Skip to content

Commit

Permalink
Merge branch 'master' into 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Oct 15, 2013
2 parents ce74153 + d4ecb7d commit 5a394c3
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 44 deletions.
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
@@ -1,35 +1,35 @@
# 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
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.

## 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.
Expand All @@ -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

Expand All @@ -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
20 changes: 11 additions & 9 deletions README.md
Expand Up @@ -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

[Q & A](http://ask.cakephp.org/) - Ask questions here, all questions welcome
[Google Group](https://groups.google.com/group/cake-php) - Community mailing list and forum

[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)

Expand Down
2 changes: 0 additions & 2 deletions lib/Cake/Cache/Engine/RedisEngine.php
Expand Up @@ -213,8 +213,6 @@ public function clearGroup($group) {

/**
* Disconnects from the redis server
*
* @return void
*/
public function __destruct() {
if (!$this->settings['persistent']) {
Expand Down
1 change: 0 additions & 1 deletion lib/Cake/Configure/IniReader.php
Expand Up @@ -96,7 +96,6 @@ public function __construct($path = null, $section = null) {
* @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) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Component/SecurityComponent.php
Expand Up @@ -350,7 +350,7 @@ protected function _requireMethod($method, $actions = array()) {
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;
}

/**
Expand Down
1 change: 0 additions & 1 deletion lib/Cake/Error/ExceptionRenderer.php
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions lib/Cake/I18n/I18n.php
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion lib/Cake/Log/Engine/BaseLog.php
Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions lib/Cake/Log/Engine/SyslogLog.php
Expand Up @@ -154,9 +154,7 @@ protected function _write($priority, $message) {

/**
* Closes the logger connection
*
* @return void
**/
*/
public function __destruct() {
closelog();
}
Expand Down
1 change: 0 additions & 1 deletion lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php
Expand Up @@ -158,7 +158,6 @@ class DbAclTwoTest extends DbAcl {
/**
* construct method
*
* @return void
*/
public function __construct() {
$this->Aro = new AroTwoTest();
Expand Down
Expand Up @@ -99,7 +99,6 @@ class AuthTestController extends Controller {
/**
* construct method
*
* @return void
*/
public function __construct($request, $response) {
$request->addParams(Router::parse('/auth_test'));
Expand Down
1 change: 0 additions & 1 deletion lib/Cake/Test/Case/Model/AclNodeTest.php
Expand Up @@ -185,7 +185,6 @@ class TestDbAcl extends DbAcl {
/**
* construct method
*
* @return void
*/
public function __construct() {
$this->Aro = new DbAroTest();
Expand Down
1 change: 1 addition & 0 deletions lib/Cake/Test/Case/Utility/DebuggerTest.php
Expand Up @@ -451,6 +451,7 @@ public function testLog() {
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');
Expand Down
8 changes: 7 additions & 1 deletion lib/Cake/Test/Case/Utility/ValidationTest.php
Expand Up @@ -1708,6 +1708,11 @@ public function testEmail() {
$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'));
Expand All @@ -1725,7 +1730,6 @@ public function testEmail() {
$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'));
}
Expand Down Expand Up @@ -1904,6 +1908,8 @@ public function testUrl() {
$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'));
Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/Test/Case/Utility/XmlTest.php
Expand Up @@ -454,7 +454,7 @@ public function testFromArrayPretty() {
XML;
$xmlResponse = Xml::fromArray($xml, array('pretty' => false));
$this->assertEquals($expected, $xmlResponse->asXML());
$this->assertTextEquals($expected, $xmlResponse->asXML());

$expected = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
Expand All @@ -471,7 +471,7 @@ public function testFromArrayPretty() {
XML;
$xmlResponse = Xml::fromArray($xml, array('pretty' => true));
$this->assertEquals($expected, $xmlResponse->asXML());
$this->assertTextEquals($expected, $xmlResponse->asXML());

$xml = array(
'tags' => array(
Expand All @@ -494,7 +494,7 @@ public function testFromArrayPretty() {
XML;
$xmlResponse = Xml::fromArray($xml, array('pretty' => false, 'format' => 'attributes'));
$this->assertEquals($expected, $xmlResponse->asXML());
$this->assertTextEquals($expected, $xmlResponse->asXML());

$expected = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
Expand All @@ -505,7 +505,7 @@ public function testFromArrayPretty() {
XML;
$xmlResponse = Xml::fromArray($xml, array('pretty' => true, 'format' => 'attributes'));
$this->assertEquals($expected, $xmlResponse->asXML());
$this->assertTextEquals($expected, $xmlResponse->asXML());
}

/**
Expand Down
1 change: 0 additions & 1 deletion lib/Cake/TestSuite/CakeTestRunner.php
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
Expand Up @@ -79,7 +79,6 @@ class CakeTestSuiteDispatcher {
/**
* constructor
*
* @return void
*/
public function __construct() {
$this->_baseUrl = $_SERVER['PHP_SELF'];
Expand Down
1 change: 0 additions & 1 deletion lib/Cake/TestSuite/Coverage/BaseCoverageReport.php
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/Utility/Validation.php
Expand Up @@ -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,})'
);

/**
Expand Down Expand Up @@ -431,7 +431,7 @@ public static function email($check, $deep = false, $regex = null) {
}

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) {
Expand Down Expand Up @@ -764,7 +764,7 @@ public static function ssn($check, $regex = null, $country = null) {
*/
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 . '*)?' .
Expand Down

0 comments on commit 5a394c3

Please sign in to comment.