本文整理汇总了PHP中csb函数的典型用法代码示例。如果您正苦于以下问题:PHP csb函数的具体用法?PHP csb怎么用?PHP csb使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了csb函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printProperty
function printProperty($class, $type)
{
$r = new ReflectionClass($class);
foreach ($r->getProperties() as $s) {
if ($type === 'action') {
$istr = "__acdesc_";
if (!csb($s->name, "__acdesc_")) {
continue;
}
}
if ($type === 'property') {
$istr = "__desc_";
if (!csb($s->name, "__desc_")) {
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("%30s %s\n", $name, $descr['help']);
}
}
示例2: add
static function add($parent, $class, $param)
{
if (!csb($param['nname'], "lvm:") && !csb($param['nname'], "/")) {
throw new lxexception('location_is_either_full_path_or_lvm', 'nname', '');
}
return $param;
}
示例3: process_main
function process_main()
{
global $gbl, $sgbl, $login, $ghtml;
global $argv;
$list = parse_opt($argv);
$exitchar = $sgbl->__var_exit_char;
$res = new Remote();
$res->exception = null;
$res->ddata = "hello";
$res->message = "hello";
$total = file_get_contents($list['temp-input-file']);
@lunlink($list['temp-input-file']);
$string = explode("\n", $total);
if (csb($total, "__file::")) {
ob_end_clean();
file_server(null, $total);
} else {
$reply = process_server_input($total);
//fprint(unserialize(base64_decode($reply)));
ob_end_clean();
print "{$reply}\n{$exitchar}\n";
flush();
}
exit;
}
示例4: checkIfUserExists
static function checkIfUserExists($name, $id)
{
if (posix_getpwnam($name)) {
$username = $name;
$list = lfile("/etc/passwd");
$comment = null;
foreach ($list as $l) {
$l = trim($l);
if (csb($l, "{$username}:")) {
$useri = explode(":", $l);
$comment = $useri[4];
break;
}
}
//dprint($comment . "Hello\n");
if ($comment === uuser::getUserDescription($id)) {
log_error("User {$name} Already Exists. But is of the same domain");
return true;
} else {
log_error("User {$name} Already Exists. But is of NOT of the same domain");
throw new lxexception("User_Exist", 'web_s_uuser_nname', $name);
}
}
return false;
}
示例5: mail_parse
static function mail_parse($file)
{
$fp = fopen($file, "r");
$ret['header'] = null;
$name = str_replace(",", "_s_coma_s_", $file);
$name = str_replace(":", "_s_colon_s_", $name);
$ret['nname'] = $name;
while (!feof($fp)) {
$l = fgets($fp);
if ($l === "\n") {
fclose($fp);
break;
}
if (csb($l, "From:")) {
$ret['from'] = strfrom($l, "From:");
}
if (csb($l, "Subject:")) {
$ret['subject'] = strfrom($l, "Subject:");
}
if (csb($l, "Date:")) {
$ret['date'] = strfrom($l, "Date:");
}
$ret['location'] = basename(dirname(dirname($file)));
$ret['header'] .= $l;
}
if (!isset($ret['subject'])) {
$ret['subject'] = '[no subject]';
}
return $ret;
}
示例6: moveToClient
function moveToClient()
{
global $gbl, $sgbl, $login, $ghtml;
$login->loadAllObjects('ftpuser');
$l = $login->getList('ftpuser');
foreach ($l as $b) {
if (csb($b->parent_clname, 'web-')) {
list($parentclass, $parentname) = getParentNameAndClass($b->parent_clname);
$d = new Domain(null, null, $parentname);
$d->get();
$b->parent_clname = $d->parent_clname;
$w = $d->getObject('web');
$b->directory = "{$w->docroot}/{$b->directory}";
$b->directory = remove_extra_slash($b->directory);
$b->setUpdateSubaction();
$b->write();
}
}
$login->loadAllObjects('mysqldb');
$l = $login->getList('mysqldb');
foreach ($l as $b) {
if (csb($b->parent_clname, 'domain-')) {
list($parentclass, $parentname) = getParentNameAndClass($b->parent_clname);
$d = new Domain(null, null, $parentname);
$d->get();
$b->parent_clname = $d->parent_clname;
$b->setUpdateSubaction();
$b->write();
}
}
}
示例7: ConvertToMESMTPAddress
static function ConvertToMESMTPAddress($MEAddress)
{
if (!csb($MEAddress, "[SMTP:")) {
return "[SMTP:" . $MEAddress . "]";
} else {
return $MEAddress;
}
}
示例8: getVersion
static function getVersion($list, $name)
{
foreach ($list as $v) {
if (csb($v, $name) || csa($v, " {$name} ")) {
$ret[] = $v;
}
}
return implode(", ", $ret);
}
示例9: check_if_skip
function check_if_skip($l)
{
$vlist = array("server-id", "master-host", "master-user", "master-password");
foreach ($vlist as $v) {
if (csb($l, $v)) {
return true;
}
}
return false;
}
示例10: add
static function add($parent, $class, $param)
{
$ttype = $param['ttype'];
$redirect = $param['redirect'];
if ($ttype == 'remote') {
if (!csb($redirect, "http")) {
$redirect = "http://" . $redirect;
}
}
$param['redirect'] = $redirect;
return $param;
}
示例11: check_for_break
static function check_for_break($root, $path)
{
if (lis_link($path)) {
$rpath = lreadlink($path);
} else {
$rpath = $path;
}
dprint("{$rpath} {$root}\n");
if (!csb($rpath, $root)) {
throw new lxException("you_are_trying_to_go_outside_your_root", '', '');
}
}
示例12: check_xen_dirlocation
function check_xen_dirlocation()
{
$diro = getFirstFromList($this->main->__t_new_xen_location_a_list);
$dirlocation = $diro->nname;
if (!csb($dirlocation, "lvm:")) {
return;
}
$dirlocation = fix_vgname($dirlocation);
$ret = exec_with_all_closed_output("vgdisplay -c {$dirlocation}");
if (!csa($ret, ":")) {
throw new lxException("the_lvm_doesnt_exist", 'nname', $dirlocation);
}
}
示例13: get_local_application_version_list
function get_local_application_version_list()
{
$list = allinstallapp__linux::getListofApps();
$list = get_namelist_from_arraylist($list);
foreach ($list as $k => $v) {
if (csb($v, "__title")) {
continue;
}
$info = allinstallapp::getAllInformation($v);
$ret[$v] = $info['pversion'];
}
$loc = new Remote();
$loc->applist = $ret;
return $loc;
}
示例14: readProcessList
static function readProcessList()
{
$list = lscandir("/proc");
foreach ($list as $pid) {
if (is_numeric($pid) && $pid[0] != ".") {
$cmdlinearr = lfile("/proc/" . $pid . "/cmdline");
$return[$pid]['nname'] = $pid;
if (!$cmdlinearr) {
unset($return[$pid]);
continue;
}
$cmdline = $cmdlinearr[0];
$cmdline = preg_replace('+\\0+i', " ", $cmdline);
$return[$pid]["command"] = substr($cmdline, 0, 100);
if (csa($cmdline, "display.php") && csa($cmdline, "kloxo")) {
unset($return[$pid]);
continue;
}
$arr = lfile("/proc/" . $return[$pid]["nname"] . "/status");
foreach ($arr as $a) {
if (csb($a, "State:")) {
$a = trim($a);
$a = strtil($a, "(");
$a = strfrom($a, "State:");
$a = trim($a);
$return[$pid]["state"] = $a;
$return[$pid]["state"] = $return[$pid]["state"] === "S" ? "ZZ" : $return[$pid]["state"];
}
if (csa($a, "Uid")) {
$uidarr = explode(":", $a);
$value = trimSpaces($uidarr[1]);
$uidarr2 = explode(" ", $value);
$uid = trim($uidarr2[1]);
$pwd = posix_getpwuid($uid);
$username = $pwd['name'];
$return[$pid]["username"] = $username;
}
if (csa($a, "VmSize")) {
$uidarr = explode(":", $a);
$uidarr = trimSpaces($uidarr[1]);
$uidarr = strtilfirst($uidarr, " ");
$return[$pid]['memory'] = round($uidarr / 1024, 2);
}
}
}
}
return $return;
}
示例15: generateGraph
static function generateGraph($oldtime, $newtime)
{
$convertedfile = self::convertfile($oldtime, $newtime);
if (!$convertedfile) {
return;
}
$list = lscandir("__path_mail_root/domains");
foreach ($list as $l) {
if (csb($l, "lists.")) {
continue;
}
$total = self::getmail_usage($convertedfile, $l, $oldtime, $newtime);
execRrdSingle("mailtraffic", "ABSOLUTE", $l, $total * 1024 * 1024);
}
lunlink($convertedfile);
}