本文整理汇总了PHP中log_log函数的典型用法代码示例。如果您正苦于以下问题:PHP log_log函数的具体用法?PHP log_log怎么用?PHP log_log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log_log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reconnect
function reconnect()
{
global $gbl, $sgbl, $login, $ghtml;
$this->__readserver = 'localhost';
$user = $sgbl->__var_admin_user;
$db = $sgbl->__var_dbf;
$pass = getAdminDbPass();
$readserver = $this->__readserver;
$fdbvar = "__fdb_" . $this->__readserver;
log_log("database_reconnect", "Reconnecting again");
if ($sgbl->__var_database_type === 'mysql') {
$gbl->{$fdbvar} = mysql_connect($readserver, $user, $pass);
mysql_select_db($db);
self::$__database = 'mysql';
} else {
if ($sgbl->__var_database_type === 'mssql') {
//print("$user, $pass <br> \n");
//$gbl->$fdbvar = mssql_connect('\\.\pipe\MSSQL$LXLABS\sql\query');
$gbl->{$fdbvar} = mssql_pconnect("{$readserver},{$sgbl->__var_mssqlport}");
mssql_select_db($db);
self::$__database = 'mssql';
} else {
$gbl->{$fdbvar} = new PDO("sqlite:{$db}");
self::$__database = 'sqlite';
}
}
}
示例2: 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");
}
示例3: checkAndThrow
static function checkAndThrow($publickey, $privatekey, $throwname = null)
{
global $gbl, $sgbl, $login, $ghtml;
if (!self::checkKeyCert($publickey, $privatekey)) {
if ($gbl->__restore_flag) {
log_log("restore", "certificate_key_file_corrupted");
} else {
throw new lxException("certificate_key_file_corrupted", '', $throwname);
}
}
//dprint("Succeesffully tested <br> <br> ");
}
示例4: updatecleanup_main
function updatecleanup_main()
{
global $argc, $argv;
global $gbl, $sgbl, $login, $ghtml;
$prognameNice = $sgbl->__var_program_name_nice;
$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");
// Do things that is needed before the cleanup starts.
print "########################################\n";
print "## Executing PreCleanup ##\n";
print "########################################\n";
doBeforeUpdate();
print "########################################\n";
print "## Finished PreCleanup ##\n";
print "########################################\n";
if ($opt['type'] === 'master') {
$sgbl->slave = false;
if (!is_secondary_master()) {
print "Update database (if needed)\n";
updateDatabaseProperly();
if (call_with_flag("fixExtraDB")) {
print "- Fixed\n";
}
print "Update extra issues (if any)\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 {$prognameNice} databasefile\n";
cp_dbfile();
} else {
$sgbl->slave = true;
}
if (!is_secondary_master()) {
print "Starting update cleanups\n";
cleanupUpdate();
}
if (!lxfile_exists($flg)) {
lxfile_touch($flg);
}
}
示例5: setQuota
function setQuota()
{
if ($this->main->ftp_disk_usage > 0) {
lxshell_return("pure-pw", "usermod", $this->main->nname, "-N", $this->main->ftp_disk_usage, "-m");
} else {
// This is because the shell_return cannot send '' to the program.
$cmd = "pure-pw usermod {$this->main->nname} -N '' -m";
log_log("shell_exec", $cmd);
system($cmd);
//lxshell_return("pure-pw", "usermod", $this->main->nname, "-N", "", "-m");
}
}
示例6: changeSuperAdminPass
function changeSuperAdminPass()
{
if ($this->nname === 'superadmin') {
$oldpass = getAdminDbPass();
$newp = client::createDbPass($this->realpass);
$return = lfile_put_contents("__path_super_pass", $newp);
if (!$return) {
log_log("admin_error", "Admin pass change failed {$last_error}");
throw new lxException("could_not_change_superadmin_pass", '');
}
$return = $sql->setPassword($newp);
if ($return) {
$return = lfile_put_contents("__path_super_pass", $oldpass);
log_log("admin_error", "mysqladmin Failed . {$out}");
throw new lxException("could_not_change_superadmin_pass", '');
}
}
}
示例7: cron_exec
function cron_exec($hour, $minute, $func)
{
static $localvar;
//dprint("in Cron exec\n");
//dprintr($localvar);
$time = mktime($hour, $minute, 0, date('n'), date('j'), date("Y"));
$now = time();
if (isset($localvar[$func]) && $localvar[$func]) {
//dprint("Already execed \n");
if ($now > $time + 2 * 60) {
$localvar[$func] = false;
}
return;
}
if ($now > $time && $now < $time + 2 * 60) {
$localvar[$func] = true;
log_log("cron_exec", "Execing {$func}");
$func();
}
}
示例8: createPaymentDetail
static function createPaymentDetail($list)
{
$ret['amount'] = $list['mc_gross'];
$ret['info'] = $list['payer_email'];
$ret['transactionid'] = $list['txn_id'];
$id = $list['item_name'];
if (!csb($id, "lx_")) {
log_log("paypal_billing", "Not lx_, skipping... {$id}\n");
return;
}
$cllist = explode("_", $id);
$ret['month'] = $cllist[1];
array_shift($cllist);
array_shift($cllist);
$ret['client'] = implode("_", $cllist);
if (!$ret['client']) {
log_log("paypal_billing", "No client for transactionid {$ret['transactionid']}.. Exiting...\n");
return;
}
$ret['ddate'] = time();
return $ret;
}
示例9: run_awstats
static function run_awstats($statsprog, $list)
{
global $gbl, $sgbl, $login, $ghtml;
global $global_dontlogshell;
log_log("run_stats", "In awstats");
$global_dontlogshell = true;
foreach ($list as $p) {
log_log("run_stats", "In awstats for {$p->nname} {$statsprog}");
if ($p->priv->isOn('awstats_flag')) {
lxfile_mkdir("__path_httpd_root/{$p->nname}/webstats/");
$name = $p->nname;
web::createstatsConf($p->nname, $p->stats_username, $p->stats_password);
if (is_disabled($statsprog)) {
continue;
}
log_log("run_stats", "Execing {$statsprog}");
//system("rm /home/httpd/$p->nname/webstats/*");
if ($statsprog === 'webalizer') {
print "webalizer: {$p->nname}\n";
lxshell_return("nice", "-n", "15", "webalizer", "-n", $p->nname, "-t", $p->nname, "-c", "__path_real_etc_root/webalizer/webalizer.{$p->nname}.conf");
} else {
print "awstats: {$p->nname}\n";
putenv("GATEWAY_INTERFACE=");
//system("nice -n 15 perl /home/kloxo/httpd/awstats/wwwroot/cgi-bin/awstats.pl -update -config=$name > /tmp/test 2>&1");
lxshell_return("nice", "-n", "15", "perl", "__path_kloxo_httpd_root/awstats/wwwroot/cgi-bin/awstats.pl", "-update", "-config={$name}");
//lxshell_return("__path_kloxo_httpd_root/awstats/tools/awstats_buildstaticpages.pl", "-awstatsprog=$sgbl->__path_kloxo_httpd_root/awstats/wwwroot/cgi-bin/awstats.pl", "-dir=$sgbl->__path_httpd_root/$name/webstats/", "-config=$name");
//lxfile_cp("__path_httpd_root/$name/webstats/awstats.$name.html", "__path_httpd_root/$name/webstats/index.html");
}
}
}
/// Needed to get the domain list from the files in the /etc/awstats directory.
/* $list = lscandir_without_dot("__path_real_etc_root/awstats");
foreach($list as $l) {
$p = preg_replace("/awstats\.(.*)\.conf/", "$1", $l);
dprint($p);
dprint("\n");
*/
}
示例10: send_email
public function send_email($toEmail, $subject, $template, $params = array())
{
include 'Mail.php';
include 'Mail/mime.php';
log_log('Email Function Started', 'START:');
ob_start();
include EMAILTEMPLATEDIR . '/' . $template;
$msg = ob_get_clean();
$text = strip_tags($msg);
$html = $msg;
$crlf = "\n";
$hdrs = array('From' => FROM_EMAIL, 'Subject' => $subject);
$mime = new Mail_mime($crlf);
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
log_log($toEmail, 'toEmail:');
log_log(var_export($hdrs, 1), 'hdrs:');
log_log($body, 'body:');
$mail =& Mail::factory('mail');
$mail->send($toEmail, $hdrs, $body);
log_log('Email Function Ended', 'END:');
}
示例11: syncCreateConf
function syncCreateConf()
{
global $gbl, $sgbl, $login, $ghtml;
global $global_shell_error;
if_demo_throw_exception('cron');
$conf_file = "__path_cron_root/{$this->main->username}";
$list = array('minute', 'hour', 'weekday', 'ddate', 'month');
$tfile = lx_tmp_file($conf_file);
$cmd = null;
if ($this->main->__var_mailto) {
$cmd .= "MAILTO={$this->main->__var_mailto}\n";
}
$result = $this->main->__var_cron_list;
foreach ($result as &$__r) {
foreach ($list as $l) {
$__r[$l] = unserialize(base64_decode($__r["ser_{$l}"]));
}
}
$result = merge_array_object_not_deleted($result, $this->main);
//dprintr($result);
foreach ((array) $result as $v) {
if ($v['ttype'] === 'simple') {
$v['weekday'] = array('--all--');
$v['month'] = array('--all--');
$v['ddate'] = array('--all--');
if ($v['simple_cron'] === 'every-day') {
$v['hour'] = $v['cron_day_hour'];
$v['minute'] = 0;
}
if ($v['simple_cron'] === 'every-hour') {
$v['hour'] = array('--all--');
$v['minute'] = 0;
}
if ($v['simple_cron'] === 'every-minute') {
$v['hour'] = array('--all--');
$v['minute'] = array('--all--');
}
} else {
foreach ($v["weekday"] as &$___tq) {
if (is_numeric($___tq)) {
$___tq -= 1;
}
}
}
foreach ($list as $l) {
$v[$l] = $this->getCronString($v[$l]);
}
if (!$v['minute']) {
$v['minute'] = 0;
}
$cmd .= implode("\t", array($v['minute'], $v['hour'], $v['ddate'], $v['month'], $v['weekday'], $v['command']));
$cmd .= "\n";
}
lfile_put_contents($tfile, $cmd);
if (!posix_getpwnam($this->main->username)) {
lxfile_rm("/var/spool/cron/{$this->main->username}");
return;
}
$ret = lxshell_return("crontab", "-u", $this->main->username, $tfile);
if ($ret) {
// Why exactly was a throw removed? backup/restore?
//throw new lxException("adding_cron_failed", "", $global_shell_error);
$gbl->setWarning('adding_cron_failed', '', $global_shell_error);
$data = lfile_get_contents($tfile);
log_log("cron_error", $data);
}
lunlink($tfile);
}
示例12: sleep
if (!$fp) {
sleep(3);
}
$fp = fsockopen('www.paypal.com', 80, $errno, $errstr, 30);
if (!$fp) {
sleep(3);
}
$fp = fsockopen('www.paypal.com', 80, $errno, $errstr, 30);
if (!$fp) {
log_log("paypal_billing", "Could not connect to paypal");
// HTTP ERROR
} else {
fputs($fp, $header . $req);
while (!feof($fp)) {
$res = fgets($fp, 1024);
if (strcmp($res, "VERIFIED") == 0) {
paymentDetail::process_paypal($_POST);
// check the payment_status is Completed
// check that txn_id has not been previously processed
// check that receiver_email is your Primary PayPal email
// check that payment_amount/payment_currency are correct
// process payment
} else {
if (strcmp($res, "INVALID") == 0) {
// log for manual investigation
log_log("paypal_billing", "Fake confirmation " . var_export($_POST, true));
}
}
}
fclose($fp);
}
示例13: dbactionUpdate
function dbactionUpdate($subaction)
{
global $gbl, $sgbl, $login, $ghtml;
if (!$this->main->customer_name) {
log_log("critical", "Lack customername for web: {$this->main->nname}");
return;
}
switch ($subaction) {
case "full_update":
$this->fullUpdate();
$this->main->doStatsPageProtection();
break;
case "add_subweb_a":
$this->AddSubWeb($this->main->__t_new_subweb_a_list);
$this->createConffile();
break;
case "delete_subweb_a":
$this->DeleteSubWeb();
$this->createConffile();
break;
case "changeowner":
$this->main->webChangeOwner();
$this->createConffile();
break;
case "create_config":
case "addondomain":
$this->createConffile();
break;
case "add_delete_dirprotect":
case "extra_tag":
case "add_dirprotect":
case "custom_error":
case "dirindex":
case "docroot":
case "ipaddress":
case "blockip":
case "add_redirect_a":
case "delete_redirect_a":
case "delete_redirect_a":
case "add_webindexdir_a":
case "delete_webindexdir_a":
case "add_server_alias_a":
case "delete_server_alias_a":
case "configure_misc":
$this->createConffile();
break;
case "redirect_domain":
$this->createConffile();
break;
case "add_forward_alias_a":
case "delete_forward_alias_a":
case "fixipdomain":
$this->createConffile();
$this->updateMainConfFile();
self::createSSlConf($this->main->__var_ipssllist, $this->main->__var_domainipaddress);
break;
case "enable_php_manage_flag":
$this->createConffile();
$this->updateMainConfFile();
break;
case "toggle_status":
$this->createConffile();
break;
case "hotlink_protection":
$this->createHotlinkHtaccess();
break;
case "enable_php_flag":
case "enable_cgi_flag":
case "enable_inc_flag":
case "enable_ssl_flag":
$this->createConffile();
break;
case "stats_protect":
$this->main->doStatsPageProtection();
$this->createConffile();
break;
case "default_domain":
$this->main->setupDefaultDomain();
break;
case "graph_webtraffic":
return rrd_graph_single("webtraffic (bytes)", $this->main->nname, $this->main->rrdtime);
break;
case "run_stats":
$this->main->runStats();
break;
case "static_config_update":
self::createCpConfig();
self::createWebDefaultConfig();
$this->updateMainConfFile();
break;
}
}
示例14: print_redirect_back
function print_redirect_back($message, $variable, $value = null)
{
global $gbl, $sgbl, $login;
$vstring = null;
if ($value) {
$value = htmlspecialchars($value);
$vstring = "&frm_m_emessage_data={$value}";
}
$parm = "frm_emessage={$message}{$vstring}";
if ($variable) {
$parm .= "&frm_ev_list={$variable}";
}
$last_page = $gbl->getSessionV("lx_http_referer");
if (!$last_page) {
$last_page = "/display.php?frm_action=show";
}
$current_url = $this->get_get_from_current_post(null);
if ($last_page === $current_url) {
log_log("redirect_error", "{$last_page} is same as the current url...\n");
$last_page = "/display.php?frm_action=show";
}
$this->get_post_from_get($last_page, $path, $post);
$get = $this->get_get_from_post(array("frm_ev_list"), $post);
$this->print_redirect("{$path}?{$get}&{$parm}");
}
示例15: debug_for_backend
<?php
include_once "htmllib/lib/include.php";
debug_for_backend();
print_time("gettraffic");
gettraffic_main();
$val = print_time("gettraffic", "Get Traffic ");
log_log("get_traffic", $val);
function gettraffic_main()
{
global $argc, $argv;
$list = parse_opt($argv);
if (isset($list['delete-table']) && $list['delete-table'] === 'yes') {
print "clearing Traffic Table\n";
clearTrafficTable();
filltraffictable();
} else {
filltraffictable();
}
}
//testFunc();
function clearTrafficTable()
{
$sql = new Sqlite(null, "vpstraffic");
$sql->rawquery("delete from vpstraffic;");
}
function filltraffictable()
{
global $gbl, $login, $ghtml;
initProgram('admin');
$t = "";