protected function copy(Gpf_Io_File $source, Gpf_Io_File $target) { parent::copy($source, $target); $installedTemplate = new Gpf_Db_InstalledTemplate(); $installedTemplate->setName(substr($source->getFileName(), $this->sourceOffset)); $installedTemplate->setContentHash(md5($source->getContents())); $installedTemplate->insert(); }
public function __construct(Gpf_Io_File $source, Gpf_Io_File $target) { parent::__construct($source, $target, 0777); }
private function copy($name) { $source = new Gpf_Io_File(Gpf_Paths::getInstance()->getInstallDirectoryPath() . $name); $target = new Gpf_Io_File(Gpf_Paths::getInstance()->getAccountsPath() . $this->account->getId() . '/' . $name); try { $task = new Gpf_Install_CopyDirectoryTask($source, $target, 0777); $task->run($this->maxRunTime); } catch (Gpf_Tasks_LongTaskInterrupt $e) { throw $e; } catch (Exception $e) { throw new Gpf_Exception($this->_('Error during creating account directory %s (%s). Please delete it and try again.', $target->getFileName(), $e->getMessage())); } }