-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstart.php
43 lines (33 loc) · 798 Bytes
/
start.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
<?php
$config = Config::get('composeur');
$my_bundle = function()
{
if (! Request::cli())
return false;
foreach ($_SERVER['argv'] as $key => $val)
{
if (strpos($val, 'composeur::') === 0)
{
echo 'my bundle';
return true;
}
}
return false;
};
if (! $my_bundle() && isset($config['auto_update']) && $config['auto_update'])
{
require dirname(__FILE__) . '/tasks/setup.php';
$cli = new Composeur_Setup_Task;
if (! $cli->test())
$cli->run();
if (! $cli->has_lock())
$cli->install(array());
if (File::modified($cli->dir() . 'composer.json') < File::modified(path('app') . 'config/composeur.php'))
$cli->update(array());
ob_clean();
}
$composer_autoload = path('base') . 'vendor/autoload.php';
if (File::exists($composer_autoload))
{
require $composer_autoload;
}