diff --git a/cake/VERSION.txt b/cake/VERSION.txt index 21634dae2..cf90295bd 100644 --- a/cake/VERSION.txt +++ b/cake/VERSION.txt @@ -17,4 +17,4 @@ // @license MIT License (http://www.opensource.org/licenses/mit-license.php) // +--------------------------------------------------------------------------------------------+ // //////////////////////////////////////////////////////////////////////////////////////////////////// -1.3.0.0 \ No newline at end of file +1.3.0-alpha \ No newline at end of file diff --git a/cake/config/config.php b/cake/config/config.php index 8671c403c..754b623ae 100644 --- a/cake/config/config.php +++ b/cake/config/config.php @@ -19,5 +19,5 @@ * @since CakePHP(tm) v 1.1.11.4062 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -return $config['Cake.version'] = '1.3.0'; +return $config['Cake.version'] = '1.3.0-alpha'; ?> diff --git a/cake/console/libs/templates/skel/views/layouts/xml/default.ctp b/cake/console/libs/templates/skel/views/layouts/xml/default.ctp new file mode 100644 index 000000000..566ca2158 --- /dev/null +++ b/cake/console/libs/templates/skel/views/layouts/xml/default.ctp @@ -0,0 +1,2 @@ +header(); ?> + \ No newline at end of file diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index 71e05a1cb..d118ef431 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -641,15 +641,15 @@ class CakeSession extends Object { function __regenerateId() { $oldSessionId = session_id(); if ($oldSessionId) { - $sessionpath = session_save_path(); - if (empty($sessionpath)) { - $sessionpath = "/tmp"; - } - if (session_id() != "" || isset($_COOKIE[session_name()])) { + if (session_id() != ''|| isset($_COOKIE[session_name()])) { setcookie(Configure::read('Session.cookie'), '', time() - 42000, $this->path); } session_regenerate_id(true); if (PHP_VERSION < 5.1) { + $sessionPath = session_save_path(); + if (empty($sessionPath)) { + $sessionPath = '/tmp'; + } $newSessid = session_id(); if (function_exists('session_write_close')) { @@ -659,7 +659,7 @@ class CakeSession extends Object { session_id($oldSessionId); session_start(); session_destroy(); - $file = $sessionpath . DS . "sess_$oldSessionId"; + $file = $sessionPath . DS . 'sess_' . $oldSessionId; @unlink($file); $this->__initSession(); session_id($newSessid); diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 40ac1fe3f..d22c9d627 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -450,10 +450,10 @@ class AuthComponent extends Object { return false; } $defaults = array( - 'loginAction' => Router::normalize(array( - 'controller'=> Inflector::underscore(Inflector::pluralize($this->userModel)), + 'loginAction' => array( + 'controller' => Inflector::underscore(Inflector::pluralize($this->userModel)), 'action' => 'login' - )), + ), 'sessionKey' => 'Auth.' . $this->userModel, 'logoutRedirect' => $this->loginAction, 'loginError' => __('Login failed. Invalid username or password.', true), diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php index 5dbe38e67..085053fe7 100644 --- a/cake/libs/controller/components/cookie.php +++ b/cake/libs/controller/components/cookie.php @@ -215,7 +215,7 @@ class CookieComponent extends Object { foreach ($key as $name => $value) { if (strpos($name, '.') === false) { $this->__values[$name] = $value; - $this->__write(".$name", $value); + $this->__write("[$name]", $value); } else { $names = explode('.', $name, 2); @@ -223,7 +223,7 @@ class CookieComponent extends Object { $this->__values[$names[0]] = array(); } $this->__values[$names[0]] = Set::insert($this->__values[$names[0]], $names[1], $value); - $this->__write("." . implode('.', $names), $value); + $this->__write('[' . implode('][', $names) . ']', $value); } } $this->__encrypted = true; @@ -289,12 +289,12 @@ class CookieComponent extends Object { } if (strpos($key, '.') === false) { unset($this->__values[$key]); - $this->__delete(".$key"); + $this->__delete("[$key]"); return; } $names = explode('.', $key, 2); $this->__values[$names[0]] = Set::remove($this->__values[$names[0]], $names[1]); - $this->__delete("." . implode('.', $names)); + $this->__delete('[' . implode('][', $names) . ']'); } /** @@ -315,11 +315,11 @@ class CookieComponent extends Object { if (is_array($value)) { foreach ($value as $key => $val) { unset($this->__values[$name][$key]); - $this->__delete(".$name.$key"); + $this->__delete("[$name][$key]"); } } unset($this->__values[$name]); - $this->__delete(".$name"); + $this->__delete("[$name]"); } } @@ -354,6 +354,11 @@ class CookieComponent extends Object { return $this->__expires; } $this->__reset = $this->__expires; + + if ($expires == 0) { + return $this->__expires = 0; + } + if (is_integer($expires) || is_numeric($expires)) { return $this->__expires = $now + intval($expires); } diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index ebad2baa1..bd7b8e69a 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -74,6 +74,9 @@ class Controller extends Object { * * Example: var $uses = array('Product', 'Post', 'Comment'); * + * Can be set to array() to use no models. Can be set to false to + * use no models and prevent the merging of $uses with AppController + * * @var mixed A single name as a string or a list of names as an array. * @access protected * @link http://book.cakephp.org/view/53/components-helpers-and-uses diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index 1e4c47ee0..83fb14294 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -229,16 +229,8 @@ class Debugger extends Object { */ function log($var, $level = LOG_DEBUG) { $_this = Debugger::getInstance(); - $trace = $_this->trace(array('start' => 1, 'depth' => 2, 'format' => 'array')); - $source = null; - - if (is_object($trace[0]['object']) && isset($trace[0]['object']->_reporter->_test_stack)) { - $stack = $trace[0]['object']->_reporter->_test_stack; - $source = sprintf('[%1$s, %3$s::%2$s()]' . "\n", - array_shift($stack), array_pop($stack), array_pop($stack)); - } - - CakeLog::write($level, $source . $_this->exportVar($var)); + $source = $_this->trace(array('start' => 1)) . "\n"; + CakeLog::write($level, "\n" . $source . $_this->exportVar($var)); } /** diff --git a/cake/libs/folder.php b/cake/libs/folder.php index f36123ec4..69af1434d 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -326,7 +326,7 @@ class Folder extends Object { * @static */ function addPathElement($path, $element) { - return Folder::slashTerm($path) . $element; + return rtrim($path, DS) . DS . $element; } /** diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index 8367ce6b3..a31b89131 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -693,7 +693,7 @@ class HttpSocket extends CakeSocket { foreach ($items as $item) { if (strpos($item, '=') !== false) { - list($key, $value) = explode('=', $item); + list($key, $value) = explode('=', $item, 2); } else { $key = $item; $value = null; diff --git a/cake/libs/model/behaviors/tree.php b/cake/libs/model/behaviors/tree.php index c1d51bb85..0466ff224 100644 --- a/cake/libs/model/behaviors/tree.php +++ b/cake/libs/model/behaviors/tree.php @@ -474,7 +474,7 @@ class TreeBehavior extends ModelBehavior { 'fields' => array($Model->primaryKey, $left, $right), 'recursive' => $recursive) ); if ($nextNode) { - list($nextNode)= array_values($nextNode); + list($nextNode) = array_values($nextNode); } else { return false; } @@ -657,6 +657,8 @@ class TreeBehavior extends ModelBehavior { $sort = $field . ' ' . $order; $nodes = $this->children($Model, $id, true, $fields, $sort, null, null, $recursive); + $cacheQueries = $Model->cacheQueries; + $Model->cacheQueries = false; if ($nodes) { foreach ($nodes as $node) { $id = $node[$Model->alias][$Model->primaryKey]; @@ -666,6 +668,7 @@ class TreeBehavior extends ModelBehavior { } } } + $Model->cacheQueries = $cacheQueries; return true; } diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php index e94fa50a5..4ada77bff 100644 --- a/cake/libs/model/datasources/datasource.php +++ b/cake/libs/model/datasources/datasource.php @@ -320,45 +320,53 @@ class DataSource extends Object { } /** + * Used to create new records. The "C" CRUD. + * * To-be-overridden in subclasses. * - * @param unknown_type $model - * @param unknown_type $fields - * @param unknown_type $values - * @return unknown + * @param Model $model The Model to be created. + * @param array $fields An Array of fields to be saved. + * @param array $values An Array of values to save. + * @return boolean success */ function create(&$model, $fields = null, $values = null) { return false; } /** + * Used to read records from the Datasource. The "R" in CRUD + * * To-be-overridden in subclasses. * - * @param unknown_type $model - * @param unknown_type $queryData - * @return unknown + * @param Model $model The model being read. + * @param array $queryData An array of query data used to find the data you want + * @return mixed */ function read(&$model, $queryData = array()) { return false; } /** + * Update a record(s) in the datasource. + * * To-be-overridden in subclasses. * - * @param unknown_type $model - * @param unknown_type $fields - * @param unknown_type $values - * @return unknown + * @param Model $model Instance of the model class being updated + * @param array $fields Array of fields to be updated + * @param array $values Array of values to be update $fields to. + * @return boolean Success */ function update(&$model, $fields = null, $values = null) { return false; } /** + * Delete a record(s) in the datasource. + * * To-be-overridden in subclasses. * - * @param unknown_type $model - * @param unknown_type $id + * @param Model $model The model class having record(s) deleted + * @param mixed $id Primary key of the model */ function delete(&$model, $id = null) { if ($id == null) { @@ -396,6 +404,16 @@ class DataSource extends Object { return false; } +/** + * Check whether the conditions for the Datasource being available + * are satisfied. Often used from connect() to check for support + * before establishing a connection. + * + * @return boolean Whether or not the Datasources conditions for use are met. + **/ + function enabled() { + return true; + } /** * Returns true if the DataSource supports the given interface (method) * diff --git a/cake/libs/model/datasources/dbo/dbo_adodb.php b/cake/libs/model/datasources/dbo/dbo_adodb.php index a43581f8a..8e2931d8e 100644 --- a/cake/libs/model/datasources/dbo/dbo_adodb.php +++ b/cake/libs/model/datasources/dbo/dbo_adodb.php @@ -110,7 +110,9 @@ class DboAdodb extends DboSource { $adodb_driver = substr($config['connect'], 0, $persistent); $connect = 'PConnect'; } - + if (!$this->enabled()) { + return false; + } $this->_adodb = NewADOConnection($adodb_driver); $this->_adodbDataDict = NewDataDictionary($this->_adodb, $adodb_driver); @@ -123,6 +125,14 @@ class DboAdodb extends DboSource { return $this->connected; } +/** + * Check that AdoDB is available. + * + * @return boolean + **/ + function enabled() { + return function_exists('NewADOConnection'); + } /** * Disconnects from database. * diff --git a/cake/libs/model/datasources/dbo/dbo_db2.php b/cake/libs/model/datasources/dbo/dbo_db2.php index 873fa8ec0..55b25010e 100644 --- a/cake/libs/model/datasources/dbo/dbo_db2.php +++ b/cake/libs/model/datasources/dbo/dbo_db2.php @@ -146,6 +146,14 @@ class DboDb2 extends DboSource { return $this->connected; } +/** + * Check that the DB2 extension is installed/loaded + * + * @return boolean + **/ + function enabled() { + return extension_loaded('ibm_db2'); + } /** * Disconnects from database. * diff --git a/cake/libs/model/datasources/dbo/dbo_firebird.php b/cake/libs/model/datasources/dbo/dbo_firebird.php index faab0920d..4243097c8 100644 --- a/cake/libs/model/datasources/dbo/dbo_firebird.php +++ b/cake/libs/model/datasources/dbo/dbo_firebird.php @@ -140,10 +140,19 @@ class DboFirebird extends DboSource { $connect = $config['connect']; $this->connected = false; + $this->connection = $connect($config['host'] . ':' . $config['database'], $config['login'], $config['password']); $this->connected = true; } +/** + * Check that the interbase extension is loaded + * + * @return boolean + **/ + function enabled() { + return extension_loaded('interbase'); + } /** * Disconnects from database. * diff --git a/cake/libs/model/datasources/dbo/dbo_mssql.php b/cake/libs/model/datasources/dbo/dbo_mssql.php index de8db0a60..11c819d52 100644 --- a/cake/libs/model/datasources/dbo/dbo_mssql.php +++ b/cake/libs/model/datasources/dbo/dbo_mssql.php @@ -164,6 +164,14 @@ class DboMssql extends DboSource { return $this->connected; } +/** + * Check that MsSQL is installed/loaded + * + * @return boolean + **/ + function enabled() { + return extension_loaded('mssql'); + } /** * Disconnects from database. * diff --git a/cake/libs/model/datasources/dbo/dbo_mysql.php b/cake/libs/model/datasources/dbo/dbo_mysql.php index 316edcc2c..86de93b10 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysql.php +++ b/cake/libs/model/datasources/dbo/dbo_mysql.php @@ -118,6 +118,40 @@ class DboMysqlBase extends DboSource { 'boolean' => array('name' => 'tinyint', 'limit' => '1') ); +/** + * Returns an array of the fields in given table name. + * + * @param string $tableName Name of database table to inspect + * @return array Fields in table. Keys are name and type + */ + function describe(&$model) { + $cache = parent::describe($model); + if ($cache != null) { + return $cache; + } + $fields = false; + $cols = $this->query('DESCRIBE ' . $this->fullTableName($model)); + + foreach ($cols as $column) { + $colKey = array_keys($column); + if (isset($column[$colKey[0]]) && !isset($column[0])) { + $column[0] = $column[$colKey[0]]; + } + if (isset($column[0])) { + $fields[$column[0]['Field']] = array( + 'type' => $this->column($column[0]['Type']), + 'null' => ($column[0]['Null'] == 'YES' ? true : false), + 'default' => $column[0]['Default'], + 'length' => $this->length($column[0]['Type']), + ); + if (!empty($column[0]['Key']) && isset($this->index[$column[0]['Key']])) { + $fields[$column[0]['Field']]['key'] = $this->index[$column[0]['Key']]; + } + } + } + $this->__cacheDescription($this->fullTableName($model, false), $fields); + return $fields; + } /** * Generates and executes an SQL UPDATE statement for given model, fields, and values. * @@ -498,6 +532,14 @@ class DboMysql extends DboMysqlBase { return $this->connected; } +/** + * Check whether the MySQL extension is installed/loaded + * + * @return boolean + **/ + function enabled() { + return extension_loaded('mysql'); + } /** * Disconnects from database. * @@ -547,52 +589,6 @@ class DboMysql extends DboMysqlBase { } } -/** - * Returns an array of the fields in given table name. - * - * @param string $tableName Name of database table to inspect - * @return array Fields in table. Keys are name and type - */ - function describe(&$model) { - $cache = parent::describe($model); - if ($cache != null) { - return $cache; - } - $fields = false; - $cols = $this->query('SHOW FULL COLUMNS FROM ' . $this->fullTableName($model)); - - foreach ($cols as $column) { - $colKey = array_keys($column); - if (isset($column[$colKey[0]]) && !isset($column[0])) { - $column[0] = $column[$colKey[0]]; - } - if (isset($column[0])) { - $fields[$column[0]['Field']] = array( - 'type' => $this->column($column[0]['Type']), - 'null' => ($column[0]['Null'] == 'YES' ? true : false), - 'default' => $column[0]['Default'], - 'length' => $this->length($column[0]['Type']), - ); - if (!empty($column[0]['Key']) && isset($this->index[$column[0]['Key']])) { - $fields[$column[0]['Field']]['key'] = $this->index[$column[0]['Key']]; - } - foreach ($this->fieldParameters as $name => $value) { - if (!empty($column[0][$value['column']])) { - $fields[$column[0]['Field']][$name] = $column[0][$value['column']]; - } - } - if (isset($fields[$column[0]['Field']]['collate'])) { - $charset = $this->getCharsetName($fields[$column[0]['Field']]['collate']); - if ($charset) { - $fields[$column[0]['Field']]['charset'] = $charset; - } - } - } - } - $this->__cacheDescription($this->fullTableName($model, false), $fields); - return $fields; - } - /** * Returns a quoted and escaped string of $data for use in an SQL statement. * diff --git a/cake/libs/model/datasources/dbo/dbo_mysqli.php b/cake/libs/model/datasources/dbo/dbo_mysqli.php index ec5f05fb3..6777dbca1 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysqli.php +++ b/cake/libs/model/datasources/dbo/dbo_mysqli.php @@ -89,6 +89,14 @@ class DboMysqli extends DboMysqlBase { return $this->connected; } +/** + * Check that MySQLi is installed/enabled + * + * @return boolean + **/ + function enabled() { + return extension_loaded('mysqli'); + } /** * Disconnects from database. * @@ -159,44 +167,6 @@ class DboMysqli extends DboMysqlBase { return $tables; } -/** - * Returns an array of the fields in given table name. - * - * @param string $tableName Name of database table to inspect - * @return array Fields in table. Keys are name and type - */ - function describe(&$model) { - - $cache = parent::describe($model); - if ($cache != null) { - return $cache; - } - - $fields = false; - $cols = $this->query('DESCRIBE ' . $this->fullTableName($model)); - - foreach ($cols as $column) { - $colKey = array_keys($column); - if (isset($column[$colKey[0]]) && !isset($column[0])) { - $column[0] = $column[$colKey[0]]; - } - if (isset($column[0])) { - $fields[$column[0]['Field']] = array( - 'type' => $this->column($column[0]['Type']), - 'null' => ($column[0]['Null'] == 'YES' ? true : false), - 'default' => $column[0]['Default'], - 'length' => $this->length($column[0]['Type']) - ); - if (!empty($column[0]['Key']) && isset($this->index[$column[0]['Key']])) { - $fields[$column[0]['Field']]['key'] = $this->index[$column[0]['Key']]; - } - } - } - - $this->__cacheDescription($this->fullTableName($model, false), $fields); - return $fields; - } - /** * Returns a quoted and escaped string of $data for use in an SQL statement. * @@ -344,26 +314,6 @@ class DboMysqli extends DboMysqlBase { return 'text'; } -/** - * Gets the length of a database-native column description, or null if no length - * - * @param string $real Real database-layer column type (i.e. "varchar(255)") - * @return integer An integer representing the length of the column - */ - function length($real) { - $col = str_replace(array(')', 'unsigned'), '', $real); - $limit = null; - - if (strpos($col, '(') !== false) { - list($col, $limit) = explode('(', $col); - } - - if ($limit != null) { - return intval($limit); - } - return null; - } - /** * Enter description here... * diff --git a/cake/libs/model/datasources/dbo/dbo_odbc.php b/cake/libs/model/datasources/dbo/dbo_odbc.php index e24daf7ce..9f73dd140 100644 --- a/cake/libs/model/datasources/dbo/dbo_odbc.php +++ b/cake/libs/model/datasources/dbo/dbo_odbc.php @@ -112,6 +112,14 @@ class DboOdbc extends DboSource { return $this->connected; } +/** + * Check if the ODBC extension is installed/loaded + * + * @return boolean + **/ + function enabled() { + return extension_loaded('odbc'); + } /** * Disconnects from database. * diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index d8787a018..0e6ac7be9 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -129,6 +129,14 @@ class DboPostgres extends DboSource { return $this->connected; } +/** + * Check if PostgreSQL is enabled/loaded + * + * @return boolean + **/ + function enabled() { + return extension_loaded('pgsql'); + } /** * Disconnects from database. * @@ -289,6 +297,7 @@ class DboPostgres extends DboSource { case 'date': case 'datetime': case 'timestamp': + case 'time': if ($data === '') { return $read ? 'NULL' : 'DEFAULT'; } diff --git a/cake/libs/model/datasources/dbo/dbo_sqlite.php b/cake/libs/model/datasources/dbo/dbo_sqlite.php index 215542628..552096bec 100644 --- a/cake/libs/model/datasources/dbo/dbo_sqlite.php +++ b/cake/libs/model/datasources/dbo/dbo_sqlite.php @@ -143,6 +143,14 @@ class DboSqlite extends DboSource { return $this->connected; } +/** + * Check that SQLite is enabled/installed + * + * @return boolean + **/ + function enabled() { + return extension_loaded('sqlite'); + } /** * Disconnects from database. * diff --git a/cake/libs/model/datasources/dbo/dbo_sybase.php b/cake/libs/model/datasources/dbo/dbo_sybase.php index db345ea08..7a56220aa 100644 --- a/cake/libs/model/datasources/dbo/dbo_sybase.php +++ b/cake/libs/model/datasources/dbo/dbo_sybase.php @@ -111,6 +111,14 @@ class DboSybase extends DboSource { return $this->connected; } +/** + * Check that one of the sybase extensions is installed + * + * @return boolean + **/ + function enabled() { + return extension_loaded('sybase') || extension_loaded('sybase_ct'); + } /** * Disconnects from database. * diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index acb433063..46afa587d 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -116,7 +116,9 @@ class DboSource extends DataSource { } parent::__construct($config); $this->fullDebug = Configure::read() > 1; - + if (!$this->enabled()) { + return false; + } if ($autoConnect) { return $this->connect(); } else { diff --git a/cake/libs/string.php b/cake/libs/string.php index d7bbf2036..15bd9cb6f 100644 --- a/cake/libs/string.php +++ b/cake/libs/string.php @@ -229,6 +229,9 @@ class String { $options += $defaults; $format = $options['format']; $data = (array)$data; + if (empty($data)) { + return ($options['clean']) ? String::cleanInsert($str, $options) : $str; + } if (!isset($format)) { $format = sprintf( diff --git a/cake/libs/view/helpers/cache.php b/cake/libs/view/helpers/cache.php index 1da01dd44..af1af442d 100644 --- a/cake/libs/view/helpers/cache.php +++ b/cake/libs/view/helpers/cache.php @@ -81,15 +81,15 @@ class CacheHelper extends AppHelper { $cacheTime = 0; $useCallbacks = false; if (is_array($this->cacheAction)) { - $contoller = Inflector::underscore($this->controllerName); + $controller = Inflector::underscore($this->controllerName); $check = str_replace('/', '_', $this->here); $replace = str_replace('/', '_', $this->base); $match = str_replace($this->base, '', $this->here); $match = str_replace('//', '/', $match); - $match = str_replace('/' . $contoller . '/', '', $match); + $match = str_replace('/' . $controller . '/', '', $match); $match = str_replace('/' . $this->controllerName . '/', '', $match); $check = str_replace($replace, '', $check); - $check = str_replace('_' . $contoller . '_', '', $check); + $check = str_replace('_' . $controller . '_', '', $check); $check = str_replace('_' . $this->controllerName . '_', '', $check); $check = Inflector::slug($check); $check = preg_replace('/^_+/', '', $check); @@ -179,7 +179,6 @@ class CacheHelper extends AppHelper { $outputResult = array_values($outputResult); } - if (!empty($fileResult)) { $i = 0; foreach ($fileResult as $cacheBlock) { @@ -202,24 +201,23 @@ class CacheHelper extends AppHelper { function __parseOutput($cache) { $count = 0; if (!empty($this->__match)) { - foreach ($this->__match as $found) { $original = $cache; $length = strlen($found); $position = 0; - for ($i = 1; $i <= 1; $i++) { - $position = strpos($cache, $found, $position); + for ($i = 1; $i <= 1; $i++) { + $position = strpos($cache, $found, $position); - if ($position !== false) { - $cache = substr($original, 0, $position); - $cache .= $this->__replace[$count]; - $cache .= substr($original, $position + $length); - } else { - break; - } + if ($position !== false) { + $cache = substr($original, 0, $position); + $cache .= $this->__replace[$count]; + $cache .= substr($original, $position + $length); + } else { + break; } - $count++; + } + $count++; } return $cache; } @@ -301,5 +299,4 @@ class CacheHelper extends AppHelper { return cache('views' . DS . $cache, $file, $timestamp); } } - ?> \ No newline at end of file diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index c44ae9edd..eac7e5f1c 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -772,9 +772,13 @@ class FormHelper extends AppHelper { if ($label !== false) { $labelAttributes = $this->domId(array(), 'for'); - if (in_array($options['type'], array('date', 'datetime'))) { - $labelAttributes['for'] .= 'Month'; - } else if ($options['type'] === 'time') { + if ($options['type'] === 'date' || $options['type'] === 'datetime') { + if (isset($options['dateFormat']) && $options['dateFormat'] === 'NONE') { + $labelAttributes['for'] .= 'Hour'; + } else { + $labelAttributes['for'] .= 'Month'; + } + } elseif ($options['type'] === 'time') { $labelAttributes['for'] .= 'Hour'; } @@ -1818,7 +1822,7 @@ class FormHelper extends AppHelper { } if ($name !== null) { - if ((!$selectedIsEmpty && $selected == $name) || ($selectedIsArray && in_array($name, $selected))) { + if ((!$selectedIsEmpty && (string)$selected == (string)$name) || ($selectedIsArray && in_array($name, $selected))) { if ($attributes['style'] === 'checkbox') { $htmlOptions['checked'] = true; } else { diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 1cc614532..3a71d0a66 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -250,11 +250,13 @@ class PaginatorHelper extends AppHelper { } /** - * Generates a sorting link + * Generates a sorting link. Sets named parameters for the sort and direction. Handles + * direction switching automatically. * - * @param string $title Title for the link. - * @param string $key The name of the key that the recordset should be sorted. - * @param array $options Options for sorting link. See #options for list of keys. + * @param string $title Title for the link. + * @param string $key The name of the key that the recordset should be sorted. If $key is null + * $title will be used for the key, and a title will be generated by inflection. + * @param array $options Options for sorting link. See #options for list of keys. * @return string A link sorting default by 'asc'. If the resultset is sorted 'asc' by the specified * key the returned link will sort by 'desc'. */ diff --git a/cake/libs/view/pages/home.ctp b/cake/libs/view/pages/home.ctp index 3c61b5624..dcf7d6f0e 100644 --- a/cake/libs/view/pages/home.ctp +++ b/cake/libs/view/pages/home.ctp @@ -28,7 +28,7 @@ endif; ?>
Html->link(__('Read the changelog', true), 'http://code.cakephp.org/wiki/changelog/1_2_x_x'); +echo $this->Html->link(__('Read the changelog', true), 'http://code.cakephp.org/wiki/changelog/1_3_0-alpha'); if (Configure::read() > 0): Debugger::checkSessionKey(); @@ -138,6 +138,7 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');This email was sent using the CakePHP Framework