public function renderTemplate($context, $filename = null) { $filename = is_null($filename) ? $this->options->filename : $filename; $filepath = $this->options->dirpath . Gongo_File_Path::make($filename . '.html'); $template = file_get_contents($filepath); return $this->renderer->render($template, $context); }
function _cachePath() { if (!$this->path->temp) { return false; } $path = $this->path->temp . Gongo_File_Path::make('/twig/'); Gongo_File::makeDir($path); return $path; }
public function renderTemplate($context, $filename = null) { $filename = is_null($filename) ? $this->options->filename : $filename; $filepath = $this->options->dirpath . Gongo_File_Path::make($filename . '.php'); extract($context); ob_start(); include $filepath; return ob_get_clean(); }
function _compiledTemplatePath() { if (!$this->path->temp) { return false; } $path = $this->path->temp . Gongo_File_Path::make('/smarty2/templates_c/'); Gongo_File::makeDir($path); return $path; }
function cachePath($name = null) { if (!$this->path->temp) { return false; } $name = is_null($name) ? $this->name : $name; $path = $this->path->temp . Gongo_File_Path::make('/' . $name . '/'); Gongo_File::makeDir($path); return $path; }
public function renderTemplate($context, $filename = null) { $filename = is_null($filename) ? $this->options->filename : $filename; $filepath = $this->options->dirpath . Gongo_File_Path::make($filename . '.html'); $this->renderer->setTemplate($filepath); foreach ($context as $key => $value) { $this->renderer->{$key} = $value; } return $this->renderer->execute(); }
public function renderTemplate($context, $filename = null) { $filename = is_null($filename) ? $this->options->filename : $filename; $filepath = $this->options->dirpath . Gongo_File_Path::make($filename . '.haml'); $cachepath = Gongo_App::$environment->path->phamlp->cachePath . Gongo_File_Path::make($filename . '.php'); $this->cache->updateFile($filepath, $cachepath, $this->_compile()); extract($context); ob_start(); include $cachepath; return ob_get_clean(); }
public function initSmarty($smarty) { $envpath = Gongo_App::$environment->path; if ($this->dirpath()) { $smarty->template_dir = Gongo_File_Path::make($this->dirpath()); } else { $smarty->template_dir = $envpath->smarty3->templatePath; } $smarty->compile_dir = $envpath->smarty3->compiledTemplatePath; $smarty->config_dir = $envpath->smarty3->configPath; $smarty->cache_dir = $envpath->smarty3->cachePath; return $smarty; }
static function autoload($className) { $ns = ''; if (false !== ($lastNsPos = strrpos($className, '\\'))) { $ns = Gongo_File_Path::make(strtr(substr($className, $lastNsPos), array('\\' => '/'))); $className = substr($className, $lastNsPos + 1); } $filePath = Gongo_File_Path::make('/' . strtr($className, array('_' => '/')) . '.php'); $paths = self::$environment->autoloadPaths; foreach ($paths as $path) { if (is_file($path . $ns . $filePath)) { require $path . $ns . $filePath; return; } } }
public function download($path, $filename = null, $nosniff = true) { $filename = is_null($filename) ? Gongo_File_Path::basename($path) : $filename; if ($nosniff) { header('X-Content-Type-Options: nosniff'); } header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Description: File Transfer"); header("Content-Disposition: attachment; filename={$filename}"); header("Content-Transfer-Encoding: binary"); header("Content-Length: " . filesize($path)); readfile($path); exit; }
function _libraryPath() { return $this->path->lib . Gongo_File_Path::make('/Mustache/Autoloader.php'); }
function _libraryPath() { return $this->path->lib . Gongo_File_Path::make('/PHPTAL/PHPTAL.php'); }
function _libraryPath() { return $this->path->lib . Gongo_File_Path::make('/dwoo/dwooAutoload.php'); }
function _libraryPath() { return $this->path->lib . Gongo_File_Path::make('/Fammel/fammel.php'); }
function _lib() { return $this->webapp . Gongo_File_Path::make('/lib'); }
static function mvDir($src, $dst, $overwrite = false) { $success = true; if (!file_exists($src)) { return false; } if (!file_exists($dst)) { self::makeDir($dst); } if (!is_dir($dst)) { return false; } $dstpath = rtrim($dst, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . Gongo_File_Path::basename($src); if (!$overwrite && file_exists($dstpath)) { return false; } if (is_file($src)) { if (!self::mv($src, $dstpath)) { return false; } } else { if (is_dir($src)) { self::makeDir($dstpath); $src = rtrim($src, DIRECTORY_SEPARATOR); foreach (scandir($src) as $filename) { if ($filename === '.' || $filename === '..') { continue; } if ($filename[0] === '.') { continue; } if (!self::mvDir($src . DIRECTORY_SEPARATOR . $filename, $dstpath, $overwrite)) { $success = false; } } self::rmDir($src); } } return $success; }
public function makeControllerClassPath($className) { $appPath = Gongo_App::$environment->path->app; return $appPath . Gongo_File_Path::make('/' . strtr($className, array('_' => '/'))) . '.php'; }
public function renderTemplate($context, $filename = null) { $filename = is_null($filename) ? $this->options->filename : $filename; $filepath = $this->options->dirpath . Gongo_File_Path::make($filename . '.tpl'); return $this->renderer->get($filepath, $context); }
function _libraryPath() { return $this->path->lib . Gongo_File_Path::make('/phamlp/haml/HamlParser.php'); }
function _img() { return $this->assets . Gongo_File_Path::make('/img'); }
function _preloadPaths() { $paths = $this->config->Path->preload; return Gongo_File_Path::preparePaths($paths, $this->path->root); }