Skip to content

Commit

Permalink
Merge branch '2.0' of github.com:cakephp/cakephp into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ceeram committed Dec 1, 2011
2 parents 0a1772c + 95e8f1d commit faddfbe
Show file tree
Hide file tree
Showing 87 changed files with 489 additions and 481 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Cache/Cache.php
Expand Up @@ -387,7 +387,7 @@ public static function decrement($key, $offset = 1, $config = 'default') {
$settings = self::settings($config);

if (empty($settings)) {
return null;
return false;
}
if (!self::isInitialized($config)) {
return false;
Expand Down Expand Up @@ -505,7 +505,7 @@ abstract class CacheEngine {
*/
public function init($settings = array()) {
$this->settings = array_merge(
array('prefix' => 'cake_', 'duration'=> 3600, 'probability'=> 100),
array('prefix' => 'cake_', 'duration' => 3600, 'probability' => 100),
$this->settings,
$settings
);
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Cache/Engine/FileEngine.php
Expand Up @@ -66,8 +66,8 @@ class FileEngine extends CacheEngine {
public function init($settings = array()) {
parent::init(array_merge(
array(
'engine' => 'File', 'path' => CACHE, 'prefix'=> 'cake_', 'lock'=> true,
'serialize'=> true, 'isWindows' => false, 'mask' => 0664
'engine' => 'File', 'path' => CACHE, 'prefix' => 'cake_', 'lock' => true,
'serialize' => true, 'isWindows' => false, 'mask' => 0664
),
$settings
));
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Cache/Engine/MemcacheEngine.php
Expand Up @@ -59,10 +59,10 @@ public function init($settings = array()) {
return false;
}
parent::init(array_merge(array(
'engine'=> 'Memcache',
'engine' => 'Memcache',
'prefix' => Inflector::slug(APP_DIR) . '_',
'servers' => array('127.0.0.1'),
'compress'=> false,
'compress' => false,
'persistent' => true
), $settings)
);
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Console/Command/ConsoleShell.php
Expand Up @@ -117,7 +117,7 @@ public function help() {
$out .= "\n";
$out .= "will return something like the following:";
$out .= "\n";
$out .= "\tarray (";
$out .= "\tarray(";
$out .= "\t [...]";
$out .= "\t 'controller' => 'posts',";
$out .= "\t 'action' => 'view',";
Expand Down
16 changes: 8 additions & 8 deletions lib/Cake/Console/Command/Task/DbConfigTask.php
Expand Up @@ -39,14 +39,14 @@ class DbConfigTask extends AppShell {
*/
protected $_defaultConfig = array(
'name' => 'default',
'datasource'=> 'Database/Mysql',
'persistent'=> 'false',
'host'=> 'localhost',
'login'=> 'root',
'password'=> 'password',
'database'=> 'project_name',
'schema'=> null,
'prefix'=> null,
'datasource' => 'Database/Mysql',
'persistent' => 'false',
'host' => 'localhost',
'login' => 'root',
'password' => 'password',
'database' => 'project_name',
'schema' => null,
'prefix' => null,
'encoding' => null,
'port' => null
);
Expand Down
16 changes: 8 additions & 8 deletions lib/Cake/Console/Command/Task/ModelTask.php
Expand Up @@ -220,13 +220,13 @@ protected function _interactive() {
}

$prompt = __d('cake_console', "Would you like to supply validation criteria \nfor the fields in your model?");
$wannaDoValidation = $this->in($prompt, array('y','n'), 'y');
$wannaDoValidation = $this->in($prompt, array('y', 'n'), 'y');
if (array_search($useTable, $this->_tables) !== false && strtolower($wannaDoValidation) == 'y') {
$validate = $this->doValidation($tempModel);
}

$prompt = __d('cake_console', "Would you like to define model associations\n(hasMany, hasOne, belongsTo, etc.)?");
$wannaDoAssoc = $this->in($prompt, array('y','n'), 'y');
$wannaDoAssoc = $this->in($prompt, array('y', 'n'), 'y');
if (strtolower($wannaDoAssoc) == 'y') {
$associations = $this->doAssociations($tempModel);
}
Expand Down Expand Up @@ -258,7 +258,7 @@ protected function _interactive() {
}

$this->hr();
$looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y','n'), 'y');
$looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y', 'n'), 'y');

if (strtolower($looksGood) == 'y') {
$vars = compact('associations', 'validate', 'primaryKey', 'useTable', 'displayField');
Expand Down Expand Up @@ -487,7 +487,7 @@ public function doAssociations($model) {
}

$associations = array(
'belongsTo' => array(), 'hasMany' => array(), 'hasOne'=> array(), 'hasAndBelongsToMany' => array()
'belongsTo' => array(), 'hasMany' => array(), 'hasOne' => array(), 'hasAndBelongsToMany' => array()
);

$associations = $this->findBelongsTo($model, $associations);
Expand Down Expand Up @@ -636,7 +636,7 @@ public function confirmAssociations($model, $associations) {
if (!empty($associations[$type])) {
foreach ($associations[$type] as $i => $assoc) {
$prompt = "{$model->name} {$type} {$assoc['alias']}?";
$response = $this->in($prompt, array('y','n'), 'y');
$response = $this->in($prompt, array('y', 'n'), 'y');

if ('n' == strtolower($response)) {
unset($associations[$type][$i]);
Expand All @@ -659,7 +659,7 @@ public function confirmAssociations($model, $associations) {
*/
public function doMoreAssociations($model, $associations) {
$prompt = __d('cake_console', 'Would you like to define some additional model associations?');
$wannaDoMoreAssoc = $this->in($prompt, array('y','n'), 'n');
$wannaDoMoreAssoc = $this->in($prompt, array('y', 'n'), 'n');
$possibleKeys = $this->_generatePossibleKeys();
while (strtolower($wannaDoMoreAssoc) == 'y') {
$assocs = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
Expand Down Expand Up @@ -711,7 +711,7 @@ public function doMoreAssociations($model, $associations) {
$associations[$assocs[$assocType]][$i]['associationForeignKey'] = $associationForeignKey;
$associations[$assocs[$assocType]][$i]['joinTable'] = $joinTable;
}
$wannaDoMoreAssoc = $this->in(__d('cake_console', 'Define another association?'), array('y','n'), 'y');
$wannaDoMoreAssoc = $this->in(__d('cake_console', 'Define another association?'), array('y', 'n'), 'y');
}
return $associations;
}
Expand Down Expand Up @@ -833,7 +833,7 @@ public function getTable($modelName, $useDbConfig = null) {
if (array_search($useTable, $this->_tables) === false) {
$this->out();
$this->out(__d('cake_console', "Given your model named '%s',\nCake would expect a database table named '%s'", $modelName, $fullTableName));
$tableIsGood = $this->in(__d('cake_console', 'Do you want to use this table?'), array('y','n'), 'y');
$tableIsGood = $this->in(__d('cake_console', 'Do you want to use this table?'), array('y', 'n'), 'y');
}
if (strtolower($tableIsGood) == 'n') {
$useTable = $this->in(__d('cake_console', 'What is the name of the table?'));
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Console/Command/Task/ProjectTask.php
Expand Up @@ -62,7 +62,7 @@ public function execute() {
$response = false;
while ($response == false && is_dir($project) === true && file_exists($project . 'Config' . 'core.php')) {
$prompt = __d('cake_console', '<warning>A project already exists in this location:</warning> %s Overwrite?', $project);
$response = $this->in($prompt, array('y','n'), 'n');
$response = $this->in($prompt, array('y', 'n'), 'n');
if (strtolower($response) === 'n') {
$response = $project = false;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Console/Command/Task/TestTask.php
Expand Up @@ -402,7 +402,7 @@ protected function _addFixture($name) {
* @return array Array of fixtures the user wants to add.
*/
public function getUserFixtures() {
$proceed = $this->in(__d('cake_console', 'Bake could not detect fixtures, would you like to add some?'), array('y','n'), 'n');
$proceed = $this->in(__d('cake_console', 'Bake could not detect fixtures, would you like to add some?'), array('y', 'n'), 'n');
$fixtures = array();
if (strtolower($proceed) == 'y') {
$fixtureList = $this->in(__d('cake_console', "Please provide a comma separated list of the fixtures names you'd like to use.\nExample: 'app.comment, app.post, plugin.forums.post'"));
Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/Console/Command/Task/ViewTask.php
Expand Up @@ -215,9 +215,9 @@ protected function _interactive() {
}

$prompt = __d('cake_console', "Would you like to create some CRUD views\n(index, add, view, edit) for this controller?\nNOTE: Before doing so, you'll need to create your controller\nand model classes (including associated models).");
$wannaDoScaffold = $this->in($prompt, array('y','n'), 'y');
$wannaDoScaffold = $this->in($prompt, array('y', 'n'), 'y');

$wannaDoAdmin = $this->in(__d('cake_console', "Would you like to create the views for admin routing?"), array('y','n'), 'n');
$wannaDoAdmin = $this->in(__d('cake_console', "Would you like to create the views for admin routing?"), array('y', 'n'), 'n');

if (strtolower($wannaDoScaffold) == 'y' || strtolower($wannaDoAdmin) == 'y') {
$vars = $this->_loadController();
Expand Down Expand Up @@ -292,7 +292,7 @@ protected function _loadController() {
$pluralHumanName = $this->_pluralHumanName($this->controllerName);

return compact('modelClass', 'schema', 'primaryKey', 'displayField', 'singularVar', 'pluralVar',
'singularHumanName', 'pluralHumanName', 'fields','associations');
'singularHumanName', 'pluralHumanName', 'fields', 'associations');
}

/**
Expand Down Expand Up @@ -330,7 +330,7 @@ public function customAction() {
$this->out(__d('cake_console', 'Action Name: %s', $action));
$this->out(__d('cake_console', 'Path: %s', $this->getPath() . $this->controllerName . DS . Inflector::underscore($action) . ".ctp"));
$this->hr();
$looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y','n'), 'y');
$looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y', 'n'), 'y');
if (strtolower($looksGood) == 'y') {
$this->bake($action, ' ');
$this->_stop();
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Console/Command/UpgradeShell.php
Expand Up @@ -764,7 +764,7 @@ public function getOptionParser() {
'help' => __d('cake_console', 'Use git command for moving files around.'),
'boolean' => true
),
'dry-run'=> array(
'dry-run' => array(
'short' => 'd',
'help' => __d('cake_console', 'Dry run the update, no files will actually be modified.'),
'boolean' => true
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Console/Shell.php
Expand Up @@ -366,7 +366,7 @@ public function runCommand($command, $argv) {
return $this->_displayHelp($command);
}

if (($isTask || $isMethod || $isMain) && $command !== 'execute' ) {
if (($isTask || $isMethod || $isMain) && $command !== 'execute') {
$this->startup();
}

Expand Down Expand Up @@ -672,7 +672,7 @@ protected function _checkUnitTest() {
return true;
}
$prompt = __d('cake_console', 'PHPUnit is not installed. Do you want to bake unit test files anyway?');
$unitTest = $this->in($prompt, array('y','n'), 'y');
$unitTest = $this->in($prompt, array('y', 'n'), 'y');
$result = strtolower($unitTest) == 'y' || strtolower($unitTest) == 'yes';

if ($result) {
Expand Down
Expand Up @@ -143,7 +143,7 @@
if ($this-><?php echo $currentModelName; ?>->delete()) {
<?php if ($wannaUseSession): ?>
$this->Session->setFlash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted'));
$this->redirect(array('action'=>'index'));
$this->redirect(array('action' => 'index'));
<?php else: ?>
$this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted'), array('action' => 'index'));
<?php endif; ?>
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Console/Templates/default/classes/controller.ctp
Expand Up @@ -50,7 +50,7 @@ class <?php echo $controllerName; ?>Controller extends <?php echo $plugin; ?>App
<?php
if (count($helpers)):
echo "/**\n * Helpers\n *\n * @var array\n */\n";
echo "\tvar \$helpers = array(";
echo "\tpublic \$helpers = array(";
for ($i = 0, $len = count($helpers); $i < $len; $i++):
if ($i != $len - 1):
echo "'" . Inflector::camelize($helpers[$i]) . "', ";
Expand Down
42 changes: 21 additions & 21 deletions lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php
Expand Up @@ -39,35 +39,35 @@ public function after($event = array()) {
}

public $acos = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'model' => array('type'=>'string', 'null' => true),
'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'alias' => array('type'=>'string', 'null' => true),
'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'model' => array('type' => 'string', 'null' => true),
'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'alias' => array('type' => 'string', 'null' => true),
'lft' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'rght' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
);

public $aros = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'model' => array('type'=>'string', 'null' => true),
'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'alias' => array('type'=>'string', 'null' => true),
'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'model' => array('type' => 'string', 'null' => true),
'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'alias' => array('type' => 'string', 'null' => true),
'lft' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'rght' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
);

public $aros_acos = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'aro_id' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
'aco_id' => array('type'=>'integer', 'null' => false, 'length' => 10),
'_create' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
'_read' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
'_update' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
'_delete' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'aro_id' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
'aco_id' => array('type' => 'integer', 'null' => false, 'length' => 10),
'_create' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
'_read' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
'_update' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
'_delete' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1))
);

Expand Down
12 changes: 6 additions & 6 deletions lib/Cake/Console/Templates/skel/Config/Schema/i18n.php
Expand Up @@ -39,12 +39,12 @@ public function after($event = array()) {
}

public $i18n = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'locale' => array('type'=>'string', 'null' => false, 'length' => 6, 'key' => 'index'),
'model' => array('type'=>'string', 'null' => false, 'key' => 'index'),
'foreign_key' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
'field' => array('type'=>'string', 'null' => false, 'key' => 'index'),
'content' => array('type'=>'text', 'null' => true, 'default' => NULL),
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),
'model' => array('type' => 'string', 'null' => false, 'key' => 'index'),
'foreign_key' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
'field' => array('type' => 'string', 'null' => false, 'key' => 'index'),
'content' => array('type' => 'text', 'null' => true, 'default' => NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0))
);

Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/Console/Templates/skel/Config/Schema/sessions.php
Expand Up @@ -39,9 +39,9 @@ public function after($event = array()) {
}

public $cake_sessions = array(
'id' => array('type'=>'string', 'null' => false, 'key' => 'primary'),
'data' => array('type'=>'text', 'null' => true, 'default' => NULL),
'expires' => array('type'=>'integer', 'null' => true, 'default' => NULL),
'id' => array('type' => 'string', 'null' => false, 'key' => 'primary'),
'data' => array('type' => 'text', 'null' => true, 'default' => NULL),
'expires' => array('type' => 'integer', 'null' => true, 'default' => NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
);

Expand Down
20 changes: 10 additions & 10 deletions lib/Cake/Console/Templates/skel/Config/core.php
Expand Up @@ -239,8 +239,8 @@
*
* Cache::config('default', array(
* 'engine' => 'File', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'duration' => 3600, //[optional]
* 'probability' => 100, //[optional]
* 'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
* 'prefix' => 'cake_', //[optional] prefix every cache file with this string
* 'lock' => false, //[optional] use file locking
Expand All @@ -251,17 +251,17 @@
*
* Cache::config('default', array(
* 'engine' => 'Apc', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'duration' => 3600, //[optional]
* 'probability' => 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* ));
*
* Xcache (http://xcache.lighttpd.net/)
*
* Cache::config('default', array(
* 'engine' => 'Xcache', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'duration' => 3600, //[optional]
* 'probability' => 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* 'user' => 'user', //user from xcache.admin.user settings
* 'password' => 'password', //plaintext password (xcache.admin.pass)
Expand All @@ -271,8 +271,8 @@
*
* Cache::config('default', array(
* 'engine' => 'Memcache', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'duration' => 3600, //[optional]
* 'probability' => 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* 'servers' => array(
* '127.0.0.1:11211' // localhost, default port 11211
Expand All @@ -285,8 +285,8 @@
*
* Cache::config('default', array(
* 'engine' => 'Wincache', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'duration' => 3600, //[optional]
* 'probability' => 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* ));
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Console/Templates/skel/View/Layouts/default.ctp
Expand Up @@ -46,7 +46,7 @@
</div>
<div id="footer">
<?php echo $this->Html->link(
$this->Html->image('cake.power.gif', array('alt'=> __('CakePHP: the rapid development php framework'), 'border' => '0')),
$this->Html->image('cake.power.gif', array('alt' => __('CakePHP: the rapid development php framework'), 'border' => '0')),
'http://www.cakephp.org/',
array('target' => '_blank', 'escape' => false)
);
Expand Down

0 comments on commit faddfbe

Please sign in to comment.