Skip to content

Commit 3d607f7

Browse files
committed
Make "src/" path segment part of path returned by App::pluginPath()
1 parent a920727 commit 3d607f7

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

src/Configure/Engine/IniConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ protected function _getFilePath($key) {
220220
}
221221

222222
if ($plugin) {
223-
$file = App::pluginPath($plugin) . 'src' . DS . 'Config' . DS . $key;
223+
$file = App::pluginPath($plugin) . 'Config' . DS . $key;
224224
} else {
225225
$file = $this->_path . $key;
226226
}

src/Configure/Engine/PhpConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ protected function _getFilePath($key) {
108108
$key .= '.php';
109109

110110
if ($plugin) {
111-
$file = App::pluginPath($plugin) . 'src' . DS . 'Config' . DS . $key;
111+
$file = App::pluginPath($plugin) . 'Config' . DS . $key;
112112
} else {
113113
$file = $this->_path . $key;
114114
}

src/Core/App.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public static function path($type, $plugin = null) {
140140
return (array)Configure::read('App.paths.templates');
141141
}
142142
if (!empty($plugin)) {
143-
return [static::pluginPath($plugin) . 'src' . DS . $type . DS];
143+
return [static::pluginPath($plugin) . $type . DS];
144144
}
145145
return [APP . $type . DS];
146146
}
@@ -159,7 +159,7 @@ public static function path($type, $plugin = null) {
159159
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#App::pluginPath
160160
*/
161161
public static function pluginPath($plugin) {
162-
return Plugin::path($plugin);
162+
return Plugin::path($plugin) . 'src' . DS;
163163
}
164164

165165
/**

src/I18n/I18n.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ protected function _bindTextDomain($domain) {
385385
foreach ($plugins as $plugin) {
386386
$pluginDomain = Inflector::underscore($plugin);
387387
if ($pluginDomain === $domain) {
388-
$searchPaths[] = Plugin::path($plugin) . 'src' . DS . 'Locale/';
388+
$searchPaths[] = App::pluginPath($plugin) . 'Locale/';
389389
$searchPaths = array_reverse($searchPaths);
390390
break;
391391
}

tests/TestCase/Core/AppTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,15 @@ public function testPluginPath() {
261261
Plugin::load(['TestPlugin', 'TestPluginTwo', 'Company/TestPluginThree']);
262262

263263
$path = App::pluginPath('TestPlugin');
264-
$expected = TEST_APP . 'Plugin' . DS . 'TestPlugin' . DS;
264+
$expected = TEST_APP . 'Plugin' . DS . 'TestPlugin' . DS . 'src' . DS;
265265
$this->assertPathEquals($expected, $path);
266266

267267
$path = App::pluginPath('TestPluginTwo');
268-
$expected = TEST_APP . 'Plugin' . DS . 'TestPluginTwo' . DS;
268+
$expected = TEST_APP . 'Plugin' . DS . 'TestPluginTwo' . DS . 'src' . DS;
269269
$this->assertPathEquals($expected, $path);
270270

271271
$path = App::pluginPath('Company/TestPluginThree');
272-
$expected = TEST_APP . 'Plugin' . DS . 'Company' . DS . 'TestPluginThree' . DS;
272+
$expected = TEST_APP . 'Plugin' . DS . 'Company' . DS . 'TestPluginThree' . DS . 'src' . DS;
273273
$this->assertPathEquals($expected, $path);
274274
}
275275

tests/TestCase/View/Helper/HtmlHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ public function testScriptTimestamping() {
747747
public function testPluginScriptTimestamping() {
748748
Plugin::load('TestPlugin');
749749

750-
$pluginPath = App::pluginPath('TestPlugin');
750+
$pluginPath = Plugin::path('TestPlugin');
751751
$pluginJsPath = $pluginPath . 'webroot/js';
752752
$this->skipIf(!is_writable($pluginJsPath), $pluginJsPath . ' is not Writable, timestamp testing has been skipped.');
753753

0 commit comments

Comments
 (0)