Skip to content

Commit

Permalink
Make "src/" path segment part of path returned by App::pluginPath()
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jun 11, 2014
1 parent a920727 commit 3d607f7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Configure/Engine/IniConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ protected function _getFilePath($key) {
}

if ($plugin) {
$file = App::pluginPath($plugin) . 'src' . DS . 'Config' . DS . $key;
$file = App::pluginPath($plugin) . 'Config' . DS . $key;
} else {
$file = $this->_path . $key;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Configure/Engine/PhpConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected function _getFilePath($key) {
$key .= '.php';

if ($plugin) {
$file = App::pluginPath($plugin) . 'src' . DS . 'Config' . DS . $key;
$file = App::pluginPath($plugin) . 'Config' . DS . $key;
} else {
$file = $this->_path . $key;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Core/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static function path($type, $plugin = null) {
return (array)Configure::read('App.paths.templates');
}
if (!empty($plugin)) {
return [static::pluginPath($plugin) . 'src' . DS . $type . DS];
return [static::pluginPath($plugin) . $type . DS];
}
return [APP . $type . DS];
}
Expand All @@ -159,7 +159,7 @@ public static function path($type, $plugin = null) {
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#App::pluginPath
*/
public static function pluginPath($plugin) {
return Plugin::path($plugin);
return Plugin::path($plugin) . 'src' . DS;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/I18n/I18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ protected function _bindTextDomain($domain) {
foreach ($plugins as $plugin) {
$pluginDomain = Inflector::underscore($plugin);
if ($pluginDomain === $domain) {
$searchPaths[] = Plugin::path($plugin) . 'src' . DS . 'Locale/';
$searchPaths[] = App::pluginPath($plugin) . 'Locale/';
$searchPaths = array_reverse($searchPaths);
break;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase/Core/AppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,15 @@ public function testPluginPath() {
Plugin::load(['TestPlugin', 'TestPluginTwo', 'Company/TestPluginThree']);

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/View/Helper/HtmlHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ public function testScriptTimestamping() {
public function testPluginScriptTimestamping() {
Plugin::load('TestPlugin');

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

Expand Down

0 comments on commit 3d607f7

Please sign in to comment.