Heim > Herunterladen >  Bibliothek herunterladen

  • <?php namespace TijsVerkoyen\CssToInlineStyles; use Symfony\Component\CssSelector\CssSelector; use Symfony\Component\CssSelector\CssSelectorConverter; use Symfony\Component\CssSelector\Exception\ExceptionInterface; use TijsVerkoyen\CssToInlineStyles\Css\Processor; use TijsVerkoyen\CssToInlineStyles\Css\Property\Processor as PropertyProcessor; use TijsVerkoyen\CssToInlineStyles\Css\Rule\Processor as RuleProcessor; use TijsVerkoyen\CssToInlineStyles\Css\Rule\Rule; class CssToInlineStyles {     private $cssConverter;     public function __construct()     {         if (class_exists('Symfony\Component\CssSelector\CssSelectorConverter')) {             $this->cssConverter = new CssSelectorConverter();         }     }Dies ist eine Inline-CSS-Bibliothek in E-Mail-Vorlagen. Freunde, die sie benötigen, können sie herunterladen und verwenden

    Andere Bibliotheken29702018-01-10
  • <?php  /**   * 参数处理类   * @author JasonWei   */  class Params  {      public $get = array();        public $post = array();        function __construct()      {  if (!emptyempty($_GET)) {      foreach ($_GET as $key => $val) {  if (is_numeric($val)) {      $this->get[$key] = $this->getInt($val);  } else {      $this->get[$key] = $this->getStr($val);  }      }  }  if (!emptyempty($_POST)) {      foreach ($_POST as $key => $val) {  if (is_numeric($val)) {      $this->post[$key] = $this->getInt($val);  } else {      $this->post[$key] = $this->getStr($val);  }      }  }Dies ist eine sehr nützliche PHP-Anti-Injection-Klasse. Freunde, die sie benötigen, können sie herunterladen und verwenden

    Andere Bibliotheken24332018-01-10
  • <?php /**  * Validator 数据验证类  */ class Validator {     /**      * 待校验数据      * @var array      */     private $_data;     /**      * 校验规则      * @var array      */     private $_ruleList = null;     /**      * 校验结果      * @var bool      */     private $_result = null;     /**      * 校验数据信息      * @var array      */     private $_resultInfo = array();     /**      * 构造函数      * @param array $data 待校验数据      */     public function __construct($data = null)     {         if ($data) {             $this->_data = $data;         }     }Dies ist ein sehr umfassender PHP-Verifizierungskurs. Freunde, die ihn benötigen, können ihn herunterladen und verwenden

    Andere Bibliotheken30692018-01-10
  • <?php class crypt {   private $skey;   public function __construct($key) {     $this->skey = hash("md5", $key, true); //32位skey   }   public function safe_b64encode($string) {     $data = base64_encode($string);     $data = str_replace(array('+', '/', '='), array('-', '_', ''), $data);     return $data;   }   public function safe_b64decode($string) {     $data = str_replace(array('-', '_'), array('+', '/'), $string);     $mod4 = strlen($data) % 4;     if ($mod4) {       $data .= substr('====', $mod4);     }     return base64_decode($data);   }Dies ist ein PHP-Verschlüsselungs- und Entschlüsselungskurs. Freunde, die ihn benötigen, können ihn herunterladen und verwenden

    Andere Bibliotheken27862018-01-10
  • <?php class cls_http_request {   public static function curl_get($url, $timeout = 1)   {     $ch = curl_init();     curl_setopt($ch, CURLOPT_URL, $url);     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);     curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);     $result = curl_exec($ch);     curl_close($ch);     if (is_string($result) && strlen($result))     {       return $result;     }     else     {       return false;     }   }http-Anforderungsverarbeitungsklasse (gekapselt basierend auf CURL)Anfrage abrufen (Curl)@param string $url angeforderte URL@param integer $timeout timeout (s)@return string (Anfrage erfolgreich) | (Anfrage fehlgeschlagen)

    Andere Bibliotheken25762018-01-10
  • <?php class CacheLayer{   protected $root = "";   protected $cache = "";   protected $key = "";   protected $life = 0;   public function __construct($key, $root = "/cachelayer"){     $this->root = $_SERVER["DOCUMENT_ROOT"].$root;     $this->key = $key;   }   public function expired($life_span){     $this->life = $life_span;     $file = $this->root."/".$this->key.".cachelayer";     if(is_file($file)){       $mtime = filemtime($file);       return (time() >= ($mtime + $this->life));     }else{       return true;     }   }   public function put($content){     $file = $this->root."/".$this->key.".cachelayer";     if(!is_dir(dirname($this->root))){       return false;     }     $this->delete();     $content = json_encode($content);     return (bool)file_put_contents($file, $content);   }   public function get(){     $file = $this->root."/".$this->key.".cachelayer";     if(is_file($file)){       return json_decode(file_get_contents($file), true);     }     return array();   }   public function delete(){     $file = $this->root."/".$this->key.".cachelayer";     if(is_file($file)){       unlink($file);       return true;     }     return false;   } } ?>Dies ist eine sehr nützliche PHP-Caching-Bibliothek, die sie herunterladen und verwenden kann. Sie kann den Druck auf die Datenbank durch Datei-Caching erheblich verringern

    Andere Bibliotheken21842018-01-09
  • <?php class upload { var $dir;            //附件存放物理目录 var $time;           //自定义文件上传时间 var $allow_types;    //允许上传附件类型 var $field;          //上传控件名称 var $maxsize;        //最大允许文件大小,单位为KB var $thumb_width;    //缩略图宽度 var $thumb_height;   //缩略图高度 var $watermark_file; //水印图片地址 var $watermark_pos;  //水印位置 var $watermark_trans;//水印透明度 //构造函数 //$types : 允许上传的文件类型 , $maxsize : 允许大小 ,  $field : 上传控件名称 , $time : 自定义上传时间 function upload($types = 'jpg|png', $maxsize = 1024, $field = 'attach', $time = '') { $this->allow_types = explode('|',$types); $this->maxsize = $maxsize * 1024; $this->field = $field; $this->time = $time ? $time : time(); } //设置并创建文件具体存放的目录 //$basedir  : 基目录,必须为物理路径 //$filedir  : 自定义子目录,可用参数{y}、{m}、{d} function set_dir($basedir,$filedir = '') { $dir = $basedir; !is_dir($dir) && @mkdir($dir,0777); if (!empty($filedir)) { $filedir = str_replace(array('{y}','{m}','{d}'),array(date('Y',$this->time),date('m',$this->time),date('d',$this->time)),strtolower($filedir));//用string_replace把{y} {m} {d}几个标签进行替换 $dirs = explode('/',$filedir); foreach ($dirs as $d) { !empty($d) && $dir .= $d.'/'; !is_dir($dir) && @mkdir($dir,0777); } } $th unterstützt Wasserzeichen, Datum, Miniaturansicht der PHP-Klasse zum Hochladen mehrerer Dateien, legt das spezifische Verzeichnis fest, in dem Dateien gespeichert werden, Einstellungen für Miniaturansichten von Bildern, wenn keine Miniaturansichten generiert werden, sind keine Einstellungen erforderlich, Einstellungen für Bildwasserzeichen, wenn keine Wasserzeichen generiert werden , es sind keine Einstellungen erforderlich. Legen Sie den Datei-Upload fest, führen Sie ihn aus und geben Sie ein Array mit Dateiinformationen zurück, das den erfolgreichen oder fehlgeschlagenen Upload nach der Verarbeitung enthält.

    Andere Bibliotheken27032018-01-09
  • <?php class IP {      public static function generate($province = '')     {         $ip_address = self::_IPSegment($province);         $ip = self::_randomIP($ip_address['begin'], $ip_address['end']);         return $ip;     }     public static function update()     {         require 'QueryList.class.php';         $province = array(             'BJ', 'GD', 'SD', 'ZJ', 'JS', 'SH', 'LN', 'SC', 'HA',             'HB', 'FJ', 'HN', 'HE', 'CQ', 'SX', 'JX', 'SN', 'AH',             'HL', 'GX', 'JL', 'YN', 'TJ', 'NM', 'XJ', 'GS', 'GZ',             'HI', 'NX', 'QH', 'XZ'         );         $count = count($province);         $ip_segment = array();         for ($i = 0; $i < $count; $i++) {             // 采集IP地址段目标网址             $url = 'http://ips.chacuo.net/view/s_' . $province[$i];             $ip_list = QueryList::Query($url, array('begin' => array('.v_l', 'text'), 'end' => array('.v_r', 'text')), '', 'UTF-8');             $ip_array = $ip_list->jsonArr;             $ip_segment[$province[$i]] = $ip_array;         }         $path = str_replace('\', '/', __DIR__);         $file = $path . '/ip_segment.php';         $res = self::_write($file, $ip_segment);         if ($res) {             echo 'Update OK!';         }     }Generieren Sie zufällig eine IPV4-Adresse basierend auf dem Provinznamen (Chinesisch)Wenn $province leer ist, eine zufällige inländische Provinz

    Andere Bibliotheken33852018-01-09
  • (function(w){     // the heatmapFactory creates heatmap instances     var heatmapFactory = (function(){     // store object constructor     // a heatmap contains a store     // the store has to know about the heatmap in order to trigger heatmap updates when datapoints get added     var store = function store(hmap){         var _ = {             // data is a two dimensional array             // a datapoint gets saved as data[point-x-value][point-y-value]             // the value at [point-x-value][point-y-value] is the occurrence of the datapoint             data: [],             // tight coupling of the heatmap object             heatmap: hmap         };         // the max occurrence - the heatmaps radial gradient alpha transition is based on it         this.max = 1;         this.get = function(key){             return _[key];         };         this.set = function(key, value){             _[key] = value;         };     }Legen Sie die von der Heatmap angezeigten detaillierten Daten fest. Nach der Implementierung können diese sofort angezeigt werden @param {Json Object} data{"<b>max</b>" Der Maximalwert des Gewichts, <br />"<b>data</b>" : {Array} Koordinatendetaildaten, das Format ist wie folgt<br/>{"lng":116.421969, "lat":39.913527," count":3}, wobei<br/>lng lat der Breiten- bzw. Längengrad ist, ZählgewichtswertFügen Sie den detaillierten Koordinatenpunkt der Leistungskarte hinzu@param {Number } lng Längengradkoordinate@param {Number} lat Längengradkoordinate@param {Number} count Längengradkoordinate

    Andere Bibliotheken32372018-01-09
  • <?php /**  * 阿里云短信验证码发送类  */ class Sms {   // 保存错误信息   public $error;   // Access Key ID   private $accessKeyId = '';   // Access Access Key Secret   private $accessKeySecret = '';   // 签名   private $signName = '';   // 模版ID   private $templateCode = '';   public function __construct($cofig = array()) {     $cofig = array (       'accessKeyId' => '***************',       'accessKeySecret' => '******************',       'signName' => '七零',       'templateCode' => 'SMS_25300059'     );     // 配置参数     $this->accessKeyId = $cofig ['accessKeyId'];     $this->accessKeySecret = $cofig ['accessKeySecret'];     $this->signName = $cofig ['signName'];     $this->templateCode = $cofig ['templateCode'];   }InvalidDayuStatus.Malformed' => 'SMS-Aktivierungsstatus ist falsch',InvalidSignName.Malformed' => 'SMS-Signatur ist falsch oder Signaturstatus ist falsch',InvalidTemplateCode.MalFormed' => Der Vorlagencode ist falsch oder der Vorlagenstatus ist falsch',InvalidRecNum.Malformed' => 'Die Ziel-Mobiltelefonnummer ist falsch, die jeweils gesendete Nummer darf 100 nicht überschreiten',InvalidParamString.MalFormed' => ' Variablen in der SMS-Vorlage nicht im JSON-Format',InvalidParamStringTemplate.Malformed' => 'Die Variablen in der SMS-Vorlage stimmen nicht mit dem Vorlageninhalt überein'InvalidSendSms' => 'Geschäftsflusskontrolle auslösenInvalidDayu. Malformed' => 'Die Variable kann keine URL sein, Variablen können in der Vorlage verfestigt werden

    Andere Bibliotheken27912018-01-09
  • <?php class HttpDownload {   private $m_url = "";   private $m_urlpath = "";   private $m_scheme = "http";   private $m_host = "";   private $m_port = "80";   private $m_user = "";   private $m_pass = "";   private $m_path = "/";   private $m_query = "";   private $m_fp = "";   private $m_error = "";   private $m_httphead = "" ;   private $m_html = "";   public function PrivateInit($url){     $urls = "";     $urls = @parse_url($url);     $this->m_url = $url;     if(is_array($urls)) {       $this->m_host = $urls["host"];       if(!empty($urls["scheme"])) $this->m_scheme = $urls["scheme"];       if(!empty($urls["user"])) $this->m_user = $urls["user"];       if(!empty($urls["pass"])) $this->m_pass = $urls["pass"];       if(!empty($urls["port"])) $this->m_port = $urls["port"];       if(!empty($urls["path"])) $this->m_path = $urls["path"];       $this->m_urlpath = $this->m_path;       if(!empty($urls["query"])) {         $this->m_query = $urls["query"];         $this->m_urlpath .= "?".$this->m_query;       }     }   }Initialisierung – Öffnen Sie die angegebene URL – Setzen Sie jeden Parameter zurück – Initialisieren Sie das System – Ermitteln Sie die Ursache eines Betriebsfehlers – Bestimmen Sie, ob das Antwortergebnis des von der Get-Methode gesendeten Headers korrekt ist – Überprüfen Sie, ob die zurückgegebene Webseite aus Text besteht Typ – Bestimmen Sie die zurückgegebene Datei. Ob die Webseite von einem bestimmten Typ ist – HTTP-Protokoll-Download-Datei

    Andere Bibliotheken28202018-01-08
  • <?php function qsort(&$arr) {   _quick_sort($arr, 0, count($arr) - 1); } function _quick_sort(&$arr, $low, $high) {   $low_data = $arr[$low];   $prev_low = $low;   $prev_high = $high;   while ($low < $high)   {     while ($arr[$high] >= $low_data && $low < $high) {       $high--;     }     if ($low < $high) {       $arr[$low] = $arr[$high];       $low++;     }     while ($arr[$low] <= $low_data && $low < $high) {       $low++;     }     if ($low < $high) {       $arr[$high] = $arr[$low];       $high--;     }   }Schnelle Sortierung mit rekursivem Algorithmus. @param array $arr Das zu sortierende Array@param int $low Der am niedrigsten sortierte Unterabschnitt@param int $high Das am höchsten sortierte Feld

    Andere Bibliotheken19502018-01-08