mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Merge branch '1.3-misc' into 1.3
This commit is contained in:
commit
bf2b8a60e6
19 changed files with 32 additions and 87 deletions
|
@ -89,6 +89,7 @@ if (!function_exists('clone')) {
|
|||
* </code>
|
||||
*
|
||||
* @param string $name Filename without the .php part
|
||||
* @deprecated
|
||||
*/
|
||||
function uses() {
|
||||
$args = func_get_args();
|
||||
|
|
|
@ -475,7 +475,7 @@ class Shell extends Object {
|
|||
}
|
||||
}
|
||||
if (!class_exists('File')) {
|
||||
uses('file');
|
||||
require LIBS . 'file.php';
|
||||
}
|
||||
|
||||
if ($File = new File($path, true)) {
|
||||
|
|
|
@ -200,7 +200,7 @@ class ProjectTask extends Shell {
|
|||
$contents = $File->read();
|
||||
if (preg_match('/([\\t\\x20]*Configure::write\\(\\\'Security.salt\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
|
||||
if (!class_exists('Security')) {
|
||||
uses('Security');
|
||||
require LIBS . 'security.php';
|
||||
}
|
||||
$string = Security::generateAuthKey();
|
||||
$result = str_replace($match[0], "\t" . 'Configure::write(\'Security.salt\', \''.$string.'\');', $contents);
|
||||
|
|
|
@ -52,7 +52,9 @@ endif;
|
|||
</p>
|
||||
<?php
|
||||
if (!empty(\$filePresent)):
|
||||
uses('model' . DS . 'connection_manager');
|
||||
if (!class_exists('ConnectionManager')) {
|
||||
require LIBS . 'model' . DS . 'connection_manager.php';
|
||||
}
|
||||
\$db = ConnectionManager::getInstance();
|
||||
\$connected = \$db->getDataSource('default');
|
||||
?>
|
||||
|
|
|
@ -34,7 +34,7 @@ if (!defined('CAKE_CORE_INCLUDE_PATH')) {
|
|||
* Enter description here...
|
||||
*/
|
||||
if (!class_exists('File')) {
|
||||
uses('file');
|
||||
require LIBS . 'file.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -219,7 +219,7 @@ class DbAcl extends AclBase {
|
|||
function __construct() {
|
||||
parent::__construct();
|
||||
if (!class_exists('AclNode')) {
|
||||
uses('model' . DS . 'db_acl');
|
||||
require LIBS . 'model' . DS . 'db_acl.php';
|
||||
}
|
||||
$this->Aro =& ClassRegistry::init(array('class' => 'Aro', 'alias' => 'Aro'));
|
||||
$this->Aco =& ClassRegistry::init(array('class' => 'Aco', 'alias' => 'Aco'));
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
*
|
||||
*/
|
||||
if (!class_exists('Object')) {
|
||||
uses('object');
|
||||
require LIBS . 'object.php';
|
||||
}
|
||||
if (!class_exists('Folder')) {
|
||||
require LIBS . 'folder.php';
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
*
|
||||
*/
|
||||
if (!class_exists('Object')) {
|
||||
uses('object');
|
||||
require LIBS . 'object.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,8 +23,11 @@
|
|||
* @lastmodified $Date$
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
if (!class_exists('Object')) {
|
||||
require LIBS . 'object.php';
|
||||
}
|
||||
if (!class_exists('File')) {
|
||||
uses('object', 'file');
|
||||
require LIBS . 'file.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -59,7 +59,7 @@ class AclBehavior extends ModelBehavior {
|
|||
|
||||
$type = $this->__typeMaps[$this->settings[$model->name]['type']];
|
||||
if (!class_exists('AclNode')) {
|
||||
uses('model' . DS . 'db_acl');
|
||||
require LIBS . 'model' . DS . 'db_acl.php';
|
||||
}
|
||||
$model->{$type} =& ClassRegistry::init($type);
|
||||
if (!method_exists($model, 'parentNode')) {
|
||||
|
|
|
@ -157,7 +157,7 @@ class Object {
|
|||
*/
|
||||
function log($msg, $type = LOG_ERROR) {
|
||||
if (!class_exists('CakeLog')) {
|
||||
uses('cake_log');
|
||||
require LIBS . 'cake_log.php';
|
||||
}
|
||||
if (is_null($this->_log)) {
|
||||
$this->_log = new CakeLog();
|
||||
|
|
|
@ -79,7 +79,9 @@ endif;
|
|||
</p>
|
||||
<?php
|
||||
if (isset($filePresent)):
|
||||
uses('model' . DS . 'connection_manager');
|
||||
if (!class_exists('ConnectionManager')) {
|
||||
require LIBS . 'model' . DS . 'connection_manager.php';
|
||||
}
|
||||
$db = ConnectionManager::getInstance();
|
||||
@$connected = $db->getDataSource('default');
|
||||
?>
|
||||
|
|
|
@ -153,6 +153,7 @@ class BasicsTest extends CakeTestCase {
|
|||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @deprecated
|
||||
*/
|
||||
function testUses() {
|
||||
$this->skipIf(class_exists('Security') || class_exists('Sanitize'), '%s Security and/or Sanitize class already loaded');
|
||||
|
@ -587,7 +588,7 @@ class BasicsTest extends CakeTestCase {
|
|||
ob_start();
|
||||
debug('this-is-a-test');
|
||||
$result = ob_get_clean();
|
||||
$pattern = '/.*\>(cake(\/|\\\)tests(\/|\\\)cases(\/|\\\)basics\.test\.php|';
|
||||
$pattern = '/.*\>(.+?cake(\/|\\\)tests(\/|\\\)cases(\/|\\\)basics\.test\.php|';
|
||||
$pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
|
||||
$pattern .= '.*line.*' . (__LINE__ - 4) . '.*this-is-a-test.*/s';
|
||||
$this->assertPattern($pattern, $result);
|
||||
|
@ -595,7 +596,7 @@ class BasicsTest extends CakeTestCase {
|
|||
ob_start();
|
||||
debug('<div>this-is-a-test</div>', true);
|
||||
$result = ob_get_clean();
|
||||
$pattern = '/.*\>(cake(\/|\\\)tests(\/|\\\)cases(\/|\\\)basics\.test\.php|';
|
||||
$pattern = '/.*\>(.+?cake(\/|\\\)tests(\/|\\\)cases(\/|\\\)basics\.test\.php|';
|
||||
$pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
|
||||
$pattern .= '.*line.*' . (__LINE__ - 4) . '.*<div>this-is-a-test<\/div>.*/s';
|
||||
$this->assertPattern($pattern, $result);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1777,7 +1777,6 @@ class SetTest extends CakeTestCase {
|
|||
$result = Set::reverse($class);
|
||||
$this->assertIdentical($result, $expected);
|
||||
|
||||
uses('model'.DS.'model');
|
||||
$model = new Model(array('id' => false, 'name' => 'Model', 'table' => false));
|
||||
$expected = array(
|
||||
'Behaviors' => array('modelName' => 'Model', '_attached' => array(), '_disabled' => array(), '__methods' => array(), '__mappedMethods' => array(), '_log' => null),
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id$ */
|
||||
|
||||
/**
|
||||
* AjaxHelperTest file
|
||||
*
|
||||
|
@ -28,17 +27,7 @@
|
|||
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
|
||||
define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
|
||||
}
|
||||
uses(
|
||||
'view' . DS . 'helpers' . DS . 'app_helper',
|
||||
'controller' . DS . 'controller',
|
||||
'model' . DS . 'model',
|
||||
'view' . DS . 'helper',
|
||||
'view' . DS . 'helpers'.DS.'ajax',
|
||||
'view' . DS . 'helpers' . DS . 'html',
|
||||
'view' . DS . 'helpers' . DS . 'form',
|
||||
'view' . DS . 'helpers' . DS . 'javascript'
|
||||
);
|
||||
|
||||
App::import('Helper', array('Html', 'Form', 'Javascript', 'Ajax'));
|
||||
/**
|
||||
* AjaxTestController class
|
||||
*
|
||||
|
@ -46,7 +35,6 @@ uses(
|
|||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
*/
|
||||
class AjaxTestController extends Controller {
|
||||
|
||||
/**
|
||||
* name property
|
||||
*
|
||||
|
@ -54,7 +42,6 @@ class AjaxTestController extends Controller {
|
|||
* @access public
|
||||
*/
|
||||
var $name = 'AjaxTest';
|
||||
|
||||
/**
|
||||
* uses property
|
||||
*
|
||||
|
@ -63,7 +50,6 @@ class AjaxTestController extends Controller {
|
|||
*/
|
||||
var $uses = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* PostAjaxTest class
|
||||
*
|
||||
|
@ -71,7 +57,6 @@ class AjaxTestController extends Controller {
|
|||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
*/
|
||||
class PostAjaxTest extends Model {
|
||||
|
||||
/**
|
||||
* primaryKey property
|
||||
*
|
||||
|
@ -79,7 +64,6 @@ class PostAjaxTest extends Model {
|
|||
* @access public
|
||||
*/
|
||||
var $primaryKey = 'id';
|
||||
|
||||
/**
|
||||
* useTable property
|
||||
*
|
||||
|
@ -87,7 +71,6 @@ class PostAjaxTest extends Model {
|
|||
* @access public
|
||||
*/
|
||||
var $useTable = false;
|
||||
|
||||
/**
|
||||
* schema method
|
||||
*
|
||||
|
@ -103,7 +86,6 @@ class PostAjaxTest extends Model {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TestAjaxHelper class
|
||||
*
|
||||
|
@ -111,7 +93,6 @@ class PostAjaxTest extends Model {
|
|||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
*/
|
||||
class TestAjaxHelper extends AjaxHelper {
|
||||
|
||||
/**
|
||||
* stop method
|
||||
*
|
||||
|
@ -121,7 +102,6 @@ class TestAjaxHelper extends AjaxHelper {
|
|||
function _stop() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TestJavascriptHelper class
|
||||
*
|
||||
|
@ -129,7 +109,6 @@ class TestAjaxHelper extends AjaxHelper {
|
|||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
*/
|
||||
class TestJavascriptHelper extends JavascriptHelper {
|
||||
|
||||
/**
|
||||
* codeBlocks property
|
||||
*
|
||||
|
@ -137,7 +116,6 @@ class TestJavascriptHelper extends JavascriptHelper {
|
|||
* @access public
|
||||
*/
|
||||
var $codeBlocks;
|
||||
|
||||
/**
|
||||
* codeBlock method
|
||||
*
|
||||
|
@ -152,7 +130,6 @@ class TestJavascriptHelper extends JavascriptHelper {
|
|||
$this->codeBlocks[] = $parameter;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* AjaxTest class
|
||||
*
|
||||
|
@ -160,21 +137,18 @@ class TestJavascriptHelper extends JavascriptHelper {
|
|||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
*/
|
||||
class AjaxHelperTest extends CakeTestCase {
|
||||
|
||||
/**
|
||||
* Regexp for CDATA start block
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $cDataStart = 'preg:/^\/\/<!\[CDATA\[[\n\r]*/';
|
||||
|
||||
/**
|
||||
* Regexp for CDATA end block
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $cDataEnd = 'preg:/[^\]]*\]\]\>[\s\r\n]*/';
|
||||
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
|
@ -192,7 +166,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
ClassRegistry::addObject('view', $view);
|
||||
ClassRegistry::addObject('PostAjaxTest', new PostAjaxTest());
|
||||
}
|
||||
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
|
@ -203,7 +176,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
unset($this->Ajax);
|
||||
ClassRegistry::flush();
|
||||
}
|
||||
|
||||
/**
|
||||
* testEvalScripts method
|
||||
*
|
||||
|
@ -237,7 +209,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
);
|
||||
$this->assertTags($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* testAutoComplete method
|
||||
*
|
||||
|
@ -284,7 +255,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
$this->assertPattern('/{parameters:\'key=value&key2=value2\'}/', $result);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* testAsynchronous method
|
||||
*
|
||||
|
@ -305,7 +275,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
);
|
||||
$this->assertTags($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* testDraggable method
|
||||
*
|
||||
|
@ -327,7 +296,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
$this->assertPattern('/onDrag:doDrag/', $result);
|
||||
$this->assertPattern('/onEnd:doEnd/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testDroppable method
|
||||
*
|
||||
|
@ -375,7 +343,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
);
|
||||
$this->assertTags($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* testForm method
|
||||
*
|
||||
|
@ -390,7 +357,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
$this->assertPattern('/id="MyFormID"/', $result);
|
||||
$this->assertPattern('/name="SomeFormName"/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testSortable method
|
||||
*
|
||||
|
@ -464,7 +430,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
$expected = "Sortable.create('div', {scroll:$('someElement')});";
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* testSubmitWithIndicator method
|
||||
*
|
||||
|
@ -476,7 +441,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
$this->assertPattern('/onLoading:function\(request\) {doSomething\(\);\s+Element.show\(\'loading\'\);}/', $result);
|
||||
$this->assertPattern('/onComplete:function\(request, json\) {doSomethingElse\(\) ;\s+Element.hide\(\'loading\'\);}/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testLink method
|
||||
*
|
||||
|
@ -586,7 +550,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
$this->assertNoPattern('/^<a[^<>]+complete="test"[^<>]*>Ajax Link<\/a>/', $result);
|
||||
$this->assertNoPattern('/^<a\s+[^<>]*url="[^"]*"[^<>]*>/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testRemoteTimer method
|
||||
*
|
||||
|
@ -642,7 +605,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
$this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new PeriodicalExecuter\(function\(\) {.+}, 10\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result);
|
||||
$this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Request(\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true, postBody:\'var1=value1\'})')) . '/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testObserveField method
|
||||
*
|
||||
|
@ -674,7 +636,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
$this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new Form.Element.EventObserver\(\'field\', function\(element, value\) {.+}\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result);
|
||||
$this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Updater(\'divId\',\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true, parameters:Form.Element.serialize(\'otherField\'), requestHeaders:[\'X-Update\', \'divId\']})')) . '/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testObserveForm method
|
||||
*
|
||||
|
@ -722,7 +683,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
);
|
||||
$this->assertTags($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* testSlider method
|
||||
*
|
||||
|
@ -800,7 +760,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
);
|
||||
$this->assertTags($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* testRemoteFunction method
|
||||
*
|
||||
|
@ -824,7 +783,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
$expected = "if (confirm('Are you sure?')) { new Ajax.Updater('myDiv','/', {asynchronous:true, evalScripts:true, requestHeaders:['X-Update', 'myDiv']}); } else { event.returnValue = false; return false; }";
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* testDiv method
|
||||
*
|
||||
|
@ -857,7 +815,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
|
||||
$_SERVER['HTTP_X_UPDATE'] = $oldXUpdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* testAfterRender method
|
||||
*
|
||||
|
@ -885,7 +842,6 @@ class AjaxHelperTest extends CakeTestCase {
|
|||
|
||||
$_SERVER['HTTP_X_UPDATE'] = $oldXUpdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* testEditor method
|
||||
*
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id$ */
|
||||
|
||||
/**
|
||||
* JsHelperTest file
|
||||
*
|
||||
|
@ -28,14 +27,6 @@
|
|||
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
|
||||
define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
|
||||
}
|
||||
uses(
|
||||
'view' . DS . 'helpers' . DS . 'app_helper',
|
||||
'controller' . DS . 'controller',
|
||||
'model' . DS . 'model',
|
||||
'view' . DS . 'helper',
|
||||
'view' . DS . 'helpers' . DS . 'js'
|
||||
);
|
||||
|
||||
/**
|
||||
* JsHelperTest class
|
||||
*
|
||||
|
@ -43,7 +34,6 @@ uses(
|
|||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
*/
|
||||
class JsHelperTest extends UnitTestCase {
|
||||
|
||||
/**
|
||||
* skip method
|
||||
*
|
||||
|
@ -53,7 +43,6 @@ class JsHelperTest extends UnitTestCase {
|
|||
function skip() {
|
||||
$this->skipIf(true, '%s JsHelper test not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
|
@ -63,7 +52,6 @@ class JsHelperTest extends UnitTestCase {
|
|||
function setUp() {
|
||||
$this->Js = new JsHelper();
|
||||
}
|
||||
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
|
|
|
@ -51,7 +51,9 @@ endif;
|
|||
</p>
|
||||
<?php
|
||||
if (!empty($filePresent)):
|
||||
uses('model' . DS . 'connection_manager');
|
||||
if (!class_exists('ConnectionManager')) {
|
||||
require LIBS . 'model' . DS . 'connection_manager.php';
|
||||
}
|
||||
$db = ConnectionManager::getInstance();
|
||||
$connected = $db->getDataSource('default');
|
||||
?>
|
||||
|
|
|
@ -82,7 +82,9 @@
|
|||
</p>
|
||||
<?php
|
||||
if (!empty($filePresent)):
|
||||
uses('model' . DS . 'connection_manager');
|
||||
if (!class_exists('ConnectionManager')) {
|
||||
require LIBS . 'model' . DS . 'connection_manager.php';
|
||||
}
|
||||
$db = ConnectionManager::getInstance();
|
||||
$connected = $db->getDataSource('default');
|
||||
?>
|
||||
|
|
Loading…
Add table
Reference in a new issue