Caker, Web developer,Beijing,China.

My projects

Cakephp bundle

http://macromates.com/svn/Bundles/trunk/Review/Bundles/PHP%20Cake.tmbundle/

Tags:

Filed under:default

cake-migrations

with it you can migrate your database as migrate of rails ,it’s cool !
check out more information here .
http://developingwithstyle.com/category/web-dev/php/cakephp/db-migrations/

Tags:

Filed under:default

1.2.0.7125 RC1 released!

the cakephp 1.2 realsed ,stable version coming up soon ,really good news, it’s time to build some webistes with it . maybe iphone.webcake.com is good case.

Tags:

Filed under:default

set cakephp to use utf8

for the app ,need set the
$html->charset(’utf-8′)
in your layouts file

for database, set the encoding in the database.php in the configure folder

Tags:

Filed under:Uncategorized

Class ‘Spyc’ not found when use the Migrations in cakephp

下载 了这个migrations,执行时候的时候发现提示没有找到Spyc,这里是大写的S,修改migrate.php里的vendor(‘Spyc’) 改成小写的s,修复!

Tags:

Filed under:Uncategorized

Undefined class ‘String’ when use the console of cakephp

today ,I try to learn the console of cakephp , when i ran ‘cake schema generate ‘command, i got a undefined the `String` class ,and i try to get answer to #cakephp on IRC.solution:
adding this line :
uses(’String’);
at the top of all classes in cake\libs\model\datasources\dbo_source.php ,works fine!!

Tags:

Filed under:Uncategorized

how to cakephp support utf8 ?

it’s very easily!
for 1.1 or older ,add fllowing code to the constrctor of your add_model.php in your root’s directory .
parent::__construct($id, $table, $ds);
$this->execute(”SET NAMES ‘UTF8′”);
define(’MYSQL_SET_NAMES_UTF8′, true);

for 1.2 ,so easy ,just add one line to config/database.php in your webapplication folder
‘encoding’ => ‘utf8’
like as

var $default = array(
‘driver’ => ‘mysql’,
[...]

Tags: ,

Filed under:Uncategorized

Writing a custom CakePHP console script

add these codes to a file,and put it in the vendor folder

// vendors/shells/demo.php
class DemoShell extends Shell {
function initialize() {
// empty
}
function main() {
$this->out(’Demo Script’);
$this->hr();
if (count($this->args) === 0) {
$filename = $this->in(’Please enter the filename:’);
} else {
$filename = $this->args[0];
}
$this->createFile(TMP.$filename, ‘Test content’);
}
function help() {
$this->out(’Here comes the help message’);
}
}

Tags: ,

Filed under:Uncategorized