-
Notifications
You must be signed in to change notification settings - Fork 0
/
weatherflux.php
48 lines (41 loc) · 1.43 KB
/
weatherflux.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
<?php
/**
* This file is part of WeatherFlux.
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author Pierre Lannoy <https://pierre.lannoy.fr/>
* @copyright Pierre Lannoy <https://pierre.lannoy.fr/>
* @link https://github.com/Pierre-Lannoy/WeatherFlux
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
define( 'WF_NAME', 'WeatherFlux' );
define( 'WF_VERSION', '2.1.4' );
error_reporting(0);
$docker = file_exists( '/.dockerenv');
if ( file_exists( __DIR__ . '/../../../vendor/autoload.php' ) ) {
require_once __DIR__ . '/../../../vendor/autoload.php';
} elseif ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
} else {
exit( 1 );
}
if ( ! $docker ) {
require_once __DIR__ . '/src/autoload.php';
}
if ( file_exists( __DIR__ . '/../../../config/config.json' ) ) {
$config = __DIR__ . '/../../../config/config.json';
} elseif ( file_exists( __DIR__ . '/config/config.json' ) ) {
$config = __DIR__ . '/config/config.json';
} else {
$config = '';
}
if ( in_array('status', $argv, true ) ) {
\WeatherFlux\Engine::status( $config, $docker, in_array('-h', $argv, true ) );
} elseif ( in_array('stop', $argv, true ) ) {
\WeatherFlux\Engine::stop( $config, $docker);
} else {
\WeatherFlux\Engine::run( $config, $docker );
}