pushbullet-notifier/bin/pushbullet

35 lines
853 B
Plaintext
Raw Permalink Normal View History

2017-09-01 21:06:45 -07:00
#!/usr/bin/env php
<?php
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
use Sikofitt\Pushbullet\Console\Application;
use Symfony\Component\Console\Output\ConsoleOutput;
set_time_limit(0);
/**
* @var Composer\Autoload\ClassLoader $loader
*/
$loader = require __DIR__ . '/../vendor/autoload.php';
$input = new ArgvInput();
$output = new ConsoleOutput();
$env = $input->getParameterOption(['--env', '-e'],
getenv('PHP_ENV') ?: 'dev');
$debug = getenv('PHP_DEBUG') !== '0' && !$input->hasParameterOption([
'--no-debug',
'',
]) && $env !== 'prod';
if ($debug) {
Debug::enable();
}
$application = new Application();
$application->add(new \Symfony\Component\Console\Command\HelpCommand());
$application->add(new \Symfony\Component\Console\Command\ListCommand());
$application->run($input, $output);