diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1697844de..5e9c278a5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,9 +1,9 @@ # How to contribute CakePHP loves to welcome your contributions. There are several ways to help out: -* Create a ticket in Lighthouse, if you have found a bug -* Write testcases for open bug tickets -* Write patches for open bug/feature tickets, preferably with testcases included +* Create an [issue](https://github.com/cakephp/cakephp/issues) on GitHub, if you have found a bug +* Write testcases for open bug issues +* Write patches for open bug/feature issues, preferably with testcases included * Contribute to the [documentation](https://github.com/cakephp/docs) There are a few guidelines that we need contributors to follow so that we have a @@ -11,8 +11,8 @@ chance of keeping on top of things. ## Getting Started -* Make sure you have a [GitHub account](https://github.com/signup/free) -* Submit a ticket for your issue, assuming one does not already exist. +* Make sure you have a [GitHub account](https://github.com/signup/free). +* Submit an [issue](https://github.com/cakephp/cakephp/issues), assuming one does not already exist. * Clearly describe the issue including steps to reproduce when it is a bug. * Make sure you fill in the earliest version that you know has the issue. * Fork the repository on GitHub. @@ -20,16 +20,16 @@ chance of keeping on top of things. ## Making Changes * Create a topic branch from where you want to base your work. - * This is usually the master branch + * This is usually the master branch. * Only target release branches if you are certain your fix must be on that - branch + branch. * To quickly create a topic branch based on master; `git branch master/my_contribution master` then checkout the new branch with `git checkout master/my_contribution`. Better avoid working directly on the `master` branch, to avoid conflicts if you pull in updates from origin. * Make commits of logical units. * Check for unnecessary whitespace with `git diff --check` before committing. -* Use descriptive commit messages and reference the #ticket number +* Use descriptive commit messages and reference the #issue number. * Core testcases should continue to pass. You can run tests locally or enable [travis-ci](https://travis-ci.org/) for your fork, so all tests and codesniffs will be executed. @@ -55,7 +55,7 @@ CakePHP tests requires [PHPUnit](http://www.phpunit.de/manual/current/en/install ./lib/Cake/Console/cake test core AllTests --stderr -To run the sniffs for CakePHP coding standards +To run the sniffs for CakePHP coding standards: phpcs -p --extensions=php --standard=CakePHP ./lib/Cake @@ -67,7 +67,7 @@ for the sniff and phpcs. # Additional Resources * [CakePHP coding standards](http://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html) -* [Bug tracker](https://cakephp.lighthouseapp.com/projects/42648-cakephp) +* [Existing issues](https://github.com/cakephp/cakephp/issues) * [General GitHub documentation](https://help.github.com/) * [GitHub pull request documentation](https://help.github.com/send-pull-requests/) * #cakephp IRC channel on freenode.org diff --git a/README.md b/README.md index 54520d713..42d1193b0 100644 --- a/README.md +++ b/README.md @@ -11,28 +11,30 @@ Some Handy Links [CakePHP](http://www.cakephp.org) - The rapid development PHP framework -[Cookbook](http://book.cakephp.org) - THE CakePHP user documentation; start learning here! +[CookBook](http://book.cakephp.org) - THE CakePHP user documentation; start learning here! + +[API](http://api.cakephp.org) - A reference to CakePHP's classes [Plugins](http://plugins.cakephp.org/) - A repository of extensions to the framework [The Bakery](http://bakery.cakephp.org) - Tips, tutorials and articles -[API](http://api.cakephp.org) - A reference to CakePHP's classes +[Community Center](http://community.cakephp.org) - A source for everything community related -[CakePHP TV](http://tv.cakephp.org) - Screen casts from events and video tutorials +[Training](http://training.cakephp.org) - Join a live session and get skilled with the framework -[The Cake Software Foundation](http://cakefoundation.org/) - promoting development related to CakePHP +[CakeFest](http://cakefest.org) - Don't miss our annual CakePHP conference + +[Cake Software Foundation](http://cakefoundation.org) - Promoting development related to CakePHP Get Support! ------------ -[Our Google Group](https://groups.google.com/group/cake-php) - community mailing list and forum +[#cakephp](http://webchat.freenode.net/?channels=#cakephp) on irc.freenode.net - Come chat with us, we have cake -[#cakephp](http://webchat.freenode.net/?channels=#cakephp) on irc.freenode.net - Come chat with us, we have cake. +[Google Group](https://groups.google.com/group/cake-php) - Community mailing list and forum -[Q & A](http://ask.cakephp.org/) - Ask questions here, all questions welcome - -[Lighthouse](https://cakephp.lighthouseapp.com/) - Got issues? Please tell us! +[GitHub Issues](https://github.com/cakephp/cakephp/issues) - Got issues? Please tell us! [![Bake Status](https://secure.travis-ci.org/cakephp/cakephp.png?branch=master)](http://travis-ci.org/cakephp/cakephp) diff --git a/lib/Cake/Cache/Engine/RedisEngine.php b/lib/Cake/Cache/Engine/RedisEngine.php index c481f8c6f..4d92cd8e8 100644 --- a/lib/Cake/Cache/Engine/RedisEngine.php +++ b/lib/Cake/Cache/Engine/RedisEngine.php @@ -213,8 +213,6 @@ class RedisEngine extends CacheEngine { /** * Disconnects from the redis server - * - * @return void */ public function __destruct() { if (!$this->settings['persistent']) { diff --git a/lib/Cake/Configure/IniReader.php b/lib/Cake/Configure/IniReader.php index 66e009404..c854bf3d5 100644 --- a/lib/Cake/Configure/IniReader.php +++ b/lib/Cake/Configure/IniReader.php @@ -96,7 +96,6 @@ class IniReader implements ConfigReaderInterface { * @return array Parsed configuration values. * @throws ConfigureException when files don't exist. * Or when files contain '..' as this could lead to abusive reads. - * @throws ConfigureException */ public function read($key) { if (strpos($key, '..') !== false) { diff --git a/lib/Cake/Controller/Component/SecurityComponent.php b/lib/Cake/Controller/Component/SecurityComponent.php index 343eba22a..3361ca1c3 100644 --- a/lib/Cake/Controller/Component/SecurityComponent.php +++ b/lib/Cake/Controller/Component/SecurityComponent.php @@ -350,7 +350,7 @@ class SecurityComponent extends Component { if (isset($actions[0]) && is_array($actions[0])) { $actions = $actions[0]; } - $this->{'require' . $method} = (empty($actions)) ? array('*'): $actions; + $this->{'require' . $method} = (empty($actions)) ? array('*') : $actions; } /** diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index 76f0ddff5..485e32a9c 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -89,7 +89,6 @@ class ExceptionRenderer { * code error depending on the code used to construct the error. * * @param Exception $exception Exception - * @return mixed Return void or value returned by controller's `appError()` function */ public function __construct(Exception $exception) { $this->controller = $this->_getController($exception); diff --git a/lib/Cake/I18n/I18n.php b/lib/Cake/I18n/I18n.php index 9eb739534..2f27023d0 100644 --- a/lib/Cake/I18n/I18n.php +++ b/lib/Cake/I18n/I18n.php @@ -98,8 +98,6 @@ class I18n { /** * Constructor, use I18n::getInstance() to get the i18n translation object. - * - * @return void */ public function __construct() { $this->l10n = new L10n(); diff --git a/lib/Cake/Log/Engine/BaseLog.php b/lib/Cake/Log/Engine/BaseLog.php index 3e071935b..a7b3953bb 100644 --- a/lib/Cake/Log/Engine/BaseLog.php +++ b/lib/Cake/Log/Engine/BaseLog.php @@ -38,7 +38,6 @@ abstract class BaseLog implements CakeLogInterface { * __construct method * * @param array $config Configuration array - * @return void */ public function __construct($config = array()) { $this->config($config); diff --git a/lib/Cake/Log/Engine/SyslogLog.php b/lib/Cake/Log/Engine/SyslogLog.php index 4c6147903..a34f03d7c 100644 --- a/lib/Cake/Log/Engine/SyslogLog.php +++ b/lib/Cake/Log/Engine/SyslogLog.php @@ -154,9 +154,7 @@ class SyslogLog extends BaseLog { /** * Closes the logger connection - * - * @return void - **/ + */ public function __destruct() { closelog(); } diff --git a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php index c29550b01..1eab437f2 100644 --- a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php @@ -158,7 +158,6 @@ class DbAclTwoTest extends DbAcl { /** * construct method * - * @return void */ public function __construct() { $this->Aro = new AroTwoTest(); diff --git a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php index ed102d2c5..2891236b8 100644 --- a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php @@ -99,7 +99,6 @@ class AuthTestController extends Controller { /** * construct method * - * @return void */ public function __construct($request, $response) { $request->addParams(Router::parse('/auth_test')); diff --git a/lib/Cake/Test/Case/Model/AclNodeTest.php b/lib/Cake/Test/Case/Model/AclNodeTest.php index d8986ea81..bd71c701f 100644 --- a/lib/Cake/Test/Case/Model/AclNodeTest.php +++ b/lib/Cake/Test/Case/Model/AclNodeTest.php @@ -185,7 +185,6 @@ class TestDbAcl extends DbAcl { /** * construct method * - * @return void */ public function __construct() { $this->Aro = new DbAroTest(); diff --git a/lib/Cake/Test/Case/Utility/DebuggerTest.php b/lib/Cake/Test/Case/Utility/DebuggerTest.php index 845cb30b5..04451915b 100644 --- a/lib/Cake/Test/Case/Utility/DebuggerTest.php +++ b/lib/Cake/Test/Case/Utility/DebuggerTest.php @@ -451,6 +451,7 @@ TEXT; if (file_exists(LOGS . 'debug.log')) { unlink(LOGS . 'debug.log'); } + CakeLog::config('file', array('engine' => 'File', 'path' => TMP . 'logs' . DS)); Debugger::log('cool'); $result = file_get_contents(LOGS . 'debug.log'); diff --git a/lib/Cake/Test/Case/Utility/ValidationTest.php b/lib/Cake/Test/Case/Utility/ValidationTest.php index e1147645d..87fcfe8a4 100644 --- a/lib/Cake/Test/Case/Utility/ValidationTest.php +++ b/lib/Cake/Test/Case/Utility/ValidationTest.php @@ -1708,6 +1708,11 @@ class ValidationTest extends CakeTestCase { $this->assertTrue(Validation::email('!def!xyz%abc@example.com')); $this->assertTrue(Validation::email('_somename@example.com')); + /// Unicode + $this->assertTrue(Validation::email('some@eräume.foo')); + $this->assertTrue(Validation::email('äu@öe.eräume.foo')); + $this->assertTrue(Validation::email('Nyrée.surname@example.com')); + // invalid addresses $this->assertFalse(Validation::email('abc@example')); $this->assertFalse(Validation::email('abc@example.c')); @@ -1725,7 +1730,6 @@ class ValidationTest extends CakeTestCase { $this->assertFalse(Validation::email("abc@sub'example.com")); $this->assertFalse(Validation::email('abc@sub/example.com')); $this->assertFalse(Validation::email('abc@yahoo!.com')); - $this->assertFalse(Validation::email("Nyrée.surname@example.com")); $this->assertFalse(Validation::email('abc@example_underscored.com')); $this->assertFalse(Validation::email('raw@test.ra.ru....com')); } @@ -1904,6 +1908,8 @@ class ValidationTest extends CakeTestCase { $this->assertTrue(Validation::url('http://www.zwischenraume.cz')); $this->assertTrue(Validation::url('http://www.last.fm/music/浜崎あゆみ'), 'utf8 path failed'); $this->assertTrue(Validation::url('http://www.electrohome.ro/images/239537750-284232-215_300[1].jpg')); + $this->assertTrue(Validation::url('http://www.eräume.foo')); + $this->assertTrue(Validation::url('http://äüö.eräume.foo')); $this->assertTrue(Validation::url('http://cakephp.org:80')); $this->assertTrue(Validation::url('http://cakephp.org:443')); diff --git a/lib/Cake/Test/Case/Utility/XmlTest.php b/lib/Cake/Test/Case/Utility/XmlTest.php index acfe4d71d..dc2162aff 100644 --- a/lib/Cake/Test/Case/Utility/XmlTest.php +++ b/lib/Cake/Test/Case/Utility/XmlTest.php @@ -454,7 +454,7 @@ XML; XML; $xmlResponse = Xml::fromArray($xml, array('pretty' => false)); - $this->assertEquals($expected, $xmlResponse->asXML()); + $this->assertTextEquals($expected, $xmlResponse->asXML()); $expected = << @@ -471,7 +471,7 @@ XML; XML; $xmlResponse = Xml::fromArray($xml, array('pretty' => true)); - $this->assertEquals($expected, $xmlResponse->asXML()); + $this->assertTextEquals($expected, $xmlResponse->asXML()); $xml = array( 'tags' => array( @@ -494,7 +494,7 @@ XML; XML; $xmlResponse = Xml::fromArray($xml, array('pretty' => false, 'format' => 'attributes')); - $this->assertEquals($expected, $xmlResponse->asXML()); + $this->assertTextEquals($expected, $xmlResponse->asXML()); $expected = << @@ -505,7 +505,7 @@ XML; XML; $xmlResponse = Xml::fromArray($xml, array('pretty' => true, 'format' => 'attributes')); - $this->assertEquals($expected, $xmlResponse->asXML()); + $this->assertTextEquals($expected, $xmlResponse->asXML()); } /** diff --git a/lib/Cake/TestSuite/CakeTestRunner.php b/lib/Cake/TestSuite/CakeTestRunner.php index fe64e30fe..9b98ffdde 100644 --- a/lib/Cake/TestSuite/CakeTestRunner.php +++ b/lib/Cake/TestSuite/CakeTestRunner.php @@ -33,7 +33,6 @@ class CakeTestRunner extends PHPUnit_TextUI_TestRunner { * * @param mixed $loader * @param array $params list of options to be used for this run - * @return void */ public function __construct($loader, $params) { parent::__construct($loader); diff --git a/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php b/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php index 4c10d1859..e7a5dabd8 100644 --- a/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php +++ b/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php @@ -79,7 +79,6 @@ class CakeTestSuiteDispatcher { /** * constructor * - * @return void */ public function __construct() { $this->_baseUrl = $_SERVER['PHP_SELF']; diff --git a/lib/Cake/TestSuite/Coverage/BaseCoverageReport.php b/lib/Cake/TestSuite/Coverage/BaseCoverageReport.php index dd63831c6..0c9ecb2f3 100644 --- a/lib/Cake/TestSuite/Coverage/BaseCoverageReport.php +++ b/lib/Cake/TestSuite/Coverage/BaseCoverageReport.php @@ -61,7 +61,6 @@ abstract class BaseCoverageReport { * * @param array $coverage Array of coverage data from PHPUnit_Test_Result * @param CakeBaseReporter $reporter A reporter to use for the coverage report. - * @return void */ public function __construct($coverage, CakeBaseReporter $reporter) { $this->_rawCoverage = $coverage; diff --git a/lib/Cake/Utility/Validation.php b/lib/Cake/Utility/Validation.php index 745e2a482..2323511a6 100644 --- a/lib/Cake/Utility/Validation.php +++ b/lib/Cake/Utility/Validation.php @@ -39,7 +39,7 @@ class Validation { * @var array */ protected static $_pattern = array( - 'hostname' => '(?:[_a-z0-9][-_a-z0-9]*\.)*(?:[a-z0-9][-a-z0-9]{0,62})\.(?:(?:[a-z]{2}\.)?[a-z]{2,})' + 'hostname' => '(?:[_\p{L}0-9][-_\p{L}0-9]*\.)*(?:[\p{L}0-9][-\p{L}0-9]{0,62})\.(?:(?:[a-z]{2}\.)?[a-z]{2,})' ); /** @@ -431,7 +431,7 @@ class Validation { } if ($regex === null) { - $regex = '/^[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@' . self::$_pattern['hostname'] . '$/i'; + $regex = '/^[\p{L}0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[\p{L}0-9!#$%&\'*+\/=?^_`{|}~-]+)*@' . self::$_pattern['hostname'] . '$/ui'; } $return = self::_check($check, $regex); if ($deep === false || $deep === null) { @@ -764,7 +764,7 @@ class Validation { */ public static function url($check, $strict = false) { self::_populateIp(); - $validChars = '([' . preg_quote('!"$&\'()*+,-.@_:;=~[]') . '\/0-9a-z\p{L}\p{N}]|(%[0-9a-f]{2}))'; + $validChars = '([' . preg_quote('!"$&\'()*+,-.@_:;=~[]') . '\/0-9\p{L}\p{N}]|(%[0-9a-f]{2}))'; $regex = '/^(?:(?:https?|ftps?|sftp|file|news|gopher):\/\/)' . (!empty($strict) ? '' : '?') . '(?:' . self::$_pattern['IPv4'] . '|\[' . self::$_pattern['IPv6'] . '\]|' . self::$_pattern['hostname'] . ')(?::[1-9][0-9]{0,4})?' . '(?:\/?|\/' . $validChars . '*)?' .