mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-14 19:08:25 +00:00
Partial migration of folders to camelcase in app
This commit is contained in:
parent
ac0ec44f51
commit
6737380deb
154 changed files with 88 additions and 44 deletions
|
@ -203,7 +203,7 @@ class App {
|
|||
$path[] = sprintf($f, $pluginPath);
|
||||
}
|
||||
}
|
||||
$path[] = $pluginPath . 'libs' . DS . $type . DS;
|
||||
$path[] = $pluginPath . 'Lib' . DS . $type . DS;
|
||||
return $path;
|
||||
}
|
||||
|
||||
|
@ -233,32 +233,61 @@ class App {
|
|||
public static function build($paths = array(), $reset = false) {
|
||||
if (empty(self::$__packageFormat)) {
|
||||
self::$__packageFormat = array(
|
||||
'Model' => array('%s' . 'models' . DS),
|
||||
'Model/Behavior' => array('%s' . 'models' . DS . 'behaviors' . DS),
|
||||
'Model/Datasource' => array('%s' . 'models' . DS . 'datasources' . DS),
|
||||
'Model/Datasource/Database' => array('%s' . 'models' . DS . 'datasources' . DS . 'database' . DS),
|
||||
'Model/Datasource/Session' => array('%s' . 'models' . DS . 'datasources' . DS . 'session' . DS),
|
||||
'Controller' => array('%s' . 'controllers' . DS),
|
||||
'Controller/Component' => array('%s' . 'controllers' . DS . 'components' . DS),
|
||||
'View' => array('%s' . 'views' . DS),
|
||||
'View/Helper' => array('%s' . 'views' . DS . 'helpers' . DS),
|
||||
'Model' => array(
|
||||
'%s' . 'Model' . DS,
|
||||
'%s' . 'models' . DS
|
||||
),
|
||||
'Model/Behavior' => array(
|
||||
'%s' . 'Model' . DS . 'Behavior' . DS,
|
||||
'%s' . 'models' . DS . 'behaviors' . DS
|
||||
),
|
||||
'Model/Datasource' => array(
|
||||
'%s' . 'Model' . DS . 'Datasource' . DS,
|
||||
'%s' . 'models' . DS . 'datasources' . DS
|
||||
),
|
||||
'Model/Datasource/Database' => array(
|
||||
'%s' . 'Model' . DS . 'Datasource' . DS . 'Database' . DS,
|
||||
'%s' . 'models' . DS . 'datasources' . DS . 'database' . DS
|
||||
),
|
||||
'Model/Datasource/Session' => array(
|
||||
'%s' . 'Model' . DS . 'Datasource' . DS . 'Session' . DS,
|
||||
'%s' . 'models' . DS . 'datasources' . DS . 'session' . DS
|
||||
),
|
||||
'Controller' => array(
|
||||
'%s' . 'Controller' . DS,
|
||||
'%s' . 'controllers' . DS
|
||||
),
|
||||
'Controller/Component' => array(
|
||||
'%s' . 'Controller' . DS . 'Component' . DS,
|
||||
'%s' . 'controllers' . DS . 'components' . DS
|
||||
),
|
||||
'View' => array(
|
||||
'%s' . 'View' . DS,
|
||||
'%s' . 'views' . DS
|
||||
),
|
||||
'View/Helper' => array(
|
||||
'%s' . 'View' . DS . 'Helper' . DS,
|
||||
'%s' . 'views' . DS . 'helpers' . DS
|
||||
),
|
||||
'Console' => array(
|
||||
'%s' . 'console' . DS,
|
||||
'%s' . 'vendors' . DS . 'shells' . DS,
|
||||
VENDORS . 'shells' . DS
|
||||
'%s' . 'Console' . DS,
|
||||
'%s' . 'console' . DS
|
||||
),
|
||||
'Console/Command' => array(
|
||||
'%s' . 'Console' . DS . 'Command' . DS,
|
||||
'%s' . 'console' . DS . 'shells' . DS,
|
||||
'%s' . 'vendors' . DS . 'shells' . DS,
|
||||
VENDORS . 'shells' . DS
|
||||
),
|
||||
'Console/Command/Task' => array(
|
||||
'%s' . 'console' . DS . 'shells' . DS . 'tasks' . DS,
|
||||
'%s' . 'vendors' . DS . 'shells' . DS . 'tasks' . DS,
|
||||
VENDORS . 'shells' . DS . 'tasks' . DS
|
||||
'%s' . 'Console' . DS . 'Command' . DS . 'Task' . DS,
|
||||
'%s' . 'console' . DS . 'shells' . DS . 'tasks' . DS
|
||||
),
|
||||
'Lib' => array(
|
||||
'%s' . 'Lib' . DS,
|
||||
'%s' . 'libs' . DS
|
||||
),
|
||||
'locales' => array(
|
||||
'%s' . 'locale' . DS
|
||||
),
|
||||
'Lib' => array('%s' . 'libs' . DS),
|
||||
'locales' => array('%s' . 'locale' . DS),
|
||||
'vendors' => array('%s' . 'vendors' . DS, VENDORS),
|
||||
'plugins' => array(APP . 'plugins' . DS, CAKE_CORE_INCLUDE_PATH . DS . 'plugins' . DS)
|
||||
);
|
||||
|
|
|
@ -44,7 +44,7 @@ class CommandListTest extends CakeTestCase {
|
|||
LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
|
||||
),
|
||||
'Console/Command' => array(
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'console' . DS . 'shells' . DS
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
|
||||
)
|
||||
), true);
|
||||
App::objects('plugin', null, false);
|
||||
|
|
|
@ -70,7 +70,7 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
public function testExecute() {
|
||||
$this->Task->interactive = false;
|
||||
|
||||
$this->Task->params['paths'] = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'pages';
|
||||
$this->Task->params['paths'] = LIBS . 'tests' . DS . 'test_app' . DS . 'View' . DS . 'pages';
|
||||
$this->Task->params['output'] = $this->path . DS;
|
||||
$this->Task->expects($this->never())->method('err');
|
||||
$this->Task->expects($this->any())->method('in')
|
||||
|
@ -157,7 +157,7 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
function testExtractWithExclude() {
|
||||
$this->Task->interactive = false;
|
||||
|
||||
$this->Task->params['paths'] = LIBS . 'tests' . DS . 'test_app' . DS . 'views';
|
||||
$this->Task->params['paths'] = LIBS . 'tests' . DS . 'test_app' . DS . 'View';
|
||||
$this->Task->params['output'] = $this->path . DS;
|
||||
$this->Task->params['exclude'] = 'pages,layouts';
|
||||
|
||||
|
@ -184,8 +184,8 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
$this->Task->interactive = false;
|
||||
|
||||
$this->Task->params['paths'] =
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'pages,' .
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'posts';
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'View' . DS . 'pages,' .
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'View' . DS . 'posts';
|
||||
|
||||
$this->Task->params['output'] = $this->path . DS;
|
||||
$this->Task->expects($this->never())->method('err');
|
||||
|
|
|
@ -16,6 +16,7 @@ class AppImportTest extends CakeTestCase {
|
|||
function testBuild() {
|
||||
$old = App::path('Model');
|
||||
$expected = array(
|
||||
APP . 'Model' . DS,
|
||||
APP . 'models' . DS
|
||||
);
|
||||
$this->assertEqual($expected, $old);
|
||||
|
@ -26,6 +27,7 @@ class AppImportTest extends CakeTestCase {
|
|||
|
||||
$expected = array(
|
||||
'/path/to/models/',
|
||||
APP . 'Model' . DS,
|
||||
APP . 'models' . DS
|
||||
);
|
||||
$this->assertEqual($expected, $new);
|
||||
|
@ -44,6 +46,7 @@ class AppImportTest extends CakeTestCase {
|
|||
function testCompatibleBuild() {
|
||||
$old = App::path('models');
|
||||
$expected = array(
|
||||
APP . 'Model' . DS,
|
||||
APP . 'models' . DS
|
||||
);
|
||||
$this->assertEqual($expected, $old);
|
||||
|
@ -54,6 +57,7 @@ class AppImportTest extends CakeTestCase {
|
|||
|
||||
$expected = array(
|
||||
'/path/to/models/',
|
||||
APP . 'Model' . DS,
|
||||
APP . 'models' . DS
|
||||
);
|
||||
$this->assertEqual($expected, $new);
|
||||
|
@ -62,6 +66,7 @@ class AppImportTest extends CakeTestCase {
|
|||
App::build(array('datasources' => array('/path/to/datasources/')));
|
||||
$expected = array(
|
||||
'/path/to/datasources/',
|
||||
APP . 'Model' . DS . 'Datasource' . DS,
|
||||
APP . 'models' . DS . 'datasources' . DS
|
||||
);
|
||||
$result = App::path('datasources');
|
||||
|
@ -71,6 +76,7 @@ class AppImportTest extends CakeTestCase {
|
|||
App::build(array('behaviors' => array('/path/to/behaviors/')));
|
||||
$expected = array(
|
||||
'/path/to/behaviors/',
|
||||
APP . 'Model' . DS . 'Behavior' . DS,
|
||||
APP . 'models' . DS . 'behaviors' . DS
|
||||
);
|
||||
$result = App::path('behaviors');
|
||||
|
@ -80,6 +86,7 @@ class AppImportTest extends CakeTestCase {
|
|||
App::build(array('controllers' => array('/path/to/controllers/')));
|
||||
$expected = array(
|
||||
'/path/to/controllers/',
|
||||
APP . 'Controller' . DS,
|
||||
APP . 'controllers' . DS
|
||||
);
|
||||
$result = App::path('controllers');
|
||||
|
@ -89,6 +96,7 @@ class AppImportTest extends CakeTestCase {
|
|||
App::build(array('components' => array('/path/to/components/')));
|
||||
$expected = array(
|
||||
'/path/to/components/',
|
||||
APP . 'Controller' . DS . 'Component' . DS,
|
||||
APP . 'controllers' . DS . 'components' . DS
|
||||
);
|
||||
$result = App::path('components');
|
||||
|
@ -98,6 +106,7 @@ class AppImportTest extends CakeTestCase {
|
|||
App::build(array('views' => array('/path/to/views/')));
|
||||
$expected = array(
|
||||
'/path/to/views/',
|
||||
APP . 'View' . DS,
|
||||
APP . 'views' . DS
|
||||
);
|
||||
$result = App::path('views');
|
||||
|
@ -107,6 +116,7 @@ class AppImportTest extends CakeTestCase {
|
|||
App::build(array('helpers' => array('/path/to/helpers/')));
|
||||
$expected = array(
|
||||
'/path/to/helpers/',
|
||||
APP . 'View' . DS . 'Helper' .DS,
|
||||
APP . 'views' . DS . 'helpers' . DS
|
||||
);
|
||||
$result = App::path('helpers');
|
||||
|
@ -116,9 +126,8 @@ class AppImportTest extends CakeTestCase {
|
|||
App::build(array('shells' => array('/path/to/shells/')));
|
||||
$expected = array(
|
||||
'/path/to/shells/',
|
||||
APP . 'Console' . DS . 'Command' . DS,
|
||||
APP . 'console' . DS . 'shells' . DS,
|
||||
APP . 'vendors' . DS . 'shells' . DS,
|
||||
ROOT . DS . 'vendors' . DS . 'shells' . DS
|
||||
);
|
||||
$result = App::path('shells');
|
||||
$this->assertEqual($expected, $result);
|
||||
|
@ -138,6 +147,7 @@ class AppImportTest extends CakeTestCase {
|
|||
function testBuildWithReset() {
|
||||
$old = App::path('Model');
|
||||
$expected = array(
|
||||
APP . 'Model' . DS,
|
||||
APP . 'models' . DS
|
||||
);
|
||||
$this->assertEqual($expected, $old);
|
||||
|
|
|
@ -948,7 +948,7 @@ class AuthTest extends CakeTestCase {
|
|||
*/
|
||||
function testAjaxLogin() {
|
||||
App::build(array(
|
||||
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
|
||||
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS)
|
||||
));
|
||||
$_SERVER['HTTP_X_REQUESTED_WITH'] = "XMLHttpRequest";
|
||||
|
||||
|
|
|
@ -670,7 +670,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*/
|
||||
function testAjaxRedirectAsRequestAction() {
|
||||
App::build(array(
|
||||
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
|
||||
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS)
|
||||
), true);
|
||||
|
||||
$this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components));
|
||||
|
@ -699,7 +699,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*/
|
||||
function testAjaxRedirectAsRequestActionStillRenderingLayout() {
|
||||
App::build(array(
|
||||
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
|
||||
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS)
|
||||
), true);
|
||||
|
||||
$this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components));
|
||||
|
|
|
@ -439,8 +439,8 @@ class ControllerTest extends CakeTestCase {
|
|||
function testLoadModelInPlugins() {
|
||||
App::build(array(
|
||||
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
|
||||
'Controller' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'controllers' . DS),
|
||||
'Model' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS)
|
||||
'Controller' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'Controller' . DS),
|
||||
'Model' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'Model' . DS)
|
||||
));
|
||||
App::uses('TestPluginAppController', 'TestPlugin.Controller');
|
||||
App::uses('TestPluginController', 'TestPlugin.Controller');
|
||||
|
@ -578,7 +578,7 @@ class ControllerTest extends CakeTestCase {
|
|||
$this->assertEqual($result, $expected);
|
||||
|
||||
App::build(array(
|
||||
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
|
||||
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS)
|
||||
));
|
||||
$Controller = new Controller($request);
|
||||
$Controller->response = $this->getMock('CakeResponse', array('_sendHeader'));
|
||||
|
@ -640,7 +640,7 @@ class ControllerTest extends CakeTestCase {
|
|||
*/
|
||||
function testRender() {
|
||||
App::build(array(
|
||||
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
|
||||
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS)
|
||||
), true);
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
$request->params['action'] = 'index';
|
||||
|
@ -684,11 +684,9 @@ class ControllerTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
function testComponentBeforeRenderChangingViewClass() {
|
||||
$core = App::core('views');
|
||||
App::build(array(
|
||||
'views' => array(
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS,
|
||||
$core[0]
|
||||
'View' => array(
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS
|
||||
)
|
||||
), true);
|
||||
$Controller = new Controller($this->getMock('CakeRequest'));
|
||||
|
|
|
@ -44,7 +44,9 @@ class PagesControllerTest extends CakeTestCase {
|
|||
*/
|
||||
function testDisplay() {
|
||||
App::build(array(
|
||||
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS, LIBS . 'libs' . DS . 'view' . DS)
|
||||
'View' => array(
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS
|
||||
)
|
||||
));
|
||||
$Pages = new PagesController(new CakeRequest(null, false));
|
||||
|
||||
|
|
|
@ -141,7 +141,9 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
function testGetPluginDataSourceAndLocalDriver() {
|
||||
App::build(array(
|
||||
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
|
||||
'Model/Datasource/Database' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS . 'datasources' . DS . 'Database' . DS)
|
||||
'Model/Datasource/Database' => array(
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS . 'Database' . DS
|
||||
)
|
||||
));
|
||||
|
||||
$name = 'test_plugin_source_and_local_driver';
|
||||
|
@ -262,7 +264,9 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
function testConnectionData() {
|
||||
App::build(array(
|
||||
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
|
||||
'Model/Datasource' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS . 'datasources' . DS)
|
||||
'Model/Datasource' => array(
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS
|
||||
)
|
||||
));
|
||||
|
||||
$expected = array(
|
||||
|
|
|
@ -518,7 +518,7 @@ class HelperTest extends CakeTestCase {
|
|||
Configure::write('Asset.timestamp', 'force');
|
||||
App::build(array(
|
||||
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
|
||||
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS),
|
||||
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View' . DS),
|
||||
));
|
||||
|
||||
$result = $this->Helper->assetTimestamp('/test_plugin/css/test_plugin_asset.css');
|
||||
|
@ -757,7 +757,7 @@ class HelperTest extends CakeTestCase {
|
|||
$this->Helper->theme = 'test_theme';
|
||||
|
||||
App::build(array(
|
||||
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
|
||||
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS)
|
||||
));
|
||||
|
||||
$result = $this->Helper->webroot('/img/cake.power.gif');
|
||||
|
|
|
@ -260,8 +260,9 @@ class ViewTest extends CakeTestCase {
|
|||
|
||||
$expected = array(
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'plugins' . DS . 'test_plugin' . DS,
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'View' . DS,
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'views' . DS,
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'libs' . DS . 'View' . DS,
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'Lib' . DS . 'View' . DS,
|
||||
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS,
|
||||
LIBS . 'View' . DS
|
||||
);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue