Exemplo n.º 1
0
 public function run()
 {
     $this->client->arguments->registerOption('recursive', '/^-r|--recursive$/', TRUE);
     $this->client->arguments->parse();
     $this->recursive = $this->client->arguments->getOption('recursive');
     $this->quiet = $this->client->arguments->getOption('quiet');
     $this->verbose = $this->client->arguments->getOption('verbose');
     $path = $this->client->arguments->getArgument(0);
     if (!$path) {
         $path = ".";
     }
     Hymn_Test::checkPhpClasses($path, $this->recursive, $this->verbose);
     /*		Hymn_Test::checkPhpClasses( "./", FALSE, !FALSE );
     		if( file_exists( "classes" ) )
     			Hymn_Test::checkPhpClasses( "./classes", TRUE, !FALSE );
     		if( file_exists( "templates" ) )
     			Hymn_Test::checkPhpClasses( "./templates", TRUE, !FALSE );
     */
 }
Exemplo n.º 2
0
 public function renderGraphImage($graph = NULL, $targetFile = NULL, $verbose = FALSE)
 {
     Hymn_Client::out("Checking graphviz: ", FALSE);
     Hymn_Test::checkShellCommand("graphviz");
     Hymn_Client::out("OK");
     try {
         if (!$graph) {
             $graph = $this->renderGraphFile(NULL, $verbose);
         }
         $sourceFile = tempnam(sys_get_temp_dir(), 'Hymn');
         file_put_contents($sourceFile, $graph);
         //  save temporary
         if ($targetFile) {
             @exec('dot -Tpng -o' . $targetFile . ' ' . $sourceFile);
             if (!$this->quiet) {
                 Hymn_Client::out('Graph image saved to ' . $targetFile . '.');
             }
         } else {
             exec('dot -Tpng -O ' . $sourceFile);
             unlink($sourceFile);
             $graphImage = file_get_contents($sourceFile . '.png');
             @unlink($sourceFile);
             return $graphImage;
         }
     } catch (Exception $e) {
         Hymn_Client::out('Graph rendering failed: ' . $e->getMessage() . '.');
     }
 }