. */ /* */ /*************************************************************************************/ namespace Thelia\Command; abstract class BaseModuleGenerate extends ContainerAwareCommand { protected $module; protected $moduleDirectory; protected $reservedKeyWords = array( "thelia" ); protected $neededDirectories = array( "Config", "Model", "Loop" ); protected function verifyExistingModule() { if (file_exists($this->moduleDirectory)) { throw new \RuntimeException(sprintf("%s module already exists", $this->module)); } } protected function formatModuleName($name) { if (in_array(strtolower($name), $this->reservedKeyWords)) { throw new \RuntimeException(sprintf("%s module name is a reserved keyword", $name)); } return ucfirst($name); } }