mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge branch '1.2' into 1.3-merger
Conflicts: cake/console/libs/tasks/controller.php cake/console/libs/tasks/extract.php cake/console/libs/tasks/model.php cake/libs/configure.php cake/libs/controller/components/cookie.php cake/libs/debugger.php cake/libs/flay.php cake/libs/http_socket.php cake/libs/inflector.php cake/libs/model/cake_schema.php cake/libs/model/connection_manager.php cake/libs/model/datasources/dbo/dbo_mysql.php cake/libs/model/datasources/dbo_source.php cake/libs/router.php cake/libs/view/helper.php cake/libs/view/helpers/form.php cake/libs/view/helpers/html.php cake/libs/view/helpers/js.php
This commit is contained in:
commit
4d37e75f18
54 changed files with 244 additions and 203 deletions
|
@ -198,6 +198,15 @@
|
|||
*/
|
||||
Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');
|
||||
|
||||
/**
|
||||
* Apply timestamps with the last modified time to static assets (js, css, images).
|
||||
* Will append a querystring parameter containing the time the file was modified. This is
|
||||
* useful for invalidating browser caches.
|
||||
*
|
||||
* Set to `true` to apply timestamps, when debug = 0, or set to 'force' to always enable
|
||||
* timestamping.
|
||||
*/
|
||||
//Configure::write('Asset.timestamp', true);
|
||||
/**
|
||||
* Compress CSS output by removing comments, whitespace, repeating tags, etc.
|
||||
* This requires a/var/cache directory to be writable by the web server for caching.
|
||||
|
|
|
@ -461,7 +461,7 @@ if (!function_exists('file_put_contents')) {
|
|||
/**
|
||||
* Writes data into file.
|
||||
*
|
||||
* If file exists, it will be overwritten. If data is an array, it will be join()ed with an empty string.
|
||||
* If file exists, it will be overwritten. If data is an array, it will be implode()ed with an empty string.
|
||||
*
|
||||
* @param string $fileName File name.
|
||||
* @param mixed $data String or array.
|
||||
|
@ -469,7 +469,7 @@ if (!function_exists('file_put_contents')) {
|
|||
*/
|
||||
function file_put_contents($fileName, $data) {
|
||||
if (is_array($data)) {
|
||||
$data = join('', $data);
|
||||
$data = implode('', $data);
|
||||
}
|
||||
$res = @fopen($fileName, 'w+b');
|
||||
|
||||
|
|
|
@ -305,7 +305,7 @@ class ConsoleShell extends Shell {
|
|||
break;
|
||||
case (preg_match("/^routes\s+show/i", $command, $tmp) == true):
|
||||
$router =& Router::getInstance();
|
||||
$this->out(join("\n", Set::extract($router->routes, '{n}.0')));
|
||||
$this->out(implode("\n", Set::extract($router->routes, '{n}.0')));
|
||||
break;
|
||||
case (preg_match("/^route\s+(\(.*\))$/i", $command, $tmp) == true):
|
||||
if ($url = eval('return array' . $tmp[1] . ';')) {
|
||||
|
|
|
@ -164,7 +164,7 @@ class ControllerTask extends Shell {
|
|||
if (file_exists($this->path . $controllerFile .'_controller.php')) {
|
||||
$question[] = sprintf(__("Warning: Choosing no will overwrite the %sController.", true), $controllerName);
|
||||
}
|
||||
$doItInteractive = $this->in(join("\n", $question), array('y', 'n'), 'y');
|
||||
$doItInteractive = $this->in(implode("\n", $question), array('y','n'), 'y');
|
||||
|
||||
if (strtolower($doItInteractive) == 'y') {
|
||||
$this->interactive = true;
|
||||
|
|
|
@ -232,9 +232,9 @@ class ExtractTask extends Shell {
|
|||
}
|
||||
|
||||
if (is_array($token)) {
|
||||
$lineNumber += count(split("\n", $token[1])) - 1;
|
||||
$lineNumber += count(explode("\n", $token[1])) - 1;
|
||||
} else {
|
||||
$lineNumber += count(split("\n", $token)) - 1;
|
||||
$lineNumber += count(explode("\n", $token)) - 1;
|
||||
}
|
||||
}
|
||||
unset($allTokens);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;<?php die() ?>
|
||||
;<?php exit() ?>
|
||||
; SVN FILE: $Id$
|
||||
;/**
|
||||
; * Short description for file.
|
||||
|
|
|
@ -79,7 +79,7 @@ class PagesController extends AppController {
|
|||
$title = Inflector::humanize($path[$count - 1]);
|
||||
}
|
||||
$this->set(compact('page', 'subpage', 'title'));
|
||||
$this->render(join('/', $path));
|
||||
$this->render(implode('/', $path));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ if (!class_exists('File')) {
|
|||
}
|
||||
|
||||
if (preg_match('|\.\.|', $url) || !preg_match('|^ccss/(.+)$|i', $url, $regs)) {
|
||||
die('Wrong file name.');
|
||||
exit('Wrong file name.');
|
||||
}
|
||||
|
||||
$filename = 'css/' . $regs[1];
|
||||
|
@ -72,7 +72,7 @@ if (!class_exists('File')) {
|
|||
$cachepath = CACHE . 'css' . DS . str_replace(array('/','\\'), '-', $regs[1]);
|
||||
|
||||
if (!file_exists($filepath)) {
|
||||
die('Wrong file name.');
|
||||
exit('Wrong file name.');
|
||||
}
|
||||
|
||||
if (file_exists($cachepath)) {
|
||||
|
|
|
@ -90,7 +90,7 @@ if (isset($corePath[0])) {
|
|||
require_once CAKE_TESTS_LIB . 'test_manager.php';
|
||||
|
||||
if (Configure::read('debug') < 1) {
|
||||
die(__('Debug setting does not allow access to this url.', true));
|
||||
exit(__('Debug setting does not allow access to this url.', true));
|
||||
}
|
||||
|
||||
if (!isset($_SERVER['SERVER_NAME'])) {
|
||||
|
|
|
@ -142,13 +142,13 @@ class Dispatcher extends Object {
|
|||
)));
|
||||
}
|
||||
|
||||
$privateAction = (bool)(strpos($this->params['action'], '_', 0) === 0);
|
||||
$privateAction = $this->params['action'][0] === '_';
|
||||
$prefixes = Router::prefixes();
|
||||
|
||||
if (!empty($prefixes)) {
|
||||
if (isset($this->params['prefix'])) {
|
||||
$this->params['action'] = $this->params['prefix'] . '_' . $this->params['action'];
|
||||
} elseif (strpos($this->params['action'], '_') !== false && !$privateAction) {
|
||||
} elseif (strpos($this->params['action'], '_') > 0) {
|
||||
list($prefix, $action) = explode('_', $this->params['action']);
|
||||
$privateAction = in_array($prefix, $prefixes);
|
||||
}
|
||||
|
@ -377,9 +377,6 @@ class Dispatcher extends Object {
|
|||
$this->webroot = $base .'/';
|
||||
return $base;
|
||||
}
|
||||
$file = null;
|
||||
|
||||
if ($baseUrl) {
|
||||
$file = '/' . basename($baseUrl);
|
||||
$base = dirname($baseUrl);
|
||||
|
||||
|
@ -395,8 +392,6 @@ class Dispatcher extends Object {
|
|||
$this->webroot .= $webroot . '/';
|
||||
}
|
||||
return $base . $file;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -529,7 +524,7 @@ class Dispatcher extends Object {
|
|||
if (key($_GET) && strpos(key($_GET), '?') !== false) {
|
||||
unset($_GET[key($_GET)]);
|
||||
}
|
||||
$uri = preg_split('/\?/', $uri, 2);
|
||||
$uri = explode('?', $uri, 2);
|
||||
|
||||
if (isset($uri[1])) {
|
||||
parse_str($uri[1], $_GET);
|
||||
|
|
|
@ -565,7 +565,7 @@ class CakeSession extends Object {
|
|||
$config = CONFIGS . Configure::read('Session.save') . '.php';
|
||||
|
||||
if (is_file($config)) {
|
||||
require_once ($config);
|
||||
require($config);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -835,7 +835,6 @@ class App extends Object {
|
|||
* @access public
|
||||
*/
|
||||
function import($type = null, $name = null, $parent = true, $search = array(), $file = null, $return = false) {
|
||||
$_this =& App::getInstance();
|
||||
$plugin = $directory = null;
|
||||
|
||||
if (is_array($type)) {
|
||||
|
@ -886,7 +885,7 @@ class App extends Object {
|
|||
list($plugin, $name) = explode('.', $name);
|
||||
$plugin = Inflector::camelize($plugin);
|
||||
}
|
||||
|
||||
$_this =& App::getInstance();
|
||||
$_this->return = $return;
|
||||
|
||||
if (isset($ext)) {
|
||||
|
|
|
@ -362,7 +362,7 @@ class DbAcl extends AclBase {
|
|||
}
|
||||
list($save['aro_id'], $save['aco_id']) = array($perms['aro'], $perms['aco']);
|
||||
|
||||
if ($perms['link'] != null && count($perms['link']) > 0) {
|
||||
if ($perms['link'] != null && !empty($perms['link'])) {
|
||||
$save['id'] = $perms['link'][0][$this->Aro->Permission->alias]['id'];
|
||||
} else {
|
||||
unset($save['id']);
|
||||
|
|
|
@ -349,7 +349,7 @@ class SecurityComponent extends Object {
|
|||
$out[] = 'opaque="' . md5($options['realm']).'"';
|
||||
}
|
||||
|
||||
return $auth . ' ' . join(',', $out);
|
||||
return $auth . ' ' . implode(',', $out);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -645,7 +645,7 @@ class Controller extends Object {
|
|||
504 => 'Gateway Time-out'
|
||||
);
|
||||
if (is_string($status)) {
|
||||
$codes = array_combine(array_values($codes), array_keys($codes));
|
||||
$codes = array_flip($codes);
|
||||
}
|
||||
|
||||
if (isset($codes[$status])) {
|
||||
|
@ -776,7 +776,7 @@ class Controller extends Object {
|
|||
function validateErrors() {
|
||||
$objects = func_get_args();
|
||||
|
||||
if (!count($objects)) {
|
||||
if (empty($objects)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -786,7 +786,7 @@ class Controller extends Object {
|
|||
$errors = array_merge($errors, $this->{$object->alias}->invalidFields());
|
||||
}
|
||||
|
||||
return $this->validationErrors = (count($errors) ? $errors : false);
|
||||
return $this->validationErrors = (!empty($errors) ? $errors : false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -951,12 +951,14 @@ class Controller extends Object {
|
|||
foreach ($fields as $field => $value) {
|
||||
$key = $model.'.'.$field;
|
||||
$fieldOp = $op;
|
||||
if (is_array($op) && array_key_exists($key, $op)) {
|
||||
$fieldOp = $op[$key];
|
||||
} elseif (is_array($op) && array_key_exists($field, $op)) {
|
||||
$fieldOp = $op[$field];
|
||||
} elseif (is_array($op)) {
|
||||
$fieldOp = false;
|
||||
if (is_array($op)) {
|
||||
if (array_key_exists($key, $op)) {
|
||||
$fieldOp = $op[$key];
|
||||
} elseif (array_key_exists($field, $op)) {
|
||||
$fieldOp = $op[$field];
|
||||
} else {
|
||||
$fieldOp = false;
|
||||
}
|
||||
}
|
||||
if ($exclusive && $fieldOp === false) {
|
||||
continue;
|
||||
|
|
|
@ -79,7 +79,7 @@ class PagesController extends AppController {
|
|||
$title = Inflector::humanize($path[$count - 1]);
|
||||
}
|
||||
$this->set(compact('page', 'subpage', 'title'));
|
||||
$this->render(join('/', $path));
|
||||
$this->render(implode('/', $path));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -312,7 +312,7 @@ class Debugger extends Object {
|
|||
}
|
||||
|
||||
if ($error == 'Fatal Error') {
|
||||
die();
|
||||
exit();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ class Debugger extends Object {
|
|||
if ($options['format'] == 'array' || $options['format'] == 'points') {
|
||||
return $back;
|
||||
}
|
||||
return join("\n", $back);
|
||||
return implode("\n", $back);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -503,10 +503,10 @@ class Debugger extends Object {
|
|||
}
|
||||
}
|
||||
$n = null;
|
||||
if (count($vars) > 0) {
|
||||
if (!empty($vars)) {
|
||||
$n = "\n";
|
||||
}
|
||||
return $out . join(",", $vars) . "{$n})";
|
||||
return $out . implode(",", $vars) . "{$n})";
|
||||
break;
|
||||
case 'resource':
|
||||
return strtolower(gettype($var));
|
||||
|
@ -545,7 +545,7 @@ class Debugger extends Object {
|
|||
$out[] = "$className::$$key = " . $value;
|
||||
}
|
||||
}
|
||||
return join("\n", $out);
|
||||
return implode("\n", $out);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -801,7 +801,7 @@ class Folder extends Object {
|
|||
continue;
|
||||
}
|
||||
if ($part === '..') {
|
||||
if (count($newparts) > 0) {
|
||||
if (!empty($newparts)) {
|
||||
array_pop($newparts);
|
||||
continue;
|
||||
} else {
|
||||
|
|
|
@ -794,7 +794,7 @@ class HttpSocket extends CakeSocket {
|
|||
$returnHeader = '';
|
||||
foreach ($header as $field => $contents) {
|
||||
if (is_array($contents) && $mode == 'standard') {
|
||||
$contents = join(',', $contents);
|
||||
$contents = implode(',', $contents);
|
||||
}
|
||||
foreach ((array)$contents as $content) {
|
||||
$contents = preg_replace("/\r\n(?![\t ])/", "\r\n ", $content);
|
||||
|
@ -873,7 +873,7 @@ class HttpSocket extends CakeSocket {
|
|||
foreach ((array)$header['Set-Cookie'] as $cookie) {
|
||||
if (strpos($cookie, '";"') !== false) {
|
||||
$cookie = str_replace('";"', "{__cookie_replace__}", $cookie);
|
||||
$parts = str_replace("{__cookie_replace__}", '";"', preg_split('/\;/', $cookie));
|
||||
$parts = str_replace("{__cookie_replace__}", '";"', explode(';', $cookie));
|
||||
} else {
|
||||
$parts = preg_split('/\;[ \t]*/', $cookie);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ class MagicDb extends Object {
|
|||
$lines = explode("\r\n", $data);
|
||||
$db = array();
|
||||
|
||||
$validHeader = count($lines > 3)
|
||||
$validHeader = count($lines) > 3
|
||||
&& preg_match('/^# Date:([0-9]{4}-[0-9]{2}-[0-9]{2})$/', $lines[1], $date)
|
||||
&& preg_match('/^# Source:(.+)$/', $lines[2], $source)
|
||||
&& strlen($lines[3]) == 0;
|
||||
|
|
|
@ -287,7 +287,7 @@ class ContainableBehavior extends ModelBehavior {
|
|||
if (strpos($name, '.') !== false) {
|
||||
$chain = explode('.', $name);
|
||||
$name = array_shift($chain);
|
||||
$children = array(join('.', $chain) => $children);
|
||||
$children = array(implode('.', $chain) => $children);
|
||||
}
|
||||
|
||||
$children = (array)$children;
|
||||
|
|
|
@ -514,7 +514,7 @@ class CakeSchema extends Object {
|
|||
if (is_array($values)) {
|
||||
foreach ($values as $key => $val) {
|
||||
if (is_array($val)) {
|
||||
$vals[] = "'{$key}' => array('" . join("', '", $val) . "')";
|
||||
$vals[] = "'{$key}' => array('" . implode("', '", $val) . "')";
|
||||
} else if (!is_numeric($key)) {
|
||||
$val = var_export($val, true);
|
||||
$vals[] = "'{$key}' => {$val}";
|
||||
|
|
|
@ -225,7 +225,7 @@ class DboAdodb extends DboSource {
|
|||
function listSources() {
|
||||
$tables = $this->_adodb->MetaTables('TABLES');
|
||||
|
||||
if (!sizeof($tables) > 0) {
|
||||
if (!count($tables) > 0) {
|
||||
trigger_error(ERROR_NO_TABLE_LIST, E_USER_NOTICE);
|
||||
exit;
|
||||
}
|
||||
|
|
|
@ -612,7 +612,7 @@ class DboMssql extends DboSource {
|
|||
|
||||
foreach (array('columns', 'indexes') as $var) {
|
||||
if (is_array(${$var})) {
|
||||
${$var} = "\t" . join(",\n\t", array_filter(${$var}));
|
||||
${$var} = "\t" . implode(",\n\t", array_filter(${$var}));
|
||||
}
|
||||
}
|
||||
return "CREATE TABLE {$table} (\n{$columns});\n{$indexes}";
|
||||
|
@ -747,7 +747,7 @@ class DboMssql extends DboSource {
|
|||
$out = "ALTER TABLE {$table} ADD CONSTRAINT {$name} UNIQUE";
|
||||
|
||||
if (is_array($value['column'])) {
|
||||
$value['column'] = join(', ', array_map(array(&$this, 'name'), $value['column']));
|
||||
$value['column'] = implode(', ', array_map(array(&$this, 'name'), $value['column']));
|
||||
} else {
|
||||
$value['column'] = $this->name($value['column']);
|
||||
}
|
||||
|
|
|
@ -168,7 +168,7 @@ class DboMysqlBase extends DboSource {
|
|||
|
||||
$alias = $joins = false;
|
||||
$fields = $this->_prepareUpdateFields($model, $combined, empty($conditions), !empty($conditions));
|
||||
$fields = join(', ', $fields);
|
||||
$fields = implode(', ', $fields);
|
||||
$table = $this->fullTableName($model);
|
||||
|
||||
if (!empty($conditions)) {
|
||||
|
@ -392,7 +392,7 @@ class DboMysqlBase extends DboSource {
|
|||
}
|
||||
}
|
||||
if (is_array($value['column'])) {
|
||||
$out .= 'KEY '. $name .' (' . join(', ', array_map(array(&$this, 'name'), $value['column'])) . ')';
|
||||
$out .= 'KEY '. $name .' (' . implode(', ', array_map(array(&$this, 'name'), $value['column'])) . ')';
|
||||
} else {
|
||||
$out .= 'KEY '. $name .' (' . $this->name($value['column']) . ')';
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ class DboMysqlBase extends DboSource {
|
|||
function insertMulti($table, $fields, $values) {
|
||||
$table = $this->fullTableName($table);
|
||||
if (is_array($fields)) {
|
||||
$fields = join(', ', array_map(array(&$this, 'name'), $fields));
|
||||
$fields = implode(', ', array_map(array(&$this, 'name'), $fields));
|
||||
}
|
||||
$values = implode(', ', $values);
|
||||
$this->query("INSERT INTO {$table} ({$fields}) VALUES {$values}");
|
||||
|
|
|
@ -95,7 +95,7 @@ class DboOdbc extends DboSource {
|
|||
$connect = 'odbc_connect';
|
||||
}
|
||||
if (!function_exists($connect)) {
|
||||
die('no odbc?');
|
||||
exit('no odbc?');
|
||||
}
|
||||
$this->connected = false;
|
||||
$this->connection = $connect($config['database'], $config['login'], $config['password'], SQL_CUR_USE_ODBC);
|
||||
|
|
|
@ -735,7 +735,7 @@ class DboOracle extends DboSource {
|
|||
break;
|
||||
}
|
||||
}
|
||||
$out .= "\t" . join(",\n\t", $colList) . ";\n\n";
|
||||
$out .= "\t" . implode(",\n\t", $colList) . ";\n\n";
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
|
@ -966,7 +966,7 @@ class DboOracle extends DboSource {
|
|||
case 'schema':
|
||||
foreach (array('columns', 'indexes') as $var) {
|
||||
if (is_array(${$var})) {
|
||||
${$var} = "\t" . join(",\n\t", array_filter(${$var}));
|
||||
${$var} = "\t" . implode(",\n\t", array_filter(${$var}));
|
||||
}
|
||||
}
|
||||
if (trim($indexes) != '') {
|
||||
|
@ -1019,7 +1019,7 @@ class DboOracle extends DboSource {
|
|||
$fetch = array();
|
||||
$ins = array_chunk($ins, 1000);
|
||||
foreach ($ins as $i) {
|
||||
$q = str_replace('{$__cakeID__$}', join(', ', $i), $query);
|
||||
$q = str_replace('{$__cakeID__$}', implode(', ', $i), $query);
|
||||
$q = str_replace('= (', 'IN (', $q);
|
||||
$res = $this->fetchAll($q, $model->cacheQueries, $model->alias);
|
||||
$fetch = array_merge($fetch, $res);
|
||||
|
@ -1063,7 +1063,7 @@ class DboOracle extends DboSource {
|
|||
$fetch = array();
|
||||
$ins = array_chunk($ins, 1000);
|
||||
foreach ($ins as $i) {
|
||||
$q = str_replace('{$__cakeID__$}', '(' .join(', ', $i) .')', $query);
|
||||
$q = str_replace('{$__cakeID__$}', '(' .implode(', ', $i) .')', $query);
|
||||
$q = str_replace('= (', 'IN (', $q);
|
||||
$q = str_replace(' WHERE 1 = 1', '', $q);
|
||||
|
||||
|
|
|
@ -554,11 +554,11 @@ class DboPostgres extends DboSource {
|
|||
}
|
||||
|
||||
if (!empty($colList)) {
|
||||
$out .= "\t" . join(",\n\t", $colList) . ";\n\n";
|
||||
$out .= "\t" . implode(",\n\t", $colList) . ";\n\n";
|
||||
} else {
|
||||
$out = '';
|
||||
}
|
||||
$out .= join(";\n\t", $this->_alterIndexes($curTable, $indexes)) . ";";
|
||||
$out .= implode(";\n\t", $this->_alterIndexes($curTable, $indexes)) . ";";
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
|
@ -596,7 +596,7 @@ class DboPostgres extends DboSource {
|
|||
$out .= 'INDEX ';
|
||||
}
|
||||
if (is_array($value['column'])) {
|
||||
$out .= $name . ' ON ' . $table . ' (' . join(', ', array_map(array(&$this, 'name'), $value['column'])) . ')';
|
||||
$out .= $name . ' ON ' . $table . ' (' . implode(', ', array_map(array(&$this, 'name'), $value['column'])) . ')';
|
||||
} else {
|
||||
$out .= $name . ' ON ' . $table . ' (' . $this->name($value['column']) . ')';
|
||||
}
|
||||
|
@ -855,7 +855,7 @@ class DboPostgres extends DboSource {
|
|||
$out .= 'UNIQUE ';
|
||||
}
|
||||
if (is_array($value['column'])) {
|
||||
$value['column'] = join(', ', array_map(array(&$this, 'name'), $value['column']));
|
||||
$value['column'] = implode(', ', array_map(array(&$this, 'name'), $value['column']));
|
||||
} else {
|
||||
$value['column'] = $this->name($value['column']);
|
||||
}
|
||||
|
@ -889,7 +889,7 @@ class DboPostgres extends DboSource {
|
|||
|
||||
foreach (array('columns', 'indexes') as $var) {
|
||||
if (is_array(${$var})) {
|
||||
${$var} = join($join[$var], array_filter(${$var}));
|
||||
${$var} = implode($join[$var], array_filter(${$var}));
|
||||
}
|
||||
}
|
||||
return "CREATE TABLE {$table} (\n\t{$columns}\n);\n{$indexes}";
|
||||
|
|
|
@ -547,7 +547,7 @@ class DboSqlite extends DboSource {
|
|||
$out .= 'UNIQUE ';
|
||||
}
|
||||
if (is_array($value['column'])) {
|
||||
$value['column'] = join(', ', array_map(array(&$this, 'name'), $value['column']));
|
||||
$value['column'] = implode(', ', array_map(array(&$this, 'name'), $value['column']));
|
||||
} else {
|
||||
$value['column'] = $this->name($value['column']);
|
||||
}
|
||||
|
@ -608,7 +608,7 @@ class DboSqlite extends DboSource {
|
|||
|
||||
foreach (array('columns', 'indexes') as $var) {
|
||||
if (is_array(${$var})) {
|
||||
${$var} = "\t" . join(",\n\t", array_filter(${$var}));
|
||||
${$var} = "\t" . implode(",\n\t", array_filter(${$var}));
|
||||
}
|
||||
}
|
||||
return "CREATE TABLE {$table} (\n{$columns});\n{$indexes}";
|
||||
|
|
|
@ -630,8 +630,8 @@ class DboSource extends DataSource {
|
|||
}
|
||||
$query = array(
|
||||
'table' => $this->fullTableName($model),
|
||||
'fields' => join(', ', $fieldInsert),
|
||||
'values' => join(', ', $valueInsert)
|
||||
'fields' => implode(', ', $fieldInsert),
|
||||
'values' => implode(', ', $valueInsert)
|
||||
);
|
||||
|
||||
if ($this->execute($this->renderStatement('create', $query))) {
|
||||
|
@ -849,7 +849,7 @@ class DboSource extends DataSource {
|
|||
}
|
||||
if (!empty($ins)) {
|
||||
if (count($ins) > 1) {
|
||||
$query = str_replace('{$__cakeID__$}', '(' .join(', ', $ins) .')', $query);
|
||||
$query = str_replace('{$__cakeID__$}', '(' .implode(', ', $ins) .')', $query);
|
||||
$query = str_replace('= (', 'IN (', $query);
|
||||
$query = str_replace('= (', 'IN (', $query);
|
||||
} else {
|
||||
|
@ -949,7 +949,7 @@ class DboSource extends DataSource {
|
|||
* @return array Association results
|
||||
*/
|
||||
function fetchAssociated($model, $query, $ids) {
|
||||
$query = str_replace('{$__cakeID__$}', join(', ', $ids), $query);
|
||||
$query = str_replace('{$__cakeID__$}', implode(', ', $ids), $query);
|
||||
if (count($ids) > 1) {
|
||||
$query = str_replace('= (', 'IN (', $query);
|
||||
$query = str_replace('= (', 'IN (', $query);
|
||||
|
@ -1332,12 +1332,12 @@ class DboSource extends DataSource {
|
|||
}
|
||||
return $this->renderStatement('select', array(
|
||||
'conditions' => $this->conditions($query['conditions'], true, true, $model),
|
||||
'fields' => join(', ', $query['fields']),
|
||||
'fields' => implode(', ', $query['fields']),
|
||||
'table' => $query['table'],
|
||||
'alias' => $this->alias . $this->name($query['alias']),
|
||||
'order' => $this->order($query['order']),
|
||||
'limit' => $this->limit($query['limit'], $query['offset']),
|
||||
'joins' => join(' ', $query['joins']),
|
||||
'joins' => implode(' ', $query['joins']),
|
||||
'group' => $this->group($query['group'])
|
||||
));
|
||||
}
|
||||
|
@ -1444,7 +1444,7 @@ class DboSource extends DataSource {
|
|||
} else {
|
||||
$combined = array_combine($fields, $values);
|
||||
}
|
||||
$fields = join(', ', $this->_prepareUpdateFields($model, $combined, empty($conditions)));
|
||||
$fields = implode(', ', $this->_prepareUpdateFields($model, $combined, empty($conditions)));
|
||||
|
||||
$alias = $joins = null;
|
||||
$table = $this->fullTableName($model);
|
||||
|
@ -1807,7 +1807,7 @@ class DboSource extends DataSource {
|
|||
} else {
|
||||
$field[0] = explode('.', $field[1]);
|
||||
if (!Set::numeric($field[0])) {
|
||||
$field[0] = join('.', array_map(array($this, 'name'), $field[0]));
|
||||
$field[0] = implode('.', array_map(array($this, 'name'), $field[0]));
|
||||
$fields[$i] = preg_replace('/\(' . $field[1] . '\)/', '(' . $field[0] . ')', $fields[$i], 1);
|
||||
}
|
||||
}
|
||||
|
@ -1840,7 +1840,7 @@ class DboSource extends DataSource {
|
|||
if (empty($out)) {
|
||||
return $clause . ' 1 = 1';
|
||||
}
|
||||
return $clause . join(' AND ', $out);
|
||||
return $clause . implode(' AND ', $out);
|
||||
}
|
||||
|
||||
if (empty($conditions) || trim($conditions) == '' || $conditions === true) {
|
||||
|
@ -1910,7 +1910,7 @@ class DboSource extends DataSource {
|
|||
$out[] = $value[0] ;
|
||||
}
|
||||
} else {
|
||||
$out[] = '(' . $not . '(' . join(') ' . strtoupper($key) . ' (', $value) . '))';
|
||||
$out[] = '(' . $not . '(' . implode(') ' . strtoupper($key) . ' (', $value) . '))';
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -1937,13 +1937,13 @@ class DboSource extends DataSource {
|
|||
if (is_object($model)) {
|
||||
$columnType = $model->getColumnType($key);
|
||||
}
|
||||
$data .= join(', ', $this->value($value, $columnType));
|
||||
$data .= implode(', ', $this->value($value, $columnType));
|
||||
}
|
||||
$data .= ')';
|
||||
} else {
|
||||
$ret = $this->conditionKeysToString($value, $quoteValues, $model);
|
||||
if (count($ret) > 1) {
|
||||
$data = '(' . join(') AND (', $ret) . ')';
|
||||
$data = '(' . implode(') AND (', $ret) . ')';
|
||||
} elseif (isset($ret[0])) {
|
||||
$data = $ret[0];
|
||||
}
|
||||
|
@ -1978,7 +1978,7 @@ class DboSource extends DataSource {
|
|||
* @access private
|
||||
*/
|
||||
function __parseKey($model, $key, $value) {
|
||||
$operatorMatch = '/^((' . join(')|(', $this->__sqlOps);
|
||||
$operatorMatch = '/^((' . implode(')|(', $this->__sqlOps);
|
||||
$operatorMatch .= '\\x20)|<[>=]?(?![^>]+>)\\x20?|[>=!]{1,3}(?!<)\\x20?)/is';
|
||||
$bound = (strpos($key, '?') !== false || (is_array($value) && strpos($key, ':') !== false));
|
||||
|
||||
|
@ -2024,7 +2024,7 @@ class DboSource extends DataSource {
|
|||
$operator = trim($operator);
|
||||
|
||||
if (is_array($value)) {
|
||||
$value = join(', ', $value);
|
||||
$value = implode(', ', $value);
|
||||
|
||||
switch ($operator) {
|
||||
case '=':
|
||||
|
@ -2124,7 +2124,7 @@ class DboSource extends DataSource {
|
|||
$keys = array_filter($keys);
|
||||
}
|
||||
|
||||
if (empty($keys) || (is_array($keys) && count($keys) && isset($keys[0]) && empty($keys[0]))) {
|
||||
if (empty($keys) || (is_array($keys) && isset($keys[0]) && empty($keys[0]))) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@ -2154,7 +2154,7 @@ class DboSource extends DataSource {
|
|||
}
|
||||
$order[] = $this->order($key . $value);
|
||||
}
|
||||
return ' ORDER BY ' . trim(str_replace('ORDER BY', '', join(',', $order)));
|
||||
return ' ORDER BY ' . trim(str_replace('ORDER BY', '', implode(',', $order)));
|
||||
}
|
||||
$keys = preg_replace('/ORDER\\x20BY/i', '', $keys);
|
||||
|
||||
|
@ -2186,7 +2186,7 @@ class DboSource extends DataSource {
|
|||
function group($group) {
|
||||
if ($group) {
|
||||
if (is_array($group)) {
|
||||
$group = join(', ', $group);
|
||||
$group = implode(', ', $group);
|
||||
}
|
||||
return ' GROUP BY ' . $this->__quoteFields($group);
|
||||
}
|
||||
|
@ -2315,7 +2315,7 @@ class DboSource extends DataSource {
|
|||
function insertMulti($table, $fields, $values) {
|
||||
$table = $this->fullTableName($table);
|
||||
if (is_array($fields)) {
|
||||
$fields = join(', ', array_map(array(&$this, 'name'), $fields));
|
||||
$fields = implode(', ', array_map(array(&$this, 'name'), $fields));
|
||||
}
|
||||
$count = count($values);
|
||||
for ($x = 0; $x < $count; $x++) {
|
||||
|
@ -2521,7 +2521,7 @@ class DboSource extends DataSource {
|
|||
$name = $this->startQuote . $name . $this->endQuote;
|
||||
}
|
||||
if (is_array($value['column'])) {
|
||||
$out .= 'KEY ' . $name . ' (' . join(', ', array_map(array(&$this, 'name'), $value['column'])) . ')';
|
||||
$out .= 'KEY ' . $name . ' (' . implode(', ', array_map(array(&$this, 'name'), $value['column'])) . ')';
|
||||
} else {
|
||||
$out .= 'KEY ' . $name . ' (' . $this->name($value['column']) . ')';
|
||||
}
|
||||
|
|
|
@ -1127,7 +1127,7 @@ class Model extends Overloadable {
|
|||
return $data[$name[0]][$name[1]];
|
||||
}
|
||||
}
|
||||
if (isset($data[0]) && count($data[0]) > 0) {
|
||||
if (!empty($data[0])) {
|
||||
$name = key($data[0]);
|
||||
return $data[0][$name];
|
||||
}
|
||||
|
@ -1353,14 +1353,6 @@ class Model extends Overloadable {
|
|||
if (isset($this->hasAndBelongsToMany[$assoc])) {
|
||||
list($join) = $this->joinModel($this->hasAndBelongsToMany[$assoc]['with']);
|
||||
|
||||
$conditions = array($join . '.' . $this->hasAndBelongsToMany[$assoc]['foreignKey'] => $id);
|
||||
|
||||
$links = $this->{$join}->find('all', array(
|
||||
'conditions' => $conditions,
|
||||
'recursive' => -1,
|
||||
'fields' => $this->hasAndBelongsToMany[$assoc]['associationForeignKey']
|
||||
));
|
||||
|
||||
$isUUID = !empty($this->{$join}->primaryKey) && (
|
||||
$this->{$join}->_schema[$this->{$join}->primaryKey]['length'] == 36 && (
|
||||
$this->{$join}->_schema[$this->{$join}->primaryKey]['type'] === 'string' ||
|
||||
|
@ -1391,7 +1383,7 @@ class Model extends Overloadable {
|
|||
if ($isUUID && $primaryAdded) {
|
||||
$values[] = $db->value(String::uuid());
|
||||
}
|
||||
$values = join(',', $values);
|
||||
$values = implode(',', $values);
|
||||
$newValues[] = "({$values})";
|
||||
unset($values);
|
||||
} elseif (isset($row[$this->hasAndBelongsToMany[$assoc]['associationForeignKey']])) {
|
||||
|
@ -1402,6 +1394,16 @@ class Model extends Overloadable {
|
|||
}
|
||||
|
||||
if ($this->hasAndBelongsToMany[$assoc]['unique']) {
|
||||
$conditions = array_merge(
|
||||
array($join . '.' . $this->hasAndBelongsToMany[$assoc]['foreignKey'] => $id),
|
||||
(array)$this->hasAndBelongsToMany[$assoc]['conditions']
|
||||
);
|
||||
$links = $this->{$join}->find('all', array(
|
||||
'conditions' => $conditions,
|
||||
'recursive' => empty($this->hasAndBelongsToMany[$assoc]['conditions']) ? -1 : 0,
|
||||
'fields' => $this->hasAndBelongsToMany[$assoc]['associationForeignKey']
|
||||
));
|
||||
|
||||
$associationForeignKey = "{$join}." . $this->hasAndBelongsToMany[$assoc]['associationForeignKey'];
|
||||
$oldLinks = Set::extract($links, "{n}.{$associationForeignKey}");
|
||||
if (!empty($oldLinks)) {
|
||||
|
@ -1419,7 +1421,7 @@ class Model extends Overloadable {
|
|||
}
|
||||
|
||||
if (!empty($newValues)) {
|
||||
$fields = join(',', $fields);
|
||||
$fields = implode(',', $fields);
|
||||
$db->insertMulti($this->{$join}, $fields, $newValues);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,8 @@ if (function_exists('mb_internal_encoding')) {
|
|||
* @param string $needle The string to find in $haystack.
|
||||
* @param integer $offset The position in $haystack to start searching.
|
||||
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
|
||||
* @return integer|boolean The numeric position of the first occurrence of $needle in the $haystack string, or false if $needle is not found.
|
||||
* @return integer|boolean The numeric position of the first occurrence of $needle in the $haystack string, or false
|
||||
* if $needle is not found.
|
||||
*/
|
||||
if (!function_exists('mb_stripos')) {
|
||||
function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) {
|
||||
|
@ -46,8 +47,9 @@ if (!function_exists('mb_stripos')) {
|
|||
* @param string $haystack The string from which to get the first occurrence of $needle.
|
||||
* @param string $needle The string to find in $haystack.
|
||||
* @param boolean $part Determines which portion of $haystack this function returns.
|
||||
* If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the first occurrence of $needle to the end, Default value is false.
|
||||
* If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the first occurrence of $needle to the end,
|
||||
* Default value is false.
|
||||
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
|
||||
* @return string|boolean The portion of $haystack, or false if $needle is not found.
|
||||
*/
|
||||
|
@ -63,7 +65,7 @@ if (!function_exists('mb_stristr')) {
|
|||
* @param string $string The string being checked for length.
|
||||
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
|
||||
* @return integer The number of characters in string $string having character encoding encoding.
|
||||
* A multi-byte character is counted as 1.
|
||||
* A multi-byte character is counted as 1.
|
||||
*/
|
||||
if (!function_exists('mb_strlen')) {
|
||||
function mb_strlen($string, $encoding = null) {
|
||||
|
@ -79,7 +81,7 @@ if (!function_exists('mb_strlen')) {
|
|||
* @param integer $offset The search offset. If it is not specified, 0 is used.
|
||||
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
|
||||
* @return integer|boolean The numeric position of the first occurrence of $needle in the $haystack string.
|
||||
* If $needle is not found, it returns false.
|
||||
* If $needle is not found, it returns false.
|
||||
*/
|
||||
if (!function_exists('mb_strpos')) {
|
||||
function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) {
|
||||
|
@ -93,8 +95,9 @@ if (!function_exists('mb_strpos')) {
|
|||
* @param string $haystack The string from which to get the last occurrence of $needle.
|
||||
* @param string $needle The string to find in $haystack.
|
||||
* @param boolean $part Determines which portion of $haystack this function returns.
|
||||
* If set to true, it returns all of $haystack from the beginning to the last occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the last occurrence of $needle to the end, Default value is false.
|
||||
* If set to true, it returns all of $haystack from the beginning to the last occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the last occurrence of $needle to the end,
|
||||
* Default value is false.
|
||||
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
|
||||
* @return string|boolean The portion of $haystack. or false if $needle is not found.
|
||||
*/
|
||||
|
@ -110,8 +113,9 @@ if (!function_exists('mb_strrchr')) {
|
|||
* @param string $haystack The string from which to get the last occurrence of $needle.
|
||||
* @param string $needle The string to find in $haystack.
|
||||
* @param boolean $part Determines which portion of $haystack this function returns.
|
||||
* If set to true, it returns all of $haystack from the beginning to the last occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the last occurrence of $needle to the end, Default value is false.
|
||||
* If set to true, it returns all of $haystack from the beginning to the last occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the last occurrence of $needle to the end,
|
||||
* Default value is false.
|
||||
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
|
||||
* @return string|boolean The portion of $haystack. or false if $needle is not found.
|
||||
*/
|
||||
|
@ -128,7 +132,8 @@ if (!function_exists('mb_strrichr')) {
|
|||
* @param string $needle The string to find in $haystack.
|
||||
* @param integer $offset The position in $haystack to start searching.
|
||||
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
|
||||
* @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string, or false if $needle is not found.
|
||||
* @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string,
|
||||
* or false if $needle is not found.
|
||||
*/
|
||||
if (!function_exists('mb_strripos')) {
|
||||
function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) {
|
||||
|
@ -142,9 +147,10 @@ if (!function_exists('mb_strripos')) {
|
|||
* @param string $haystack The string being checked, for the last occurrence of $needle.
|
||||
* @param string $needle The string to find in $haystack.
|
||||
* @param integer $offset May be specified to begin searching an arbitrary number of characters into the string.
|
||||
* Negative values will stop searching at an arbitrary point prior to the end of the string.
|
||||
* Negative values will stop searching at an arbitrary point prior to the end of the string.
|
||||
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
|
||||
* @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string. If $needle is not found, it returns false.
|
||||
* @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string.
|
||||
* If $needle is not found, it returns false.
|
||||
*/
|
||||
if (!function_exists('mb_strrpos')) {
|
||||
function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) {
|
||||
|
@ -158,8 +164,9 @@ if (!function_exists('mb_strrpos')) {
|
|||
* @param string $haystack The string from which to get the first occurrence of $needle.
|
||||
* @param string $needle The string to find in $haystack
|
||||
* @param boolean $part Determines which portion of $haystack this function returns.
|
||||
* If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the first occurrence of $needle to the end, Default value is FALSE.
|
||||
* If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the first occurrence of $needle to the end,
|
||||
* Default value is FALSE.
|
||||
* @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used.
|
||||
* @return string|boolean The portion of $haystack, or true if $needle is not found.
|
||||
*/
|
||||
|
@ -229,12 +236,13 @@ if (!function_exists('mb_substr')) {
|
|||
*
|
||||
* @param string $str The string being encoded
|
||||
* @param string $charset specifies the name of the character set in which str is represented in.
|
||||
* The default value is determined by the current NLS setting (mbstring.language).
|
||||
* @param string $transfer_encoding specifies the scheme of MIME encoding. It should be either "B" (Base64) or "Q" (Quoted-Printable).
|
||||
* Falls back to "B" if not given.
|
||||
* @param string $linefeed specifies the EOL (end-of-line) marker with which mb_encode_mimeheader() performs line-folding
|
||||
* (a » RFC term, the act of breaking a line longer than a certain length into multiple lines.
|
||||
* The length is currently hard-coded to 74 characters). Falls back to "\r\n" (CRLF) if not given.
|
||||
* The default value is determined by the current NLS setting (mbstring.language).
|
||||
* @param string $transfer_encoding specifies the scheme of MIME encoding.
|
||||
* It should be either "B" (Base64) or "Q" (Quoted-Printable). Falls back to "B" if not given.
|
||||
* @param string $linefeed specifies the EOL (end-of-line) marker with which
|
||||
* mb_encode_mimeheader() performs line-folding
|
||||
* (a » RFC term, the act of breaking a line longer than a certain length into multiple lines.
|
||||
* The length is currently hard-coded to 74 characters). Falls back to "\r\n" (CRLF) if not given.
|
||||
* @param integer $indent [definition unknown and appears to have no affect]
|
||||
* @return string A converted version of the string represented in ASCII.
|
||||
*/
|
||||
|
@ -315,7 +323,7 @@ class Multibyte extends Object {
|
|||
if ($value < 128) {
|
||||
$map[] = $value;
|
||||
} else {
|
||||
if (count($values) == 0) {
|
||||
if (empty($values)) {
|
||||
$find = ($value < 224) ? 2 : 3;
|
||||
}
|
||||
$values[] = $value;
|
||||
|
@ -367,7 +375,8 @@ class Multibyte extends Object {
|
|||
* @param multi-byte string $haystack The string from which to get the position of the first occurrence of $needle.
|
||||
* @param multi-byte string $needle The string to find in $haystack.
|
||||
* @param integer $offset The position in $haystack to start searching.
|
||||
* @return integer|boolean The numeric position of the first occurrence of $needle in the $haystack string, or false if $needle is not found.
|
||||
* @return integer|boolean The numeric position of the first occurrence of $needle in the $haystack string,
|
||||
* or false if $needle is not found.
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
|
@ -386,8 +395,9 @@ class Multibyte extends Object {
|
|||
* @param string $haystack The string from which to get the first occurrence of $needle.
|
||||
* @param string $needle The string to find in $haystack.
|
||||
* @param boolean $part Determines which portion of $haystack this function returns.
|
||||
* If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the first occurrence of $needle to the end, Default value is false.
|
||||
* If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the first occurrence of $needle to the end,
|
||||
* Default value is false.
|
||||
* @return int|boolean The portion of $haystack, or false if $needle is not found.
|
||||
* @access public
|
||||
* @static
|
||||
|
@ -465,7 +475,7 @@ class Multibyte extends Object {
|
|||
* @param string $needle The position counted from the beginning of haystack.
|
||||
* @param integer $offset The search offset. If it is not specified, 0 is used.
|
||||
* @return integer|boolean The numeric position of the first occurrence of $needle in the $haystack string.
|
||||
* If $needle is not found, it returns false.
|
||||
* If $needle is not found, it returns false.
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
|
@ -509,8 +519,9 @@ class Multibyte extends Object {
|
|||
* @param string $haystack The string from which to get the last occurrence of $needle.
|
||||
* @param string $needle The string to find in $haystack.
|
||||
* @param boolean $part Determines which portion of $haystack this function returns.
|
||||
* If set to true, it returns all of $haystack from the beginning to the last occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the last occurrence of $needle to the end, Default value is false.
|
||||
* If set to true, it returns all of $haystack from the beginning to the last occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the last occurrence of $needle to the end,
|
||||
* Default value is false.
|
||||
* @return string|boolean The portion of $haystack. or false if $needle is not found.
|
||||
* @access public
|
||||
* @static
|
||||
|
@ -570,8 +581,9 @@ class Multibyte extends Object {
|
|||
* @param string $haystack The string from which to get the last occurrence of $needle.
|
||||
* @param string $needle The string to find in $haystack.
|
||||
* @param boolean $part Determines which portion of $haystack this function returns.
|
||||
* If set to true, it returns all of $haystack from the beginning to the last occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the last occurrence of $needle to the end, Default value is false.
|
||||
* If set to true, it returns all of $haystack from the beginning to the last occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the last occurrence of $needle to the end,
|
||||
* Default value is false.
|
||||
* @return string|boolean The portion of $haystack. or false if $needle is not found.
|
||||
* @access public
|
||||
* @static
|
||||
|
@ -633,7 +645,8 @@ class Multibyte extends Object {
|
|||
* @param string $haystack The string from which to get the position of the last occurrence of $needle.
|
||||
* @param string $needle The string to find in $haystack.
|
||||
* @param integer $offset The position in $haystack to start searching.
|
||||
* @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string, or false if $needle is not found.
|
||||
* @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string,
|
||||
* or false if $needle is not found.
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
|
@ -684,8 +697,9 @@ class Multibyte extends Object {
|
|||
* @param string $haystack The string being checked, for the last occurrence of $needle.
|
||||
* @param string $needle The string to find in $haystack.
|
||||
* @param integer $offset May be specified to begin searching an arbitrary number of characters into the string.
|
||||
* Negative values will stop searching at an arbitrary point prior to the end of the string.
|
||||
* @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string. If $needle is not found, it returns false.
|
||||
* Negative values will stop searching at an arbitrary point prior to the end of the string.
|
||||
* @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string.
|
||||
* If $needle is not found, it returns false.
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
|
@ -735,8 +749,9 @@ class Multibyte extends Object {
|
|||
* @param string $haystack The string from which to get the first occurrence of $needle.
|
||||
* @param string $needle The string to find in $haystack
|
||||
* @param boolean $part Determines which portion of $haystack this function returns.
|
||||
* If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the first occurrence of $needle to the end, Default value is FALSE.
|
||||
* If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle.
|
||||
* If set to false, it returns all of $haystack from the first occurrence of $needle to the end,
|
||||
* Default value is FALSE.
|
||||
* @return string|boolean The portion of $haystack, or true if $needle is not found.
|
||||
* @access public
|
||||
* @static
|
||||
|
@ -879,14 +894,14 @@ class Multibyte extends Object {
|
|||
if ($length > 1 && count($keys[$key]['lower']) > 1) {
|
||||
$j = 0;
|
||||
|
||||
for ($ii = 0; $ii < count($keys[$key]['lower']); $ii++) {
|
||||
for ($ii = 0, $count = count($keys[$key]['lower']); $ii < $count; $ii++) {
|
||||
$nextChar = $utf8Map[$i + $ii];
|
||||
|
||||
if (isset($nextChar) && ($nextChar == $keys[$key]['lower'][$j + $ii])) {
|
||||
$replace++;
|
||||
}
|
||||
}
|
||||
if ($replace == count($keys[$key]['lower'])) {
|
||||
if ($replace == $count) {
|
||||
$upperCase[] = $keys[$key]['upper'];
|
||||
$replaced = array_merge($replaced, array_values($keys[$key]['lower']));
|
||||
$matched = true;
|
||||
|
@ -899,14 +914,14 @@ class Multibyte extends Object {
|
|||
|
||||
if (in_array($nextChar, $keys[$ii]['lower'])) {
|
||||
|
||||
for ($jj = 0; $jj < count($keys[$ii]['lower']); $jj++) {
|
||||
for ($jj = 0, $count = count($keys[$ii]['lower']); $jj < $count; $jj++) {
|
||||
$nextChar = $utf8Map[$i + $jj];
|
||||
|
||||
if (isset($nextChar) && ($nextChar == $keys[$ii]['lower'][$j + $jj])) {
|
||||
$replace++;
|
||||
}
|
||||
}
|
||||
if ($replace == count($keys[$ii]['lower'])) {
|
||||
if ($replace == $count) {
|
||||
$upperCase[] = $keys[$ii]['upper'];
|
||||
$replaced = array_merge($replaced, array_values($keys[$ii]['lower']));
|
||||
$matched = true;
|
||||
|
|
|
@ -410,7 +410,7 @@ class Router {
|
|||
$parsed[] = '/' . $element;
|
||||
}
|
||||
}
|
||||
return array('#^' . join('', $parsed) . '[\/]*$#', $names);
|
||||
return array('#^' . implode('', $parsed) . '[\/]*$#', $names);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -941,11 +941,11 @@ class Router {
|
|||
break;
|
||||
}
|
||||
}
|
||||
$output = join('/', $urlOut) . '/';
|
||||
$output = implode('/', $urlOut) . '/';
|
||||
}
|
||||
|
||||
if (!empty($args)) {
|
||||
$args = join('/', $args);
|
||||
$args = implode('/', $args);
|
||||
if ($output{strlen($output) - 1} != '/') {
|
||||
$args = '/'. $args;
|
||||
}
|
||||
|
@ -1132,7 +1132,7 @@ class Router {
|
|||
for ($i = 0; $i < $count; $i++) {
|
||||
$named[] = $keys[$i] . $this->named['separator'] . $params['named'][$keys[$i]];
|
||||
}
|
||||
$params['named'] = join('/', $named);
|
||||
$params['named'] = implode('/', $named);
|
||||
}
|
||||
$params['pass'] = str_replace('//', '/', $params['pass'] . '/' . $params['named']);
|
||||
}
|
||||
|
|
|
@ -165,7 +165,7 @@ class Sanitize {
|
|||
$params = params(func_get_args());
|
||||
$str = $params[0];
|
||||
|
||||
for ($i = 1; $i < count($params); $i++) {
|
||||
for ($i = 1, $count = count($params); $i < $count; $i++) {
|
||||
$str = preg_replace('/<' . $params[$i] . '\b[^>]*>/i', '', $str);
|
||||
$str = preg_replace('/<\/' . $params[$i] . '[^>]*>/i', '', $str);
|
||||
}
|
||||
|
|
|
@ -418,7 +418,7 @@ class Set {
|
|||
if (count($context['trace']) == 1) {
|
||||
$context['trace'][] = $context['key'];
|
||||
}
|
||||
$parent = join('/', $context['trace']) . '/.';
|
||||
$parent = implode('/', $context['trace']) . '/.';
|
||||
$context['item'] = Set::extract($parent, $data);
|
||||
$context['key'] = array_pop($context['trace']);
|
||||
if (isset($context['trace'][1]) && $context['trace'][1] > 0) {
|
||||
|
@ -1098,7 +1098,7 @@ class Set {
|
|||
if (!is_null($key)) {
|
||||
$id = $key;
|
||||
}
|
||||
if (is_array($r) && count($r)) {
|
||||
if (is_array($r) && !empty($r)) {
|
||||
$stack = array_merge($stack, Set::__flatten($r, $id));
|
||||
} else {
|
||||
$stack[] = array('id' => $id, 'value' => $r);
|
||||
|
|
|
@ -626,10 +626,10 @@ class Validation extends Object {
|
|||
if (empty($check)) {
|
||||
return false;
|
||||
}
|
||||
if ($options['max'] && sizeof($check) > $options['max']) {
|
||||
if ($options['max'] && count($check) > $options['max']) {
|
||||
return false;
|
||||
}
|
||||
if ($options['min'] && sizeof($check) < $options['min']) {
|
||||
if ($options['min'] && count($check) < $options['min']) {
|
||||
return false;
|
||||
}
|
||||
if ($options['in'] && is_array($options['in'])) {
|
||||
|
|
|
@ -602,7 +602,7 @@ class Helper extends Overloadable {
|
|||
$name = $field;
|
||||
break;
|
||||
default:
|
||||
$name = 'data[' . join('][', $view->entity()) . ']';
|
||||
$name = 'data[' . implode('][', $view->entity()) . ']';
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -261,7 +261,7 @@ class AjaxHelper extends AppHelper {
|
|||
$options['requestHeaders'] = array();
|
||||
}
|
||||
if (is_array($options['update'])) {
|
||||
$options['update'] = join(' ', $options['update']);
|
||||
$options['update'] = implode(' ', $options['update']);
|
||||
}
|
||||
$options['requestHeaders']['X-Update'] = $options['update'];
|
||||
} else {
|
||||
|
@ -824,7 +824,7 @@ class AjaxHelper extends AppHelper {
|
|||
$keys[] = "'" . $key . "'";
|
||||
$keys[] = "'" . $val . "'";
|
||||
}
|
||||
$jsOptions['requestHeaders'] = '[' . join(', ', $keys) . ']';
|
||||
$jsOptions['requestHeaders'] = '[' . implode(', ', $keys) . ']';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -873,7 +873,7 @@ class AjaxHelper extends AppHelper {
|
|||
}
|
||||
}
|
||||
|
||||
$out = join(', ', $out);
|
||||
$out = implode(', ', $out);
|
||||
$out = '{' . $out . '}';
|
||||
return $out;
|
||||
} else {
|
||||
|
@ -996,7 +996,7 @@ class AjaxHelper extends AppHelper {
|
|||
$data[] = $key . ':"' . rawurlencode($val) . '"';
|
||||
}
|
||||
}
|
||||
$out = 'var __ajaxUpdater__ = {' . join(", \n", $data) . '};' . "\n";
|
||||
$out = 'var __ajaxUpdater__ = {' . implode(", \n", $data) . '};' . "\n";
|
||||
$out .= 'for (n in __ajaxUpdater__) { if (typeof __ajaxUpdater__[n] == "string"';
|
||||
$out .= ' && $(n)) Element.update($(n), unescape(decodeURIComponent(';
|
||||
$out .= '__ajaxUpdater__[n]))); }';
|
||||
|
|
|
@ -409,7 +409,7 @@ class FormHelper extends AppHelper {
|
|||
}
|
||||
}
|
||||
}
|
||||
$field = join('.', $field);
|
||||
$field = implode('.', $field);
|
||||
if (!in_array($field, $this->fields)) {
|
||||
if ($value !== null) {
|
||||
return $this->fields[$field] = $value;
|
||||
|
@ -1028,7 +1028,7 @@ class FormHelper extends AppHelper {
|
|||
));
|
||||
}
|
||||
}
|
||||
$out = $hidden . join($inbetween, $out);
|
||||
$out = $hidden . implode($inbetween, $out);
|
||||
|
||||
if ($legend) {
|
||||
$out = sprintf(
|
||||
|
|
|
@ -560,7 +560,7 @@ class HtmlHelper extends AppHelper {
|
|||
if ($oneline) {
|
||||
return join(' ', $out);
|
||||
}
|
||||
return join("\n", $out);
|
||||
return implode("\n", $out);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -572,7 +572,7 @@ class HtmlHelper extends AppHelper {
|
|||
* @access public
|
||||
*/
|
||||
function getCrumbs($separator = '»', $startText = false) {
|
||||
if (count($this->_crumbs)) {
|
||||
if (!empty($this->_crumbs)) {
|
||||
$out = array();
|
||||
if ($startText) {
|
||||
$out[] = $this->link($startText, '/');
|
||||
|
@ -585,7 +585,7 @@ class HtmlHelper extends AppHelper {
|
|||
$out[] = $crumb[0];
|
||||
}
|
||||
}
|
||||
return $this->output(join($separator, $out));
|
||||
return $this->output(implode($separator, $out));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@ -643,7 +643,7 @@ class HtmlHelper extends AppHelper {
|
|||
foreach ($names as $arg) {
|
||||
$out[] = sprintf($this->tags['tableheader'], $this->_parseAttributes($thOptions), $arg);
|
||||
}
|
||||
$data = sprintf($this->tags['tablerow'], $this->_parseAttributes($trOptions), join(' ', $out));
|
||||
$data = sprintf($this->tags['tablerow'], $this->_parseAttributes($trOptions), implode(' ', $out));
|
||||
return $this->output($data);
|
||||
}
|
||||
|
||||
|
@ -696,9 +696,9 @@ class HtmlHelper extends AppHelper {
|
|||
$cellsOut[] = sprintf($this->tags['tablecell'], $this->_parseAttributes($cellOptions), $cell);
|
||||
}
|
||||
$options = $this->_parseAttributes($count % 2 ? $oddTrOptions : $evenTrOptions);
|
||||
$out[] = sprintf($this->tags['tablerow'], $options, join(' ', $cellsOut));
|
||||
$out[] = sprintf($this->tags['tablerow'], $options, implode(' ', $cellsOut));
|
||||
}
|
||||
return $this->output(join("\n", $out));
|
||||
return $this->output(implode("\n", $out));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -655,9 +655,9 @@ class JavascriptHelper extends AppHelper {
|
|||
}
|
||||
|
||||
if (!$numeric) {
|
||||
$rt = '{' . join(',', $out) . '}';
|
||||
$rt = '{' . implode(',', $out) . '}';
|
||||
} else {
|
||||
$rt = '[' . join(',', $out) . ']';
|
||||
$rt = '[' . implode(',', $out) . ']';
|
||||
}
|
||||
}
|
||||
$rt = $options['prefix'] . $rt . $options['postfix'];
|
||||
|
|
|
@ -217,7 +217,7 @@ class RssHelper extends XmlHelper {
|
|||
}
|
||||
$categories[] = $this->elem($key, $attrib, $category);
|
||||
}
|
||||
$elements[$key] = join('', $categories);
|
||||
$elements[$key] = implode('', $categories);
|
||||
continue 2;
|
||||
} else if (is_array($val) && isset($val['domain'])) {
|
||||
$attrib['domain'] = $val['domain'];
|
||||
|
@ -267,7 +267,7 @@ class RssHelper extends XmlHelper {
|
|||
$elements[$key] = $this->elem($key, $attrib, $val);
|
||||
}
|
||||
if (!empty($elements)) {
|
||||
$content = join('', $elements);
|
||||
$content = implode('', $elements);
|
||||
}
|
||||
return $this->output($this->elem('item', $att, $content, !($content === null)));
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ class TimeHelper extends AppHelper {
|
|||
if (empty($dateString)) {
|
||||
return false;
|
||||
}
|
||||
if (is_integer($dateString) || is_numeric($dateString)) {
|
||||
if (is_int($dateString) || is_numeric($dateString)) {
|
||||
$date = intval($dateString);
|
||||
} else {
|
||||
$date = strtotime($dateString);
|
||||
|
|
|
@ -454,7 +454,7 @@ class View extends Object {
|
|||
|
||||
$dataForLayout = array_merge($this->viewVars, array(
|
||||
'content_for_layout' => $content_for_layout,
|
||||
'scripts_for_layout' => join("\n\t", $this->__scripts),
|
||||
'scripts_for_layout' => implode("\n\t", $this->__scripts),
|
||||
'cakeDebug' => $debug
|
||||
));
|
||||
|
||||
|
|
|
@ -590,7 +590,7 @@ class XmlNode extends Object {
|
|||
* @access public
|
||||
*/
|
||||
function hasChildren() {
|
||||
if (is_array($this->children) && count($this->children) > 0) {
|
||||
if (is_array($this->children) && !empty($this->children)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -618,7 +618,7 @@ class XmlNode extends Object {
|
|||
}
|
||||
|
||||
$d .= '<' . $this->name();
|
||||
if (count($this->namespaces) > 0) {
|
||||
if (!empty($this->namespaces) > 0) {
|
||||
foreach ($this->namespaces as $key => $val) {
|
||||
$val = str_replace('"', '\"', $val);
|
||||
$d .= ' xmlns:' . $key . '="' . $val . '"';
|
||||
|
@ -626,14 +626,14 @@ class XmlNode extends Object {
|
|||
}
|
||||
|
||||
$parent =& $this->parent();
|
||||
if ($parent->name === '#document' && count($parent->namespaces) > 0) {
|
||||
if ($parent->name === '#document' && !empty($parent->namespaces)) {
|
||||
foreach ($parent->namespaces as $key => $val) {
|
||||
$val = str_replace('"', '\"', $val);
|
||||
$d .= ' xmlns:' . $key . '="' . $val . '"';
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($this->attributes) && count($this->attributes) > 0) {
|
||||
if (is_array($this->attributes) && !empty($this->attributes)) {
|
||||
foreach ($this->attributes as $key => $val) {
|
||||
if (is_bool($val) && $val === false) {
|
||||
$val = 0;
|
||||
|
|
|
@ -113,6 +113,9 @@ class MagicDbTest extends UnitTestCase {
|
|||
$r = $this->Db->toArray(array('yeah'));
|
||||
$this->assertTrue($r === array('yeah'));
|
||||
|
||||
$r = $this->Db->toArray("# FILE_ID DB\r\n# Date:2009-10-10\r\n# Source:xxx.php");
|
||||
$this->assertTrue($r === array());
|
||||
|
||||
$r = $this->Db->toArray('foo');
|
||||
$this->assertTrue($r === array());
|
||||
|
||||
|
|
|
@ -305,7 +305,7 @@ class AclBehaviorTestCase extends CakeTestCase {
|
|||
$this->assertEqual($result['Aro']['parent_id'], 5);
|
||||
|
||||
$node = $Person->node(array('model' => 'AclPerson', 'foreign_key' => 8));
|
||||
$this->assertEqual(sizeof($node), 2);
|
||||
$this->assertEqual(count($node), 2);
|
||||
$this->assertEqual($node[0]['Aro']['parent_id'], 5);
|
||||
$this->assertEqual($node[1]['Aro']['parent_id'], null);
|
||||
|
||||
|
@ -358,7 +358,7 @@ class AclBehaviorTestCase extends CakeTestCase {
|
|||
$Person->save($data);
|
||||
$id = $Person->id;
|
||||
$node = $Person->node();
|
||||
$this->assertEqual(sizeof($node), 2);
|
||||
$this->assertEqual(count($node), 2);
|
||||
$this->assertEqual($node[0]['Aro']['parent_id'], 5);
|
||||
$this->assertEqual($node[1]['Aro']['parent_id'], null);
|
||||
|
||||
|
@ -406,7 +406,7 @@ class AclBehaviorTestCase extends CakeTestCase {
|
|||
$Person->id = 2;
|
||||
$result = $Person->node();
|
||||
$this->assertTrue(is_array($result));
|
||||
$this->assertEqual(sizeof($result), 1);
|
||||
$this->assertEqual(count($result), 1);
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -4887,21 +4887,6 @@ class ModelReadTest extends BaseModelTest {
|
|||
$this->assertFalse($TestModel->find('all', array('connection' => 'foo')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that the database configuration assigned to the model can be changed using
|
||||
* (before|after)Find callbacks
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCallbackSourceChange() {
|
||||
$this->loadFixtures('Post');
|
||||
$TestModel = new Post();
|
||||
$this->assertEqual(3, count($TestModel->find('all')));
|
||||
|
||||
$this->expectError(new PatternExpectation('/Non-existent data source foo/i'));
|
||||
$this->expectError(new PatternExpectation('/Only variable references/i'));
|
||||
$this->assertFalse($TestModel->find('all', array('connection' => 'foo')));
|
||||
}
|
||||
/**
|
||||
* testMultipleBelongsToWithSameClass method
|
||||
*
|
||||
|
|
|
@ -624,7 +624,7 @@ class ModelWriteTest extends BaseModelTest {
|
|||
function testBeforeValidateSaveAbortion() {
|
||||
$Model =& new CallbackPostTestModel();
|
||||
$Model->beforeValidateReturn = false;
|
||||
|
||||
|
||||
$data = array(
|
||||
'title' => 'new article',
|
||||
'body' => 'this is some text.'
|
||||
|
@ -2015,6 +2015,54 @@ class ModelWriteTest extends BaseModelTest {
|
|||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* test that saving habtm records respects conditions set in the the 'conditions' key
|
||||
* for the association.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHabtmSaveWithConditionsInAssociation() {
|
||||
$this->loadFixtures('JoinThing', 'Something', 'SomethingElse');
|
||||
$Something =& new Something();
|
||||
$Something->unbindModel(array('hasAndBelongsToMany' => array('SomethingElse')), false);
|
||||
|
||||
$Something->bindModel(array(
|
||||
'hasAndBelongsToMany' => array(
|
||||
'DoomedSomethingElse' => array(
|
||||
'className' => 'SomethingElse',
|
||||
'joinTable' => 'join_things',
|
||||
'conditions' => 'JoinThing.doomed = 1',
|
||||
'unique' => true
|
||||
),
|
||||
'NotDoomedSomethingElse' => array(
|
||||
'className' => 'SomethingElse',
|
||||
'joinTable' => 'join_things',
|
||||
'conditions' => array('JoinThing.doomed' => 0),
|
||||
'unique' => true
|
||||
)
|
||||
)
|
||||
), false);
|
||||
$result = $Something->read(null, 1);
|
||||
$this->assertTrue(empty($result['NotDoomedSomethingElse']));
|
||||
$this->assertEqual(count($result['DoomedSomethingElse']), 1);
|
||||
|
||||
$data = array(
|
||||
'Something' => array('id' => 1),
|
||||
'NotDoomedSomethingElse' => array(
|
||||
'NotDoomedSomethingElse' => array(
|
||||
array('something_else_id' => 2, 'doomed' => 0),
|
||||
array('something_else_id' => 3, 'doomed' => 0)
|
||||
)
|
||||
)
|
||||
);
|
||||
$Something->create($data);
|
||||
$result = $Something->save();
|
||||
$this->assertTrue($result);
|
||||
|
||||
$result = $Something->read(null, 1);
|
||||
$this->assertEqual(count($result['NotDoomedSomethingElse']), 2);
|
||||
$this->assertEqual(count($result['DoomedSomethingElse']), 1);
|
||||
}
|
||||
/**
|
||||
* testHabtmSaveKeyResolution method
|
||||
*
|
||||
|
|
|
@ -3090,8 +3090,6 @@ class Uuiditem extends CakeTestModel {
|
|||
* @var array
|
||||
* @access public
|
||||
*/
|
||||
//var $hasAndBelongsToMany = array('Uuidportfolio' => array('unique' => true));
|
||||
// var $hasAndBelongsToMany = array('Uuidportfolio' => array('with' => 'UuiditemsUuidportfolio'));
|
||||
var $hasAndBelongsToMany = array('Uuidportfolio' => array('with' => 'UuiditemsUuidportfolioNumericid'));
|
||||
|
||||
}
|
||||
|
|
|
@ -5064,21 +5064,6 @@ class FormHelperTest extends CakeTestCase {
|
|||
'/fieldset'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
|
||||
$this->Form->data = array();
|
||||
$this->Form->params['controller'] = 'contacts';
|
||||
$this->Form->params['models'] = array('Contact');
|
||||
$result = $this->Form->create(array('url' => array('action' => 'index', 'param')));
|
||||
$expected = array(
|
||||
'form' => array(
|
||||
'id' => 'ContactAddForm', 'method' => 'post', 'action' => '/contacts/index/param'
|
||||
),
|
||||
'fieldset' => array('style' => 'preg:/display\s*\:\s*none;\s*/'),
|
||||
'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'),
|
||||
'/fieldset'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -656,10 +656,10 @@ class CakeTestCase extends UnitTestCase {
|
|||
$permutations = $this->__array_permute($attrs);
|
||||
$permutationTokens = array();
|
||||
foreach ($permutations as $permutation) {
|
||||
$permutationTokens[] = join('', $permutation);
|
||||
$permutationTokens[] = implode('', $permutation);
|
||||
}
|
||||
$regex[] = array(
|
||||
sprintf('%s', join(', ', $explanations)),
|
||||
sprintf('%s', implode(', ', $explanations)),
|
||||
$permutationTokens,
|
||||
$i,
|
||||
);
|
||||
|
|
|
@ -602,7 +602,7 @@ class HtmlTestManager extends TestManager {
|
|||
foreach ($testCases as $testCaseFile => $testCase) {
|
||||
$title = explode(strpos($testCase, '\\') ? '\\' : '/', str_replace('.test.php', '', $testCase));
|
||||
$title[count($title) - 1] = Inflector::camelize($title[count($title) - 1]);
|
||||
$title = join(' / ', $title);
|
||||
$title = implode(' / ', $title);
|
||||
|
||||
$buffer .= "<li><a href='" . $manager->getBaseURL() . "?case=" . urlencode($testCase) . $urlExtra ."'>" . $title . "</a></li>\n";
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;<?php die() ?>
|
||||
;<?php exit() ?>
|
||||
; SVN FILE: $Id$
|
||||
;/**
|
||||
; * Test App Ini Based Acl Config File
|
||||
|
|
Loading…
Reference in a new issue