mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-08 04:22:40 +00:00
Updating PluginTask to filter out paths that don't exist, and not offer
them as options for baking plugins into. Fixes #1723
This commit is contained in:
parent
68482be3f1
commit
87bccdafe6
2 changed files with 39 additions and 4 deletions
|
@ -90,7 +90,6 @@ class PluginTask extends Shell {
|
|||
public function bake($plugin) {
|
||||
$pluginPath = Inflector::camelize($plugin);
|
||||
$pathOptions = App::path('plugins');
|
||||
var_dump($pathOptions);
|
||||
if (count($pathOptions) > 1) {
|
||||
$this->findPath($pathOptions);
|
||||
}
|
||||
|
@ -164,6 +163,11 @@ class PluginTask extends Shell {
|
|||
*/
|
||||
public function findPath($pathOptions) {
|
||||
$valid = false;
|
||||
foreach ($pathOptions as $i =>$path) {
|
||||
if(!is_dir($path)) {
|
||||
array_splice($pathOptions, $i, 1);
|
||||
}
|
||||
}
|
||||
$max = count($pathOptions);
|
||||
while (!$valid) {
|
||||
foreach ($pathOptions as $i => $option) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue