diff --git a/web/api/CONTRIBUTING.md b/web/api/CONTRIBUTING.md index 211d68744..8c7ceb48b 100644 --- a/web/api/CONTRIBUTING.md +++ b/web/api/CONTRIBUTING.md @@ -9,6 +9,10 @@ CakePHP loves to welcome your contributions. There are several ways to help out: There are a few guidelines that we need contributors to follow so that we have a chance of keeping on top of things. +## Code of Conduct + +Help us keep CakePHP open and inclusive. Please read and follow our [Code of Conduct](https://github.com/cakephp/code-of-conduct/blob/master/CODE_OF_CONDUCT.md). + ## Getting Started * Make sure you have a [GitHub account](https://github.com/signup/free). @@ -33,14 +37,14 @@ chance of keeping on top of things. * Core test cases 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. -* Your work should apply the CakePHP coding standards. +* Your work should apply the [CakePHP coding standards](https://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html). ## Which branch to base the work * Bugfix branches will be based on master. * New features that are backwards compatible will be based on next minor release branch. -* New features or other non-BC changes will go in the next major release branch. +* New features or other non backwards compatible changes will go in the next major release branch. ## Submitting Changes @@ -50,8 +54,8 @@ chance of keeping on top of things. ## Test cases and codesniffer -CakePHP tests requires [PHPUnit](http://www.phpunit.de/manual/current/en/installation.html) -3.5 or higher. To run the test cases locally use the following command: +CakePHP tests requires [PHPUnit](https://phpunit.de/manual/current/en/installation.html) +3.7, version 4 is not compatible. To run the test cases locally use the following command: ./lib/Cake/Console/cake test core AllTests --stderr @@ -60,12 +64,16 @@ To run the sniffs for CakePHP coding standards: phpcs -p --extensions=php --standard=CakePHP ./lib/Cake Check the [cakephp-codesniffer](https://github.com/cakephp/cakephp-codesniffer) -repository to setup the CakePHP standard. The README contains installation info +repository to setup the CakePHP standard. The [README](https://github.com/cakephp/cakephp-codesniffer/blob/master/README.md) contains installation info for the sniff and phpcs. +## Reporting a Security Issue + +If you've found a security related issue in CakePHP, please don't open an issue in GitHub. Instead contact us at security@cakephp.org. For more information on how we handle security issues, [see the CakePHP Security Issue Process](https://book.cakephp.org/2.0/en/contributing/tickets.html#reporting-security-issues). + # Additional Resources -* [CakePHP coding standards](http://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html) +* [CakePHP coding standards](https://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html) * [Existing issues](https://github.com/cakephp/cakephp/issues) * [Development Roadmaps](https://github.com/cakephp/cakephp/wiki#roadmaps) * [General GitHub documentation](https://help.github.com/) diff --git a/web/api/app/Config/Schema/db_acl.sql b/web/api/app/Config/Schema/db_acl.sql index cbb0ccece..e0a0e02fb 100644 --- a/web/api/app/Config/Schema/db_acl.sql +++ b/web/api/app/Config/Schema/db_acl.sql @@ -40,7 +40,7 @@ CREATE TABLE aros ( PRIMARY KEY (id) ); -/* this indexes will improve acl perfomance */ +/* this indexes will improve acl performance */ CREATE INDEX idx_acos_lft_rght ON `acos` (`lft`, `rght`); CREATE INDEX idx_acos_alias ON `acos` (`alias`); diff --git a/web/api/app/Config/Schema/sessions.php b/web/api/app/Config/Schema/sessions.php index 14ff2c6d4..b766ebff0 100644 --- a/web/api/app/Config/Schema/sessions.php +++ b/web/api/app/Config/Schema/sessions.php @@ -4,37 +4,57 @@ * * Use it to configure database for Sessions * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config.Schema * @since CakePHP(tm) v 0.2.9 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ -/* - * +/** * Using the Schema command line utility * cake schema run create Sessions - * */ class SessionsSchema extends CakeSchema { +/** + * Name property + * + * @var string + */ public $name = 'Sessions'; +/** + * Before callback. + * + * @param array $event Schema object properties + * @return bool Should process continue + */ public function before($event = array()) { return true; } +/** + * After callback. + * + * @param array $event Schema object properties + * @return void + */ public function after($event = array()) { } +/** + * The cake_sessions table definition + * + * @var array + */ public $cake_sessions = array( 'id' => array('type' => 'string', 'null' => false, 'key' => 'primary'), 'data' => array('type' => 'text', 'null' => true, 'default' => null), diff --git a/web/api/app/Config/email.php.default b/web/api/app/Config/email.php.default index 6dcfdd8f9..353548e6a 100644 --- a/web/api/app/Config/email.php.default +++ b/web/api/app/Config/email.php.default @@ -1,7 +1,5 @@ * The origin email. See CakeEmail::from() about the valid values - * */ class EmailConfig { diff --git a/web/api/app/Controller/AppController.php b/web/api/app/Controller/AppController.php index 737dedacf..3cd001e7c 100644 --- a/web/api/app/Controller/AppController.php +++ b/web/api/app/Controller/AppController.php @@ -5,18 +5,18 @@ * This file is application-wide controller file. You can put all * application-wide controller-related methods here. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.Controller * @since CakePHP(tm) v 0.2.9 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://www.opensource.org/licenses/mit-license.php MIT License */ App::uses('Controller', 'Controller'); App::uses('CrudControllerTrait', 'Crud.Lib'); @@ -27,8 +27,8 @@ App::uses('CrudControllerTrait', 'Crud.Lib'); * Add your application-wide methods in the class below, your controllers * will inherit them. * - * @package app.Controller - * @link http://book.cakephp.org/2.0/en/controllers.html#the-app-controller + * @package app.Controller + * @link https://book.cakephp.org/2.0/en/controllers.html#the-app-controller */ class AppController extends Controller { use CrudControllerTrait; diff --git a/web/api/app/Model/AppModel.php b/web/api/app/Model/AppModel.php index 27836464d..bf4b88add 100644 --- a/web/api/app/Model/AppModel.php +++ b/web/api/app/Model/AppModel.php @@ -5,18 +5,18 @@ * This file is application-wide model file. You can put all * application-wide model-related methods here. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.Model * @since CakePHP(tm) v 0.2.9 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('Model', 'Model'); diff --git a/web/api/app/View/Emails/html/default.ctp b/web/api/app/View/Emails/html/default.ctp index e2bff19c0..a6e95fe6a 100644 --- a/web/api/app/View/Emails/html/default.ctp +++ b/web/api/app/View/Emails/html/default.ctp @@ -1,19 +1,17 @@ ' . $line . "
\n"; endforeach; -?> \ No newline at end of file +?> diff --git a/web/api/app/View/Emails/text/default.ctp b/web/api/app/View/Emails/text/default.ctp index 090b5c403..48ea5660a 100644 --- a/web/api/app/View/Emails/text/default.ctp +++ b/web/api/app/View/Emails/text/default.ctp @@ -1,19 +1,17 @@ - \ No newline at end of file + diff --git a/web/api/app/View/Errors/error400.ctp b/web/api/app/View/Errors/error400.ctp index 4c3850b28..311a53175 100644 --- a/web/api/app/View/Errors/error400.ctp +++ b/web/api/app/View/Errors/error400.ctp @@ -1,19 +1,17 @@ diff --git a/web/api/app/View/Errors/error500.ctp b/web/api/app/View/Errors/error500.ctp index 518b9ee77..8b6eb9724 100644 --- a/web/api/app/View/Errors/error500.ctp +++ b/web/api/app/View/Errors/error500.ctp @@ -1,19 +1,17 @@ diff --git a/web/api/app/View/Helper/AppHelper.php b/web/api/app/View/Helper/AppHelper.php index 9097d33f0..4851a5b41 100644 --- a/web/api/app/View/Helper/AppHelper.php +++ b/web/api/app/View/Helper/AppHelper.php @@ -5,18 +5,18 @@ * This file is application-wide helper file. You can put all * application-wide helper-related methods here. * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) + * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * - * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project * @package app.View.Helper * @since CakePHP(tm) v 0.2.9 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('Helper', 'View'); diff --git a/web/api/app/View/Layouts/Emails/html/default.ctp b/web/api/app/View/Layouts/Emails/html/default.ctp index da3851a09..747994a63 100644 --- a/web/api/app/View/Layouts/Emails/html/default.ctp +++ b/web/api/app/View/Layouts/Emails/html/default.ctp @@ -1,29 +1,27 @@ -This email was sent using the CakePHP Framework
+This email was sent using the CakePHP Framework
\ No newline at end of file diff --git a/web/api/app/View/Layouts/Emails/text/default.ctp b/web/api/app/View/Layouts/Emails/text/default.ctp index ee624de45..82a1e195b 100644 --- a/web/api/app/View/Layouts/Emails/text/default.ctp +++ b/web/api/app/View/Layouts/Emails/text/default.ctp @@ -1,21 +1,19 @@ fetch('content'); ?> -This email was sent using the CakePHP Framework, http://cakephp.org. +This email was sent using the CakePHP Framework, https://cakephp.org. diff --git a/web/api/app/View/Layouts/ajax.ctp b/web/api/app/View/Layouts/ajax.ctp index 0f9a4fb62..7e14112c1 100644 --- a/web/api/app/View/Layouts/ajax.ctp +++ b/web/api/app/View/Layouts/ajax.ctp @@ -1,19 +1,17 @@ fetch('content'); ?> diff --git a/web/api/app/View/Layouts/default.ctp b/web/api/app/View/Layouts/default.ctp index 38dececbc..2f8d3cb8e 100644 --- a/web/api/app/View/Layouts/default.ctp +++ b/web/api/app/View/Layouts/default.ctp @@ -1,19 +1,17 @@ Html->charset(); ?>+ Html->link($message, $url); ?> +
diff --git a/web/api/app/View/Layouts/rss/default.ctp b/web/api/app/View/Layouts/rss/default.ctp index 26d875eda..60a53659f 100644 --- a/web/api/app/View/Layouts/rss/default.ctp +++ b/web/api/app/View/Layouts/rss/default.ctp @@ -3,7 +3,7 @@ if (!isset($channel)): $channel = array(); endif; if (!isset($channel['title'])): - $channel['title'] = $title_for_layout; + $channel['title'] = $this->fetch('title'); endif; echo $this->Rss->document( @@ -11,4 +11,3 @@ echo $this->Rss->document( array(), $channel, $this->fetch('content') ) ); -?> diff --git a/web/api/app/View/Pages/home.ctp b/web/api/app/View/Pages/home.ctp index 082cc99b0..d0e20df8c 100644 --- a/web/api/app/View/Pages/home.ctp +++ b/web/api/app/View/Pages/home.ctp @@ -1,8 +1,6 @@- + Html->link(__d('cake_dev', 'Read the changelog'), 'https://cakephp.org/changelogs/' . Configure::version()); ?>
0): Debugger::checkSecurityKeys(); endif; ?> - -- - 1) Help me configure it - 2) I don't / can't use URL rewriting -
- + ++ + 1) Help me configure it + 2) I don't / can't use URL rewriting +
+=')): +if (version_compare(PHP_VERSION, '5.2.8', '>=')): + echo ''; + echo __d('cake_dev', 'Your version of PHP is 5.2.8 or higher.'); + echo ''; +else: + echo ''; + echo __d('cake_dev', 'Your version of PHP is too low. You need PHP 5.2.8 or higher to use CakePHP.'); + echo ''; +endif; +?> +
++ '; - echo __d('cake_dev', 'Your version of PHP is 5.2.8 or higher.'); + echo __d('cake_dev', 'Your tmp directory is writable.'); echo ''; else: echo ''; - echo __d('cake_dev', 'Your version of PHP is too low. You need PHP 5.2.8 or higher to use CakePHP.'); + echo __d('cake_dev', 'Your tmp directory is NOT writable.'); echo ''; endif; -?> -
-- '; - echo __d('cake_dev', 'Your tmp directory is writable.'); - echo ''; - else: - echo ''; - echo __d('cake_dev', 'Your tmp directory is NOT writable.'); - echo ''; - endif; ?>
'; - echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit %s', ''. $settings['engine'] . 'Engine', 'APP/Config/core.php'); - echo ''; - else: - echo ''; - echo __d('cake_dev', 'Your cache is NOT working. Please check the settings in %s', 'APP/Config/core.php'); - echo ''; - endif; + $settings = Cache::settings(); + if (!empty($settings)): + echo ''; + echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit %s', '' . $settings['engine'] . 'Engine', CONFIG . 'core.php'); + echo ''; + else: + echo ''; + echo __d('cake_dev', 'Your cache is NOT working. Please check the settings in %s', CONFIG . 'core.php'); + echo ''; + endif; ?>
';
- echo __d('cake_dev', 'Your database configuration file is present.');
- $filePresent = true;
- echo '';
- else:
- echo '';
- echo __d('cake_dev', 'Your database configuration file is NOT present.');
- echo '
';
- echo __d('cake_dev', 'Rename %s to %s', 'APP/Config/database.php.default', 'APP/Config/database.php');
- echo '';
- endif;
+ $filePresent = null;
+ if (file_exists(CONFIG . 'database.php')):
+ echo '';
+ echo __d('cake_dev', 'Your database configuration file is present.');
+ $filePresent = true;
+ echo '';
+ else:
+ echo '';
+ echo __d('cake_dev', 'Your database configuration file is NOT present.');
+ echo '
';
+ echo __d('cake_dev', 'Rename %s to %s', CONFIG . 'database.php.default', CONFIG . 'database.php');
+ echo '';
+ endif;
?>
- isConnected()):
- echo '';
- echo __d('cake_dev', 'CakePHP is able to connect to the database.');
- echo '';
- else:
- echo '';
- echo __d('cake_dev', 'CakePHP is NOT able to connect to the database.');
- echo '
';
- echo $errorMsg;
- echo '';
- endif;
?>
-
+ isConnected()):
+ echo '';
+ echo __d('cake_dev', 'CakePHP is able to connect to the database.');
+ echo '';
+ else:
+ echo '';
+ echo __d('cake_dev', 'CakePHP is NOT able to connect to the database.');
+ echo '
';
+ echo $errorMsg;
+ echo '';
+ endif;
+ ?>
+
--enable-unicode-properties
when configuring');
- echo '';
- endif;
+endif;
+
+App::uses('Validation', 'Utility');
+if (!Validation::alphaNumeric('cakephp')):
+ echo '';
+ echo __d('cake_dev', 'PCRE has not been compiled with Unicode support.');
+ echo '
';
+ echo __d('cake_dev', 'Recompile PCRE with Unicode support by adding --enable-unicode-properties
when configuring');
+ echo '
';
- echo __d('cake_dev', 'DebugKit plugin is present');
- echo '';
- else:
- echo '';
- echo __d('cake_dev', 'DebugKit is not installed. It will help you inspect and debug different aspects of your application.');
- echo '
';
- echo __d('cake_dev', 'You can install it from %s', $this->Html->link('GitHub', 'https://github.com/cakephp/debug_kit'));
- echo '';
- endif;
+ if (CakePlugin::loaded('DebugKit')):
+ echo '';
+ echo __d('cake_dev', 'DebugKit plugin is present');
+ echo '';
+ else:
+ echo '';
+ echo __d('cake_dev', 'DebugKit is not installed. It will help you inspect and debug different aspects of your application.');
+ echo '
';
+ echo __d('cake_dev', 'You can install it from %s', $this->Html->link('GitHub', 'https://github.com/cakephp/debug_kit/tree/2.2'));
+ echo '';
+ endif;
?>
Html->link( - sprintf('%s %s', __d('cake_dev', 'New'), __d('cake_dev', 'CakePHP 2.0 Docs')), - 'http://book.cakephp.org/2.0/en/', - array('target' => '_blank', 'escape' => false) - ); + echo $this->Html->link( + sprintf('%s %s', __d('cake_dev', 'New'), __d('cake_dev', 'CakePHP 2.0 Docs')), + 'https://book.cakephp.org/2.0/en/', + array('target' => '_blank', 'escape' => false) + ); ?>
Html->link( - __d('cake_dev', 'The 15 min Blog Tutorial'), - 'http://book.cakephp.org/2.0/en/tutorials-and-examples/blog/blog.html', - array('target' => '_blank', 'escape' => false) - ); + echo $this->Html->link( + __d('cake_dev', 'The 15 min Blog Tutorial'), + 'https://book.cakephp.org/2.0/en/tutorials-and-examples/blog/blog.html', + array('target' => '_blank', 'escape' => false) + ); ?>
@@ -183,7 +178,7 @@ You can also add some CSS styles for your pages at: %s.',