FlameCore/Seabreeze

View on GitHub
bin/breeze

Summary

Maintainability
Test Coverage
#!/usr/bin/env php
<?php
/**
 * Seabreeze
 * Copyright (C) 2015 IceFlame.net
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
 * above copyright notice and this permission notice appear in all copies.
 *
 * @package  FlameCore\Seabreeze
 * @version  0.1-dev
 * @link     http://www.flamecore.org
 * @license  ISC License <http://opensource.org/licenses/ISC>
 */

namespace FlameCore\Seabreeze;

use FlameCore\Seabreeze\Console\Application;

/**
 * Seabreeze Core
 *
 * @author   Christian Neff <christian.neff@gmail.com>
 */

set_time_limit(0);

define('DS', DIRECTORY_SEPARATOR);
define('SEABREEZE_PATH', DS != '/' ? str_replace(DS, '/', __DIR__) : __DIR__);

$files = array(
    SEABREEZE_PATH.'/../autoload.php',
    SEABREEZE_PATH.'/vendor/autoload.php'
);

foreach ($files as $file) {
    if (file_exists($file)) {
        include_once $file;
        define('PHP_SEABREEZE_COMPOSER_INSTALL', $file);
        break;
    }
}

if (!defined('PHP_SEABREEZE_COMPOSER_INSTALL')) {
    die(
        'You need to set up the project dependencies using the following commands:' . PHP_EOL .
        '  curl -s http://getcomposer.org/installer | php' . PHP_EOL .
        '  php composer.phar install' . PHP_EOL
    );
}

$workingDir = getcwd();

try {
    $application = new Application($workingDir);
    $application->run();
} catch (\Exception $e) {
    exit(1);
}