Compare commits

...
2 Commits
Author SHA1 Message Date
Barry vd. Heuvel 3ac68d5446 Change order 2013-05-30 21:40:02 +03:00
Barry vd. Heuvel 26f09bccbf Throw error when compiled.php exists 2013-05-30 21:39:12 +03:00
2 changed files with 37 additions and 29 deletions
+7 -2
View File
@@ -8,6 +8,11 @@ Add the helper file to your laravel folder (not in a public folder). The file is
* SublimeText CodeIntel version: https://gist.github.com/barryvdh/5227814
### Automatic phpDoc generation for Laravel Facades
#### NOTE: run before optimising. If bootstrap/compiled.php is loaded, it doesn't work.
php artisan clear-compiled
php artisan ide-helper:generate
php artisan optimize
Require this package in your composer.json:
@@ -31,8 +36,8 @@ You can configure your composer.json to do this after each commit:
"scripts":{
"post-update-cmd":[
"php artisan optimize",
"php artisan ide-helper:generate",
"php artisan optimize"
]
},
@@ -71,4 +76,4 @@ After copying the phpdocs to your model, you can clear the file, so your IDE onl
### License
The Laravel IDE Helper Generator is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)
The Laravel IDE Helper Generator is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)
@@ -52,34 +52,37 @@ class GeneratorCommand extends Command {
*/
public function fire()
{
$filename = $this->argument('filename');
if($this->option('memory')){
$this->useMemoryDriver();
}
$this->extra = \Config::get('laravel-ide-helper::extra');
$this->nonstatic = \Config::get('laravel-ide-helper::nonstatic');
$this->onlyExtend = \Config::get('laravel-ide-helper::only_extend');
if( $this->option('helpers') || (\Config::get('laravel-ide-helper::include_helpers') && ! $this->option('nohelpers'))){
$this->helpers = \Config::get('laravel-ide-helper::helper_files');
if (file_exists($compiled = base_path().'/bootstrap/compiled.php')){
$this->error('Error: first delete bootstrap/compiled.php (php artisan clear-compiled)');
}else{
$this->helpers = array();
}
$this->sublime = $this->option('sublime') || \Config::get('laravel-ide-helper::sublime');
$content = $this->generateDocs();
$written = \File::put($filename, $content);
if($written !== false){
$this->info("A new helper file was written to $filename");
}else{
$this->error("The helper file could not be created at $filename");
}
$filename = $this->argument('filename');
if($this->option('memory')){
$this->useMemoryDriver();
}
$this->extra = \Config::get('laravel-ide-helper::extra');
$this->nonstatic = \Config::get('laravel-ide-helper::nonstatic');
$this->onlyExtend = \Config::get('laravel-ide-helper::only_extend');
if( $this->option('helpers') || (\Config::get('laravel-ide-helper::include_helpers') && ! $this->option('nohelpers'))){
$this->helpers = \Config::get('laravel-ide-helper::helper_files');
}else{
$this->helpers = array();
}
$this->sublime = $this->option('sublime') || \Config::get('laravel-ide-helper::sublime');
$content = $this->generateDocs();
$written = \File::put($filename, $content);
if($written !== false){
$this->info("A new helper file was written to $filename");
}else{
$this->error("The helper file could not be created at $filename");
}
}
}
protected function useMemoryDriver(){