mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Merge branch '2.7' into 2.8
This commit is contained in:
commit
8a57d78dba
139 changed files with 438 additions and 359 deletions
|
@ -21,7 +21,6 @@
|
|||
/**
|
||||
* Using the Schema command line utility
|
||||
* cake schema run create DbAcl
|
||||
*
|
||||
*/
|
||||
class DbAclSchema extends CakeSchema {
|
||||
|
||||
|
|
|
@ -27,6 +27,11 @@
|
|||
*/
|
||||
class I18nSchema extends CakeSchema {
|
||||
|
||||
/**
|
||||
* The name property
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name = 'i18n';
|
||||
|
||||
/**
|
||||
|
@ -48,6 +53,11 @@ class I18nSchema extends CakeSchema {
|
|||
public function after($event = array()) {
|
||||
}
|
||||
|
||||
/**
|
||||
* The i18n table definition
|
||||
*
|
||||
* @var 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'),
|
||||
|
|
|
@ -18,14 +18,17 @@
|
|||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
/**
|
||||
* Using the Schema command line utility
|
||||
* cake schema run create Sessions
|
||||
*
|
||||
*/
|
||||
class SessionsSchema extends CakeSchema {
|
||||
|
||||
/**
|
||||
* Name property
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name = 'Sessions';
|
||||
|
||||
/**
|
||||
|
@ -47,6 +50,11 @@ class SessionsSchema extends CakeSchema {
|
|||
public function after($event = array()) {
|
||||
}
|
||||
|
||||
/**
|
||||
* The cake_sessions table definition
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $cake_sessions = array(
|
||||
'id' => array('type' => 'string', 'null' => false, 'key' => 'primary'),
|
||||
'data' => array('type' => 'text', 'null' => true, 'default' => null),
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
; * @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
; */
|
||||
|
||||
; acl.ini.php - Cake ACL Configuration
|
||||
; acl.ini.php - CakePHP ACL Configuration
|
||||
; ---------------------------------------------------------------------
|
||||
; Use this file to specify user permissions.
|
||||
; aco = access control object (something in your application)
|
||||
|
|
|
@ -48,7 +48,6 @@ Cache::config('default', array('engine' => 'File'));
|
|||
* 'Vendor' => array('/path/to/vendors/', '/next/path/to/vendors/'),
|
||||
* 'Plugin' => array('/path/to/plugins/', '/next/path/to/plugins/'),
|
||||
* ));
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -57,7 +56,6 @@ Cache::config('default', array('engine' => 'File'));
|
|||
*
|
||||
* Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
|
||||
* Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -67,7 +65,6 @@ Cache::config('default', array('engine' => 'File'));
|
|||
*
|
||||
* CakePlugin::loadAll(); // Loads all plugins at once
|
||||
* CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
//setLocale(LC_ALL, 'deu');
|
||||
//Configure::write('Config.language', 'deu');
|
||||
|
||||
/**
|
||||
* CakePHP Debug Level:
|
||||
*
|
||||
|
@ -147,13 +150,11 @@
|
|||
* Enables:
|
||||
* `admin_index()` and `/admin/controller/index`
|
||||
* `manager_index()` and `/manager/controller/index`
|
||||
*
|
||||
*/
|
||||
//Configure::write('Routing.prefixes', array('admin'));
|
||||
|
||||
/**
|
||||
* Turn off all caching application-wide.
|
||||
*
|
||||
*/
|
||||
//Configure::write('Cache.disable', true);
|
||||
|
||||
|
@ -164,7 +165,6 @@
|
|||
* public $cacheAction inside your controllers to define caching settings.
|
||||
* You can either set it controller-wide by setting public $cacheAction = true,
|
||||
* or in each action using $this->cacheAction = true.
|
||||
*
|
||||
*/
|
||||
//Configure::write('Cache.check', true);
|
||||
|
||||
|
@ -213,7 +213,6 @@
|
|||
*
|
||||
* To use database sessions, run the app/Config/Schema/sessions.php schema using
|
||||
* the cake shell command: cake schema create Sessions
|
||||
*
|
||||
*/
|
||||
Configure::write('Session', array(
|
||||
'defaults' => 'php'
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
|
@ -35,7 +33,6 @@
|
|||
*
|
||||
* from =>
|
||||
* The origin email. See CakeEmail::from() about the valid values
|
||||
*
|
||||
*/
|
||||
class EmailConfig {
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
* @since CakePHP(tm) v 0.2.9
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Here, we are connecting '/' (base path) to controller called 'Pages',
|
||||
* its action called 'display', and we pass a param to select the view file
|
||||
|
|
|
@ -11,4 +11,3 @@ echo $this->Rss->document(
|
|||
array(), $channel, $this->fetch('content')
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
@charset "utf-8";
|
||||
/**
|
||||
*
|
||||
* Generic CSS for CakePHP
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
|
@ -84,7 +83,7 @@ p {
|
|||
line-height:20px;
|
||||
background: #003d4c url('../img/cake.icon.png') no-repeat left;
|
||||
color: #fff;
|
||||
padding: 0px 30px;
|
||||
padding: 0 30px;
|
||||
}
|
||||
#header h1 a {
|
||||
color: #fff;
|
||||
|
@ -174,7 +173,7 @@ td.actions {
|
|||
white-space: nowrap;
|
||||
}
|
||||
table td.actions a {
|
||||
margin: 0px 6px;
|
||||
margin: 0 6px;
|
||||
padding:2px 5px;
|
||||
}
|
||||
|
||||
|
@ -336,7 +335,7 @@ option {
|
|||
input[type=checkbox] {
|
||||
clear: left;
|
||||
float: left;
|
||||
margin: 0px 6px 7px 2px;
|
||||
margin: 0 6px 7px 2px;
|
||||
width: auto;
|
||||
}
|
||||
div.checkbox label {
|
||||
|
@ -365,7 +364,7 @@ form .submit input[type=submit] {
|
|||
background-image: -moz-linear-gradient(top, #76BF6B, #3B8230);
|
||||
border-color: #2d6324;
|
||||
color: #fff;
|
||||
text-shadow: rgba(0, 0, 0, 0.5) 0px -1px 0px;
|
||||
text-shadow: rgba(0, 0, 0, 0.5) 0 -1px 0;
|
||||
padding: 8px 10px;
|
||||
}
|
||||
form .submit input[type=submit]:hover {
|
||||
|
@ -527,11 +526,11 @@ input[type=submit],
|
|||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
text-decoration: none;
|
||||
text-shadow: #fff 0px 1px 0px;
|
||||
text-shadow: #fff 0 1px 0;
|
||||
min-width: 0;
|
||||
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2);
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2);
|
||||
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2);
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2);
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
@ -551,7 +550,7 @@ input[type=submit]:active,
|
|||
background-image: -ms-linear-gradient(top, #dfdfdf, #eee);
|
||||
background-image: -o-linear-gradient(top, #dfdfdf, #eee);
|
||||
background-image: linear-gradient(top, #dfdfdf, #eee);
|
||||
text-shadow: #eee 0px 1px 0px;
|
||||
text-shadow: #eee 0 1px 0;
|
||||
-moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
|
||||
-webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
|
||||
|
@ -627,15 +626,15 @@ pre {
|
|||
-moz-border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
border-radius: 10px;
|
||||
margin: 0px 4px 10px 2px;
|
||||
margin: 0 4px 10px 2px;
|
||||
font-family: sans-serif;
|
||||
font-size: 14px;
|
||||
line-height: 14px;
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
-moz-box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3);
|
||||
-webkit-box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3);
|
||||
box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3);
|
||||
-moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3);
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3);
|
||||
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.cake-code-dump pre {
|
||||
position: relative;
|
||||
|
@ -647,13 +646,13 @@ pre {
|
|||
.cake-stack-trace pre {
|
||||
color: #000;
|
||||
background-color: #F0F0F0;
|
||||
margin: 0px 0 10px 0;
|
||||
margin: 0 0 10px 0;
|
||||
padding: 1em;
|
||||
overflow: auto;
|
||||
text-shadow: none;
|
||||
}
|
||||
.cake-stack-trace li {
|
||||
padding: 10px 5px 0px;
|
||||
padding: 10px 5px 0;
|
||||
margin: 0 0 4px 0;
|
||||
font-family: monospace;
|
||||
border: 1px solid #bbb;
|
||||
|
@ -709,7 +708,7 @@ pre {
|
|||
}
|
||||
.code-coverage-results div.start {
|
||||
border:1px solid #aaa;
|
||||
border-width:1px 1px 0px 1px;
|
||||
border-width:1px 1px 0 1px;
|
||||
margin-top:30px;
|
||||
padding-top:5px;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ if (!defined('DS')) {
|
|||
|
||||
/**
|
||||
* The full path to the directory which holds "app", WITHOUT a trailing DS.
|
||||
*
|
||||
*/
|
||||
if (!defined('ROOT')) {
|
||||
define('ROOT', dirname(dirname(dirname(__FILE__))));
|
||||
|
@ -41,7 +40,6 @@ if (!defined('ROOT')) {
|
|||
|
||||
/**
|
||||
* The actual directory name for the "app".
|
||||
*
|
||||
*/
|
||||
if (!defined('APP_DIR')) {
|
||||
define('APP_DIR', basename(dirname(dirname(__FILE__))));
|
||||
|
@ -76,7 +74,6 @@ if (!defined('CAKE_CORE_INCLUDE_PATH') && file_exists($vendorPath . DS . $dispat
|
|||
/**
|
||||
* Editing below this line should NOT be necessary.
|
||||
* Change at your own risk.
|
||||
*
|
||||
*/
|
||||
if (!defined('WEBROOT_DIR')) {
|
||||
define('WEBROOT_DIR', basename(dirname(__FILE__)));
|
||||
|
@ -86,7 +83,7 @@ if (!defined('WWW_ROOT')) {
|
|||
}
|
||||
|
||||
// for built-in server
|
||||
if (php_sapi_name() === 'cli-server') {
|
||||
if (PHP_SAPI === 'cli-server') {
|
||||
if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['PHP_SELF'])) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ if (!defined('DS')) {
|
|||
|
||||
/**
|
||||
* The full path to the directory which holds "app", WITHOUT a trailing DS.
|
||||
*
|
||||
*/
|
||||
if (!defined('ROOT')) {
|
||||
define('ROOT', dirname(dirname(dirname(__FILE__))));
|
||||
|
@ -42,7 +41,6 @@ if (!defined('ROOT')) {
|
|||
|
||||
/**
|
||||
* The actual directory name for the "app".
|
||||
*
|
||||
*/
|
||||
if (!defined('APP_DIR')) {
|
||||
define('APP_DIR', basename(dirname(dirname(__FILE__))));
|
||||
|
@ -74,7 +72,6 @@ if (!defined('CAKE_CORE_INCLUDE_PATH') && file_exists($vendorPath . DS . $dispat
|
|||
/**
|
||||
* Editing below this line should not be necessary.
|
||||
* Change at your own risk.
|
||||
*
|
||||
*/
|
||||
if (!defined('WEBROOT_DIR')) {
|
||||
define('WEBROOT_DIR', basename(dirname(__FILE__)));
|
||||
|
@ -100,7 +97,7 @@ if (!empty($failed)) {
|
|||
}
|
||||
|
||||
if (Configure::read('debug') < 1) {
|
||||
throw new NotFoundException(__d('cake_dev', 'Debug setting does not allow access to this url.'));
|
||||
throw new NotFoundException(__d('cake_dev', 'Debug setting does not allow access to this URL.'));
|
||||
}
|
||||
|
||||
require_once CAKE . 'TestSuite' . DS . 'CakeTestSuiteDispatcher.php';
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "3.7.*",
|
||||
"cakephp/debug_kit" : "2.2.*"
|
||||
"cakephp/debug_kit" : "2.2.*",
|
||||
"cakephp/cakephp-codesniffer": "^1.0.0"
|
||||
},
|
||||
"bin": [
|
||||
"lib/Cake/Console/cake"
|
||||
|
|
|
@ -558,7 +558,7 @@ class AclShell extends AppShell {
|
|||
* or an array of properties to use in AcoNode::node()
|
||||
*
|
||||
* @param string $class Class type you want (Aro/Aco)
|
||||
* @param string|array $identifier A mixed identifier for finding the node.
|
||||
* @param string|array|null $identifier A mixed identifier for finding the node, otherwise null.
|
||||
* @return int Integer of NodeId. Will trigger an error if nothing is found.
|
||||
*/
|
||||
protected function _getNodeId($class, $identifier) {
|
||||
|
@ -568,7 +568,7 @@ class AclShell extends AppShell {
|
|||
$identifier = var_export($identifier, true);
|
||||
}
|
||||
$this->error(__d('cake_console', 'Could not find node using reference "%s"', $identifier));
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
return Hash::get($node, "0.{$class}.id");
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ class FixtureTask extends BakeTask {
|
|||
))->addOption('count', array(
|
||||
'help' => __d('cake_console', 'When using generated data, the number of records to include in the fixture(s).'),
|
||||
'short' => 'n',
|
||||
'default' => 10
|
||||
'default' => 1
|
||||
))->addOption('connection', array(
|
||||
'help' => __d('cake_console', 'Which database configuration to use for baking.'),
|
||||
'short' => 'c',
|
||||
|
@ -210,7 +210,7 @@ class FixtureTask extends BakeTask {
|
|||
* @param string $model Name of model to bake.
|
||||
* @param string $useTable Name of table to use.
|
||||
* @param array $importOptions Options for public $import
|
||||
* @return string Baked fixture content
|
||||
* @return string|null Baked fixture content, otherwise null.
|
||||
*/
|
||||
public function bake($model, $useTable = false, $importOptions = array()) {
|
||||
App::uses('CakeSchema', 'Model');
|
||||
|
@ -243,7 +243,7 @@ class FixtureTask extends BakeTask {
|
|||
$data = $this->_Schema->read(array('models' => false, 'connection' => $this->connection));
|
||||
if (!isset($data['tables'][$useTable])) {
|
||||
$this->err("<warning>Warning:</warning> Could not find the '${useTable}' table for ${model}.");
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
$tableInfo = $data['tables'][$useTable];
|
||||
|
|
|
@ -89,7 +89,7 @@ class ViewTask extends BakeTask {
|
|||
$this->_interactive();
|
||||
}
|
||||
if (empty($this->args[0])) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
if (!isset($this->connection)) {
|
||||
$this->connection = 'default';
|
||||
|
|
|
@ -179,11 +179,11 @@ class TestShell extends Shell {
|
|||
/**
|
||||
* Parse the CLI options into an array CakeTestDispatcher can use.
|
||||
*
|
||||
* @return array Array of params for CakeTestDispatcher
|
||||
* @return array|null Array of params for CakeTestDispatcher or null.
|
||||
*/
|
||||
protected function _parseArgs() {
|
||||
if (empty($this->args)) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
$params = array(
|
||||
'core' => false,
|
||||
|
|
|
@ -23,10 +23,10 @@ echo "App::uses('{$plugin}AppController', '{$pluginPath}Controller');\n";
|
|||
?>
|
||||
/**
|
||||
* <?php echo $controllerName; ?> Controller
|
||||
*
|
||||
<?php
|
||||
if (!$isScaffold) {
|
||||
$defaultModel = Inflector::singularize($controllerName);
|
||||
echo " *\n";
|
||||
echo " * @property {$defaultModel} \${$defaultModel}\n";
|
||||
if (!empty($components)) {
|
||||
foreach ($components as $component) {
|
||||
|
|
|
@ -106,7 +106,7 @@ foreach ($associations as $assoc):
|
|||
if (!empty($assoc)):
|
||||
?>
|
||||
|
||||
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
||||
// The Associations below have been created with all possible keys, those that are not needed can be removed
|
||||
<?php
|
||||
break;
|
||||
endif;
|
||||
|
|
|
@ -131,4 +131,6 @@ echo "\t<?php endforeach; ?>\n";
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
|
|
|
@ -9,11 +9,9 @@
|
|||
* @since CakePHP(tm) v 0.2.9
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
/**
|
||||
* Using the Schema command line utility
|
||||
* cake schema run create DbAcl
|
||||
*
|
||||
*/
|
||||
class DbAclSchema extends CakeSchema {
|
||||
|
||||
|
|
|
@ -4,9 +4,18 @@
|
|||
*
|
||||
* Use it to configure database for i18n
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @package app.Config.Schema
|
||||
* @since CakePHP(tm) v 0.2.9
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -26,26 +35,26 @@ class I18nSchema extends CakeSchema {
|
|||
public $name = 'i18n';
|
||||
|
||||
/**
|
||||
* Before event.
|
||||
* Before callback.
|
||||
*
|
||||
* @param array $event The event data.
|
||||
* @return bool success
|
||||
* @param array $event Schema object properties
|
||||
* @return bool Should process continue
|
||||
*/
|
||||
public function before($event = array()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* After event.
|
||||
* After callback.
|
||||
*
|
||||
* @param array $event The event data.
|
||||
* @param array $event Schema object properties
|
||||
* @return void
|
||||
*/
|
||||
public function after($event = array()) {
|
||||
}
|
||||
|
||||
/**
|
||||
* The i18n table property
|
||||
* The i18n table definition
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
|
|
|
@ -4,15 +4,23 @@
|
|||
*
|
||||
* Use it to configure database for Sessions
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @package app.Config.Schema
|
||||
* @since CakePHP(tm) v 0.2.9
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Using the Schema command line utility
|
||||
* cake schema run create Sessions
|
||||
*
|
||||
*/
|
||||
class SessionsSchema extends CakeSchema {
|
||||
|
||||
|
@ -24,26 +32,26 @@ class SessionsSchema extends CakeSchema {
|
|||
public $name = 'Sessions';
|
||||
|
||||
/**
|
||||
* Before event.
|
||||
* Before callback.
|
||||
*
|
||||
* @param array $event The event data.
|
||||
* @return bool Success
|
||||
* @param array $event Schema object properties
|
||||
* @return bool Should process continue
|
||||
*/
|
||||
public function before($event = array()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* After event.
|
||||
* After callback.
|
||||
*
|
||||
* @param array $event The event data.
|
||||
* @param array $event Schema object properties
|
||||
* @return void
|
||||
*/
|
||||
public function after($event = array()) {
|
||||
}
|
||||
|
||||
/**
|
||||
* cake_sessions table definition
|
||||
* The cake_sessions table definition
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
|
|
|
@ -39,7 +39,6 @@ Cache::config('default', array('engine' => 'File'));
|
|||
* 'Vendor' => array('/path/to/vendors/', '/next/path/to/vendors/'),
|
||||
* 'Plugin' => array('/path/to/plugins/', '/next/path/to/plugins/'),
|
||||
* ));
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -48,7 +47,6 @@ Cache::config('default', array('engine' => 'File'));
|
|||
*
|
||||
* Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
|
||||
* Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -58,7 +56,6 @@ Cache::config('default', array('engine' => 'File'));
|
|||
*
|
||||
* CakePlugin::loadAll(); // Loads all plugins at once
|
||||
* CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -138,13 +138,11 @@
|
|||
* Enables:
|
||||
* `admin_index()` and `/admin/controller/index`
|
||||
* `manager_index()` and `/manager/controller/index`
|
||||
*
|
||||
*/
|
||||
//Configure::write('Routing.prefixes', array('admin'));
|
||||
|
||||
/**
|
||||
* Turn off all caching application-wide.
|
||||
*
|
||||
*/
|
||||
//Configure::write('Cache.disable', true);
|
||||
|
||||
|
@ -155,7 +153,6 @@
|
|||
* public $cacheAction inside your controllers to define caching settings.
|
||||
* You can either set it controller-wide by setting public $cacheAction = true,
|
||||
* or in each action using $this->cacheAction = true.
|
||||
*
|
||||
*/
|
||||
//Configure::write('Cache.check', true);
|
||||
|
||||
|
@ -204,7 +201,6 @@
|
|||
*
|
||||
* To use database sessions, run the app/Config/Schema/sessions.php schema using
|
||||
* the cake shell command: cake schema create Sessions
|
||||
*
|
||||
*/
|
||||
Configure::write('Session', array(
|
||||
'defaults' => 'php'
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @package app.Config
|
||||
* @since CakePHP(tm) v 0.2.9
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
*
|
||||
* from =>
|
||||
* The origin email. See CakeEmail::from() about the valid values
|
||||
*
|
||||
*/
|
||||
class EmailConfig {
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ $content = explode("\n", $content);
|
|||
foreach ($content as $line):
|
||||
echo '<p> ' . $line . "</p>\n";
|
||||
endforeach;
|
||||
?>
|
|
@ -17,4 +17,3 @@
|
|||
if (Configure::read('debug') > 0):
|
||||
echo $this->element('exception_stack_trace');
|
||||
endif;
|
||||
?>
|
||||
|
|
|
@ -14,4 +14,3 @@
|
|||
if (Configure::read('debug') > 0):
|
||||
echo $this->element('exception_stack_trace');
|
||||
endif;
|
||||
?>
|
||||
|
|
|
@ -62,7 +62,7 @@ endif;
|
|||
$settings = Cache::settings();
|
||||
if (!empty($settings)):
|
||||
echo '<span class="notice success">';
|
||||
echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit %s', '<em>'. $settings['engine'] . 'Engine</em>', 'APP/Config/core.php');
|
||||
echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit %s', '<em>' . $settings['engine'] . 'Engine</em>', 'APP/Config/core.php');
|
||||
echo '</span>';
|
||||
else:
|
||||
echo '<span class="notice">';
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
@charset "utf-8";
|
||||
/**
|
||||
*
|
||||
* Generic CSS for CakePHP
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
|
@ -84,7 +83,7 @@ p {
|
|||
line-height:20px;
|
||||
background: #003d4c url('../img/cake.icon.png') no-repeat left;
|
||||
color: #fff;
|
||||
padding: 0px 30px;
|
||||
padding: 0 30px;
|
||||
}
|
||||
#header h1 a {
|
||||
color: #fff;
|
||||
|
@ -172,7 +171,7 @@ td.actions {
|
|||
white-space: nowrap;
|
||||
}
|
||||
table td.actions a {
|
||||
margin: 0px 6px;
|
||||
margin: 0 6px;
|
||||
padding:2px 5px;
|
||||
}
|
||||
|
||||
|
@ -334,7 +333,7 @@ option {
|
|||
input[type=checkbox] {
|
||||
clear: left;
|
||||
float: left;
|
||||
margin: 0px 6px 7px 2px;
|
||||
margin: 0 6px 7px 2px;
|
||||
width: auto;
|
||||
}
|
||||
div.checkbox label {
|
||||
|
@ -363,7 +362,7 @@ form .submit input[type=submit] {
|
|||
background-image: -moz-linear-gradient(top, #76BF6B, #3B8230);
|
||||
border-color: #2d6324;
|
||||
color: #fff;
|
||||
text-shadow: rgba(0, 0, 0, 0.5) 0px -1px 0px;
|
||||
text-shadow: rgba(0, 0, 0, 0.5) 0 -1px 0;
|
||||
padding: 8px 10px;
|
||||
}
|
||||
form .submit input[type=submit]:hover {
|
||||
|
@ -525,11 +524,11 @@ input[type=submit],
|
|||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
text-decoration: none;
|
||||
text-shadow: #fff 0px 1px 0px;
|
||||
text-shadow: #fff 0 1px 0;
|
||||
min-width: 0;
|
||||
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2);
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0px 1px 1px rgba(0, 0, 0, 0.2);
|
||||
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2);
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2);
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
@ -549,7 +548,7 @@ input[type=submit]:active,
|
|||
background-image: -ms-linear-gradient(top, #dfdfdf, #eee);
|
||||
background-image: -o-linear-gradient(top, #dfdfdf, #eee);
|
||||
background-image: linear-gradient(top, #dfdfdf, #eee);
|
||||
text-shadow: #eee 0px 1px 0px;
|
||||
text-shadow: #eee 0 1px 0;
|
||||
-moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
|
||||
-webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
|
||||
|
@ -625,15 +624,15 @@ pre {
|
|||
-moz-border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
border-radius: 10px;
|
||||
margin: 0px 4px 10px 2px;
|
||||
margin: 0 4px 10px 2px;
|
||||
font-family: sans-serif;
|
||||
font-size: 14px;
|
||||
line-height: 14px;
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
-moz-box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3);
|
||||
-webkit-box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3);
|
||||
box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.3);
|
||||
-moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3);
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3);
|
||||
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.cake-code-dump pre {
|
||||
position: relative;
|
||||
|
@ -645,13 +644,13 @@ pre {
|
|||
.cake-stack-trace pre {
|
||||
color: #000;
|
||||
background-color: #F0F0F0;
|
||||
margin: 0px 0 10px 0;
|
||||
margin: 0 0 10px 0;
|
||||
padding: 1em;
|
||||
overflow: auto;
|
||||
text-shadow: none;
|
||||
}
|
||||
.cake-stack-trace li {
|
||||
padding: 10px 5px 0px;
|
||||
padding: 10px 5px 0;
|
||||
margin: 0 0 4px 0;
|
||||
font-family: monospace;
|
||||
border: 1px solid #bbb;
|
||||
|
@ -707,7 +706,7 @@ pre {
|
|||
}
|
||||
.code-coverage-results div.start {
|
||||
border:1px solid #aaa;
|
||||
border-width:1px 1px 0px 1px;
|
||||
border-width:1px 1px 0 1px;
|
||||
margin-top:30px;
|
||||
padding-top:5px;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ if (!defined('DS')) {
|
|||
|
||||
/**
|
||||
* The full path to the directory which holds "app", WITHOUT a trailing DS.
|
||||
*
|
||||
*/
|
||||
if (!defined('ROOT')) {
|
||||
define('ROOT', dirname(dirname(dirname(__FILE__))));
|
||||
|
@ -32,7 +31,6 @@ if (!defined('ROOT')) {
|
|||
|
||||
/**
|
||||
* The actual directory name for the "app".
|
||||
*
|
||||
*/
|
||||
if (!defined('APP_DIR')) {
|
||||
define('APP_DIR', basename(dirname(dirname(__FILE__))));
|
||||
|
@ -67,7 +65,6 @@ if (!defined('CAKE_CORE_INCLUDE_PATH') && file_exists($vendorPath . DS . $dispat
|
|||
/**
|
||||
* Editing below this line should NOT be necessary.
|
||||
* Change at your own risk.
|
||||
*
|
||||
*/
|
||||
if (!defined('WEBROOT_DIR')) {
|
||||
define('WEBROOT_DIR', basename(dirname(__FILE__)));
|
||||
|
|
|
@ -25,7 +25,6 @@ if (!defined('DS')) {
|
|||
|
||||
/**
|
||||
* The full path to the directory which holds "app", WITHOUT a trailing DS.
|
||||
*
|
||||
*/
|
||||
if (!defined('ROOT')) {
|
||||
define('ROOT', dirname(dirname(dirname(__FILE__))));
|
||||
|
@ -33,7 +32,6 @@ if (!defined('ROOT')) {
|
|||
|
||||
/**
|
||||
* The actual directory name for the "app".
|
||||
*
|
||||
*/
|
||||
if (!defined('APP_DIR')) {
|
||||
define('APP_DIR', basename(dirname(dirname(__FILE__))));
|
||||
|
@ -65,7 +63,6 @@ if (!defined('CAKE_CORE_INCLUDE_PATH') && file_exists($vendorPath . DS . $dispat
|
|||
/**
|
||||
* Editing below this line should not be necessary.
|
||||
* Change at your own risk.
|
||||
*
|
||||
*/
|
||||
if (!defined('WEBROOT_DIR')) {
|
||||
define('WEBROOT_DIR', basename(dirname(__FILE__)));
|
||||
|
|
|
@ -41,7 +41,6 @@ class DbAcl extends Object implements AclInterface {
|
|||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
|
|
@ -196,7 +196,6 @@ class PhpAcl extends Object implements AclInterface {
|
|||
|
||||
/**
|
||||
* Access Control Object
|
||||
*
|
||||
*/
|
||||
class PhpAco {
|
||||
|
||||
|
@ -361,7 +360,6 @@ class PhpAco {
|
|||
|
||||
/**
|
||||
* Access Request Object
|
||||
*
|
||||
*/
|
||||
class PhpAro {
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class AclComponent extends Component {
|
|||
* Will call the initialize method on the adapter if setting a new one.
|
||||
*
|
||||
* @param AclInterface|string $adapter Instance of AclInterface or a string name of the class to use. (optional)
|
||||
* @return AclInterface|void either null, or the adapter implementation.
|
||||
* @return AclInterface|null Either null, or the adapter implementation.
|
||||
* @throws CakeException when the given class is not an instance of AclInterface
|
||||
*/
|
||||
public function adapter($adapter = null) {
|
||||
|
@ -92,7 +92,7 @@ class AclComponent extends Component {
|
|||
}
|
||||
$this->_Instance = $adapter;
|
||||
$this->_Instance->initialize($this);
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
return $this->_Instance;
|
||||
}
|
||||
|
|
|
@ -481,7 +481,7 @@ class AuthComponent extends Component {
|
|||
*/
|
||||
public function constructAuthorize() {
|
||||
if (empty($this->authorize)) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
$this->_authorizeObjects = array();
|
||||
$config = Hash::normalize((array)$this->authorize);
|
||||
|
@ -772,12 +772,12 @@ class AuthComponent extends Component {
|
|||
/**
|
||||
* Loads the configured authentication objects.
|
||||
*
|
||||
* @return mixed either null on empty authenticate value, or an array of loaded objects.
|
||||
* @return mixed Either null on empty authenticate value, or an array of loaded objects.
|
||||
* @throws CakeException
|
||||
*/
|
||||
public function constructAuthenticate() {
|
||||
if (empty($this->authenticate)) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
$this->_authenticateObjects = array();
|
||||
$config = Hash::normalize((array)$this->authenticate);
|
||||
|
|
|
@ -27,7 +27,6 @@ App::uses('Hash', 'Utility');
|
|||
*
|
||||
* @package Cake.Controller.Component
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/components/cookie.html
|
||||
*
|
||||
*/
|
||||
class CookieComponent extends Component {
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ App::uses('Xml', 'Utility');
|
|||
*
|
||||
* @package Cake.Controller.Component
|
||||
* @link http://book.cakephp.org/2.0/en/core-libraries/components/request-handling.html
|
||||
*
|
||||
*/
|
||||
class RequestHandlerComponent extends Component {
|
||||
|
||||
|
@ -280,7 +279,7 @@ class RequestHandlerComponent extends Component {
|
|||
* "304 Not Modified" header.
|
||||
*
|
||||
* @param Controller $controller Controller instance.
|
||||
* @return bool false if the render process should be aborted
|
||||
* @return bool False if the render process should be aborted.
|
||||
*/
|
||||
public function beforeRender(Controller $controller) {
|
||||
if ($this->settings['checkHttpCache'] && $this->response->checkNotModified($this->request)) {
|
||||
|
|
|
@ -34,7 +34,7 @@ class SessionComponent extends Component {
|
|||
* Get / Set the userAgent
|
||||
*
|
||||
* @param string $userAgent Set the userAgent
|
||||
* @return void
|
||||
* @return string Current user agent.
|
||||
*/
|
||||
public function userAgent($userAgent = null) {
|
||||
return CakeSession::userAgent($userAgent);
|
||||
|
|
|
@ -31,7 +31,6 @@ class Object {
|
|||
|
||||
/**
|
||||
* Constructor, no-op
|
||||
*
|
||||
*/
|
||||
public function __construct() {
|
||||
}
|
||||
|
|
|
@ -230,6 +230,16 @@ class ErrorHandler {
|
|||
}
|
||||
$message = $error . ' (' . $code . '): ' . $description . ' in [' . $file . ', line ' . $line . ']';
|
||||
if (!empty($errorConfig['trace'])) {
|
||||
// https://bugs.php.net/bug.php?id=65322
|
||||
if (version_compare(PHP_VERSION, '5.4.21', '<')) {
|
||||
if (!class_exists('Debugger')) {
|
||||
App::load('Debugger');
|
||||
}
|
||||
if (!class_exists('CakeText')) {
|
||||
App::uses('CakeText', 'Utility');
|
||||
App::load('CakeText');
|
||||
}
|
||||
}
|
||||
$trace = Debugger::trace(array('start' => 1, 'format' => 'log'));
|
||||
$message .= "\nTrace:\n" . $trace . "\n";
|
||||
}
|
||||
|
|
|
@ -71,7 +71,6 @@ class CakeEvent {
|
|||
* $event = new CakeEvent('Order.afterBuy', $this, array('buyer' => $userData));
|
||||
* $event = new CakeEvent('User.afterRegister', $UserModel);
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
public function __construct($name, $subject = null, $data = null) {
|
||||
$this->_name = $name;
|
||||
|
|
|
@ -182,7 +182,7 @@ class FileLog extends BaseLog {
|
|||
* Also if `rotate` count is reached oldest file is removed.
|
||||
*
|
||||
* @param string $filename Log file name
|
||||
* @return mixed True if rotated successfully or false in case of error.
|
||||
* @return mixed True if rotated successfully or false in case of error, otherwise null.
|
||||
* Void if file doesn't need to be rotated.
|
||||
*/
|
||||
protected function _rotateFile($filename) {
|
||||
|
@ -196,7 +196,7 @@ class FileLog extends BaseLog {
|
|||
if (!file_exists($filepath) ||
|
||||
filesize($filepath) < $this->_size
|
||||
) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($this->_config['rotate'] === 0) {
|
||||
|
|
|
@ -39,7 +39,6 @@ class AclNode extends Model {
|
|||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*/
|
||||
public function __construct() {
|
||||
$config = Configure::read('Acl.database');
|
||||
|
|
|
@ -357,7 +357,7 @@ class CakeSession {
|
|||
* Get / Set the user agent
|
||||
*
|
||||
* @param string|null $userAgent Set the user agent
|
||||
* @return string Current user agent
|
||||
* @return string Current user agent.
|
||||
*/
|
||||
public static function userAgent($userAgent = null) {
|
||||
if ($userAgent) {
|
||||
|
|
|
@ -352,7 +352,7 @@ class Mysql extends DboSource {
|
|||
if (in_array($fields[$column->Field]['type'], $this->fieldParameters['unsigned']['types'], true)) {
|
||||
$fields[$column->Field]['unsigned'] = $this->_unsigned($column->Type);
|
||||
}
|
||||
if ($fields[$column->Field]['type'] === 'timestamp' && strtoupper($column->Default) === 'CURRENT_TIMESTAMP') {
|
||||
if (in_array($fields[$column->Field]['type'], array('timestamp', 'datetime')) && strtoupper($column->Default) === 'CURRENT_TIMESTAMP') {
|
||||
$fields[$column->Field]['default'] = null;
|
||||
}
|
||||
if (!empty($column->Key) && isset($this->index[$column->Key])) {
|
||||
|
|
|
@ -284,7 +284,7 @@ class DboSource extends DataSource {
|
|||
if ($this->_result instanceof PDOStatement) {
|
||||
$this->_result->closeCursor();
|
||||
}
|
||||
unset($this->_connection);
|
||||
$this->_connection = null;
|
||||
$this->connected = false;
|
||||
return true;
|
||||
}
|
||||
|
@ -857,12 +857,16 @@ class DboSource extends DataSource {
|
|||
* @return bool True if the database is connected, else false
|
||||
*/
|
||||
public function isConnected() {
|
||||
try {
|
||||
$connected = $this->_connection->query('SELECT 1');
|
||||
} catch (Exception $e) {
|
||||
if ($this->_connection === null) {
|
||||
$connected = false;
|
||||
} else {
|
||||
try {
|
||||
$connected = $this->_connection->query('SELECT 1');
|
||||
} catch (Exception $e) {
|
||||
$connected = false;
|
||||
}
|
||||
}
|
||||
$this->connected = ! empty($connected);
|
||||
$this->connected = !empty($connected);
|
||||
return $this->connected;
|
||||
}
|
||||
|
||||
|
@ -1264,7 +1268,7 @@ class DboSource extends DataSource {
|
|||
|
||||
$queryTemplate = $this->generateAssociationQuery($Model, $LinkModel, $type, $association, $assocData, $queryData, $external);
|
||||
if (empty($queryTemplate)) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!is_array($resultSet)) {
|
||||
|
@ -1958,7 +1962,7 @@ class DboSource extends DataSource {
|
|||
*
|
||||
* @param string $type type of query being run. e.g select, create, update, delete, schema, alter.
|
||||
* @param array $data Array of data to insert into the query.
|
||||
* @return string Rendered SQL expression to be run.
|
||||
* @return string|null Rendered SQL expression to be run, otherwise null.
|
||||
*/
|
||||
public function renderStatement($type, $data) {
|
||||
extract($data);
|
||||
|
@ -1992,7 +1996,7 @@ class DboSource extends DataSource {
|
|||
}
|
||||
return "CREATE TABLE {$table} (\n{$columns}{$indexes}) {$tableParameters};";
|
||||
case 'alter':
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ class DatabaseSession implements CakeSessionHandlerInterface {
|
|||
/**
|
||||
* Constructor. Looks at Session configuration information and
|
||||
* sets up the session model.
|
||||
*
|
||||
*/
|
||||
public function __construct() {
|
||||
$modelName = Configure::read('Session.handler.model');
|
||||
|
|
|
@ -1190,12 +1190,12 @@ class Model extends Object implements CakeEventListener {
|
|||
*
|
||||
* @param string|array|SimpleXmlElement|DomNode $one Array or string of data
|
||||
* @param string $two Value string for the alternative indata method
|
||||
* @return array Data with all of $one's keys and values
|
||||
* @return array|null Data with all of $one's keys and values, otherwise null.
|
||||
* @link http://book.cakephp.org/2.0/en/models/saving-your-data.html
|
||||
*/
|
||||
public function set($one, $two = null) {
|
||||
if (!$one) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
if (is_object($one)) {
|
||||
|
@ -1835,7 +1835,12 @@ class Model extends Object implements CakeEventListener {
|
|||
$now = time();
|
||||
|
||||
foreach ($dateFields as $updateCol) {
|
||||
if (in_array($updateCol, $fields) || !$this->hasField($updateCol)) {
|
||||
$fieldHasValue = in_array($updateCol, $fields);
|
||||
$fieldInWhitelist = (
|
||||
count($this->whitelist) === 0 ||
|
||||
in_array($updateCol, $this->whitelist)
|
||||
);
|
||||
if (($fieldHasValue && $fieldInWhitelist) || !$this->hasField($updateCol)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -452,7 +452,7 @@ class CakeResponse {
|
|||
|
||||
/**
|
||||
* Formats the Content-Type header based on the configured contentType and charset
|
||||
* the charset will only be set in the header if the response is of type text/*
|
||||
* the charset will only be set in the header if the response is of type text
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
@ -832,7 +832,7 @@ class CakeResponse {
|
|||
if (!$public && !$private && !$noCache) {
|
||||
return null;
|
||||
}
|
||||
$sharable = $public || ! ($private || $noCache);
|
||||
$sharable = $public || !($private || $noCache);
|
||||
return $sharable;
|
||||
}
|
||||
if ($public) {
|
||||
|
|
|
@ -216,7 +216,7 @@ class CakeSocket {
|
|||
*/
|
||||
public function context() {
|
||||
if (!$this->connection) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
return stream_context_get_options($this->connection);
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ class Dispatcher implements CakeEventListener {
|
|||
* @param CakeRequest $request Request object to dispatch.
|
||||
* @param CakeResponse $response Response object to put the results of the dispatch into.
|
||||
* @param array $additionalParams Settings array ("bare", "return") which is melded with the GET and POST params
|
||||
* @return string|void if `$request['return']` is set then it returns response body, null otherwise
|
||||
* @return string|null if `$request['return']` is set then it returns response body, null otherwise
|
||||
* @triggers Dispatcher.beforeDispatch $this, compact('request', 'response', 'additionalParams')
|
||||
* @triggers Dispatcher.afterDispatch $this, compact('request', 'response')
|
||||
* @throws MissingControllerException When the controller is missing.
|
||||
|
@ -152,7 +152,7 @@ class Dispatcher implements CakeEventListener {
|
|||
return $beforeEvent->result->body();
|
||||
}
|
||||
$beforeEvent->result->send();
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
$controller = $this->_getController($request, $response);
|
||||
|
|
|
@ -42,7 +42,7 @@ class AssetDispatcher extends DispatcherFilter {
|
|||
public function beforeDispatch(CakeEvent $event) {
|
||||
$url = urldecode($event->data['request']->url);
|
||||
if (strpos($url, '..') !== false || strpos($url, '.') === false) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($result = $this->_filterAsset($event)) {
|
||||
|
|
|
@ -39,7 +39,7 @@ class CacheDispatcher extends DispatcherFilter {
|
|||
*/
|
||||
public function beforeDispatch(CakeEvent $event) {
|
||||
if (Configure::read('Cache.check') !== true) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
$path = $event->data['request']->here();
|
||||
|
|
|
@ -37,7 +37,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
$this->assertEquals($parser, $result, 'Setting description is not chainable');
|
||||
$this->assertEquals('A test', $parser->description(), 'getting value is wrong.');
|
||||
|
||||
$result = $parser->description(array('A test', 'something'));
|
||||
$parser->description(array('A test', 'something'));
|
||||
$this->assertEquals("A test\nsomething", $parser->description(), 'getting value is wrong.');
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
$this->assertEquals($parser, $result, 'Setting epilog is not chainable');
|
||||
$this->assertEquals('A test', $parser->epilog(), 'getting value is wrong.');
|
||||
|
||||
$result = $parser->epilog(array('A test', 'something'));
|
||||
$parser->epilog(array('A test', 'something'));
|
||||
$this->assertEquals("A test\nsomething", $parser->epilog(), 'getting value is wrong.');
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
$expected = array('name' => 'mark', 'help' => false);
|
||||
$this->assertEquals($expected, $result[0], 'Got the correct value.');
|
||||
|
||||
$result = $parser->parse(array('--name', 'jimmy'));
|
||||
$parser->parse(array('--name', 'jimmy'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -384,7 +384,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
$result = $parser->parse($expected);
|
||||
$this->assertEquals($expected, $result[1], 'Arguments are not as expected');
|
||||
|
||||
$result = $parser->parse(array('one', 'two', 'three'));
|
||||
$parser->parse(array('one', 'two', 'three'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -430,7 +430,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
$expected = array('mark', 'samurai', 'sword');
|
||||
$this->assertEquals($expected, $result[1], 'Got the correct value.');
|
||||
|
||||
$result = $parser->parse(array('jose', 'coder'));
|
||||
$parser->parse(array('jose', 'coder'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -155,7 +155,6 @@ class DbAclTwoTest extends DbAcl {
|
|||
|
||||
/**
|
||||
* construct method
|
||||
*
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->Aro = new AroTwoTest();
|
||||
|
|
|
@ -45,6 +45,8 @@ class ControllerAuthorizeTest extends CakeTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* testControllerTypeError
|
||||
*
|
||||
* @expectedException PHPUnit_Framework_Error
|
||||
* @return void
|
||||
*/
|
||||
|
@ -53,6 +55,8 @@ class ControllerAuthorizeTest extends CakeTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* testControllerErrorOnMissingMethod
|
||||
*
|
||||
* @expectedException CakeException
|
||||
* @return void
|
||||
*/
|
||||
|
|
|
@ -176,7 +176,6 @@ class AuthTestController extends Controller {
|
|||
|
||||
/**
|
||||
* construct method
|
||||
*
|
||||
*/
|
||||
public function __construct($request, $response) {
|
||||
$request->addParams(Router::parse('/auth_test'));
|
||||
|
@ -1319,7 +1318,7 @@ class AuthComponentTest extends CakeTestCase {
|
|||
->with('HTTP/1.1 403 Forbidden', null);
|
||||
$this->Auth->initialize($this->Controller);
|
||||
|
||||
$result = $this->Auth->startup($this->Controller);
|
||||
$this->Auth->startup($this->Controller);
|
||||
|
||||
$this->assertArrayNotHasKey('Location', $this->Controller->response->header());
|
||||
$this->assertNull($this->Controller->testUrl, 'redirect() not called');
|
||||
|
|
|
@ -486,7 +486,7 @@ class PaginatorComponentTest extends CakeTestCase {
|
|||
|
||||
$Controller->request->params['named'] = array('limit' => 12);
|
||||
$Controller->Paginator->settings = array('limit' => 30, 'maxLimit' => 100, 'paramType' => 'named');
|
||||
$result = $Controller->Paginator->paginate('PaginatorControllerPost');
|
||||
$Controller->Paginator->paginate('PaginatorControllerPost');
|
||||
$paging = $Controller->params['paging']['PaginatorControllerPost'];
|
||||
|
||||
$this->assertEquals(12, $Controller->PaginatorControllerPost->lastQueries[0]['limit']);
|
||||
|
@ -504,7 +504,7 @@ class PaginatorComponentTest extends CakeTestCase {
|
|||
'paramType' => 'named'
|
||||
)
|
||||
);
|
||||
$result = $Controller->Paginator->paginate('ControllerPaginateModel');
|
||||
$Controller->Paginator->paginate('ControllerPaginateModel');
|
||||
$expected = array(
|
||||
'contain' => array('ControllerPaginateModel'),
|
||||
'group' => 'Comment.author_id',
|
||||
|
|
|
@ -653,7 +653,7 @@ class ControllerTest extends CakeTestCase {
|
|||
$expected = $Controller->ControllerComment->validationErrors;
|
||||
|
||||
$Controller->viewPath = 'Posts';
|
||||
$result = $Controller->render('index');
|
||||
$Controller->render('index');
|
||||
$View = $Controller->View;
|
||||
$this->assertTrue(isset($View->validationErrors['ControllerComment']));
|
||||
$this->assertEquals($expected, $View->validationErrors['ControllerComment']);
|
||||
|
|
|
@ -20,7 +20,6 @@ App::uses('CakePlugin', 'Core');
|
|||
|
||||
/**
|
||||
* CakePluginTest class
|
||||
*
|
||||
*/
|
||||
class CakePluginTest extends CakeTestCase {
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
|
||||
/**
|
||||
* Test to ensure bootrapping doesn't overwrite prior configs set under 'App' key
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBootstrap() {
|
||||
|
@ -469,6 +470,8 @@ class ConfigureTest extends CakeTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* testDumpNoAdapter
|
||||
*
|
||||
* @expectedException ConfigureException
|
||||
* @return void
|
||||
*/
|
||||
|
|
|
@ -73,7 +73,7 @@ class RequestActionController extends Controller {
|
|||
/**
|
||||
* normal_request_action method
|
||||
*
|
||||
* @return void
|
||||
* @return string Hello World!
|
||||
*/
|
||||
public function normal_request_action() {
|
||||
return 'Hello World';
|
||||
|
@ -82,7 +82,7 @@ class RequestActionController extends Controller {
|
|||
/**
|
||||
* returns $this->here
|
||||
*
|
||||
* @return void
|
||||
* @return string $this->here.
|
||||
*/
|
||||
public function return_here() {
|
||||
return $this->here;
|
||||
|
@ -91,7 +91,7 @@ class RequestActionController extends Controller {
|
|||
/**
|
||||
* paginate_request_action method
|
||||
*
|
||||
* @return void
|
||||
* @return true
|
||||
*/
|
||||
public function paginate_request_action() {
|
||||
$this->paginate();
|
||||
|
@ -251,8 +251,9 @@ class TestObject extends Object {
|
|||
}
|
||||
|
||||
/**
|
||||
* undocumented function
|
||||
* Set properties.
|
||||
*
|
||||
* @param array $properties The $properties.
|
||||
* @return void
|
||||
*/
|
||||
public function set($properties = array()) {
|
||||
|
|
|
@ -88,7 +88,6 @@ class CustomTestEventListener extends CakeEventTestListener implements CakeEvent
|
|||
|
||||
/**
|
||||
* Tests the CakeEventManager class functionality
|
||||
*
|
||||
*/
|
||||
class CakeEventManagerTest extends CakeTestCase {
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ App::uses('CakeEvent', 'Event');
|
|||
|
||||
/**
|
||||
* Tests the CakeEvent class functionality
|
||||
*
|
||||
*/
|
||||
class CakeEventTest extends CakeTestCase {
|
||||
|
||||
|
|
|
@ -181,8 +181,7 @@ class DbAroUserTest extends CakeTestModel {
|
|||
class TestDbAcl extends DbAcl {
|
||||
|
||||
/**
|
||||
* construct method
|
||||
*
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->Aro = new DbAroTest();
|
||||
|
|
|
@ -926,6 +926,44 @@ SQL;
|
|||
$this->assertContains('`limit_date` timestamp NOT NULL,', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that describe() ignores `default current_timestamp` in datetime columns.
|
||||
* This is for MySQL >= 5.6.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testDescribeHandleCurrentTimestampDatetime() {
|
||||
$mysqlVersion = $this->Dbo->query('SELECT VERSION() as version', array('log' => false));
|
||||
$this->skipIf(version_compare($mysqlVersion[0][0]['version'], '5.6.0', '<'));
|
||||
|
||||
$name = $this->Dbo->fullTableName('timestamp_default_values');
|
||||
$sql = <<<SQL
|
||||
CREATE TABLE $name (
|
||||
id INT(11) NOT NULL AUTO_INCREMENT,
|
||||
phone VARCHAR(10),
|
||||
limit_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY(id)
|
||||
);
|
||||
SQL;
|
||||
$this->Dbo->execute($sql);
|
||||
$model = new Model(array(
|
||||
'table' => 'timestamp_default_values',
|
||||
'ds' => 'test',
|
||||
'alias' => 'TimestampDefaultValue'
|
||||
));
|
||||
$result = $this->Dbo->describe($model);
|
||||
$this->Dbo->execute('DROP TABLE ' . $name);
|
||||
|
||||
$this->assertNull($result['limit_date']['default']);
|
||||
|
||||
$schema = new CakeSchema(array(
|
||||
'connection' => 'test',
|
||||
'testdescribes' => $result
|
||||
));
|
||||
$result = $this->Dbo->createSchema($schema);
|
||||
$this->assertContains('`limit_date` datetime NOT NULL,', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* test that a describe() gets additional fieldParameters
|
||||
*
|
||||
|
@ -4092,4 +4130,17 @@ SQL;
|
|||
$this->assertEquals("'a'", $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test isConnected
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testIsConnected() {
|
||||
$this->Dbo->disconnect();
|
||||
$this->assertFalse($this->Dbo->isConnected(), 'Not connected now.');
|
||||
|
||||
$this->Dbo->connect();
|
||||
$this->assertTrue($this->Dbo->isConnected(), 'Should be connected.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -387,6 +387,34 @@ class ModelWriteTest extends BaseModelTest {
|
|||
$this->assertEquals($whitelist, $model->whitelist);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that save() with a fieldList continues to write
|
||||
* updated in all cases.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testSaveUpdatedWithFieldList() {
|
||||
$this->loadFixtures('Post', 'Author');
|
||||
$model = ClassRegistry::init('Post');
|
||||
$original = $model->find('first', array(
|
||||
'conditions' => array('Post.id' => 1)
|
||||
));
|
||||
$data = array(
|
||||
'Post' => array(
|
||||
'id' => 1,
|
||||
'title' => 'New title',
|
||||
'updated' => '1999-01-01 00:00:00',
|
||||
)
|
||||
);
|
||||
$model->save($data, array(
|
||||
'fieldList' => array('title')
|
||||
));
|
||||
$new = $model->find('first', array(
|
||||
'conditions' => array('Post.id' => 1)
|
||||
));
|
||||
$this->assertGreaterThan($original['Post']['updated'], $new['Post']['updated']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test save() resets the whitelist after afterSave
|
||||
*
|
||||
|
@ -1960,8 +1988,8 @@ class ModelWriteTest extends BaseModelTest {
|
|||
'title' => 'New Article With Tags and fieldList',
|
||||
'body' => '',
|
||||
'published' => 'N',
|
||||
'created' => '',
|
||||
'updated' => ''
|
||||
'created' => static::date(),
|
||||
'updated' => static::date(),
|
||||
),
|
||||
'Tag' => array(
|
||||
0 => array(
|
||||
|
|
|
@ -4781,7 +4781,6 @@ class MysqlTestModel extends Model {
|
|||
|
||||
/**
|
||||
* Test model for datasource prefixes
|
||||
*
|
||||
*/
|
||||
class PrefixTestModel extends CakeTestModel {
|
||||
}
|
||||
|
|
|
@ -318,12 +318,6 @@ class CakeRequestTest extends CakeTestCase {
|
|||
$request->reConstruct();
|
||||
$this->assertEquals($data, $request->data);
|
||||
|
||||
$data = array(
|
||||
'data' => array(
|
||||
'Article' => array('title' => 'Testing'),
|
||||
),
|
||||
'action' => 'update'
|
||||
);
|
||||
$request = $this->getMock('TestCakeRequest', array('_readInput'));
|
||||
$request->expects($this->at(0))->method('_readInput')
|
||||
->will($this->returnValue('data[Article][title]=Testing&action=update'));
|
||||
|
@ -2261,7 +2255,7 @@ class CakeRequestTest extends CakeTestCase {
|
|||
|
||||
// Checking if requested
|
||||
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'es_mx,en_ca';
|
||||
$result = CakeRequest::acceptLanguage();
|
||||
CakeRequest::acceptLanguage();
|
||||
|
||||
$result = CakeRequest::acceptLanguage('en-ca');
|
||||
$this->assertTrue($result);
|
||||
|
|
|
@ -566,7 +566,7 @@ class CakeResponseTest extends CakeTestCase {
|
|||
$response->send();
|
||||
|
||||
ob_start();
|
||||
$response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent'));
|
||||
$this->getMock('CakeResponse', array('_sendHeader', '_sendContent'));
|
||||
$goofyOutput = 'I am goofily sending output in the controller';
|
||||
echo $goofyOutput;
|
||||
$response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent'));
|
||||
|
@ -1746,7 +1746,7 @@ class CakeResponseTest extends CakeTestCase {
|
|||
);
|
||||
|
||||
$this->assertEquals(416, $response->statusCode());
|
||||
$result = $response->send();
|
||||
$response->send();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1787,7 +1787,7 @@ class CakeResponseTest extends CakeTestCase {
|
|||
);
|
||||
|
||||
ob_start();
|
||||
$result = $response->send();
|
||||
$response->send();
|
||||
ob_get_clean();
|
||||
}
|
||||
|
||||
|
@ -1876,7 +1876,7 @@ class CakeResponseTest extends CakeTestCase {
|
|||
);
|
||||
|
||||
$this->assertEquals(416, $response->statusCode());
|
||||
$result = $response->send();
|
||||
$response->send();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,7 +21,6 @@ App::uses('File', 'Utility');
|
|||
|
||||
/**
|
||||
* Help to test CakeEmail
|
||||
*
|
||||
*/
|
||||
class TestCakeEmail extends CakeEmail {
|
||||
|
||||
|
@ -36,7 +35,6 @@ class TestCakeEmail extends CakeEmail {
|
|||
|
||||
/**
|
||||
* Config
|
||||
*
|
||||
*/
|
||||
protected $_config = array();
|
||||
|
||||
|
@ -89,7 +87,6 @@ class TestCakeEmail extends CakeEmail {
|
|||
|
||||
/**
|
||||
* EmailConfig class
|
||||
*
|
||||
*/
|
||||
class TestEmailConfig {
|
||||
|
||||
|
@ -135,7 +132,6 @@ class TestEmailConfig {
|
|||
/**
|
||||
* ExtendTransport class
|
||||
* test class to ensure the class has send() method
|
||||
*
|
||||
*/
|
||||
class ExtendTransport {
|
||||
|
||||
|
@ -217,7 +213,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->assertSame($this->CakeEmail, $result);
|
||||
|
||||
$this->setExpectedException('SocketException');
|
||||
$result = $this->CakeEmail->from(array('cake@cakephp.org' => 'CakePHP', 'fail@cakephp.org' => 'From can only be one address'));
|
||||
$this->CakeEmail->from(array('cake@cakephp.org' => 'CakePHP', 'fail@cakephp.org' => 'From can only be one address'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -866,7 +862,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
|
||||
$this->setExpectedException('SocketException');
|
||||
$this->CakeEmail->transport('Invalid');
|
||||
$result = $this->CakeEmail->transportClass();
|
||||
$this->CakeEmail->transportClass();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -955,7 +951,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->assertEquals($expected, $this->CakeEmail->transportClass()->config());
|
||||
|
||||
$this->CakeEmail->config(array('log' => true));
|
||||
$result = $this->CakeEmail->transportClass()->config();
|
||||
$this->CakeEmail->transportClass()->config();
|
||||
$expected += array('log' => true);
|
||||
$this->assertEquals($expected, $this->CakeEmail->transportClass()->config());
|
||||
|
||||
|
@ -2028,7 +2024,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->assertEquals('html', $result);
|
||||
|
||||
$this->setExpectedException('SocketException');
|
||||
$result = $this->CakeEmail->emailFormat('invalid');
|
||||
$this->CakeEmail->emailFormat('invalid');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2288,10 +2284,10 @@ class CakeEmailTest extends CakeTestCase {
|
|||
protected function _getEmailByOldStyleCharset($charset, $headerCharset) {
|
||||
$email = new CakeEmail(array('transport' => 'Debug'));
|
||||
|
||||
if (! empty($charset)) {
|
||||
if (!empty($charset)) {
|
||||
$email->charset = $charset;
|
||||
}
|
||||
if (! empty($headerCharset)) {
|
||||
if (!empty($headerCharset)) {
|
||||
$email->headerCharset = $headerCharset;
|
||||
}
|
||||
|
||||
|
@ -2312,10 +2308,10 @@ class CakeEmailTest extends CakeTestCase {
|
|||
protected function _getEmailByNewStyleCharset($charset, $headerCharset) {
|
||||
$email = new CakeEmail(array('transport' => 'Debug'));
|
||||
|
||||
if (! empty($charset)) {
|
||||
if (!empty($charset)) {
|
||||
$email->charset($charset);
|
||||
}
|
||||
if (! empty($headerCharset)) {
|
||||
if (!empty($headerCharset)) {
|
||||
$email->headerCharset($headerCharset);
|
||||
}
|
||||
|
||||
|
@ -2385,7 +2381,6 @@ class CakeEmailTest extends CakeTestCase {
|
|||
style="font-weight: bold">The tag is across multiple lines</th>
|
||||
</table>
|
||||
HTML;
|
||||
$length = strlen($str);
|
||||
$message = $str . str_repeat('x', CakeEmail::LINE_LENGTH_MUST + 1);
|
||||
|
||||
$this->CakeEmail->reset();
|
||||
|
|
|
@ -22,7 +22,6 @@ App::uses('DebugTransport', 'Network/Email');
|
|||
|
||||
/**
|
||||
* Test case
|
||||
*
|
||||
*/
|
||||
class DebugTransportTest extends CakeTestCase {
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ App::uses('MailTransport', 'Network/Email');
|
|||
|
||||
/**
|
||||
* Test case
|
||||
*
|
||||
*/
|
||||
class MailTransportTest extends CakeTestCase {
|
||||
|
||||
|
|
|
@ -22,14 +22,13 @@ App::uses('SmtpTransport', 'Network/Email');
|
|||
|
||||
/**
|
||||
* Help to test SmtpTransport
|
||||
*
|
||||
*/
|
||||
class SmtpTestTransport extends SmtpTransport {
|
||||
|
||||
/**
|
||||
* Helper to change the socket
|
||||
*
|
||||
* @param object $socket
|
||||
* @param CakeSocket $socket A socket.
|
||||
* @return void
|
||||
*/
|
||||
public function setSocket(CakeSocket $socket) {
|
||||
|
@ -39,7 +38,7 @@ class SmtpTestTransport extends SmtpTransport {
|
|||
/**
|
||||
* Helper to change the CakeEmail
|
||||
*
|
||||
* @param object $cakeEmail
|
||||
* @param object $cakeEmail An email object.
|
||||
* @return void
|
||||
*/
|
||||
public function setCakeEmail($cakeEmail) {
|
||||
|
@ -57,8 +56,8 @@ class SmtpTestTransport extends SmtpTransport {
|
|||
/**
|
||||
* Magic function to call protected methods
|
||||
*
|
||||
* @param string $method
|
||||
* @param string $args
|
||||
* @param string $method The method to call.
|
||||
* @param string $args The arguments.
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call($method, $args) {
|
||||
|
@ -70,7 +69,6 @@ class SmtpTestTransport extends SmtpTransport {
|
|||
|
||||
/**
|
||||
* Test case
|
||||
*
|
||||
*/
|
||||
class SmtpTransportTest extends CakeTestCase {
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ class TestAuthentication {
|
|||
/**
|
||||
* authentication method
|
||||
*
|
||||
* @param HttpSocket $http
|
||||
* @param array $authInfo
|
||||
* @param HttpSocket $http A HTTP socket.
|
||||
* @param array &$authInfo Some auth info.
|
||||
* @return void
|
||||
*/
|
||||
public static function authentication(HttpSocket $http, &$authInfo) {
|
||||
|
@ -40,8 +40,8 @@ class TestAuthentication {
|
|||
/**
|
||||
* proxyAuthentication method
|
||||
*
|
||||
* @param HttpSocket $http
|
||||
* @param array $proxyInfo
|
||||
* @param HttpSocket $http A HTTP socket.
|
||||
* @param array &$proxyInfo Some proxy info.
|
||||
* @return void
|
||||
*/
|
||||
public static function proxyAuthentication(HttpSocket $http, &$proxyInfo) {
|
||||
|
@ -52,7 +52,6 @@ class TestAuthentication {
|
|||
|
||||
/**
|
||||
* CustomResponse
|
||||
*
|
||||
*/
|
||||
class CustomResponse {
|
||||
|
||||
|
@ -66,6 +65,7 @@ class CustomResponse {
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $message A message.
|
||||
*/
|
||||
public function __construct($message) {
|
||||
$this->first10 = substr($message, 0, 10);
|
||||
|
@ -75,7 +75,6 @@ class CustomResponse {
|
|||
|
||||
/**
|
||||
* TestHttpSocket
|
||||
*
|
||||
*/
|
||||
class TestHttpSocket extends HttpSocket {
|
||||
|
||||
|
@ -135,7 +134,6 @@ class TestHttpSocket extends HttpSocket {
|
|||
* Convenience method for testing protected method
|
||||
*
|
||||
* @param array $request Needs to contain a 'uri' key. Should also contain a 'method' key, otherwise defaults to GET.
|
||||
* @param string $versionToken The version token to use, defaults to HTTP/1.1
|
||||
* @return string Request line
|
||||
*/
|
||||
public function buildRequestLine($request = array()) {
|
||||
|
@ -583,7 +581,7 @@ class HttpSocketTest extends CakeTestCase {
|
|||
|
||||
$this->Socket->reset();
|
||||
$request = array('method' => 'POST', 'uri' => 'http://www.cakephp.org/posts/add', 'body' => array('name' => 'HttpSocket-is-released', 'date' => 'today'));
|
||||
$response = $this->Socket->request($request);
|
||||
$this->Socket->request($request);
|
||||
$this->assertEquals("name=HttpSocket-is-released&date=today", $this->Socket->request['body']);
|
||||
}
|
||||
|
||||
|
|
|
@ -258,7 +258,6 @@ class AssetDispatcherTest extends CakeTestCase {
|
|||
$file = file_get_contents($path);
|
||||
$this->assertEquals($file, $result);
|
||||
|
||||
$expected = filesize($path);
|
||||
$headers = $response->header();
|
||||
$this->assertFalse($headers['Content-Length']);
|
||||
}
|
||||
|
|
|
@ -47,14 +47,14 @@ class RedirectRouteTest extends CakeTestCase {
|
|||
$route = new RedirectRoute('/home', array('controller' => 'posts'));
|
||||
$route->stop = false;
|
||||
$route->response = $this->getMock('CakeResponse', array('_sendHeader'));
|
||||
$result = $route->parse('/home');
|
||||
$route->parse('/home');
|
||||
$header = $route->response->header();
|
||||
$this->assertEquals(Router::url('/posts', true), $header['Location']);
|
||||
|
||||
$route = new RedirectRoute('/home', array('controller' => 'posts', 'action' => 'index'));
|
||||
$route->stop = false;
|
||||
$route->response = $this->getMock('CakeResponse', array('_sendHeader'));
|
||||
$result = $route->parse('/home');
|
||||
$route->parse('/home');
|
||||
$header = $route->response->header();
|
||||
$this->assertEquals(Router::url('/posts', true), $header['Location']);
|
||||
$this->assertEquals(301, $route->response->statusCode());
|
||||
|
@ -62,14 +62,14 @@ class RedirectRouteTest extends CakeTestCase {
|
|||
$route = new RedirectRoute('/google', 'http://google.com');
|
||||
$route->stop = false;
|
||||
$route->response = $this->getMock('CakeResponse', array('_sendHeader'));
|
||||
$result = $route->parse('/google');
|
||||
$route->parse('/google');
|
||||
$header = $route->response->header();
|
||||
$this->assertEquals('http://google.com', $header['Location']);
|
||||
|
||||
$route = new RedirectRoute('/posts/*', array('controller' => 'posts', 'action' => 'view'), array('status' => 302));
|
||||
$route->stop = false;
|
||||
$route->response = $this->getMock('CakeResponse', array('_sendHeader'));
|
||||
$result = $route->parse('/posts/2');
|
||||
$route->parse('/posts/2');
|
||||
$header = $route->response->header();
|
||||
$this->assertEquals(Router::url('/posts/view', true), $header['Location']);
|
||||
$this->assertEquals(302, $route->response->statusCode());
|
||||
|
@ -77,35 +77,35 @@ class RedirectRouteTest extends CakeTestCase {
|
|||
$route = new RedirectRoute('/posts/*', array('controller' => 'posts', 'action' => 'view'), array('persist' => true));
|
||||
$route->stop = false;
|
||||
$route->response = $this->getMock('CakeResponse', array('_sendHeader'));
|
||||
$result = $route->parse('/posts/2');
|
||||
$route->parse('/posts/2');
|
||||
$header = $route->response->header();
|
||||
$this->assertEquals(Router::url('/posts/view/2', true), $header['Location']);
|
||||
|
||||
$route = new RedirectRoute('/posts/*', '/test', array('persist' => true));
|
||||
$route->stop = false;
|
||||
$route->response = $this->getMock('CakeResponse', array('_sendHeader'));
|
||||
$result = $route->parse('/posts/2');
|
||||
$route->parse('/posts/2');
|
||||
$header = $route->response->header();
|
||||
$this->assertEquals(Router::url('/test', true), $header['Location']);
|
||||
|
||||
$route = new RedirectRoute('/my_controllers/:action/*', array('controller' => 'tags', 'action' => 'add'), array('persist' => true));
|
||||
$route->stop = false;
|
||||
$route->response = $this->getMock('CakeResponse', array('_sendHeader'));
|
||||
$result = $route->parse('/my_controllers/do_something/passme/named:param');
|
||||
$route->parse('/my_controllers/do_something/passme/named:param');
|
||||
$header = $route->response->header();
|
||||
$this->assertEquals(Router::url('/tags/add/passme/named:param', true), $header['Location']);
|
||||
|
||||
$route = new RedirectRoute('/my_controllers/:action/*', array('controller' => 'tags', 'action' => 'add'));
|
||||
$route->stop = false;
|
||||
$route->response = $this->getMock('CakeResponse', array('_sendHeader'));
|
||||
$result = $route->parse('/my_controllers/do_something/passme/named:param');
|
||||
$route->parse('/my_controllers/do_something/passme/named:param');
|
||||
$header = $route->response->header();
|
||||
$this->assertEquals(Router::url('/tags/add', true), $header['Location']);
|
||||
|
||||
$route = new RedirectRoute('/:lang/my_controllers', array('controller' => 'tags', 'action' => 'add'), array('lang' => '(nl|en)', 'persist' => array('lang')));
|
||||
$route->stop = false;
|
||||
$route->response = $this->getMock('CakeResponse', array('_sendHeader'));
|
||||
$result = $route->parse('/nl/my_controllers/');
|
||||
$route->parse('/nl/my_controllers/');
|
||||
$header = $route->response->header();
|
||||
$this->assertEquals(Router::url('/tags/add/lang:nl', true), $header['Location']);
|
||||
|
||||
|
@ -114,7 +114,7 @@ class RedirectRouteTest extends CakeTestCase {
|
|||
$route = new RedirectRoute('/:lang/my_controllers', array('controller' => 'tags', 'action' => 'add'), array('lang' => '(nl|en)', 'persist' => array('lang')));
|
||||
$route->stop = false;
|
||||
$route->response = $this->getMock('CakeResponse', array('_sendHeader'));
|
||||
$result = $route->parse('/nl/my_controllers/');
|
||||
$route->parse('/nl/my_controllers/');
|
||||
$header = $route->response->header();
|
||||
$this->assertEquals(Router::url('/nl/preferred_controllers', true), $header['Location']);
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ class RouterTest extends CakeTestCase {
|
|||
));
|
||||
CakePlugin::load('TestPlugin');
|
||||
App::uses('TestRoute', 'TestPlugin.Routing/Route');
|
||||
$resources = Router::mapResources('Posts', array(
|
||||
Router::mapResources('Posts', array(
|
||||
'connectOptions' => array(
|
||||
'routeClass' => 'TestPlugin.TestRoute',
|
||||
'foo' => '^(bar)$',
|
||||
|
@ -238,7 +238,7 @@ class RouterTest extends CakeTestCase {
|
|||
$this->assertEquals($expected, $result);
|
||||
$this->assertEquals(array('test_plugin'), $resources);
|
||||
|
||||
$resources = Router::mapResources('Posts', array('prefix' => 'api'));
|
||||
Router::mapResources('Posts', array('prefix' => 'api'));
|
||||
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$result = Router::parse('/api/posts');
|
||||
|
@ -1579,7 +1579,7 @@ class RouterTest extends CakeTestCase {
|
|||
$request->base = '/';
|
||||
Router::setRequestInfo($request);
|
||||
|
||||
$result = Router::parse('/admin/controller/index/type:whatever');
|
||||
Router::parse('/admin/controller/index/type:whatever');
|
||||
$result = Router::url(array('type' => 'new'));
|
||||
$expected = "/admin/controller/index/type:new";
|
||||
$this->assertEquals($expected, $result);
|
||||
|
|
|
@ -327,7 +327,6 @@ class CakeTestCaseTest extends CakeTestCase {
|
|||
*/
|
||||
public function testAssertTextStartsWith() {
|
||||
$stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!";
|
||||
$stringClean = "some\nstring\nwith\ndifferent\nline endings!";
|
||||
|
||||
$this->assertStringStartsWith("some\nstring", $stringDirty);
|
||||
$this->assertStringStartsNotWith("some\r\nstring\r\nwith", $stringDirty);
|
||||
|
@ -344,8 +343,6 @@ class CakeTestCaseTest extends CakeTestCase {
|
|||
*/
|
||||
public function testAssertTextStartsNotWith() {
|
||||
$stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!";
|
||||
$stringClean = "some\nstring\nwith\ndifferent\nline endings!";
|
||||
|
||||
$this->assertTextStartsNotWith("some\nstring\nwithout", $stringDirty);
|
||||
}
|
||||
|
||||
|
@ -356,8 +353,6 @@ class CakeTestCaseTest extends CakeTestCase {
|
|||
*/
|
||||
public function testAssertTextEndsWith() {
|
||||
$stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!";
|
||||
$stringClean = "some\nstring\nwith\ndifferent\nline endings!";
|
||||
|
||||
$this->assertTextEndsWith("string\nwith\r\ndifferent\rline endings!", $stringDirty);
|
||||
$this->assertTextEndsWith("string\r\nwith\ndifferent\nline endings!", $stringDirty);
|
||||
}
|
||||
|
@ -369,8 +364,6 @@ class CakeTestCaseTest extends CakeTestCase {
|
|||
*/
|
||||
public function testAssertTextEndsNotWith() {
|
||||
$stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!";
|
||||
$stringClean = "some\nstring\nwith\ndifferent\nline endings!";
|
||||
|
||||
$this->assertStringEndsNotWith("different\nline endings", $stringDirty);
|
||||
$this->assertTextEndsNotWith("different\rline endings", $stringDirty);
|
||||
}
|
||||
|
@ -382,11 +375,8 @@ class CakeTestCaseTest extends CakeTestCase {
|
|||
*/
|
||||
public function testAssertTextContains() {
|
||||
$stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!";
|
||||
$stringClean = "some\nstring\nwith\ndifferent\nline endings!";
|
||||
|
||||
$this->assertContains("different", $stringDirty);
|
||||
$this->assertNotContains("different\rline", $stringDirty);
|
||||
|
||||
$this->assertTextContains("different\rline", $stringDirty);
|
||||
}
|
||||
|
||||
|
@ -397,8 +387,6 @@ class CakeTestCaseTest extends CakeTestCase {
|
|||
*/
|
||||
public function testAssertTextNotContains() {
|
||||
$stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!";
|
||||
$stringClean = "some\nstring\nwith\ndifferent\nline endings!";
|
||||
|
||||
$this->assertTextNotContains("different\rlines", $stringDirty);
|
||||
}
|
||||
|
||||
|
@ -460,7 +448,7 @@ class CakeTestCaseTest extends CakeTestCase {
|
|||
), App::RESET);
|
||||
CakePlugin::load('TestPlugin');
|
||||
$this->getMockForModel('TestPlugin.TestPluginAppModel');
|
||||
$TestPluginComment = $this->getMockForModel('TestPlugin.TestPluginComment');
|
||||
$this->getMockForModel('TestPlugin.TestPluginComment');
|
||||
|
||||
$result = ClassRegistry::init('TestPlugin.TestPluginComment');
|
||||
$this->assertInstanceOf('TestPluginComment', $result);
|
||||
|
|
|
@ -534,7 +534,7 @@ class CakeTestFixtureTest extends CakeTestCase {
|
|||
*/
|
||||
public function testInsertInvalid() {
|
||||
$Fixture = new InvalidTestFixture();
|
||||
$return = $Fixture->insert($this->criticDb);
|
||||
$Fixture->insert($this->criticDb);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -276,7 +276,7 @@ class ControllerTestCaseTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testTestAction() {
|
||||
$Controller = $this->Case->generate('TestsApps');
|
||||
$this->Case->generate('TestsApps');
|
||||
$this->Case->testAction('/tests_apps/index');
|
||||
$this->assertInternalType('array', $this->Case->controller->viewVars);
|
||||
|
||||
|
@ -306,7 +306,7 @@ class ControllerTestCaseTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testTestActionArrayUrls() {
|
||||
$Controller = $this->Case->generate('TestsApps');
|
||||
$this->Case->generate('TestsApps');
|
||||
$this->Case->testAction(array('controller' => 'tests_apps', 'action' => 'index'));
|
||||
$this->assertInternalType('array', $this->Case->controller->viewVars);
|
||||
}
|
||||
|
@ -452,7 +452,7 @@ class ControllerTestCaseTest extends CakeTestCase {
|
|||
public function testTestActionGetData() {
|
||||
$this->Case->autoMock = true;
|
||||
|
||||
$result = $this->Case->testAction('/tests_apps_posts/url_var', array(
|
||||
$this->Case->testAction('/tests_apps_posts/url_var', array(
|
||||
'method' => 'get',
|
||||
'data' => array(
|
||||
'some' => 'var',
|
||||
|
@ -474,7 +474,7 @@ class ControllerTestCaseTest extends CakeTestCase {
|
|||
));
|
||||
$this->assertEquals(array('gogo', 'val2'), $result['params']['pass']);
|
||||
|
||||
$result = $this->Case->testAction('/tests_apps_posts/url_var', array(
|
||||
$this->Case->testAction('/tests_apps_posts/url_var', array(
|
||||
'return' => 'vars',
|
||||
'method' => 'get',
|
||||
'data' => array(
|
||||
|
|
|
@ -1026,7 +1026,7 @@ class FolderTest extends CakeTestCase {
|
|||
extract($this->_setupFilesystem());
|
||||
|
||||
$Folder = new Folder($folderOne);
|
||||
$result = $Folder->copy(array('to' => $folderThree, 'scheme' => Folder::OVERWRITE));
|
||||
$Folder->copy(array('to' => $folderThree, 'scheme' => Folder::OVERWRITE));
|
||||
|
||||
$this->assertTrue(file_exists($folderThree . DS . 'file1.php'));
|
||||
$this->assertTrue(file_exists($folderThree . DS . 'folderA' . DS . 'fileA.php'));
|
||||
|
|
|
@ -27,8 +27,8 @@ class GenericObject {
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param GenericObjectCollection $collection
|
||||
* @param array $settings
|
||||
* @param GenericObjectCollection $collection A collection.
|
||||
* @param array $settings Settings.
|
||||
*/
|
||||
public function __construct(GenericObjectCollection $collection, $settings = array()) {
|
||||
$this->_Collection = $collection;
|
||||
|
|
|
@ -154,7 +154,7 @@ class SanitizeTest extends CakeTestCase {
|
|||
$string = '';
|
||||
$expected = '';
|
||||
$result = Sanitize::clean($string, array('connection' => 'test'));
|
||||
$this->assertEquals($expected, $string);
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$data = array(
|
||||
'Grant' => array(
|
||||
|
|
|
@ -324,7 +324,7 @@ class SecurityTest extends CakeTestCase {
|
|||
public function testDecryptKeyFailure() {
|
||||
$txt = 'The quick brown fox';
|
||||
$key = 'This key is longer than 32 bytes long.';
|
||||
$result = Security::encrypt($txt, $key);
|
||||
Security::encrypt($txt, $key);
|
||||
|
||||
$key = 'Not the same key. This one will fail';
|
||||
$this->assertFalse(Security::decrypt($txt, $key), 'Modified key will fail.');
|
||||
|
|
|
@ -2763,7 +2763,6 @@ class SetTest extends CakeTestCase {
|
|||
/**
|
||||
* testSetApply method
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
public function testApply() {
|
||||
$data = array(
|
||||
|
|
|
@ -28,7 +28,7 @@ class CustomValidator {
|
|||
/**
|
||||
* Makes sure that a given $email address is valid and unique
|
||||
*
|
||||
* @param string $email
|
||||
* @param string $check Email to check.
|
||||
* @return bool
|
||||
*/
|
||||
public static function customValidate($check) {
|
||||
|
|
|
@ -175,7 +175,7 @@ class XmlTest extends CakeTestCase {
|
|||
*/
|
||||
public function testBuildFromFileWhenDisabled() {
|
||||
$xml = CAKE . 'Test' . DS . 'Fixture' . DS . 'sample.xml';
|
||||
$obj = Xml::build($xml, array('readFile' => false));
|
||||
Xml::build($xml, array('readFile' => false));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -186,7 +186,7 @@ class XmlTest extends CakeTestCase {
|
|||
*/
|
||||
public function testBuildFromUrlWhenDisabled() {
|
||||
$xml = 'http://www.google.com';
|
||||
$obj = Xml::build($xml, array('readFile' => false));
|
||||
Xml::build($xml, array('readFile' => false));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -222,7 +222,7 @@ class XmlTest extends CakeTestCase {
|
|||
*/
|
||||
public function testBuildInvalidDataSimpleXml() {
|
||||
$input = '<derp';
|
||||
$xml = Xml::build($input, array('return' => 'simplexml'));
|
||||
Xml::build($input, array('return' => 'simplexml'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
App::uses('AppController', 'Controller');
|
||||
/**
|
||||
* Articles Controller
|
||||
*
|
||||
*/
|
||||
class ArticlesController extends AppController {
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Test suite app/Model/Datasource/Session session handler
|
||||
*
|
||||
*/
|
||||
|
||||
App::uses('CakeSessionHandlerInterface', 'Model/Datasource/Session');
|
||||
|
|
|
@ -8,4 +8,3 @@ test plugin error500
|
|||
if (Configure::read('debug') > 0):
|
||||
echo $this->element('exception_stack_trace');
|
||||
endif;
|
||||
?>
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
<?php
|
||||
echo $this->Html->link('Test', 'http://example.com');
|
||||
?>
|
|
@ -4,4 +4,3 @@ $content = explode("\n", $content);
|
|||
foreach ($content as $line):
|
||||
echo '<p> ' . $line . '</p>';
|
||||
endforeach;
|
||||
?>
|
|
@ -1,2 +1,3 @@
|
|||
Ajax!
|
||||
<?php echo $this->fetch('content'); ?>
|
||||
<?php
|
||||
echo $this->fetch('content');
|
|
@ -13,5 +13,3 @@ echo $this->Rss->document(
|
|||
array(), $channel, $this->fetch('content')
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue