当前位置: 首页>>代码示例>>PHP>>正文


PHP dprintr函数代码示例

本文整理汇总了PHP中dprintr函数的典型用法代码示例。如果您正苦于以下问题:PHP dprintr函数的具体用法?PHP dprintr怎么用?PHP dprintr使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dprintr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: os_fix_fstab

function os_fix_fstab()
{
    $list = lfile_trim("/etc/fstab");
    foreach ($list as $l) {
        $nl = trimSpaces($l);
        $n = explode(" ", $nl);
        if ($n[1] !== "/home" && $n[1] !== '/') {
            $out[] = $l;
            continue;
        }
        if (!csa($n[3], "usrquota")) {
            $mount[] = $n[1];
            $n[3] = "{$n['3']},usrquota,grpquota";
        }
        $o = implode("\t", $n);
        $out[] = $o;
    }
    $out = implode("\n", $out);
    $out .= "\n";
    dprint($out);
    lfile_put_contents("/etc/fstab", $out);
    dprintr($mount);
    foreach ($mount as $m) {
        system("mount {$m} -o remount");
    }
}
开发者ID:zseand,项目名称:kloxo,代码行数:26,代码来源:linuxlib.php

示例2: storeinGblvariables

function storeinGblvariables()
{
    global $gbl, $sgbl, $login, $ghtml;
    return;
    $firstofmonth = @mktime(00, 01, 00, @date("n"), 1, @date("Y"));
    $today = time() + 2 * 24 * 60 * 60;
    $vpslist = $login->loadAllVps();
    $vpslist = $login->getList('vps');
    if ($vpslist) {
        foreach ($vpslist as $vps) {
            $vpst = $vps->getList("vpstraffic");
            $list = get_namelist_from_objectlist($vpst);
            $total[$vps->getClName()] = trafficGetIndividualObjectTotal($vpst, $firstofmonth, $today, $vps->nname);
            list($month, $year) = get_last_month_and_year();
            $last_traffic = VpstrafficHistory::getMonthTotal($vpst, $month, $year, null);
            if (!isset($sgbl->__var_traffic_last_usage)) {
                $sgbl->__var_traffic_last_usage = null;
            }
            $sgbl->__var_traffic_last_usage[$vps->getClName()] = $last_traffic['traffic_usage'];
            /*
            	try {
            		$sgbl->__var_backupdisk_usage[$vps->getClName()] = rl_exec_get(null, $vps->syncserver, array("vps", "getBackupDiskSize"), array($vps->nname));
            	} catch (Exception $e) {
            		$sgbl->__var_backupdisk_usage[$vps->getClName()] = null;
            	}
            */
        }
    }
    //dprintr($sgbl->__var_backupdisk_usage);
    $sgbl->__var_traffic_usage = $total;
    dprintr($sgbl->__var_traffic_last_usage);
}
开发者ID:digideskio,项目名称:hypervm,代码行数:32,代码来源:collectquota.php

示例3: createExtraVariables

 function createExtraVariables()
 {
     global $gbl, $sgbl, $login, $ghtml;
     $revc = $login->getObject('general')->reversedns_b;
     if (!$revc->dns_slave_list) {
         throw new lxexception("dns_params_not_configured", '', "");
     }
     $this->syncserver = implode(",", $revc->dns_slave_list);
     $rdrlist = $this->getList('rdnsrange');
     $rdrange = null;
     foreach ($rdrlist as $k => $v) {
         list($base, $first) = self::getBaseEnd($v->firstip);
         list($base, $last) = self::getBaseEnd($v->lastip);
         $rdrange[] = array($base, $first, $last);
     }
     $this->__var_rdnsrange = $rdrange;
     dprintr($this->__var_rdnsrange);
     $sq = new Sqlite(null, 'reversedns');
     $res = $sq->getTable();
     foreach ($res as $r) {
         list($base, $last) = self::getBaseEnd($r['nname'], $this->__var_rdnsrange);
         $total[$base][] = array('nname' => $r['nname'], 'end' => $last, 'reversename' => $r['reversename']);
     }
     $this->__var_revdns1 = $revc->primarydns;
     $this->__var_revdns2 = $revc->secondarydns;
     $this->__var_reverse_list = $total;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:27,代码来源:reversednslib.php

示例4: updateUpdate

 function updateUpdate($param)
 {
     foreach ($param as $k => $v) {
         $param[$k] = self::fixListVariable($v);
     }
     dprintr($param);
     return $param;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:8,代码来源:interface_templatelib.php

示例5: createExtraVariables

 function createExtraVariables()
 {
     $pserver = $this->getParentO();
     $hdb = new Sqlite($this->__masterserver, 'hostdeny');
     $string = "syncserver = '{$pserver->nname}' ";
     $hlist = $hdb->getRowsWhere($string);
     $this->__var_hostlist = $hlist;
     dprintr($this->__var_hostlist);
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:9,代码来源:hostdenylib.php

示例6: dbactionAdd

 function dbactionAdd()
 {
     dprintr($this);
     $ret = self::checkIfUserExists($this->main->nname, $this->main->getParentName());
     if ($ret) {
         return true;
     }
     $this->createUser();
     $this->shellModify();
     $this->toggleStatus();
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:11,代码来源:uuser__linuxlib.php

示例7: 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

示例8: getSizeForAll

 static function getSizeForAll($list)
 {
     foreach ($list as $l) {
         if (csa($l, "lvm:")) {
             $ret[$l] = vg_diskfree($l);
         } else {
             $ret[$l] = lxfile_disk_free_space($l);
         }
     }
     dprintr($ret);
     return $ret;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:12,代码来源:dirlocation__linuxlib.php

示例9: __xenimport_get_data

function __xenimport_get_data()
{
    lxfile_mkdir("/home/oldxenconfig-hypervm");
    $list = lscandir_without_dot("/etc/xen/oldxen");
    foreach ($list as $l) {
        $vm[] = __xenimport_parse_config("/etc/xen/oldxen/{$l}");
        //lxfile_mv("/etc/xen/$l", "/home/oldxenconfig-hypervm");
        lunlink("/etc/xen/auto/{$l}");
    }
    dprintr($vm);
    return $vm;
}
开发者ID:digideskio,项目名称:hypervm,代码行数:12,代码来源:xenimport__xenmax.php

示例10: __xenimport_get_data

function __xenimport_get_data()
{
    lxfile_mkdir("/home/oldxenconfig-hypervm");
    $list = lscandir_without_dot("/home/xen");
    foreach ($list as $l) {
        if (!cse($l, ".vm")) {
            continue;
        }
        $vm[] = __xenimport_parse_config("/home/xen/{$l}/{$l}.cfg");
        //lxfile_mv("/etc/xen/$l", "/home/oldxenconfig-hypervm");
    }
    dprintr($vm);
    return $vm;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:14,代码来源:xenimport__hypervm.php

示例11: getDnsTemplateList

 static function getDnsTemplateList($parent)
 {
     $res = $parent->dnstemplate_list;
     dprintr($res);
     if (!$res) {
         $sq = new Sqlite(null, "dnstemplate");
         $res = $sq->getTable();
         $res = get_namelist_from_arraylist($res);
     }
     if (!$res) {
         throw new lxException("err_no_dns_template", '', '');
     }
     return $res;
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:14,代码来源:domainbaselib.php

示例12: dbactionAdd

 function dbactionAdd()
 {
     global $gbl, $sgbl, $login;
     if (if_demo()) {
         return;
     }
     $_filepath = "__path_home_root/lxguard/hostdeny.info";
     $result = $this->main->__var_hostlist;
     $result = merge_array_object_not_deleted($result, $this->main);
     $list = get_namelist_from_arraylist($result, 'hostname', 'hostname');
     dprintr($list);
     lfile_put_serialize($_filepath, $list);
     lxshell_return("__path_php_path", "../bin/common/lxguard.php");
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:14,代码来源:hostdeny__linuxlib.php

示例13: getPackages

 static function getPackages($nocache = false)
 {
     $cmd = self::getYumCommand();
     $file = fix_nname_to_be_variable(implode(" ", $cmd));
     $file = "__path_program_root/cache/{$file}";
     if ($nocache) {
         $val = `{$cmd}`;
     } else {
         $val = get_with_cache($file, $cmd);
     }
     $list = explode("\n", $val);
     dprintr($list);
     $match = false;
     $res = null;
     foreach ($list as $l) {
         $l = trim($l);
         if (strstr($l, "---------------------")) {
             $match = true;
             continue;
         }
         if ($match) {
             if (!$l) {
                 break;
             }
         }
         if (!$match) {
             continue;
         }
         $l = trimSpaces($l);
         $l = trim($l);
         if (!$l) {
             continue;
         }
         $v = explode(" ", $l);
         $out['nname'] = $v[0];
         //$out['arch'] = $v[1];
         $out['update_version'] = $v[1];
         $out['kloxo_status'] = 'dull';
         if ($v[3] === 'lxlabs-updates') {
             $out['kloxo_status'] = 'on';
         }
         $out['repo'] = $v[3];
         $res[] = $out;
     }
     //dprintr($res);
     return $res;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:47,代码来源:package__up2datelib.php

示例14: __xenimport_get_data

function __xenimport_get_data()
{
    lxfile_mkdir("/home/oldxenconfig-hypervm");
    $list = lscandir_without_dot("/etc/hypervm/");
    foreach ($list as $l) {
        if (!csb($l, "xm")) {
            continue;
        }
        if (csb($l, "xmexample")) {
            continue;
        }
        $vm[] = __xenimport_parse_config("/etc/xen/{$l}");
        //lxfile_mv("/etc/xen/$l", "/home/oldxenconfig-hypervm");
        lunlink("/etc/xen/auto/{$l}");
    }
    dprintr($vm);
    return $vm;
}
开发者ID:digideskio,项目名称:hypervm,代码行数:18,代码来源:xenimport__seflow.php

示例15: parse_mapping

function parse_mapping($root, $m, $parent_path)
{
    $a = $m->children('http://apstandard.com/ns/1/php')->attributes();
    $spath = $m->attributes()->url;
    $parent_path = "{$parent_path}/{$spath}";
    if ($a) {
        dprintr($a);
        if ((string) $a->writable === 'true') {
            lxfile_generic_chmod("{$root}/{$parent_path}", "0775");
            dprint("{$parent_path} Is writable\n");
        }
    } else {
        dprint("{$parent_path} Not writable\n");
    }
    foreach ($m->mapping as $mp) {
        parse_mapping($root, $mp, $parent_path);
    }
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:18,代码来源:xmlinclude.php


注:本文中的dprintr函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。