-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhakefile
43 lines (32 loc) · 1.09 KB
/
Phakefile
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
namespace Ignite;
use Symfony\Component\Routing\Exception\MissingMandatoryParametersException;
require_once 'vendor/autoload.php';
EnvironmentManager::init();
\desc('Copies example files to app root to give a head start.');
\task('setup', function($args){
if (isset($args['env']))
EnvironmentManager::setEnvironment($args['env']);
`cp -r -i vendor/appscend/ignite-php/example/. .`;
chmod('.', 0775);
});
\desc('Generates static xml files based on the configuration file.');
\task('generate_static', function($args) {
if (isset($args['env']))
EnvironmentManager::setEnvironment($args['env']);
$app = new Application();
if (isset($args['locale']))
Localization::setLocale($args['locale']);
if (isset($args['module'])) {
$moduleNames = explode(',', $args['module']);
foreach ($moduleNames as $class) {
/**
* @var $m Module
*/
$m = (new \ReflectionClass('Ignite\Modules\\'.$class.'\\'.$class))->newInstanceArgs([$app]);
$m->views($app);
$m->generateStaticViews();
}
} else
throw new MissingMandatoryParametersException('Missing \'module\' parameter.');
});