-
Notifications
You must be signed in to change notification settings - Fork 1
/
cron.php
76 lines (61 loc) · 1.87 KB
/
cron.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
ini_set('error_reporting', E_ALL);
ini_set('register_globals', 0);
ini_set('display_errors', 1);
ini_set("max_execution_time", "3600");
require_once dirname(__FILE__)."/ezcomponents/Base/src/base.php";
function __autoload( $className )
{
ezcBase::autoload( $className );
}
ezcBase::addClassRepository( dirname(__FILE__).'/', dirname(__FILE__).'/lib/autoloads');
$input = new ezcConsoleInput();
$helpOption = $input->registerOption(
new ezcConsoleOption(
's',
'siteaccess',
ezcConsoleInput::TYPE_STRING
)
);
$cronjobPartOption = $input->registerOption(
new ezcConsoleOption(
'c',
'cronjob',
ezcConsoleInput::TYPE_STRING
)
);
$extensionPartOption = $input->registerOption(
new ezcConsoleOption(
'e',
'extension',
ezcConsoleInput::TYPE_STRING
)
);
try
{
$input->process();
}
catch ( ezcConsoleOptionException $e )
{
die( $e->getMessage() );
}
ezcBaseInit::setCallback(
'ezcInitDatabaseInstance',
'erLhcoreClassLazyDatabaseConfiguration'
);
$instance = erLhcoreClassSystem::instance();
$instance->SiteAccess = $helpOption->value;
$instance->SiteDir = dirname(__FILE__).'/';
$cfgSite = erConfigClassLhConfig::getInstance();
$defaultSiteAccess = $cfgSite->getSetting( 'site', 'default_site_access' );
$optionsSiteAccess = $cfgSite->getSetting('site_access_options',$helpOption->value);
$instance->Language = $optionsSiteAccess['locale'];
$instance->ThemeSite = $optionsSiteAccess['theme'];
$instance->WWWDirLang = '/'.$helpOption->value;
// php cron.php -s site_admin -c gallery/cron
if ($extensionPartOption->value) {
include_once('extension/'.$extensionPartOption->value.'/modules/lh'.$cronjobPartOption->value.'.php');
} else {
include_once('modules/lh'.$cronjobPartOption->value.'.php');
}
?>