Make doctrine optional

Not needed for most people.
This commit is contained in:
Barry vd. Heuvel
2014-06-29 12:35:57 +02:00
parent 138b3deeb1
commit 0b70167182
3 changed files with 16 additions and 6 deletions
@@ -126,6 +126,8 @@ class ModelsCommand extends Command {
*/
\n\n";
$hasDoctrine = interface_exists('Doctrine\DBAL\Driver');
if(empty($loadModels)){
$models = $this->loadModels();
}else{
@@ -158,7 +160,9 @@ class ModelsCommand extends Command {
}
$model = new $name();
$this->getPropertiesFromTable($model);
if($hasDoctrine){
$this->getPropertiesFromTable($model);
}
$this->getPropertiesFromMethods($model);
$output .= $this->createPhpDocs($name);
}catch(\Exception $e){
@@ -169,6 +173,10 @@ class ModelsCommand extends Command {
}
}
if(!$hasDoctrine){
$this->error("Warning: 'doctrine/dbal: ~2.3' is required to load database information. Please require that in your composer.json and run 'composer update'.");
}
return $output;