當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Imit_L函數代碼示例

本文整理匯總了PHP中Imit_L函數的典型用法代碼示例。如果您正苦於以下問題:PHP Imit_L函數的具體用法?PHP Imit_L怎麽用?PHP Imit_L使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Imit_L函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: connect

 protected function connect()
 {
     global $sae_config;
     if (empty($sae_config['db_name'])) {
         die(Imit_L('_SAE_PLEASE_CONFIG_DB_'));
     }
     self::$link = mysql_connect(SAE_MYSQL_HOST_M, SAE_MYSQL_USER, SAE_MYSQL_PASS) or die(Imit_L('_SAE_CONNECT_DB_ERR_'));
     mysql_select_db(SAE_MYSQL_DB, self::$link);
     mysql_query("set names " . self::$charset, self::$link);
     if (!mysql_select_db(SAE_MYSQL_DB, self::$link)) {
         //如果數據庫不存在,自動建立
         mysql_query('create database ' . SAE_MYSQL_DB, self::$link);
         mysql_select_db(SAE_MYSQL_DB, self::$link) or Imit_L('_SAE_DATABASE_NOT_EXIST_');
     }
 }
開發者ID:chenyongze,項目名稱:januarybuy_develop,代碼行數:15,代碼來源:SaeMysql.class.php

示例2: __construct

 public function __construct()
 {
     $this->errmsg = Imit_L("_SAE_OK_");
     static $inited = false;
     //隻初始化一次
     if ($inited) {
         return;
     }
     if (extension_loaded('sqlite3')) {
         self::$db = new ImitSqlite();
     } else {
         self::$db = get_class($this) == "SaeMysql" ? $this : new SaeMysql();
         $this->createTable();
     }
     $inited = true;
 }
開發者ID:zjstage,項目名稱:ThinkPHP,代碼行數:16,代碼來源:SaeObject.class.php

示例3: write

 public function write($domain, $destFileName, $content, $size = -1, $attr = array(), $compress = false)
 {
     if (empty($domain) || empty($destFileName)) {
         $this->errmsg = Imit_L("_SAE_STORAGE_PARAM_EMPTY_") . "[the value of parameter (domain,destFileName,content) can not be empty!]";
         $this->errno = -101;
         return false;
     }
     //定義文件路徑
     $filepath = $this->domainDir . $domain . "/" . $destFileName;
     $this->mkdir(dirname($filepath));
     //設置長度
     if ($size > -1) {
         $content = substr($content, 0, $size);
     }
     //寫入文件
     if (file_put_contents($filepath, $content)) {
         return true;
     } else {
         $this->errmsg = Imit_L('_SAE_STORAGE_SERVER_ERR_');
         $this->errno = -12;
         return false;
     }
 }
開發者ID:Trangttq,項目名稱:thinkphp-vietnam,代碼行數:23,代碼來源:SaeStorage.class.php

示例4: Imit_L

<?php

// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2010 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: luofei614 <www.3g4k.com>
// +----------------------------------------------------------------------
// $Id$
Imit_L(array('_SAE_DATABASE_NOT_EXIST_' => '數據庫[' . SAE_MYSQL_DB . ']不存在', '_SAE_NOT_IN_BILLBOARD_' => '查找元素沒有在排行榜中[not in billboard]', '_SAE_BILLBOARD_NOT_EXISTS_' => '排行榜不存在[billboard not exists]', '_SAE_THE_RANK_IS_EXISTED_' => '排行榜已存在[the rank is existed]', '_SAE_ERR_' => 'SAE內部錯誤', '_SAE_OK_' => '操作成功[OK]', '_SAE_ERRPARAMTER_' => '參數錯誤[Unavailable tasks]', '_SAE_TASKQUEUE_SERVICE_FAULT_' => '服務內部錯誤[taskqueue service segment fault]', '_SAE_TASKQUEUE_SERVICE_ERROR_' => '服務內部錯誤[taskqueue service internal error]', '_SAE_UNKNOWN_ERROR_' => '未知錯誤[unknown error]', '_SAE_STORAGE_PARAM_EMPTY_' => '參數錯誤', '_SAE_STORAGE_SERVER_ERR_' => '存儲服務器返回錯誤', '_SAE_STORAGE_DELETE_ERR_' => '刪除失敗[deleted failed!...]', '_SAE_STORAGE_FILE_NOT_EXISTS_' => '文件不存在', '_SAE_MAIL_SIZE_lARGER_' => '郵件內容過大[mail size cannot larger than 1048576 bytes]', '_SAE_CONNECT_DB_ERR_' => '數據庫連接失敗', '_SAE_PLEASE_CONFIG_DB_' => '請配置數據庫'));
開發者ID:zjstage,項目名稱:ThinkPHP,代碼行數:13,代碼來源:Lang.php

示例5: setOpt

 public function setOpt($options)
 {
     if (isset($options['subject']) && strlen($options['subject']) > self::subject_limitsize) {
         $this->errno = SAE_ErrParameter;
         $this->errmsg = Imit_L("_SAE_MAIL_SIZE_lARGER_");
         return false;
     }
     if (isset($options['content'])) {
         $this->_count = $this->_attachSize + strlen($options['content']);
     }
     if ($this->_count > self::mail_limitsize) {
         $this->errno = SAE_ErrParameter;
         $this->errmsg = Imit_L("_SAE_MAIL_SIZE_lARGER_");
         return false;
     }
     $this->_post = array_merge($this->_post, $options);
     return true;
 }
開發者ID:lxp521125,項目名稱:TP-Admin,代碼行數:18,代碼來源:SaeMail.class.php

示例6: emptyName

 private function emptyName($name)
 {
     $num = self::$db->getVar("select count(*) from sae_rank where namespace='{$name}'");
     if ($num == 0) {
         return true;
     } else {
         $this->errno = -4;
         $this->errmsg = Imit_L("_SAE_BILLBOARD_NOT_EXISTS_");
         return false;
     }
 }
開發者ID:Trangttq,項目名稱:thinkphp-vietnam,代碼行數:11,代碼來源:SaeRank.class.php

示例7: push

 public function push()
 {
     //todu, 當用戶環境不支持curl時用socket發送。
     if (empty($this->queue)) {
         return false;
     }
     $s = curl_init();
     foreach ($this->queue as $k => $v) {
         curl_setopt($s, CURLOPT_URL, $v['url']);
         //curl_setopt($s,CURLOPT_TIMEOUT,5);
         curl_setopt($s, CURLOPT_RETURNTRANSFER, true);
         curl_setopt($s, CURLOPT_HEADER, 1);
         curl_setopt($s, CURLINFO_HEADER_OUT, true);
         curl_setopt($s, CURLOPT_POST, true);
         curl_setopt($s, CURLOPT_POSTFIELDS, $v['postdata']);
         $ret = curl_exec($s);
         $info = curl_getinfo($s);
         // print_r($info);
         if (empty($info['http_code'])) {
             $this->errno = SAE_ErrInternal;
             $this->errmsg = Imit_L("_SAE_TASKQUEUE_SERVICE_FAULT_");
             return false;
         } else {
             if ($info['http_code'] != 200) {
                 $this->errno = SAE_ErrInternal;
                 $this->errmsg = Imit_L("_SAE_TASKQUEUE_SERVICE_ERROR_");
                 return false;
             } else {
                 //todu 這裏好像有些問題
                 if ($info['size_download'] == 0) {
                     // get MailError header
                     $this->errno = SAE_ErrUnknown;
                     $this->errmsg = Imit_L("_SAE_UNKNOWN_ERROR_");
                     return false;
                 }
             }
         }
     }
     //循環結束
     $this->queue = array();
     //清空列隊
     return true;
 }
開發者ID:lxp521125,項目名稱:TP-Admin,代碼行數:43,代碼來源:SaeTaskQueue.class.php


注:本文中的Imit_L函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。