Пример #1
0
 /**
  * Create runner
  *
  * @param \Phrekyll\Autoloader $loader Instance of auto-loader
  * @param array $paths Folder paths
  */
 public function __construct($loader)
 {
     $this->paths = $loader->getPaths();
     $this->loader = $loader;
     $this->outputter = new Outputter();
     // load main config
     $yaml = file_get_contents($this->paths['configs'] . 'phrekyll.yml');
     $this->config = Yaml::parse($yaml);
 }
Пример #2
0
 /**
  * If configuration options are passed then twig environment
  * is initialized right away
  *
  * @param array $options Processor options
  *
  * @return \Phrekyll\Processor\Twig
  */
 public function __construct($options = array())
 {
     $path = Loader::getInstance()->getPath('library');
     if (count($options)) {
         $this->setConfig($options)->getEnvironment();
     }
 }
Пример #3
0
 private function autoloadPlugins($plugins)
 {
     $loader = \Phrekyll\Autoloader::getInstance()->getLoader();
     $plugins .= '/plugins/';
     if (is_dir($plugins)) {
         $loader->add('PhrekyllPlugin', $plugins);
     }
 }
Пример #4
0
 /**
  * If configuration options are passes then twig environment
  * is initialized right away
  *
  * @param array $options Processor options
  *
  * @return void
  */
 public function __construct($options = array())
 {
     $path = Loader::getInstance()->getPath('library');
     require_once $path . '/Vendor/Extra/scss.inc.php';
     if (count($options)) {
         $this->setConfig($options)->getEnvironment();
     }
 }
Пример #5
0
 public function setUp()
 {
     $this->phr = realpath(__DIR__ . '/../../../bin/phrekyll.php');
     $this->fout = tmpfile();
     $this->outputter = new Outputter($this->fout, null);
     require_once 'Phrekyll/Autoloader.php';
     $loader = Loader::getInstance();
     $this->runner = new Runner($loader);
     $this->runner->setOutputter($this->outputter, $this->outputter);
 }
Пример #6
0
 private function getAppConfig()
 {
     if (null === $this->appConfig) {
         $path = Loader::getInstance()->getPath('configs') . '/phrekyll.yml';
         $this->appConfig = Yaml::parse(file_get_contents($path));
     }
     return $this->appConfig;
 }
Пример #7
0
 /**
  * Make sure that absolute application path is prepended to config paths
  *
  * @return \Phrekyll\Config
  */
 public function updatePaths()
 {
     if (isset($this->configs['paths'])) {
         $paths = Loader::getInstance()->getPaths();
         foreach ($this->configs['paths'] as $key => $file) {
             $file = str_replace('@PEAR-DIR@', $paths['php_dir'], $file);
             $file = str_replace('@DATA-DIR@', $paths['data_dir'], $file);
             $this->configs['paths'][$key] = $file;
         }
     }
     return $this;
 }