PHP Classes

File: bin/phpdoc-to-rst

Recommend this page to a friend!
  Classes of Francesco Danti   Sphinx PHP Doc RST   bin/phpdoc-to-rst   Download  
File: bin/phpdoc-to-rst
Role: Example script
Content type: text/plain
Description: Example script
Class: Sphinx PHP Doc RST
Generate Sphinx documentation from PHPDoc comments
Author: By
Last change:
Date: 4 years ago
Size: 1,174 bytes
 

Contents

Class file image Download
#!/usr/bin/env php
<?php

if (!ini_get('date.timezone')) {
   
ini_set('date.timezone', 'UTC');
}

foreach([
'vendor',null] as $vendor_dir)
{

    if(
defined('PHPUNIT_COMPOSER_INSTALL'))
    {
        continue;
    }

   
$dir = [__DIR__];
    for(
$a=0;$a<=3;$a++)
    {
       
$dir[]= '..';
       
$file = implode(DIRECTORY_SEPARATOR, $dir);
        if(
$vendor_dir)
        {
           
$file.= DIRECTORY_SEPARATOR . 'vendor';
        }

       
$file.= DIRECTORY_SEPARATOR . 'autoload.php';

        echo
$file .PHP_EOL;

        if (
file_exists($file)) {
           
define('PHPUNIT_COMPOSER_INSTALL', $file);
            break;
        }
    }
}

unset(
$file);

if (!
defined('PHPUNIT_COMPOSER_INSTALL')) {
   
fwrite(STDERR,
       
'You need to set up the project dependencies using the following commands:' . PHP_EOL .
       
'wget http://getcomposer.org/composer.phar' . PHP_EOL .
       
'php composer.phar install' . PHP_EOL
   
);
    die(
1);
}

require
PHPUNIT_COMPOSER_INSTALL;


use
Symfony\Component\Console\Application;

$application = new Application();
$application->add(new JuliusHaertl\PHPDocToRst\GenerateDocumentationCommand());
$application->run();