本文整理汇总了PHP中cse函数的典型用法代码示例。如果您正苦于以下问题:PHP cse函数的具体用法?PHP cse怎么用?PHP cse使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cse函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createExtraVariables
function createExtraVariables()
{
if ($this->ttype === 'forward') {
return;
}
$this->__var_addonlist = $this->getParentO()->getList('addondomain');
$spam = $this->getObject('spam');
$this->__var_spam_status = $spam->status;
$master = null;
if ($this->dbaction === 'add' || $this->dbaction === 'syncadd') {
try {
$master = $this->getFromList('mailaccount', "postmaster@{$this->nname}");
} catch (exception $e) {
$this->__var_password = "hello";
}
if ($master) {
$this->__var_password = $master->realpass;
}
}
if (!$this->systemuser) {
$dom = $this->getParentO();
$web = $dom->getObject('web');
$this->systemuser = $web->username;
}
if (cse($this->subaction, 'backup')) {
$this->createMailaccountList();
}
}
示例2: printProperty
function printProperty($class, $type)
{
$r = new ReflectionClass($class);
foreach ($r->getProperties() as $s) {
$istr = getModeFromType($type);
if (!csb($s->name, $istr)) {
continue;
}
$descr = get_classvar_description($class, $s->name);
$name = strfrom($s->name, $istr);
if (csa($descr[0], "q")) {
continue;
}
if (cse($name, "_f")) {
continue;
}
if (cse($name, "_l")) {
continue;
}
if (cse($name, "_o")) {
continue;
}
printf("%35s %s\n", $name, $descr['help']);
}
}
示例3: find_cpuusage
function find_cpuusage()
{
$out = lxshell_output("xm", "list");
$list = explode("\n", $out);
foreach ($list as $l) {
$l = trimSpaces($l);
$val = explode(" ", $l);
if (!cse($val[0], ".vm")) {
continue;
}
execRrdCpuusage("{$val['0']}", $val[5]);
}
}
示例4: add
static function add($parent, $class, $param)
{
if (!cse($param['nname'], ".aux")) {
$param['nname'] .= ".aux";
}
if (!$parent->isAdmin()) {
$param['nname'] = "{$parent->nname}_{$param['nname']}";
}
$param['cpstatus'] = 'on';
$param['status'] = 'on';
$param['realpass'] = $param['password'];
$param['password'] = crypt($param['password']);
return $param;
}
示例5: __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;
}
示例6: readMailqueue
static function readMailqueue()
{
lxfile_unix_chmod("__path_program_root/bin/misc/qmHandle", "0755");
$res = lxshell_output("__path_program_root/bin/misc/qmHandle", "-l");
$list = array('subject', 'to', 'from', 'date', 'size');
//$res = lfile_get_contents("a.txt");
$res = explode("\n", $res);
//dprintr($res);
$i = 0;
foreach ($res as $r) {
$r = trim($r);
if (!$r) {
$i++;
continue;
}
if (is_numeric($r[0])) {
list($nname, $s, $ss) = explode(" ", $r);
$ret[$i]['nname'] = $nname;
if (cse($ss, 'R)')) {
$ret[$i]['type'] = 'remote';
} else {
$ret[$i]['type'] = 'local';
}
continue;
}
foreach ($list as $l) {
$ul = ucfirst($l);
if (csb($r, "{$ul}:")) {
$ret[$i][$l] = strfrom($r, "{$ul}:");
if ($l === 'size') {
$ret[$i][$l] = strtil($ret[$i][$l], " bytes");
$ret[$i][$l] = trim($ret[$i][$l]);
}
}
}
}
return $ret;
}
示例7: doReverseDns
function doReverseDns()
{
addLineIfNotExistInside("__path_named_chroot/etc/named.conf", "include \"/etc/lxreverse.conf\";", "//added by hypervm");
list($base, $end) = reversedns::getBaseEnd($this->main->nname, $this->main->__var_rdnsrange);
$ddate = date("Ymd");
$v = rand(0, 99);
if ($v < 10) {
$v = "0{$v}";
}
$ddate = "{$ddate}{$v}";
$string = null;
$string .= "\$TTL 86400\n";
$string .= "@ IN SOA {$this->main->__var_revdns1}. root.{$this->main->__var_revdns1}. (\n";
$string .= "{$ddate} ; serial\n";
$string .= "28800 ; refresh\n";
$string .= "14400 ; retry\n";
$string .= "1814400 ; expire\n";
$string .= "86400 ; default_tt\n";
$string .= ")\n";
$string .= " IN NS {$this->main->__var_revdns1}.\n";
if ($this->main->__var_revdns2) {
$string .= " IN NS {$this->main->__var_revdns2}.\n";
}
$result = $this->main->__var_reverse_list;
$result = $result[$base];
$this->main->end = $end;
$result = merge_array_object_not_deleted($result, $this->main);
foreach ($result as $k => $v) {
$v['reversename'] = trim($v['reversename']);
if (!cse($v['reversename'], ".")) {
$v['reversename'] .= ".";
}
$string .= "{$v['end']}\tIN PTR {$v['reversename']}\n";
}
lfile_put_contents("__path_named_realpath/{$base}.in-addr.arpa", $string);
$this->createMainFile();
}
示例8: getGreeter
function getGreeter($nicklist, $nick)
{
foreach ($nicklist as $n) {
$n = trim($n);
if (!$n) {
continue;
}
if ($n === $nick) {
continue;
}
if ($n === 'Myself') {
continue;
}
if (cse($n, "|aw")) {
continue;
}
return "Connected...<br><br> <> Type your message to start the conference. <br>";
}
return "Connected...<br><br> <Leave Message> I am not available now. Please leave a message. <br>";
}
示例9: updateform
function updateform($subaction, $param)
{
global $gbl, $sgbl, $login, $ghtml;
$gen = $login->getObject('general')->generalmisc_b;
switch ($subaction) {
case "dialogsize":
$vlist['dialogsize'] = null;
return $vlist;
case "boxposopen":
$vlist['title_class'] = null;
$vlist['title_open'] = null;
$vlist['title_name'] = null;
return $vlist;
case "boxpos":
$vlist['title_class'] = null;
$vlist['title_open'] = null;
$vlist['title_name'] = null;
$vlist['page'] = null;
return $vlist;
case "addshortcut":
$vlist['shortcut'] = null;
return $vlist;
case "resendwelcome":
$vlist['extra_email_f'] = null;
$vlist['password'] = null;
$vlist['__v_updateall_button'] = array();
return $vlist;
case "disable_per":
if ($this->islogin()) {
throw new lxException('you_cannot_set_your_own_limit', '');
}
$vlist['disable_per'] = array('s', array('off', '95', '100', '110', '120', '130'));
return $vlist;
case "miscinfo":
$vlist['nname'] = array('M', $this->nname);
$vlist['realname'] = "";
$vlist['add_address'] = "";
$vlist['add_city'] = "";
$vlist['add_country'] = "";
$vlist['add_telephone'] = "";
$vlist['add_fax'] = "";
return $vlist;
case "limit_s":
case "limit":
if ($this->islogin()) {
throw new lxException('you_cannot_set_your_own_limit', '');
}
if (cse($this->get__table(), "template")) {
$class = strtil($this->get__table(), "template");
$vlist = getQuotaListForClass($class);
} else {
$vlist = $this->getQuotaVariableList();
}
// This is patently wrong. In update, the object is inititialized properly and we are suppsed to get the quota for the specific type of object and not for the class.... Changing it to $this.
$sgbl->method = 'post';
//$vlist['__v_updateall_button'] = array();
return $vlist;
case "change_plan":
$parent = $this->getParentO();
$ttlist = $parent->getTemplateList("resourceplan", false);
$this->newresourceplan = $this->resourceplan_used;
if (!$ttlist) {
$vlist['newresourceplan'] = array("M", "No Plan in Parent");
} else {
$vlist['newresourceplan'] = array("A", $ttlist);
}
//$vlist['__v_updateall_button'] = array();
return $vlist;
case "password":
if ($this->isLogin() || $this->is__table('auxiliary') && $this->getParentO()->isAuxiliary()) {
$vlist['old_password_f'] = "";
}
$vlist['password'] = "";
$vlist['__v_updateall_button'] = array();
return $vlist;
}
return parent::updateform($subaction, $param);
}
示例10: print_resource
//.........这里部分代码省略.........
}
$imgstr = "{$inputstr} <img src={$img} width=14 height=14> {$imgstr} {$name}";
if (isset($object->__v_message)) {
$imgstr .= " " . $object->__v_message;
}
$pttr = createTreeObject($name, $img, $imgstr, $url, $open, $help, $alt);
$tree->addToList('tree', $pttr);
$childdepth = 1;
$ppp = $object;
//dprintr($depth);
if ($object !== $toplevelobject) {
while ($ppp = $ppp->getParentO()) {
if ($ppp === $toplevelobject) {
break;
}
$childdepth++;
}
if ($depth && $childdepth >= $depth) {
return;
}
}
//print("$treename.add($total, $level, '<img src=$img width=14 height=14> $imgstr $name', '$url', '', 'mainframe', '', '', $open, '$help', '$alt');\n");
if ($alist && $alistflag) {
$open = 'false';
$imgstr = "<img src={$homeimg} width=14 height=14> <font color=#5958aa> <b> Functions </b></font> ";
$ttr = createTreeObject($name, '', $imgstr, $url, $open, $help, $alt);
$pttr->addToList('tree', $ttr);
//print("$treename.add($total, $level + 1, '<img src=$homeimg width=14 height=14> <font color=#5958aa> <b> Functions </b></font> ', '', '', 'mainframe', '$homeimg', '$homeimg', $open, '$help', '$alt');\n");
$this->print_resourcelist($ttr, $alist, null);
$open = 'true';
}
foreach ((array) $cnl as $v) {
$name = $object->getChildNameFromDes($v);
if (cse($v, "_o")) {
$c = null;
if ($object->isRealChild($name)) {
$c = $object->getObject($name);
}
if ($c) {
$this->print_resource($pttr, $c, $cgi_o_o, $toplevelobject, $depth, $alistflag, $func, true, $showurlflag);
}
continue;
}
$img = $this->get_image($path, $name, "list", ".gif");
$url = $this->getFullUrl("a=list&c={$name}");
$desc = $this->get_class_description($name);
$printname = get_plural($desc[2]);
$help = "Click to Show {$printname}";
$alt = $help;
$npttr = $pttr;
if ($object === $toplevelobject) {
$open = 'true';
$gbl->__navigmenu[$level + 2] = array('show', $object);
$gbl->__navig[$level + 2] = $this->get_post_from_get($url, $__tpath, $__tpost);
$imgstr = "<img src={$img} width=20 height=20>{$printname}";
if (!$showurlflag) {
$url = null;
}
$npttr = createTreeObject($name, $homeimg, $imgstr, $url, $open, $help, $alt);
$pttr->addToList('tree', $npttr);
//print("$treename.add($total, 0, '<img src=$img width=20 height=20>$printname ', '$url', '', 'mainframe', '$img', '$img', $open, '$help', '$alt');\n");
if ($alistflag) {
$open = 'false';
$imgstr = 'Functions';
$nttr = createTreeObject($name, $homeimg, $imgstr, $url, $open, $help, $alt);
$npttr->addToList('tree', $nttr);
示例11: createNewcertificate
function createNewcertificate()
{
global $gbl, $sgbl, $login, $ghtml;
foreach ($this->ssl_data_b as $key => $value) {
if (!cse($key, "_r")) {
continue;
}
$nk = strtil($key, "_r");
$temp[$nk] = $value;
}
foreach ($temp as $key => $t) {
if ($key === "countryName") {
$l = explode(":", $t);
$name = $l[0];
} else {
$name = $t;
}
$ltemp[$key] = $name;
}
$config['private_key_bits'] = 1024;
$privkey = openssl_pkey_new($config);
openssl_pkey_export($privkey, $text_key_content);
$csr = openssl_csr_new($ltemp, $privkey);
openssl_csr_export($csr, $text_csr_content);
$sscert = openssl_csr_sign($csr, null, $privkey, 3650);
openssl_x509_export($sscert, $text_crt_content);
$this->text_key_content = $text_key_content;
$this->text_csr_content = $text_csr_content;
$this->text_crt_content = $text_crt_content;
}
示例12: get_classvar_description
function get_classvar_description($class, $var = null)
{
global $gbl, $sgbl, $login, $ghtml;
global $g_language_desc;
global $g_language_mes;
//$var = fix_nname_to_be_variable($var);
if (csb($var, "__")) {
$dvar = $var;
} else {
if ($var) {
$dvar = "__desc_{$var}";
} else {
$dvar = "__desc";
}
}
$rvar = strfrom($dvar, "__desc_");
$rvar = strfrom($rvar, "__acdesc_");
$class = strtolower($class);
$ret = get_real_class_variable($class, $dvar);
if (!$ret) {
return null;
}
$ret['help'] = $ret[2];
if (cse($dvar, "_o") || cse($dvar, "_l")) {
return $ret;
}
if (!$g_language_desc) {
return $ret;
}
/*
if ($login->getSpecialObject('sp_specialplay')->isCoreLanguage()) {
return $ret;
}
*/
$k = trim($ret[2], "_\n ");
if (isset($g_language_desc->__description[$k])) {
$ret[2] = $g_language_desc->__description[$k][0];
if (isset($g_language_mes->__helpvar[$rvar])) {
$ret['help'] = $g_language_mes->__helpvar[$rvar];
} else {
if (isset($g_language_mes->__help[$dvar])) {
$ret['help'] = $g_language_desc->__help[$k];
} else {
$ret['help'] = $ret[2];
}
}
}
return $ret;
}
示例13: __ac_desc_graph
function __ac_desc_graph($object)
{
global $gbl, $sgbl, $login, $ghtml;
$subaction = $ghtml->frm_subaction;
$selflist = $object->getSelfList();
if (!$ghtml->frm_c_graph_time) {
$ghtml->frm_c_graph_time = '1d';
}
$object->createShowPropertyList($alist);
$object->createShowAlist($alist, $subaction);
$nalist = null;
if (!isset($alist['property'])) {
$alist['property'] = array();
}
$nalist = lx_merge_good($nalist, $alist['property']);
remove_if_older_than_a_minute_dir("__path_program_htmlbase/tmp/");
$ghtml->print_tab_block($nalist);
if ($selflist) {
$ghtml->printShowSelectBox($selflist);
}
if (cse($ghtml->frm_subaction, 'base')) {
$core = strtil($ghtml->frm_subaction, "base");
$ghtml->__http_vars['frm_subaction'] = "{$core}traffic";
$subaction = "{$core}traffic";
}
$galist = $object->createGraphList();
$ghtml->print_tab_block($galist);
$graphtlist = array('1h' => '1h', '12h' => '12h', '1d' => '1d', '2d' => '2d', '1week' => '1week', '1month' => '1month');
$gtlistsec = array('1h' => 3600, '12h' => 12 * 3600, '1d' => 24 * 3600, '2d' => 2 * 24 * 3600, '1week' => 7 * 24 * 3600, '1month' => 30 * 24 * 3600, '1year' => 365 * 24 * 3600);
$ghtml->printGraphSelect($graphtlist);
lxfile_mkdir("__path_program_htmlbase/tmp");
$tmpgraph = ltempnam("__path_program_htmlbase/tmp/", "graph");
$object->setUpdateSubaction("graph_{$subaction}");
$time = $ghtml->frm_c_graph_time;
$object->rrdtime = $gtlistsec[$time];
try {
$object->createExtraVariables();
$file = rl_exec_set(null, $object->syncserver, $object);
} catch (lxException $e) {
$ghtml->print_curvy_table_start();
print "Graph Failed due to {$e->getMessage()} {$e->value}";
$ghtml->print_curvy_table_end();
$object->dbaction = 'clean';
return;
}
$object->dbaction = 'clean';
lfile_put_contents($tmpgraph, $file);
$tmpgraph = basename($tmpgraph);
print "<img src=/tmp/{$tmpgraph}>";
}
示例14: baseinitThisList
static function baseinitThisList($parent, $class, $type)
{
global $gbl, $sgbl, $login, $ghtml;
$rlist = $parent->createShowRlist("");
$class = $parent->get__table();
$resourceout = null;
if ($rlist) {
$j = 0;
foreach ($rlist as $k => $v) {
if ($k === 'priv') {
$vlist = $parent->getQuotaVariableList();
$vlist = lx_array_merge(array($vlist, $parent->getDeadQuotaVariableList()));
foreach ($vlist as $nk => $nv) {
// Why am I skipping hardquota?. OK it screws up vps graph
if ($parent->isHardQuota($nk)) {
continue;
}
if ($type === 'permission') {
if (!cse($nk, "_flag")) {
continue;
}
if ($login->getSpecialObject('sp_specialplay')->isOn('dont_show_disabled_permission')) {
if (!$parent->priv->isOn($nk)) {
continue;
}
}
} else {
if (cse($nk, "_flag")) {
continue;
}
}
$desc = get_classvar_description($class, $nk);
if (is_array($parent->priv->{$nk})) {
foreach ($parent->priv->{$nk} as $nnk => $nnv) {
$resourceout[$j]['vv'] = $nk;
$resourceout[$j]['nname'] = $j;
$resourceout[$j]['shortdescr'] = getNthToken($desc[2], 0);
$sh = getNthToken($desc[2], 0);
$ln = getNthToken($desc[2], 1);
$resourceout[$j]['descr'] = "_lxspan:{$sh}:{$ln}:";
$resourceout[$j]['resourceused'] = $parent->used->{$nk}[$nnk];
$resourceout[$j]['resourcepriv'] = $parent->priv->{$nk}[$nnk];
$j++;
}
continue;
}
if (isset($parent->used)) {
$vresourceused = $parent->used->{$nk};
} else {
$vresourceused = '-';
}
if (cse($nk, "_flag")) {
$vresourcepriv = $parent->priv->{$nk};
} else {
if ($parent->priv->{$nk} === "0") {
continue;
}
if ($parent->showPrivInResource()) {
$vresourcepriv = $parent->priv->{$nk};
} else {
$vresourcepriv = '-';
}
}
if (cse($nk, 'last_usage')) {
$vresourcepriv = '-';
}
if ($parent->isDeadQuotaVariable($nk)) {
$vresourcepriv = "-";
}
$resourceout[$j]['vv'] = $nk;
$resourceout[$j]['nname'] = $j;
$resourceout[$j]['shortdescr'] = getNthToken($desc[2], 0);
$sh = getNthToken($desc[2], 0);
$ln = getNthToken($desc[2], 1);
$resourceout[$j]['descr'] = "_lxspan:{$sh}:{$ln}:";
$resourceout[$j]['resourceused'] = $vresourceused;
$resourceout[$j]['resourcepriv'] = $vresourcepriv;
$j++;
}
} else {
$resourceout[$j]['vv'] = $v[0];
$resourceout[$j]['nname'] = $j;
$resourceout[$j]['shortdescr'] = getNthToken($v[1], 0);
$sh = getNthToken($v[1], 0);
$ln = getNthToken($v[1], 1);
$resourceout[$j]['descr'] = "_lxspan:{$sh}:{$ln}:";
$resourceout[$j]['resourceused'] = $v[2];
$resourceout[$j]['resourcepriv'] = $v[3];
$j++;
}
}
}
return $resourceout;
}
示例15: lscandir_without_dot_or_underscore
<?php
include_once "htmllib/lib/include.php";
$list = lscandir_without_dot_or_underscore("/home/kloxo/httpd/ssl/");
foreach ($list as $l) {
if (cse($l, ".crt")) {
$newlist[] = basename($l, ".crt");
} else {
continue;
}
}
foreach ($newlist as $n) {
lxfile_cp("/usr/local/lxlabs/kloxo/file/program.crt", "/home/kloxo/httpd/ssl/{$n}.crt");
lxfile_cp("/usr/local/lxlabs/kloxo/file/program.key", "/home/kloxo/httpd/ssl/{$n}.key");
// lxfile_cp("/usr/local/lxlabs/lxadmin/httpdocs/htmllib/filecore/program.ca", "/home/kloxo/httpd/ssl/$n.ca");
lxfile_cp("/usr/local/lxlabs/kloxo/httpdocs/htmllib/filecore/program.ca", "/home/kloxo/httpd/ssl/{$n}.ca");
}