mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Replace function join (alias) by implode.
Signed-off-by: Mark Story <mark@mark-story.com>
This commit is contained in:
parent
1acc60b04c
commit
df9e1e0bd1
33 changed files with 111 additions and 111 deletions
|
@ -423,7 +423,7 @@ if (!function_exists('file_put_contents')) {
|
||||||
/**
|
/**
|
||||||
* Writes data into file.
|
* 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 string $fileName File name.
|
||||||
* @param mixed $data String or array.
|
* @param mixed $data String or array.
|
||||||
|
@ -431,7 +431,7 @@ if (!function_exists('file_put_contents')) {
|
||||||
*/
|
*/
|
||||||
function file_put_contents($fileName, $data) {
|
function file_put_contents($fileName, $data) {
|
||||||
if (is_array($data)) {
|
if (is_array($data)) {
|
||||||
$data = join('', $data);
|
$data = implode('', $data);
|
||||||
}
|
}
|
||||||
$res = @fopen($fileName, 'w+b');
|
$res = @fopen($fileName, 'w+b');
|
||||||
|
|
||||||
|
|
|
@ -286,7 +286,7 @@ class ConsoleShell extends Shell {
|
||||||
break;
|
break;
|
||||||
case (preg_match("/^routes\s+show/i", $command, $tmp) == true):
|
case (preg_match("/^routes\s+show/i", $command, $tmp) == true):
|
||||||
$router =& Router::getInstance();
|
$router =& Router::getInstance();
|
||||||
$this->out(join("\n", Set::extract($router->routes, '{n}.0')));
|
$this->out(implode("\n", Set::extract($router->routes, '{n}.0')));
|
||||||
break;
|
break;
|
||||||
case (preg_match("/^route\s+(.*)/i", $command, $tmp) == true):
|
case (preg_match("/^route\s+(.*)/i", $command, $tmp) == true):
|
||||||
$this->out(var_export(Router::parse($tmp[1]), true));
|
$this->out(var_export(Router::parse($tmp[1]), true));
|
||||||
|
|
|
@ -126,7 +126,7 @@ class ControllerTask extends Shell {
|
||||||
if (file_exists($this->path . $controllerFile .'_controller.php')) {
|
if (file_exists($this->path . $controllerFile .'_controller.php')) {
|
||||||
$question[] = sprintf(__("Warning: Choosing no will overwrite the %sController.", true), $controllerName);
|
$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' || strtolower($doItInteractive) == 'yes') {
|
if (strtolower($doItInteractive) == 'y' || strtolower($doItInteractive) == 'yes') {
|
||||||
$this->interactive = true;
|
$this->interactive = true;
|
||||||
|
@ -313,7 +313,7 @@ class ControllerTask extends Shell {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($compact)) {
|
if (!empty($compact)) {
|
||||||
$actions .= "\t\t\$this->set(compact(" . join(', ', $compact) . "));\n";
|
$actions .= "\t\t\$this->set(compact(" . implode(', ', $compact) . "));\n";
|
||||||
}
|
}
|
||||||
$actions .= "\t}\n";
|
$actions .= "\t}\n";
|
||||||
$actions .= "\n";
|
$actions .= "\n";
|
||||||
|
@ -365,7 +365,7 @@ class ControllerTask extends Shell {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($compact)) {
|
if (!empty($compact)) {
|
||||||
$actions .= "\t\t\$this->set(compact(" . join(',', $compact) . "));\n";
|
$actions .= "\t\t\$this->set(compact(" . implode(',', $compact) . "));\n";
|
||||||
}
|
}
|
||||||
$actions .= "\t}\n";
|
$actions .= "\t}\n";
|
||||||
$actions .= "\n";
|
$actions .= "\n";
|
||||||
|
|
|
@ -414,13 +414,13 @@ class ExtractTask extends Shell{
|
||||||
|
|
||||||
if ($this->__oneFile === true) {
|
if ($this->__oneFile === true) {
|
||||||
foreach ($fileInfo as $file => $lines) {
|
foreach ($fileInfo as $file => $lines) {
|
||||||
$occured[] = "$file:" . join(';', $lines);
|
$occured[] = "$file:" . implode(';', $lines);
|
||||||
|
|
||||||
if (isset($this->__fileVersions[$file])) {
|
if (isset($this->__fileVersions[$file])) {
|
||||||
$fileList[] = $this->__fileVersions[$file];
|
$fileList[] = $this->__fileVersions[$file];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$occurances = join("\n#: ", $occured);
|
$occurances = implode("\n#: ", $occured);
|
||||||
$occurances = str_replace($this->path, '', $occurances);
|
$occurances = str_replace($this->path, '', $occurances);
|
||||||
$output = "#: $occurances\n";
|
$output = "#: $occurances\n";
|
||||||
$filename = $this->__filename;
|
$filename = $this->__filename;
|
||||||
|
@ -439,12 +439,12 @@ class ExtractTask extends Shell{
|
||||||
} else {
|
} else {
|
||||||
foreach ($fileInfo as $file => $lines) {
|
foreach ($fileInfo as $file => $lines) {
|
||||||
$filename = $str;
|
$filename = $str;
|
||||||
$occured = array("$str:" . join(';', $lines));
|
$occured = array("$str:" . implode(';', $lines));
|
||||||
|
|
||||||
if (isset($this->__fileVersions[$str])) {
|
if (isset($this->__fileVersions[$str])) {
|
||||||
$fileList[] = $this->__fileVersions[$str];
|
$fileList[] = $this->__fileVersions[$str];
|
||||||
}
|
}
|
||||||
$occurances = join("\n#: ", $occured);
|
$occurances = implode("\n#: ", $occured);
|
||||||
$occurances = str_replace($this->path, '', $occurances);
|
$occurances = str_replace($this->path, '', $occurances);
|
||||||
$output .= "#: $occurances\n";
|
$output .= "#: $occurances\n";
|
||||||
|
|
||||||
|
@ -511,9 +511,9 @@ class ExtractTask extends Shell{
|
||||||
$fileList = str_replace(array($this->path), '', $fileList);
|
$fileList = str_replace(array($this->path), '', $fileList);
|
||||||
|
|
||||||
if (count($fileList) > 1) {
|
if (count($fileList) > 1) {
|
||||||
$fileList = "Generated from files:\n# " . join("\n# ", $fileList);
|
$fileList = "Generated from files:\n# " . implode("\n# ", $fileList);
|
||||||
} elseif (count($fileList) == 1) {
|
} elseif (count($fileList) == 1) {
|
||||||
$fileList = 'Generated from file: ' . join('', $fileList);
|
$fileList = 'Generated from file: ' . implode('', $fileList);
|
||||||
} else {
|
} else {
|
||||||
$fileList = 'No version information was available in the source files.';
|
$fileList = 'No version information was available in the source files.';
|
||||||
}
|
}
|
||||||
|
@ -535,7 +535,7 @@ class ExtractTask extends Shell{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fp = fopen($this->__output . $file, 'w');
|
$fp = fopen($this->__output . $file, 'w');
|
||||||
fwrite($fp, str_replace('--VERSIONS--', $fileList, join('', $content)));
|
fwrite($fp, str_replace('--VERSIONS--', $fileList, implode('', $content)));
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -700,7 +700,7 @@ class ModelTask extends Shell {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fixture = join(", ", $fixture);
|
$fixture = implode(", ", $fixture);
|
||||||
|
|
||||||
$import = $className;
|
$import = $className;
|
||||||
if (isset($this->plugin)) {
|
if (isset($this->plugin)) {
|
||||||
|
@ -904,24 +904,24 @@ class ModelTask extends Shell {
|
||||||
}
|
}
|
||||||
$records[] = "\t\t'$field' => $insert";
|
$records[] = "\t\t'$field' => $insert";
|
||||||
unset($value['type']);
|
unset($value['type']);
|
||||||
$col .= join(', ', $schema->__values($value));
|
$col .= implode(', ', $schema->__values($value));
|
||||||
} else {
|
} else {
|
||||||
$col = "\t\t'indexes' => array(";
|
$col = "\t\t'indexes' => array(";
|
||||||
$props = array();
|
$props = array();
|
||||||
foreach ((array)$value as $key => $index) {
|
foreach ((array)$value as $key => $index) {
|
||||||
$props[] = "'{$key}' => array(" . join(', ', $schema->__values($index)) . ")";
|
$props[] = "'{$key}' => array(" . implode(', ', $schema->__values($index)) . ")";
|
||||||
}
|
}
|
||||||
$col .= join(', ', $props);
|
$col .= implode(', ', $props);
|
||||||
}
|
}
|
||||||
$col .= ")";
|
$col .= ")";
|
||||||
$cols[] = $col;
|
$cols[] = $col;
|
||||||
}
|
}
|
||||||
$out .= join(",\n", $cols);
|
$out .= implode(",\n", $cols);
|
||||||
}
|
}
|
||||||
$out .= "\n\t);\n";
|
$out .= "\n\t);\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$records = join(",\n", $records);
|
$records = implode(",\n", $records);
|
||||||
$out .= "\tvar \$records = array(array(\n$records\n\t));\n";
|
$out .= "\tvar \$records = array(array(\n$records\n\t));\n";
|
||||||
$out .= "}\n";
|
$out .= "}\n";
|
||||||
$path = TESTS . DS . 'fixtures' . DS;
|
$path = TESTS . DS . 'fixtures' . DS;
|
||||||
|
|
|
@ -79,7 +79,7 @@ class PagesController extends AppController {
|
||||||
$title = Inflector::humanize($path[$count - 1]);
|
$title = Inflector::humanize($path[$count - 1]);
|
||||||
}
|
}
|
||||||
$this->set(compact('page', 'subpage', 'title'));
|
$this->set(compact('page', 'subpage', 'title'));
|
||||||
$this->render(join('/', $path));
|
$this->render(implode('/', $path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -327,7 +327,7 @@ class SecurityComponent extends Object {
|
||||||
$out[] = 'opaque="' . md5($options['realm']).'"';
|
$out[] = 'opaque="' . md5($options['realm']).'"';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $auth . ' ' . join(',', $out);
|
return $auth . ' ' . implode(',', $out);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Parses an HTTP digest authentication response, and returns an array of the data, or null on failure.
|
* Parses an HTTP digest authentication response, and returns an array of the data, or null on failure.
|
||||||
|
|
|
@ -79,7 +79,7 @@ class PagesController extends AppController {
|
||||||
$title = Inflector::humanize($path[$count - 1]);
|
$title = Inflector::humanize($path[$count - 1]);
|
||||||
}
|
}
|
||||||
$this->set(compact('page', 'subpage', 'title'));
|
$this->set(compact('page', 'subpage', 'title'));
|
||||||
$this->render(join('/', $path));
|
$this->render(implode('/', $path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -275,7 +275,7 @@ class Debugger extends Object {
|
||||||
foreach ($next['args'] as $arg) {
|
foreach ($next['args'] as $arg) {
|
||||||
$args[] = Debugger::exportVar($arg);
|
$args[] = Debugger::exportVar($arg);
|
||||||
}
|
}
|
||||||
$function .= join(', ', $args);
|
$function .= implode(', ', $args);
|
||||||
}
|
}
|
||||||
$function .= ')';
|
$function .= ')';
|
||||||
}
|
}
|
||||||
|
@ -297,7 +297,7 @@ class Debugger extends Object {
|
||||||
if ($options['format'] == 'array' || $options['format'] == 'points') {
|
if ($options['format'] == 'array' || $options['format'] == 'points') {
|
||||||
return $back;
|
return $back;
|
||||||
}
|
}
|
||||||
return join("\n", $back);
|
return implode("\n", $back);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Shortens file paths by replacing the application base path with 'APP', and the CakePHP core
|
* Shortens file paths by replacing the application base path with 'APP', and the CakePHP core
|
||||||
|
@ -406,7 +406,7 @@ class Debugger extends Object {
|
||||||
if (count($vars) > 0) {
|
if (count($vars) > 0) {
|
||||||
$n = "\n";
|
$n = "\n";
|
||||||
}
|
}
|
||||||
return $out . join(",", $vars) . "{$n})";
|
return $out . implode(",", $vars) . "{$n})";
|
||||||
break;
|
break;
|
||||||
case 'resource':
|
case 'resource':
|
||||||
return strtolower(gettype($var));
|
return strtolower(gettype($var));
|
||||||
|
@ -444,7 +444,7 @@ class Debugger extends Object {
|
||||||
$out[] = "$className::$$key = " . $value;
|
$out[] = "$className::$$key = " . $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return join("\n", $out);
|
return implode("\n", $out);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Handles object conversion to debug string.
|
* Handles object conversion to debug string.
|
||||||
|
|
|
@ -217,7 +217,7 @@ class Flay extends Object{
|
||||||
if (count($snips) > $max_snippets) {
|
if (count($snips) > $max_snippets) {
|
||||||
$snips = array_slice($snips, 0, $max_snippets);
|
$snips = array_slice($snips, 0, $max_snippets);
|
||||||
}
|
}
|
||||||
$joined = join(' <b>...</b> ', $snips);
|
$joined = implode(' <b>...</b> ', $snips);
|
||||||
$snips = $joined ? "<b>...</b> {$joined} <b>...</b>" : substr($string, 0, 80) . '<b>...</b>';
|
$snips = $joined ? "<b>...</b> {$joined} <b>...</b>" : substr($string, 0, 80) . '<b>...</b>';
|
||||||
return $this->colorMark($words, $snips);
|
return $this->colorMark($words, $snips);
|
||||||
}
|
}
|
||||||
|
|
|
@ -738,7 +738,7 @@ class HttpSocket extends CakeSocket {
|
||||||
$request['uri'] = $this->buildUri($request['uri'], '/%path?%query');
|
$request['uri'] = $this->buildUri($request['uri'], '/%path?%query');
|
||||||
|
|
||||||
if (!$this->quirksMode && $request['uri'] === '*' && !in_array($request['method'], $asteriskMethods)) {
|
if (!$this->quirksMode && $request['uri'] === '*' && !in_array($request['method'], $asteriskMethods)) {
|
||||||
trigger_error(sprintf(__('HttpSocket::buildRequestLine - The "*" asterisk character is only allowed for the following methods: %s. Activate quirks mode to work outside of HTTP/1.1 specs.', true), join(',', $asteriskMethods)), E_USER_WARNING);
|
trigger_error(sprintf(__('HttpSocket::buildRequestLine - The "*" asterisk character is only allowed for the following methods: %s. Activate quirks mode to work outside of HTTP/1.1 specs.', true), implode(',', $asteriskMethods)), E_USER_WARNING);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return $request['method'].' '.$request['uri'].' '.$versionToken.$this->lineBreak;
|
return $request['method'].' '.$request['uri'].' '.$versionToken.$this->lineBreak;
|
||||||
|
@ -776,7 +776,7 @@ class HttpSocket extends CakeSocket {
|
||||||
$returnHeader = '';
|
$returnHeader = '';
|
||||||
foreach ($header as $field => $contents) {
|
foreach ($header as $field => $contents) {
|
||||||
if (is_array($contents) && $mode == 'standard') {
|
if (is_array($contents) && $mode == 'standard') {
|
||||||
$contents = join(',', $contents);
|
$contents = implode(',', $contents);
|
||||||
}
|
}
|
||||||
foreach ((array)$contents as $content) {
|
foreach ((array)$contents as $content) {
|
||||||
$contents = preg_replace("/\r\n(?![\t ])/", "\r\n ", $content);
|
$contents = preg_replace("/\r\n(?![\t ])/", "\r\n ", $content);
|
||||||
|
@ -921,7 +921,7 @@ class HttpSocket extends CakeSocket {
|
||||||
* @todo Test $chars parameter
|
* @todo Test $chars parameter
|
||||||
*/
|
*/
|
||||||
function unescapeToken($token, $chars = null) {
|
function unescapeToken($token, $chars = null) {
|
||||||
$regex = '/"(['.join('', $this->__tokenEscapeChars(true, $chars)).'])"/';
|
$regex = '/"(['.implode('', $this->__tokenEscapeChars(true, $chars)).'])"/';
|
||||||
$token = preg_replace($regex, '\\1', $token);
|
$token = preg_replace($regex, '\\1', $token);
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
|
@ -934,7 +934,7 @@ class HttpSocket extends CakeSocket {
|
||||||
* @todo Test $chars parameter
|
* @todo Test $chars parameter
|
||||||
*/
|
*/
|
||||||
function escapeToken($token, $chars = null) {
|
function escapeToken($token, $chars = null) {
|
||||||
$regex = '/(['.join('', $this->__tokenEscapeChars(true, $chars)).'])/';
|
$regex = '/(['.implode('', $this->__tokenEscapeChars(true, $chars)).'])/';
|
||||||
$token = preg_replace($regex, '"\\1"', $token);
|
$token = preg_replace($regex, '"\\1"', $token);
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,8 +243,8 @@ class Inflector extends Object {
|
||||||
extract($_this->pluralRules);
|
extract($_this->pluralRules);
|
||||||
|
|
||||||
if (!isset($regexUninflected) || !isset($regexIrregular)) {
|
if (!isset($regexUninflected) || !isset($regexIrregular)) {
|
||||||
$regexUninflected = __enclose(join( '|', $uninflected));
|
$regexUninflected = __enclose(implode( '|', $uninflected));
|
||||||
$regexIrregular = __enclose(join( '|', array_keys($irregular)));
|
$regexIrregular = __enclose(implode( '|', array_keys($irregular)));
|
||||||
$_this->pluralRules['regexUninflected'] = $regexUninflected;
|
$_this->pluralRules['regexUninflected'] = $regexUninflected;
|
||||||
$_this->pluralRules['regexIrregular'] = $regexIrregular;
|
$_this->pluralRules['regexIrregular'] = $regexIrregular;
|
||||||
}
|
}
|
||||||
|
@ -383,8 +383,8 @@ class Inflector extends Object {
|
||||||
extract($_this->singularRules);
|
extract($_this->singularRules);
|
||||||
|
|
||||||
if (!isset($regexUninflected) || !isset($regexIrregular)) {
|
if (!isset($regexUninflected) || !isset($regexIrregular)) {
|
||||||
$regexUninflected = __enclose(join( '|', $uninflected));
|
$regexUninflected = __enclose(implode( '|', $uninflected));
|
||||||
$regexIrregular = __enclose(join( '|', array_keys($irregular)));
|
$regexIrregular = __enclose(implode( '|', array_keys($irregular)));
|
||||||
$_this->singularRules['regexUninflected'] = $regexUninflected;
|
$_this->singularRules['regexUninflected'] = $regexUninflected;
|
||||||
$_this->singularRules['regexIrregular'] = $regexIrregular;
|
$_this->singularRules['regexIrregular'] = $regexIrregular;
|
||||||
}
|
}
|
||||||
|
|
|
@ -283,7 +283,7 @@ class ContainableBehavior extends ModelBehavior {
|
||||||
if (strpos($name, '.') !== false) {
|
if (strpos($name, '.') !== false) {
|
||||||
$chain = explode('.', $name);
|
$chain = explode('.', $name);
|
||||||
$name = array_shift($chain);
|
$name = array_shift($chain);
|
||||||
$children = array(join('.', $chain) => $children);
|
$children = array(implode('.', $chain) => $children);
|
||||||
}
|
}
|
||||||
|
|
||||||
$children = (array)$children;
|
$children = (array)$children;
|
||||||
|
|
|
@ -591,7 +591,7 @@ class DboMssql extends DboSource {
|
||||||
|
|
||||||
foreach (array('columns', 'indexes') as $var) {
|
foreach (array('columns', 'indexes') as $var) {
|
||||||
if (is_array(${$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}";
|
return "CREATE TABLE {$table} (\n{$columns});\n{$indexes}";
|
||||||
|
@ -719,7 +719,7 @@ class DboMssql extends DboSource {
|
||||||
$out = "ALTER TABLE {$table} ADD CONSTRAINT {$name} UNIQUE";
|
$out = "ALTER TABLE {$table} ADD CONSTRAINT {$name} UNIQUE";
|
||||||
|
|
||||||
if (is_array($value['column'])) {
|
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 {
|
} else {
|
||||||
$value['column'] = $this->name($value['column']);
|
$value['column'] = $this->name($value['column']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,7 +141,7 @@ class DboMysqlBase extends DboSource {
|
||||||
|
|
||||||
$alias = $joins = false;
|
$alias = $joins = false;
|
||||||
$fields = $this->_prepareUpdateFields($model, $combined, empty($conditions), !empty($conditions));
|
$fields = $this->_prepareUpdateFields($model, $combined, empty($conditions), !empty($conditions));
|
||||||
$fields = join(', ', $fields);
|
$fields = implode(', ', $fields);
|
||||||
$table = $this->fullTableName($model);
|
$table = $this->fullTableName($model);
|
||||||
|
|
||||||
if (!empty($conditions)) {
|
if (!empty($conditions)) {
|
||||||
|
@ -281,7 +281,7 @@ class DboMysqlBase extends DboSource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$colList = array_merge($colList, $this->_alterIndexes($curTable, $indexes));
|
$colList = array_merge($colList, $this->_alterIndexes($curTable, $indexes));
|
||||||
$out .= "\t" . join(",\n\t", $colList) . ";\n\n";
|
$out .= "\t" . implode(",\n\t", $colList) . ";\n\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $out;
|
return $out;
|
||||||
|
@ -339,7 +339,7 @@ class DboMysqlBase extends DboSource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_array($value['column'])) {
|
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 {
|
} else {
|
||||||
$out .= 'KEY '. $name .' (' . $this->name($value['column']) . ')';
|
$out .= 'KEY '. $name .' (' . $this->name($value['column']) . ')';
|
||||||
}
|
}
|
||||||
|
@ -358,7 +358,7 @@ class DboMysqlBase extends DboSource {
|
||||||
function insertMulti($table, $fields, $values) {
|
function insertMulti($table, $fields, $values) {
|
||||||
$table = $this->fullTableName($table);
|
$table = $this->fullTableName($table);
|
||||||
if (is_array($fields)) {
|
if (is_array($fields)) {
|
||||||
$fields = join(', ', array_map(array(&$this, 'name'), $fields));
|
$fields = implode(', ', array_map(array(&$this, 'name'), $fields));
|
||||||
}
|
}
|
||||||
$values = implode(', ', $values);
|
$values = implode(', ', $values);
|
||||||
$this->query("INSERT INTO {$table} ({$fields}) VALUES {$values}");
|
$this->query("INSERT INTO {$table} ({$fields}) VALUES {$values}");
|
||||||
|
|
|
@ -704,7 +704,7 @@ class DboOracle extends DboSource {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$out .= "\t" . join(",\n\t", $colList) . ";\n\n";
|
$out .= "\t" . implode(",\n\t", $colList) . ";\n\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $out;
|
return $out;
|
||||||
|
@ -925,7 +925,7 @@ class DboOracle extends DboSource {
|
||||||
case 'schema':
|
case 'schema':
|
||||||
foreach (array('columns', 'indexes') as $var) {
|
foreach (array('columns', 'indexes') as $var) {
|
||||||
if (is_array(${$var})) {
|
if (is_array(${$var})) {
|
||||||
${$var} = "\t" . join(",\n\t", array_filter(${$var}));
|
${$var} = "\t" . implode(",\n\t", array_filter(${$var}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (trim($indexes) != '') {
|
if (trim($indexes) != '') {
|
||||||
|
@ -977,7 +977,7 @@ class DboOracle extends DboSource {
|
||||||
$fetch = array();
|
$fetch = array();
|
||||||
$ins = array_chunk($ins, 1000);
|
$ins = array_chunk($ins, 1000);
|
||||||
foreach ($ins as $i) {
|
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('= (', 'IN (', $q);
|
||||||
$res = $this->fetchAll($q, $model->cacheQueries, $model->alias);
|
$res = $this->fetchAll($q, $model->cacheQueries, $model->alias);
|
||||||
$fetch = array_merge($fetch, $res);
|
$fetch = array_merge($fetch, $res);
|
||||||
|
@ -1021,7 +1021,7 @@ class DboOracle extends DboSource {
|
||||||
$fetch = array();
|
$fetch = array();
|
||||||
$ins = array_chunk($ins, 1000);
|
$ins = array_chunk($ins, 1000);
|
||||||
foreach ($ins as $i) {
|
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('= (', 'IN (', $q);
|
||||||
$q = str_replace(' WHERE 1 = 1', '', $q);
|
$q = str_replace(' WHERE 1 = 1', '', $q);
|
||||||
|
|
||||||
|
|
|
@ -539,11 +539,11 @@ class DboPostgres extends DboSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($colList)) {
|
if (!empty($colList)) {
|
||||||
$out .= "\t" . join(",\n\t", $colList) . ";\n\n";
|
$out .= "\t" . implode(",\n\t", $colList) . ";\n\n";
|
||||||
} else {
|
} else {
|
||||||
$out = '';
|
$out = '';
|
||||||
}
|
}
|
||||||
$out .= join(";\n\t", $this->_alterIndexes($curTable, $indexes)) . ";";
|
$out .= implode(";\n\t", $this->_alterIndexes($curTable, $indexes)) . ";";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $out;
|
return $out;
|
||||||
|
@ -580,7 +580,7 @@ class DboPostgres extends DboSource {
|
||||||
$out .= 'INDEX ';
|
$out .= 'INDEX ';
|
||||||
}
|
}
|
||||||
if (is_array($value['column'])) {
|
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 {
|
} else {
|
||||||
$out .= $name . ' ON ' . $table . ' (' . $this->name($value['column']) . ')';
|
$out .= $name . ' ON ' . $table . ' (' . $this->name($value['column']) . ')';
|
||||||
}
|
}
|
||||||
|
@ -829,7 +829,7 @@ class DboPostgres extends DboSource {
|
||||||
$out .= 'UNIQUE ';
|
$out .= 'UNIQUE ';
|
||||||
}
|
}
|
||||||
if (is_array($value['column'])) {
|
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 {
|
} else {
|
||||||
$value['column'] = $this->name($value['column']);
|
$value['column'] = $this->name($value['column']);
|
||||||
}
|
}
|
||||||
|
@ -862,7 +862,7 @@ class DboPostgres extends DboSource {
|
||||||
|
|
||||||
foreach (array('columns', 'indexes') as $var) {
|
foreach (array('columns', 'indexes') as $var) {
|
||||||
if (is_array(${$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}";
|
return "CREATE TABLE {$table} (\n\t{$columns}\n);\n{$indexes}";
|
||||||
|
|
|
@ -529,7 +529,7 @@ class DboSqlite extends DboSource {
|
||||||
$out .= 'UNIQUE ';
|
$out .= 'UNIQUE ';
|
||||||
}
|
}
|
||||||
if (is_array($value['column'])) {
|
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 {
|
} else {
|
||||||
$value['column'] = $this->name($value['column']);
|
$value['column'] = $this->name($value['column']);
|
||||||
}
|
}
|
||||||
|
@ -589,7 +589,7 @@ class DboSqlite extends DboSource {
|
||||||
|
|
||||||
foreach (array('columns', 'indexes') as $var) {
|
foreach (array('columns', 'indexes') as $var) {
|
||||||
if (is_array(${$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}";
|
return "CREATE TABLE {$table} (\n{$columns});\n{$indexes}";
|
||||||
|
|
|
@ -580,8 +580,8 @@ class DboSource extends DataSource {
|
||||||
}
|
}
|
||||||
$query = array(
|
$query = array(
|
||||||
'table' => $this->fullTableName($model),
|
'table' => $this->fullTableName($model),
|
||||||
'fields' => join(', ', $fieldInsert),
|
'fields' => implode(', ', $fieldInsert),
|
||||||
'values' => join(', ', $valueInsert)
|
'values' => implode(', ', $valueInsert)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($this->execute($this->renderStatement('create', $query))) {
|
if ($this->execute($this->renderStatement('create', $query))) {
|
||||||
|
@ -796,7 +796,7 @@ class DboSource extends DataSource {
|
||||||
}
|
}
|
||||||
if (!empty($ins)) {
|
if (!empty($ins)) {
|
||||||
if (count($ins) > 1) {
|
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);
|
||||||
$query = str_replace('= (', 'IN (', $query);
|
$query = str_replace('= (', 'IN (', $query);
|
||||||
} else {
|
} else {
|
||||||
|
@ -895,7 +895,7 @@ class DboSource extends DataSource {
|
||||||
* @return array Association results
|
* @return array Association results
|
||||||
*/
|
*/
|
||||||
function fetchAssociated($model, $query, $ids) {
|
function fetchAssociated($model, $query, $ids) {
|
||||||
$query = str_replace('{$__cakeID__$}', join(', ', $ids), $query);
|
$query = str_replace('{$__cakeID__$}', implode(', ', $ids), $query);
|
||||||
if (count($ids) > 1) {
|
if (count($ids) > 1) {
|
||||||
$query = str_replace('= (', 'IN (', $query);
|
$query = str_replace('= (', 'IN (', $query);
|
||||||
$query = str_replace('= (', 'IN (', $query);
|
$query = str_replace('= (', 'IN (', $query);
|
||||||
|
@ -1272,12 +1272,12 @@ class DboSource extends DataSource {
|
||||||
}
|
}
|
||||||
return $this->renderStatement('select', array(
|
return $this->renderStatement('select', array(
|
||||||
'conditions' => $this->conditions($query['conditions'], true, true, $model),
|
'conditions' => $this->conditions($query['conditions'], true, true, $model),
|
||||||
'fields' => join(', ', $query['fields']),
|
'fields' => implode(', ', $query['fields']),
|
||||||
'table' => $query['table'],
|
'table' => $query['table'],
|
||||||
'alias' => $this->alias . $this->name($query['alias']),
|
'alias' => $this->alias . $this->name($query['alias']),
|
||||||
'order' => $this->order($query['order']),
|
'order' => $this->order($query['order']),
|
||||||
'limit' => $this->limit($query['limit'], $query['offset']),
|
'limit' => $this->limit($query['limit'], $query['offset']),
|
||||||
'joins' => join(' ', $query['joins']),
|
'joins' => implode(' ', $query['joins']),
|
||||||
'group' => $this->group($query['group'])
|
'group' => $this->group($query['group'])
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -1324,7 +1324,7 @@ class DboSource extends DataSource {
|
||||||
case 'schema':
|
case 'schema':
|
||||||
foreach (array('columns', 'indexes') as $var) {
|
foreach (array('columns', 'indexes') as $var) {
|
||||||
if (is_array(${$var})) {
|
if (is_array(${$var})) {
|
||||||
${$var} = "\t" . join(",\n\t", array_filter(${$var}));
|
${$var} = "\t" . implode(",\n\t", array_filter(${$var}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (trim($indexes) != '') {
|
if (trim($indexes) != '') {
|
||||||
|
@ -1378,7 +1378,7 @@ class DboSource extends DataSource {
|
||||||
} else {
|
} else {
|
||||||
$combined = array_combine($fields, $values);
|
$combined = array_combine($fields, $values);
|
||||||
}
|
}
|
||||||
$fields = join(', ', $this->_prepareUpdateFields($model, $combined, empty($conditions)));
|
$fields = implode(', ', $this->_prepareUpdateFields($model, $combined, empty($conditions)));
|
||||||
|
|
||||||
$alias = $joins = null;
|
$alias = $joins = null;
|
||||||
$table = $this->fullTableName($model);
|
$table = $this->fullTableName($model);
|
||||||
|
@ -1728,7 +1728,7 @@ class DboSource extends DataSource {
|
||||||
} else {
|
} else {
|
||||||
$field[0] = explode('.', $field[1]);
|
$field[0] = explode('.', $field[1]);
|
||||||
if (!Set::numeric($field[0])) {
|
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);
|
$fields[$i] = preg_replace('/\(' . $field[1] . '\)/', '(' . $field[0] . ')', $fields[$i], 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1760,7 +1760,7 @@ class DboSource extends DataSource {
|
||||||
if (empty($out)) {
|
if (empty($out)) {
|
||||||
return $clause . ' 1 = 1';
|
return $clause . ' 1 = 1';
|
||||||
}
|
}
|
||||||
return $clause . join(' AND ', $out);
|
return $clause . implode(' AND ', $out);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($conditions) || trim($conditions) == '' || $conditions === true) {
|
if (empty($conditions) || trim($conditions) == '' || $conditions === true) {
|
||||||
|
@ -1829,7 +1829,7 @@ class DboSource extends DataSource {
|
||||||
$out[] = $value[0] ;
|
$out[] = $value[0] ;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$out[] = '(' . $not . '(' . join(') ' . strtoupper($key) . ' (', $value) . '))';
|
$out[] = '(' . $not . '(' . implode(') ' . strtoupper($key) . ' (', $value) . '))';
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -1856,13 +1856,13 @@ class DboSource extends DataSource {
|
||||||
if (is_object($model)) {
|
if (is_object($model)) {
|
||||||
$columnType = $model->getColumnType($key);
|
$columnType = $model->getColumnType($key);
|
||||||
}
|
}
|
||||||
$data .= join(', ', $this->value($value, $columnType));
|
$data .= implode(', ', $this->value($value, $columnType));
|
||||||
}
|
}
|
||||||
$data .= ')';
|
$data .= ')';
|
||||||
} else {
|
} else {
|
||||||
$ret = $this->conditionKeysToString($value, $quoteValues, $model);
|
$ret = $this->conditionKeysToString($value, $quoteValues, $model);
|
||||||
if (count($ret) > 1) {
|
if (count($ret) > 1) {
|
||||||
$data = '(' . join(') AND (', $ret) . ')';
|
$data = '(' . implode(') AND (', $ret) . ')';
|
||||||
} elseif (isset($ret[0])) {
|
} elseif (isset($ret[0])) {
|
||||||
$data = $ret[0];
|
$data = $ret[0];
|
||||||
}
|
}
|
||||||
|
@ -1896,7 +1896,7 @@ class DboSource extends DataSource {
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __parseKey($model, $key, $value) {
|
function __parseKey($model, $key, $value) {
|
||||||
$operatorMatch = '/^((' . join(')|(', $this->__sqlOps);
|
$operatorMatch = '/^((' . implode(')|(', $this->__sqlOps);
|
||||||
$operatorMatch .= '\\x20)|<[>=]?(?![^>]+>)\\x20?|[>=!]{1,3}(?!<)\\x20?)/is';
|
$operatorMatch .= '\\x20)|<[>=]?(?![^>]+>)\\x20?|[>=!]{1,3}(?!<)\\x20?)/is';
|
||||||
$bound = (strpos($key, '?') !== false || (is_array($value) && strpos($key, ':') !== false));
|
$bound = (strpos($key, '?') !== false || (is_array($value) && strpos($key, ':') !== false));
|
||||||
|
|
||||||
|
@ -1942,7 +1942,7 @@ class DboSource extends DataSource {
|
||||||
$operator = trim($operator);
|
$operator = trim($operator);
|
||||||
|
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
$value = join(', ', $value);
|
$value = implode(', ', $value);
|
||||||
|
|
||||||
switch ($operator) {
|
switch ($operator) {
|
||||||
case '=':
|
case '=':
|
||||||
|
@ -2069,7 +2069,7 @@ class DboSource extends DataSource {
|
||||||
}
|
}
|
||||||
$order[] = $this->order($key . $value);
|
$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);
|
$keys = preg_replace('/ORDER\\x20BY/i', '', $keys);
|
||||||
|
|
||||||
|
@ -2100,7 +2100,7 @@ class DboSource extends DataSource {
|
||||||
function group($group) {
|
function group($group) {
|
||||||
if ($group) {
|
if ($group) {
|
||||||
if (is_array($group)) {
|
if (is_array($group)) {
|
||||||
$group = join(', ', $group);
|
$group = implode(', ', $group);
|
||||||
}
|
}
|
||||||
return ' GROUP BY ' . $this->__quoteFields($group);
|
return ' GROUP BY ' . $this->__quoteFields($group);
|
||||||
}
|
}
|
||||||
|
@ -2224,7 +2224,7 @@ class DboSource extends DataSource {
|
||||||
function insertMulti($table, $fields, $values) {
|
function insertMulti($table, $fields, $values) {
|
||||||
$table = $this->fullTableName($table);
|
$table = $this->fullTableName($table);
|
||||||
if (is_array($fields)) {
|
if (is_array($fields)) {
|
||||||
$fields = join(', ', array_map(array(&$this, 'name'), $fields));
|
$fields = implode(', ', array_map(array(&$this, 'name'), $fields));
|
||||||
}
|
}
|
||||||
$count = count($values);
|
$count = count($values);
|
||||||
for ($x = 0; $x < $count; $x++) {
|
for ($x = 0; $x < $count; $x++) {
|
||||||
|
@ -2396,7 +2396,7 @@ class DboSource extends DataSource {
|
||||||
$name = $this->startQuote . $name . $this->endQuote;
|
$name = $this->startQuote . $name . $this->endQuote;
|
||||||
}
|
}
|
||||||
if (is_array($value['column'])) {
|
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 {
|
} else {
|
||||||
$out .= 'KEY ' . $name . ' (' . $this->name($value['column']) . ')';
|
$out .= 'KEY ' . $name . ' (' . $this->name($value['column']) . ')';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1340,7 +1340,7 @@ class Model extends Overloadable {
|
||||||
if ($isUUID && $primaryAdded) {
|
if ($isUUID && $primaryAdded) {
|
||||||
$values[] = $db->value(String::uuid());
|
$values[] = $db->value(String::uuid());
|
||||||
}
|
}
|
||||||
$values = join(',', $values);
|
$values = implode(',', $values);
|
||||||
$newValues[] = "({$values})";
|
$newValues[] = "({$values})";
|
||||||
unset($values);
|
unset($values);
|
||||||
} elseif (isset($row[$this->hasAndBelongsToMany[$assoc]['associationForeignKey']])) {
|
} elseif (isset($row[$this->hasAndBelongsToMany[$assoc]['associationForeignKey']])) {
|
||||||
|
@ -1368,7 +1368,7 @@ class Model extends Overloadable {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($newValues)) {
|
if (!empty($newValues)) {
|
||||||
$fields = join(',', $fields);
|
$fields = implode(',', $fields);
|
||||||
$db->insertMulti($this->{$join}, $fields, $newValues);
|
$db->insertMulti($this->{$join}, $fields, $newValues);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -334,19 +334,19 @@ class CakeSchema extends Object {
|
||||||
}
|
}
|
||||||
$col = "\t\t'{$field}' => array('type' => '" . $value['type'] . "', ";
|
$col = "\t\t'{$field}' => array('type' => '" . $value['type'] . "', ";
|
||||||
unset($value['type']);
|
unset($value['type']);
|
||||||
$col .= join(', ', $this->__values($value));
|
$col .= implode(', ', $this->__values($value));
|
||||||
} else {
|
} else {
|
||||||
$col = "\t\t'indexes' => array(";
|
$col = "\t\t'indexes' => array(";
|
||||||
$props = array();
|
$props = array();
|
||||||
foreach ((array)$value as $key => $index) {
|
foreach ((array)$value as $key => $index) {
|
||||||
$props[] = "'{$key}' => array(" . join(', ', $this->__values($index)) . ")";
|
$props[] = "'{$key}' => array(" . implode(', ', $this->__values($index)) . ")";
|
||||||
}
|
}
|
||||||
$col .= join(', ', $props);
|
$col .= implode(', ', $props);
|
||||||
}
|
}
|
||||||
$col .= ")";
|
$col .= ")";
|
||||||
$cols[] = $col;
|
$cols[] = $col;
|
||||||
}
|
}
|
||||||
$out .= join(",\n", $cols);
|
$out .= implode(",\n", $cols);
|
||||||
}
|
}
|
||||||
$out .= "\n\t);\n";
|
$out .= "\n\t);\n";
|
||||||
}
|
}
|
||||||
|
@ -447,7 +447,7 @@ class CakeSchema extends Object {
|
||||||
if (is_array($values)) {
|
if (is_array($values)) {
|
||||||
foreach ($values as $key => $val) {
|
foreach ($values as $key => $val) {
|
||||||
if (is_array($val)) {
|
if (is_array($val)) {
|
||||||
$vals[] = "'{$key}' => array('" . join("', '", $val) . "')";
|
$vals[] = "'{$key}' => array('" . implode("', '", $val) . "')";
|
||||||
} else if (!is_numeric($key)) {
|
} else if (!is_numeric($key)) {
|
||||||
$val = var_export($val, true);
|
$val = var_export($val, true);
|
||||||
$vals[] = "'{$key}' => {$val}";
|
$vals[] = "'{$key}' => {$val}";
|
||||||
|
|
|
@ -378,7 +378,7 @@ class Router extends Object {
|
||||||
$parsed[] = '/' . $element;
|
$parsed[] = '/' . $element;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return array('#^' . join('', $parsed) . '[\/]*$#', $names);
|
return array('#^' . implode('', $parsed) . '[\/]*$#', $names);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Returns the list of prefixes used in connected routes
|
* Returns the list of prefixes used in connected routes
|
||||||
|
@ -880,11 +880,11 @@ class Router extends Object {
|
||||||
if ($_this->__admin && isset($url[$_this->__admin])) {
|
if ($_this->__admin && isset($url[$_this->__admin])) {
|
||||||
array_unshift($urlOut, $_this->__admin);
|
array_unshift($urlOut, $_this->__admin);
|
||||||
}
|
}
|
||||||
$output = join('/', $urlOut) . '/';
|
$output = implode('/', $urlOut) . '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($args)) {
|
if (!empty($args)) {
|
||||||
$args = join('/', $args);
|
$args = implode('/', $args);
|
||||||
if ($output{strlen($output) - 1} != '/') {
|
if ($output{strlen($output) - 1} != '/') {
|
||||||
$args = '/'. $args;
|
$args = '/'. $args;
|
||||||
}
|
}
|
||||||
|
@ -1066,7 +1066,7 @@ class Router extends Object {
|
||||||
for ($i = 0; $i < $count; $i++) {
|
for ($i = 0; $i < $count; $i++) {
|
||||||
$named[] = $keys[$i] . $this->named['separator'] . $params['named'][$keys[$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']);
|
$params['pass'] = str_replace('//', '/', $params['pass'] . '/' . $params['named']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -413,7 +413,7 @@ class Set extends Object {
|
||||||
if (count($context['trace']) == 1) {
|
if (count($context['trace']) == 1) {
|
||||||
$context['trace'][] = $context['key'];
|
$context['trace'][] = $context['key'];
|
||||||
}
|
}
|
||||||
$parent = join('/', $context['trace']) . '/.';
|
$parent = implode('/', $context['trace']) . '/.';
|
||||||
$context['item'] = Set::extract($parent, $data);
|
$context['item'] = Set::extract($parent, $data);
|
||||||
$context['key'] = array_pop($context['trace']);
|
$context['key'] = array_pop($context['trace']);
|
||||||
if (isset($context['trace'][1]) && $context['trace'][1] > 0) {
|
if (isset($context['trace'][1]) && $context['trace'][1] > 0) {
|
||||||
|
|
|
@ -313,7 +313,7 @@ class Helper extends Overloadable {
|
||||||
|
|
||||||
if ($setScope) {
|
if ($setScope) {
|
||||||
$view->modelScope = false;
|
$view->modelScope = false;
|
||||||
} elseif (join('.', $view->entity()) == $entity) {
|
} elseif (implode('.', $view->entity()) == $entity) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -530,7 +530,7 @@ class Helper extends Overloadable {
|
||||||
$name = $field;
|
$name = $field;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$name = 'data[' . join('][', $view->entity()) . ']';
|
$name = 'data[' . implode('][', $view->entity()) . ']';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -251,7 +251,7 @@ class AjaxHelper extends AppHelper {
|
||||||
$options['requestHeaders'] = array();
|
$options['requestHeaders'] = array();
|
||||||
}
|
}
|
||||||
if (is_array($options['update'])) {
|
if (is_array($options['update'])) {
|
||||||
$options['update'] = join(' ', $options['update']);
|
$options['update'] = implode(' ', $options['update']);
|
||||||
}
|
}
|
||||||
$options['requestHeaders']['X-Update'] = $options['update'];
|
$options['requestHeaders']['X-Update'] = $options['update'];
|
||||||
} else {
|
} else {
|
||||||
|
@ -799,7 +799,7 @@ class AjaxHelper extends AppHelper {
|
||||||
$keys[] = "'" . $key . "'";
|
$keys[] = "'" . $key . "'";
|
||||||
$keys[] = "'" . $val . "'";
|
$keys[] = "'" . $val . "'";
|
||||||
}
|
}
|
||||||
$jsOptions['requestHeaders'] = '[' . join(', ', $keys) . ']';
|
$jsOptions['requestHeaders'] = '[' . implode(', ', $keys) . ']';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -846,7 +846,7 @@ class AjaxHelper extends AppHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$out = join(', ', $out);
|
$out = implode(', ', $out);
|
||||||
$out = '{' . $out . '}';
|
$out = '{' . $out . '}';
|
||||||
return $out;
|
return $out;
|
||||||
} else {
|
} else {
|
||||||
|
@ -965,7 +965,7 @@ class AjaxHelper extends AppHelper {
|
||||||
$data[] = $key . ':"' . rawurlencode($val) . '"';
|
$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 .= 'for (n in __ajaxUpdater__) { if (typeof __ajaxUpdater__[n] == "string"';
|
||||||
$out .= ' && $(n)) Element.update($(n), unescape(decodeURIComponent(';
|
$out .= ' && $(n)) Element.update($(n), unescape(decodeURIComponent(';
|
||||||
$out .= '__ajaxUpdater__[n]))); }';
|
$out .= '__ajaxUpdater__[n]))); }';
|
||||||
|
|
|
@ -355,7 +355,7 @@ class FormHelper extends AppHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$field = join('.', $field);
|
$field = implode('.', $field);
|
||||||
if (!in_array($field, $this->fields)) {
|
if (!in_array($field, $this->fields)) {
|
||||||
if ($value !== null) {
|
if ($value !== null) {
|
||||||
return $this->fields[$field] = $value;
|
return $this->fields[$field] = $value;
|
||||||
|
@ -585,7 +585,7 @@ class FormHelper extends AppHelper {
|
||||||
function input($fieldName, $options = array()) {
|
function input($fieldName, $options = array()) {
|
||||||
$view =& ClassRegistry::getObject('view');
|
$view =& ClassRegistry::getObject('view');
|
||||||
$this->setEntity($fieldName);
|
$this->setEntity($fieldName);
|
||||||
$entity = join('.', $view->entity());
|
$entity = implode('.', $view->entity());
|
||||||
|
|
||||||
$defaults = array('before' => null, 'between' => null, 'after' => null);
|
$defaults = array('before' => null, 'between' => null, 'after' => null);
|
||||||
$options = array_merge($defaults, $options);
|
$options = array_merge($defaults, $options);
|
||||||
|
@ -952,7 +952,7 @@ class FormHelper extends AppHelper {
|
||||||
'id' => $attributes['id'] . '_', 'value' => '', 'name' => $attributes['name']
|
'id' => $attributes['id'] . '_', 'value' => '', 'name' => $attributes['name']
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
$out = $hidden . join($inbetween, $out);
|
$out = $hidden . implode($inbetween, $out);
|
||||||
|
|
||||||
if ($legend) {
|
if ($legend) {
|
||||||
$out = sprintf(
|
$out = sprintf(
|
||||||
|
|
|
@ -398,9 +398,9 @@ class HtmlHelper extends AppHelper {
|
||||||
$out[] = $key.':'.$value.';';
|
$out[] = $key.':'.$value.';';
|
||||||
}
|
}
|
||||||
if ($inline) {
|
if ($inline) {
|
||||||
return join(' ', $out);
|
return implode(' ', $out);
|
||||||
}
|
}
|
||||||
return join("\n", $out);
|
return implode("\n", $out);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Returns the breadcrumb trail as a sequence of »-separated links.
|
* Returns the breadcrumb trail as a sequence of »-separated links.
|
||||||
|
@ -423,7 +423,7 @@ class HtmlHelper extends AppHelper {
|
||||||
$out[] = $crumb[0];
|
$out[] = $crumb[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->output(join($separator, $out));
|
return $this->output(implode($separator, $out));
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -481,7 +481,7 @@ class HtmlHelper extends AppHelper {
|
||||||
foreach ($names as $arg) {
|
foreach ($names as $arg) {
|
||||||
$out[] = sprintf($this->tags['tableheader'], $this->_parseAttributes($thOptions), $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);
|
return $this->output($data);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -531,9 +531,9 @@ class HtmlHelper extends AppHelper {
|
||||||
$cellsOut[] = sprintf($this->tags['tablecell'], $this->_parseAttributes($cellOptions), $cell);
|
$cellsOut[] = sprintf($this->tags['tablecell'], $this->_parseAttributes($cellOptions), $cell);
|
||||||
}
|
}
|
||||||
$options = $this->_parseAttributes($count % 2 ? $oddTrOptions : $evenTrOptions);
|
$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));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Returns a formatted block tag, i.e DIV, SPAN, P.
|
* Returns a formatted block tag, i.e DIV, SPAN, P.
|
||||||
|
|
|
@ -649,9 +649,9 @@ class JavascriptHelper extends AppHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$numeric) {
|
if (!$numeric) {
|
||||||
$rt = '{' . join(',', $out) . '}';
|
$rt = '{' . implode(',', $out) . '}';
|
||||||
} else {
|
} else {
|
||||||
$rt = '[' . join(',', $out) . ']';
|
$rt = '[' . implode(',', $out) . ']';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$rt = $options['prefix'] . $rt . $options['postfix'];
|
$rt = $options['prefix'] . $rt . $options['postfix'];
|
||||||
|
|
|
@ -128,7 +128,7 @@ class JsHelper extends Overloadable2 {
|
||||||
$options['requestHeaders'] = array();
|
$options['requestHeaders'] = array();
|
||||||
}
|
}
|
||||||
if (is_array($options['update'])) {
|
if (is_array($options['update'])) {
|
||||||
$options['update'] = join(' ', $options['update']);
|
$options['update'] = implode(' ', $options['update']);
|
||||||
}
|
}
|
||||||
$options['requestHeaders']['X-Update'] = $options['update'];
|
$options['requestHeaders']['X-Update'] = $options['update'];
|
||||||
} else {
|
} else {
|
||||||
|
@ -257,9 +257,9 @@ class JsHelper extends Overloadable2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$numeric) {
|
if (!$numeric) {
|
||||||
$rt = '{' . join(', ', $out) . '}';
|
$rt = '{' . implode(', ', $out) . '}';
|
||||||
} else {
|
} else {
|
||||||
$rt = '[' . join(', ', $out) . ']';
|
$rt = '[' . implode(', ', $out) . ']';
|
||||||
}
|
}
|
||||||
$rt = $prefix . $rt . $postfix;
|
$rt = $prefix . $rt . $postfix;
|
||||||
|
|
||||||
|
@ -445,7 +445,7 @@ class JsHelperObject {
|
||||||
}
|
}
|
||||||
$options[] = $key . ':' . $val;
|
$options[] = $key . ':' . $val;
|
||||||
}
|
}
|
||||||
return join(', ', $options);
|
return implode(', ', $options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -209,7 +209,7 @@ class RssHelper extends XmlHelper {
|
||||||
}
|
}
|
||||||
$categories[] = $this->elem($key, $attrib, $category);
|
$categories[] = $this->elem($key, $attrib, $category);
|
||||||
}
|
}
|
||||||
$elements[$key] = join('', $categories);
|
$elements[$key] = implode('', $categories);
|
||||||
continue 2;
|
continue 2;
|
||||||
} else if (is_array($val) && isset($val['domain'])) {
|
} else if (is_array($val) && isset($val['domain'])) {
|
||||||
$attrib['domain'] = $val['domain'];
|
$attrib['domain'] = $val['domain'];
|
||||||
|
@ -259,7 +259,7 @@ class RssHelper extends XmlHelper {
|
||||||
$elements[$key] = $this->elem($key, $attrib, $val);
|
$elements[$key] = $this->elem($key, $attrib, $val);
|
||||||
}
|
}
|
||||||
if (!empty($elements)) {
|
if (!empty($elements)) {
|
||||||
$content = join('', $elements);
|
$content = implode('', $elements);
|
||||||
}
|
}
|
||||||
return $this->output($this->elem('item', $att, $content, !($content === null)));
|
return $this->output($this->elem('item', $att, $content, !($content === null)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -437,7 +437,7 @@ class View extends Object {
|
||||||
$data_for_layout = array_merge($this->viewVars, array(
|
$data_for_layout = array_merge($this->viewVars, array(
|
||||||
'title_for_layout' => $pageTitle,
|
'title_for_layout' => $pageTitle,
|
||||||
'content_for_layout' => $content_for_layout,
|
'content_for_layout' => $content_for_layout,
|
||||||
'scripts_for_layout' => join("\n\t", $this->__scripts),
|
'scripts_for_layout' => implode("\n\t", $this->__scripts),
|
||||||
'cakeDebug' => $debug
|
'cakeDebug' => $debug
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
|
@ -634,10 +634,10 @@ class CakeTestCase extends UnitTestCase {
|
||||||
$permutations = $this->__array_permute($attrs);
|
$permutations = $this->__array_permute($attrs);
|
||||||
$permutationTokens = array();
|
$permutationTokens = array();
|
||||||
foreach ($permutations as $permutation) {
|
foreach ($permutations as $permutation) {
|
||||||
$permutationTokens[] = join('', $permutation);
|
$permutationTokens[] = implode('', $permutation);
|
||||||
}
|
}
|
||||||
$regex[] = array(
|
$regex[] = array(
|
||||||
sprintf('%s', join(', ', $explanations)),
|
sprintf('%s', implode(', ', $explanations)),
|
||||||
$permutationTokens,
|
$permutationTokens,
|
||||||
$i,
|
$i,
|
||||||
);
|
);
|
||||||
|
|
|
@ -575,7 +575,7 @@ class HtmlTestManager extends TestManager {
|
||||||
foreach ($testCases as $testCaseFile => $testCase) {
|
foreach ($testCases as $testCaseFile => $testCase) {
|
||||||
$title = explode(strpos($testCase, '\\') ? '\\' : '/', str_replace('.test.php', '', $testCase));
|
$title = explode(strpos($testCase, '\\') ? '\\' : '/', str_replace('.test.php', '', $testCase));
|
||||||
$title[count($title) - 1] = Inflector::camelize($title[count($title) - 1]);
|
$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";
|
$buffer .= "<li><a href='" . $manager->getBaseURL() . "?case=" . urlencode($testCase) . $urlExtra ."'>" . $title . "</a></li>\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue