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:
phpnut 2006-05-16 20:46:06 +00:00
parent 5e268e0805
commit 1dc168abc7
12 changed files with 73 additions and 34 deletions

View file

@ -6,4 +6,4 @@
// +---------------------------------------------------------------------------------------------------+ //
///////////////////////////////////////////////////////////////////////////////////////////////////////////
1.1.2.2802
1.1.2.2887

View file

@ -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>&nbsp;</option>"
; Tag template for a select option tag.
selectoption = "<option value="%s" %s>%s</option>"

View file

@ -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;

View file

@ -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();

View file

@ -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;
}
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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);

View file

@ -273,7 +273,7 @@ class JavascriptHelper extends Helper
}
else
{
$rt = 'new Array('.join(', ', $out).')';
$rt = '['.join(', ', $out).']';
}
$rt = $prefix.$rt.$postfix;

View file

@ -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>&lt;?php<br />
&nbsp;&nbsp;&nbsp;&nbsp;class <?php echo $controller;?> extends AppController<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
class <?php echo $controller;?> extends AppController<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;var $name = '<?php echo $controllerName;?>';<br />
}<br />
?&gt;<br />
</p>
<p>

View file

@ -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>&lt;?php<br />
class <?php echo $model;?> extends AppModel<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;var $name = '<?php echo $model;?>';<br />
}<br />
?&gt;<br />
</p>
<p>
in file : <?php echo "app".DS."models".DS.Inflector::underscore($model).".php"; ?>
</p>