示例#1
0
 /**
  * Apply the formatter to the given Pinocchio instance.
  * Returns the resulting HTML page.
  *
  * @param \Pinocchio\Pinocchio $pinocchio  The Pinocchio instance to format.
  *
  * @return string
  */
 protected function apply($pinocchio)
 {
     $variables = array('configuration' => $this->configuration, 'pinocchio' => $pinocchio);
     ob_start();
     extract($variables);
     include $this->configuration->get('template');
     return ob_get_clean();
 }
示例#2
0
 /**
  * Get the Logger instance.
  *
  * @return \Pinocchio\Logger\LoggerInterface
  */
 public function getLogger()
 {
     if ($this->logger === null) {
         if ($this->configuration->get('silent')) {
             $this->logger = new Logger\NullLogger();
         } else {
             $loggerClass = $this->configuration->get('logger') ?: '\\Pinocchio\\Logger\\StandardLogger';
             $loggerOpts = $this->configuration->get('logger_opts') ?: array();
             $this->logger = new $loggerClass($loggerOpts);
         }
     }
     return $this->logger;
 }