Skip to content
Permalink
Browse files

Mark App::pluginPath as deprecated and don't use it anymore.

  • Loading branch information...
dereuromark committed Jun 24, 2014
1 parent 59c3b73 commit 26fe1265abc2dbfb4f3f9f5ac69ea4978625a579
@@ -17,6 +17,7 @@
*/
App::uses('Hash', 'Utility');
App::uses('CakePlugin', 'Core');
/**
* Ini file configuration engine.
@@ -218,7 +219,7 @@ protected function _getFilePath($key) {
}
if ($plugin) {
$file = App::pluginPath($plugin) . 'Config' . DS . $key;
$file = CakePlugin::path($plugin) . 'Config' . DS . $key;
} else {
$file = $this->_path . $key;
}
@@ -15,6 +15,8 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
App::uses('CakePlugin', 'Core');
/**
* PHP Reader allows Configure to load configuration values from
* files containing simple PHP arrays.
@@ -49,7 +51,7 @@ public function __construct($path = null) {
* Read a config file and return its contents.
*
* Files with `.` in the name will be treated as values in plugins. Instead of reading from
* the initialized path, plugin keys will be located using App::pluginPath().
* the initialized path, plugin keys will be located using CakePlugin::path().
*
* @param string $key The identifier to read from. If the key has a . it will be treated
* as a plugin prefix.
@@ -105,7 +107,7 @@ protected function _getFilePath($key) {
$key .= '.php';
if ($plugin) {
$file = App::pluginPath($plugin) . 'Config' . DS . $key;
$file = CakePlugin::path($plugin) . 'Config' . DS . $key;
} else {
$file = $this->_path . $key;
}
@@ -18,6 +18,7 @@
App::uses('AppShell', 'Console/Command');
App::uses('Folder', 'Utility');
App::uses('CakePlugin', 'Core');
/**
* A shell class to help developers upgrade applications to CakePHP 2.0
@@ -102,7 +103,7 @@ public function all() {
public function tests() {
$this->_paths = array(APP . 'tests' . DS);
if (!empty($this->params['plugin'])) {
$this->_paths = array(App::pluginPath($this->params['plugin']) . 'tests' . DS);
$this->_paths = array(CakePlugin::path($this->params['plugin']) . 'tests' . DS);
}
$patterns = array(
array(
@@ -128,7 +129,7 @@ public function locations() {
$cwd = getcwd();
if (!empty($this->params['plugin'])) {
chdir(App::pluginPath($this->params['plugin']));
chdir(CakePlugin::path($this->params['plugin']));
}
if (is_dir('plugins')) {
@@ -215,7 +216,7 @@ public function helpers() {
$this->_paths = array_diff(App::path('views'), App::core('views'));
if (!empty($this->params['plugin'])) {
$this->_paths = array(App::pluginPath($this->params['plugin']) . 'views' . DS);
$this->_paths = array(CakePlugin::path($this->params['plugin']) . 'views' . DS);
}
$patterns = array();
@@ -229,7 +230,7 @@ public function helpers() {
CakePlugin::load($plugin);
$pluginHelpers = array_merge(
$pluginHelpers,
App::objects('helper', App::pluginPath($plugin) . DS . 'views' . DS . 'helpers' . DS, false)
App::objects('helper', CakePlugin::path($plugin) . DS . 'views' . DS . 'helpers' . DS, false)
);
}
$helpers = array_merge($pluginHelpers, $helpers);
@@ -260,7 +261,7 @@ public function i18n() {
APP
);
if (!empty($this->params['plugin'])) {
$this->_paths = array(App::pluginPath($this->params['plugin']));
$this->_paths = array(CakePlugin::path($this->params['plugin']));
}
$patterns = array(
@@ -299,7 +300,7 @@ public function basics() {
APP
);
if (!empty($this->params['plugin'])) {
$this->_paths = array(App::pluginPath($this->params['plugin']));
$this->_paths = array(CakePlugin::path($this->params['plugin']));
}
$patterns = array(
array(
@@ -354,7 +355,7 @@ public function request() {
$this->_paths = array_merge($views, $controllers, $components);
if (!empty($this->params['plugin'])) {
$pluginPath = App::pluginPath($this->params['plugin']);
$pluginPath = CakePlugin::path($this->params['plugin']);
$this->_paths = array(
$pluginPath . 'controllers' . DS,
$pluginPath . 'controllers' . DS . 'components' . DS,
@@ -411,7 +412,7 @@ public function configure() {
APP
);
if (!empty($this->params['plugin'])) {
$this->_paths = array(App::pluginPath($this->params['plugin']));
$this->_paths = array(CakePlugin::path($this->params['plugin']));
}
$patterns = array(
array(
@@ -433,7 +434,7 @@ public function constants() {
APP
);
if (!empty($this->params['plugin'])) {
$this->_paths = array(App::pluginPath($this->params['plugin']));
$this->_paths = array(CakePlugin::path($this->params['plugin']));
}
$patterns = array(
array(
@@ -564,7 +565,7 @@ public function exceptions() {
$this->_paths = array_merge($controllers, $components);
if (!empty($this->params['plugin'])) {
$pluginPath = App::pluginPath($this->params['plugin']);
$pluginPath = CakePlugin::path($this->params['plugin']);
$this->_paths = array(
$pluginPath . 'controllers' . DS,
$pluginPath . 'controllers' . DS . 'components' . DS,
@@ -17,6 +17,7 @@
*/
App::uses('Inflector', 'Utility');
App::uses('CakePlugin', 'Core');
/**
* App is responsible for path management, class location and class loading.
@@ -223,7 +224,7 @@ public static function path($type, $plugin = null) {
if (!empty($plugin)) {
$path = array();
$pluginPath = self::pluginPath($plugin);
$pluginPath = CakePlugin::path($plugin);
$packageFormat = self::_packageFormat();
if (!empty($packageFormat[$type])) {
foreach ($packageFormat[$type] as $f) {
@@ -360,6 +361,7 @@ public static function build($paths = array(), $mode = App::PREPEND) {
* @param string $plugin CamelCased/lower_cased plugin name to find the path of.
* @return string full path to the plugin.
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#App::pluginPath
* @deprecated Use CakePlugin::path() instead.
*/
public static function pluginPath($plugin) {
return CakePlugin::path($plugin);
@@ -552,7 +554,7 @@ public static function load($className) {
$paths[] = APP . $package . DS;
$paths[] = CAKE . $package . DS;
} else {
$pluginPath = self::pluginPath($plugin);
$pluginPath = CakePlugin::path($plugin);
$paths[] = $pluginPath . 'Lib' . DS . $package . DS;
$paths[] = $pluginPath . $package . DS;
}
@@ -430,27 +430,6 @@ public function testListObjectsInPlugin() {
App::build();
}
/**
* test that pluginPath can find paths for plugins.
*
* @return void
*/
public function testPluginPath() {
App::build(array(
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
$path = App::pluginPath('TestPlugin');
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS;
$this->assertEquals($expected, $path);
$path = App::pluginPath('TestPluginTwo');
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPluginTwo' . DS;
$this->assertEquals($expected, $path);
App::build();
}
/**
* test that themePath can find paths for themes.
*
@@ -23,6 +23,7 @@
App::uses('FormHelper', 'View/Helper');
App::uses('ClassRegistry', 'Utility');
App::uses('Folder', 'Utility');
App::uses('CakePlugin', 'Core');
if (!defined('FULL_BASE_URL')) {
define('FULL_BASE_URL', 'http://cakephp.org');
@@ -906,7 +907,7 @@ public function testScriptTimestamping() {
public function testPluginScriptTimestamping() {
CakePlugin::load('TestPlugin');
$pluginPath = App::pluginPath('TestPlugin');
$pluginPath = CakePlugin::path('TestPlugin');
$pluginJsPath = $pluginPath . 'webroot/js';
$this->skipIf(!is_writable($pluginJsPath), $pluginJsPath . ' is not Writable, timestamp testing has been skipped.');
@@ -19,6 +19,9 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
App::uses('Inflector', 'Utility');
App::uses('CakePlugin', 'Core');
/**
* Abstract class for common CoverageReport methods.
* Provides several template methods for custom output.
@@ -102,7 +105,7 @@ public function getPathFilter() {
if ($this->appTest) {
$path .= APP_DIR . DS;
} elseif ($this->pluginTest) {
$path = App::pluginPath($this->pluginTest);
$path = CakePlugin::path($this->pluginTest);
} else {
$path = CAKE;
}

0 comments on commit 26fe126

Please sign in to comment.
You can’t perform that action at this time.