-
Notifications
You must be signed in to change notification settings - Fork 2
/
update-from-banner.php
executable file
·37 lines (32 loc) · 1.17 KB
/
update-from-banner.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
#!/usr/bin/env php
<?php
$GLOBALS['start_time'] = microtime();
require_once __DIR__.'/../application/autoload.php';
define('DISPLAY_ERROR_BACKTRACE', true);
set_exception_handler(['harmoni_ErrorHandler', 'handleException']);
/*********************************************************
* Config
*********************************************************/
$configFile = dirname(__DIR__).'/update_config.ini';
if (!file_exists($configFile)) {
throw new Exception('Config file "'.$configFile.'" does not exist.');
}
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', getenv('APPLICATION_ENV') ?: 'production');
$config = new Zend_Config_Ini($configFile, APPLICATION_ENV);
// Set a memory limit for this operation if one is configured.
// This can allow this upgrade script to consume more memory than other operations.
if (!empty($config->memory_limit)) {
ini_set('memory_limit', $config->memory_limit);
}
// Run the sync.
try {
$director = new CatalogSync_Director($config);
$director->sync();
exit(0);
} catch (Exception $e) {
fwrite(\STDERR, $e->getMessage()."\n");
fwrite(\STDERR, $e->getTraceAsString()."\n");
exit(1);
}