當前位置: 首頁>>代碼示例>>PHP>>正文


PHP lxfile_cp函數代碼示例

本文整理匯總了PHP中lxfile_cp函數的典型用法代碼示例。如果您正苦於以下問題:PHP lxfile_cp函數的具體用法?PHP lxfile_cp怎麽用?PHP lxfile_cp使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了lxfile_cp函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: xen_install

function xen_install($installtype)
{
    // If openvz.repo file exist remove it imediately before install Xen
    if (file_exists("/etc/yum.repos.d/openvz.repo")) {
        unlink("/etc/yum.repos.d/openvz.repo");
    }
    if (is_centossix()) {
        $arch = `arch`;
        $arch = trim($arch);
        if ($arch === 'x86_64') {
            lxfile_cp("../file/centos-6-xen.repo.template", "/etc/yum.repos.d/CentOS-Xen.repo");
        } else {
            echo "Sorry, installation aborted. Xen is not supported at CentOS 6 32bit.";
            exit;
        }
    }
    if (is_centosfive()) {
        $list = array("kernel-xen", "xen", "virt-manager");
    } else {
        $list = array("kernel-xen", "xen", "virt-manager", "lxmkinitrd", "lxkernel-domU-xen");
    }
    run_package_installer($list);
    if (file_exists("/boot/vmlinuz-2.6-xen") && !file_exists("/boot/hypervm-xen-vmlinuz")) {
        system("cd /boot ; ln -s vmlinuz-2.6-xen hypervm-xen-vmlinuz; ln -s initrd-2.6-xen.img hypervm-xen-initrd.img");
    }
    if (file_exists("/etc/init.d/libvirtd")) {
        system("chkconfig libvirtd off");
    }
    system("chkconfig xendomains on");
    system("chkconfig xend on");
    if (is_centossix()) {
        system("../bin/grub-bootxen.sh");
        system("sh /script/fixxenkernel");
    }
}
開發者ID:hypervm-ng,項目名稱:hypervm-ng,代碼行數:35,代碼來源:virt-install.php

示例2: cp_dbfile

function cp_dbfile()
{
    global $gbl, $sgbl, $login, $ghtml;
    $progname = $sgbl->__var_program_name;
    lxfile_cp("../sbin/{$progname}db", "/usr/bin/{$progname}db");
    lxfile_generic_chmod("/usr/bin/{$progname}db", "0755");
}
開發者ID:digideskio,項目名稱:hypervm,代碼行數:7,代碼來源:tmpupdatecleanup.php

示例3: installMe

 static function installMe()
 {
     $ret = lxshell_return("yum", "-y", "install", "spamassassin");
     if ($ret) {
         throw new lxexception('install_spamassassin_failed', 'parent');
     }
     lxshell_return("chkconfig", "spamassassin", "on");
     lxfile_cp("../file/sysconfig_spamassassin", "/etc/sysconfig/spamassassin");
     createRestartFile("spamassassin");
 }
開發者ID:soar-team,項目名稱:kloxo,代碼行數:10,代碼來源:spam__spamassassinlib.php

示例4: openvz_install

function openvz_install($installtype)
{
    $arch = `arch`;
    $arch = trim($arch);
    if ($arch === 'x86_64') {
        $list = array("vzctl.x86_64", "vzquota.x86_64", "ovzkernel.x86_64");
    } else {
        $list = array("vzctl", "vzquota", "ovzkernel-PAE");
    }
    lxfile_cp("../file/openvz.repo", "/etc/yum.repos.d/openvz.repo");
    run_package_installer($list);
}
開發者ID:digideskio,項目名稱:hypervm,代碼行數:12,代碼來源:virt-install.php

示例5: installMe

 static function installMe()
 {
     lxshell_return("yum", "-y", "install", "djbdns", "daemontools");
     if ($ret) {
         throw new lxexception('install_djbdns_failed', 'parent');
     }
     lxfile_rm_rec("/var/tinydns");
     lxfile_rm_rec("/var/axfrdns");
     lxshell_return("__path_php_path", "../bin/misc/djbdnsstart.php");
     lxfile_cp("../file/djbdns.init", "/etc/init.d/djbdns");
     lxfile_unix_chmod("/etc/init.d/djbdns", "0755");
     lxshell_return("chkconfig", "djbdns", "on");
     createRestartFile("djbdns");
 }
開發者ID:zseand,項目名稱:kloxo,代碼行數:14,代碼來源:dns__djbdnslib.php

示例6: os_createLowMem

function os_createLowMem()
{
    if (!lxfile_exists("/proc/user_beancounters") && !lxfile_exists("/proc/xen")) {
        if (!lxshell_return("diff", "../file/lowmem/my.cnf.lowmem", "/etc/my.cnf")) {
            lxfile_cp("/etc/lowmem.saved.my.cnf", "/etc/my.cnf");
            createRestartFile("mysqld");
        }
        return;
    }
    if (lxfile_exists("__path_program_etc/flag/lowmem.flag")) {
        if (!lxfile_exists("/etc/lowmem.saved.my.cnf")) {
            lxfile_cp("/etc/my.cnf", "/etc/lowmem.saved.my.cnf");
            lxfile_cp("../file/lowmem/my.cnf.lowmem", "/etc/my.cnf");
            createRestartFile('mysql');
            createRestartFile('courier-imap');
        }
        //lxfile_cp("../file/lowmem/spamassassin.lowmem", "/etc/sysconfig/spamassassin");
    }
}
開發者ID:zseand,項目名稱:kloxo,代碼行數:19,代碼來源:linuxproglib.php

示例7: dbactionUpdate

 function dbactionUpdate($subaction)
 {
     $name = sslcert::getSslCertnameFromIP($this->main->nname);
     $path = "__path_ssl_root";
     $contentscer = $this->main->text_crt_content;
     $contentskey = $this->main->text_key_content;
     $contentsca = trim($this->main->text_ca_content);
     if (!$contentscer || !$contentskey) {
         throw new lxException("certificate_key_file_empty", '');
     }
     sslcert::checkAndThrow($contentscer, $contentskey, $name);
     lfile_put_contents("{$path}/{$name}.crt", $contentscer);
     lfile_put_contents("{$path}/{$name}.key", $contentskey);
     $contentpem = "{$contentscer}\n{$contentskey}";
     lfile_put_contents("{$path}/{$name}.pem", $contentpem);
     if ($contentsca) {
         lfile_put_contents("{$path}/{$name}.ca", $contentsca);
     } else {
         lxfile_cp("htmllib/filecore/program.ca", "{$path}/{$name}.ca");
     }
     createRestartFile($this->main->__var_webdriver);
 }
開發者ID:lonelywoolf,項目名稱:hypervm,代碼行數:22,代碼來源:sslipaddress__synclib.php

示例8: add_line_to_secondary_mycnf

function add_line_to_secondary_mycnf($master, $slavepass)
{
    global $gbl, $sgbl, $login, $ghtml;
    if (!lxfile_exists("/etc/secondary_master.copy.my.cnf")) {
        lxfile_cp("/etc/my.cnf", "/etc/secondary_master.copy.my.cnf");
    }
    $list = lfile_trim("/etc/my.cnf");
    foreach ($list as $k => $l) {
        if (check_if_skip($l)) {
            continue;
        }
        $ll[] = $l;
        if ($l == '[mysqld]') {
            $ll[] = "server-id=2";
            $ll[] = "master-host={$master}";
            $ll[] = "master-user=lxlabsslave";
            $ll[] = "master-password={$slavepass}";
        }
    }
    lfile_put_contents("/etc/my.cnf", implode("\n", $ll));
    system("service mysqld restart");
}
開發者ID:hypervm-ng,項目名稱:hypervm-ng,代碼行數:22,代碼來源:setupsecondary.php

示例9: add_line_to_master_mycnf

function add_line_to_master_mycnf()
{
    global $gbl, $sgbl, $login, $ghtml;
    $dbf = $sgbl->__var_dbf;
    if (!lxfile_exists("/etc/primary_master.copy.my.cnf")) {
        lxfile_cp("/etc/my.cnf", "/etc/primary_master.copy.my.cnf");
    }
    $v = lfile_get_contents("/etc/my.cnf");
    if (csa($v, "binlog-do-db")) {
        print "Line already exists in /etc/my.cnf\n";
        return;
    }
    $list = lfile_trim("/etc/my.cnf");
    foreach ($list as $k => $l) {
        $ll[] = $l;
        if ($l == '[mysqld]') {
            $ll[] = "log-bin=mysql-bin";
            $ll[] = "binlog-do-db={$dbf}";
            $ll[] = "server-id=1";
        }
    }
    lfile_put_contents("/etc/my.cnf", implode("\n", $ll));
    system("service mysqld restart");
}
開發者ID:hypervm-ng,項目名稱:hypervm-ng,代碼行數:24,代碼來源:setupprimarymaster.php

示例10: enablePhp

 function enablePhp()
 {
     global $gbl, $sgbl, $login, $ghtml;
     $domname = $this->main->nname;
     $uname = $this->main->username;
     if (!$this->main->priv->isOn('php_flag')) {
         return "AddType application/x-httpd-php-source .php\n";
     }
     $string = null;
     lxfile_unix_chown("/home/httpd/{$domname}", "{$uname}:apache");
     lxfile_unix_chmod("/home/httpd/{$domname}", "0775");
     if (!lxfile_exists("/home/httpd/{$domname}/php.ini")) {
         // MR -- issue #650 - lxuser_cp doesn't work and change to lxfile_cp; lighttpd use lxfile_cp
         lxfile_cp("/etc/php.ini", "/home/httpd/{$domname}/php.ini");
     }
     return $string;
 }
開發者ID:soar-team,項目名稱:kloxo,代碼行數:17,代碼來源:web__apachelib.php

示例11: foreach

    }
}
foreach ($list as &$l) {
    $l = preg_replace("/__cgi_or_fcgi__/", $php_st, $l);
    $l = preg_replace("/__program_name__/", $sgbl->__var_program_name, $l);
    $l = preg_replace("/__program_disable_nonssl__/", $nonsslhash, $l);
    $l = preg_replace("/__program_port__/", $nonsslport, $l);
    $l = preg_replace("/__program_sslport__/", $sslport, $l);
    $l = preg_replace("/__program_user__/", $user, $l);
}
lfile_put_contents("../file/lighttpd.conf", implode("", $list));
$pemfile = "__path_program_root/etc/program.pem";
$cafile = "__path_program_root/etc/program.ca";
if (!lxfile_exists($pemfile)) {
    lxfile_cp("__path_program_htmlbase/htmllib/filecore/program.pem", $pemfile);
    lxfile_generic_chown($pemfile, "lxlabs");
}
// Merged from 6.1.x/kloxo/bin/common/misc/fixlighty.php	(revision 472)
lxfile_touch("__path_program_root/log/lighttpd_error.log");
lxfile_touch("__path_program_root/log/access_log");
lxfile_generic_chmod("__path_program_root/log", "0700");
lxfile_generic_chown("__path_program_root/log", "lxlabs:lxlabs");
lxfile_generic_chmod("__path_program_root/log/lighttpd_error.log", "0644");
lxfile_generic_chmod("__path_program_root/log/access_log", "0644");
lxfile_generic_chown("__path_program_root/log/lighttpd_error.log", "lxlabs:root");
lxfile_generic_chown("__path_program_root/log/access_log", "lxlabs:root");
//
if (!lxfile_exists($cafile)) {
    lxfile_cp("__path_program_htmlbase/htmllib/filecore/program.ca", $cafile);
    lxfile_generic_chown($cafile, "lxlabs");
}
開發者ID:lonelywoolf,項目名稱:hypervm,代碼行數:31,代碼來源:fixlighty.php

示例12: updateupload_Logo

 function updateupload_Logo($param)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $progname = $sgbl->__var_program_name;
     $parent = $this->getParentO();
     $imgname = $parent->getClName();
     //	$param['specialplay_b-logo_image'] = "/img/logo/$imgname.gif";
     //	$param['specialplay_b-logo_image_loading'] = "/img/logo/$imgname-loading.gif";
     //	make_sure_directory_is_lxlabs("__path_program_htmlbase/img/logo");
     $param['specialplay_b-logo_image'] = "/img/user-logo.png";
     $fullpath_logo_image = __path_program_htmlbase . $param['specialplay_b-logo_image'];
     // temporary only for admin - 6.1.7
     if ($_FILES['logo_image_f']['tmp_name']) {
         lxfile_mv($_FILES['logo_image_f']['tmp_name'], $fullpath_logo_image);
     }
     /*
     	else {
     		lxfile_cp("__path_program_htmlbase/img/$progname-logo.gif", "__path_program_htmlbase" . $param['specialplay_b-logo_image']);
     	}
     */
     lxfile_cp($fullpath_logo_image, "/usr/local/lxlabs/kloxo/file/user-logo.png");
     // must chown to lxlabs for successful display on 'Upload Logo'
     lxfile_unix_chown($fullpath_logo_image, "lxlabs");
     passthru("lxphp.exe /usr/local/lxlabs/kloxo/bin/fix/fix-userlogo.php --select=all");
     /*
     	if ($_FILES['logo_image_loading_f']['tmp_name']) {
     		lxfile_mv($_FILES['logo_image_loading_f']['tmp_name'], "__path_program_htmlbase" .$param['specialplay_b-logo_image_loading']);
     	} else {
     		lxfile_cp("__path_program_htmlbase/img/$progname-splash.gif", "__path_program_htmlbase" . $param['specialplay_b-logo_image_loading']);
     	}
     */
     $tsp = $parent->getObject("sp_childspecialplay");
     $tsp->specialplay_b->logo_image = $param['specialplay_b-logo_image'];
     //	$tsp->specialplay_b->logo_image_loading = $param['specialplay_b-logo_image_loading'];
     $tsp->setUpdateSubaction('upload_logo');
     $this->setUpdateSubaction('upload_logo');
     return $param;
 }
開發者ID:soar-team,項目名稱:kloxo,代碼行數:38,代碼來源:appearancelib.php

示例13: do_restore

 public function do_restore($docd)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $this->hardstop();
     $this->createDisk();
     $tmpbasedir = $this->main->__var_tmp_base_dir;
     if ($this->checkForSnapshot()) {
         lvm_remove($this->getSnapshotName());
         if ($this->checkForSnapshot()) {
             throw new lxException("snapshot_for_this_exists_and_coudnt_remove");
         }
     }
     if (!$this->main->isWindows()) {
         $mountpoint = $this->mount_this_guy();
         lxshell_unzip_numeric_with_throw($mountpoint, $docd);
         //lxshell_return("tar", "-C", "$mountpoint/dev", "-xzf", "__path_program_root/file/vps-dev.tgz");
         if ($this->main->__old_driver !== 'xen') {
             log_restore("Restoring {$this->main->nname} from a different driver {$this->main->__old_driver} to xen");
             /*
             	if (!lxfile_exists("__path_program_home/xen/template/{$this->main->ostemplate}.tar.gz")) {
             		throw new lxException("migrating_from_{$this->main->__old_driver}_needs_osImage");
             }
             */
             //lxshell_return("tar", "-C", $mountpoint, "-xzf", "__path_program_home/xen/template/{$this->main->ostemplate}.tar.gz", "etc/rc.d", "sbin", "etc/hotplug.d", "etc/dev.d", "etc/udev", "lib", "usr", "bin", "etc/inittab", "etc/sysconfig");
             //lxshell_return("tar", "-C", $mountpoint, "-xzf", "__path_program_home/xen/template/{$this->main->ostemplate}.tar.gz", "etc/rc.d", "sbin", "etc/hotplug.d", "etc/dev.d", "etc/udev", "lib", "usr", "bin", "etc/inittab");
             lxfile_cp("../file/sysfile/xen/fstab", "{$mountpoint}/etc/fstab");
             lxfile_cp("__path_program_root/file/sysfile/xen/inittab", "{$mountpoint}/etc/inittab");
             lunlink("{$mountpoint}/etc/mtab");
             lunlink("{$mountpoint}/etc/init.d/vzquota");
             $this->copyKernelModules();
         }
         lxfile_mkdir("{$mountpoint}/proc");
         $this->createConfig();
         $this->setMemoryUsage();
         $this->setCpuUsage();
         $this->setSwapUsage();
     } else {
         $tmpdir = createTempDir($tmpbasedir, "lx_{$this->main->nname}_backup");
         lxshell_unzip_with_throw($tmpdir, $docd);
         $partition = $this->getPartition();
         lxshell_return("ntfsclone", "--restore-image", "--force", "-O", $partition, "{$tmpdir}/backup.img");
         lxfile_tmp_rm_rec("{$tmpdir}");
         $this->kpart_remove();
     }
     $this->main->status = 'on';
     try {
         $this->toggleStatus();
     } catch (Exception $e) {
     }
     $this->start();
     // Saving state doesn't seem to be an option. The thing is, it is the file system itself that's left in an inconsistent state, and there's little we can do about it.
     /*
     	$statefile = "$mountpoint/__hypervm_xensavestate";
     	if (lxfile_exists($statefile)) {
     		$tmp = lx_tmp_file("/tmp", "xen_ram");
     		lxfile_mv($statefile, $tmp);
     		$this->umountThis();
     		$this->restoreXen($tmp);
     		lunlink($tmp);
     	} else {
     		$this->start();
     	}
     */
 }
開發者ID:digideskio,項目名稱:hypervm,代碼行數:64,代碼來源:vps__xenlib.php

示例14: update_main

function update_main()
{
    global $argc, $argv;
    global $gbl, $sgbl, $login, $ghtml;
    log_cleanup("*** Executing Update (upcp) - BEGIN ***");
    debug_for_backend();
    $login = new Client(null, null, 'upgrade');
    $DoUpdate = false;
    $opt = parse_opt($argv);
    log_cleanup("Kloxo Install/Update");
    if (lxfile_exists("/var/cache/kloxo/kloxo-install-firsttime.flg")) {
        log_cleanup("- Installing Kloxo packages at the first time");
        $DoUpdate = true;
    } else {
        log_cleanup("- Getting Version Info from the LxCenter download Server");
        $upversion = false;
        if (isset($opt['till-version']) && $opt['till-version'] || lxfile_exists("__path_slave_db")) {
            $sgbl->slave = true;
            $upversion = findNextVersion($opt['till-version']);
            $type = 'slave';
        } else {
            $sgbl->slave = false;
            $upversion = findNextVersion();
            $type = 'master';
        }
        if ($upversion) {
            log_cleanup("- Connecting LxCenter download server");
            do_upgrade($upversion);
            log_cleanup("- Upgrade Done. Cleanup....");
            flush();
        } else {
            $localversion = $sgbl->__ver_major_minor_release;
            log_cleanup("- Kloxo is the latest version ({$localversion})");
        }
        // Thirdparty/Webmail/AWstats checks
        $verWM = getVersionNumber(get_package_version("lxwebmail"));
        $verAW = getVersionNumber(get_package_version("lxawstats"));
        $ver = file_get_contents("http://download.lxcenter.org/download/thirdparty/kloxo-version.list");
        $verTP = getVersionNumber($ver);
        if (!lxfile_exists("/var/cache/kloxo/lxwebmail{$verWM}.tar.gz")) {
            $retWM = true;
        } else {
            $retWM = false;
        }
        if (!lxfile_exists("/var/cache/kloxo/lxawstats{$verAW}.tar.gz")) {
            $retAW = true;
        } else {
            $retAW = false;
        }
        if (!lxfile_exists("/var/cache/kloxo/kloxo-thirdparty.{$verTP}.zip")) {
            $retTP = true;
        } else {
            $retTP = false;
        }
        installThirdparty();
        installWebmail();
        installAwstats();
        // Run cleanups or not
        if ($retTP || $retWM || $retAW || $upversion) {
            $DoUpdate = true;
        } else {
            $DoUpdate = false;
        }
    }
    log_cleanup("*** Executing Update (upcp) - END ***");
    if ($DoUpdate == false) {
        log_cleanup("Run /script/cleanup if you want to fix/restore/(re)install non-working components.");
        exit;
    }
    if (is_running_secondary()) {
        log_cleanup("Not running Update cleanup, because this is running as secondary\n");
        exit;
    }
    //
    // Executing update/cleanup process
    //
    lxfile_cp("htmllib/filecore/php.ini", "/usr/local/lxlabs/ext/php/etc/php.ini");
    $res = pcntl_exec("/bin/sh", array("../bin/common/updatecleanup.sh", "--type={$type}"));
}
開發者ID:zseand,項目名稱:kloxo,代碼行數:79,代碼來源:updatelib.php

示例15: switchProgramPre

 static function switchProgramPre($old, $new)
 {
     if ($new === 'bind') {
         lxshell_return("service", "djbdns", "stop");
         $ret = lxshell_return("yum", "-y", "install", "bind", "bind-chroot");
         if ($ret) {
             throw new lxexception('install_bind_failed', 'parent');
         }
         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("yum", "-y", "install", "djbdns", "daemontools-toaster");
         if ($ret) {
             throw new lxexception('install_djbdns_failed', 'parent');
         }
         lxshell_return("service", "named", "stop");
         lxfile_rm_rec("/var/tinydns");
         lxfile_rm_rec("/var/axfrdns");
         lxshell_return("__path_php_path", "../bin/misc/djbdnsstart.php");
         lxshell_return("rpm", "-e", "--nodeps", "bind");
         lxshell_return("rpm", "-e", "--nodeps", "bind-chroot");
         lxfile_cp("../file/djbdns.init", "/etc/init.d/djbdns");
         lxfile_unix_chmod("/etc/init.d/djbdns", "0755");
         lxshell_return("chkconfig", "djbdns", "on");
     }
 }
開發者ID:soar-team,項目名稱:kloxo,代碼行數:33,代碼來源:dnslib.php


注:本文中的lxfile_cp函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。