当前位置: 首页>>代码示例>>PHP>>正文


PHP csa函数代码示例

本文整理汇总了PHP中csa函数的典型用法代码示例。如果您正苦于以下问题:PHP csa函数的具体用法?PHP csa怎么用?PHP csa使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了csa函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __xenimport_parse_config

function __xenimport_parse_config($file)
{
    $list = lfile_trim($file);
    foreach ($list as $l) {
        if (!csa($l, "=")) {
            continue;
        }
        list($var, $val) = explode("=", $l);
        $var = trim($var);
        $val = trim($val);
        switch ($var) {
            case "memory":
                $ret['memory'] = $val;
                break;
            case "name":
                $ret['name'] = strtolower(trim($val, '"'));
                break;
            case "ipaddr":
                $val = trim($val, '"');
                $ret['ipaddress'] = trim($val);
                break;
            case "hostname":
                $val = trim($val, '"');
                $ret['hostname'] = trim($val);
                break;
            case "disk":
                __xenimport_parsedisk($ret, $val);
                break;
        }
    }
    return $ret;
}
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:32,代码来源:xenimport__unixshell.php

示例2: convert_tree_to_frm_o

function convert_tree_to_frm_o()
{
    global $gbl, $sgbl, $login, $ghtml;
    $cid = $ghtml->node;
    if (!csa($cid, "&")) {
        return null;
    }
    $cid = trim($cid, "/&");
    $dlist = explode("&", $cid);
    $i = 0;
    $ghtml->__title_function = false;
    $ghtml->__resource_class = false;
    foreach ((array) $dlist as $d) {
        //if (csa($d, "_s_vv_p_")) {
        if (csb($d, "__title_")) {
            $ghtml->__title_function = $d;
            continue;
        }
        if (csb($d, "__resource_")) {
            $ghtml->__resource_class = $d;
            continue;
        }
        $ghtml->__resource_class = false;
        if (csa($d, "-")) {
            list($class, $name) = getClassAndName($d);
            $frmo[$i]['class'] = $class;
            $frmo[$i]['nname'] = $name;
        } else {
            $frmo[$i]['class'] = $d;
        }
        $i++;
    }
    $ghtml->__http_vars['frm_o_o'] = $frmo;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:34,代码来源:ajaxcore.php

示例3: getEachfileqouta

 static function getEachfileqouta($file, $domainname, $oldtime, $newtime)
 {
     $fp = @fopen($file, "r");
     print "Opening File name is :{$file}\n";
     error_reporting(0);
     if (!$fp) {
         return 0;
     }
     $fsize = filesize($file);
     print "Here U are in Mail log file Size is:{$fsize}\n";
     if ($fsize <= 5) {
         return 0;
     }
     $total = 0;
     $ret = FindRightPosition($fp, $fsize, $oldtime, $newtime, array("ftpusertraffic__pureftp", "getTimeFromString"));
     if ($ret < 0) {
         dprint("Could not find position\n");
         return null;
     }
     $total = 0;
     while (!feof($fp)) {
         $string = fgets($fp);
         if (csa($string, $domainname)) {
             $total += self::LogConvertString($string);
         }
         if (self::getTimeFromString($string) > $newtime) {
             break;
         }
     }
     $total = $total / (1024 * 1024);
     $total = round($total, 1);
     fclose($fp);
     dprint("Returning Total From OUT SIDE This File: for {$domainname} {$total} \n");
     return $total;
 }
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:35,代码来源:ftpusertraffic__pureftplib.php

示例4: 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']);
    }
}
开发者ID:soar-team,项目名称:kloxo,代码行数:25,代码来源:reflect.php

示例5: getVersion

 static function getVersion($list, $name)
 {
     foreach ($list as $v) {
         if (csb($v, $name) || csa($v, " {$name} ")) {
             $ret[] = $v;
         }
     }
     return implode(", ", $ret);
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:9,代码来源:component__rpmlib.php

示例6: 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);
     }
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:13,代码来源:dirlocation__linuxlib.php

示例7: log_error_messages

 function log_error_messages($throwflag = true)
 {
     if (mysql_errno()) {
         dprint(mysql_error());
         if (mysql_errno() === 1007 && csa($this->main->dbname, "_")) {
             log_message("Mysql Db {$this->main->dbname} already exists. and also has an underscore... Will treat this as the main db..");
             log_error(mysql_error());
             return true;
         }
         if ($throwflag) {
             throw new lxException('mysql_error', '', mysql_error());
         }
     }
 }
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:14,代码来源:mysqldbuser__mysqllib.php

示例8: 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;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:48,代码来源:process__linuxlib.php

示例9: print_a_right_button

function print_a_right_button($something, $ttype, $id, $pos)
{
    global $gbl, $login, $ghtml, $gdata;
    $name = $gdata[$id][0];
    $url = $gdata[$id][1];
    $icon = $gdata[$id][2];
    if (csa($url, "javascript")) {
        $onclickstring = "onClick=\"{$url}\"";
    } else {
        $onclickstring = "onClick=\"top.mainframe.location='{$url}';\"";
    }
    $skindir = $login->getSkinDir();
    ?>
 
	
	<table border="0" cellspacing=0 cellpadding=0 style='font-size:11;color:#004466;height:34;width:73;background:url(<?php 
    echo $skindir;
    ?>
/right_btn.gif);' OnMouseOver="style.cursor='pointer'; top.mainframe.changeContent('help','<?php 
    echo $name;
    ?>
');"  <?php 
    echo $onclickstring;
    ?>
 onmouseout="changeContent('help','helparea')">
        <tr>
            <td valign=bottom width=17 height=34 align=left style='padding-bottom:5;padding-left:6'>
            <img height=8 width=8 src='/img/image/<?php 
    echo $login->getSpecialObject('sp_specialplay')->icon_name;
    ?>
/button/<?php 
    echo $icon;
    ?>
'></td>
        <td valign=bottom width=53 style='padding-left:3;padding-bottom:3;' align=left><b><?php 
    echo $name;
    ?>
 </font> </b></td>
    </tr>
    </table>

	<?php 
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:43,代码来源:oldheader.php

示例10: getFtpList

 static function getFtpList($username = null)
 {
     $list = process__linux::readProcessList();
     $ret = null;
     foreach ($list as $l) {
         if (!csa($l['command'], "pure-ftp")) {
             continue;
         }
         dprintr($l);
         $r['pid'] = $l['nname'];
         $r['nname'] = $r['pid'];
         if ($username && $username !== $l['username']) {
             continue;
         }
         $r['account'] = $username;
         $r['state'] = $l['state'];
         $ret[] = $r;
     }
     return $ret;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:20,代码来源:ftpsession__pureftplib.php

示例11: readSingleMail

 static function readSingleMail($name)
 {
     $ret['message'] = lxshell_output("__path_program_root/bin/misc/qmHandle", "-m{$name}");
     $oldtime = time() - 7200;
     $newtime = time() - 500;
     $fp = fopen("/var/log/kloxo/maillog", "r");
     $fsize = lxfile_size("/var/log/kloxo/maillog");
     $ot = date("Y-m-d:H-i");
     dprint("Start time: {$ot}\n");
     $res = FindRightPosition($fp, $fsize, $oldtime, $newtime, array("mailtraffic", "getTimeFromOriginalQmailString"));
     if ($res < 0) {
         $ret['log'] = null;
         return $ret;
     }
     //$s = fgets($fp);
     dprint("here {$s}\n");
     takeToStartOfLine($fp);
     takeToStartOfLine($fp);
     //$s = fgets($fp);
     dprint("here {$s}\n");
     $delivery = null;
     while (!feof($fp)) {
         $s = fgets($fp);
         if (!$delivery) {
             if (csa($s, "starting delivery") && csa($s, "msg {$name}")) {
                 $delivery = preg_replace("/.*delivery ([^:]*):.*/", "\$1", $s);
                 $delivery = trim($delivery);
                 dprint("Deliver num: {$delivery}*\n");
                 continue;
             }
         } else {
             dprint("{$s}\n");
             if (csa($s, "delivery {$delivery}:")) {
                 dprint("{$s}\n");
                 $ret['log'] = $s;
                 break;
             }
         }
     }
     return $ret;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:41,代码来源:mailqueue__qmaillib.php

示例12: print_a_right_button

function print_a_right_button($something, $ttype, $id, $pos)
{
    global $gbl, $login, $ghtml, $gdata;
    $name = $gdata[$id][0];
    $url = $gdata[$id][1];
    $icon = $gdata[$id][2];
    if (csa($url, "javascript")) {
        $onclickstring = "onClick=\"{$url}\"";
    } else {
        $onclickstring = "onClick=\"top.mainframe.location='{$url}';\"";
    }
    $skindir = $login->getSkinDir();
    ?>
<td>
<table class="headertabletabsright" style="background: url(<?php 
    echo $skindir;
    ?>
right_btn.gif);" OnMouseOver="style.cursor='pointer';" <?php 
    echo $onclickstring;
    ?>
>
    <tr>
        <td valign="bottom" width="17" height="34" align="left" style="padding-bottom: 5px; padding-left: 6px;">
            <img height="8" width="8" src="/img/image/<?php 
    echo $login->getSpecialObject('sp_specialplay')->icon_name;
    ?>
/button/<?php 
    echo $icon;
    ?>
">
        </td>
        <td valign="bottom" width="53" style="padding-left: 3px; padding-bottom: 3px;" align="left"><b><?php 
    echo $name;
    ?>
</b>
        </td>
    </tr>
</table>
</td>
<?php 
}
开发者ID:soar-team,项目名称:kloxo,代码行数:41,代码来源:default-header.php

示例13: updateform

 function updateform($subaction, $param)
 {
     if (csa($subaction, "ssl_")) {
         $this->slave_id = "localhost";
         $vlist['slave_id'] = array('s', get_all_pserver());
         return $vlist;
     }
     if ($this->isOn('upload_status')) {
         $string = null;
         $res = openssl_x509_read($this->text_crt_content);
         $ar = openssl_x509_parse($res);
         $string .= "{$ar['name']} {$ar['subject']['CN']}";
         $vlist['upload'] = array('M', $string);
         $vlist['text_crt_content'] = null;
         $vlist['text_key_content'] = null;
         $vlist['text_ca_content'] = null;
     } else {
         $vlist['nname'] = array('M', $this->certname);
         $vlist["ssl_data_b_s_commonName_r"] = null;
         $vlist["ssl_data_b_s_countryName_r"] = null;
         $vlist["ssl_data_b_s_stateOrProvinceName_r"] = null;
         $vlist["ssl_data_b_s_localityName_r"] = null;
         $vlist["ssl_data_b_s_organizationName_r"] = null;
         $vlist["ssl_data_b_s_organizationalUnitName_r"] = null;
         $vlist["ssl_data_b_s_emailAddress_r"] = null;
         $this->convertToUnmodifiable($vlist);
         $vlist['text_csr_content'] = null;
         $vlist['text_crt_content'] = null;
         $vlist['text_key_content'] = null;
     }
     /*
     	if ($this->getParentO()->isAdmin()) {
     		$vlist['__m_message_pre'] = 'sslcert_updateform_update_pre_admin';
     	} else {
     		$vlist['__m_message_pre'] = 'sslcert_updateform_update_pre_client';
     	}
     */
     $vlist['__v_button'] = array();
     return $vlist;
 }
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:40,代码来源:sslcertlib.php

示例14: getEachfileqouta

 static function getEachfileqouta($file, $iface, $oldtime, $newtime)
 {
     $fp = @fopen($file, "r");
     print "Opening File name is :{$file}\n";
     error_reporting(0);
     if (!$fp) {
         return 0;
     }
     $fsize = filesize($file);
     print "Here U are in Mail log file Size is:{$fsize}\n";
     if ($fsize <= 5) {
         return 0;
     }
     $total = 0;
     $ret = FindRightPosition($fp, $fsize, $oldtime, $newtime, array("vpstraffic__xen", "getTimeFromString"));
     if ($ret < 0) {
         dprint("Could not find position\n");
         return;
     }
     $total = 0;
     while (!feof($fp)) {
         $string = fgets($fp);
         if (csa($string, $iface)) {
             //$total += self::LogConvertString($string);
             $incoming += self::getFromString($string, 4);
             $outgoing += self::getFromString($string, 5);
             $total += self::getFromString($string, 5);
             $total += self::getFromString($string, 4);
         }
         if (self::getTimeFromString($string) > $newtime) {
             break;
         }
     }
     $incoming = self::roundupValue($incoming);
     $outgoing = self::roundupValue($outgoing);
     $total = self::roundupValue($total);
     fclose($fp);
     dprint("Returning Total From OUT SIDE This File: for {$iface} {$total} \n");
     return array('total' => $total, 'incoming' => $incoming, 'outgoing' => $outgoing);
 }
开发者ID:digideskio,项目名称:hypervm,代码行数:40,代码来源:vpstraffic__xenlib.php

示例15: 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;
     }
     $sysuser = mmail__qmail::getUserGroup($domain);
     // --- 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}/.bogopref.cf";
         $prefpath = "{$mailpath}/{$user}/.bogopref.cf";
     } else {
         return;
     }
     $prefdir = dirname($prefpath);
     if (!lxfile_exists(dirname($prefpath))) {
         lxuser_mkdir($sysuser, dirname($prefpath));
     }
     $wname = fix_nname_to_be_variable($this->main->nname);
     $fdata = null;
     $cutoff = $this->main->spam_hit / 10 + 0.2;
     $fdata .= "spam_cutoff  {$cutoff}\n";
     $fdata .= "spam_subject_tag={$this->main->subject_tag}\n";
     $fdata .= "wordlist R,user,{$wname}.wordlist.db,1\n";
     $fdata .= "wordlist R,system,wordlist.db,2\n";
     $fdata .= "wordlist R,system,kloxo.wordlist.db,3\n";
     lxuser_put_contents($sysuser, $prefpath, $fdata);
     if (!lxfile_real("/var/bogofilter/{$wname}.wordlist.db")) {
         new_process_cmd($sysuser, null, "bogofilter -d /var/bogofilter/ --wordlist=R,user,{$wname}.wordlist.db,1  -n < /etc/my.cnf");
     }
     lxfile_touch("/var/bogofilter/wordlist.db");
     // Using generic because spamassasin is used on windows too. Or at least can be used.
     //lxfile_generic_chown("/var/bogofilter", mmail__qmail::getUserGroup($domain));
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:40,代码来源:spam__bogofilterlib.php


注:本文中的csa函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。