This repository was archived by the owner on Jan 28, 2021. It is now read-only.
forked from modmore/Gitify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapplication.php
59 lines (53 loc) · 1.98 KB
/
application.php
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* Make sure dependencies have been installed, and load the autoloader.
*/
if (file_exists($file = dirname(__FILE__) . '/vendor/autoload.php')) {
require $file;
} else if (!class_exists("\modmore\Gitify\Gitify")) {
throw new \Exception('Uh oh, it looks like dependencies have not yet been installed with Composer. Please follow Please follow the installation instructions at https://github.com/modmore/Gitify/wiki/1.-Installation');
}
/**
* Ensure the timezone is set; otherwise you'll get a shit ton (that's a technical term) of errors.
*/
if (version_compare(phpversion(),'5.3.0') >= 0) {
$tz = @ini_get('date.timezone');
if (empty($tz)) {
date_default_timezone_set(@date_default_timezone_get());
}
}
/**
* Specify the working directory, if it hasn't been set yet.
*/
if (!defined('GITIFY_WORKING_DIR')) {
define ('GITIFY_WORKING_DIR', $cwd = getcwd() . DIRECTORY_SEPARATOR);
}
/**
* Load all the commands and create the Gitify instance
*/
use modmore\Gitify\Gitify;
use modmore\Gitify\Command\BackupCommand;
use modmore\Gitify\Command\BuildCommand;
use modmore\Gitify\Command\ExtractCommand;
use modmore\Gitify\Command\InitCommand;
use modmore\Gitify\Command\InstallModxCommand;
use modmore\Gitify\Command\UpgradeModxCommand;
use modmore\Gitify\Command\InstallPackageCommand;
use modmore\Gitify\Command\RestoreCommand;
$version = file_get_contents(__DIR__ . "/composer.json");
$version = json_decode($version, true);
$version = $version['version'];
$application = new Gitify('Gitify', $version);
$application->add(new InitCommand);
$application->add(new BuildCommand);
$application->add(new ExtractCommand);
$application->add(new InstallModxCommand);
$application->add(new UpgradeModxCommand);
$application->add(new InstallPackageCommand);
$application->add(new BackupCommand);
$application->add(new RestoreCommand);
/**
* We return it so the CLI controller in /Gitify can run it, or for other integrations to
* work with the Gitify api directly.
*/
return $application;