/** * copy $path to webmodulePublicDir/$path */ protected function copy($path) { $dest = Environment::getVariable('webtempDir') . '/' . static::ID . '/' . $path; $src = $this->buildSrcPath() . $path; if (!file_exists($dest)) { if (file_exists($src)) { Basic::copyr($src, $dest); } else { throw new ArgumentOutOfRangeException("Source path '{$src}' does NOT exist"); } } }
protected function beforeRender() { parent::beforeRender(); //copy assets to webtemp $relPath = "/webtemp/acl"; $src = __DIR__ . "/../../assets"; $dest = WWW_DIR . $relPath; if (!file_exists($dest)) { if (file_exists($src)) { Basic::copyr($src, $dest); } else { throw new ArgumentOutOfRangeException("Source path '{$src}' does NOT exist"); } } $this->template->assetsBasePath = Environment::getVariable('basePath') . $relPath; $this->template->current = $this->getPresenter()->getName(); }
/** * copy $path to webmodulePublicDir/$path * @param string * @param bool is copied file mandatory? */ protected function copy($path, $need = true) { $dest = Basic::addLastSlash(self::$webloaderDestPath) . $path; $src = Basic::addLastSlash(self::$webloaderSrcPath) . $path; if (!file_exists($dest)) { if (file_exists($src)) { Basic::copyr($src, $dest); } elseif ($need) { throw new ArgumentOutOfRangeException("Source path '{$src}' does NOT exist"); } } }