CakePHP 和 Zend Framework 逐项比较
Wednesday, September 3, 2008 12:23:31 AM
如果您要在这两个框架间作出选择,推荐读这篇《Notes on Choosing a PHP Framework: A Comparison of CakePHP and the Zend Framework》,文章用一个表格比较了两个框架的各方面,尽管带有一些主观性,总体来说还算客观,因此是个不错的参考。
无不用其“极”
Wednesday, September 3, 2008 12:23:31 AM
Thursday, March 13, 2008 2:26:09 AM
SELECT sequence_name FROM information_schema.sequences
SELECT c.relname as sequence_name FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n WHERE c.relnamespace = n.oid AND c.relkind='S' and n.nspname = 'public'
function sequenceExists($seq) {
$cache = parent::__cacheDescription('sequences');
if($cache != null) {
return in_array($seq, $cache);
}
$sequences = array();
// ★修改这句
//$res = $this->rawQuery("SELECT sequence_name FROM information_schema.sequences");
$schema = $this->config['schema'];
$res = $this->rawQuery("SELECT c.relname as sequence_name FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n WHERE c.relnamespace = n.oid AND c.relkind='S' AND n.nspname = '{$schema}'");
while($row = $this->fetchRow($res)) {
$sequences[] = $row[0]['sequence_name'];
}
parent::__cacheDescription('sequences', $sequences);
return in_array($seq, $sequences);
}
Tuesday, March 11, 2008 6:36:09 AM
define('SITE_ID', 1);
define('SITE_ID', 2);
define('SITE_ID', 3);
<?php
class Users extends AppModel {
var $name = 'Users';
var $useTable = 'users';
var $primaryKey = 'user_id';
function settableprefix() {
if(SITE_ID == 1) {
$this->tablePrefix = 'a_';
} elseif(SITE_ID == 2) {
$this->tablePrefix = 'b_';
} elseif(SITE_ID == 3) {
$this->tablePrefix = 'c_';
}
}
}
?>
Tuesday, March 11, 2008 2:56:26 AM
<?php
class DATABASE_CONFIG {
#localhost
var $local = array('driver' => 'mysql',
'connect' => 'mysql_connect',
'host' => 'localhost',
'login' => 'root',
'password' => ",
'database' => 'local',
'prefix' => '');
#dev server
var $dev = array('driver' => 'mysql',
'connect' => 'mysql_connect',
'host' => 'mysql.dev.com',
'login' => 'dev',
'password' => 'password',
'database' => 'dev',
'prefix' => '');
#live server
var $live = array('driver' => 'mysql',
'connect' => 'mysql_connect',
'host' => 'mysql.live.com',
'login' => 'live',
'password' => 'password',
'database' => 'live',
'prefix' => ");
#switch between configs
var $default = array();
var $test = array();
function __construct() {
#wildcard the subdomains
$host_r = explode('.', $_SERVER['SERVER_NAME']);
if(count($host_r)>2) while(count($host_r)>2)array_shift($host_r);
$mainhost = implode('.', $host_r);
#switch between servers
switch(strtolower($mainhost)) {
case 'localhost':
$this->default = $this->local;
break;
case 'dev.com':
$this->default = $this->dev;
break;
case 'live.com':
$this->default = $this->live;
break;
default:
$this->default = $this->local;
}
}
#php 4 compatibility
function DATABASE_CONFIG() {
$this->__construct();
}
}
?>
Wednesday, February 27, 2008 6:09:37 AM
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
| ||||||
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | |||
书法绘画作品收藏
MSN空间
成功亦有足迹可循... ...
大理,苍山洱海,白族,风花雪月
禅语一览
有农历和节假日的日历
日本日历
美国日历
本Blog之备份
自动逐句播放的《论语》
自动逐章播放的《道德经》
给您提供二十四点答案
唐诗三百首(英汉对照)自动播放
批语用提示的方法显示的《石头记》
在线拼音输入法,面向智能手机
四大名著在线版,主要面向智能手机。
易经六十四卦
关注:php,mysql,ajax ,linux, js,开源
有用的Opera菜单
なにもあたらしくない
By Adam Li
By Satoru Watanabe
by singway
by 摸鱼儿
by Somh
by 法师
by yumumao
Maybe I was a Bird in another Life !
投放广告挣美元,可用PayPal接收付款
免费网页模板
数据表格样式收集