Exemple #1
0
 /**
  * Reload the page.
  *
  * This is a convenient way to simply reload the page in your browser 
  * without having to run 'holograph build' because this class does that for 
  * you.
  *
  * E.g. in a browser, go to 
  * http://localhost/styleguide/docs/index.php/index.html and it will 
  * serve up the index.html file after regenerating the styleguide build.
  *
  * Current downside is you can't provide an alternate config filename; it 
  * always assumes holograph.yml
  *
  * @param mixed $requestUri
  * @return void
  */
 public static function reload($requestUri)
 {
     $configFile = 'holograph.yml';
     $config = Yaml::parse($configFile);
     $logger = new Logger\Memory();
     $builder = new Builder($config, $logger);
     $builder->execute();
     //$destination = $builder->getConfig('destination');
     $destination = '.';
     $fileio = new FileOps();
     $contents = $fileio->readFile($destination . '/' . self::transformRequestUri($requestUri));
     return $contents;
 }
Exemple #2
0
 /**
  * testRunPreprocessorWithNone
  *
  * @return void
  */
 public function testRunPreprocessorWithNone()
 {
     $config = array('preprocessor' => 'none');
     $builder = new Builder($config, $this->logger);
     $result = $builder->runPreprocessor(array());
     $this->assertNull($result);
 }
Exemple #3
0
 /**
  * Write a config file to disk
  *
  * @return void
  */
 public function writeConfig()
 {
     if (file_exists($this->_configFilename)) {
         $this->_halt(sprintf("Config file already exists: '%s'", $this->_configFilename));
     }
     $defaultBuilder = new Builder(array(), $this->logger);
     $this->logger->notice(sprintf("Writing default configuration to config file '%s'", $this->_configFilename));
     file_put_contents($this->_configFilename, $defaultBuilder->getConfigAnnotated());
 }