mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 00:48:25 +00:00
Merge branch 'master' into 2.5
This commit is contained in:
commit
5a394c379a
19 changed files with 38 additions and 44 deletions
|
@ -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
|
||||
|
|
20
README.md
20
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)
|
||||
|
||||
|
|
|
@ -213,8 +213,6 @@ class RedisEngine extends CacheEngine {
|
|||
|
||||
/**
|
||||
* Disconnects from the redis server
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __destruct() {
|
||||
if (!$this->settings['persistent']) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -154,9 +154,7 @@ class SyslogLog extends BaseLog {
|
|||
|
||||
/**
|
||||
* Closes the logger connection
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function __destruct() {
|
||||
closelog();
|
||||
}
|
||||
|
|
|
@ -158,7 +158,6 @@ class DbAclTwoTest extends DbAcl {
|
|||
/**
|
||||
* construct method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->Aro = new AroTwoTest();
|
||||
|
|
|
@ -99,7 +99,6 @@ class AuthTestController extends Controller {
|
|||
/**
|
||||
* construct method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($request, $response) {
|
||||
$request->addParams(Router::parse('/auth_test'));
|
||||
|
|
|
@ -185,7 +185,6 @@ class TestDbAcl extends DbAcl {
|
|||
/**
|
||||
* construct method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->Aro = new DbAroTest();
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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'));
|
||||
|
|
|
@ -454,7 +454,7 @@ XML;
|
|||
|
||||
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"?>
|
||||
|
@ -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 = <<<XML
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -79,7 +79,6 @@ class CakeTestSuiteDispatcher {
|
|||
/**
|
||||
* constructor
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->_baseUrl = $_SERVER['PHP_SELF'];
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 . '*)?' .
|
||||
|
|
Loading…
Add table
Reference in a new issue