Exemplo n.º 1
0
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
namespace Bd808\Bash;

if (!defined('APP_ROOT')) {
    define('APP_ROOT', dirname(__DIR__));
}
require_once APP_ROOT . '/vendor/autoload.php';
// Ensure that a default timezone is set
set_error_handler(function ($errno, $errstr) {
    throw new Exception($errstr);
});
try {
    date_default_timezone_get();
} catch (Exception $e) {
    // Use UTC if not specified anywhere in .ini
    date_default_timezone_set('UTC');
}
restore_error_handler();
// Load environment settings from .env if present
if (is_readable(APP_ROOT . '/.env')) {
    \Wikimedia\Slimapp\Config::load(APP_ROOT . '/.env');
}
$app = new App(APP_ROOT);
$app->run();