/** * Create runner * * @param \Phrozn\Autoloader $loader Instance of auto-loader * @param array $paths Folder paths */ public function __construct($loader) { $this->paths = $loader->getPaths(); $this->loader = $loader; // load main config $this->config = Yaml::load($this->paths['configs'] . 'phrozn.yml'); }
/** * If configuration options are passed then twig environment * is initialized right away * * @param array $options Processor options * * @return \Phrozn\Processor\Twig */ public function __construct($options = array()) { $path = Loader::getInstance()->getPath('library'); if (count($options)) { $this->setConfig($options)->getEnvironment(); } }
private function autoloadPlugins($plugins) { $loader = \Phrozn\Autoloader::getInstance()->getLoader(); $plugins .= '/plugins/'; if (is_dir($plugins)) { $loader->add('PhroznPlugin', $plugins); } }
/** * 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(); } }
public function setUp() { $this->outputter = new Outputter($this); $this->fout = fopen(self::STDOUT, 'w+'); define('STDOUT', $this->fout); require_once 'Phrozn/Autoloader.php'; $loader = Loader::getInstance(); $this->runner = new Runner($loader); }
public function setUp() { $this->phr = realpath(__DIR__ . '/../../../bin/phrozn.php'); $this->outputter = new Outputter($this); $this->fout = tmpfile(); define('STDOUT', $this->fout); require_once 'Phrozn/Autoloader.php'; $loader = Loader::getInstance(); $this->runner = new Runner($loader); }
/** * If configuration options are passed then twig environment * is initialized right away * * @param array $options Processor options * * @return \Phrozn\Processor\Twig */ public function __construct($options = array()) { $path = Loader::getInstance()->getPath('library'); // Twig uses perverted file naming (due to absense of NSs at a time it was written) // so fire up its own autoloader require_once $path . '/Vendor/Twig/Autoloader.php'; \Twig_Autoloader::register(); if (count($options)) { $this->setConfig($options)->getEnvironment(); } }
#!/usr/bin/env php <?php use Phrozn\Autoloader as Loader; error_reporting(E_ALL & ~E_NOTICE); // rely on configuration files require_once dirname(__FILE__) . '/../Phrozn/Autoloader.php'; $loader = Loader::getInstance()->getLoader(); $config = new \Phrozn\Config(dirname(__FILE__) . '/../configs/'); require_once 'PEAR/PackageFileManager2.php'; PEAR::setErrorHandling(PEAR_ERROR_DIE); $pack = new PEAR_PackageFileManager2(); $outputDir = realpath(dirname(__FILE__) . '/../') . '/'; $inputDir = realpath(dirname(__FILE__) . '/../'); $e = $pack->setOptions(array('baseinstalldir' => '/', 'packagedirectory' => $inputDir, 'ignore' => array('build/', 'tests/', 'extras/', 'plugin/', 'phrozn.png', '*.tgz', 'bin/release', 'tags'), 'outputdirectory' => $outputDir, 'simpleoutput' => true, 'roles' => array('textile' => 'doc'), 'dir_roles' => array('Phrozn' => 'php', 'configs' => 'data', 'skeleton' => 'data', 'tests' => 'test'), 'exceptions' => array('bin/phrozn.php' => 'script', 'bin/phr.php' => 'script', 'LICENSE' => 'doc'), 'installexceptions' => array(), 'clearchangelog' => true)); $pack->setPackage('Phrozn'); $pack->setSummary($config['phrozn']['summary']); $pack->setDescription($config['phrozn']['description']); $pack->setChannel('pear.phrozn.info'); $pack->setPackageType('php'); // this is a PEAR-style php script package $pack->setReleaseVersion($config['phrozn']['version']); $pack->setAPIVersion($config['phrozn']['version']); $pack->setReleaseStability($config['phrozn']['stability']); $pack->setAPIStability($config['phrozn']['stability']); $pack->setNotes(' * The first public release of Phrozn '); $pack->setLicense('Apache License, Version 2.0', 'http://www.apache.org/licenses/LICENSE-2.0'); $pack->addMaintainer('lead', 'victor', 'Victor Farazdagi', '*****@*****.**'); $pack->addRelease(); $pack->addInstallAs('bin/phr.php', 'phr');
/** * Processor can be setup at initialization time * * @param array $options Processor options * * @return void */ public function __construct($options = array()) { $path = Loader::getInstance()->getPath('library'); require_once $path . '/Vendor/Extra/textile.php'; $this->textile = new \Textile; }
/** * Processor can be setup at initialization time * * @param array $options Processor options * * @return void */ public function __construct($options = array()) { $path = Loader::getInstance()->getPath('library'); require_once $path . '/Vendor/Extra/markdown.php'; $this->markdown = new \Markdown_Parser(); }
/** * Make sure that absolute application path is prepended to config paths * * @return \Phrozn\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; }
private function getAppConfig() { if (null === $this->appConfig) { $path = Loader::getInstance()->getPath('configs') . '/phrozn.yml'; $this->appConfig = Yaml::load(file_get_contents($path)); } return $this->appConfig; }
#!/usr/bin/env php <?php namespace Phrozn; use Phrozn\Runner\CommandLine as Runner, Phrozn\Autoloader as Loader; if (strpos('@PHP-BIN@', '@PHP-BIN') === 0) { // stand-alone version is running $base = dirname(__FILE__) . '/../'; set_include_path($base . PATH_SEPARATOR . get_include_path()); } require_once 'Phrozn/Autoloader.php'; $loader = Loader::getInstance(); $runner = new Runner($loader); $runner->run(); unset($runner, $loader);