• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP lunlink函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: process_main

function process_main()
{
    global $gbl, $sgbl, $login, $ghtml;
    global $argv;
    $list = parse_opt($argv);
    $exitchar = $sgbl->__var_exit_char;
    $res = new Remote();
    $res->exception = null;
    $res->ddata = "hello";
    $res->message = "hello";
    $total = file_get_contents($list['temp-input-file']);
    @lunlink($list['temp-input-file']);
    $string = explode("\n", $total);
    if (csb($total, "__file::")) {
        ob_end_clean();
        file_server(null, $total);
    } else {
        $reply = process_server_input($total);
        //fprint(unserialize(base64_decode($reply)));
        ob_end_clean();
        print "{$reply}\n{$exitchar}\n";
        flush();
    }
    exit;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:25,代码来源:process_single.php


示例2: fixlogdir_main

function fixlogdir_main()
{
    global $gbl, $sgbl, $login, $ghtml;
    $progname = $sgbl->__var_program_name;
    $logl = lscandir_without_dot("../log");
    lxfile_mkdir("../processed_log");
    @lunlink("../log/access_log");
    @lunlink("/usr/local/lxlabs/ext/php/error.log");
    $dir = getNotexistingFile("../processed_log", "proccessed");
    system("mv ../log ../processed_log/{$dir}");
    mkdir("../log");
    $list = lscandir_without_dot("../processed_log");
    foreach ($list as $l) {
        remove_directory_if_older_than_a_day("../processed_log/{$l}", 6);
    }
    foreach ($logl as $l) {
        lxfile_touch("../log/{$l}");
    }
    lxfile_generic_chown_rec("../log", "lxlabs:lxlabs");
    //
    // Related to Issue #15
    //
    lxfile_generic_chmod_rec("../log", "0640");
    lxfile_generic_chmod_rec("../processed_log", "0640");
    lxfile_generic_chmod("../log", "0700");
    lxfile_generic_chmod("../processed_log", "0700");
    lxfile_generic_chmod("../log/lighttpd_error.log", "0644");
    lxfile_generic_chmod("../log/access_log", "0644");
    lxfile_generic_chown("../log/lighttpd_error.log", "lxlabs:root");
    lxfile_generic_chown("../log/access_log", "lxlabs:root");
    //
    os_restart_program();
}
开发者ID:soar-team,项目名称:kloxo,代码行数:33,代码来源:fixlogdir.php


示例3: doUpdate

 static function doUpdate($list)
 {
     $cmd = self::getYumCommand();
     $file = fix_nname_to_be_variable($cmd);
     $file = "__path_program_root/cache/{$file}";
     lxshell_return("yum", "-y", "install", implode(" ", $list));
     lunlink($file);
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:8,代码来源:package__yumlib.php


示例4: remove_lighttpd_error_log

function remove_lighttpd_error_log()
{
    $f = "/home/kloxo/httpd/lighttpd/error.log";
    $s = lxfile_size($f);
    if ($s > 50 * 1024 * 1024) {
        lunlink($f);
        createRestartFile("lighttpd");
    }
}
开发者ID:zseand,项目名称:kloxo,代码行数:9,代码来源:linuxproglib.php


示例5: uninstallMe

 static function uninstallMe()
 {
     global $gbl, $sgbl, $login, $ghtml;
     lxshell_return("service", "httpd", "stop");
     lxshell_return("rpm", "-e", "--nodeps", "httpd");
     if (file_exists("/etc/init.d/httpd")) {
         lunlink("/etc/init.d/httpd");
     }
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:9,代码来源:web__apachelib.php


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


示例7: doUpdate

 static function doUpdate($list)
 {
     $cmd = self::getYumCommand();
     $file = fix_nname_to_be_variable(implode(" ", $cmd));
     $file = "__path_program_root/cache/{$file}";
     $plist = implode(" ", $list);
     while (true) {
         system("up2date --nox --install --nosig {$plist}", $return_value);
         if (!$return_value) {
             break;
         }
         dprint("Got error from up2date...\n");
     }
     lunlink($file);
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:15,代码来源:package__up2datelib.php


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


示例9: readAuthorizedKey

 static function readAuthorizedKey($username)
 {
     $p = os_get_home_dir($username);
     if ($p === '/tmp' && $username) {
         lxfile_mkdir("/home/{$username}");
         lxshell_return("usermod", "-d", "/home/{$username}", $username);
         lxfile_unix_chown_rec("/home/{$username}", "{$username}:{$username}");
         $p = "/home/{$username}";
     }
     if (!$p) {
         return;
     }
     $f = "{$p}/.ssh/authorized_keys";
     if (lxfile_exists("{$f}2")) {
         $s = lfile_get_contents("{$f}2");
         $s = "\n{$s}\n";
         lfile_put_contents($f, $s, FILE_APPEND);
         lunlink("{$f}2");
     }
     return lfile_get_contents($f);
 }
开发者ID:digideskio,项目名称:hypervm,代码行数:21,代码来源:sshauthorizedkey__sync.php


示例10: findTotalmailQuota

 static function findTotalmailQuota($driver, $list, $oldtime, $newtime)
 {
     global $gbl, $sgbl, $login, $ghtml;
     if (!isset($oldtime)) {
         return null;
     }
     $file = '/var/log/kloxo/maillog';
     $processedir = "/var/log/kloxo";
     $convertedfile = self::convertfile($oldtime, $newtime);
     if (!$convertedfile) {
         self::rotateLog($processedir, $file);
         return;
     }
     foreach ($list as $d) {
         $tlist[$d] = self::getmail_usage($convertedfile, $d, $oldtime, $newtime);
     }
     lunlink($convertedfile);
     self::rotateLog($processedir, $file);
     self::rotateLog("/var/log/kloxo/", "/var/log/kloxo/courier");
     self::rotateLog("/var/log/kloxo/", "/var/log/kloxo/smtp.log");
     return $tlist;
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:22,代码来源:mailtrafficlib.php


示例11: initThisList

 static function initThisList($parent, $class)
 {
     // Load entire Session
     $result = null;
     $list = lscandir_without_dot("__path_program_root/session");
     foreach ($list as $l) {
         $pp = lfile_get_json_unserialize("__path_program_root/session/{$l}");
         if (!$pp) {
             lunlink("__path_program_root/session/{$l}");
             continue;
         }
         if (!$parent->isAdmin()) {
             //$result = $db->getRowsWhere("parent_clname = '" . $parent->getClName() . "'");
             if ($pp['parent_clname'] !== $parent->getClName()) {
                 continue;
             }
         }
         $result[] = $pp;
     }
     if ($result) {
         $parent->setListFromArray($parent->__masterserver, $parent->__readserver, 'ssessionlist', $result, true);
     }
     return null;
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:24,代码来源:ssession.php


示例12: 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);
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:68,代码来源:cron__linuxlib.php


示例13: setInternalParam


//.........这里部分代码省略.........
     }
     $iplist = get_namelist_from_objectlist($this->main->vmipaddress_a);
     if ($this->main->mainipaddress) {
         $main_ip = $this->main->mainipaddress;
         $iplist = array_remove($iplist, $main_ip);
     } else {
         $main_ip = array_shift($iplist);
     }
     if ($this->main->networknetmask) {
         $main_netmask = $this->main->networknetmask;
     } else {
         $main_netmask = "255.255.255.0";
     }
     $iplist = implode(" ", $iplist);
     $ipadd = $result['ADD_IP'];
     $sethostname = $result['SET_HOSTNAME'];
     $setuserpass = $result['SET_USERPASS'];
     $ipdel = $result['DEL_IP'];
     if ($this->main->networkgateway) {
         $gw = $this->main->networkgateway;
     } else {
         $gw = os_get_network_gateway();
     }
     $gwn = strtil($gw, '.') . '.0';
     $hostname = $this->main->hostname;
     if (!$hostname) {
         $hostname = os_get_hostname();
     }
     if ($result['STARTUP_SCRIPT'] != 'systemd') {
         $name = createTempDir("{$mountpoint}/tmp", 'xen-scripts');
         lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/functions", $name);
         lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$ipadd}", $name);
         lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$sethostname}", $name);
         lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$setuserpass}", $name);
         lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$ipdel}", $name);
         $basepath = strfrom($name, $mountpoint);
         lfile_put_contents("{$name}/tmpfile.sh", "source /{$basepath}/functions\nsource /{$basepath}/{$ipdel}\n");
         $delipstring = "IPDELALL=yes chroot {$mountpoint} bash /{$basepath}/tmpfile.sh";
         log_shell($delipstring);
         log_shell(system($delipstring, $ret1) . ":return {$ret1}");
         putenv("VE_STATE=stopped");
         lfile_put_contents("{$name}/tmpfile.sh", "source /{$basepath}/functions\n source /{$basepath}/{$ipadd}\n");
         $string = "IPDELALL=yes MAIN_NETMASK={$main_netmask} MAIN_IP_ADDRESS={$main_ip} IP_ADDR=\"{$iplist}\" NETWORK_GATEWAY={$gw} NETWORK_GATEWAY_NET={$gwn} chroot {$mountpoint} bash /{$basepath}/tmpfile.sh";
         log_shell($string);
         log_shell(system($string, $ret1) . ":return {$ret1}");
         lfile_put_contents("{$name}/tmpfile.sh", "source /{$basepath}/functions\n source /{$basepath}/{$sethostname}\n");
         $string = "HOSTNM={$hostname} chroot {$mountpoint} bash /{$basepath}/tmpfile.sh";
         log_shell($string);
         log_shell(system($string, $ret1) . ":return {$ret1}");
         if ($this->main->subaction === 'rebuild' || $this->main->dbaction === 'add' || $this->main->isOn('__var_rootpassword_changed') && $this->main->rootpassword) {
             $rootpass = "root:{$this->main->rootpassword}";
             lfile_put_contents("{$name}/tmpfile.sh", "source /{$basepath}/functions\n source /{$basepath}/{$setuserpass}\n");
             $string = "USERPW={$rootpass} chroot {$mountpoint} bash /{$basepath}/tmpfile.sh";
             log_shell($string);
             log_shell(system($string));
         }
         lxfile_rm_rec($name);
     } else {
         if ($result['STARTUP_SCRIPT'] == 'systemd') {
             $script_dir = createTempDir("{$mountpoint}", "hypervm-runonce");
             lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/functions", $script_dir);
             lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$ipadd}", $script_dir);
             lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$sethostname}", $script_dir);
             lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$setuserpass}", $script_dir);
             lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$ipdel}", $script_dir);
             $basepath = strfrom($script_dir, $mountpoint);
             $startupdir = 'lib/systemd/system';
             $startupscript = 'fedora-startup.service';
             $setrootpass = '';
             if ($this->main->subaction === 'rebuild' || $this->main->dbaction === 'add' || $this->main->isOn('__var_rootpassword_changed') && $this->main->rootpassword) {
                 $rootpass = "root:{$this->main->rootpassword}";
                 $setrootpass = " & USERPW={$rootpass} source {$basepath}/{$setuserpass}";
             }
             $run_once_script = "#!/bin/bash\n" . "source {$basepath}/functions\n" . '(' . "IPDELALL=yes source {$basepath}/{$ipdel}" . " & IPDELALL=yes VE_STATE=stopped MAIN_NETMASK={$main_netmask} MAIN_IP_ADDRESS={$main_ip} IP_ADDR=\"{$iplist}\" NETWORK_GATEWAY={$gw} NETWORK_GATEWAY_NET={$gwn} source {$basepath}/{$ipadd}" . " & HOSTNM={$hostname} source {$basepath}/{$sethostname}" . "{$setrootpass})\n" . "service fedora-startup disable\nrm -f /{$startupdir}/{$startupscript}\nrm -rf {$basepath}";
             lfile_put_contents("{$script_dir}/hypervm-runonce.sh", $run_once_script);
             lxfile_cp_rec("__path_program_root/bin/xen-dists/scripts/{$startupscript}", "{$mountpoint}/{$startupdir}");
             lfile_put_contents("{$mountpoint}/{$startupdir}/{$startupscript}", lfile_get_contents("{$mountpoint}/{$startupdir}/{$startupscript}") . "ExecStart={$basepath}/hypervm-runonce.sh\n");
             system("ln -s /lib/systemd/system/fedora-startup.service {$mountpoint}/etc/systemd/system/multi-user.target.wants/fedora-startup.service");
             system("chmod 755 {$script_dir}/hypervm-runonce.sh");
         }
     }
     if ($this->main->nameserver) {
         $nlist = explode(" ", $this->main->nameserver);
         $nstring = null;
         foreach ($nlist as $l) {
             $nstring .= "nameserver {$l}\n";
         }
         lfile_put_contents("{$mountpoint}/etc/resolv.conf", $nstring);
     }
     if ($this->main->timezone) {
         lxfile_rm("{$mountpoint}/etc/localtime");
         $cmdstring = "ln -sf ../usr/share/zoneinfo/{$this->main->timezone} {$mountpoint}/etc/localtime";
         log_log("localtime", $cmdstring);
         do_exec_system('__system__', "/", $cmdstring, $out, $err, $ret, null);
         //lxfile_cp("/usr/share/zoneinfo/{$this->main->timezone}", "$mountpoint/etc/localtime");
     }
     lunlink("{$mountpoint}/etc/sysconfig/network-scripts/ifcfg-venet0");
     lunlink("{$mountpoint}/etc/sysconfig/network-scripts/ifcfg-venet0:0");
     $this->main->doKloxoInit($mountpoint);
 }
开发者ID:digideskio,项目名称:hypervm,代码行数:101,代码来源:vps__xenlib.php


示例14: lxfile_mkdir

    lxfile_mkdir("{$cdir}/old");
    lxfile_mkdir("{$cdir}/cgi-bin");
    foreach ($dlist as $l) {
        if (lxfile_exists("{$cdir}/{$l->nname}")) {
            lxfile_mv_rec("{$cdir}/{$l->nname}", "{$cdir}/old/");
        }
        if (!is_link("{$cdir}/domain/{$l->nname}/www/")) {
            lxfile_mv_rec("{$cdir}/domain/{$l->nname}/www/", "{$cdir}/{$l->nname}");
        }
        /*
        	foreach($l->subweb_a as $k => $v) {
        		lxfile_mv_rec("$cdir/domain/$l->nname/subdomains/$v->nname", "$cdir/$l->nname/$v->nname");
        	}
        */
        if (!is_link("{$cdir}/domain/{$l->nname}/cgi-bin/")) {
            lxfile_mv_rec("{$cdir}/domain/{$l->nname}/cgi-bin/", "{$cdir}/cgi-bin/{$l->nname}");
        }
        lunlink("{$cdir}/domain/{$l->nname}/www");
        lxfile_symlink("{$cdir}/{$l->nname}", "{$cdir}/domain/{$l->nname}/www");
        lxfile_symlink("{$cdir}/cgi-bin/{$l->nname}", "{$cdir}/domain/{$l->nname}/cgi-bin");
        $web = $l->getObject('web');
        $web->setUpdateSubaction('full_update');
        $dirlist = $web->getList('dirprotect');
        foreach ($dirlist as $dir) {
            $dir->setUpdateSubaction('full_update');
            $dir->was();
        }
        $web->was();
    }
}
lxshell_return("__path_php_path", "../bin/misc/fixftpuserclient.phps");
开发者ID:soar-team,项目名称:kloxo,代码行数:31,代码来源:fixsimpldocroot.php


示例15: setRemoveOldDirs

function setRemoveOldDirs()
{
    log_cleanup("Remove Old dirs");
    log_cleanup("- Remove process");
    if (lxfile_exists("/home/admin/domain")) {
        log_cleanup("- Remove dir /home/admin/domain/ if exists");
        rmdir("/home/admin/domain/");
    }
    if (lxfile_exists("/home/admin/old")) {
        log_cleanup("- Remove dir /home/admin/old/ if exists");
        rmdir("/home/admin/old/");
    }
    if (lxfile_exists("/home/admin/cgi-bin")) {
        log_cleanup("- Remove dir /home/admin/cgi-bin/ if exists");
        rmdir("/home/admin/cgi-bin/");
    }
    if (lxfile_exists("/etc/skel/Maildir")) {
        log_cleanup("- Remove dir /etc/skel/Maildir/ if exists");
        rmdir("/etc/skel/Maildir/new");
        rmdir("/etc/skel/Maildir/cur");
        rmdir("/etc/skel/Maildir/tmp");
        rmdir("/etc/skel/Maildir/");
    }
    if (lxfile_exists('kloxo.sql')) {
        log_cleanup("- Remove file kloxo.sql");
        lunlink('kloxo.sql');
    }
}
开发者ID:zseand,项目名称:kloxo,代码行数:28,代码来源:lib.php


示例16: dbactionDelete

 function dbactionDelete()
 {
     global $gbl, $sgbl, $login, $ghtml;
     lunlink("/home/lighttpd/conf/domains/{$this->main->nname}.conf");
     $this->delDomain();
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:6,代码来源:web__lighttpdlib.php


示例17: removeOtherDriver

 static function removeOtherDriver($driverapp)
 {
     global $gbl, $sgbl, $login, $ghtml;
     if ($driverapp === 'bind') {
         lxshell_return("service", "djbdns", "stop");
         lxshell_return("chkconfig", "named", "on");
         $pattern = 'include "/etc/kloxo.named.conf";';
         $file = "/var/named/chroot/etc/named.conf";
         $comment = "//Kloxo";
         addLineIfNotExistInside($file, $pattern, $comment);
         touch("/var/named/chroot/etc/kloxo.named.conf");
         chown("/var/named/chroot/etc/kloxo.named.conf", "named");
         lxshell_return("rpm", "-e", "djbdns");
         lunlink("/etc/init.d/djbdns");
     } else {
         lxshell_return("service", "named", "stop");
         lxshell_return("rpm", "-e", "--nodeps", "bind");
         lxshell_return("rpm", "-e", "--nodeps", "bind-chroot");
         lxshell_return("chkconfig", "djbdns", "on");
     }
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:21,代码来源:dnslib.php


示例18: do_serve_file

function do_serve_file($fd, $rem)
{
    $file = $rem->filename;
    $file = basename($file);
    $file = "__path_serverfile/{$file}";
    if (!lxfile_exists($file)) {
        log_log("servfile", "datafile {$file} dosn't exist, exiting");
        print_or_write($fd, "fFile Doesn't {$file} Exist...\n\n\n\n");
        return false;
    }
    $array = lfile_get_unserialize($file);
    lunlink($file);
    $realfile = $array['filename'];
    $pass = $array['password'];
    if ($fd) {
        dprint("Got request for {$file}, realfile: {$realfile}\n");
    }
    log_log("servfile", "Got request for {$file} realfile {$realfile}");
    if (!($pass && $pass === $rem->password)) {
        print_or_write($fd, "fPassword doesn't match\n\n");
        return false;
    }
    if (is_dir($realfile)) {
        // This should neverhappen. The directories are zipped at cp-fileserv and tar_to_filserved then itself.
        $b = basename($realfile);
        lxfile_mkdir("__path_serverfile/tmp/");
        $tfile = tempnam("__path_serverfile/tmp/", "{$b}.tar");
        $list = lscandir_without_dot($realfile);
        lxshell_tar($realfile, $tfile, $list);
        $realfile = $tfile;
    }
    $fpr = lfopen($realfile, "rb");
    if (!$fpr) {
        print_or_write($fd, "fCouldn't open {$realfile}\n\n");
        return false;
    }
    print_or_write($fd, "s");
    while (!feof($fpr)) {
        $written = print_or_write($fd, fread($fpr, 8092));
        if ($written <= 0) {
            break;
        }
    }
    // Just send a newline so that the fgets will break after reading. This has to be removed after the file is read.
    print_or_write($fd, "\n");
    fclose($fpr);
    fileserv_unlink_if_tmp($realfile);
    return true;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:49,代码来源:lib.php


示例19: checkRestart

function checkRestart()
{
    if (if_demo()) {
        return;
    }
    log_log("cron_exec", "Check service restarts...\n");
    $res = lscandir_without_dot("__path_program_etc/.restart");
    if ($res === false) {
        dprint(".restart does not exist... Creating\n");
        lxfile_mkdir("__path_program_etc/.restart");
        lxfile_generic_chown("__path_program_etc/.restart", "lxlabs");
    }
    foreach ((array) $res as $r) {
        if (csb($r, "._restart_")) {
            $cmd = strfrom($r, "._restart_");
        }
        lunlink("__path_program_etc/.restart/{$r}");
        dprint("Restarting {$cmd}\n");
        switch ($cmd) {
            case 'lxcollectquota':
                log_log("cron_exec", "Start collecting Quota's\n");
                exec_justdb_collectquota();
                break;
            case 'openvz_tc':
                log_log("cron_exec", "Start openvz_tc script\n");
                exec_openvz_tc();
                break;
            default:
                log_log("cron_exec", "Restarting {$cmd}\n");
                exec_with_all_closed("/etc/init.d/{$cmd} restart");
                break;
        }
    }
}
开发者ID:soar-team,项目名称:kloxo,代码行数:34,代码来源:lxserverlib.php


示例20: do_restore

 function do_restore($docd)
 {
     $srv = new COM("SQLDMO.SQLServer");
     $srv->LoginSecure = true;
     try {
         $srv->Connect("localhost,1433");
     } catch (Exception $e) {
         throw new lxException('MsSql Connection is Failed', '', '');
     }
     $sBAKFilePath = "C:/SQL_Backup";
     if (!is_dir($sBAKFilePath)) {
         mkdir($sBAKFilePath, 0777);
     }
     $dir = "{$sBAKFilePath}/mssql";
     $mode = 0700;
     $sBAKFilePath = $dir . mt_rand(0, 9999999);
     mkdir($sBAKFilePath, $mode);
     $docf = "{$sBAKFilePath}/{$this->main->dbname}.bak";
     $ret = lxshell_unzip_with_throw($sBAKFilePath, $docd);
     if (!lxfile_exists($docf)) {
         throw new lxException('could_not_find_matching_dumpfile_for_db', '', '');
     }
     $bkp = new COM("SQLDMO.Restore");
     $dbname = $this->main->dbname;
     $bkp->Database = $dbname;
     $bkp->Files = $docf;
     $bkp->ReplaceDatabase = True;
     $bkp->SQLRestore($srv);
     print "\nRestored\n";
     $srv->DisConnect();
     lunlink($docf);
     lxfile_tmp_rm_rec($sBAKFilePath);
 }
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:33,代码来源:mssqldb__mssqllib.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP lx_array_merge函数代码示例发布时间:2022-05-15
下一篇:
PHP luna_trim函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap