-
Notifications
You must be signed in to change notification settings - Fork 0
/
pup
executable file
·39 lines (34 loc) · 984 Bytes
/
pup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env php
<?php
namespace StellarWP\Pup;
const PUP_VERSION = '1.3.4';
define( '__PUP_DIR__', __DIR__ );
if ( ! \Phar::running() ) {
$local_dir_autoload = __PUP_DIR__ . '/vendor/autoload.php';
$autoload = getcwd() . '/vendor/autoload.php';
if ( ! empty( $GLOBALS['_composer_autoload_path'] ) ) {
require $GLOBALS['_composer_autoload_path'];
} elseif ( is_file( $local_dir_autoload ) ) {
require $local_dir_autoload;
} elseif ( is_file( $autoload ) ) {
require $autoload;
} else {
fwrite( STDERR,
'You must set up the project dependencies, run the following commands:' . PHP_EOL .
'curl -s http://getcomposer.org/installer | php' . PHP_EOL .
'php composer.phar install' . PHP_EOL
);
exit( 1 );
}
} else {
require __PUP_DIR__ . '/vendor/autoload.php';
}
try {
App::getConfig();
$app = App::instance();
$app->setIsPhar( \Phar::running() );
$app->run();
} catch ( \Exception $e ) {
echo 'ERROR: ' . $e->getMessage() . PHP_EOL;
exit( 1 );
}