HummingBirdAnimeClient/console

41 lines
1.1 KiB
PHP
Executable File

#!/usr/bin/env php
<?php declare(strict_types=1);
if ( ! function_exists('_dir'))
{
/**
* Joins paths together. Variadic to take an
* arbitrary number of arguments
*
* @return string
*/
function _dir()
{
return implode(DIRECTORY_SEPARATOR, func_get_args());
}
}
$_SERVER['HTTP_HOST'] = 'localhost';
// Define base directories
$APP_DIR = __DIR__ . '/app/';
$SRC_DIR = __DIR__ . '/src/';
$CONF_DIR = realpath("${APP_DIR}/config/");
// Set up autoloader for third-party dependencies
require_once realpath(__DIR__ . '/vendor/autoload.php');
// Unset 'constants'
unset($APP_DIR);
unset($SRC_DIR);
unset($CONF_DIR);
// ---------------------------------------------------------------------------------------------------------------------
// Start console script
// ---------------------------------------------------------------------------------------------------------------------
$console = new \ConsoleKit\Console([
'cache-images' => '\Aviat\AnimeClient\Command\CacheImages',
'clear-cache' => '\Aviat\AnimeClient\Command\ClearCache',
]);
$console->run();