本文整理汇总了PHP中lscandir_without_dot函数的典型用法代码示例。如果您正苦于以下问题:PHP lscandir_without_dot函数的具体用法?PHP lscandir_without_dot怎么用?PHP lscandir_without_dot使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lscandir_without_dot函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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();
}
示例3: getweb_usage
static function getweb_usage($name, $customer_name, $oldtime, $newtime, $d)
{
global $gbl, $sgbl, $login, $ghtml;
$web_home = "{$sgbl->__path_httpd_root}";
$log_path = "{$web_home}/{$name}/stats";
$processedir = "{$sgbl->__path_customer_root}/{$customer_name}/__processed_stats/";
lxfile_mkdir($processedir);
$dir1 = "{$log_path}/";
$files = lscandir_without_dot($dir1);
$total = 0;
foreach ($files as $file) {
if (!strstr($file, "gz")) {
$total += self::getEachwebfilequota("{$dir1}/{$file}", $oldtime, $newtime);
$stat = stat("{$dir1}/{$file}");
if ($stat['size'] >= 50 * 1024 * 1024) {
if (isOn($d->remove_processed_stats)) {
lxfile_rm("{$dir1}/{$file}");
} else {
lxfile_mv("{$dir1}/{$file}", getNotexistingFile($processedir, $file));
}
}
}
}
return $total;
}
示例4: getServiceList
static function getServiceList()
{
global $gbl, $sgbl, $login, $ghtml;
$val = lscandir_without_dot("__path_real_etc_root/init.d");
$val = array_remove($val, $sgbl->__var_programname_web);
$val = array_remove($val, $sgbl->__var_programname_dns);
$val = array_remove($val, $sgbl->__var_programname_imap);
$val = array_remove($val, $sgbl->__var_programname_mmail);
$nval = self::getMainServiceList();
$nval = lx_array_merge(array($nval, $val));
return $nval;
}
示例5: __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;
}
示例6: __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;
}
示例7: __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;
}
示例8: foreach
$dns = $l->getObject('dns');
$dns->setUpdateSubaction('full_update');
if ($newip && $oldip) {
foreach ($dns->dns_record_a as $drec) {
if ($drec->ttype !== 'a') {
continue;
}
if ($drec->param === $oldip) {
$drec->param = $newip;
}
}
}
$dns->was();
}
}
$list = lscandir_without_dot("/home/httpd");
foreach ($list as $l) {
if (!is_dir("/home/httpd/{$l}")) {
continue;
}
lxfile_unix_chown_rec("/home/httpd/{$l}/stats/", "apache");
}
$driverapp = $gbl->getSyncClass(null, 'localhost', 'web');
if ($driverapp === 'apache') {
// --- issue #589
// addLineIfNotExistInside("/etc/httpd/conf/httpd.conf", "Include /etc/httpd/conf/kloxo/kloxo.conf", "");
lxshell_return("__path_php_path", "../bin/misc/installsuphp.php");
} else {
lxfile_cp("../file/lighttpd/lighttpd.conf", "/etc/lighttpd/lighttpd.conf");
// --- issue #598
// lxfile_cp("../file/lighttpd/conf/kloxo/kloxo.conf", "/etc/lighttpd/conf/kloxo/kloxo.conf");
示例9: 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;
}
}
}
示例10: 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;
}
示例11: lxfile_cp_content
function lxfile_cp_content($dirsource, $dirdest)
{
$username = "__system__";
$dirdest = expand_real_root($dirdest);
$dirsource = expand_real_root($dirsource);
if (!lxfile_exists($dirdest)) {
lxfile_mkdir($dirdest);
}
$list = lscandir_without_dot($dirsource);
foreach ($list as $l) {
lxfile_cp_rec("{$dirsource}/{$l}", "{$dirdest}/{$l}");
}
}
示例12: updatecollectModInfo
function updatecollectModInfo()
{
$modlist = $this->getList('module');
foreach ((array) $modlist as $m) {
$m->delete();
$m->metadbaction = 'writeonly';
}
$this->was();
$list = lscandir_without_dot(getreal("/module/"));
foreach ($list as $l) {
if ($l === 'define.inc') {
continue;
}
$m = new Module(null, null, $l);
$m->dbaction = 'add';
$m->parent_clname = $this->getClName();
$m->write();
}
return null;
}
示例13: clear_extra_backups
static function clear_extra_backups($class, $name, $object)
{
global $gbl, $sgbl, $login, $ghtml;
$progname = $sgbl->__var_program_name;
$bpath = "__path_program_home/{$class}/{$name}/__backup";
$list = lscandir_without_dot($bpath);
$dellist = self::getDeleteList($object, $list);
dprint("Delete list\n");
dprintr($dellist);
$num = $object->rm_last_number ? $object->rm_last_number : 5;
print "Deleting Old backups.... Will retain {$num}.\n";
$bpath = "__path_program_home/{$class}/{$name}/__backup";
foreach ($dellist as $k => $v) {
print "deleting {$v}\n";
lunlink("{$bpath}/{$v}");
}
print "deleting old backups from ftp server\n";
$fn = null;
$mylogin = null;
if (!$object->ftp_server) {
return;
}
$fn = ftp_connect($object->ftp_server);
$mylogin = ftp_login($fn, $object->rm_username, $object->rm_password);
if (!$fn) {
return;
}
$list = ftp_nlist($fn, $object->rm_directory);
print "Total list of files in ftp server\n";
print_r($list);
$dellist = self::getDeleteList($object, $list);
print "Deleting these files on remote server.\n";
print_r($dellist);
foreach ((array) $dellist as $k => $v) {
$v = basename($v);
if ($object->rm_directory) {
$v = "{$object->rm_directory}/{$v}";
}
ftp_delete($fn, $v);
}
ftp_close($fn);
}
示例14: checkRestart
function checkRestart()
{
if (if_demo()) {
return;
}
$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");
// THe 3,4 etc are the tcp ports of this program, and it should be closed, else some programs will grab it.
//exec("/etc/init.d/$cmd restart </dev/null >/dev/null 2>&1 3</dev/null 4</dev/null 5</dev/null 6</dev/null &");
switch ($cmd) {
case 'lxcollectquota':
exec_justdb_collectquota();
break;
case 'openvz_tc':
exec_openvz_tc();
break;
default:
exec_with_all_closed("/etc/init.d/{$cmd} restart");
break;
}
}
}
示例15: lxfile_dstat
function lxfile_dstat($dir, $duflag)
{
$dir = expand_real_root($dir);
$list = lscandir_without_dot($dir);
$ret = null;
foreach ($list as $l) {
$stat = lstat("{$dir}/{$l}");
get_file_type("{$dir}/{$l}", $stat);
remove_unnecessary_stat($stat);
if ($duflag && is_dir("{$dir}/{$l}") || $l === ".trash") {
$stat['size'] = lxfile_dirsize("{$dir}/{$l}", true);
} else {
$stat['size'] = lxfile_size("{$dir}/{$l}");
}
$stat['name'] = "{$dir}/{$l}";
$ret[] = $stat;
}
//dprintr($ret);
return $ret;
}