本文整理汇总了PHP中lxfile_exists函数的典型用法代码示例。如果您正苦于以下问题:PHP lxfile_exists函数的具体用法?PHP lxfile_exists怎么用?PHP lxfile_exists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lxfile_exists函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getServiceDetails
static function getServiceDetails($list)
{
$ps = lxshell_output("ps", "ax");
$run = Service__linux::getRunLevel();
$rclist = lscandir_without_dot("__path_real_etc_root/rc{$run}.d/");
foreach ($list as &$__l) {
$__l['install_state'] = 'dull';
$__l['state'] = 'off';
$__l['boot_state'] = 'off';
if (lxfile_exists("__path_real_etc_root/init.d/{$__l['servicename']}")) {
$__l['install_state'] = 'on';
} else {
continue;
}
if (self::checkServiceInRc($rclist, $__l['servicename'])) {
$__l['boot_state'] = 'on';
}
if ($__l['grepstring']) {
if (preg_match("/[\\/ ]{$__l['grepstring']}/i", $ps)) {
$__l['state'] = 'on';
}
} else {
$ret = lxshell_return("/etc/init.d/{$__l['servicename']}", "status");
if ($ret) {
$__l['state'] = 'off';
} else {
$__l['state'] = 'on';
}
}
}
return $list;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:32,代码来源:service__redhatlib.php
示例2: do_server_stuff
function do_server_stuff()
{
global $gbl, $sgbl, $login, $ghtml;
if (if_demo()) {
return;
}
try {
timed_execution();
if ($sgbl->is_this_master()) {
$schour = null;
$scminute = null;
$timefile = "../etc/conf/scavenge_time.conf";
if (lxfile_exists($timefile)) {
$readvalue = file_get_contents($timefile);
$readvalue = explode(" ", $readvalue);
$schour = $readvalue['0'];
$scminute = $readvalue['1'];
}
log_log("cron_exec", "Initialize Scavenge Cronjob");
if ($schour) {
cron_exec($schour, $scminute, "exec_scavenge");
} else {
cron_exec("03", "35", "exec_scavenge");
}
}
} catch (exception $e) {
print "Caught Exception: ";
print $e->getMessage();
print "\n";
}
}
开发者ID:soar-team,项目名称:kloxo,代码行数:31,代码来源:lxserverlib.php
示例3: 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
示例4: get
function get()
{
if (!lxfile_exists("__path_program_root/session/{$this->nname}")) {
$this->dbaction = 'add';
return;
}
$rmt = lfile_get_json_unserialize("__path_program_root/session/{$this->nname}");
$this->modify($rmt, 'clean');
$this->dbaction = 'clean';
}
开发者ID:soar-team,项目名称:kloxo,代码行数:10,代码来源:ssession.php
示例5: change_lxadmin_to_kloxo_directory
function change_lxadmin_to_kloxo_directory($dir)
{
if (!lxfile_exists($dir)) {
return;
}
$list = lscandir_without_dot_or_underscore($dir);
foreach ($list as $l) {
change_lxadmin_to_kloxo("{$dir}/{$l}");
}
}
开发者ID:soar-team,项目名称:kloxo,代码行数:10,代码来源:kloxo-migrate.php
示例6: collectdata_main
function collectdata_main()
{
if (lxfile_exists("/proc/xen") && lxfile_exists("/usr/sbin/xm")) {
vps__xen::find_traffic();
vps__xen::find_cpuusage();
}
if (lxfile_exists("/proc/vz")) {
vps__openvz::find_traffic();
vps__openvz::find_cpuusage();
vps__openvz::find_memoryusage();
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:12,代码来源:sisinfoc.php
示例7: dbactionAdd
function dbactionAdd()
{
global $gbl, $sgbl, $login, $ghtml;
lxfile_mkdir("__path_client_root/{$this->main->nname}");
lxfile_mkdir("__path_client_root/{$this->main->nname}/__backup");
lxfile_generic_chown("__path_client_root/{$this->main->nname}", "lxlabs");
lxfile_generic_chown("__path_client_root/{$this->main->nname}/__backup", "lxlabs");
if (lxfile_exists("__path_customer_root/{$this->main->getPathFromName()}")) {
throw new lxException("directory_already_exists", '', '');
}
$ret = $this->createUser();
$this->setupDefaultDomain();
return $ret;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:14,代码来源:client__synclib.php
示例8: installapp_data_update
function installapp_data_update()
{
print fill_string("Fetch current InstallApp version", 50);
$string = file_get_contents("http://download.lxcenter.org/download/installapp/version.list");
$rmt = unserialize($string);
if (!$rmt) {
throw new lxexception(" could_not_get_application_version_list", '', "");
}
print " OK ";
$remver = $rmt->applist['installapp'];
print "version is {$remver}\n";
if (lxfile_exists("/home/kloxo/httpd/installappdata")) {
print fill_string("Fetch local InstallApp version", 50);
$loc = get_local_application_version_list();
$locver = $loc->applist['installapp'];
print " OK version is {$locver}\n";
if ($remver != $locver) {
print fill_string("New installapp found", 50);
print " OK\n";
}
}
print fill_string("Checking for old installappdata.zip", 50);
if (lxfile_exists("/tmp/installappdata.zip")) {
lxfile_rm("/tmp/installappdata.zip");
}
print " OK\n";
print fill_string("Downloading InstallApp data...", 50);
system("cd /tmp ; wget -q http://download.lxcenter.org/download/installapp/installappdata.zip");
if (!lxfile_exists("/tmp/installappdata.zip")) {
print " ERROR\n";
print "Could not download data from LxCenter.\nAborted.\n\n";
return;
}
print " OK\n";
print fill_string("Remove old InstallApp data", 50);
// lxfile_rm_rec("__path_kloxo_httpd_root/installappdata");
// lxfile_mkdir("__path_kloxo_httpd_root/installappdata");
lxfile_rm_rec("/home/kloxo/httpd/installappdata");
lxfile_mkdir("/home/kloxo/httpd/installapp");
lxfile_mkdir("/home/kloxo/httpd/installappdata");
print " OK\n";
print fill_string("Unpack new InstallApp data", 50);
// lxshell_unzip("lxlabs", "__path_kloxo_httpd_root/installappdata/", "/tmp/installappdata.zip");
system("cd /home/kloxo/httpd/installappdata ; unzip -qq /tmp/installappdata.zip");
print " OK\n";
print fill_string("Remove downloaded InstallApp data zip file", 50);
lxfile_rm("/tmp/installappdata.zip");
print " OK\n";
}
开发者ID:soar-team,项目名称:kloxo,代码行数:49,代码来源:programlib.php
示例9: generateGraph
static function generateGraph($oldtime, $newtime)
{
global $global_dontlogshell;
$oldv = $global_dontlogshell;
$global_dontlogshell = true;
$list = lscandir_without_dot("__path_httpd_root");
foreach ($list as $l) {
if (!lxfile_exists("__path_httpd_root/{$l}/stats")) {
continue;
}
$total = webtraffic::getEachwebfilequota("__path_httpd_root/{$l}/stats/{$l}-custom_log", $oldtime, $newtime);
execRrdSingle("webtraffic", "ABSOLUTE", $l, $total * 1024 * 1024);
}
$global_dontlogshell = $oldv;
}
开发者ID:zseand,项目名称:kloxo,代码行数:15,代码来源:webtrafficlib.php
示例10: lxfile_rm_rec
function lxfile_rm_rec($file)
{
$obj = new COM("Scripting.FilesystemObject");
$file = expand_real_root($file);
$file = remove_extra_slash($file);
$list = explode("/", $file);
if (count($list) <= 2) {
throw new lxException('recursive_removal_low_level_directories_not_allowed', '');
}
if (lxfile_exists($file)) {
if (is_dir($file)) {
$obj->deleteFolder($file);
} else {
$obj->deleteFile($file);
}
}
}
开发者ID:soar-team,项目名称:kloxo,代码行数:17,代码来源:windowsfslib.php
示例11: scavenge_main
function scavenge_main()
{
global $gbl, $sgbl, $login, $ghtml;
log_scavenge("Fix log dir");
passthru("{$sgbl->__path_php_path} ../bin/common/fixlogdir.php");
log_scavenge("### Starting Scavenge");
initProgramlib('admin');
uploadStatsLxCenter();
if (lxfile_exists("../etc/conf/scavenge_time.conf")) {
log_scavenge("Found scavenge_time.conf");
}
log_scavenge("Collect Traffic");
passthru("{$sgbl->__path_php_path} ../bin/gettraffic.php");
log_scavenge("Collect Quota");
passthru("{$sgbl->__path_php_path} ../bin/collectquota.php");
log_scavenge("Schedule backups");
passthru("{$sgbl->__path_php_path} ../bin/common/schedulebackup.php");
log_scavenge("Clear Sessions");
passthru("{$sgbl->__path_php_path} ../bin/common/clearsession.php");
log_scavenge("Self backup");
passthru("{$sgbl->__path_php_path} ../bin/common/mebackup.php");
log_scavenge("Check Cluster Disk Quota");
checkClusterDiskQuota();
$driverapp = $gbl->getSyncClass(null, 'localhost', 'web');
if ($driverapp === 'lighttpd') {
log_scavenge("Restarting lighttpd");
system("service lighttpd restart");
}
log_scavenge("InstallApp update");
passthru("{$sgbl->__path_php_path} ../bin/installapp-update.phps");
log_scavenge("Watchdog checks");
$rs = get_all_pserver();
foreach ($rs as $r) {
watchdog::addDefaultWatchdog($r);
}
log_scavenge("Collect LxGuard info");
lxguard::collect_lxguard();
log_scavenge("Fix MySQL root password");
fix_all_mysql_root_password();
log_scavenge("Auto update Kloxo");
auto_update();
log_scavenge("### End Scavenge");
// Wait at least 60 seconds before ending the scavenge
sleep(60);
}
开发者ID:soar-team,项目名称:kloxo,代码行数:45,代码来源:scavenge.php
示例12: dbactionAdd
function dbactionAdd()
{
global $gbl, $sgbl, $login, $ghtml;
$dir = $this->main->__var_full_directory;
$dir = expand_real_root($dir);
$pass = $this->main->realpass;
if (!$pass) {
$pass = randomString(8);
}
lxshell_input("{$pass}\n{$pass}\n", "pure-pw", "useradd", $this->main->nname, "-u", $this->main->__var_username, "-d", $dir, "-m");
if (!lxfile_exists($dir)) {
lxfile_mkdir($dir);
lxfile_unix_chown($dir, $this->main->__var_username);
}
$this->setQuota();
// If the user is added is fully formed, this makes sure that all his properties are synced.
$this->toggleStatus();
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:18,代码来源:ftpuser__pureftplib.php
示例13: createDiruserfile
function createDiruserfile()
{
$dir = '__path_httpd_root/' . $this->main->getParentName() . '/__dirprotect';
$dirfile = $dir . '/' . $this->main->getFileName();
$chownug = $this->main->__var_username . ':apache';
if (!lxfile_exists($dir)) {
lxuser_mkdir($chownug, $dir);
lxfile_generic_chmod($dir, '0750');
}
lxfile_rm($dirfile);
if ($this->main->status == 'on') {
$fstr = '';
foreach ($this->main->diruser_a as $v) {
$fstr .= $v->nname . ':' . crypt($v->param) . "\n";
}
lxuser_put_contents($chownug, $dirfile, $fstr);
lxfile_generic_chmod($dirfile, '0750');
}
}
开发者ID:soar-team,项目名称:kloxo,代码行数:19,代码来源:dirprotect__apachelib.php
示例14: updateform
function updateform($subaction, $param)
{
global $gbl, $sgbl, $login, $ghtml;
$list = array("client");
if ($sgbl->isHyperVm()) {
$list = lx_array_merge(array($list, array("vps")));
}
$vlist['class'] = array('s', $list);
$vlist['description'] = null;
$vlist['url'] = null;
$ipt = "img/custom/{$this->nname}.gif";
if (lxfile_exists($ipt)) {
$vlist['image'] = array('I', array('width' => 20, 'height' => 20, 'value' => $ipt));
} else {
$vlist['image'] = array('M', "No Image");
}
$vlist['upload'] = array('F', null);
return $vlist;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:19,代码来源:custombuttonlib.php
示例15: setFixUserlogoDomainPages
function setFixUserlogoDomainPages()
{
global $gbl, $sgbl, $login, $ghtml;
$login->loadAllObjects('client');
$list = $login->getList('client');
foreach ($list as $c) {
$clname = $c->getPathFromName('nname');
$cdir = "/home/{$clname}";
$dlist = $c->getList('domaina');
foreach ((array) $dlist as $l) {
$web = $l->nname;
// If there is no images directory so need to create that first
if (!lxfile_exists("{$cdir}/{$web}/images")) {
lxfile_mkdir("{$cdir}/{$web}/images");
}
system("cp -rf /home/kloxo/httpd/user-logo.png {$cdir}/{$web}/images/logo.png");
log_cleanup("- User logo for domain pages moved to -> {$cdir}/{$web}/images/logo.png");
}
}
}
开发者ID:soar-team,项目名称:kloxo,代码行数:20,代码来源:fix-userlogo.php
示例16: 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
示例17: syncSpamUserPref
function syncSpamUserPref()
{
global $gbl, $sgbl, $ghtml;
// The parent can be either a domain or a user. CHeck for the @ sign.
if (csa($this->main->nname, "@")) {
list($user, $domain) = explode("@", $this->main->nname);
} else {
$domain = $this->main->nname;
$user = null;
}
$sysuser = mmail__qmail::getUserGroup($domain);
// --- issue #578/#721 - missing in version 6.1.6
// $mailpath = "/home/lxadmin/mail";
$mailpath = mmail__qmail::getDir($domain);
if ($user) {
// $prefpath = "$mailpath/domains/{$domain}/{$user}/.bogopref.cf";
$prefpath = "{$mailpath}/{$user}/.bogopref.cf";
} else {
return;
}
$prefdir = dirname($prefpath);
if (!lxfile_exists(dirname($prefpath))) {
lxuser_mkdir($sysuser, dirname($prefpath));
}
$wname = fix_nname_to_be_variable($this->main->nname);
$fdata = null;
$cutoff = $this->main->spam_hit / 10 + 0.2;
$fdata .= "spam_cutoff {$cutoff}\n";
$fdata .= "spam_subject_tag={$this->main->subject_tag}\n";
$fdata .= "wordlist R,user,{$wname}.wordlist.db,1\n";
$fdata .= "wordlist R,system,wordlist.db,2\n";
$fdata .= "wordlist R,system,kloxo.wordlist.db,3\n";
lxuser_put_contents($sysuser, $prefpath, $fdata);
if (!lxfile_real("/var/bogofilter/{$wname}.wordlist.db")) {
new_process_cmd($sysuser, null, "bogofilter -d /var/bogofilter/ --wordlist=R,user,{$wname}.wordlist.db,1 -n < /etc/my.cnf");
}
lxfile_touch("/var/bogofilter/wordlist.db");
// Using generic because spamassasin is used on windows too. Or at least can be used.
//lxfile_generic_chown("/var/bogofilter", mmail__qmail::getUserGroup($domain));
}
开发者ID:soar-team,项目名称:kloxo,代码行数:40,代码来源:spam__bogofilterlib.php
示例18: dbactionUpdate
function dbactionUpdate($subaction)
{
if (if_demo()) {
throw new lxException("demo", $v);
}
if ($this->main->ssh_port && !($this->main->ssh_port > 0)) {
throw new lxException('invalid_ssh_port', 'ssh_port', '');
}
dprint($this->main->ssh_port);
$this->main->ssh_port = trim($this->main->ssh_port);
if (!$this->main->ssh_port) {
$port = "22";
} else {
$port = $this->main->ssh_port;
}
if (lxfile_exists("/etc/fedora-release")) {
$str = lfile_get_contents("../file/template/sshd_config-fedora-2");
} else {
$str = lfile_get_contents("../file/template/sshd_config");
}
$str = str_replace("%ssh_port%", $port, $str);
if ($this->main->isOn('without_password_flag')) {
$wt = 'without-password';
} else {
$wt = 'yes';
}
if ($this->main->isOn('disable_password_flag')) {
$pwa = 'no';
} else {
$pwa = 'yes';
}
$str = str_replace("%permit_root_login%", $wt, $str);
$str = str_replace("%permit_password%", $pwa, $str);
$ret = lfile_put_contents("/etc/ssh/sshd_config", $str);
if (!$ret) {
throw new lxException('could_not_write_config_file', '', '');
}
exec_with_all_closed("/etc/init.d/sshd restart");
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:39,代码来源:sshconfig__linuxlib.php
示例19: 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
示例20: syncSpamUserPref
function syncSpamUserPref()
{
global $gbl, $sgbl, $ghtml;
// The parent can be either a domain or a user. CHeck for the @ sign.
if (csa($this->main->nname, "@")) {
list($user, $domain) = explode("@", $this->main->nname);
} else {
$domain = $this->main->nname;
$user = null;
}
// --- issue #578/#721 - missing in version 6.1.6
// $mailpath = "/home/lxadmin/mail";
$mailpath = mmail__qmail::getDir($domain);
if ($user) {
// $prefpath = "$mailpath/domains/{$domain}/{$user}/user_prefs";
$prefpath = "{$mailpath}/{$user}/user_prefs";
} else {
return;
}
if (!lxfile_exists(dirname($prefpath))) {
lxfile_mkdir(dirname($prefpath));
lxfile_generic_chown(dirname($prefpath), "lxpopuser:lxpopgroup");
}
$fdata = null;
$fdata .= "required_score " . $this->main->spam_hit . "\n";
$fdata .= "ok_locales all\n";
$fdata .= "rewrite_header Subject {$this->main->subject_tag}\n";
foreach ((array) $this->main->wlist_a as $wlist) {
$fdata .= "whitelist_from " . $wlist->nname . "\n";
}
$fdata .= "#***********************************\n";
foreach ((array) $this->main->blist_a as $blist) {
$fdata .= "blocklist_from " . $blist->nname . "\n";
}
lxfile_rm($prefpath);
lfile_write_content($prefpath, $fdata, "lxpopuser:lxpopgroup");
}
开发者ID:soar-team,项目名称:kloxo,代码行数:37,代码来源:spam__spamassassinlib.php
注:本文中的lxfile_exists函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论