PHP Classes

File: bin/hephaestus

Recommend this page to a friend!
  Classes of Carlos Artur Curvelo da Matos   Hephaestus Modern and Sophisticated Error Handling for PHP 8   bin/hephaestus   Download  
File: bin/hephaestus
Role: Example script
Content type: text/plain
Description: Example script
Class: Hephaestus Modern and Sophisticated Error Handling for PHP 8
Handle PHP errors in several ways
Author: By
Last change:
Date: 18 days ago
Size: 575 bytes
 

Contents

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

if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
    require
__DIR__ . '/../vendor/autoload.php';
} elseif (
file_exists(__DIR__ . '/../../../autoload.php')) {
    require
__DIR__ . '/../../../autoload.php';
} else {
   
fwrite(STDERR,
       
'You must set up the project dependencies using `composer install`' . PHP_EOL
   
);
    exit(
1);
}

use
Hephaestus\Console\InitCommand;
use
Symfony\Component\Console\Application;

$application = new Application('Hephaestus CLI', '1.0.0');
$application->add(new InitCommand());
$application->run();