Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.0' into 3.0-dsn-support
Browse files Browse the repository at this point in the history
* origin/3.0: (172 commits)
  Consolidate doc block headings.
  Adding a test for #5019 the plugin view file path
  Fixing the view file loading for plugins in View/View.php
  Make method name better represent what it is going to do.
  Don't mutate cwd.
  More doc block corrections.
  Cosolidate doc block headers
  Add FlashComponent property to PHPDoc for Controller class
  Fix doubly inflected variable names in controller task.
  Use chdir() instead of calling multiple commands.
  Add missing 'b' to radio docs
  Fix FormHelper::radio() options docs
  Add test case for quoted strings
  Fix issue in PoFileParser where only slashes from translations of type array are stripped.
  Remove for attributes for other group type inputs.
  Remove meaningless and possibly wrong for attr.
  Fix missing label elements in input(type=radio)
  Fix radio widget and label=false.
  Fix input() making multiple checkboxes.
  Not using union, but OR conditions
  ...
  • Loading branch information
AD7six committed Oct 31, 2014
2 parents 0a8831b + 1b7e36e commit 109123b
Show file tree
Hide file tree
Showing 240 changed files with 2,205 additions and 842 deletions.
6 changes: 1 addition & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@
*.php text
*.default text
*.ctp text
*.sql text
*.md text
*.po text
*.js text
*.css text
*.ini text
*.properties text
*.txt text
*.xml text
*.yml text
.htaccess text

# Declare files that will always have CRLF line endings on checkout.
*.bat eol=crlf
Expand All @@ -31,4 +27,4 @@
*.jpg binary
*.gif binary
*.ico binary
*.mo binary
*.mo binary
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ Cake Software Foundation, Inc.
1785 E. Sahara Avenue,
Suite 490-204
Las Vegas, Nevada 89104,
United States of America.
United States of America.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
[![Bake Status](https://secure.travis-ci.org/cakephp/cakephp.png?branch=3.0)](http://travis-ci.org/cakephp/cakephp)
[![Latest Stable Version](https://poser.pugx.org/cakephp/cakephp/v/stable.svg)](https://packagist.org/packages/cakephp/cakephp)
[![License](https://poser.pugx.org/cakephp/cakephp/license.svg)](https://packagist.org/packages/cakephp/cakephp)
[![Bake Status](https://secure.travis-ci.org/cakephp/cakephp.png?branch=master)](http://travis-ci.org/cakephp/cakephp)
[![Code consistency](http://squizlabs.github.io/PHP_CodeSniffer/analysis/cakephp/cakephp/grade.svg)](http://squizlabs.github.io/PHP_CodeSniffer/analysis/cakephp/cakephp/)

[![CakePHP](http://cakephp.org/img/cake-logo.png)](http://www.cakephp.org)

Expand Down
4 changes: 2 additions & 2 deletions src/Auth/DigestAuthenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function getUser(Request $request) {
$password = $user[$field];
unset($user[$field]);

$hash = $this->generateResponseHash($digest, $password, $request->env('REQUEST_METHOD'));
$hash = $this->generateResponseHash($digest, $password, $request->env('ORIGINAL_REQUEST_METHOD'));
if ($digest['response'] === $hash) {
return $user;
}
Expand Down Expand Up @@ -151,7 +151,7 @@ public function parseAuthData($digest) {
}
$keys = $match = array();
$req = array('nonce' => 1, 'nc' => 1, 'cnonce' => 1, 'qop' => 1, 'username' => 1, 'uri' => 1, 'response' => 1);
preg_match_all('/(\w+)=([\'"]?)([a-zA-Z0-9\:\#\%@=.\/_-]+)\2/', $digest, $match, PREG_SET_ORDER);
preg_match_all('/(\w+)=([\'"]?)([a-zA-Z0-9\:\#\%\?\&@=\.\/_-]+)\2/', $digest, $match, PREG_SET_ORDER);

foreach ($match as $i) {
$keys[$i[1]] = $i[3];
Expand Down
9 changes: 4 additions & 5 deletions src/Auth/PasswordHasherFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ class PasswordHasherFactory {
/**
* Returns password hasher object out of a hasher name or a configuration array
*
* @param string|array $passwordHasher name of the password hasher or an array with
* @param string|array $passwordHasher Name of the password hasher or an array with
* at least the key `className` set to the name of the class to use
* @return AbstractPasswordHasher Password hasher instance
* @return \Cake\Auth\AbstractPasswordHasher Password hasher instance
* @throws \RuntimeException If password hasher class not found or
* it does not extend AbstractPasswordHasher
* it does not extend Cake\Auth\AbstractPasswordHasher
*/
public static function build($passwordHasher) {
$config = [];
Expand All @@ -41,9 +41,8 @@ public static function build($passwordHasher) {
unset($config['className']);
}

list($plugin, $class) = pluginSplit($class, true);
$className = App::className($class, 'Auth', 'PasswordHasher');
if (!class_exists($className)) {
if (!$className) {
throw new \RuntimeException(sprintf('Password hasher class "%s" was not found.', $class));
}

Expand Down
2 changes: 1 addition & 1 deletion src/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public static function read($key, $config = 'default') {
* @param array $keys an array of keys to fetch from the cache
* @param string $config optional name of the configuration to use. Defaults to 'default'
* @return array An array containing, for each of the given $keys, the cached data or false if cached data could not be
* retreived
* retrieved.
*/
public static function readMany($keys, $config = 'default') {
$engine = static::engine($config);
Expand Down
9 changes: 4 additions & 5 deletions src/Cache/Engine/FileEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,12 +401,11 @@ protected function _setKey($key, $createKey = false) {
*/
protected function _active() {
$dir = new \SplFileInfo($this->_config['path']);
if (Configure::read('debug')) {
$path = $dir->getPathname();
if (!is_dir($path)) {
mkdir($path, 0775, true);
}
$path = $dir->getPathname();
if (!is_dir($path)) {
mkdir($path, 0775, true);
}

if ($this->_init && !($dir->isDir() && $dir->isWritable())) {
$this->_init = false;
trigger_error(sprintf(
Expand Down
4 changes: 2 additions & 2 deletions src/Cache/Engine/MemcachedEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MemcachedEngine extends CacheEngine {
/**
* memcached wrapper.
*
* @var Memcache
* @var \Memcached
*/
protected $_Memcached = null;

Expand Down Expand Up @@ -298,7 +298,7 @@ public function read($key) {
*
* @param array $keys An array of identifiers for the data
* @return An array containing, for each of the given $keys, the cached data or
* false if cached data could not be retreived.
* false if cached data could not be retrieved.
*/
public function readMany($keys) {
$cacheKeys = array();
Expand Down
4 changes: 2 additions & 2 deletions src/Cache/Engine/RedisEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class RedisEngine extends CacheEngine {
/**
* Redis wrapper.
*
* @var Redis
* @var \Redis
*/
protected $_Redis = null;

Expand Down Expand Up @@ -57,7 +57,7 @@ class RedisEngine extends CacheEngine {
'password' => false,
'persistent' => true,
'port' => 6379,
'prefix' => null,
'prefix' => 'cake_',
'probability' => 100,
'server' => '127.0.0.1',
'timeout' => 0,
Expand Down
30 changes: 15 additions & 15 deletions src/Collection/CollectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface CollectionInterface extends Iterator, JsonSerializable {
* and passes both the value and key for them on each step.
* Returns the same collection for chaining.
*
* ###Example:
* ### Example:
*
* {{{
* $collection = (new Collection($items))->each(function ($value, $key) {
Expand All @@ -53,7 +53,7 @@ public function each(callable $c);
* in the current iteration, the key of the element and this collection as
* arguments, in that order.
*
* ##Example:
* ### Example:
*
* Filtering odd numbers in an array, at the end only the value 2 will
* be present in the resulting collection:
Expand All @@ -79,7 +79,7 @@ public function filter(callable $c = null);
* in the current iteration, the key of the element and this collection as
* arguments, in that order.
*
* ##Example:
* ### Example:
*
* Filtering even numbers in an array, at the end only values 1 and 3 will
* be present in the resulting collection:
Expand All @@ -104,7 +104,7 @@ public function reject(callable $c);
* in the current iteration and the key of the element as arguments, in that
* order.
*
* ###Example:
* ### Example:
*
* {{{
* $overTwentyOne = (new Collection([24, 45, 60, 15]))->every(function ($value, $key) {
Expand All @@ -126,7 +126,7 @@ public function every(callable $c);
* in the current iteration and the key of the element as arguments, in that
* order.
*
* ###Example:
* ### Example:
*
* {{{
* $hasYoungPeople = (new Collection([24, 45, 15]))->every(function ($value, $key) {
Expand Down Expand Up @@ -157,7 +157,7 @@ public function contains($value);
* in the current iteration, the key of the element and this collection as
* arguments, in that order.
*
* ##Example:
* ### Example:
*
* Getting a collection of booleans where true indicates if a person is female:
*
Expand Down Expand Up @@ -220,7 +220,7 @@ public function extract($matcher);
* Returns the top element in this collection after being sorted by a property.
* Check the sortBy method for information on the callback and $type parameters
*
* ###Examples:
* ### Examples:
*
* {{{
* // For a collection of employees
Expand All @@ -246,7 +246,7 @@ public function max($callback, $type = SORT_NUMERIC);
* Returns the bottom element in this collection after being sorted by a property.
* Check the sortBy method for information on the callback and $type parameters
*
* ###Examples:
* ### Examples:
*
* {{{
* // For a collection of employees
Expand All @@ -269,7 +269,7 @@ public function max($callback, $type = SORT_NUMERIC);
public function min($callback, $type = SORT_NUMERIC);

/**
* Returns a sorted iterator out of the elements in this colletion,
* Returns a sorted iterator out of the elements in this collection,
* ranked in ascending order by the results of running each value through a
* callback. $callback can also be a string representing the column or property
* name.
Expand All @@ -279,7 +279,7 @@ public function min($callback, $type = SORT_NUMERIC);
* element. Please note that the callback function could be called more than once
* per element.
*
* ###Example:
* ### Example:
*
* {{{
* $items = $collection->sortBy(function ($user) {
Expand Down Expand Up @@ -315,7 +315,7 @@ public function sortBy($callback, $dir = SORT_DESC, $type = SORT_NUMERIC);
* a dot separated path of properties that should be followed to get the last
* one in the path.
*
* ###Example:
* ### Example:
*
* {{{
* $items = [
Expand Down Expand Up @@ -358,7 +358,7 @@ public function groupBy($callback);
* a dot separated path of properties that should be followed to get the last
* one in the path.
*
* ###Example:
* ### Example:
*
* {{{
* $items = [
Expand Down Expand Up @@ -397,7 +397,7 @@ public function indexBy($callback);
* a dot separated path of properties that should be followed to get the last
* one in the path.
*
* ###Example:
* ### Example:
*
* {{{
* $items = [
Expand Down Expand Up @@ -430,7 +430,7 @@ public function countBy($callback);
* Returns the total sum of all the values extracted with $matcher
* or of this collection.
*
* ###Example:
* ### Example:
*
* {{{
* $items = [
Expand Down Expand Up @@ -483,7 +483,7 @@ public function take($size = 1, $from = 0);
* Looks through each value in the list, returning a Collection of all the
* values that contain all of the key-value pairs listed in $conditions.
*
* ###Example:
* ### Example:
*
* {{{
* $items = [
Expand Down
4 changes: 2 additions & 2 deletions src/Collection/Iterator/InsertIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* This iterator will insert values into a property of each of the records returned.
* The values to be inserted come out of another traversal object. This is useful
* when you have two separate collections and want to merge them toghether by placing
* when you have two separate collections and want to merge them together by placing
* each of the values from one collection into a property inside the other collection.
*/
class InsertIterator extends Collection {
Expand All @@ -32,7 +32,7 @@ class InsertIterator extends Collection {
protected $_values;

/**
* Holds whether the values colelction is still valid. (has more records)
* Holds whether the values collection is still valid. (has more records)
*
* @var bool
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Iterator/MapReduce.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class MapReduce implements IteratorAggregate {
/**
* Constructor
*
* ## Example:
* ### Example:
*
* Separate all unique odd and even numbers in an array
*
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Iterator/SortIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* An iterator that will return the passed items in order. The order is given by
* the value returned in a callback function that maps each of the elements.
*
* ###Example:
* ### Example:
*
* {{{
* $items = [$user1, $user2, $user3];
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Iterator/TreeIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function __construct(RecursiveIterator $items, $mode = RecursiveIteratorI
* the current element as first parameter, the current iteration key as second
* parameter, and the iterator instance as third argument.
*
* ##Example
* ### Example
*
* {{{
* $printer = (new Collection($treeStructure))->listNested()->printer('name');
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Iterator/TreePrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TreePrinter extends RecursiveIteratorIterator {
/**
* Constructor
*
* @param RecursiveIterator $items The iterator to flatten.
* @param \RecursiveIterator $items The iterator to flatten.
* @param string|callable $valuePath The property to extract or a callable to return
* the display value.
* @param string|callable $keyPath The property to use as iteration key or a
Expand Down
2 changes: 1 addition & 1 deletion src/Console/ConsoleErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __construct($options = []) {
*
* @param \Exception $exception Exception instance.
* @return void
* @throws Exception When renderer class not found
* @throws \Exception When renderer class not found
* @see http://php.net/manual/en/function.set-exception-handler.php
*/
public function handleException(\Exception $exception) {
Expand Down
2 changes: 1 addition & 1 deletion src/Console/ShellDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ protected function _shellExists($shell) {
/**
* Create the given shell name, and set the plugin property
*
* @param string $className The class name to instanciate
* @param string $className The class name to instantiate
* @param string $shortName The plugin-prefixed shell name
* @return \Cake\Console\Shell A shell instance.
*/
Expand Down
10 changes: 5 additions & 5 deletions src/Controller/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
namespace Cake\Controller;

use Cake\Core\InstanceConfigTrait;
use Cake\Event\EventListener;
use Cake\Event\EventListenerInterface;
use Cake\Log\LogTrait;

/**
* Base class for an individual Component. Components provide reusable bits of
* controller logic that can be composed into a controller. Components also
* provide request life-cycle callbacks for injecting logic at specific points.
*
* ## Initialize hook
* ### Initialize hook
*
* Like Controller and Table, this class has an initialize() hook that you can use
* to add custom 'constructor' logic. It is important to remember that each request
* (and sub-request) will only make one instance of any given component.
*
* ## Life cycle callbacks
* ### Life cycle callbacks
*
* Components can provide several callbacks that are fired at various stages of the request
* cycle. The available callbacks are:
Expand All @@ -53,10 +53,10 @@
* While the controller is not an explicit argument for the callback methods it
* is the subject of each event and can be fetched using Event::subject().
*
* @link http://book.cakephp.org/2.0/en/controllers/components.html
* @link http://book.cakephp.org/3.0/en/controllers/components.html
* @see Controller::$components
*/
class Component implements EventListener {
class Component implements EventListenerInterface {

use InstanceConfigTrait;
use LogTrait;
Expand Down

0 comments on commit 109123b

Please sign in to comment.