Esempio n. 1
0
 /**
  * remove domainObject related files if a domainObject was deleted
  *
  * @param \EBT\ExtensionBuilder\Domain\Model\DomainObject $domainObject
  * @return void
  */
 protected function removeDomainObjectFiles(Model\DomainObject $domainObject)
 {
     $this->log('Remove domainObject ' . $domainObject->getName());
     $this->cleanUp(FileGenerator::getFolderForClassFile($this->previousExtensionDirectory, 'Model', false), $domainObject->getName() . '.php');
     $this->cleanUp($this->previousExtensionDirectory . 'Configuration/TCA/', $domainObject->getName() . '.php');
     if ($domainObject->isAggregateRoot()) {
         $this->cleanUp(FileGenerator::getFolderForClassFile($this->previousExtensionDirectory, 'Controller', false), $domainObject->getName() . 'Controller.php');
         $this->cleanUp(FileGenerator::getFolderForClassFile($this->previousExtensionDirectory, 'Repository', false), $domainObject->getName() . 'Repository.php');
     }
     if (count($domainObject->getActions()) > 0) {
         $this->cleanUp(FileGenerator::getFolderForClassFile($this->previousExtensionDirectory, 'Controller', false), $domainObject->getName() . 'Controller.php');
     }
     // other files
     $iconsDirectory = $this->extensionDirectory . 'Resources/Public/Icons/';
     $languageDirectory = $this->extensionDirectory . 'Resources/Private/Language/';
     $locallang_cshFile = $languageDirectory . 'locallang_csh_' . $domainObject->getDatabaseTableName() . '.xml';
     $iconFile = $iconsDirectory . $domainObject->getDatabaseTableName() . '.gif';
     if (file_exists($locallang_cshFile)) {
         // no overwrite settings check here...
         unlink($locallang_cshFile);
         GeneralUtility::devLog('locallang_csh file removed: ' . $locallang_cshFile, 'extension_builder', 1);
     }
     if (file_exists($iconFile)) {
         unlink($iconFile);
         GeneralUtility::devLog('icon file removed: ' . $iconFile, 'extension_builder', 1);
     }
 }