2015-11-18 03:33:55 +00:00
|
|
|
#!/usr/bin/env php
|
|
|
|
<?php
|
2018-11-12 10:21:44 +00:00
|
|
|
|
2021-02-05 05:09:42 +00:00
|
|
|
/**
|
2025-01-06 14:14:42 +00:00
|
|
|
* @copyright Copyright (c) 2015 - 2025 Trilby Media, LLC. All rights reserved.
|
2021-02-05 05:09:42 +00:00
|
|
|
* @license MIT License; see LICENSE file for details.
|
|
|
|
*/
|
|
|
|
|
2018-11-12 10:21:44 +00:00
|
|
|
use Grav\Common\Composer;
|
|
|
|
use Grav\Common\Grav;
|
2021-01-06 17:13:19 +00:00
|
|
|
use Grav\Console\Application\PluginApplication;
|
2018-11-12 10:21:44 +00:00
|
|
|
|
2018-10-16 10:12:26 +00:00
|
|
|
\define('GRAV_CLI', true);
|
|
|
|
\define('GRAV_REQUEST_TIME', microtime(true));
|
2015-11-18 03:33:55 +00:00
|
|
|
|
2018-11-12 10:21:44 +00:00
|
|
|
if (!file_exists(__DIR__ . '/../vendor/autoload.php')){
|
|
|
|
// Before we can even start, we need to run composer first
|
2015-11-18 03:33:55 +00:00
|
|
|
require_once __DIR__ . '/../system/src/Grav/Common/Composer.php';
|
|
|
|
|
|
|
|
$composer = Composer::getComposerExecutor();
|
|
|
|
echo "Preparing to install vendor dependencies...\n\n";
|
2018-11-12 10:21:44 +00:00
|
|
|
echo system($composer.' --working-dir="'.__DIR__.'/../" --no-interaction --no-dev --prefer-dist -o install');
|
2015-11-18 03:33:55 +00:00
|
|
|
echo "\n\n";
|
|
|
|
}
|
|
|
|
|
2018-10-16 10:12:26 +00:00
|
|
|
$autoload = require __DIR__ . '/../vendor/autoload.php';
|
2015-11-18 03:33:55 +00:00
|
|
|
|
2022-02-14 07:38:22 +00:00
|
|
|
// Set timezone to default, falls back to system if php.ini not set
|
|
|
|
date_default_timezone_set(@date_default_timezone_get());
|
2015-11-18 03:33:55 +00:00
|
|
|
|
2020-02-10 07:50:39 +00:00
|
|
|
// Set internal encoding.
|
|
|
|
@ini_set('default_charset', 'UTF-8');
|
|
|
|
mb_internal_encoding('UTF-8');
|
|
|
|
|
2018-11-12 10:21:44 +00:00
|
|
|
if (!file_exists(GRAV_ROOT . '/index.php')) {
|
2015-11-18 03:33:55 +00:00
|
|
|
exit('FATAL: Must be run from ROOT directory of Grav!');
|
|
|
|
}
|
|
|
|
|
2020-02-11 08:24:06 +00:00
|
|
|
// Bootstrap Grav container.
|
2015-11-18 03:33:55 +00:00
|
|
|
$grav = Grav::instance(array('loader' => $autoload));
|
|
|
|
|
2021-01-06 17:13:19 +00:00
|
|
|
$app = new PluginApplication('Grav Plugins Commands', GRAV_VERSION);
|
|
|
|
$app->run();
|