本文整理汇总了PHP中initProgram函数的典型用法代码示例。如果您正苦于以下问题:PHP initProgram函数的具体用法?PHP initProgram怎么用?PHP initProgram使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了initProgram函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: main
function main()
{
global $gbl, $sgbl, $login, $ghtml;
global $argv;
initProgram('admin');
$login->loadAllObjects('vps');
$this->bserver_l = $login->getList('centralbackupserver');
$list = $login->getList('vps');
foreach ($this->bserver_l as $bso) {
$bso->setMyselfUp();
}
$opt = parse_opt($argv);
if (!isset($opt['newarg'])) {
$mess = "\n\nThe architecture of centralized backup has been completely rewritten, and now we have per slave backup-server; you will need to supply --newarg=true for this to work. ";
$mess .= "More info at http://wiki.lxcenter.org/.";
print $mess;
log_log("centralbackup_flag", $mess);
send_mail_to_admin("Central Backup Failed", $mess);
exit;
}
$this->stopvps = opt_get_single_flag($opt, 'stopvps');
//$stopxen = opt_get_single_flag($opt, 'stopxen');
//$stopopenvz = opt_get_single_flag($opt, 'stopopenvz');
foreach ($list as $l) {
$this->backup_one_vps($l);
}
foreach ((array) $this->global_list as $k => $s) {
//$res = rl_exec_get(null, $k, 'remove_scpid', array($backupiddsa));
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:30,代码来源:vpsbackup.php
示例2: mebackup_main
function mebackup_main()
{
global $gbl, $sgbl, $login, $ghtml;
$progname = $sgbl->__var_program_name;
$cprogname = ucfirst($progname);
initProgram('admin');
lxfile_mkdir("__path_program_home/selfbackup/self/__backup");
$backup = $login->getObject('general')->selfbackupparam_b;
$dbf = $sgbl->__var_dbf;
$pass = trim(lfile_get_contents("__path_program_root/etc/conf/{$progname}.pass"));
$vd = createTempDir("/tmp", "mebackup");
$docf = "{$vd}/mebackup.dump";
// Issue #671 - Fixed backup-restore issue
// exec("exec mysqldump --add-drop-table -u $progname -p$pass $dbf > $docf");
system("exec mysqldump --add-drop-table -u {$progname} -p{$pass} {$dbf} > {$docf}");
$string = @date('Y-M-d') . '-' . time();
$bfile = "{$sgbl->__path_program_home}/selfbackup/self/__backup/{$progname}-scheduled-masterselfbackup-{$string}.zip";
lxshell_zip($vd, $bfile, array("mebackup.dump"));
lxfile_tmp_rm_rec($vd);
if ($backup && $backup->isOn('selfbackupflag')) {
try {
lxbackup::upload_to_server($bfile, basename($bfile), $backup);
} catch (Exception $e) {
print "Sending warning to {$login->contactemail} ..\n";
lx_mail(null, $login->contactemail, "{$cprogname} Self Database Backup Upload Failed on " . date('Y-M-d') . " at " . date('H') . " Hours", "{$cprogname} Backup upload Failed due to {$e->getMessage()}\n");
}
}
$backup->rm_last_number = 20;
$backup->nname = 'masterselfbackup';
lxbackup::clear_extra_backups('selfbackup', 'self', $backup);
}
开发者ID:soar-team,项目名称:kloxo,代码行数:31,代码来源:mebackup.php
示例3: lpanel_main
function lpanel_main()
{
global $gbl, $login, $ghtml;
initProgram();
init_language();
print_meta_lan();
$gbl->__navigmenu = null;
$gbl->__navig = null;
$skincolor = $login->getSkinColor();
// This should be called only in display.php, and not anywhere else. It doesn't matter anyway, since both lpanel.php, AND header.php never allows any modification to be carried out. Also, the display.php automatically deletes the login info, so if you click on any link on the header or the lpanel, you will automatically logged out.
//check_if_disabled_and_exit();
$imgbordermain = "{$login->getSkinDir()}/top_line_medium.gif";
if ($gbl->isOn('show_help')) {
$background = "{$login->getSkinDir()}/top_line_dark.gif";
$border = null;
} else {
$background = null;
}
$ghtml->print_include_jscript('left_panel');
print "<body topmargin=0 leftmargin=0 style='background-color:#fafafa'>";
//$ghtml->lpanel_beginning();
try {
//$ghtml->xp_panel($login);
//print_ext_tree($login);
$ghtml->tab_vheight();
} catch (exception $e) {
print "The Resource List could not gathered....{$e->getMessage()}<br> \n";
}
}
开发者ID:digideskio,项目名称:hypervm,代码行数:29,代码来源:lpanel.php
示例4: updatecleanup_main
function updatecleanup_main()
{
global $argc, $argv;
global $gbl, $sgbl, $login, $ghtml;
$program = $sgbl->__var_program_name;
$opt = parse_opt($argv);
if ($opt['type'] === 'master') {
initProgram('admin');
$flg = "__path_program_start_vps_flag";
if (!lxfile_exists($flg)) {
set_login_skin_to_feather();
}
} else {
$login = new Client(null, null, 'update');
}
print "Executing UpdateCleanup. This can take a long time. Please be patient\n";
log_log("update", "Executing Updatecleanup");
//
// Cleanup old lxlabs.repo file
//
print "Fixing Repo's\n";
if (lxfile_exists("/etc/yum.repos.d/lxcenter.repo")) {
if (lxfile_exists("/etc/yum.repos.d/lxlabs.repo")) {
lxfile_mv("/etc/yum.repos.d/lxlabs.repo", "/etc/yum.repos.d/lxlabs.repo.lxsave");
system("rm -f /etc/yum.repos.d/lxlabs.repo");
}
}
if (lxfile_exists("CVS")) {
print "Found Development version, we just go on.\n";
// exit;
}
if ($opt['type'] === 'master') {
$sgbl->slave = false;
if (!is_secondary_master()) {
print "Update database\n";
updateDatabaseProperly();
print "Fix Extra database issues\n";
fixExtraDB();
print "Update extra issues\n";
doUpdateExtraStuff();
print "Get Driver info\n";
lxshell_return("__path_php_path", "../bin/common/driverload.php");
}
print "Starting Update all slaves\n";
update_all_slave();
print "Fix main {$program} databasefile\n";
cp_dbfile();
} else {
$sgbl->slave = true;
}
if (!is_secondary_master()) {
print "Starting update cleanups\n";
updatecleanup();
}
lxfile_touch("__path_program_start_vps_flag");
}
开发者ID:digideskio,项目名称:hypervm,代码行数:56,代码来源:tmpupdatecleanup.php
示例5: switchserver_main
function switchserver_main()
{
global $argc, $argv;
global $gbl, $sgbl, $login, $ghtml;
//sleep(60);
initProgram("admin");
if ($argc === 1) {
print "Usage: {$argv['0']} --class= --name= --v-syncserver= \n";
exit;
}
try {
$opt = parse_opt($argv);
$param = get_variable($opt);
dprintr($param);
$class = $opt['class'];
$name = $opt['name'];
if (lx_core_lock("{$class}-{$name}.switchserver")) {
exit;
}
$object = new $class(null, 'localhost', $name);
$object->get();
if ($object->dbaction === 'add') {
throw new lxException("no_object", '', '');
exit;
}
if (!$object->syncserver) {
print "No_synserver...\n";
throw new lxException("no_syncserver", '', '');
exit;
}
if ($param['syncserver'] === $object->syncserver) {
print "No Change...\n";
throw new lxException("no_change", '', '');
exit;
}
$driverapp_old = $gbl->getSyncClass('localhost', $object->syncserver, $object->get__table());
$driverapp_new = $gbl->getSyncClass('localhost', $param['syncserver'], $object->get__table());
if ($driverapp_new !== $driverapp_old) {
//throw new lxException ("the_drivers_are_different_in_two_servers", '', '');
}
$object->doupdateSwitchserver($param);
} catch (exception $e) {
print $e->getMessage();
/// hcak ahck... Chnage only the olddelete variable which is the mutex used for locking in the process of switch. The problem is we want to totally bail out if the switchserver fails. The corect way would be save after reverting the syncserve to the old value, but that's a bit risky. So we just use a hack to change only the olddeleteflag; Not a real hack.. This is the better way.
$message = "{$e->getMessage()}";
write_to_object($object, $message, $param['syncserver']);
$fullmesage = "Switch of {$object->get__table()}:{$object->nname} to {$object->syncserver} failed due to {$e->getMessage()}";
log_switch($fullmesage);
mail($login->contactemail, "Switch Failed:", "{$fullmesage}\n");
print "\n";
exit;
}
mail($login->contactemail, "Switch Succeeded", "Switch Succeeded {$object->get__table()}:{$object->nname} to {$param['syncserver']}\n");
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:54,代码来源:switchserver.php
示例6: header_main
function header_main()
{
global $gbl, $sgbl, $login, $ghtml;
initProgram();
init_language();
print_meta_lan();
if ($login->isDefaultSkin()) {
print_header_old_default();
} else {
print_header();
}
}
开发者ID:digideskio,项目名称:hypervm,代码行数:12,代码来源:header.php
示例7: driverload_main
function driverload_main()
{
global $argv, $gbl, $sgbl, $login, $ghtml;
initProgram('admin');
$p = parse_opt($argv);
if (isset($p['clear-existing'])) {
$sq = new Sqlite(null, "driver");
$sq->rawQuery("delete from driver");
}
$list = $login->getList('pserver');
foreach ($list as $l) {
$l->getandWriteModuleDriver();
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:14,代码来源:driverload.php
示例8: schedulebackup_main
function schedulebackup_main()
{
global $gbl, $sgbl, $login, $ghtml;
$progname = $sgbl->__var_program_name;
initProgram('admin');
$login->loadAllBackups();
$list = $login->lxbackup_l;
foreach ($list as $l) {
$l->backupstage = 'done';
$l->setUpdateSubaction();
$l->write();
if ($l->parent_clname !== $login->getClName() && !$l->priv->isOn('backupschedule_flag')) {
continue;
}
if ($l->getParentClass() === 'domain') {
continue;
}
if (!$l->backupschedule_type) {
continue;
}
if ($l->backupschedule_type === 'disabled') {
continue;
}
if ($l->backupschedule_type === 'weekly' && date('D') !== 'Sun') {
continue;
}
if ($l->backupschedule_type === 'monthly' && date('d') !== '01') {
continue;
}
/*
try {
$param['backup_to_file_f'] = "$progname-scheduled";
$param['upload_to_ftp'] = $l->upload_to_ftp;
$backup = $l;
$object = $l->getParentO();
$backup->doupdateBackup($param);
$backup->backupstage = 'done';
} catch (exception $e) {
$mess = "{$e->__full_message}\n";
$backup->backupstage = "Failed due to: $mess";
lx_mail($progname, $object->contactemail, "Backup Failed..", "Backup Failed for $object->nname with the Message $mess");
}
*/
$class = $l->getParentClass();
$name = $l->getParentName();
$fname = "{$progname}-scheduled";
print "Scheduling for {$class} {$name}\n";
lxshell_return("__path_php_path", "../bin/common/backup.php", "--class={$class}", "--name={$name}", "--v-backup_file_name={$fname}");
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:50,代码来源:schedulebackup.php
示例9: header_main
function header_main()
{
global $gbl, $sgbl, $login, $ghtml;
initProgram();
initLanguage();
initLanguageCharset();
// Load default skin or feather skin
if ($login->isDefaultSkin()) {
include_once "lib/default_header.php";
CreateDefaultHeaderMenu();
} else {
print_header();
}
}
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:14,代码来源:header.php
示例10: install_main
function install_main()
{
global $gbl, $login, $ghtml;
try {
initProgram("admin");
ob_end_flush();
create_servername();
add_client_template();
add_customer_reseller();
add_domain_list();
$login->was();
} catch (Exception $e) {
print $e->getMessage();
print "\\n\n\n\n\n\n\n\n\n\nn\n";
}
print "\n";
}
开发者ID:soar-team,项目名称:kloxo,代码行数:17,代码来源:demoinit.php
示例11: header_main
function header_main()
{
global $gbl, $sgbl, $login, $ghtml;
initProgram();
init_language();
print_open_head_tag();
print_meta_tags();
print_meta_css();
if ($login->isDefaultSkin()) {
print "<!-- Default Theme -->\n";
print_header_default();
} else {
print_close_head_tag();
print "<!-- Feather Theme -->\n";
print_header_feather();
}
print "</body>\n</html>\n";
}
开发者ID:soar-team,项目名称:kloxo,代码行数:18,代码来源:header.php
示例12: database_main
function database_main()
{
global $argc, $argv;
global $gbl, $login, $ghtml;
initProgram('admin');
if ($argv[1] == 'exec') {
$db = new Sqlite(null, 'client');
$res = $db->rawQuery($argv[2]);
foreach ($res as &$r) {
foreach ($r as $k => &$__r) {
if (csb($k, "ser_")) {
$__r = unserialize(base64_decode($__r));
}
}
}
print_r($res);
exit;
}
}
开发者ID:soar-team,项目名称:kloxo,代码行数:19,代码来源:database.php
示例13: commandline_main
function commandline_main()
{
global $gbl, $sgbl, $login, $ghtml;
global $argv;
initProgram('admin');
$must = array('action');
$p = parse_opt($argv);
$pk = array_keys($p);
foreach ($must as $m) {
if (!array_search_bool($m, $pk)) {
print "Need action, class and name\n";
exit;
}
}
$func = "__cmd_desc_{$p['action']}";
try {
$list = $func($p);
if ($list) {
if (isset($p['output-type'])) {
if ($p['output-type'] === 'json') {
$out = json_encode($list);
print $out;
} else {
if ($p['output-type'] === 'serialize') {
$out = serialize($list);
print $out;
}
}
} else {
foreach ($list as $l) {
print "{$l}\n";
}
}
} else {
print "{$p['action']} succesfully executed\n";
}
exit(0);
} catch (exception $e) {
print $e->__full_message;
print "\n";
exit(8);
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:43,代码来源:commandline.php
示例14: logout_main
function logout_main()
{
global $gbl, $sgbl, $login, $ghtml;
initProgram();
clear_all_cookie();
$cl = $login->getList("ssession");
Utmp::updateUtmp($gbl->c_session->nname, $login, "Logout");
$gbl->c_session->delete();
$gbl->c_session->was();
if ($gbl->c_session->ssl_param) {
$ghtml->print_redirect($gbl->c_session->ssl_param['backurl']);
} else {
if ($gbl->c_session->consuming_parent) {
$ret = $gbl->getSessionV('return_url');
$ghtml->print_redirect($ret);
} else {
$ghtml->print_redirect_self("/login/");
}
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:20,代码来源:logout.php
示例15: lpanel_main
function lpanel_main()
{
global $gbl, $login, $ghtml;
initProgram();
init_language();
print_open_head_tag();
print_meta_tags();
print_meta_css();
print_meta_css_lpanel();
$gbl->__navigmenu = null;
$gbl->__navig = null;
$catched = false;
$ghtml->print_include_jscript('left_panel');
$ghtml->print_jscript_source("/htmllib/js/lpanel-tabs.js");
try {
$ghtml->tab_vheight();
} catch (exception $e) {
print_close_head_tag();
print "<body>\n";
print "The Resource List could not gathered....{$e->getMessage()}<br> \n";
$catched = true;
}
if (!$catched) {
print_close_head_tag();
print "<body>\n";
}
// The div id's tabs1 script markup tree-div tab-content are generated from lpanel-tabs.js
print "<div class=\"lpanelmain\" id=\"tabs1\">\n";
print "<div id=\"script\" class=\"lpanelnormal tab-content\">\n";
print "<br>\n";
$ghtml->xp_panel($login);
print "</div>\n";
print "<div id=\"markup\" class=\"tab-content\">\n";
print "<div id=\"tree-div\" class=\"lpaneltree\">\n";
print "</div>\n";
print "</div>\n";
print "</div>\n";
print "</body>\n";
print "</html>\n";
}
开发者ID:soar-team,项目名称:kloxo,代码行数:40,代码来源:lpanel.php
示例16: monitor_child
function monitor_child()
{
global $gbl, $sgbl, $login, $ghtml;
global $global_reminder;
initProgram('admin');
$login->loadAllObjects('client');
$login->loadAllObjects('vps');
$cllist = $login->getList('client');
$vpslist = $login->getList('vps');
$clist = lx_array_merge(array($cllist, $vpslist));
foreach ($clist as $c) {
$downlist = null;
$mlist = $c->getList('monitorserver');
if (!$mlist) {
continue;
}
foreach ($mlist as $ml) {
$plist = $ml->getList('monitorport');
$eidlist = $ml->getList('emailalert');
$nidlist = $c->getList('emailalert');
$rlist = lx_array_merge(array($nidlist, $eidlist));
$portlist = process_port($rlist, $plist);
if ($portlist) {
$text = file_get_contents("../file/mailalert.txt");
$text = str_replace("%port%", implode(" ", $portlist), $text);
$text = str_replace("%server%", $ml->servername, $text);
foreach ($rlist as $eid) {
if (time() - $eid->last_sent > $eid->period * 60) {
log_message("Sending mail to {$eid->emailid} about {$ml->servername} at " . time());
$global_reminder[$eid->emailid][] = array("s", $text);
$eid->last_sent = time();
$eid->setUpdateSubaction();
$eid->write();
}
}
}
}
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:39,代码来源:mailalert.php
示例17: init_main
function init_main($admin_pass)
{
global $gbl, $sgbl, $login, $ghtml;
try {
add_admin($admin_pass);
initProgram("admin");
create_servername();
//create_default_template();
$login->was();
createDnsTemplate();
Ticket::createWelcomeTicket();
/*
if (lxfile_exists("__path_program_etc/license.txt")) {
decodeAndStoreLicense();
$login->license_o->write();
$login->write();
}
*/
} catch (Exception $e) {
print $e->getMessage();
print "\\n\n\n\n\n\n\n\n\n\nn\n";
}
print "\n";
}
开发者ID:soar-team,项目名称:kloxo,代码行数:24,代码来源:init.php
示例18: backup_main
function backup_main()
{
global $argc, $argv;
global $gbl, $login, $ghtml;
$gbl->__restore_flag = true;
if ($argc === 1) {
print "Usage: {$argv['0']} --restore/--list --accounts='domain-<domain1.com>,client-<client1>,domain-<domain2.com>' <backup-file> [--switchserverlist='oldserver1:newserver1,oldserver2:newserver2']\n Use --accounts=all to restore everything.\n";
exit;
}
initProgram("admin");
$object = $login;
$opt = parse_opt($argv);
if (isset($opt['class']) && isset($opt['name'])) {
$object = new $opt['class'](null, null, $opt['name']);
$object->get();
if ($object->dbaction === 'add') {
log_error("{$opt['class']} doesnt exist");
print "{$opt['class']} doesnt exist\n";
exit;
}
}
$class = $opt['class'];
$name = $opt['name'];
if (lx_core_lock("{$class}-{$name}.restore")) {
print "Another Restore for the same class is happening..\n";
exit;
}
$backup = $object->getObject('lxbackup');
if (isset($opt['switchserverlist'])) {
$sq = new Sqlite(null, "pserver");
$serverlist = $sq->getTable();
$serverlist = get_namelist_from_arraylist($serverlist);
$server = $opt['switchserverlist'];
$list = explode(",", $server);
foreach ($list as $l) {
if (!$l) {
continue;
}
$q = explode(":", $l);
$rlist[$q[0]] = $q[1];
if (!array_search_bool($q[1], $serverlist)) {
print "The server {$q[1]} doesn't exist in the server system here\n";
exit;
}
}
$param['switchserverlist'] = $rlist;
dprint("\n");
} else {
$param['switchserverlist'] = null;
}
/*
if (!testAllServersWithMessage()) {
$backup->restorestage = "Failed due to: could not connect to slave servers";
clearLxbackup($backup);
exit;
}
*/
$file = $opt['final'];
//$param = get_variable($opt);
if (isset($opt['list'])) {
$gbl->__var_list_flag = true;
$param['_accountselect'] = null;
} else {
if (isset($opt['restore'])) {
$gbl->__var_list_flag = false;
if (!isset($opt['accounts'])) {
print "Restore option needs accounts that are to be restored. --accounts='domain-domain.com,client:clientname'... Use --list to find out all the domain/clients in the backup archive.\n";
clearLxbackup($backup);
exit;
}
$account = $opt['accounts'];
//$account = str_replace(":", "_s_vv_p_", $account);
$account = str_replace(":", "-", $account);
$accountlist = explode(",", $account);
$param['_accountselect'] = $accountlist;
} else {
print "Usage: {$argv['0']} <--list/--restore --accounts=> <filename>\n";
clearLxbackup($backup);
exit;
}
}
if (isset($opt['priority']) && $opt['priority'] === 'low') {
sleep(20);
}
dprintr($param);
//dprint($file);
try {
$backup->doUpdateRestore($file, $param);
$backup->restorestage = 'done';
} catch (exception $e) {
log_error("Restore Failed. Reason: {$e->__full_message} \n");
print "Restore Failed. Reason: {$e->__full_message} \n";
$mess = $e->__full_message;
mail($object->contactemail, "Restore Failed..", "Restore Failed for {$object->nname} with the Message {$mess}");
$backup->restorestage = "Restore failed due to {$mess}";
}
clearLxbackup($backup);
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:98,代码来源:restore.php
示例19: ob_start
<?php
ob_start();
initProgram();
init_language();
check_if_disabled_and_exit();
$gbl->__inside_ajax = true;
// We need to convert the tree format to frm_o_o.
if ($ghtml->frm_action === 'tree') {
convert_tree_to_frm_o();
}
createPrincipleObject();
$cgi_action = "__ajax_desc_{$ghtml->frm_action}";
//sleep(6);
$ret = $cgi_action();
while (@ob_end_clean()) {
}
print json_encode($ret);
flush();
function convert_tree_to_frm_o()
{
global $gbl, $sgbl, $login, $ghtml;
$cid = $ghtml->node;
if (!csa($cid, "&")) {
return null;
}
$cid = trim($cid, "/&");
$dlist = explode("&", $cid);
$i = 0;
$ghtml->__title_function = false;
$ghtml->__resource_class = false;
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:31,代码来源:ajaxcore.php
示例20: process_paypal
static function process_paypal($list)
{
initProgram('admin');
$sq = new Sqlite(null, 'paymentdetail');
$r = paymentdetail__paypal::createPaymentDetail($list);
if (self::checkIftransactionExists($r['transactionid'])) {
log_log("paypal_billing", "Transactionid {$r['transactionid']} already exists\n");
return;
}
$i = 0;
while (true) {
$r['nname'] = implode("___", array($r['client'], $r['month'], $i));
if (!$sq->getRowsWhere("nname = '{$r['nname']}'")) {
break;
}
$i++;
}
$r['parent_clname'] = createParentName('client', $r['client']);
$cl = new Client(null, null, $r['client']);
$cl->get();
if (!$cl->isOn('status')) {
$cl->updateEnable(null);
$cl->was();
}
$payp = new paymentDetail(null, null, $r['nname']);
$r['complete_detail'] = $list;
$r['paymentgw'] = 'paypal';
$payp->create($r);
$payp->write();
log_log("paypal_billing", "saved the payment detail {$p->nname}");
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:31,代码来源:paymentdetaillib.php
注:本文中的initProgram函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论