• []
  • []
  •  
  • del.icio.us 
  •  
  • Yahoo!֥åޡϿ 

CakePHPのプロジェクトを作成する

PHP 求人 募集 Symfony CakePHP Smarty Ruby on Rails

プロジェクトとは?

フレームワークとはシステムの一番根幹に相当するプログラム。
対してプロジェクトはアプリケーション毎のコアプログラムと言うべきか。
例えば、メインサイト、管理サイトなどの単位でシステムの区切りを作るようなもの。

以下はプロジェクト名を[testproject]としている。

プロジェクト作成

$ php cake/scripts/bake.php testproject
Look okay? (y/n/q) 
[y] > (Enter)
Do you want verbose output? (y/n) 
[n] > (Enter)  

基本設定

データベースなどの基本設定を行う。
コマンドは先ほどと同じ。
自身の用意したデータベースとその設定を記述する
あと、同じ流れでM/V/Cとそのテストの作成とも問い合わされる。
とりあえず、Controllerが必要なので作っておく。

$ php cake/scripts/bake.php testproject
---------------------------------------------------------------
Database Configuration:
---------------------------------------------------------------
What database driver would you like to use? (mysql/mysqli/mssql/sqlite/postgres/odbc)
[mysql] >
What is the hostname for the database server?
[localhost] > 
What is the database username?
[root] >
What is the database password?
>
The password you supplied was empty. Use an empty password? (y/n)
[n] > 
What is the name of the database you will be using?
[cake] >
Enter a table prefix?
[n] >
Look okay? (y/n)      
[y] > y               
Creating file /path/to/cakephp/demoapp/config/database.php
Wrote /path/to/cakephp/demoapp/config/database.php


[M]odel               
[C]ontroller          
[V]iew                
What would you like to Bake? (M/V/C)
> C                   
---------------------------------------------------------------
Controller Bake:      
---------------------------------------------------------------
Possible Controllers based on your current database:
                      
Enter a number from the list above, or type in the name of another controller.
> Posts               
                      
Would you like bake to build your controller interactively?
Warning: Choosing no will overwrite  controller if it exist. (y/n)
[y] > y               
                      
Would you like to use scaffolding? (y/n)
[y] >                 
                      
---------------------------------------------------------------
The following controller will be created:
---------------------------------------------------------------
Controller Name:        Posts
                        var $scaffold;
---------------------------------------------------------------
                      
Look okay? (y/n)      
[y] >                 
                      
Creating file /path/to/cakephp/demoapp/controllers/posts_controller.php
Wrote/path/to/cakephp/demoapp/controllers/posts_controller.php
                      
Cake test suite not installed.  Do you want to bake unit test files anyway? (y/n)
[y] >                 
                      
You can download the Cake test suite from http://cakeforge.org/projects/testsuite/
Baking unit test for Posts...
                      
Unit test directory does not exist.  Create it? (y/n)
[y] >                 

framework/cakephp/プロジェクト作成.txt · 最終更新: 2007/05/26 15:38 (外部編集)