/
index.php
41 lines (32 loc) · 1.17 KB
/
index.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
<?php
/**
* Isotope eCommerce Migration Tool
*
* Copyright (C) 2014 terminal42 gmbh
*
* @link http://isotopeecommerce.org
* @license http://opensource.org/licenses/lgpl-3.0.html
*/
use Isotope\Migration\Provider\ContaoServiceProvider;
use Isotope\Migration\Provider\MigrationServiceProvider;
use Symfony\Component\HttpFoundation\Request;
require_once __DIR__ . '/vendor/autoload.php';
$app = new Silex\Application();
$app['kernel.root_dir'] = __DIR__;
// Support PHAR
if (\Phar::running()) {
$app['kernel.root_dir'] = \Phar::running(false);
}
$app->register(new ContaoServiceProvider(), array(
'contao.root' => dirname($app['kernel.root_dir'])
));
$app->register(new MigrationServiceProvider());
$app->before(function (Request $request) use ($app) {
$app['translator']->setLocale($request->getPreferredLanguage(array('en', 'de')));
});
$app->get('/', 'migration.controller:indexAction');
$app->get('/config/', 'migration.controller:configIntroAction');
$app->match('/config/{slug}', 'migration.controller:configAction');
$app->match('/execute', 'migration.controller:executeAction');
$app->get('/summary', 'migration.controller:summaryAction');
$app->run();