Permalink
Browse files

Merge branch '1.3-misc' into 1.3

  • Loading branch information...
2 parents d118c6a + e404288 commit bf2b8a60e6acdda8b3a2d4a16a69b5d1631913cf gwoo committed Aug 2, 2009
View
@@ -89,6 +89,7 @@ function config() {
* </code>
*
* @param string $name Filename without the .php part
+ * @deprecated
*/
function uses() {
$args = func_get_args();
@@ -475,7 +475,7 @@ function createFile ($path, $contents) {
}
}
if (!class_exists('File')) {
- uses('file');
+ require LIBS . 'file.php';
}
if ($File = new File($path, true)) {
@@ -200,7 +200,7 @@ function securitySalt($path) {
$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 @@
* 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'));
View
@@ -29,7 +29,7 @@
*
*/
if (!class_exists('Object')) {
- uses('object');
+ require LIBS . 'object.php';
}
if (!class_exists('Folder')) {
require LIBS . 'folder.php';
View
@@ -29,7 +29,7 @@
*
*/
if (!class_exists('Object')) {
- uses('object');
+ require LIBS . 'object.php';
}
/**
View
@@ -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 @@ function setup(&$model, $config = array()) {
$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')) {
View
@@ -157,7 +157,7 @@ function _stop($status = 0) {
*/
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 @@ function testEnv() {
*
* @access public
* @return void
+ * @deprecated
*/
function testUses() {
$this->skipIf(class_exists('Security') || class_exists('Sanitize'), '%s Security and/or Sanitize class already loaded');
@@ -587,15 +588,15 @@ function testDebug() {
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);
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) . '.*&lt;div&gt;this-is-a-test&lt;\/div&gt;.*/s';
$this->assertPattern($pattern, $result);

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1777,7 +1777,6 @@ function testMapReverse() {
$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),
Oops, something went wrong.

0 comments on commit bf2b8a6

Please sign in to comment.