本文整理汇总了PHP中lxshell_return函数的典型用法代码示例。如果您正苦于以下问题:PHP lxshell_return函数的具体用法?PHP lxshell_return怎么用?PHP lxshell_return使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lxshell_return函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: setMysqlOptimize
function setMysqlOptimize($select, $database = null)
{
global $gbl, $sgbl, $login, $ghtml;
log_cleanup("Mysql Optimization");
$database = $database ? $database : "_all_";
$pass = slave_get_db_pass();
if ($select === 'repair') {
log_cleanup("- Repairing database");
if ($database === '_all_') {
system("mysqlcheck --user=root --password=\"{$pass}\" --repair --all-databases");
} else {
system("mysqlcheck --user=root --password=\"{$pass}\" --repair --databases {$dbname}");
}
} else {
if ($select === 'optimize') {
log_cleanup("- Compacting database");
if ($database === '_all_') {
system("mysqlcheck --user=root --password=\"{$pass}\" --optimize --all-databases");
} else {
system("mysqlcheck --user=root --password=\"{$pass}\" --optimize --databases {$dbname}");
}
}
}
log_cleanup("- MySQL Service restart");
$ret = lxshell_return("service", "mysqld", "restart");
if ($ret) {
throw new lxexception('mysqld_restart_failed', 'parent');
}
}
开发者ID:soar-team,项目名称:kloxo,代码行数:29,代码来源:mysql-optimize.php
示例2: updateSwitchProgram
function updateSwitchProgram($param)
{
global $gbl, $sgbl, $login, $ghtml;
if_demo_throw_exception('switchprog');
$this->web_driver = $gbl->getSyncClass($this->__masterserver, $this->nname, 'web');
$this->dns_driver = $gbl->getSyncClass($this->__masterserver, $this->nname, 'dns');
$this->spam_driver = $gbl->getSyncClass($this->__masterserver, $this->nname, 'spam');
$a['web'] = $this->web_driver;
$a['dns'] = $this->dns_driver;
$a['spam'] = $this->spam_driver;
foreach ($param as $k => $v) {
if ($this->{$k} === $v) {
dprint("No change for {$k}: {$v}\n");
} else {
$class = strtilfirst($k, "_");
$drstring = "{$class}_driver";
rl_exec_get(null, $this->nname, array($class, 'switchDriver'), array($class, $this->{$drstring}, $v));
changeDriver($this->nname, $class, $v);
$fixc = $class;
if ($class === 'spam') {
$fixc = "mmail";
}
lxshell_return("__path_php_path", "../bin/fix/fix{$fixc}.php", "--server={$this->nname}");
$a[$class] = $v;
rl_exec_get(null, $this->nname, 'slave_save_db', array('driver', $a));
}
}
}
开发者ID:soar-team,项目名称:kloxo,代码行数:28,代码来源:pserverlib.php
示例3: installMe
static function installMe()
{
global $gbl, $sgbl, $login, $ghtml;
$ret = lxshell_return("yum", "-y", "install", "lighttpd", "lighttpd-fastcgi");
if ($ret) {
throw new lxexception('install_lighttpd_failed', 'parent');
}
lxshell_return("chkconfig", "lighttpd", "on");
lxfile_mkdir("/etc/lighttpd/");
//-- old structure
lxfile_rm("/etc/lighttpd/conf/kloxo");
//-- new structure
$path = "/home/lighttpd/conf";
$list = array("defaults", "domains", "redirects", "webmails", "wildcards", "exclusive");
foreach ($list as $k => $l) {
if (!lxfile_exists("{$path}/{$l}")) {
lxfile_mkdir("{$path}/{$l}");
}
}
lxfile_cp("/usr/local/lxlabs/kloxo/file/lighttpd/lighttpd.conf", "/etc/lighttpd/lighttpd.conf");
$cver = "###version0-7###";
$fver = file_get_contents("/etc/lighttpd/conf.d/~lxcenter.conf");
if (stristr($fver, $cver) === FALSE) {
lxfile_cp("/usr/local/lxlabs/kloxo/file/lighttpd/~lxcenter.conf", "/etc/lighttpd/conf.d/~lxcenter.conf");
}
lxfile_cp("../file/lighttpd/etc_init.d", "/etc/init.d/lighttpd");
lxfile_unix_chmod("/etc/init.d/lighttpd", "0755");
lxfile_unix_chmod("/etc/init.d/lighttpd", "0755");
lxfile_mkdir("/home/kloxo/httpd/lighttpd");
lxfile_unix_chown("/home/kloxo/httpd/lighttpd", "apache");
createRestartFile("lighttpd");
}
开发者ID:soar-team,项目名称:kloxo,代码行数:32,代码来源:web__lighttpdlib.php
示例4: dbactionUpdate
function dbactionUpdate($subaction)
{
global $gbl, $sgbl, $login, $ghtml;
$dir = $this->main->__var_full_directory;
$dir = expand_real_root($dir);
switch ($subaction) {
case "full_update":
$pass = $this->main->realpass;
lxshell_input("{$pass}\n{$pass}\n", "pure-pw", "passwd", $this->main->nname, "-m");
lxshell_return("pure-pw", "usermod", $this->main->nname, "-d", $dir, "-m");
$this->toggleStatus();
$this->setQuota();
break;
case "password":
$pass = $this->main->realpass;
lxshell_input("{$pass}\n{$pass}\n", "pure-pw", "passwd", $this->main->nname, "-m");
break;
case "toggle_status":
$this->toggleStatus();
break;
case "edit":
lxshell_return("pure-pw", "usermod", $this->main->nname, "-d", $dir, "-m");
$this->setQuota();
break;
case "changeowner":
lxshell_return("pure-pw", "usermod", $this->main->nname, "-u", $this->main->__var_username, "-d", $dir, "-m");
break;
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:29,代码来源:ftpuser__pureftplib.php
示例5: installMe
static function installMe()
{
global $gbl, $sgbl, $login, $ghtml;
$ret = lxshell_return("yum", "-y", "install", "httpd", "mod_ssl");
if ($ret) {
throw new lxexception('install_httpd_failed', 'parent');
}
lxshell_return("chkconfig", "httpd", "on");
$cver = "###version0-6###";
$fver = file_get_contents("/etc/httpd/conf.d/~lxcenter.conf");
if (stristr($fver, $cver) === FALSE) {
lxfile_cp("/usr/local/lxlabs/kloxo/file/apache/~lxcenter.conf", "/etc/httpd/conf.d/~lxcenter.conf");
}
lxfile_cp("/usr/local/lxlabs/kloxo/file/centos-5/httpd.conf", "/etc/httpd/conf/httpd.conf");
// MR -- old structure
lxfile_rm("/etc/httpd/conf/kloxo");
lxfile_rm("/home/httpd/conf");
// MR -- new structure
$path = "/home/apache/conf";
$list = array("defaults", "domains", "redirects", "webmails", "wildcards", "exclusive");
foreach ($list as $k => $l) {
if (!lxfile_exists("{$path}/{$l}")) {
lxfile_mkdir("{$path}/{$l}");
}
}
// MR -- some vps include /etc/httpd/conf.d/swtune.conf
lxfile_rm("/etc/httpd/conf.d/swtune.conf");
// issue #527
lxfile_cp("../file/apache/etc_init.d", "/etc/init.d/httpd");
lxshell_return("{$sgbl->__path_php_path}", "../bin/misc/installsuphp.php");
createRestartFile("apache");
}
开发者ID:soar-team,项目名称:kloxo,代码行数:32,代码来源:web__apachelib.php
示例6: checkService
static function checkService($name)
{
$servicepath = "__path_real_etc_root/init.d";
$ret = lxshell_return("{$servicepath}/{$name}", "status");
$state = $ret ? "off" : "on";
return $state;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:7,代码来源:service__linuxlib.php
示例7: 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
示例8: dbactionUpdate
function dbactionUpdate($subaction)
{
if_demo_throw_exception('lxguard');
$rmt = new Remote();
$rmt->data['disablehit'] = $this->main->disablehit;
lfile_put_serialize("__path_home_root/lxguard/config.info", $rmt);
lxshell_return("__path_php_path", "../bin/common/lxguard.php");
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:8,代码来源:lxguard__synclib.php
示例9: dosyncToSystemPost
function dosyncToSystemPost()
{
global $sgbl;
$ret = lxshell_return("rndc", "reload");
if ($ret) {
createRestartFile("bind");
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:8,代码来源:reversedns__bindlib.php
示例10: 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
示例11: 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
示例12: updateWht
function updateWht()
{
$res = $this->main->__var_whitelist;
$res = merge_array_object_not_deleted($res, $this->main);
$list = get_namelist_from_arraylist($res, 'ipaddress');
$rmt = new Remote();
$rmt->data = $list;
lfile_put_serialize("__path_home_root/lxguard/whitelist.info", $rmt);
lxshell_return("__path_php_path", "../bin/common/lxguard.php");
}
开发者ID:digideskio,项目名称:hypervm,代码行数:10,代码来源:lxguardwhitelist__synclib.php
示例13: create_dev
function create_dev()
{
if (lxfile_exists("/sbin/udevd")) {
lxfile_mv("/sbin/udevd", "/sbin/udevd.back");
}
lxshell_return('tar', '-C', '/dev', '-xzf', '../file/centos-5/vps-dev.tgz');
lxshell_return('/sbin/MAKEDEV', 'pty');
lxshell_return('/sbin/MAKEDEV', 'tty');
lxshell_return('/sbin/MAKEDEV', 'loop');
lxshell_return('/sbin/MAKEDEV', 'random');
lxshell_return('/sbin/MAKEDEV', 'urandom');
}
开发者ID:zseand,项目名称:kloxo,代码行数:12,代码来源:linuxproglib.php
示例14: shellModify
function shellModify()
{
global $gbl, $sgbl, $login, $ghtml;
if_demo_throw_exception();
$shell = fix_disabled($this->main->shell, $sgbl->__var_noaccess_shell);
lxshell_return("usermod", "-s", $shell, $this->main->nname);
if ($this->main->isOn('disable_system_flag')) {
lxshell_return("usermod", "-L", $this->main->nname);
} else {
lxshell_return("usermod", "-U", $this->main->nname);
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:12,代码来源:client__synclib.php
示例15: 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
示例16: schedulebackup_main
function schedulebackup_main()
{
global $gbl, $sgbl, $login, $ghtml;
$progname = $sgbl->__var_program_name;
initProgram('admin');
$login->loadAllBackups();
$list = $login->lxbackup_l;
foreach ($list as $l) {
$l->backupstage = 'done';
$l->setUpdateSubaction();
$l->write();
if ($l->parent_clname !== $login->getClName() && !$l->priv->isOn('backupschedule_flag')) {
continue;
}
if ($l->getParentClass() === 'domain') {
continue;
}
if (!$l->backupschedule_type) {
continue;
}
if ($l->backupschedule_type === 'disabled') {
continue;
}
if ($l->backupschedule_type === 'weekly' && date('D') !== 'Sun') {
continue;
}
if ($l->backupschedule_type === 'monthly' && date('d') !== '01') {
continue;
}
/*
try {
$param['backup_to_file_f'] = "$progname-scheduled";
$param['upload_to_ftp'] = $l->upload_to_ftp;
$backup = $l;
$object = $l->getParentO();
$backup->doupdateBackup($param);
$backup->backupstage = 'done';
} catch (exception $e) {
$mess = "{$e->__full_message}\n";
$backup->backupstage = "Failed due to: $mess";
lx_mail($progname, $object->contactemail, "Backup Failed..", "Backup Failed for $object->nname with the Message $mess");
}
*/
$class = $l->getParentClass();
$name = $l->getParentName();
$fname = "{$progname}-scheduled";
print "Scheduling for {$class} {$name}\n";
lxshell_return("__path_php_path", "../bin/common/backup.php", "--class={$class}", "--name={$name}", "--v-backup_file_name={$fname}");
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:50,代码来源:schedulebackup.php
示例17: dbactionAdd
function dbactionAdd()
{
global $gbl, $sgbl, $login;
if (if_demo()) {
return;
}
$_filepath = "__path_home_root/lxguard/hostdeny.info";
$result = $this->main->__var_hostlist;
$result = merge_array_object_not_deleted($result, $this->main);
$list = get_namelist_from_arraylist($result, 'hostname', 'hostname');
dprintr($list);
lfile_put_serialize($_filepath, $list);
lxshell_return("__path_php_path", "../bin/common/lxguard.php");
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:14,代码来源:hostdeny__linuxlib.php
示例18: 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
示例19: getAspnetVersion
static function getAspnetVersion()
{
//print("\nI am here\n");
//$r=exec("c:\regASPVer.vbs");
$cm = "cmd /K CD C:\\Dir";
lxshell_return("cmd", "/K", "cd", "c:\\dir");
//print($r."\n");
//$r = system('cscript.exe c:\regASPVer.vbs.vbs', $a);
//cscript.exe regASPVer.vbs
//regASPVer.vbs
foreach ($a as $b) {
$res['version'] = "aab";
$res['sss'] = 'ab';
$ret[] = $res;
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:16,代码来源:aspnet__windowslib.php
示例20: dbactionUpdate
function dbactionUpdate($subaction)
{
switch ($subaction) {
case "toggle_status":
if ($this->main->isOn('status')) {
lxshell_return("update-rc.d", $this->main->servicename, 'defaults');
} else {
lxshell_return("update-rc.d", "-f", $this->main->servicename, 'remove');
}
break;
case "toggle_state":
if ($this->main->isOn('state')) {
lxshell_return("__path_real_etc_root/init.d/{$this->main->servicename}", "start");
} else {
lxshell_return("__path_real_etc_root/init.d/{$this->main->servicename}", "stop");
}
break;
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:19,代码来源:service__debianlib.php
注:本文中的lxshell_return函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论