mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Merging fixes into 1.x.x.x branched code:
Revision: [2887] git-svn-id: https://svn.cakephp.org/repo/branches/1.x.x.x@2890 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
5e268e0805
commit
1dc168abc7
12 changed files with 73 additions and 34 deletions
|
@ -6,4 +6,4 @@
|
|||
// +---------------------------------------------------------------------------------------------------+ //
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
1.1.2.2802
|
||||
1.1.2.2887
|
|
@ -64,7 +64,7 @@ selectstart = "<select name="data[%s][%s]" %s>"
|
|||
selectmultiplestart = "<select name="data[%s][%s][]" %s>"
|
||||
|
||||
; Tag template for an empty select option tag.
|
||||
selectempty = "<option value="" %s></option>"
|
||||
selectempty = "<option value="" %s> </option>"
|
||||
|
||||
; Tag template for a select option tag.
|
||||
selectoption = "<option value="%s" %s>%s</option>"
|
||||
|
|
|
@ -220,9 +220,32 @@ class Dispatcher extends Object
|
|||
$controller->webroot = $this->webroot;
|
||||
$controller->params = $params;
|
||||
$controller->action = $params['action'];
|
||||
$controller->data = empty($params['data'])? null: $params['data'];
|
||||
$controller->passed_args = empty($params['pass'])? null: $params['pass'];
|
||||
$controller->autoLayout = empty($params['bare'])?$controller->autoLayout:!$params['bare'];
|
||||
if (!empty($controller->params['data']))
|
||||
{
|
||||
$controller->data =& $controller->params['data'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$controller->data = null;
|
||||
}
|
||||
if (!empty($controller->params['pass']))
|
||||
{
|
||||
$controller->passed_args =& $controller->params['pass'];
|
||||
$controller->passedArgs =& $controller->params['pass'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$controller->passed_args = null;
|
||||
$controller->passedArgs = null;
|
||||
}
|
||||
if (!empty($params['bare']))
|
||||
{
|
||||
$controller->autoLayout = !$params['bare'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$controller->autoLayout = $controller->autoLayout;
|
||||
}
|
||||
$controller->webservices = $params['webservices'];
|
||||
$controller->plugin = $this->plugin;
|
||||
|
||||
|
|
|
@ -145,7 +145,9 @@ class ErrorHandler extends Object
|
|||
$this->controller->base = $base;
|
||||
$this->controller->webroot = $webroot;
|
||||
$this->controller->viewPath = 'errors';
|
||||
$controllerName = str_replace('Controller', '', $className);
|
||||
$this->controller->set(array('controller' => $className,
|
||||
'controllerName' => $controllerName,
|
||||
'title' => 'Missing Controller'));
|
||||
$this->controller->render('missingController');
|
||||
exit();
|
||||
|
|
|
@ -155,7 +155,7 @@ class ConnectionManager extends Object
|
|||
}
|
||||
else
|
||||
{
|
||||
trigger_error('Unable to load DataSource file ' . $filename . '.php', E_USER_ERROR);
|
||||
trigger_error('Unable to load DataSource file ' . $conn['filename'] . '.php', E_USER_ERROR);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1020,7 +1020,7 @@ class Model extends Object
|
|||
}
|
||||
if(!empty($newValues))
|
||||
{
|
||||
$newValue[] = join(',', $newValues);
|
||||
$newValue[] = $newValues;
|
||||
unset($newValues);
|
||||
}
|
||||
}
|
||||
|
@ -1033,7 +1033,11 @@ class Model extends Object
|
|||
$db->execute("DELETE FROM {$joinTable[$count]} WHERE {$mainKey[$count]} = '{$id}'");
|
||||
if(!empty($newValue[$count]))
|
||||
{
|
||||
$db->execute("INSERT INTO {$joinTable[$count]} ({$fields[$count]}) VALUES {$newValue[$count]}");
|
||||
$secondCount = count($newValue[$count]);
|
||||
for ($x = 0; $x < $secondCount; $x++)
|
||||
{
|
||||
$db->execute("INSERT INTO {$joinTable[$count]} ({$fields[$count]}) VALUES {$newValue[$count][$x]}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1462,7 +1466,7 @@ class Model extends Object
|
|||
return true;
|
||||
}
|
||||
|
||||
if (empty($data) && isset($this->data))
|
||||
if (isset($this->data))
|
||||
{
|
||||
$data = $this->data;
|
||||
}
|
||||
|
|
|
@ -1016,7 +1016,7 @@ class Model extends Object
|
|||
}
|
||||
if(!empty($newValues))
|
||||
{
|
||||
$newValue[] = join(',', $newValues);
|
||||
$newValue[] = $newValues;
|
||||
unset($newValues);
|
||||
}
|
||||
}
|
||||
|
@ -1029,7 +1029,11 @@ class Model extends Object
|
|||
$db->execute("DELETE FROM {$joinTable[$count]} WHERE {$mainKey[$count]} = '{$id}'");
|
||||
if(!empty($newValue[$count]))
|
||||
{
|
||||
$db->execute("INSERT INTO {$joinTable[$count]} ({$fields[$count]}) VALUES {$newValue[$count]}");
|
||||
$secondCount = count($newValue[$count]);
|
||||
for ($x = 0; $x < $secondCount; $x++)
|
||||
{
|
||||
$db->execute("INSERT INTO {$joinTable[$count]} ({$fields[$count]}) VALUES {$newValue[$count][$x]}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1458,7 +1462,7 @@ class Model extends Object
|
|||
return true;
|
||||
}
|
||||
|
||||
if (empty($data) && isset($this->data))
|
||||
if (isset($this->data))
|
||||
{
|
||||
$data = $this->data;
|
||||
}
|
||||
|
|
|
@ -430,20 +430,6 @@ class CakeSession extends Object
|
|||
require_once($config);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!isset($_SESSION))
|
||||
{
|
||||
if(function_exists('ini_set'))
|
||||
{
|
||||
ini_set('session.use_trans_sid', 0);
|
||||
ini_set('session.name', CAKE_SESSION_COOKIE);
|
||||
ini_set('session.cookie_lifetime', $this->cookieLifeTime);
|
||||
ini_set('session.cookie_path', $this->path);
|
||||
ini_set('session.gc_probability', 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -645,11 +631,11 @@ class CakeSession extends Object
|
|||
|
||||
if($row[0][0]['count'] > 0)
|
||||
{
|
||||
$db->execute("UPDATE ".$db->name('cake_sessions')." SET ".$db->name('cake_sessions.data')." = ".$db->value($value).", ".$db->name('cake_sessions.expires')." = ".$db->value($expires)." WHERE ".$db->name('cake_sessions.id')." = ".$db->value($key));
|
||||
$db->execute("UPDATE ".$db->name('cake_sessions')." SET ".$db->name('data')." = ".$db->value($value).", ".$db->name('cake_sessions.expires')." = ".$db->value($expires)." WHERE ".$db->name('cake_sessions.id')." = ".$db->value($key));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->execute("INSERT INTO ".$db->name('cake_sessions')." (".$db->name('cake_sessions.data').",".$db->name('cake_sessions.expires').",".$db->name('cake_sessions.id').") VALUES (".$db->value($value).", ".$db->value($expires).", ".$db->value($key).")");
|
||||
$db->execute("INSERT INTO ".$db->name('cake_sessions')." (".$db->name('data').",".$db->name('cake_sessions.expires').",".$db->name('cake_sessions.id').") VALUES (".$db->value($value).", ".$db->value($expires).", ".$db->value($key).")");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1550,7 +1550,7 @@ function url($url = null, $return = false)
|
|||
$opt = $this->dayOptionTag( $tagName ,null ,$day, $selectAttr, $optionAttr, $showEmpty) . '-' . $this->monthOptionTag( $tagName, null, $month, $selectAttr, $optionAttr, $showEmpty) . '-' . $this->yearOptionTag( $tagName, null, null, null, $year, $selectAttr, $optionAttr, $showEmpty);
|
||||
break;
|
||||
case 'MDY' :
|
||||
$opt = $this->monthOptionTag($tagName, null, $month, $selectAttr, $optionAttr, $showEmpty) .'-'.$this->dayOptionTag( $tagName, null, $day, $selectAttr, $optionAttr, $showEmpty) . '-' . $this->yearOptionTag($tagName, null, null, null, $year, $optionAttr, $selectAttr, $showEmpty);
|
||||
$opt = $this->monthOptionTag($tagName, null, $month, $selectAttr, $optionAttr, $showEmpty) .'-'.$this->dayOptionTag( $tagName, null, $day, $selectAttr, $optionAttr, $showEmpty) . '-' . $this->yearOptionTag($tagName, null, null, null, $year, $selectAttr, $optionAttr, $showEmpty);
|
||||
break;
|
||||
case 'YMD' :
|
||||
$opt = $this->yearOptionTag($tagName, null, null, null, $year, $selectAttr, $optionAttr, $showEmpty) . '-' . $this->monthOptionTag( $tagName, null, $month, $selectAttr, $optionAttr, $showEmpty) . '-' . $this->dayOptionTag( $tagName, null, $day, $selectAttr, $optionAttr, $showEmpty);
|
||||
|
|
|
@ -273,7 +273,7 @@ class JavascriptHelper extends Helper
|
|||
}
|
||||
else
|
||||
{
|
||||
$rt = 'new Array('.join(', ', $out).')';
|
||||
$rt = '['.join(', ', $out).']';
|
||||
}
|
||||
$rt = $prefix.$rt.$postfix;
|
||||
|
||||
|
|
|
@ -44,11 +44,12 @@ view file, a user-customizable error page for handling invalid controller dispat
|
|||
<p>
|
||||
<strong>Fatal</strong>: Create Class:
|
||||
</p>
|
||||
<p>
|
||||
<br />
|
||||
<p><?php<br />
|
||||
class <?php echo $controller;?> extends AppController<br />
|
||||
{<br />
|
||||
}<br />
|
||||
class <?php echo $controller;?> extends AppController<br />
|
||||
{<br />
|
||||
var $name = '<?php echo $controllerName;?>';<br />
|
||||
}<br />
|
||||
?><br />
|
||||
</p>
|
||||
<p>
|
||||
|
|
|
@ -34,4 +34,23 @@
|
|||
|
||||
<p> <span class="notice"><strong>Notice:</strong> this error is being rendered by the
|
||||
<code>app/views/errors/missing_model.thtml</code> view file, a user-customizable error page.</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Fatal</strong>: Unable to load model <em><?php echo $model;?></em>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Fatal</strong>: Create Class:
|
||||
</p>
|
||||
<br />
|
||||
<p><?php<br />
|
||||
class <?php echo $model;?> extends AppModel<br />
|
||||
{<br />
|
||||
var $name = '<?php echo $model;?>';<br />
|
||||
}<br />
|
||||
?><br />
|
||||
</p>
|
||||
<p>
|
||||
in file : <?php echo "app".DS."models".DS.Inflector::underscore($model).".php"; ?>
|
||||
</p>
|
Loading…
Add table
Reference in a new issue