本文整理汇总了PHP中lxfile_mkdir函数的典型用法代码示例。如果您正苦于以下问题:PHP lxfile_mkdir函数的具体用法?PHP lxfile_mkdir怎么用?PHP lxfile_mkdir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lxfile_mkdir函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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;
}
开发者ID:zseand,项目名称:kloxo,代码行数:25,代码来源:webtrafficlib.php
示例2: mebackup_main
function mebackup_main()
{
global $gbl, $sgbl, $login, $ghtml;
$progname = $sgbl->__var_program_name;
$cprogname = ucfirst($progname);
initProgram('admin');
lxfile_mkdir("__path_program_home/selfbackup/self/__backup");
$backup = $login->getObject('general')->selfbackupparam_b;
$dbf = $sgbl->__var_dbf;
$pass = trim(lfile_get_contents("__path_program_root/etc/conf/{$progname}.pass"));
$vd = createTempDir("/tmp", "mebackup");
$docf = "{$vd}/mebackup.dump";
// Issue #671 - Fixed backup-restore issue
// exec("exec mysqldump --add-drop-table -u $progname -p$pass $dbf > $docf");
system("exec mysqldump --add-drop-table -u {$progname} -p{$pass} {$dbf} > {$docf}");
$string = @date('Y-M-d') . '-' . time();
$bfile = "{$sgbl->__path_program_home}/selfbackup/self/__backup/{$progname}-scheduled-masterselfbackup-{$string}.zip";
lxshell_zip($vd, $bfile, array("mebackup.dump"));
lxfile_tmp_rm_rec($vd);
if ($backup && $backup->isOn('selfbackupflag')) {
try {
lxbackup::upload_to_server($bfile, basename($bfile), $backup);
} catch (Exception $e) {
print "Sending warning to {$login->contactemail} ..\n";
lx_mail(null, $login->contactemail, "{$cprogname} Self Database Backup Upload Failed on " . date('Y-M-d') . " at " . date('H') . " Hours", "{$cprogname} Backup upload Failed due to {$e->getMessage()}\n");
}
}
$backup->rm_last_number = 20;
$backup->nname = 'masterselfbackup';
lxbackup::clear_extra_backups('selfbackup', 'self', $backup);
}
开发者ID:soar-team,项目名称:kloxo,代码行数:31,代码来源:mebackup.php
示例3: MakeSureDirectoryExists
static function MakeSureDirectoryExists($name)
{
if (!lxfile_exists($name)) {
lxfile_mkdir($name);
lxfile_generic_chown($name, "lxlabs");
}
}
开发者ID:digideskio,项目名称:hypervm,代码行数:7,代码来源:lxbackuplib.php
示例4: 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
示例5: lxfile_disk_free_space
function lxfile_disk_free_space($dir)
{
$dir = expand_real_root($dir);
lxfile_mkdir($dir);
$ret = disk_free_space($dir);
$ret = round($ret / (1024 * 1024), 1);
log_shell("Disk Space {$dir} {$ret}");
return $ret;
}
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:9,代码来源:commonfslib.php
示例6: updateUpdate
function updateUpdate($param)
{
lxfile_mkdir("img/custom");
if ($_FILES['upload']['tmp_name']) {
lxfile_rm("img/custom/{$this->nname}.gif");
lxfile_mv($_FILES['upload']['tmp_name'], "img/custom/{$this->nname}.gif");
lxfile_generic_chmod("img/custom/{$this->nname}.gif", "0755");
}
return $param;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:10,代码来源:custombuttonlib.php
示例7: __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
示例8: create_main
function create_main()
{
global $argc, $argv;
global $gbl, $sgbl, $login, $ghtml;
$opt = parse_opt($argv);
if (file_exists('/usr/local/lxlabs/.git')) {
$opt['development_found'] = '1';
}
lxfile_mkdir("{$sgbl->__path_program_etc}/conf");
lxfile_mkdir("{$sgbl->__path_program_root}/pid");
lxfile_mkdir("{$sgbl->__path_program_root}/log");
lxfile_mkdir("{$sgbl->__path_httpd_root}");
os_create_program_service();
if (isset($opt['admin-password'])) {
$admin_pass = $opt['admin-password'];
} else {
$admin_pass = 'admin';
}
if ($opt['install-type'] == 'master') {
if (!isset($opt['development_found'])) {
create_mysql_db('master', $opt, $admin_pass);
create_database();
create_general();
add_admin($admin_pass);
create_servername();
lxshell_return("__path_php_path", "../bin/collectquota.php");
} else {
print "Development GIT version found. Skipping creation from scratch of HyperVM-NG.\n";
}
print "Updating the system. Will take a while\n";
system("/usr/local/lxlabs/ext/php/php ../bin/common/updatecleanup-main.php --type=master");
} else {
if ($opt['install-type'] == 'slave') {
if (!isset($opt['development_found'])) {
init_slave($admin_pass);
} else {
print "Development GIT version found. Skipping creation from scratch of HyperVM-NG.\n";
}
print "Updating the system. Will take a while\n";
system("/usr/local/lxlabs/ext/php/php ../bin/common/updatecleanup-main.php --type=slave");
} else {
print "Unknown Install type\n";
flush();
}
}
system("rm -f /etc/sysconfig/network-scripts/ifcfg-*-range*");
//system("$sgbl->__path_php_path ../bin/misc/fixcentos5xen.php");
//os_fix_some_permissions();
system("cp ../sbin/lxxen ../sbin/lxopenvz /usr/bin");
system("chmod 4755 /usr/bin/lxxen /usr/bin/lxopenvz");
//os_set_iis_ftp_root_path();
}
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:52,代码来源:create.php
示例9: __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
示例10: createVirtualHost
function createVirtualHost()
{
$string = null;
foreach ($this->main->__var_domlist as $v) {
$string .= "\$HTTP[\"host\"] =~ \"^{$v}\" {\n";
$string .= "server.document-root = \"/usr/local/lxlabs/kloxo/httpdocs/webdisk/\"\n";
$string .= "cgi.assign = ( \".php\" => \"/home/httpd/{$v}/davsuexec.sh\" )\n";
$string .= $this->getDirprotectCore($v);
$string .= "}\n\n\n";
lxfile_mkdir("__path_httpd_root/{$v}/__davuser/");
lxfile_touch("__path_httpd_root/{$v}/__davuser/davuser");
}
return $string;
}
开发者ID:soar-team,项目名称:kloxo,代码行数:14,代码来源:davuser__lighttpdlib.php
示例11: 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
示例12: write
function write()
{
lxfile_mkdir("__path_program_root/session");
if ($this->isDeleted()) {
lunlink("__path_program_root/session/{$this->nname}");
} else {
foreach ($this as $k => $v) {
if (is_object($v)) {
continue;
}
$array[$k] = $v;
}
lfile_put_json_serialize("__path_program_root/session/{$this->nname}", $array);
}
}
开发者ID:soar-team,项目名称:kloxo,代码行数:15,代码来源:ssession.php
示例13: create_main
function create_main()
{
global $argc, $argv;
global $gbl, $sgbl, $login, $ghtml;
$opt = parse_opt($argv);
lxfile_mkdir("{$sgbl->__path_program_etc}/conf");
lxfile_mkdir("{$sgbl->__path_program_root}/pid");
lxfile_mkdir("{$sgbl->__path_program_root}/log");
lxfile_mkdir("{$sgbl->__path_httpd_root}");
os_fix_lxlabs_permission();
os_create_program_service();
os_create_kloxo_service_once();
if (isset($opt['admin-password'])) {
$admin_pass = $opt['admin-password'];
} else {
$admin_pass = 'admin';
}
if ($opt['install-type'] == 'master') {
create_mysql_db('master', $opt, $admin_pass);
create_database();
create_general();
init_main($admin_pass);
lxshell_return("__path_php_path", "../bin/collectquota.php");
print "This will take a long time... Please wait...\n";
system("/usr/local/lxlabs/ext/php/php ../bin/common/tmpupdatecleanup.php --type=master");
} else {
if ($opt['install-type'] == 'slave') {
init_slave($admin_pass);
print "This will take a long time... Please wait...\n";
system("/usr/local/lxlabs/ext/php/php ../bin/common/tmpupdatecleanup.php --type=slave");
} else {
if ($opt['install-type'] == 'supernode') {
$sgbl->__path_sql_file = $sgbl->__path_sql_file_supernode;
$sgbl->__var_dbf = $sgbl->__path_supernode_db;
$sgbl->__path_admin_pass = $sgbl->__path_super_pass;
$sgbl->__var_admin_user = $sgbl->__var_super_user;
create_mysql_db('super', $opt, $admin_pass);
init_supernode($admin_pass);
print "\n";
} else {
print "Unknown Install type\n";
flush();
}
}
}
os_create_default_slave_driver_db();
os_fix_some_permissions();
}
开发者ID:soar-team,项目名称:kloxo,代码行数:48,代码来源:create.php
示例14: 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
示例15: __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
示例16: 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
示例17: add_admin
function add_admin($pass)
{
global $gbl, $sgbl, $login, $ghtml;
$client = new Client(null, null, 'admin');
$login = $client;
$client->initThisDef();
$client->priv->pserver_num = 'Unlimited';
$client->priv->maindomain_num = 'Unlimited';
$client->priv->vps_num = 'Unlimited';
$client->priv->client_num = 'Unlimited';
$client->ddate = time();
$ddb = new Sqlite(null, "client");
if (!$ddb->existInTable("nname", 'admin')) {
if ($sgbl->dbg > 0) {
$pass = 'lxlabs';
$res['contacemail'] = '[email protected]';
}
$res['password'] = crypt($pass);
$res['cttype'] = 'admin';
$res['cpstatus'] = 'on';
if (if_demo()) {
$res['email'] = "[email protected]";
}
$client->create($res);
$client->driverApp = new client__sync(null, null, 'admin');
$client->was();
lxfile_mkdir("__path_client_root/{$client->nname}");
lxfile_generic_chown("__path_client_root/{$client->nname}", "lxlabs");
}
$notif = new Notification(null, null, $client->getClName());
$notif->initThisDef();
$notif->dbaction = 'add';
$notif->text_newaccountmessage = lfile_get_contents("__path_program_root/file/welcome.txt");
$notif->parent_clname = $client->getClName();
$notif->write();
$display = new sp_SpecialPlay(null, null, $client->getClName());
$display->initThisDef();
$display->parent_clname = $client->getClName();
$display->dbaction = 'add';
$display->write();
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:41,代码来源:initlib.php
示例18: 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
示例19: createUser
function createUser()
{
global $gbl, $sgbl, $login, $ghtml;
global $global_shell_out, $global_shell_error, $global_shell_ret;
return;
$mn = $this->main;
$passwd = $mn->password;
lxfile_mkdir("__path_httpd_root/" . $mn->getParentName());
$cmd = "useradd";
$shell = fix_disabled($this->main->shell, $sgbl->__var_noaccess_shell);
$ret = lxshell_return($cmd, "-m", '-c', uuser::getUserDescription($this->main->getParentName()), "-k", "__path_program_root/file/user-skel/", "-d", "{$mn->getParentName()}/", "-s", $shell, "-p", $passwd, $mn->nname);
if ($ret) {
// Error... Do a lot of stuff;
log_error($global_shell_out);
throw new lxexception('user_create', 'web_s_uuser_s_nname', $this->main->nname);
}
/*
if($mn->quota != "Unlimited"){
lxshell_return("setquota", "-ur", "-F", "vfsv0" , $mn->nname, "0", $mn->quota,"200", "0" ,"0", "-a" , "ext3");
}
*/
return 1;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:23,代码来源:uuser__linuxlib.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_mkdir函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论