2017年1月17日火曜日

Microsoft Office 2010: Primary Interop Assemblies Redistributable の使用許諾コピペ

https://www.microsoft.com/en-us/download/details.aspx?id=3508

MICROSOFT SOFTWARE LICENSE TERMS
MICROSOFT OFFICE 2010 PRIMARY INTEROP ASSEMBLIES
These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft
• updates,
• supplements,
• Internet-based services, and
• support services
for this software, unless other terms accompany those items. If so, those terms apply.
BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.
If you comply with these license terms, you have the rights below.
1. INSTALLATION AND USE RIGHTS.
• You may install and use any number of copies of the software on your devices.
• You may link directly to the 02010pia.msi file for download and use as Distributable Code as described in the available 02010PA_readme.rtf file. You agree not to disclose to third parties the location of the Distributable Code and any information contained in the 02010PA_readme.rtf file.   This information is confidential.
2. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.
a. Distributable Code. The software contains code that you are permitted to distribute in or link to for download and use as part of programs you develop if you comply with the terms below.
i. Right to Use and Distribute. The code and text files listed below are “Distributable Code.”
• O2010pia.msi file. You may copy and distribute or link to for download and use the object code form of code listed in the O2010pia.msi file.
• Third Party Distribution. You may permit distributors of your programs to copy and distribute or link to for download the Distributable Code as part of those programs.
ii. Distribution Requirements. For any Distributable Code you distribute or link to for download and use, you must
• add significant primary functionality to it in your programs;
• require distributors and external end users to agree to terms that protect it at least as much as this agreement;
• display your valid copyright notice on your programs; and
• indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ fees, related to the distribution or use of your programs.

iii. Distribution Restrictions. You may not
• alter any copyright, trademark or patent notice in the Distributable Code;
• use Microsoft’s trademarks in your programs’ names or in a way that suggests your programs come from or are endorsed by Microsoft;
• distribute or link to for download and use, Distributable Code, other than code listed in the O2010pia.msi file to run on a platform other than the Windows platform;
• include Distributable Code in malicious, deceptive or unlawful programs; or
• modify, distribute or link to for download and use the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that
• the code be disclosed or distributed in source code form; or
• others have the right to modify it.
3. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not
• work around any technical limitations in the software;
• reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation;
• make more copies of the software than specified in this agreement or allowed by applicable law, despite this limitation;
• publish the software for others to copy;
• rent, lease or lend the software;
• transfer the software or this agreement to any third party; or
• use the software for commercial software hosting services.
4. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall the software.
5. DOCUMENTATION. Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.
6. EXPORT RESTRICTIONS. The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see www.microsoft.com/exporting.
7. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it.
8. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.
9. APPLICABLE LAW.
a. United States. If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.
b. Outside the United States. If you acquired the software in any other country, the laws of that country apply.
10. LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.
11. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.

12. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
This limitation applies to
• anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and
• claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.
It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.
Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French.
Remarque : Ce logiciel étant distribué au Québec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français.
EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues.
LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.
Cette limitation concerne:
• tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et
• les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi en vigueur.
Elle s’applique également, même si Microsoft connaissait ou devrait connaître l’éventualité d’un tel dommage. Si votre pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votre égard.
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas.
EULAID:O14_RTM_PIA.2_RTM_EN
















2013年2月7日木曜日

sqlsrv_driver.php


<?php
/**
 * CodeIgniter
 *
 * An open source application development framework for PHP 5.2.4 or newer
 *
 * NOTICE OF LICENSE
 *
 * Licensed under the Open Software License version 3.0
 *
 * This source file is subject to the Open Software License (OSL 3.0) that is
 * bundled with this package in the files license.txt / license.rst.  It is
 * also available through the world wide web at this URL:
 * http://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to obtain it
 * through the world wide web, please send an email to
 * licensing@ellislab.com so we can send you a copy immediately.
 *
 * @package  CodeIgniter
 * @author  EllisLab Dev Team
 * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/)
 * @license  http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 * @link  http://codeigniter.com
 * @since  Version 2.0.3
 * @filesource
 */
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * SQLSRV Database Adapter Class
 *
 * Note: _DB is an extender class that the app controller
 * creates dynamically based on whether the query builder
 * class is being used or not.
 *
 * @package  CodeIgniter
 * @subpackage Drivers
 * @category Database
 * @author  EllisLab Dev Team
 * @link  http://codeigniter.com/user_guide/database/
 */
class CI_DB_sqlsrv_driver extends CI_DB {

 /**
  * Database driver
  *
  * @var string
  */
 public $dbdriver = 'sqlsrv';

 // --------------------------------------------------------------------

 /**
  * ORDER BY random keyword
  *
  * @var array
  */
 protected $_random_keyword = array('NEWID()', 'RAND(%d)');

 /**
  * Quoted identifier flag
  *
  * Whether to use SQL-92 standard quoted identifier
  * (double quotes) or brackets for identifier escaping.
  *
  * @var bool
  */
 protected $_quoted_identifier = TRUE;

 // --------------------------------------------------------------------

 /**
  * Database connection
  *
  * @param bool $pooling
  * @return resource
  */
 public function db_connect($pooling = FALSE)
 {
  $charset = in_array(strtolower($this->char_set), array('utf-8', 'utf8'), TRUE)
   ? 'UTF-8' : SQLSRV_ENC_CHAR;

  $connection = array(
   'UID'   => empty($this->username) ? '' : $this->username,
   'PWD'   => empty($this->password) ? '' : $this->password,
   'Database'  => $this->database,
   'ConnectionPooling' => ($pooling === TRUE) ? 1 : 0,
   'CharacterSet'  => $charset,
   'Encrypt'  => ($this->encrypt === TRUE) ? 1 : 0,
   'ReturnDatesAsStrings' => 1
  );

  // If the username and password are both empty, assume this is a
  // 'Windows Authentication Mode' connection.
  if (empty($connection['UID']) && empty($connection['PWD']))
  {
   unset($connection['UID'], $connection['PWD']);
  }

  $this->conn_id = sqlsrv_connect($this->hostname, $connection);

  // Determine how identifiers are escaped
  $query = $this->query('SELECT CASE WHEN (@@OPTIONS | 256) = @@OPTIONS THEN 1 ELSE 0 END AS qi');
  $query = $query->row_array();
  $this->_quoted_identifier = empty($query) ? FALSE : (bool) $query['qi'];
  $this->_escape_char = ($this->_quoted_identifier) ? '"' : array('[', ']');

  return $this->conn_id;
 }

 // --------------------------------------------------------------------

 /**
  * Persistent database connection
  *
  * @return resource
  */
 public function db_pconnect()
 {
  return $this->db_connect(TRUE);
 }

 // --------------------------------------------------------------------

 /**
  * Select the database
  *
  * @param string $database
  * @return bool
  */
 public function db_select($database = '')
 {
  if ($database === '')
  {
   $database = $this->database;
  }

  if ($this->_execute('USE '.$this->escape_identifiers($database)))
  {
   $this->database = $database;
   return TRUE;
  }

  return FALSE;
 }

 // --------------------------------------------------------------------

 /**
  * Execute the query
  *
  * @param string $sql an SQL query
  * @return resource
  */
 protected function _execute($sql)
 {
  return ($this->is_write_type($sql) && stripos($sql, 'INSERT') === FALSE)
   ? sqlsrv_query($this->conn_id, $sql)
   : sqlsrv_query($this->conn_id, $sql, NULL, array('Scrollable' => SQLSRV_CURSOR_STATIC));
 }

 // --------------------------------------------------------------------

 /**
  * Begin Transaction
  *
  * @param bool $test_mode
  * @return bool
  */
 public function trans_begin($test_mode = FALSE)
 {
  // When transactions are nested we only begin/commit/rollback the outermost ones
  if ( ! $this->trans_enabled OR $this->_trans_depth > 0)
  {
   return TRUE;
  }

  // Reset the transaction failure flag.
  // If the $test_mode flag is set to TRUE transactions will be rolled back
  // even if the queries produce a successful result.
  $this->_trans_failure = ($test_mode === TRUE);

  return sqlsrv_begin_transaction($this->conn_id);
 }

 // --------------------------------------------------------------------

 /**
  * Commit Transaction
  *
  * @return bool
  */
 public function trans_commit()
 {
  // When transactions are nested we only begin/commit/rollback the outermost ones
  if ( ! $this->trans_enabled OR $this->_trans_depth > 0)
  {
   return TRUE;
  }

  return sqlsrv_commit($this->conn_id);
 }

 // --------------------------------------------------------------------

 /**
  * Rollback Transaction
  *
  * @return bool
  */
 public function trans_rollback()
 {
  // When transactions are nested we only begin/commit/rollback the outermost ones
  if ( ! $this->trans_enabled OR $this->_trans_depth > 0)
  {
   return TRUE;
  }

  return sqlsrv_rollback($this->conn_id);
 }

 // --------------------------------------------------------------------

 /**
  * Affected Rows
  *
  * @return int
  */
 public function affected_rows()
 {
  return sqlsrv_rows_affected($this->result_id);
 }

 // --------------------------------------------------------------------

 /**
  * Insert ID
  *
  * Returns the last id created in the Identity column.
  *
  * @return string
  */
 public function insert_id()
 {
  $query = $this->query('SELECT @@IDENTITY AS insert_id');
  $query = $query->row();
  return $query->insert_id;
 }

 // --------------------------------------------------------------------

 /**
  * Database version number
  *
  * @return string
  */
 public function version()
 {
  if (isset($this->data_cache['version']))
  {
   return $this->data_cache['version'];
  }
  elseif ( ! $this->conn_id)
  {
   $this->initialize();
  }

  if ( ! $this->conn_id OR ($info = sqlsrv_server_info($this->conn_id)) === FALSE)
  {
   return FALSE;
  }

  return $this->data_cache['version'] = $info['SQLServerVersion'];
 }

 // --------------------------------------------------------------------

 /**
  * List table query
  *
  * Generates a platform-specific query string so that the table names can be fetched
  *
  * @param bool
  * @return string $prefix_limit
  */
 protected function _list_tables($prefix_limit = FALSE)
 {
  $sql = 'SELECT '.$this->escape_identifiers('name')
   .' FROM '.$this->escape_identifiers('sysobjects')
   .' WHERE '.$this->escape_identifiers('type')." = 'U'";

  if ($prefix_limit === TRUE && $this->dbprefix !== '')
  {
   $sql .= ' AND '.$this->escape_identifiers('name')." LIKE '".$this->escape_like_str($this->dbprefix)."%' "
    .sprintf($this->_escape_like_str, $this->_escape_like_chr);
  }

  return $sql.' ORDER BY '.$this->escape_identifiers('name');
 }

 // --------------------------------------------------------------------

 /**
  * List column query
  *
  * Generates a platform-specific query string so that the column names can be fetched
  *
  * @param string $table
  * @return string
  */
 protected function _list_columns($table = '')
 {
  return 'SELECT COLUMN_NAME
   FROM INFORMATION_SCHEMA.Columns
   WHERE UPPER(TABLE_NAME) = '.$this->escape(strtoupper($table));
 }

 // --------------------------------------------------------------------

 /**
  * Returns an object with field data
  *
  * @param string $table
  * @return array
  */
 public function field_data($table = '')
 {
  if ($table === '')
  {
   return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
  }

  $sql = 'SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION, COLUMN_DEFAULT
   FROM INFORMATION_SCHEMA.Columns
   WHERE UPPER(TABLE_NAME) = '.$this->escape(strtoupper($table));

  if (($query = $this->query($sql)) === FALSE)
  {
   return FALSE;
  }
  $query = $query->result_object();

  $retval = array();
  for ($i = 0, $c = count($query); $i < $c; $i++)
  {
   $retval[$i]   = new stdClass();
   $retval[$i]->name  = $query[$i]->COLUMN_NAME;
   $retval[$i]->type  = $query[$i]->DATA_TYPE;
   $retval[$i]->max_length  = ($query[$i]->CHARACTER_MAXIMUM_LENGTH > 0) ? $query[$i]->CHARACTER_MAXIMUM_LENGTH : $query[$i]->NUMERIC_PRECISION;
   $retval[$i]->default  = $query[$i]->COLUMN_DEFAULT;
  }

  return $retval;
 }

 // --------------------------------------------------------------------

 /**
  * Error
  *
  * Returns an array containing code and message of the last
  * database error that has occured.
  *
  * @return array
  */
 public function error()
 {
  $error = array('code' => '00000', 'message' => '');
  $sqlsrv_errors = sqlsrv_errors(SQLSRV_ERR_ERRORS);

  if ( ! is_array($sqlsrv_errors))
  {
   return $error;
  }

  $sqlsrv_error = array_shift($sqlsrv_errors);
  if (isset($sqlsrv_error['SQLSTATE']))
  {
   $error['code'] = isset($sqlsrv_error['code']) ? $sqlsrv_error['SQLSTATE'].'/'.$sqlsrv_error['code'] : $sqlsrv_error['SQLSTATE'];
  }
  elseif (isset($sqlsrv_error['code']))
  {
   $error['code'] = $sqlsrv_error['code'];
  }

  if (isset($sqlsrv_error['message']))
  {
   $error['message'] = $sqlsrv_error['message'];
  }

  return $error;
 }

 // --------------------------------------------------------------------

 /**
  * Update statement
  *
  * Generates a platform-specific update string from the supplied data
  *
  * @param string $table
  * @param array $values
  * @return string
  */
 protected function _update($table, $values)
 {
  $this->qb_limit = FALSE;
  $this->qb_orderby = array();
  return parent::_update($table, $values);
 }

 // --------------------------------------------------------------------

 /**
  * Truncate statement
  *
  * Generates a platform-specific truncate string from the supplied data
  *
  * If the database does not support the TRUNCATE statement,
  * then this method maps to 'DELETE FROM table'
  *
  * @param string $table
  * @return string
  */
 protected function _truncate($table)
 {
  return 'TRUNCATE TABLE '.$table;
 }

 // --------------------------------------------------------------------

 /**
  * Delete statement
  *
  * Generates a platform-specific delete string from the supplied data
  *
  * @param string $table
  * @return string
  */
 protected function _delete($table)
 {
  if ($this->qb_limit)
  {
   return 'WITH ci_delete AS (SELECT TOP '.$this->qb_limit.' * FROM '.$table.$this->_compile_wh('qb_where').') DELETE FROM ci_delete';
  }

  return parent::_delete($table);
 }

 // --------------------------------------------------------------------

 /**
  * LIMIT
  *
  * Generates a platform-specific LIMIT clause
  *
  * @param string $sql SQL Query
  * @return string
  */
 protected function _limit($sql)
 {
  // As of SQL Server 2012 (11.0.*) OFFSET is supported
  if (version_compare($this->version(), '11', '>='))
  {
   return $sql.' OFFSET '.(int) $this->qb_offset.' ROWS FETCH NEXT '.$this->qb_limit.' ROWS ONLY';
  }

  $limit = $this->qb_offset + $this->qb_limit;

  // An ORDER BY clause is required for ROW_NUMBER() to work
  if ($this->qb_offset && ! empty($this->qb_orderby))
  {
   $orderby = $this->_compile_order_by();

   // We have to strip the ORDER BY clause
   $sql = trim(substr($sql, 0, strrpos($sql, $orderby)));

   // Get the fields to select from our subquery, so that we can avoid CI_rownum appearing in the actual results
   if (count($this->qb_select) === 0)
   {
    $select = '*'; // Inevitable
   }
   else
   {
    // Use only field names and their aliases, everything else is out of our scope.
    $select = array();
    $field_regexp = ($this->_quoted_identifier)
     ? '("[^\"]+")' : '(\[[^\]]+\])';
    for ($i = 0, $c = count($this->qb_select); $i < $c; $i++)
    {
     $select[] = preg_match('/(?:\s|\.)'.$field_regexp.'$/i', $this->qb_select[$i], $m)
      ? $m[1] : $this->qb_select[$i];
    }
    $select = implode(', ', $select);
   }

   return 'SELECT '.$select." FROM (\n\n"
    .preg_replace('/^(SELECT( DISTINCT)?)/i', '\\1 ROW_NUMBER() OVER('.trim($orderby).') AS '.$this->escape_identifiers('CI_rownum').', ', $sql)
    ."\n\n) ".$this->escape_identifiers('CI_subquery')
    ."\nWHERE ".$this->escape_identifiers('CI_rownum').' BETWEEN '.($this->qb_offset + 1).' AND '.$limit;
  }

  return preg_replace('/(^\SELECT (DISTINCT)?)/i','\\1 TOP '.$limit.' ', $sql);
 }

 // --------------------------------------------------------------------

 /**
  * Insert batch statement
  *
  * Generates a platform-specific insert string from the supplied data.
  *
  * @param string $table Table name
  * @param array $keys INSERT keys
  * @param array $values INSERT values
  * @return string|bool
  */
 protected function _insert_batch($table, $keys, $values)
 {
  // Multiple-value inserts are only supported as of SQL Server 2008
  if (version_compare($this->version(), '10', '>='))
  {
   return parent::_insert_batch($table, $keys, $values);
  }

  return ($this->db->db_debug) ? $this->db->display_error('db_unsupported_feature') : FALSE;
 }

 // --------------------------------------------------------------------

 /**
  * Close DB Connection
  *
  * @return void
  */
 protected function _close()
 {
  @sqlsrv_close($this->conn_id);
 }

}

/* End of file sqlsrv_driver.php */
/* Location: ./system/database/drivers/sqlsrv/sqlsrv_driver.php */

2013年1月27日日曜日

[SQL Server 2008 R2] Windows XP にインストール

お疲れ様です。作業の記録。上から順番に。

Windows Installer 4.5 Redistributable - 日本語
http://www.microsoft.com/ja-jp/download/details.aspx?id=8483
WindowsXP-KB942288-v3-x86.exe
  • EULAはインストールの途中で表示される。
  • インストール後にOSの再起動が必要。
.NET Framework 3.5 SP1
これも前提だけど既にインストール済みだった。ので飛ばす。

Windows PowerShell 2.0
Windows XP 用更新プログラム (KB968930)
http://www.microsoft.com/ja-jp/download/details.aspx?id=16818
WindowsXP-KB968930-x86-JPN.exe

  • この中に Windows PowerShell 2.0 が入っている。
  • SQL Server Management Studio Express の前提になっている。1.0でもいいみたい。

Microsoft SQL Server 2008 R2 RTM - Express with Management Tools
http://www.microsoft.com/ja-jp/download/details.aspx?id=23650
SQLEXPRWT_x86_JPN.exe

ダウンロード

[ダウンロード]ボタンが無く、[続行]ボタンになっている場合
  1. [続行]をクリック。
  2. 「いいえ、登録はしません。すぐにダウンロードします。」を選択して[続行]をクリック。
  3. SQLEXPRWT_x86_JPN.exe の[ダウンロード]をクリック。
インストール

「新規インストールを実行するか、既存のインストールに機能を追加します。」を選択。
EULAはインストールの途中で表示される。
「機能の選択」では「SQL Server レプリケーション」を不要と判断。外す。
「サーバの構成」

「SQL Server Database Engine」のところはこうした。

「データベース エンジンの構成」
「認証モード」のところはこうした。
無事にインストールできたみたい。
OSの再起動は不要だったけど、再起動した。
追加されたサービスが自動で上がって来るので、今は手動にしておいた。

おわり


今回参考にさせていただいたページ:
SQL Server 2008 R2 Express Edition のインストール
http://awoni.net/fc/sql-server-2008-express/


2012年9月1日土曜日

[phpunit] DbUnitをオフラインインストール


前回からの続きでPHPUnitにDbUnitを追加します。
事情あってオフラインインストールです。

チャネルをブラウザで開く。
http://pear.phpunit.de/

DbUnit 1.1.2 (stable) をダウンロードする。
http://pear.phpunit.de/get/DbUnit-1.1.2.tgz

コマンド叩く。
前回からの続きなのでpear config-setが済んでいる前提で。

---
J:\>path %path%;C:\Program Files\BitNami WAMPStack\php

J:\>pear install --offline J:\software\phpunit\DbUnit-1.1.2.tgz
install ok: channel://pear.phpunit.de/DbUnit-1.1.2

J:\>pear list -c pear.phpunit.de
INSTALLED PACKAGES, CHANNEL PEAR.PHPUNIT.DE:
============================================
PACKAGE            VERSION STATE
DbUnit             1.1.2   stable
File_Iterator      1.3.1   stable
PHPUnit            3.6.11  stable
PHPUnit_MockObject 1.1.1   stable
PHP_CodeCoverage   1.1.3   stable
PHP_Timer          1.0.2   stable
PHP_TokenStream    1.1.3   stable
Text_Template      1.1.1   stable

J:\>
---

おわり。

2012年8月21日火曜日

[phpdoc] phpdocumentor2 の abstract テンプレートを ie8 向けに調整


おはようございます。

とりあえずこうしたら直りました。

{php-install-dir}\PEAR\phpDocumentor\data\templates\abstract\css\template.css
に以下を追加して、ドキュメントを再生成します。
---
td#db-header,
td#db-menu,
td#db-footer {
    height:1em;
}
---

ちなみにie8はsvgのレンダリングをサポートしていないようなので、
クラス図を表示することはできません。

ではまた。

2012年7月25日水曜日

[phpdoc] phpdocumentor2 のテンプレート


おつかれさまです。

phpdocumentor2のテンプレートを好みのものにしたいと思います。

有効なテンプレート
-----------------------------------------------------
phpdocumentor2に同梱されているテンプレートは以下のコマンドでわかります。

> phpdoc template:list
Available templates:
* abstract
* new-black
* responsive
* zend

4つありました。

テンプレートを指定する
-----------------------------------------------------
例えばabstractテンプレートを使って生成する場合はこうします。

> path %path%;C:\Program Files\BitNami WAMPStack\php
> path %path%;C:\Program Files\Graphviz 2.28\bin
> set PHP_PEAR_BIN_DIR=C:\Program Files\BitNami WAMPStack\php
> cd C:\Program Files\BitNami WAMPStack\frameworks\codeigniter
phpdoc -d . -t output-abstract --template=abstract

ドキュメントの生成結果
-----------------------------------------------------
abstract テンプレート



new-black テンプレート



responsive テンプレート


zend テンプレート

オレどれにしよう
-----------------------------------------------------
  • abstract 無難。特に不満なし。採用
  • new-black クリックしないと開かないとか面倒。不採用。
  • responsive 同上。
  • zend ブラウザの最低幅があって結構場所とる。abstractはそれが無い。

END

[phpdoc] phpdocインストール

おつかれさまです。

前提
------------------------------------------------------------
  • bitnami wamp stack 環境で。
  • pearによるオフラインでのインストール。

pearチャネル追加
------------------------------------------------------------
http://pear.phpdoc.org/channel.xml を保存する。(channel_phpdoc.xml)

パッケージ取得
------------------------------------------------------------
http://pear.phpdoc.org/get/phpDocumentor-2.0.0a8.tgz

インストール
------------------------------------------------------------
path %path%;C:\Program Files\BitNami WAMPStack\php
pear config-set doc_dir "C:\Program Files\BitNami WAMPStack\php\PEAR\docs"
pear config-set data_dir "C:\Program Files\BitNami WAMPStack\php\PEAR\data"
pear config-set test_dir "C:\Program Files\BitNami WAMPStack\php\PEAR\tests"
j:
cd software\phpdoc
pear channel-add channel_phpdoc.xml
pear install --offline phpDocumentor-2.0.0a8.tgz

実行結果
------------------------------------------------------------
phpdoc/phpDocumentor can optionally use package "pear/PEAR_PackageFileManager2
(version >= 1.0.2)
install ok: channel://pear.phpdoc.org/phpDocumentor-2.0.0a8

最後のpear installは時間が掛かります。

GraphVizインストール
------------------------------------------------------------
http://graphviz.org/
の以下から graphviz-2.28.0.msi を配布している。
http://graphviz.org/Download_windows.php
これは Class inheritanse diagram の生成に使われる。

php.ini変更
------------------------------------------------------------
以下を有効にする。
---
extension=php_xsl.dll
---

ドキュメント生成
------------------------------------------------------------
path %path%;C:\Program Files\BitNami WAMPStack\php
path %path%;C:\Program Files\Graphviz 2.28\bin
set PHP_PEAR_BIN_DIR=C:\Program Files\BitNami WAMPStack\php
cd C:\Program Files\BitNami WAMPStack\frameworks\codeigniter
phpdoc -d .

感想
------------------------------------------------------------
見栄えかっこいいけど、いちいちclickさせるUIは残念。
javadoc風にスキンを変えたい。そのあたりは今後。

END