-
Notifications
You must be signed in to change notification settings - Fork 38
/
convert.php
30 lines (26 loc) · 997 Bytes
/
convert.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
<?php
if (PHP_SAPI === 'cli') {
$cwd = getcwd();
parse_str(implode('&', array_slice($argv, 1)), $_GET);
$sourceDir = !empty($_GET['s']) ? $_GET['s'] : "{$cwd}/source";
$mage1Dir = !empty($_GET['m']) ? $_GET['m'] : "{$cwd}/../magento";
$mage2Dir = !empty($_GET['o']) ? $_GET['o'] : "{$cwd}/../magento2";
$stage = !empty($_GET['a']) ? (int)$_GET['a'] : 1;
} else {
$sourceDir = 'source';
$mage1Dir = '../magento';
$mage2Dir = '../magento2';
$stage = !empty($_GET['a']) ? (int)$_GET['a'] : 1;
echo "<pre>";
}
ini_set('display_errors', 1);
error_reporting(E_ALL | E_STRICT);
if (!date_default_timezone_get()) {
date_default_timezone_set('UTC');
}
$time = microtime(true);
include_once __DIR__ . '/SimpleDOM.php';
include_once __DIR__ . '/ConvertM1M2.php';
$converter = new ConvertM1M2($sourceDir, $mage1Dir, $mage2Dir);
$converter->convertAllExtensions($stage);
$converter->log('[SUCCESS] ALL DONE (' . (microtime(true) - $time) . ' sec)')->log('');