Пример #1
0
 /**
  *
  */
 public function execute()
 {
     $skeleton = file_get_contents($this->config->getTemplateFilename());
     $skeleton = $this->replacePlaceholder($skeleton, '%%VERSION%%', $this->version->getVersion());
     $skeleton = $this->replacePlaceholder($skeleton, '%%DATE%%', $this->now->format('Y-m-d H:i:sO'));
     $this->writeSkeletonFile($skeleton);
 }
Пример #2
0
 /**
  * @param string     $error
  * @param string     $file
  * @param int        $line
  * @param array|null $trace
  */
 private function showError($error, $file, $line, array $trace = null)
 {
     $baseLen = strlen(realpath(__DIR__ . '/../../..')) + 1;
     $message = [$error];
     $message[] = '';
     $message[] = sprintf('#0 %s(%d)', substr($file, $baseLen), $line);
     if ($trace != null) {
         foreach ($trace as $pos => $step) {
             $file = 'unknown file';
             if (isset($step['file'])) {
                 $file = substr($step['file'], $baseLen);
             }
             $message[] = sprintf('#%d %s(%d): %s%s%s()', $pos + 1, $file, isset($step['line']) ? $step['line'] : 0, isset($step['class']) ? $step['class'] : '', isset($step['type']) ? $step['type'] : '', $step['function']);
         }
         $message[] = sprintf('#%d {main}', count($trace) + 1);
     }
     $this->ouput->writeError(sprintf(file_get_contents(__DIR__ . '/error.txt'), join("\n          ", $message), $this->environment->getRuntimeString(), $this->version->getVersion()));
 }
Пример #3
0
 public function execute()
 {
     $this->output->writeText($this->version->getVersionString() . "\n\n");
 }
Пример #4
0
 public function execute()
 {
     $this->output->writeText($this->version->getVersionString() . "\n\n");
     $this->output->writeText(str_replace('%phive', $this->environment->getBinaryName(), file_get_contents(__DIR__ . '/help.txt')) . "\n\n");
 }