From aa596c6c2a2a1f4ccb671ff70cc7104e79859a2b Mon Sep 17 00:00:00 2001 From: Erwane Breton Date: Thu, 12 Dec 2019 20:34:49 +0100 Subject: [PATCH 1/6] rename RaidheadSource to RaidplannerDbSource --- ...aidheadSource.php => RaidplannerDbSource.php} | 2 +- app/Plugin/Admin/Controller/AjaxController.php | 16 ++++++++-------- app/Plugin/Admin/Controller/GamesController.php | 16 ++++++++-------- 3 files changed, 17 insertions(+), 17 deletions(-) rename app/Model/Datasource/{RaidheadSource.php => RaidplannerDbSource.php} (97%) diff --git a/app/Model/Datasource/RaidheadSource.php b/app/Model/Datasource/RaidplannerDbSource.php similarity index 97% rename from app/Model/Datasource/RaidheadSource.php rename to app/Model/Datasource/RaidplannerDbSource.php index 18920d8..5212f19 100644 --- a/app/Model/Datasource/RaidheadSource.php +++ b/app/Model/Datasource/RaidplannerDbSource.php @@ -11,7 +11,7 @@ App::uses('HttpSocket', 'Network/Http'); App::uses('Configure', 'Core'); -class RaidheadSource extends DataSource { +class RaidplannerDbSource extends DataSource { public $config = array( 'baseUrl' => 'https://api.raidhead.com/', diff --git a/app/Plugin/Admin/Controller/AjaxController.php b/app/Plugin/Admin/Controller/AjaxController.php index 186d149..c30664e 100644 --- a/app/Plugin/Admin/Controller/AjaxController.php +++ b/app/Plugin/Admin/Controller/AjaxController.php @@ -47,8 +47,8 @@ public function importGame() { $slug = $this->request->query['slug']; $this->Session->write('ajaxProgress', 10); - App::uses('RaidheadSource', 'Model/Datasource'); - $RaidHead = new RaidheadSource(); + App::uses('RaidplannerDbSource', 'Model/Datasource'); + $RaidHead = new RaidplannerDbSource(); $game = $RaidHead->get($slug); // Check API error @@ -139,7 +139,7 @@ public function importGame() { $ClasseModel->__add($toSaveClasses, array('game_id' => $gameId)); } } - + $this->Session->write('ajaxProgress', 100); $jsonMessage['type'] = 'success'; @@ -155,7 +155,7 @@ public function importGame() { public function ajaxProgress() { $progress = 0; if($this->Session->check('ajaxProgress')) { - $progress = $this->Session->read('ajaxProgress'); + $progress = $this->Session->read('ajaxProgress'); } return $progress; @@ -167,11 +167,11 @@ public function checkUpdates() { App::uses('Game', 'Model'); $GameModel = new Game(); - App::uses('RaidheadSource', 'Model/Datasource'); - $RaidHead = new RaidheadSource(); + App::uses('RaidplannerDbSource', 'Model/Datasource'); + $RaidHead = new RaidplannerDbSource(); $apiGames = $RaidHead->gets(); - $params = array(); + $params = array(); $params['recursive'] = -1; $params['fields'] = array('import_slug', 'import_modified'); $params['conditions']['import_slug !='] = null; @@ -187,4 +187,4 @@ public function checkUpdates() { return json_encode($jsonList); } -} \ No newline at end of file +} diff --git a/app/Plugin/Admin/Controller/GamesController.php b/app/Plugin/Admin/Controller/GamesController.php index 5a659f2..b4f8a7e 100644 --- a/app/Plugin/Admin/Controller/GamesController.php +++ b/app/Plugin/Admin/Controller/GamesController.php @@ -75,7 +75,7 @@ public function add() { $this->Session->setFlash(__('Something goes wrong'), 'flash_error'); } }else { - $this->Session->setFlash($imageName['error'], 'flash_error'); + $this->Session->setFlash($imageName['error'], 'flash_error'); } } @@ -99,7 +99,7 @@ public function edit($id = null) { $params['recursive'] = 1; $params['contain']['Classe'] = array(); $params['contain']['Dungeon'] = array(); - $params['contain']['Race'] = array(); + $params['contain']['Race'] = array(); $params['conditions']['Game.id'] = $id; if(!$game = $this->Game->find('first', $params)) { $this->Session->setFlash(__('MushRaider is unable to find this game oO'), 'flash_error'); @@ -193,7 +193,7 @@ public function edit($id = null) { $this->Session->setFlash(__('Something goes wrong'), 'flash_error'); } }else { - $this->Session->setFlash($imageName['error'], 'flash_error'); + $this->Session->setFlash($imageName['error'], 'flash_error'); } $game['Game'] = array_merge($game['Game'], $this->request->data['Game']); @@ -209,12 +209,12 @@ public function edit($id = null) { $this->set('racesList', $racesList); - $this->request->data = array_merge($game, $this->request->data); + $this->request->data = array_merge($game, $this->request->data); } public function import() { - App::uses('RaidheadSource', 'Model/Datasource'); - $RaidHead = new RaidheadSource(); + App::uses('RaidplannerDbSource', 'Model/Datasource'); + $RaidHead = new RaidplannerDbSource(); $this->set('gamesList', $RaidHead->gets('list')); } @@ -232,7 +232,7 @@ public function delete($id = null) { $this->Session->setFlash(__('Something goes wrong'), 'flash_error'); } } - + $this->redirect('/admin/games'); } -} \ No newline at end of file +} From a0a98868afd3aea164665d082b6a4873718813e6 Mon Sep 17 00:00:00 2001 From: Erwane Breton Date: Thu, 12 Dec 2019 20:46:30 +0100 Subject: [PATCH 2/6] add timeout to mushraider version check --- app/Plugin/Admin/Controller/AdminAppController.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/Plugin/Admin/Controller/AdminAppController.php b/app/Plugin/Admin/Controller/AdminAppController.php index 7539c90..69611ee 100644 --- a/app/Plugin/Admin/Controller/AdminAppController.php +++ b/app/Plugin/Admin/Controller/AdminAppController.php @@ -41,14 +41,17 @@ private function checkUpdate() { $mushraider['date'] = '0000-00-00'; } $jsonUrl = 'http://medias.mushraider.com/version.json'; - $HttpSocket = new HttpSocket(); - $json = $HttpSocket->get($jsonUrl); - $lastVersion = json_decode($json->body); + $HttpSocket = new HttpSocket(['timeout' => 1]); + $response = $HttpSocket->get($jsonUrl); + if (empty($response->body)) { + return; + } + $lastVersion = json_decode($response->body); // Check if version is different - // Be sure the server is newer than the current app + // Be sure the server is newer than the current app if(($mushraider['version'] != $lastVersion->version && $mushraider['date'] < $lastVersion->date) || ($mushraider['version'] == $lastVersion->version && $mushraider['date'] < $lastVersion->date)) { $updateMsg = __('MushRaider %s is available! Please update now', $lastVersion->version); $this->set('updateAvailable', $updateMsg); } } -} \ No newline at end of file +} From 22ba1d199dc70701772e572f328cf2a65d137c3e Mon Sep 17 00:00:00 2001 From: Erwane Breton Date: Thu, 12 Dec 2019 21:50:12 +0100 Subject: [PATCH 3/6] RaidplannerDbSource call new Url --- app/Model/Datasource/RaidplannerDbSource.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/Model/Datasource/RaidplannerDbSource.php b/app/Model/Datasource/RaidplannerDbSource.php index 5212f19..9161a19 100644 --- a/app/Model/Datasource/RaidplannerDbSource.php +++ b/app/Model/Datasource/RaidplannerDbSource.php @@ -14,7 +14,7 @@ class RaidplannerDbSource extends DataSource { public $config = array( - 'baseUrl' => 'https://api.raidhead.com/', + 'baseUrl' => 'https://db.raidplanner.org/', 'langs' => array('eng', 'fra') ); @@ -36,6 +36,7 @@ public function __construct() { private function _get($uri) { $client = new HttpSocket(array( + 'timeout' => 5, 'request' => array( 'redirect' => 2, ), @@ -61,7 +62,7 @@ private function _get($uri) } public function gets($type = 'all') { - $games = $this->_get('/games/index.json'); + $games = $this->_get('/games.json'); if($type == 'list') { $list = array(); @@ -76,10 +77,6 @@ public function gets($type = 'all') { } public function get($slug) { - return $this->_get('/games/get/' . $slug . '.json'); - } - - public function serverStatus($slug) { - return $this->_get('/server_status/get/' . $slug . '.json'); + return $this->_get('/game/' . $slug . '.json'); } } From 2b1deadf545b85cd2a9cc8aab7cb7567ff95ca87 Mon Sep 17 00:00:00 2001 From: Erwane Breton Date: Thu, 12 Dec 2019 21:51:00 +0100 Subject: [PATCH 4/6] Import game from RaidplannerDb --- app/Plugin/Admin/Controller/AjaxController.php | 10 +++++----- app/Plugin/Admin/Controller/GamesController.php | 4 ++-- app/Plugin/Admin/View/Games/import.ctp | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/Plugin/Admin/Controller/AjaxController.php b/app/Plugin/Admin/Controller/AjaxController.php index c30664e..fd19246 100644 --- a/app/Plugin/Admin/Controller/AjaxController.php +++ b/app/Plugin/Admin/Controller/AjaxController.php @@ -48,8 +48,8 @@ public function importGame() { $this->Session->write('ajaxProgress', 10); App::uses('RaidplannerDbSource', 'Model/Datasource'); - $RaidHead = new RaidplannerDbSource(); - $game = $RaidHead->get($slug); + $source = new RaidplannerDbSource(); + $game = $source->get($slug); // Check API error if($game['error']) { @@ -71,7 +71,7 @@ public function importGame() { $toSave['slug'] = $game['game']['short']; $toSave['logo'] = $game['game']['icon_64']; $toSave['import_slug'] = $game['game']['short']; - $toSave['import_modified'] = $game['lastupdate']; + $toSave['import_modified'] = strtotime($game['lastupdate']); if(!$gameId = $GameModel->__add($toSave)) { $jsonMessage['type'] = 'important'; $jsonMessage['msg'] = __('Save failed : An error occur while saving the game'); @@ -168,8 +168,8 @@ public function checkUpdates() { $GameModel = new Game(); App::uses('RaidplannerDbSource', 'Model/Datasource'); - $RaidHead = new RaidplannerDbSource(); - $apiGames = $RaidHead->gets(); + $source = new RaidplannerDbSource(); + $apiGames = $source->gets(); $params = array(); $params['recursive'] = -1; diff --git a/app/Plugin/Admin/Controller/GamesController.php b/app/Plugin/Admin/Controller/GamesController.php index b4f8a7e..b4b3ca9 100644 --- a/app/Plugin/Admin/Controller/GamesController.php +++ b/app/Plugin/Admin/Controller/GamesController.php @@ -214,8 +214,8 @@ public function edit($id = null) { public function import() { App::uses('RaidplannerDbSource', 'Model/Datasource'); - $RaidHead = new RaidplannerDbSource(); - $this->set('gamesList', $RaidHead->gets('list')); + $source = new RaidplannerDbSource(); + $this->set('gamesList', $source->gets('list')); } public function delete($id = null) { diff --git a/app/Plugin/Admin/View/Games/import.ctp b/app/Plugin/Admin/View/Games/import.ctp index 637bb8b..c4be110 100644 --- a/app/Plugin/Admin/View/Games/import.ctp +++ b/app/Plugin/Admin/View/Games/import.ctp @@ -6,8 +6,8 @@

-

-

+

+

@@ -25,4 +25,4 @@
- \ No newline at end of file + From a3a76fc8dd72bde11c06cc81598d081098212799 Mon Sep 17 00:00:00 2001 From: Erwane Breton Date: Thu, 12 Dec 2019 22:00:48 +0100 Subject: [PATCH 5/6] upgrade to cake 2.10.19 --- app/Controller/AppController.php | 6 +- lib/Cake/Cache/Cache.php | 24 +- lib/Cake/Cache/CacheEngine.php | 12 +- lib/Cake/Cache/Engine/ApcEngine.php | 10 +- lib/Cake/Cache/Engine/FileEngine.php | 20 +- lib/Cake/Cache/Engine/MemcacheEngine.php | 10 +- lib/Cake/Cache/Engine/MemcachedEngine.php | 10 +- lib/Cake/Cache/Engine/RedisEngine.php | 12 +- lib/Cake/Cache/Engine/WincacheEngine.php | 10 +- lib/Cake/Cache/Engine/XcacheEngine.php | 10 +- lib/Cake/Config/config.php | 10 +- lib/Cake/Config/routes.php | 12 +- .../Config/unicode/casefolding/0080_00ff.php | 10 +- .../Config/unicode/casefolding/0100_017f.php | 10 +- .../Config/unicode/casefolding/0180_024F.php | 10 +- .../Config/unicode/casefolding/0250_02af.php | 10 +- .../Config/unicode/casefolding/0370_03ff.php | 10 +- .../Config/unicode/casefolding/0400_04ff.php | 10 +- .../Config/unicode/casefolding/0500_052f.php | 10 +- .../Config/unicode/casefolding/0530_058f.php | 10 +- .../Config/unicode/casefolding/1e00_1eff.php | 10 +- .../Config/unicode/casefolding/1f00_1fff.php | 10 +- .../Config/unicode/casefolding/2100_214f.php | 10 +- .../Config/unicode/casefolding/2150_218f.php | 10 +- .../Config/unicode/casefolding/2460_24ff.php | 10 +- .../Config/unicode/casefolding/2c00_2c5f.php | 10 +- .../Config/unicode/casefolding/2c60_2c7f.php | 10 +- .../Config/unicode/casefolding/2c80_2cff.php | 10 +- .../Config/unicode/casefolding/ff00_ffef.php | 10 +- lib/Cake/Configure/ConfigReaderInterface.php | 10 +- lib/Cake/Configure/IniReader.php | 14 +- lib/Cake/Configure/PhpReader.php | 12 +- lib/Cake/Console/Command/AclShell.php | 12 +- lib/Cake/Console/Command/ApiShell.php | 10 +- lib/Cake/Console/Command/AppShell.php | 10 +- lib/Cake/Console/Command/BakeShell.php | 12 +- lib/Cake/Console/Command/CommandListShell.php | 11 +- lib/Cake/Console/Command/CompletionShell.php | 10 +- lib/Cake/Console/Command/ConsoleShell.php | 12 +- lib/Cake/Console/Command/I18nShell.php | 10 +- lib/Cake/Console/Command/SchemaShell.php | 14 +- lib/Cake/Console/Command/ServerShell.php | 12 +- lib/Cake/Console/Command/Task/BakeTask.php | 10 +- lib/Cake/Console/Command/Task/CommandTask.php | 10 +- .../Console/Command/Task/ControllerTask.php | 16 +- .../Console/Command/Task/DbConfigTask.php | 12 +- lib/Cake/Console/Command/Task/ExtractTask.php | 10 +- lib/Cake/Console/Command/Task/FixtureTask.php | 13 +- lib/Cake/Console/Command/Task/ModelTask.php | 16 +- lib/Cake/Console/Command/Task/PluginTask.php | 12 +- lib/Cake/Console/Command/Task/ProjectTask.php | 16 +- .../Console/Command/Task/TemplateTask.php | 10 +- lib/Cake/Console/Command/Task/TestTask.php | 10 +- lib/Cake/Console/Command/Task/ViewTask.php | 10 +- lib/Cake/Console/Command/TestShell.php | 29 +- lib/Cake/Console/Command/TestsuiteShell.php | 10 +- lib/Cake/Console/Command/UpgradeShell.php | 10 +- lib/Cake/Console/ConsoleErrorHandler.php | 10 +- lib/Cake/Console/ConsoleInput.php | 10 +- lib/Cake/Console/ConsoleInputArgument.php | 12 +- lib/Cake/Console/ConsoleInputOption.php | 17 +- lib/Cake/Console/ConsoleInputSubcommand.php | 10 +- lib/Cake/Console/ConsoleOptionParser.php | 10 +- lib/Cake/Console/ConsoleOutput.php | 10 +- lib/Cake/Console/HelpFormatter.php | 12 +- lib/Cake/Console/Helper/BaseShellHelper.php | 10 +- .../Console/Helper/ProgressShellHelper.php | 10 +- lib/Cake/Console/Helper/TableShellHelper.php | 10 +- lib/Cake/Console/Shell.php | 61 +- lib/Cake/Console/ShellDispatcher.php | 54 +- lib/Cake/Console/TaskCollection.php | 12 +- .../default/actions/controller_actions.ctp | 15 +- .../Templates/default/classes/controller.ctp | 10 +- .../Templates/default/classes/fixture.ctp | 10 +- .../Templates/default/classes/model.ctp | 10 +- .../Templates/default/classes/test.ctp | 10 +- .../Console/Templates/default/views/form.ctp | 10 +- .../Console/Templates/default/views/index.ctp | 10 +- .../Console/Templates/default/views/view.ctp | 10 +- .../Templates/skel/Config/Schema/db_acl.php | 2 +- .../Templates/skel/Config/Schema/db_acl.sql | 4 +- .../Templates/skel/Config/Schema/i18n.php | 10 +- .../Templates/skel/Config/Schema/i18n.sql | 4 +- .../Templates/skel/Config/Schema/sessions.php | 10 +- .../Templates/skel/Config/Schema/sessions.sql | 4 +- .../Console/Templates/skel/Config/acl.ini.php | 2 +- .../Console/Templates/skel/Config/acl.php | 2 +- .../Templates/skel/Config/bootstrap.php | 2 +- .../Console/Templates/skel/Config/core.php | 10 +- .../skel/Config/database.php.default | 8 +- .../Templates/skel/Config/email.php.default | 2 +- .../Console/Templates/skel/Config/routes.php | 2 +- .../skel/Console/Command/AppShell.php | 2 +- lib/Cake/Console/Templates/skel/Console/cake | 10 +- .../Console/Templates/skel/Console/cake.bat | 8 +- .../Console/Templates/skel/Console/cake.php | 8 +- .../skel/Controller/AppController.php | 4 +- .../skel/Controller/PagesController.php | 8 +- .../Console/Templates/skel/Model/AppModel.php | 2 +- .../Templates/skel/Test/Case/AllTestsTest.php | 10 +- .../Templates/skel/View/Elements/empty | 0 .../skel/View/Emails/html/default.ctp | 10 +- .../skel/View/Emails/text/default.ctp | 10 +- .../Templates/skel/View/Errors/error400.ctp | 2 +- .../Templates/skel/View/Errors/error500.ctp | 2 +- .../Templates/skel/View/Helper/AppHelper.php | 2 +- .../skel/View/Layouts/Emails/html/default.ctp | 4 +- .../skel/View/Layouts/Emails/text/default.ctp | 12 +- .../Templates/skel/View/Layouts/ajax.ctp | 2 +- .../Templates/skel/View/Layouts/default.ctp | 6 +- .../Templates/skel/View/Layouts/error.ctp | 6 +- .../Templates/skel/View/Layouts/flash.ctp | 2 +- .../Templates/skel/View/Pages/home.ctp | 34 +- lib/Cake/Console/Templates/skel/index.php | 2 +- .../skel/webroot/css/cake.generic.css | 10 +- .../Console/Templates/skel/webroot/index.php | 10 +- .../Console/Templates/skel/webroot/test.php | 2 +- lib/Cake/Console/cake | 10 +- lib/Cake/Console/cake.bat | 10 +- lib/Cake/Console/cake.php | 10 +- lib/Cake/Controller/CakeErrorController.php | 10 +- lib/Cake/Controller/Component.php | 22 +- .../Controller/Component/Acl/AclInterface.php | 10 +- lib/Cake/Controller/Component/Acl/DbAcl.php | 18 +- lib/Cake/Controller/Component/Acl/IniAcl.php | 12 +- lib/Cake/Controller/Component/Acl/PhpAcl.php | 12 +- .../Controller/Component/AclComponent.php | 12 +- .../Component/Auth/AbstractPasswordHasher.php | 10 +- .../Component/Auth/ActionsAuthorize.php | 10 +- .../Component/Auth/BaseAuthenticate.php | 10 +- .../Component/Auth/BaseAuthorize.php | 10 +- .../Component/Auth/BasicAuthenticate.php | 16 +- .../Component/Auth/BlowfishAuthenticate.php | 10 +- .../Component/Auth/BlowfishPasswordHasher.php | 12 +- .../Component/Auth/ControllerAuthorize.php | 10 +- .../Component/Auth/CrudAuthorize.php | 10 +- .../Component/Auth/DigestAuthenticate.php | 14 +- .../Component/Auth/FormAuthenticate.php | 10 +- .../Component/Auth/SimplePasswordHasher.php | 12 +- .../Controller/Component/AuthComponent.php | 38 +- .../Controller/Component/CookieComponent.php | 92 +- .../Controller/Component/EmailComponent.php | 16 +- .../Controller/Component/FlashComponent.php | 24 +- .../Component/PaginatorComponent.php | 45 +- .../Component/RequestHandlerComponent.php | 27 +- .../Component/SecurityComponent.php | 420 +++++++-- .../Controller/Component/SessionComponent.php | 42 +- lib/Cake/Controller/ComponentCollection.php | 10 +- lib/Cake/Controller/Controller.php | 112 ++- lib/Cake/Controller/Scaffold.php | 12 +- lib/Cake/Core/App.php | 36 +- lib/Cake/Core/CakeObject.php | 12 +- lib/Cake/Core/CakePlugin.php | 76 +- lib/Cake/Core/Configure.php | 31 +- lib/Cake/Core/Object.php | 10 +- lib/Cake/Error/ErrorHandler.php | 10 +- lib/Cake/Error/ExceptionRenderer.php | 10 +- lib/Cake/Error/exceptions.php | 87 +- lib/Cake/Event/CakeEvent.php | 12 +- lib/Cake/Event/CakeEventListener.php | 10 +- lib/Cake/Event/CakeEventManager.php | 11 +- lib/Cake/I18n/I18n.php | 10 +- lib/Cake/I18n/L10n.php | 16 +- lib/Cake/I18n/Multibyte.php | 12 +- lib/Cake/LICENSE.txt | 2 +- lib/Cake/Log/CakeLog.php | 22 +- lib/Cake/Log/CakeLogInterface.php | 10 +- lib/Cake/Log/Engine/BaseLog.php | 8 +- lib/Cake/Log/Engine/ConsoleLog.php | 8 +- lib/Cake/Log/Engine/FileLog.php | 8 +- lib/Cake/Log/Engine/SyslogLog.php | 8 +- lib/Cake/Log/LogEngineCollection.php | 10 +- lib/Cake/Model/AclNode.php | 21 +- lib/Cake/Model/Aco.php | 10 +- lib/Cake/Model/AcoAction.php | 10 +- lib/Cake/Model/Aro.php | 10 +- lib/Cake/Model/Behavior/AclBehavior.php | 14 +- .../Model/Behavior/ContainableBehavior.php | 14 +- lib/Cake/Model/Behavior/TranslateBehavior.php | 143 +++- lib/Cake/Model/Behavior/TreeBehavior.php | 41 +- lib/Cake/Model/BehaviorCollection.php | 14 +- lib/Cake/Model/CakeSchema.php | 105 +-- lib/Cake/Model/ConnectionManager.php | 12 +- lib/Cake/Model/Datasource/CakeSession.php | 57 +- lib/Cake/Model/Datasource/DataSource.php | 12 +- lib/Cake/Model/Datasource/Database/Mysql.php | 38 +- .../Model/Datasource/Database/Postgres.php | 71 +- lib/Cake/Model/Datasource/Database/Sqlite.php | 34 +- .../Model/Datasource/Database/Sqlserver.php | 60 +- lib/Cake/Model/Datasource/DboSource.php | 294 +++++-- .../Model/Datasource/Session/CacheSession.php | 10 +- .../Session/CakeSessionHandlerInterface.php | 10 +- .../Datasource/Session/DatabaseSession.php | 10 +- lib/Cake/Model/I18nModel.php | 10 +- lib/Cake/Model/Model.php | 153 ++-- lib/Cake/Model/ModelBehavior.php | 10 +- lib/Cake/Model/ModelValidator.php | 20 +- lib/Cake/Model/Permission.php | 12 +- .../Model/Validator/CakeValidationRule.php | 12 +- .../Model/Validator/CakeValidationSet.php | 12 +- lib/Cake/Network/CakeRequest.php | 24 +- lib/Cake/Network/CakeResponse.php | 57 +- lib/Cake/Network/CakeSocket.php | 57 +- lib/Cake/Network/Email/AbstractTransport.php | 10 +- lib/Cake/Network/Email/CakeEmail.php | 42 +- lib/Cake/Network/Email/DebugTransport.php | 10 +- lib/Cake/Network/Email/MailTransport.php | 14 +- lib/Cake/Network/Email/SmtpTransport.php | 16 +- lib/Cake/Network/Http/BasicAuthentication.php | 10 +- .../Network/Http/DigestAuthentication.php | 10 +- lib/Cake/Network/Http/HttpResponse.php | 10 +- lib/Cake/Network/Http/HttpSocket.php | 60 +- lib/Cake/Network/Http/HttpSocketResponse.php | 12 +- lib/Cake/Routing/Dispatcher.php | 10 +- lib/Cake/Routing/DispatcherFilter.php | 10 +- lib/Cake/Routing/Filter/AssetDispatcher.php | 10 +- lib/Cake/Routing/Filter/CacheDispatcher.php | 10 +- lib/Cake/Routing/Route/CakeRoute.php | 10 +- lib/Cake/Routing/Route/PluginShortRoute.php | 10 +- lib/Cake/Routing/Route/RedirectRoute.php | 10 +- lib/Cake/Routing/Router.php | 43 +- lib/Cake/Test/Case/AllBehaviorsTest.php | 10 +- lib/Cake/Test/Case/AllCacheTest.php | 10 +- lib/Cake/Test/Case/AllComponentsTest.php | 10 +- lib/Cake/Test/Case/AllConfigureTest.php | 10 +- lib/Cake/Test/Case/AllConsoleTest.php | 10 +- lib/Cake/Test/Case/AllControllerTest.php | 11 +- lib/Cake/Test/Case/AllCoreTest.php | 10 +- lib/Cake/Test/Case/AllDatabaseTest.php | 10 +- lib/Cake/Test/Case/AllDbRelatedTest.php | 10 +- lib/Cake/Test/Case/AllErrorTest.php | 10 +- lib/Cake/Test/Case/AllEventTest.php | 10 +- lib/Cake/Test/Case/AllHelpersTest.php | 10 +- lib/Cake/Test/Case/AllI18nTest.php | 10 +- lib/Cake/Test/Case/AllLogTest.php | 10 +- lib/Cake/Test/Case/AllNetworkTest.php | 10 +- lib/Cake/Test/Case/AllRoutingTest.php | 10 +- lib/Cake/Test/Case/AllTestSuiteTest.php | 10 +- lib/Cake/Test/Case/AllTestsTest.php | 10 +- lib/Cake/Test/Case/AllUtilityTest.php | 10 +- lib/Cake/Test/Case/AllViewTest.php | 10 +- lib/Cake/Test/Case/BasicsTest.php | 10 +- lib/Cake/Test/Case/Cache/CacheTest.php | 71 +- .../Test/Case/Cache/Engine/ApcEngineTest.php | 10 +- .../Test/Case/Cache/Engine/FileEngineTest.php | 10 +- .../Case/Cache/Engine/MemcacheEngineTest.php | 10 +- .../Case/Cache/Engine/MemcachedEngineTest.php | 10 +- .../Case/Cache/Engine/RedisEngineTest.php | 10 +- .../Case/Cache/Engine/WincacheEngineTest.php | 10 +- .../Case/Cache/Engine/XcacheEngineTest.php | 10 +- .../Test/Case/Configure/IniReaderTest.php | 10 +- .../Test/Case/Configure/PhpReaderTest.php | 10 +- .../Test/Case/Console/AllConsoleLibsTest.php | 10 +- lib/Cake/Test/Case/Console/AllConsoleTest.php | 10 +- lib/Cake/Test/Case/Console/AllShellsTest.php | 10 +- lib/Cake/Test/Case/Console/AllTasksTest.php | 10 +- .../Case/Console/Command/AclShellTest.php | 10 +- .../Case/Console/Command/ApiShellTest.php | 10 +- .../Case/Console/Command/BakeShellTest.php | 10 +- .../Console/Command/CommandListShellTest.php | 10 +- .../Console/Command/CompletionShellTest.php | 10 +- .../Case/Console/Command/SchemaShellTest.php | 16 +- .../Console/Command/Task/CommandTaskTest.php | 10 +- .../Command/Task/ControllerTaskTest.php | 10 +- .../Console/Command/Task/DbConfigTaskTest.php | 14 +- .../Console/Command/Task/ExtractTaskTest.php | 83 +- .../Console/Command/Task/FixtureTaskTest.php | 17 +- .../Console/Command/Task/ModelTaskTest.php | 20 +- .../Console/Command/Task/PluginTaskTest.php | 10 +- .../Console/Command/Task/ProjectTaskTest.php | 12 +- .../Console/Command/Task/TemplateTaskTest.php | 10 +- .../Console/Command/Task/TestTaskTest.php | 10 +- .../Console/Command/Task/ViewTaskTest.php | 10 +- .../Case/Console/Command/TestShellTest.php | 10 +- .../Case/Console/ConsoleErrorHandlerTest.php | 10 +- .../Case/Console/ConsoleOptionParserTest.php | 10 +- .../Test/Case/Console/ConsoleOutputTest.php | 10 +- .../Test/Case/Console/HelpFormatterTest.php | 37 +- .../Helper/ProgressShellHelperTest.php | 10 +- .../Console/Helper/TableShellHelperTest.php | 10 +- .../Test/Case/Console/ShellDispatcherTest.php | 48 +- lib/Cake/Test/Case/Console/ShellTest.php | 52 +- .../Test/Case/Console/TaskCollectionTest.php | 10 +- .../Controller/ApplicationControllerTest.php | 104 +++ .../Controller/Component/Acl/DbAclTest.php | 10 +- .../Controller/Component/Acl/IniAclTest.php | 10 +- .../Controller/Component/Acl/PhpAclTest.php | 10 +- .../Controller/Component/AclComponentTest.php | 10 +- .../Component/Auth/ActionsAuthorizeTest.php | 10 +- .../Component/Auth/BasicAuthenticateTest.php | 34 +- .../Auth/BlowfishAuthenticateTest.php | 10 +- .../Auth/ControllerAuthorizeTest.php | 17 +- .../Component/Auth/CrudAuthorizeTest.php | 10 +- .../Component/Auth/DigestAuthenticateTest.php | 10 +- .../Component/Auth/FormAuthenticateTest.php | 10 +- .../Component/AuthComponentTest.php | 76 +- .../Component/CookieComponentTest.php | 176 +++- .../Component/EmailComponentTest.php | 18 +- .../Component/FlashComponentTest.php | 143 +++- .../Component/PaginatorComponentTest.php | 260 +++++- .../Component/RequestHandlerComponentTest.php | 10 +- .../Component/SecurityComponentTest.php | 669 +++++++++++++-- .../Component/SessionComponentTest.php | 19 +- .../Controller/ComponentCollectionTest.php | 10 +- .../Test/Case/Controller/ComponentTest.php | 10 +- .../Controller/ControllerMergeVarsTest.php | 10 +- .../Test/Case/Controller/ControllerTest.php | 96 ++- .../Case/Controller/PagesControllerTest.php | 27 +- .../Test/Case/Controller/ScaffoldTest.php | 12 +- lib/Cake/Test/Case/Core/AppTest.php | 10 +- lib/Cake/Test/Case/Core/CakeObjectTest.php | 23 +- lib/Cake/Test/Case/Core/CakePluginTest.php | 10 +- lib/Cake/Test/Case/Core/ConfigureTest.php | 16 +- lib/Cake/Test/Case/Core/ObjectTest.php | 679 --------------- lib/Cake/Test/Case/Error/ErrorHandlerTest.php | 10 +- .../Test/Case/Error/ExceptionRendererTest.php | 10 +- .../Test/Case/Event/CakeEventManagerTest.php | 10 +- lib/Cake/Test/Case/Event/CakeEventTest.php | 10 +- lib/Cake/Test/Case/I18n/I18nTest.php | 11 +- lib/Cake/Test/Case/I18n/L10nTest.php | 10 +- lib/Cake/Test/Case/I18n/MultibyteTest.php | 59 +- lib/Cake/Test/Case/Log/CakeLogTest.php | 10 +- .../Test/Case/Log/Engine/ConsoleLogTest.php | 10 +- lib/Cake/Test/Case/Log/Engine/FileLogTest.php | 10 +- .../Test/Case/Log/Engine/SyslogLogTest.php | 10 +- .../Test/Case/Log/LogEngineCollectionTest.php | 10 +- lib/Cake/Test/Case/Model/AclNodeTest.php | 10 +- .../Case/Model/Behavior/AclBehaviorTest.php | 10 +- .../Behavior/ContainableBehaviorTest.php | 10 +- .../Model/Behavior/TranslateBehaviorTest.php | 209 ++++- .../Model/Behavior/TreeBehaviorAfterTest.php | 10 +- .../Model/Behavior/TreeBehaviorNumberTest.php | 10 +- .../Model/Behavior/TreeBehaviorScopedTest.php | 10 +- .../Case/Model/Behavior/TreeBehaviorTest.php | 10 +- .../Model/Behavior/TreeBehaviorUuidTest.php | 10 +- .../Case/Model/BehaviorCollectionTest.php | 10 +- lib/Cake/Test/Case/Model/CakeSchemaTest.php | 88 +- .../Test/Case/Model/ConnectionManagerTest.php | 12 +- .../Case/Model/Datasource/CakeSessionTest.php | 10 +- .../Case/Model/Datasource/DataSourceTest.php | 10 +- .../Model/Datasource/Database/MysqlTest.php | 109 ++- .../Datasource/Database/PostgresTest.php | 36 +- .../Model/Datasource/Database/SqliteTest.php | 71 +- .../Datasource/Database/SqlserverTest.php | 166 +++- .../Case/Model/Datasource/DboSourceTest.php | 385 ++++++++- .../Datasource/Session/CacheSessionTest.php | 10 +- .../Session/DatabaseSessionTest.php | 10 +- .../Case/Model/ModelCrossSchemaHabtmTest.php | 10 +- lib/Cake/Test/Case/Model/ModelDeleteTest.php | 10 +- .../Test/Case/Model/ModelIntegrationTest.php | 10 +- lib/Cake/Test/Case/Model/ModelReadTest.php | 435 ++++++++-- lib/Cake/Test/Case/Model/ModelTest.php | 10 +- lib/Cake/Test/Case/Model/ModelTestBase.php | 11 +- .../Test/Case/Model/ModelValidationTest.php | 20 +- lib/Cake/Test/Case/Model/ModelWriteTest.php | 41 +- .../Validator/CakeValidationRuleTest.php | 10 +- .../Model/Validator/CakeValidationSetTest.php | 10 +- lib/Cake/Test/Case/Model/models.php | 21 +- .../Test/Case/Network/CakeRequestTest.php | 36 +- .../Test/Case/Network/CakeResponseTest.php | 10 +- lib/Cake/Test/Case/Network/CakeSocketTest.php | 35 +- .../Test/Case/Network/Email/CakeEmailTest.php | 142 ++- .../Case/Network/Email/DebugTransportTest.php | 10 +- .../Case/Network/Email/MailTransportTest.php | 10 +- .../Case/Network/Email/SmtpTransportTest.php | 186 ++-- .../Network/Http/BasicAuthenticationTest.php | 10 +- .../Network/Http/DigestAuthenticationTest.php | 10 +- .../Case/Network/Http/HttpResponseTest.php | 10 +- .../Test/Case/Network/Http/HttpSocketTest.php | 16 +- lib/Cake/Test/Case/Routing/DispatcherTest.php | 16 +- .../Routing/Filter/AssetDispatcherTest.php | 17 +- .../Test/Case/Routing/Route/CakeRouteTest.php | 10 +- .../Routing/Route/PluginShortRouteTest.php | 10 +- .../Case/Routing/Route/RedirectRouteTest.php | 10 +- lib/Cake/Test/Case/Routing/RouterTest.php | 78 +- .../Test/Case/TestSuite/CakeTestCaseTest.php | 13 +- .../Case/TestSuite/CakeTestFixtureTest.php | 11 +- .../Test/Case/TestSuite/CakeTestSuiteTest.php | 10 +- .../Case/TestSuite/ControllerTestCaseTest.php | 159 +++- .../Fixture/CakeFixtureManagerTest.php | 10 +- .../Case/TestSuite/HtmlCoverageReportTest.php | 10 +- .../TestSuite/Stub/ConsoleOutputStubTest.php | 10 +- lib/Cake/Test/Case/Utility/CakeNumberTest.php | 10 +- lib/Cake/Test/Case/Utility/CakeTextTest.php | 10 +- lib/Cake/Test/Case/Utility/CakeTimeTest.php | 116 ++- .../Test/Case/Utility/ClassRegistryTest.php | 41 +- lib/Cake/Test/Case/Utility/DebuggerTest.php | 28 +- lib/Cake/Test/Case/Utility/FileTest.php | 10 +- lib/Cake/Test/Case/Utility/FolderTest.php | 10 +- lib/Cake/Test/Case/Utility/HashTest.php | 151 +++- lib/Cake/Test/Case/Utility/InflectorTest.php | 10 +- .../Case/Utility/ObjectCollectionTest.php | 10 +- lib/Cake/Test/Case/Utility/SanitizeTest.php | 10 +- lib/Cake/Test/Case/Utility/SecurityTest.php | 83 +- lib/Cake/Test/Case/Utility/SetTest.php | 10 +- lib/Cake/Test/Case/Utility/StringTest.php | 806 ------------------ lib/Cake/Test/Case/Utility/ValidationTest.php | 68 +- lib/Cake/Test/Case/Utility/XmlTest.php | 91 +- .../Test/Case/View/Helper/CacheHelperTest.php | 10 +- .../Test/Case/View/Helper/FlashHelperTest.php | 69 +- .../Test/Case/View/Helper/FormHelperTest.php | 667 ++++++++++++++- .../Test/Case/View/Helper/HtmlHelperTest.php | 80 +- .../View/Helper/JqueryEngineHelperTest.php | 10 +- .../Test/Case/View/Helper/JsHelperTest.php | 10 +- .../View/Helper/MootoolsEngineHelperTest.php | 10 +- .../Case/View/Helper/NumberHelperTest.php | 10 +- .../Case/View/Helper/PaginatorHelperTest.php | 125 ++- .../View/Helper/PrototypeEngineHelperTest.php | 10 +- .../Test/Case/View/Helper/RssHelperTest.php | 10 +- .../Case/View/Helper/SessionHelperTest.php | 57 +- .../Test/Case/View/Helper/TextHelperTest.php | 10 +- .../Test/Case/View/Helper/TimeHelperTest.php | 10 +- .../Test/Case/View/HelperCollectionTest.php | 10 +- lib/Cake/Test/Case/View/HelperTest.php | 10 +- lib/Cake/Test/Case/View/JsonViewTest.php | 10 +- lib/Cake/Test/Case/View/MediaViewTest.php | 10 +- lib/Cake/Test/Case/View/ScaffoldViewTest.php | 10 +- lib/Cake/Test/Case/View/ThemeViewTest.php | 36 +- lib/Cake/Test/Case/View/ViewTest.php | 87 +- lib/Cake/Test/Case/View/XmlViewTest.php | 10 +- lib/Cake/Test/Fixture/AccountFixture.php | 10 +- lib/Cake/Test/Fixture/AcoActionFixture.php | 10 +- lib/Cake/Test/Fixture/AcoFixture.php | 10 +- lib/Cake/Test/Fixture/AcoTwoFixture.php | 10 +- lib/Cake/Test/Fixture/AdFixture.php | 6 +- .../Test/Fixture/AdvertisementFixture.php | 10 +- lib/Cake/Test/Fixture/AfterTreeFixture.php | 6 +- .../Test/Fixture/AnotherArticleFixture.php | 10 +- lib/Cake/Test/Fixture/AppleFixture.php | 10 +- lib/Cake/Test/Fixture/ArmorFixture.php | 10 +- lib/Cake/Test/Fixture/ArmorsPlayerFixture.php | 10 +- lib/Cake/Test/Fixture/AroFixture.php | 10 +- lib/Cake/Test/Fixture/AroTwoFixture.php | 10 +- lib/Cake/Test/Fixture/ArosAcoFixture.php | 10 +- lib/Cake/Test/Fixture/ArosAcoTwoFixture.php | 10 +- .../Test/Fixture/ArticleFeaturedFixture.php | 10 +- .../Fixture/ArticleFeaturedsTagsFixture.php | 10 +- lib/Cake/Test/Fixture/ArticleFixture.php | 10 +- lib/Cake/Test/Fixture/ArticlesTagFixture.php | 10 +- lib/Cake/Test/Fixture/AttachmentFixture.php | 10 +- .../Fixture/AuthUserCustomFieldFixture.php | 10 +- lib/Cake/Test/Fixture/AuthUserFixture.php | 10 +- lib/Cake/Test/Fixture/AuthorFixture.php | 10 +- lib/Cake/Test/Fixture/BakeArticleFixture.php | 10 +- .../Fixture/BakeArticlesBakeTagFixture.php | 10 +- lib/Cake/Test/Fixture/BakeCommentFixture.php | 10 +- lib/Cake/Test/Fixture/BakeTagFixture.php | 10 +- lib/Cake/Test/Fixture/BasketFixture.php | 10 +- lib/Cake/Test/Fixture/BidFixture.php | 10 +- lib/Cake/Test/Fixture/BiddingFixture.php | 10 +- .../Test/Fixture/BiddingMessageFixture.php | 10 +- lib/Cake/Test/Fixture/BinaryTestFixture.php | 10 +- lib/Cake/Test/Fixture/BookFixture.php | 10 +- .../Test/Fixture/CacheTestModelFixture.php | 10 +- lib/Cake/Test/Fixture/CakeSessionFixture.php | 10 +- lib/Cake/Test/Fixture/CallbackFixture.php | 10 +- lib/Cake/Test/Fixture/CampaignFixture.php | 6 +- lib/Cake/Test/Fixture/CategoryFixture.php | 10 +- .../Test/Fixture/CategoryThreadFixture.php | 10 +- lib/Cake/Test/Fixture/CdFixture.php | 10 +- lib/Cake/Test/Fixture/CommentFixture.php | 10 +- .../Test/Fixture/ContentAccountFixture.php | 10 +- lib/Cake/Test/Fixture/ContentFixture.php | 10 +- .../Test/Fixture/CounterCachePostFixture.php | 10 +- ...rCachePostNonstandardPrimaryKeyFixture.php | 10 +- .../Test/Fixture/CounterCacheUserFixture.php | 10 +- ...rCacheUserNonstandardPrimaryKeyFixture.php | 10 +- lib/Cake/Test/Fixture/DataTestFixture.php | 10 +- lib/Cake/Test/Fixture/DatatypeFixture.php | 23 +- lib/Cake/Test/Fixture/DependencyFixture.php | 10 +- lib/Cake/Test/Fixture/DeviceFixture.php | 10 +- .../Fixture/DeviceTypeCategoryFixture.php | 10 +- lib/Cake/Test/Fixture/DeviceTypeFixture.php | 10 +- .../Test/Fixture/DocumentDirectoryFixture.php | 10 +- lib/Cake/Test/Fixture/DocumentFixture.php | 10 +- lib/Cake/Test/Fixture/DomainFixture.php | 10 +- lib/Cake/Test/Fixture/DomainsSiteFixture.php | 10 +- .../Fixture/ExteriorTypeCategoryFixture.php | 10 +- lib/Cake/Test/Fixture/FeatureSetFixture.php | 10 +- lib/Cake/Test/Fixture/FeaturedFixture.php | 10 +- lib/Cake/Test/Fixture/FilmFileFixture.php | 10 +- lib/Cake/Test/Fixture/FlagTreeFixture.php | 10 +- lib/Cake/Test/Fixture/FruitFixture.php | 10 +- .../Test/Fixture/FruitsUuidTagFixture.php | 10 +- .../Test/Fixture/GroupUpdateAllFixture.php | 10 +- lib/Cake/Test/Fixture/GuildFixture.php | 10 +- lib/Cake/Test/Fixture/GuildsPlayerFixture.php | 10 +- lib/Cake/Test/Fixture/HomeFixture.php | 10 +- lib/Cake/Test/Fixture/ImageFixture.php | 10 +- lib/Cake/Test/Fixture/InnoFixture.php | 10 +- lib/Cake/Test/Fixture/ItemFixture.php | 10 +- .../Test/Fixture/ItemsPortfolioFixture.php | 10 +- lib/Cake/Test/Fixture/JoinABFixture.php | 10 +- lib/Cake/Test/Fixture/JoinACFixture.php | 10 +- lib/Cake/Test/Fixture/JoinAFixture.php | 10 +- lib/Cake/Test/Fixture/JoinBFixture.php | 10 +- lib/Cake/Test/Fixture/JoinCFixture.php | 10 +- lib/Cake/Test/Fixture/JoinThingFixture.php | 10 +- lib/Cake/Test/Fixture/MessageFixture.php | 10 +- .../Fixture/MyCategoriesMyProductsFixture.php | 10 +- .../Fixture/MyCategoriesMyUsersFixture.php | 10 +- lib/Cake/Test/Fixture/MyCategoryFixture.php | 10 +- lib/Cake/Test/Fixture/MyProductFixture.php | 10 +- lib/Cake/Test/Fixture/MyUserFixture.php | 10 +- lib/Cake/Test/Fixture/NodeFixture.php | 10 +- lib/Cake/Test/Fixture/NumberTreeFixture.php | 10 +- .../Test/Fixture/NumberTreeTwoFixture.php | 10 +- .../Test/Fixture/NumericArticleFixture.php | 10 +- .../Test/Fixture/OverallFavoriteFixture.php | 10 +- lib/Cake/Test/Fixture/PersonFixture.php | 10 +- lib/Cake/Test/Fixture/PlayerFixture.php | 10 +- lib/Cake/Test/Fixture/PortfolioFixture.php | 10 +- lib/Cake/Test/Fixture/PostFixture.php | 10 +- lib/Cake/Test/Fixture/PostsTagFixture.php | 10 +- lib/Cake/Test/Fixture/PrefixTestFixture.php | 10 +- lib/Cake/Test/Fixture/PrimaryModelFixture.php | 10 +- lib/Cake/Test/Fixture/ProductFixture.php | 10 +- .../Test/Fixture/ProductUpdateAllFixture.php | 10 +- lib/Cake/Test/Fixture/ProjectFixture.php | 10 +- lib/Cake/Test/Fixture/SampleFixture.php | 10 +- .../Test/Fixture/SecondaryModelFixture.php | 10 +- lib/Cake/Test/Fixture/SessionFixture.php | 10 +- lib/Cake/Test/Fixture/SiteFixture.php | 10 +- .../Test/Fixture/SomethingElseFixture.php | 10 +- lib/Cake/Test/Fixture/SomethingFixture.php | 10 +- lib/Cake/Test/Fixture/StoriesTagFixture.php | 10 +- lib/Cake/Test/Fixture/StoryFixture.php | 10 +- lib/Cake/Test/Fixture/SyfileFixture.php | 10 +- lib/Cake/Test/Fixture/TagFixture.php | 10 +- .../Test/Fixture/TestPluginArticleFixture.php | 10 +- .../Test/Fixture/TestPluginCommentFixture.php | 10 +- .../Test/Fixture/ThePaperMonkiesFixture.php | 10 +- lib/Cake/Test/Fixture/ThreadFixture.php | 10 +- .../Test/Fixture/TranslateArticleFixture.php | 10 +- lib/Cake/Test/Fixture/TranslateFixture.php | 10 +- .../Test/Fixture/TranslateTableFixture.php | 10 +- .../Fixture/TranslateWithPrefixFixture.php | 10 +- .../Test/Fixture/TranslatedArticleFixture.php | 10 +- .../Test/Fixture/TranslatedItemFixture.php | 10 +- .../Fixture/UnconventionalTreeFixture.php | 10 +- .../Test/Fixture/UnderscoreFieldFixture.php | 10 +- lib/Cake/Test/Fixture/UnsignedFixture.php | 14 +- lib/Cake/Test/Fixture/UserFixture.php | 10 +- lib/Cake/Test/Fixture/UuidFixture.php | 10 +- lib/Cake/Test/Fixture/UuidNativeFixture.php | 10 +- .../Test/Fixture/UuidNativeTagFixture.php | 10 +- .../Test/Fixture/UuidNativeTreeFixture.php | 10 +- lib/Cake/Test/Fixture/UuidTagFixture.php | 10 +- lib/Cake/Test/Fixture/UuidTreeFixture.php | 10 +- lib/Cake/Test/Fixture/UuiditemFixture.php | 10 +- .../Fixture/UuiditemsUuidportfolioFixture.php | 10 +- ...UuiditemsUuidportfolioNumericidFixture.php | 10 +- .../Test/Fixture/UuidnativeitemFixture.php | 10 +- ...dnativeitemsUuidnativeportfolioFixture.php | 10 +- ...emsUuidnativeportfolioNumericidFixture.php | 10 +- .../Fixture/UuidnativeportfolioFixture.php | 10 +- .../Test/Fixture/UuidportfolioFixture.php | 10 +- lib/Cake/Test/Fixture/rss.xml | 12 +- .../Controller/ActionsUsingSessions.ctp | 5 +- .../Controller/ActionsWithNoSessions.ctp | 5 +- lib/Cake/Test/test_app/Config/acl.ini | 10 +- lib/Cake/Test/test_app/Config/acl.ini.php | 10 +- lib/Cake/Test/test_app/Config/acl.php | 10 +- lib/Cake/Test/test_app/Config/routes.php | 10 +- .../test_app/Console/Command/SampleShell.php | 10 +- .../test_app/Controller/AppController.php | 12 +- .../test_app/Controller/PagesController.php | 12 +- .../Controller/TestsAppsController.php | 12 +- .../Controller/TestsAppsPostsController.php | 10 +- .../Lib/Cache/Engine/TestAppCacheEngine.php | 10 +- lib/Cake/Test/test_app/Lib/Library.php | 10 +- .../test_app/Lib/Log/Engine/TestAppLog.php | 10 +- .../test_app/Lib/Utility/TestUtilityClass.php | 10 +- lib/Cake/Test/test_app/Model/AppModel.php | 10 +- .../Behavior/PersisterOneBehaviorBehavior.php | 10 +- .../Behavior/PersisterTwoBehaviorBehavior.php | 10 +- lib/Cake/Test/test_app/Model/Comment.php | 10 +- lib/Cake/Test/test_app/Model/Extract.php | 10 +- lib/Cake/Test/test_app/Model/PersisterOne.php | 10 +- lib/Cake/Test/test_app/Model/PersisterTwo.php | 10 +- lib/Cake/Test/test_app/Model/Post.php | 10 +- .../TestPlugin/Config/Schema/schema.php | 10 +- .../Plugin/TestPlugin/Config/acl.ini.php | 10 +- .../Plugin/TestPlugin/Config/load.php | 10 +- .../Plugin/TestPlugin/Config/more.load.php | 10 +- .../Console/Command/ExampleShell.php | 10 +- .../Console/Command/Task/OtherTaskTask.php | 10 +- .../Console/Command/TestPluginShell.php | 10 +- .../Controller/Component/OtherComponent.php | 10 +- .../Controller/Component/PluginsComponent.php | 10 +- .../Component/TestPluginComponent.php | 10 +- .../Component/TestPluginEmailComponent.php | 10 + .../Component/TestPluginOtherComponent.php | 10 +- .../Controller/TestPluginAppController.php | 10 +- .../Controller/TestPluginController.php | 10 +- .../TestPlugin/Controller/TestsController.php | 10 +- .../Cache/Engine/TestPluginCacheEngine.php | 10 +- .../Lib/Custom/Package/CustomLibClass.php | 10 +- .../Lib/Error/TestPluginExceptionRenderer.php | 10 +- .../Lib/Log/Engine/TestPluginLog.php | 10 +- .../Routing/Filter/Test2DispatcherFilter.php | 10 +- .../Routing/Filter/TestDispatcherFilter.php | 10 +- .../TestPlugin/Lib/TestPluginLibrary.php | 10 +- .../TestPlugin/Lib/TestPluginOtherLibrary.php | 10 +- .../TestPluginPersisterOneBehavior.php | 10 +- .../TestPluginPersisterTwoBehavior.php | 10 +- .../TestPlugin/Model/TestPluginAppModel.php | 10 +- .../TestPlugin/Model/TestPluginAuthUser.php | 10 +- .../TestPlugin/Model/TestPluginAuthors.php | 10 +- .../TestPlugin/Model/TestPluginComment.php | 10 +- .../TestPlugin/Model/TestPluginPost.php | 10 +- .../Vendor/sample/sample_plugin.php | 10 +- .../Plugin/TestPlugin/Vendor/welcome.php | 10 +- .../View/Helper/OtherHelperHelper.php | 10 +- .../View/Helper/PluggedHelperHelper.php | 10 +- .../Console/Command/ExampleShell.php | 10 +- .../Console/Command/WelcomeShell.php | 10 +- lib/Cake/Test/test_app/Vendor/Test/MyTest.php | 10 +- lib/Cake/Test/test_app/Vendor/Test/hello.php | 10 +- .../sample/configure_test_vendor_sample.php | 10 +- .../test_app/Vendor/somename/some.name.php | 10 +- lib/Cake/Test/test_app/Vendor/welcome.php | 10 +- .../View/Layouts/Emails/html/default.ctp | 2 +- .../View/Layouts/Emails/html/japanese.ctp | 2 +- .../View/Layouts/Emails/text/default.ctp | 2 +- .../View/Layouts/Emails/text/japanese.ctp | 2 +- .../Test/test_app/View/Layouts/default.ctp | 4 +- lib/Cake/Test/test_app/View/Pages/home.ctp | 6 +- .../test_app/View/Posts/test_nocache_tags.ctp | 10 +- lib/Cake/TestSuite/CakeTestCase.php | 169 +++- lib/Cake/TestSuite/CakeTestLoader.php | 10 +- lib/Cake/TestSuite/CakeTestRunner.php | 34 +- lib/Cake/TestSuite/CakeTestSuite.php | 10 +- lib/Cake/TestSuite/CakeTestSuiteCommand.php | 14 +- .../TestSuite/CakeTestSuiteDispatcher.php | 28 +- lib/Cake/TestSuite/ControllerTestCase.php | 55 +- .../TestSuite/Coverage/BaseCoverageReport.php | 10 +- .../TestSuite/Coverage/HtmlCoverageReport.php | 10 +- .../TestSuite/Coverage/TextCoverageReport.php | 10 +- .../TestSuite/Fixture/CakeFixtureManager.php | 16 +- .../TestSuite/Fixture/CakeTestFixture.php | 10 +- lib/Cake/TestSuite/Fixture/CakeTestModel.php | 10 +- .../TestSuite/Reporter/CakeBaseReporter.php | 12 +- .../TestSuite/Reporter/CakeHtmlReporter.php | 45 +- .../TestSuite/Reporter/CakeTextReporter.php | 10 +- lib/Cake/TestSuite/Stub/ConsoleOutputStub.php | 10 +- lib/Cake/TestSuite/templates/footer.php | 12 +- lib/Cake/TestSuite/templates/header.php | 10 +- lib/Cake/TestSuite/templates/menu.php | 10 +- .../templates/missing_connection.php | 10 +- lib/Cake/TestSuite/templates/phpunit.php | 10 +- lib/Cake/TestSuite/templates/xdebug.php | 10 +- lib/Cake/Utility/CakeNumber.php | 30 +- lib/Cake/Utility/CakeText.php | 20 +- lib/Cake/Utility/CakeTime.php | 175 ++-- lib/Cake/Utility/ClassRegistry.php | 14 +- lib/Cake/Utility/Debugger.php | 33 +- lib/Cake/Utility/File.php | 78 +- lib/Cake/Utility/Folder.php | 70 +- lib/Cake/Utility/Hash.php | 133 +-- lib/Cake/Utility/Inflector.php | 30 +- lib/Cake/Utility/ObjectCollection.php | 13 +- lib/Cake/Utility/Sanitize.php | 14 +- lib/Cake/Utility/Security.php | 67 +- lib/Cake/Utility/Set.php | 54 +- lib/Cake/Utility/String.php | 10 +- lib/Cake/Utility/Validation.php | 51 +- lib/Cake/Utility/Xml.php | 23 +- lib/Cake/VERSION.txt | 12 +- .../View/Elements/exception_stack_trace.ctp | 10 +- lib/Cake/View/Elements/sql_dump.ctp | 10 +- lib/Cake/View/Errors/fatal_error.ctp | 10 +- lib/Cake/View/Errors/missing_action.ctp | 10 +- lib/Cake/View/Errors/missing_behavior.ctp | 10 +- lib/Cake/View/Errors/missing_component.ctp | 10 +- lib/Cake/View/Errors/missing_connection.ctp | 10 +- lib/Cake/View/Errors/missing_controller.ctp | 12 +- lib/Cake/View/Errors/missing_database.ctp | 10 +- lib/Cake/View/Errors/missing_datasource.ctp | 10 +- .../View/Errors/missing_datasource_config.ctp | 10 +- lib/Cake/View/Errors/missing_helper.ctp | 10 +- lib/Cake/View/Errors/missing_layout.ctp | 10 +- lib/Cake/View/Errors/missing_plugin.ctp | 10 +- lib/Cake/View/Errors/missing_table.ctp | 10 +- lib/Cake/View/Errors/missing_view.ctp | 10 +- lib/Cake/View/Errors/pdo_error.ctp | 10 +- lib/Cake/View/Errors/private_action.ctp | 10 +- lib/Cake/View/Errors/scaffold_error.ctp | 10 +- lib/Cake/View/Helper.php | 12 +- lib/Cake/View/Helper/CacheHelper.php | 14 +- lib/Cake/View/Helper/FlashHelper.php | 24 +- lib/Cake/View/Helper/FormHelper.php | 122 ++- lib/Cake/View/Helper/HtmlHelper.php | 98 ++- lib/Cake/View/Helper/JqueryEngineHelper.php | 10 +- lib/Cake/View/Helper/JsBaseEngineHelper.php | 10 +- lib/Cake/View/Helper/JsHelper.php | 24 +- lib/Cake/View/Helper/MootoolsEngineHelper.php | 10 +- lib/Cake/View/Helper/NumberHelper.php | 24 +- lib/Cake/View/Helper/PaginatorHelper.php | 78 +- .../View/Helper/PrototypeEngineHelper.php | 10 +- lib/Cake/View/Helper/RssHelper.php | 24 +- lib/Cake/View/Helper/SessionHelper.php | 80 +- lib/Cake/View/Helper/TextHelper.php | 32 +- lib/Cake/View/Helper/TimeHelper.php | 60 +- lib/Cake/View/HelperCollection.php | 10 +- lib/Cake/View/JsonView.php | 10 +- lib/Cake/View/MediaView.php | 10 +- lib/Cake/View/ScaffoldView.php | 10 +- lib/Cake/View/Scaffolds/form.ctp | 10 +- lib/Cake/View/Scaffolds/index.ctp | 10 +- lib/Cake/View/Scaffolds/view.ctp | 10 +- lib/Cake/View/ThemeView.php | 10 +- lib/Cake/View/View.php | 20 +- lib/Cake/View/ViewBlock.php | 10 +- lib/Cake/View/XmlView.php | 10 +- lib/Cake/basics.php | 91 +- lib/Cake/bootstrap.php | 24 +- 717 files changed, 10922 insertions(+), 6891 deletions(-) delete mode 100644 lib/Cake/Console/Templates/skel/View/Elements/empty mode change 100644 => 100755 lib/Cake/Console/cake create mode 100644 lib/Cake/Test/Case/Controller/ApplicationControllerTest.php delete mode 100644 lib/Cake/Test/Case/Core/ObjectTest.php delete mode 100644 lib/Cake/Test/Case/Utility/StringTest.php create mode 100644 lib/Cake/Test/test_app/Plugin/TestPlugin/Controller/Component/TestPluginEmailComponent.php diff --git a/app/Controller/AppController.php b/app/Controller/AppController.php index 4fb36e7..516aa83 100644 --- a/app/Controller/AppController.php +++ b/app/Controller/AppController.php @@ -58,7 +58,7 @@ public function beforeFilter() { // If config isn't set, redirect to install process to create one if(!Configure::read('Settings.installed') && strtolower($this->plugin) != 'install') { $this->Session->setFlash(__('MushRaider is ready for install, what about you ?'), 'flash_info'); - $this->redirect('/install/step/1'); + $this->redirect('/install/step/1'); } // Language @@ -91,7 +91,7 @@ public function beforeFilter() { // Log in user if($this->Session->check('User.id')) { - $userID = $this->Session->read('User.id'); + $userID = $this->Session->read('User.id'); if(!empty($userID)) { $params = array(); $params['recursive'] = 1; @@ -136,7 +136,7 @@ public function beforeRender() { // SEO $this->pageTitle .= !empty($this->request->params['named']['page'])?' - page '.$this->request->params['named']['page']:''; $this->pageDescription .= !empty($this->request->params['named']['page'])?' - page '.$this->request->params['named']['page']:''; - + $this->set('title_for_layout', $this->pageTitle); $this->set('description_for_layout', $this->pageDescription); $this->set('breadcrumb', $this->breadcrumb); diff --git a/lib/Cake/Cache/Cache.php b/lib/Cake/Cache/Cache.php index a7a01d0..3db66c4 100644 --- a/lib/Cake/Cache/Cache.php +++ b/lib/Cake/Cache/Cache.php @@ -1,17 +1,17 @@ _groupPrefix)) { - $prefix = vsprintf($this->_groupPrefix, $this->groups()); + $prefix = md5(implode('_', $this->groups())); } $key = preg_replace('/[\s]+/', '_', strtolower(trim(str_replace(array(DS, '/', '.'), '_', strval($key))))); diff --git a/lib/Cake/Cache/Engine/ApcEngine.php b/lib/Cake/Cache/Engine/ApcEngine.php index 8500560..329e871 100644 --- a/lib/Cake/Cache/Engine/ApcEngine.php +++ b/lib/Cake/Cache/Engine/ApcEngine.php @@ -2,18 +2,18 @@ /** * APC storage engine for cache. * - * 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 Cake.Cache.Engine * @since CakePHP(tm) v 1.2.0.4933 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/lib/Cake/Cache/Engine/FileEngine.php b/lib/Cake/Cache/Engine/FileEngine.php index 5bbbd93..7599d61 100644 --- a/lib/Cake/Cache/Engine/FileEngine.php +++ b/lib/Cake/Cache/Engine/FileEngine.php @@ -6,17 +6,17 @@ * * You can configure a FileEngine cache, using Cache::config() * - * 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 * @since CakePHP(tm) v 1.2.0.4933 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** @@ -267,6 +267,10 @@ protected function _clearDirectory($path, $now, $threshold) { } $dir = dir($path); + if ($dir === false) { + return; + } + while (($entry = $dir->read()) !== false) { if (substr($entry, 0, $prefixLength) !== $this->settings['prefix']) { continue; @@ -348,7 +352,11 @@ protected function _setKey($key, $createKey = false) { if (!$createKey && !$path->isFile()) { return false; } - if (empty($this->_File) || $this->_File->getBaseName() !== $key) { + if ( + empty($this->_File) || + $this->_File->getBaseName() !== $key || + $this->_File->valid() === false + ) { $exists = file_exists($path->getPathname()); try { $this->_File = $path->openFile('c+'); diff --git a/lib/Cake/Cache/Engine/MemcacheEngine.php b/lib/Cake/Cache/Engine/MemcacheEngine.php index eba2ec4..d70c1c5 100644 --- a/lib/Cake/Cache/Engine/MemcacheEngine.php +++ b/lib/Cake/Cache/Engine/MemcacheEngine.php @@ -2,18 +2,18 @@ /** * Memcache storage engine for cache * - * 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 Cake.Cache.Engine * @since CakePHP(tm) v 1.2.0.4933 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/lib/Cake/Cache/Engine/MemcachedEngine.php b/lib/Cake/Cache/Engine/MemcachedEngine.php index 241b982..655eb5d 100644 --- a/lib/Cake/Cache/Engine/MemcachedEngine.php +++ b/lib/Cake/Cache/Engine/MemcachedEngine.php @@ -1,16 +1,16 @@ settings['persistent']) { + if (empty($this->settings['persistent']) && $this->_Redis !== null) { $this->_Redis->close(); } } diff --git a/lib/Cake/Cache/Engine/WincacheEngine.php b/lib/Cake/Cache/Engine/WincacheEngine.php index e5c9d7b..dc83481 100644 --- a/lib/Cake/Cache/Engine/WincacheEngine.php +++ b/lib/Cake/Cache/Engine/WincacheEngine.php @@ -4,18 +4,18 @@ * * Supports wincache 1.1.0 and higher. * - * 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 Cake.Cache.Engine * @since CakePHP(tm) v 1.2.0.4933 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/lib/Cake/Cache/Engine/XcacheEngine.php b/lib/Cake/Cache/Engine/XcacheEngine.php index c46a7b9..2ce3324 100644 --- a/lib/Cake/Cache/Engine/XcacheEngine.php +++ b/lib/Cake/Cache/Engine/XcacheEngine.php @@ -2,18 +2,18 @@ /** * Xcache storage engine for cache. * - * 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 Cake.Cache.Engine * @since CakePHP(tm) v 1.2.0.4947 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/lib/Cake/Config/config.php b/lib/Cake/Config/config.php index cd3a398..755944a 100644 --- a/lib/Cake/Config/config.php +++ b/lib/Cake/Config/config.php @@ -2,18 +2,18 @@ /** * Core Configurations. * - * 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 Cake.Config * @since CakePHP(tm) v 1.1.11.4062 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ $versionFile = file(CAKE . 'VERSION.txt'); diff --git a/lib/Cake/Config/routes.php b/lib/Cake/Config/routes.php index 7bcc0c0..5d603ed 100644 --- a/lib/Cake/Config/routes.php +++ b/lib/Cake/Config/routes.php @@ -1,17 +1,17 @@ _path = $path; $this->_section = $section; diff --git a/lib/Cake/Configure/PhpReader.php b/lib/Cake/Configure/PhpReader.php index d15a41b..40176ce 100644 --- a/lib/Cake/Configure/PhpReader.php +++ b/lib/Cake/Configure/PhpReader.php @@ -2,17 +2,17 @@ /** * PhpReader file * - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.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://book.cakephp.org/2.0/en/development/configuration.html#loading-configuration-files CakePHP(tm) Configuration + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://book.cakephp.org/2.0/en/development/configuration.html#loading-configuration-files CakePHP(tm) Configuration * @package Cake.Configure * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('CakePlugin', 'Core'); @@ -38,11 +38,11 @@ class PhpReader implements ConfigReaderInterface { /** * Constructor for PHP Config file reading. * - * @param string $path The path to read config files from. Defaults to APP . 'Config' . DS + * @param string $path The path to read config files from. Defaults to CONFIG */ public function __construct($path = null) { if (!$path) { - $path = APP . 'Config' . DS; + $path = CONFIG; } $this->_path = $path; } diff --git a/lib/Cake/Console/Command/AclShell.php b/lib/Cake/Console/Command/AclShell.php index 15536eb..10db318 100644 --- a/lib/Cake/Console/Command/AclShell.php +++ b/lib/Cake/Console/Command/AclShell.php @@ -2,17 +2,17 @@ /** * Acl Shell provides Acl access in the CLI environment * - * 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 * @since CakePHP(tm) v 1.2.0.5012 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -89,7 +89,7 @@ public function startup() { $this->args = null; return $this->DbConfig->execute(); } - require_once APP . 'Config' . DS . 'database.php'; + require_once CONFIG . 'database.php'; if (!in_array($this->command, array('initdb'))) { $collection = new ComponentCollection(); diff --git a/lib/Cake/Console/Command/ApiShell.php b/lib/Cake/Console/Command/ApiShell.php index 8b0c979..3c3dd1c 100644 --- a/lib/Cake/Console/Command/ApiShell.php +++ b/lib/Cake/Console/Command/ApiShell.php @@ -4,17 +4,17 @@ * * Implementation of a Cake Shell to show CakePHP core method signatures. * - * 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 * @since CakePHP(tm) v 1.2.0.5012 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); diff --git a/lib/Cake/Console/Command/AppShell.php b/lib/Cake/Console/Command/AppShell.php index 4ea0f2d..030ae49 100644 --- a/lib/Cake/Console/Command/AppShell.php +++ b/lib/Cake/Console/Command/AppShell.php @@ -2,17 +2,17 @@ /** * AppShell file * - * 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 * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('Shell', 'Console'); diff --git a/lib/Cake/Console/Command/BakeShell.php b/lib/Cake/Console/Command/BakeShell.php index c1e59c6..e0db7bc 100644 --- a/lib/Cake/Console/Command/BakeShell.php +++ b/lib/Cake/Console/Command/BakeShell.php @@ -6,17 +6,17 @@ * application development by writing fully functional skeleton controllers, * models, and views. Going further, Bake can also write Unit Tests for you. * - * 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 * @since CakePHP(tm) v 1.2.0.5012 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -30,7 +30,7 @@ * models, and views. Going further, Bake can also write Unit Tests for you. * * @package Cake.Console.Command - * @link http://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html + * @link https://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html */ class BakeShell extends AppShell { diff --git a/lib/Cake/Console/Command/CommandListShell.php b/lib/Cake/Console/Command/CommandListShell.php index ca6620a..49b9877 100644 --- a/lib/Cake/Console/Command/CommandListShell.php +++ b/lib/Cake/Console/Command/CommandListShell.php @@ -1,17 +1,17 @@ out(" -working: " . rtrim(APP, DS)); $this->out(" -root: " . rtrim(ROOT, DS)); $this->out(" -core: " . rtrim(CORE_PATH, DS)); + $this->out(" -webroot: " . rtrim(WWW_ROOT, DS)); $this->out(""); $this->out(__d('cake_console', "Changing Paths:"), 2); $this->out(__d('cake_console', "Your working path should be the same as your application path. To change your path use the '-app' param.")); diff --git a/lib/Cake/Console/Command/CompletionShell.php b/lib/Cake/Console/Command/CompletionShell.php index 57e86f9..3d6fa17 100644 --- a/lib/Cake/Console/Command/CompletionShell.php +++ b/lib/Cake/Console/Command/CompletionShell.php @@ -1,17 +1,17 @@ __d('cake_console', 'Path to read and write schema.php'), - 'default' => APP . 'Config' . DS . 'Schema' + 'default' => CONFIG . 'Schema' ); $file = array( 'help' => __d('cake_console', 'File name to read and write.'), diff --git a/lib/Cake/Console/Command/ServerShell.php b/lib/Cake/Console/Command/ServerShell.php index 8c7d5e5..014d397 100644 --- a/lib/Cake/Console/Command/ServerShell.php +++ b/lib/Cake/Console/Command/ServerShell.php @@ -2,17 +2,17 @@ /** * built-in Server Shell * - * 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 * @since CakePHP(tm) v 2.3.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -78,7 +78,7 @@ public function initialize() { * or otherwise modify the pre-command flow. * * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::startup + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::startup */ public function startup() { if (!empty($this->params['host'])) { diff --git a/lib/Cake/Console/Command/Task/BakeTask.php b/lib/Cake/Console/Command/Task/BakeTask.php index 8298e11..c886c95 100644 --- a/lib/Cake/Console/Command/Task/BakeTask.php +++ b/lib/Cake/Console/Command/Task/BakeTask.php @@ -2,17 +2,17 @@ /** * Base class for Bake Tasks. * - * 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 * @since CakePHP(tm) v 1.3 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); diff --git a/lib/Cake/Console/Command/Task/CommandTask.php b/lib/Cake/Console/Command/Task/CommandTask.php index fca006a..99c888f 100644 --- a/lib/Cake/Console/Command/Task/CommandTask.php +++ b/lib/Cake/Console/Command/Task/CommandTask.php @@ -1,16 +1,16 @@ out("\n" . __d('cake_console', 'Baking controller class for %s...', $controllerName), 1, Shell::QUIET); + if ($helpers === null) { + $helpers = array(); + } + if ($components === null) { + $components = array(); + } $isScaffold = ($actions === 'scaffold') ? true : false; $this->Template->set(array( diff --git a/lib/Cake/Console/Command/Task/DbConfigTask.php b/lib/Cake/Console/Command/Task/DbConfigTask.php index ee1aa6c..c76b87b 100644 --- a/lib/Cake/Console/Command/Task/DbConfigTask.php +++ b/lib/Cake/Console/Command/Task/DbConfigTask.php @@ -2,17 +2,17 @@ /** * The DbConfig Task handles creating and updating the database.php * - * 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 * @since CakePHP(tm) v 1.2 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -64,7 +64,7 @@ class DbConfigTask extends AppShell { * @return void */ public function initialize() { - $this->path = APP . 'Config' . DS; + $this->path = CONFIG; } /** diff --git a/lib/Cake/Console/Command/Task/ExtractTask.php b/lib/Cake/Console/Command/Task/ExtractTask.php index 740528f..eaa691e 100644 --- a/lib/Cake/Console/Command/Task/ExtractTask.php +++ b/lib/Cake/Console/Command/Task/ExtractTask.php @@ -2,17 +2,17 @@ /** * Language string extractor * - * 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 * @since CakePHP(tm) v 1.2.0.5012 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); diff --git a/lib/Cake/Console/Command/Task/FixtureTask.php b/lib/Cake/Console/Command/Task/FixtureTask.php index d0329e9..7b2ee52 100644 --- a/lib/Cake/Console/Command/Task/FixtureTask.php +++ b/lib/Cake/Console/Command/Task/FixtureTask.php @@ -2,17 +2,17 @@ /** * The FixtureTask handles creating and updating fixture files. * - * 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 * @since CakePHP(tm) v 1.3 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -335,6 +335,9 @@ protected function _generateRecords($tableInfo, $recordCount = 1) { } $insert = ''; switch ($fieldInfo['type']) { + case 'tinyinteger': + case 'smallinteger': + case 'biginteger': case 'integer': case 'float': $insert = $i + 1; diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php index 2dc03a5..88be255 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -2,17 +2,17 @@ /** * The ModelTask handles creating and updating models files. * - * 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 * @since CakePHP(tm) v 1.2 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -224,7 +224,7 @@ protected function _interactive() { if (!array_key_exists('id', $fields)) { $primaryKey = $this->findPrimaryKey($fields); } - + $displayField = null; if ($knownToExist) { $displayField = $tempModel->hasField(array('name', 'title')); if (!$displayField) { @@ -450,6 +450,10 @@ public function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { $guess = $methods['notBlank']; } elseif ($metaData['type'] === 'integer') { $guess = $methods['numeric']; + } elseif ($metaData['type'] === 'smallinteger') { + $guess = $methods['numeric']; + } elseif ($metaData['type'] === 'tinyinteger') { + $guess = $methods['numeric']; } elseif ($metaData['type'] === 'float') { $guess = $methods['numeric']; } elseif ($metaData['type'] === 'boolean') { diff --git a/lib/Cake/Console/Command/Task/PluginTask.php b/lib/Cake/Console/Command/Task/PluginTask.php index 7cd5079..10a0086 100644 --- a/lib/Cake/Console/Command/Task/PluginTask.php +++ b/lib/Cake/Console/Command/Task/PluginTask.php @@ -1,16 +1,16 @@ path = current(App::path('plugins')); - $this->bootstrap = APP . 'Config' . DS . 'bootstrap.php'; + $this->bootstrap = CONFIG . 'bootstrap.php'; } /** diff --git a/lib/Cake/Console/Command/Task/ProjectTask.php b/lib/Cake/Console/Command/Task/ProjectTask.php index df1ab19..ed38f68 100644 --- a/lib/Cake/Console/Command/Task/ProjectTask.php +++ b/lib/Cake/Console/Command/Task/ProjectTask.php @@ -2,17 +2,17 @@ /** * The Project Task handles creating the base application * - * 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 * @since CakePHP(tm) v 1.2 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); @@ -79,14 +79,14 @@ public function execute() { if ($this->securitySalt($path) === true) { $this->out(__d('cake_console', ' * Random hash key created for \'Security.salt\'')); } else { - $this->err(__d('cake_console', 'Unable to generate random hash for \'Security.salt\', you should change it in %s', APP . 'Config' . DS . 'core.php')); + $this->err(__d('cake_console', 'Unable to generate random hash for \'Security.salt\', you should change it in %s', CONFIG . 'core.php')); $success = false; } if ($this->securityCipherSeed($path) === true) { $this->out(__d('cake_console', ' * Random seed created for \'Security.cipherSeed\'')); } else { - $this->err(__d('cake_console', 'Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', APP . 'Config' . DS . 'core.php')); + $this->err(__d('cake_console', 'Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', CONFIG . 'core.php')); $success = false; } @@ -362,7 +362,7 @@ protected function _replaceCorePath($filename, $hardCode) { * @return bool Success */ public function cakeAdmin($name) { - $path = (empty($this->configPath)) ? APP . 'Config' . DS : $this->configPath; + $path = (empty($this->configPath)) ? CONFIG : $this->configPath; $File = new File($path . 'core.php'); $contents = $File->read(); if (preg_match('%(\s*[/]*Configure::write\(\'Routing.prefixes\',[\s\'a-z,\)\(]*\);)%', $contents, $match)) { diff --git a/lib/Cake/Console/Command/Task/TemplateTask.php b/lib/Cake/Console/Command/Task/TemplateTask.php index d5dfc44..0691bf5 100644 --- a/lib/Cake/Console/Command/Task/TemplateTask.php +++ b/lib/Cake/Console/Command/Task/TemplateTask.php @@ -2,17 +2,17 @@ /** * Template Task can generate templated output Used in other Tasks * - * 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 * @since CakePHP(tm) v 1.3 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); diff --git a/lib/Cake/Console/Command/Task/TestTask.php b/lib/Cake/Console/Command/Task/TestTask.php index 7b5cc54..342494e 100644 --- a/lib/Cake/Console/Command/Task/TestTask.php +++ b/lib/Cake/Console/Command/Task/TestTask.php @@ -2,17 +2,17 @@ /** * The TestTask handles creating and updating test files. * - * 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 * @since CakePHP(tm) v 1.3 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); diff --git a/lib/Cake/Console/Command/Task/ViewTask.php b/lib/Cake/Console/Command/Task/ViewTask.php index 06ecf00..fa7ddef 100644 --- a/lib/Cake/Console/Command/Task/ViewTask.php +++ b/lib/Cake/Console/Command/Task/ViewTask.php @@ -2,17 +2,17 @@ /** * The View Tasks handles creating and updating view files. * - * 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 * @since CakePHP(tm) v 1.2 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); diff --git a/lib/Cake/Console/Command/TestShell.php b/lib/Cake/Console/Command/TestShell.php index 29eca27..ebaab5b 100644 --- a/lib/Cake/Console/Command/TestShell.php +++ b/lib/Cake/Console/Command/TestShell.php @@ -4,17 +4,17 @@ * * This Shell allows the running of test suites via the cake command line * - * CakePHP(tm) Tests - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) Tests + * 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://book.cakephp.org/2.0/en/development/testing.html + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://book.cakephp.org/2.0/en/development/testing.html * @since CakePHP(tm) v 1.2.0.4433 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('Shell', 'Console'); @@ -360,23 +360,19 @@ protected function _mapFileToCase($file, $category, $throwOnMissingFile = true) } $testFile = $testCase = null; - + $testCaseFolder = str_replace(APP, '', APP_TEST_CASES); if (preg_match('@Test[\\\/]@', $file)) { - if (substr($file, -8) === 'Test.php') { - $testCase = substr($file, 0, -8); $testCase = str_replace(DS, '/', $testCase); - - if ($testCase = preg_replace('@.*Test\/Case\/@', '', $testCase)) { - + $testCaseFolderEscaped = str_replace('/', '\/', $testCaseFolder); + $testCase = preg_replace('@.*' . $testCaseFolderEscaped . '\/@', '', $testCase); + if (!empty($testCase)) { if ($category === 'core') { $testCase = str_replace('lib/Cake', '', $testCase); } - return $testCase; } - throw new Exception(__d('cake_dev', 'Test case %s cannot be run via this shell', $testFile)); } } @@ -397,11 +393,11 @@ protected function _mapFileToCase($file, $category, $throwOnMissingFile = true) } if ($category === 'app') { - $testFile = str_replace(APP, APP . 'Test/Case/', $file) . 'Test.php'; + $testFile = str_replace(APP, APP_TEST_CASES . '/', $file) . 'Test.php'; } else { $testFile = preg_replace( "@((?:plugins|Plugin)[\\/]{$category}[\\/])(.*)$@", - '\1Test/Case/\2Test.php', + '\1' . $testCaseFolder . '/\2Test.php', $file ); } @@ -412,8 +408,7 @@ protected function _mapFileToCase($file, $category, $throwOnMissingFile = true) $testCase = substr($testFile, 0, -8); $testCase = str_replace(DS, '/', $testCase); - $testCase = preg_replace('@.*Test/Case/@', '', $testCase); - + $testCase = preg_replace('@.*' . $testCaseFolder . '/@', '', $testCase); return $testCase; } diff --git a/lib/Cake/Console/Command/TestsuiteShell.php b/lib/Cake/Console/Command/TestsuiteShell.php index d37ac50..911f787 100644 --- a/lib/Cake/Console/Command/TestsuiteShell.php +++ b/lib/Cake/Console/Command/TestsuiteShell.php @@ -4,17 +4,17 @@ * * This is a bc wrapper for the newer Test shell * - * CakePHP(tm) Tests - * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) + * CakePHP(tm) Tests + * 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://book.cakephp.org/2.0/en/development/testing.html + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://book.cakephp.org/2.0/en/development/testing.html * @since CakePHP(tm) v 1.2.0.4433 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('TestShell', 'Console/Command'); diff --git a/lib/Cake/Console/Command/UpgradeShell.php b/lib/Cake/Console/Command/UpgradeShell.php index 7621c99..f9d1223 100644 --- a/lib/Cake/Console/Command/UpgradeShell.php +++ b/lib/Cake/Console/Command/UpgradeShell.php @@ -2,18 +2,18 @@ /** * Upgrade Shell * - * 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 Cake.Console.Command * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('AppShell', 'Console/Command'); diff --git a/lib/Cake/Console/ConsoleErrorHandler.php b/lib/Cake/Console/ConsoleErrorHandler.php index 7cbb2df..3df0bf7 100644 --- a/lib/Cake/Console/ConsoleErrorHandler.php +++ b/lib/Cake/Console/ConsoleErrorHandler.php @@ -2,17 +2,17 @@ /** * ErrorHandler for Console Shells * - * 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 * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('ErrorHandler', 'Error'); diff --git a/lib/Cake/Console/ConsoleInput.php b/lib/Cake/Console/ConsoleInput.php index 551635b..dc416ce 100644 --- a/lib/Cake/Console/ConsoleInput.php +++ b/lib/Cake/Console/ConsoleInput.php @@ -2,18 +2,18 @@ /** * ConsoleInput file. * - * 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 Cake.Console * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/lib/Cake/Console/ConsoleInputArgument.php b/lib/Cake/Console/ConsoleInputArgument.php index 08dbc21..36f0855 100644 --- a/lib/Cake/Console/ConsoleInputArgument.php +++ b/lib/Cake/Console/ConsoleInputArgument.php @@ -2,17 +2,17 @@ /** * ConsoleArgumentOption file * - * 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 * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** @@ -159,7 +159,7 @@ public function xml(SimpleXmlElement $parent) { $option = $parent->addChild('argument'); $option->addAttribute('name', $this->_name); $option->addAttribute('help', $this->_help); - $option->addAttribute('required', $this->isRequired()); + $option->addAttribute('required', (int)$this->isRequired()); $choices = $option->addChild('choices'); foreach ($this->_choices as $valid) { $choices->addChild('choice', $valid); diff --git a/lib/Cake/Console/ConsoleInputOption.php b/lib/Cake/Console/ConsoleInputOption.php index 3a4b7a1..139c983 100644 --- a/lib/Cake/Console/ConsoleInputOption.php +++ b/lib/Cake/Console/ConsoleInputOption.php @@ -2,17 +2,17 @@ /** * ConsoleInputOption file * - * 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 * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** @@ -205,10 +205,11 @@ public function xml(SimpleXmlElement $parent) { $option->addAttribute('name', '--' . $this->_name); $short = ''; if (strlen($this->_short)) { - $short = $this->_short; + $short = '-' . $this->_short; } - $option->addAttribute('short', '-' . $short); - $option->addAttribute('boolean', $this->_boolean); + $option->addAttribute('short', $short); + $option->addAttribute('help', $this->_help); + $option->addAttribute('boolean', (int)$this->_boolean); $option->addChild('default', $this->_default); $choices = $option->addChild('choices'); foreach ($this->_choices as $valid) { diff --git a/lib/Cake/Console/ConsoleInputSubcommand.php b/lib/Cake/Console/ConsoleInputSubcommand.php index 65c10db..b672106 100644 --- a/lib/Cake/Console/ConsoleInputSubcommand.php +++ b/lib/Cake/Console/ConsoleInputSubcommand.php @@ -2,17 +2,17 @@ /** * ConsoleInputSubcommand file * - * 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 * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/lib/Cake/Console/ConsoleOptionParser.php b/lib/Cake/Console/ConsoleOptionParser.php index f54c546..f90dbc4 100644 --- a/lib/Cake/Console/ConsoleOptionParser.php +++ b/lib/Cake/Console/ConsoleOptionParser.php @@ -2,17 +2,17 @@ /** * ConsoleOptionParser file * - * 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 * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('TaskCollection', 'Console'); diff --git a/lib/Cake/Console/ConsoleOutput.php b/lib/Cake/Console/ConsoleOutput.php index ec6fb39..4690a85 100644 --- a/lib/Cake/Console/ConsoleOutput.php +++ b/lib/Cake/Console/ConsoleOutput.php @@ -2,17 +2,17 @@ /** * ConsoleOutput file. * - * 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 * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** diff --git a/lib/Cake/Console/HelpFormatter.php b/lib/Cake/Console/HelpFormatter.php index 3a8fac9..0c4259a 100644 --- a/lib/Cake/Console/HelpFormatter.php +++ b/lib/Cake/Console/HelpFormatter.php @@ -2,16 +2,16 @@ /** * HelpFormatter * - * 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 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) + * @link https://cakephp.org CakePHP(tm) Project + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('CakeText', 'Utility'); @@ -182,7 +182,6 @@ public function xml($string = true) { $xml->addChild('command', $parser->command()); $xml->addChild('description', $parser->description()); - $xml->addChild('epilog', $parser->epilog()); $subcommands = $xml->addChild('subcommands'); foreach ($parser->subcommands() as $command) { $command->xml($subcommands); @@ -195,6 +194,7 @@ public function xml($string = true) { foreach ($parser->arguments() as $argument) { $argument->xml($arguments); } + $xml->addChild('epilog', $parser->epilog()); return $string ? $xml->asXml() : $xml; } diff --git a/lib/Cake/Console/Helper/BaseShellHelper.php b/lib/Cake/Console/Helper/BaseShellHelper.php index f06a17a..96f12c1 100644 --- a/lib/Cake/Console/Helper/BaseShellHelper.php +++ b/lib/Cake/Console/Helper/BaseShellHelper.php @@ -1,16 +1,16 @@ name) { @@ -222,7 +222,7 @@ public function __construct($stdout = null, $stderr = null, $stdin = null) { * allows configuration of tasks prior to shell execution * * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::initialize + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::initialize */ public function initialize() { $this->_loadModels(); @@ -237,7 +237,7 @@ public function initialize() { * or otherwise modify the pre-command flow. * * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::startup + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::startup */ public function startup() { $this->_welcome(); @@ -340,7 +340,7 @@ public function loadTasks() { * * @param string $task The task name to check. * @return bool Success - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasTask + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasTask */ public function hasTask($task) { return isset($this->_taskMap[Inflector::camelize($task)]); @@ -351,7 +351,7 @@ public function hasTask($task) { * * @param string $name The method name to check. * @return bool - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasMethod + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasMethod */ public function hasMethod($name) { try { @@ -387,7 +387,7 @@ public function hasMethod($name) { * `return $this->dispatchShell('schema', 'create', 'i18n', '--dry');` * * @return mixed The return of the other shell. - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::dispatchShell + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::dispatchShell */ public function dispatchShell() { $args = func_get_args(); @@ -415,8 +415,8 @@ public function dispatchShell() { * @param string $command The command name to run on this shell. If this argument is empty, * and the shell has a `main()` method, that will be called instead. * @param array $argv Array of arguments to run the shell with. This array should be missing the shell name. - * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::runCommand + * @return int|bool + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::runCommand */ public function runCommand($command, $argv) { $isTask = $this->hasTask($command); @@ -431,6 +431,7 @@ public function runCommand($command, $argv) { try { list($this->params, $this->args) = $this->OptionParser->parse($argv, $command); } catch (ConsoleException $e) { + $this->err(__d('cake_console', 'Error: %s', $e->getMessage())); $this->out($this->OptionParser->help($command)); return false; } @@ -468,7 +469,7 @@ public function runCommand($command, $argv) { * Display the help in the correct format * * @param string $command The command to get help for. - * @return void + * @return int|bool */ protected function _displayHelp($command) { $format = 'text'; @@ -487,7 +488,7 @@ protected function _displayHelp($command) { * By overriding this method you can configure the ConsoleOptionParser before returning it. * * @return ConsoleOptionParser - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::getOptionParser + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::getOptionParser */ public function getOptionParser() { $name = ($this->plugin ? $this->plugin . '.' : '') . $this->name; @@ -533,7 +534,7 @@ public function param($name) { * @param string|array $options Array or string of options. * @param string $default Default input value. * @return mixed Either the default value, or the user-provided input. - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::in + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::in */ public function in($prompt, $options = null, $default = null) { if (!$this->interactive) { @@ -570,7 +571,7 @@ public function in($prompt, $options = null, $default = null) { * @param string $prompt Prompt text. * @param string|array $options Array or string of options. * @param string $default Default input value. - * @return Either the default value, or the user-provided input. + * @return string|int the default value, or the user-provided input. */ protected function _getInput($prompt, $options, $default) { if (!is_array($options)) { @@ -612,7 +613,7 @@ protected function _getInput($prompt, $options, $default) { * @param string|int|array $options Array of options to use, or an integer to wrap the text to. * @return string Wrapped / indented text * @see CakeText::wrap() - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::wrapText + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::wrapText */ public function wrapText($text, $options = array()) { return CakeText::wrap($text, $options); @@ -633,7 +634,7 @@ public function wrapText($text, $options = array()) { * @param int $newlines Number of newlines to append * @param int $level The message's output level, see above. * @return int|bool Returns the number of bytes returned from writing to stdout. - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::out + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::out */ public function out($message = null, $newlines = 1, $level = Shell::NORMAL) { $currentLevel = Shell::NORMAL; @@ -688,7 +689,7 @@ public function overwrite($message, $newlines = 1, $size = null) { * @param string|array $message A string or an array of strings to output * @param int $newlines Number of newlines to append * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::err + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::err */ public function err($message = null, $newlines = 1) { $this->stderr->write($message, $newlines); @@ -699,7 +700,7 @@ public function err($message = null, $newlines = 1) { * * @param int $multiplier Number of times the linefeed sequence should be repeated * @return string - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::nl + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::nl */ public function nl($multiplier = 1) { return str_repeat(ConsoleOutput::LF, $multiplier); @@ -711,7 +712,7 @@ public function nl($multiplier = 1) { * @param int $newlines Number of newlines to pre- and append * @param int $width Width of the line, defaults to 63 * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hr + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hr */ public function hr($newlines = 0, $width = 63) { $this->out(null, $newlines); @@ -725,8 +726,8 @@ public function hr($newlines = 0, $width = 63) { * * @param string $title Title of the error * @param string $message An optional error message - * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::error + * @return int + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::error */ public function error($title, $message = null) { $this->err(__d('cake_console', 'Error: %s', $title)); @@ -742,7 +743,7 @@ public function error($title, $message = null) { * Clear the console * * @return void - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::clear + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::clear */ public function clear() { if (empty($this->params['noclear'])) { @@ -760,11 +761,9 @@ public function clear() { * @param string $path Where to put the file. * @param string $contents Content to put in the file. * @return bool Success - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::createFile + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::createFile */ public function createFile($path, $contents) { - $path = str_replace(DS . DS, DS, $path); - $this->out(); if (is_file($path) && empty($this->params['force']) && $this->interactive === true) { @@ -849,7 +848,7 @@ protected function _checkUnitTest() { * * @param string $file Absolute file path * @return string short path - * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::shortPath + * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::shortPath */ public function shortPath($file) { $shortPath = str_replace(ROOT, null, $file); diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php index 37aa300..5249008 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -2,17 +2,17 @@ /** * ShellDispatcher file * - * 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 * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ /** @@ -106,7 +106,7 @@ protected function _initEnvironment() { $message = "This file has been loaded incorrectly and cannot continue.\n" . "Please make sure that " . DS . 'lib' . DS . 'Cake' . DS . "Console is in your system path,\n" . "and check the cookbook for the correct usage of this command.\n" . - "(http://book.cakephp.org/)"; + "(https://book.cakephp.org/)"; throw new CakeException($message); } @@ -129,15 +129,25 @@ protected function _bootstrap() { define('APP', $this->params['working'] . DS); } if (!defined('WWW_ROOT')) { - define('WWW_ROOT', APP . $this->params['webroot'] . DS); + if (!$this->_isAbsolutePath($this->params['webroot'])) { + $webroot = realpath(APP . $this->params['webroot']); + } else { + $webroot = $this->params['webroot']; + } + define('WWW_ROOT', $webroot . DS); } if (!defined('TMP') && !is_dir(APP . 'tmp')) { define('TMP', CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'tmp' . DS); } + if (!defined('CONFIG')) { + define('CONFIG', ROOT . DS . APP_DIR . DS . 'Config' . DS); + } + // $boot is used by Cake/bootstrap.php file + $boot = file_exists(CONFIG . 'bootstrap.php'); require CORE_PATH . 'Cake' . DS . 'bootstrap.php'; - if (!file_exists(APP . 'Config' . DS . 'core.php')) { + if (!file_exists(CONFIG . 'core.php')) { include_once CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'Config' . DS . 'core.php'; App::build(); } @@ -305,25 +315,45 @@ public function parseParams($args) { } } - if ($params['app'][0] === '/' || preg_match('/([a-z])(:)/i', $params['app'], $matches)) { + if ($this->_isAbsolutePath($params['app'])) { $params['root'] = dirname($params['app']); } elseif (strpos($params['app'], '/')) { $params['root'] .= '/' . dirname($params['app']); } - + $isWindowsAppPath = $this->_isWindowsPath($params['app']); $params['app'] = basename($params['app']); $params['working'] = rtrim($params['root'], '/'); if (!$isWin || !preg_match('/^[A-Z]:$/i', $params['app'])) { $params['working'] .= '/' . $params['app']; } - if (!empty($matches[0]) || !empty($isWin)) { + if ($isWindowsAppPath || !empty($isWin)) { $params = str_replace('/', '\\', $params); } $this->params = $params + $this->params; } +/** + * Checks whether the given path is absolute or relative. + * + * @param string $path absolute or relative path. + * @return bool + */ + protected function _isAbsolutePath($path) { + return $path[0] === '/' || $this->_isWindowsPath($path); + } + +/** + * Checks whether the given path is Window OS path. + * + * @param string $path absolute path. + * @return bool + */ + protected function _isWindowsPath($path) { + return preg_match('/([a-z])(:)/i', $path) == 1; + } + /** * Parses out the paths from from the argv * @@ -332,7 +362,7 @@ public function parseParams($args) { */ protected function _parsePaths($args) { $parsed = array(); - $keys = array('-working', '--working', '-app', '--app', '-root', '--root'); + $keys = array('-working', '--working', '-app', '--app', '-root', '--root', '-webroot', '--webroot'); $args = (array)$args; foreach ($keys as $key) { while (($index = array_search($key, $args)) !== false) { diff --git a/lib/Cake/Console/TaskCollection.php b/lib/Cake/Console/TaskCollection.php index 3fafddd..5d2e7a7 100644 --- a/lib/Cake/Console/TaskCollection.php +++ b/lib/Cake/Console/TaskCollection.php @@ -3,17 +3,17 @@ * Task collection is used as a registry for loaded tasks and handles loading * and constructing task class objects. * - * 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 * @since CakePHP(tm) v 2.0 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ App::uses('ObjectCollection', 'Utility'); @@ -64,7 +64,7 @@ public function __construct(Shell $Shell) { * * @param string $task Task name to load * @param array $settings Settings for the task. - * @return Task A task object, Either the existing loaded task or a new one. + * @return AppShell A task object, Either the existing loaded task or a new one. * @throws MissingTaskException when the task could not be found */ public function load($task, $settings = array()) { diff --git a/lib/Cake/Console/Templates/default/actions/controller_actions.ctp b/lib/Cake/Console/Templates/default/actions/controller_actions.ctp index dfc3092..0cde5c6 100644 --- a/lib/Cake/Console/Templates/default/actions/controller_actions.ctp +++ b/lib/Cake/Console/Templates/default/actions/controller_actions.ctp @@ -2,18 +2,18 @@ /** * Bake Template for Controller action generation. * - * 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 Cake.Console.Templates.default.actions * @since CakePHP(tm) v 1.3 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ ?> @@ -131,12 +131,11 @@ * @return void */ public function delete($id = null) { - $this->->id = $id; - if (!$this->->exists()) { + if (!$this->->exists($id)) { throw new NotFoundException(__('Invalid ')); } $this->request->allowMethod('post', 'delete'); - if ($this->->delete()) { + if ($this->->delete($id)) { $this->Flash->success(__('The has been deleted.')); } else { diff --git a/lib/Cake/Console/Templates/default/classes/controller.ctp b/lib/Cake/Console/Templates/default/classes/controller.ctp index 6beb4b4..30a9846 100644 --- a/lib/Cake/Console/Templates/default/classes/controller.ctp +++ b/lib/Cake/Console/Templates/default/classes/controller.ctp @@ -4,18 +4,18 @@ * * Allows templating of Controllers generated from bake. * - * 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 Cake.Console.Templates.default.classes * @since CakePHP(tm) v 1.3 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ echo "
diff --git a/lib/Cake/Console/Templates/default/views/index.ctp b/lib/Cake/Console/Templates/default/views/index.ctp index cf77c0e..7227714 100644 --- a/lib/Cake/Console/Templates/default/views/index.ctp +++ b/lib/Cake/Console/Templates/default/views/index.ctp @@ -1,17 +1,17 @@
diff --git a/lib/Cake/Console/Templates/default/views/view.ctp b/lib/Cake/Console/Templates/default/views/view.ctp index 3acfad8..b229b9f 100644 --- a/lib/Cake/Console/Templates/default/views/view.ctp +++ b/lib/Cake/Console/Templates/default/views/view.ctp @@ -1,17 +1,17 @@
diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php b/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php index 9a4f543..12ad8ee 100644 --- a/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php +++ b/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php @@ -4,7 +4,7 @@ * * Use it to configure database for ACL * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config.Schema * @since CakePHP(tm) v 0.2.9 */ diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.sql b/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.sql index 0bf3f76..cbb0cce 100644 --- a/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.sql +++ b/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.sql @@ -1,11 +1,11 @@ # $Id$ # -# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.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. -# MIT License (http://www.opensource.org/licenses/mit-license.php) +# MIT License (https://opensource.org/licenses/mit-license.php) CREATE TABLE acos ( id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php b/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php index cd598b3..63dc0db 100644 --- a/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php +++ b/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php @@ -4,18 +4,18 @@ * * Use it to configure database for i18n * - * 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 */ /** diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/i18n.sql b/lib/Cake/Console/Templates/skel/Config/Schema/i18n.sql index 66a42bd..a1a4e68 100644 --- a/lib/Cake/Console/Templates/skel/Config/Schema/i18n.sql +++ b/lib/Cake/Console/Templates/skel/Config/Schema/i18n.sql @@ -1,11 +1,11 @@ # $Id$ # -# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.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. -# MIT License (http://www.opensource.org/licenses/mit-license.php) +# MIT License (https://opensource.org/licenses/mit-license.php) CREATE TABLE i18n ( id int(10) NOT NULL auto_increment, diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php b/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php index bd7b1ef..b766ebf 100644 --- a/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php +++ b/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php @@ -4,18 +4,18 @@ * * 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 */ /** diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/sessions.sql b/lib/Cake/Console/Templates/skel/Config/Schema/sessions.sql index 76845bd..e197556 100644 --- a/lib/Cake/Console/Templates/skel/Config/Schema/sessions.sql +++ b/lib/Cake/Console/Templates/skel/Config/Schema/sessions.sql @@ -1,13 +1,13 @@ # $Id$ # -# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) # 1785 E. Sahara Avenue, Suite 490-204 # Las Vegas, Nevada 89104 # # 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. -# MIT License (http://www.opensource.org/licenses/mit-license.php) +# MIT License (https://opensource.org/licenses/mit-license.php) CREATE TABLE cake_sessions ( id varchar(255) NOT NULL default '', diff --git a/lib/Cake/Console/Templates/skel/Config/acl.ini.php b/lib/Cake/Console/Templates/skel/Config/acl.ini.php index 5f37e1c..1f93158 100644 --- a/lib/Cake/Console/Templates/skel/Config/acl.ini.php +++ b/lib/Cake/Console/Templates/skel/Config/acl.ini.php @@ -2,7 +2,7 @@ ;/** ; * ACL Configuration ; * -; * @link http://cakephp.org CakePHP(tm) Project +; * @link https://cakephp.org CakePHP(tm) Project ; * @package app.Config ; * @since CakePHP(tm) v 0.10.0.1076 ; */ diff --git a/lib/Cake/Console/Templates/skel/Config/acl.php b/lib/Cake/Console/Templates/skel/Config/acl.php index d008979..2fe93fe 100644 --- a/lib/Cake/Console/Templates/skel/Config/acl.php +++ b/lib/Cake/Console/Templates/skel/Config/acl.php @@ -4,7 +4,7 @@ * * Use it to configure access control of your CakePHP application. * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config * @since CakePHP(tm) v 2.1 */ diff --git a/lib/Cake/Console/Templates/skel/Config/bootstrap.php b/lib/Cake/Console/Templates/skel/Config/bootstrap.php index 0cf81be..6d05aab 100644 --- a/lib/Cake/Console/Templates/skel/Config/bootstrap.php +++ b/lib/Cake/Console/Templates/skel/Config/bootstrap.php @@ -8,7 +8,7 @@ * You should also use this file to include any files that provide global functions/constants * that your application uses. * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config * @since CakePHP(tm) v 0.10.8.2117 */ diff --git a/lib/Cake/Console/Templates/skel/Config/core.php b/lib/Cake/Console/Templates/skel/Config/core.php index 18d645a..8647776 100644 --- a/lib/Cake/Console/Templates/skel/Config/core.php +++ b/lib/Cake/Console/Templates/skel/Config/core.php @@ -4,7 +4,7 @@ * * Use it to configure core behavior of Cake. * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config * @since CakePHP(tm) v 0.2.9 */ @@ -104,7 +104,7 @@ * will override the automatic detection of full base URL and can be * useful when generating links from the CLI (e.g. sending emails) */ - //Configure::write('App.fullBaseUrl', 'http://example.com'); + //Configure::write('App.fullBaseUrl', 'https://example.com'); /** * Web path to the public images directory under webroot. @@ -273,7 +273,7 @@ * 'mask' => 0664, //[optional] * )); * - * APC (http://pecl.php.net/package/APC) + * APC (https://pecl.php.net/package/APC) * * Cache::config('default', array( * 'engine' => 'Apc', //[required] @@ -282,7 +282,7 @@ * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string * )); * - * Xcache (http://xcache.lighttpd.net/) + * Xcache (https://xcache.lighttpd.net/) * * Cache::config('default', array( * 'engine' => 'Xcache', //[required] @@ -307,7 +307,7 @@ * 'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory) * )); * - * Wincache (http://php.net/wincache) + * Wincache (https://secure.php.net/wincache) * * Cache::config('default', array( * 'engine' => 'Wincache', //[required] diff --git a/lib/Cake/Console/Templates/skel/Config/database.php.default b/lib/Cake/Console/Templates/skel/Config/database.php.default index cc549a5..202b821 100644 --- a/lib/Cake/Console/Templates/skel/Config/database.php.default +++ b/lib/Cake/Console/Templates/skel/Config/database.php.default @@ -1,6 +1,6 @@ * Array of key/value pairs, on connection it executes SET statements for each pair - * For MySQL : http://dev.mysql.com/doc/refman/5.6/en/set-statement.html - * For Postgres : http://www.postgresql.org/docs/9.2/static/sql-set.html - * For Sql Server : http://msdn.microsoft.com/en-us/library/ms190356.aspx + * For MySQL : https://dev.mysql.com/doc/refman/5.6/en/set-statement.html + * For Postgres : https://www.postgresql.org/docs/9.2/static/sql-set.html + * For Sql Server : https://msdn.microsoft.com/en-us/library/ms190356.aspx * * flags => * A key/value array of driver specific connection options. diff --git a/lib/Cake/Console/Templates/skel/Config/email.php.default b/lib/Cake/Console/Templates/skel/Config/email.php.default index 0a01e38..aadb515 100644 --- a/lib/Cake/Console/Templates/skel/Config/email.php.default +++ b/lib/Cake/Console/Templates/skel/Config/email.php.default @@ -4,7 +4,7 @@ * * Use it to configure email transports of Cake. * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config * @since CakePHP(tm) v 2.0.0 */ diff --git a/lib/Cake/Console/Templates/skel/Config/routes.php b/lib/Cake/Console/Templates/skel/Config/routes.php index 2562ebe..ac19d9f 100644 --- a/lib/Cake/Console/Templates/skel/Config/routes.php +++ b/lib/Cake/Console/Templates/skel/Config/routes.php @@ -6,7 +6,7 @@ * Routes are very important mechanism that allows you to freely connect * different URLs to chosen controllers and their actions (functions). * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Config * @since CakePHP(tm) v 0.2.9 */ diff --git a/lib/Cake/Console/Templates/skel/Console/Command/AppShell.php b/lib/Cake/Console/Templates/skel/Console/Command/AppShell.php index 04a3430..f73c35a 100644 --- a/lib/Cake/Console/Templates/skel/Console/Command/AppShell.php +++ b/lib/Cake/Console/Templates/skel/Console/Command/AppShell.php @@ -2,7 +2,7 @@ /** * AppShell file * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @since CakePHP(tm) v 2.0 */ diff --git a/lib/Cake/Console/Templates/skel/Console/cake b/lib/Cake/Console/Templates/skel/Console/cake index 6745451..fee8e35 100644 --- a/lib/Cake/Console/Templates/skel/Console/cake +++ b/lib/Cake/Console/Templates/skel/Console/cake @@ -3,18 +3,18 @@ # # Bake is a shell script for running CakePHP bake script # -# 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.Console # @since CakePHP(tm) v 1.2.0.5012 -# @license http://www.opensource.org/licenses/mit-license.php MIT License +# @license https://opensource.org/licenses/mit-license.php MIT License # ################################################################################ diff --git a/lib/Cake/Console/Templates/skel/Console/cake.bat b/lib/Cake/Console/Templates/skel/Console/cake.bat index 0aa43c0..722febf 100644 --- a/lib/Cake/Console/Templates/skel/Console/cake.bat +++ b/lib/Cake/Console/Templates/skel/Console/cake.bat @@ -2,14 +2,14 @@ :: :: Bake is a shell script for running CakePHP bake script :: -:: 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 :: 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.Console :: @since CakePHP(tm) v 2.0 :: diff --git a/lib/Cake/Console/Templates/skel/Console/cake.php b/lib/Cake/Console/Templates/skel/Console/cake.php index f5b262a..280613a 100644 --- a/lib/Cake/Console/Templates/skel/Console/cake.php +++ b/lib/Cake/Console/Templates/skel/Console/cake.php @@ -3,15 +3,15 @@ /** * Command-line code generation utility to automate programmer chores. * - * 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.Console * @since CakePHP(tm) v 2.0 */ diff --git a/lib/Cake/Console/Templates/skel/Controller/AppController.php b/lib/Cake/Console/Templates/skel/Controller/AppController.php index db4b9e2..4e927f6 100644 --- a/lib/Cake/Console/Templates/skel/Controller/AppController.php +++ b/lib/Cake/Console/Templates/skel/Controller/AppController.php @@ -5,7 +5,7 @@ * This file is application-wide controller file. You can put all * application-wide controller-related methods here. * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Controller * @since CakePHP(tm) v 0.2.9 */ @@ -19,7 +19,7 @@ * will inherit them. * * @package app.Controller - * @link http://book.cakephp.org/2.0/en/controllers.html#the-app-controller + * @link https://book.cakephp.org/2.0/en/controllers.html#the-app-controller */ class AppController extends Controller { } diff --git a/lib/Cake/Console/Templates/skel/Controller/PagesController.php b/lib/Cake/Console/Templates/skel/Controller/PagesController.php index eb023a5..75df741 100644 --- a/lib/Cake/Console/Templates/skel/Controller/PagesController.php +++ b/lib/Cake/Console/Templates/skel/Controller/PagesController.php @@ -4,7 +4,7 @@ * * This file will render views from views/pages/ * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Controller * @since CakePHP(tm) v 0.2.9 */ @@ -17,7 +17,7 @@ * Override this controller by placing a copy in controllers directory of an application * * @package app.Controller - * @link http://book.cakephp.org/2.0/en/controllers/pages-controller.html + * @link https://book.cakephp.org/2.0/en/controllers/pages-controller.html */ class PagesController extends AppController { @@ -32,6 +32,7 @@ class PagesController extends AppController { * Displays a view * * @return void + * @throws ForbiddenException When a directory traversal attempt. * @throws NotFoundException When the view file could not be found * or MissingViewException in debug mode. */ @@ -42,6 +43,9 @@ public function display() { if (!$count) { return $this->redirect('/'); } + if (in_array('..', $path, true) || in_array('.', $path, true)) { + throw new ForbiddenException(); + } $page = $subpage = $title_for_layout = null; if (!empty($path[0])) { diff --git a/lib/Cake/Console/Templates/skel/Model/AppModel.php b/lib/Cake/Console/Templates/skel/Model/AppModel.php index eef7150..cc5ca8f 100644 --- a/lib/Cake/Console/Templates/skel/Model/AppModel.php +++ b/lib/Cake/Console/Templates/skel/Model/AppModel.php @@ -5,7 +5,7 @@ * This file is application-wide model file. You can put all * application-wide model-related methods here. * - * @link http://cakephp.org CakePHP(tm) Project + * @link https://cakephp.org CakePHP(tm) Project * @package app.Model * @since CakePHP(tm) v 0.2.9 */ diff --git a/lib/Cake/Console/Templates/skel/Test/Case/AllTestsTest.php b/lib/Cake/Console/Templates/skel/Test/Case/AllTestsTest.php index 9929fa5..98b803c 100644 --- a/lib/Cake/Console/Templates/skel/Test/Case/AllTestsTest.php +++ b/lib/Cake/Console/Templates/skel/Test/Case/AllTestsTest.php @@ -2,18 +2,18 @@ /** * AllTests file * - * 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.Test.Case * @since CakePHP(tm) v 2.5 - * @license http://www.opensource.org/licenses/mit-license.php MIT License + * @license https://opensource.org/licenses/mit-license.php MIT License */ class AllTestsTest extends CakeTestSuite { diff --git a/lib/Cake/Console/Templates/skel/View/Elements/empty b/lib/Cake/Console/Templates/skel/View/Elements/empty deleted file mode 100644 index e69de29..0000000 diff --git a/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp b/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp index a1333dc..f4dd9e6 100644 --- a/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp +++ b/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp @@ -1,17 +1,17 @@ \ No newline at end of file diff --git a/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp b/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp index 6c84d88..ff6730d 100644 --- a/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp +++ b/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp @@ -1,6 +1,6 @@ fetch('content'); ?> -

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/lib/Cake/Console/Templates/skel/View/Layouts/Emails/text/default.ctp b/lib/Cake/Console/Templates/skel/View/Layouts/Emails/text/default.ctp index 5396158..82a1e19 100644 --- a/lib/Cake/Console/Templates/skel/View/Layouts/Emails/text/default.ctp +++ b/lib/Cake/Console/Templates/skel/View/Layouts/Emails/text/default.ctp @@ -1,19 +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/lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp b/lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp index f2338e6..950d4d9 100644 --- a/lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp +++ b/lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp @@ -1,6 +1,6 @@
@@ -39,7 +39,7 @@ $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework