cakeのベース2

新規に取ってくる(クローン)

$ cd htdocs
$ rm -rf ybase/
$ git clone git@github.com:iphlox/ybase.git
Initialized empty Git repository in /Applications/MAMP/htdocs/ybase/.git/
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.
$ cd ybase/
$ ls
README
  • これでコンテンツが入ったybaseディレクトリが作られる

commit2

展開
$ cd htdocs
$ unzip cakephp-cakephp1x-fc6802b.zip 
Archive:  cakephp-cakephp1x-fc6802b.zip
edf2ea1e741a554a8de069fd17122f850b46f85e
   creating: cakephp-cakephp1x-fc6802b/
...
$ cp -r cakephp-cakephp1x-fc6802b/* ybase/
$ cp -r cakephp-cakephp1x-fc6802b/.htaccess ybase/
git管理下にする(add)
$ git add index.php 
$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	new file:   index.php
#
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modified:   README
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	.htaccess
#	app/
#	cake/
#	plugins/
#	vendors/
$ git commit -m 'index.phpを追加\nREADME更新'
[master 5b2ed44] index.phpを追加\nREADME更新
 1 files changed, 56 insertions(+), 0 deletions(-)
 create mode 100644 index.php
$ git push origin master
Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 1.11 KiB, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@github.com:iphlox/ybase.git
   04f197e..5b2ed44  master -> master
  • git commitは-mなしでviが動いてメッセージを入力できる

commit3

http://localhost/ybase/ をみるといくつかエラー
app/config/core.phpを編集
  • Security.saltに32文字のランダム文字列を設定
  • Security.cipherSeedに32桁のランダム数字を設定
app/config/database.php(defaultを外す)を編集
  • MAMP環境ではroot/rootでつながる
  • データベースは照合順序をutf8_general_ciで作っとく
	var $default = array(
		'driver' => 'mysql',
		'persistent' => false,
		'host' => 'localhost',
		'login' => 'root',
		'password' => 'root',
		'database' => 'dbname',
		'prefix' => '',
		'encoding' => 'UTF8',
	);
これでオールグリーン