Akelos で開発記 3
myproject/config/config.php を設定する。
チュートリアルでは、ブラウザ上から config.php を生成していたが、既存の DEFAULT-config.php から設定をする。
% cd ~/works/myproject/trunk/config/
% cp DEFAULT-config.php config.php
% vi config.php
データベースの設定変更前
<?php $database_settings = array( 'production' => array( 'type' => 'mysql', // mysql, sqlite or pgsql 'database_file' => '/home/bermi/database.sqlite', // you only need this for SQLite 'host' => 'localhost', 'port' => '', 'database_name' => '', 'user' => '', 'password' => '', 'options' => '' // persistent, debug, fetchmode, new ), 'development' => array( 'type' => 'mysql', 'database_file' => '', 'host' => 'localhost', 'port' => '', 'database_name' => '', 'user' => '', 'password' => '', 'options' => '' ), 'testing' => array( 'type' => 'mysql', 'database_file' => '', 'host' => 'localhost', 'port' => '', 'database_name' => '', 'user' => '', 'password' => '', 'options' => '' ) );
データベースの設定変更後
<?php $database_settings = array( 'production' => array( 'type' => 'mysql', // mysql, sqlite or pgsql 'database_file' => '', // you only need this for SQLite 'host' => 'localhost', 'port' => '', 'database_name' => 'myproject', 'user' => 'yourname', 'password' => 'yourpassword', 'options' => '', // persistent, debug, fetchmode, new ), 'development' => array( 'type' => 'mysql', 'database_file' => '', 'host' => 'localhost', 'port' => '', 'database_name' => 'myproject_dev', 'user' => 'yourname', 'password' => 'yourpassword', 'options' => '', ), 'testing' => array( 'type' => 'mysql', 'database_file' => '', 'host' => 'localhost', 'port' => '', 'database_name' => 'myproject_tests', 'user' => 'yourname', 'password' => 'yourpassword', 'options' => '', ) );
Akelos の設定変更前
$ftp_settings = ''; // Current environment. Options are: development, testing and production defined('AK_ENVIRONMENT') ? null : define('AK_ENVIRONMENT', 'development'); defined('AK_FRAMEWORK_DIR') ? null : define('AK_FRAMEWORK_DIR', '/Users/naotaka/akelos'); include_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'boot.php');
Akelos の設定変更後
$ftp_settings = ''; defined('AK_ENVIRONMENT') ? null : define('AK_ENVIRONMENT', 'development'); define('AK_AVAILABLE_LOCALES', 'en,ja_jp'); define('AK_ACTIVE_RECORD_DEFAULT_LOCALES', 'en,ja_jp'); define('AK_APP_LOCALES', 'en,ja_jp'); define('AK_PUBLIC_LOCALES', 'en,ja_jp'); defined('AK_FRAMEWORK_DIR') ? null : define('AK_FRAMEWORK_DIR', '/home/littlebuddha/akelos'); include_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'boot.php');
言語に関する設定
すでにチュートリアルを行っていることが前提として、
%cp チュートリアルで作成したアプリケーション/config/locales/ja_jp.php myproject/config/locales/ja_jp.php %cp チュートリアルで作成したアプリケーション/config/routes.php myproject/config/routes.php
と行う。
ブラウザで他に生成されているファイルはないと思うが、万が一のことを考えると、ブラウザから設定を行った方が、トラブルを避ける意味でよさそう。