mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-19 02:23:11 +00:00
Only allow relative path
This commit is contained in:
@@ -93,7 +93,7 @@ class ModelsCommand extends Command {
|
|||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array('filename', 'F', InputOption::VALUE_OPTIONAL, 'The path to the helper file', '_ide_helper_models.php'),
|
array('filename', 'F', InputOption::VALUE_OPTIONAL, 'The path to the helper file', '_ide_helper_models.php'),
|
||||||
array('dir', 'D', InputOption::VALUE_OPTIONAL, 'The model dir', app_path().'/models'),
|
array('dir', 'D', InputOption::VALUE_OPTIONAL, 'The model dir','models'),
|
||||||
array('write', 'W', InputOption::VALUE_NONE, 'Write to Model file'),
|
array('write', 'W', InputOption::VALUE_NONE, 'Write to Model file'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -141,13 +141,12 @@ class ModelsCommand extends Command {
|
|||||||
|
|
||||||
|
|
||||||
protected function loadModels(){
|
protected function loadModels(){
|
||||||
$dir = $this->dir;
|
$dir = base_path().'/'.$this->dir;
|
||||||
if(!file_exists($dir)){
|
|
||||||
$dir = base_path().'/'.$dir;
|
|
||||||
}
|
|
||||||
$models = array();
|
$models = array();
|
||||||
foreach(ClassMapGenerator::createMap($dir) as $model=> $path){
|
if(file_exists($dir)){
|
||||||
$models[] = $model;
|
foreach(ClassMapGenerator::createMap($dir) as $model=> $path){
|
||||||
|
$models[] = $model;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $models;
|
return $models;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user