PHP Classes

File: bin/php-dep

Recommend this page to a friend!
  Packages of DeGraciaMathieu   PHP Dep   bin/php-dep   Download  
File: bin/php-dep
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Dep
Analyse the dependencies of classes in a project
Author: By
Last change:
Date: 23 days ago
Size: 654 bytes
 

Contents

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

declare(strict_types=1);

// Find and load the autoloader
$autoloaderPaths = [
   
__DIR__ . '/../vendor/autoload.php',
   
__DIR__ . '/../../autoload.php',
   
__DIR__ . '/../../../autoload.php',
];

$autoloaderFound = false;
foreach (
$autoloaderPaths as $autoloaderPath) {
    if (
file_exists($autoloaderPath)) {
        require_once
$autoloaderPath;
       
$autoloaderFound = true;
        break;
    }
}

if (!
$autoloaderFound) {
   
fwrite(STDERR, "Error: Composer autoloader not found. Run 'composer install' first.\n");
    exit(
1);
}

use
PhpDep\Cli\Application;

$application = new Application();
$application->run();