首页 > 下载 >  类库下载

  • <?phpclass Curl{   public $cookieJar ="";  public function __construct($cookieJarFile = 'cookies.txt') {  $this->cookieJar = $cookieJarFile;  }  function setup()  {  $header = array();  $header[0] ="Accept: text/xml,application/xml,application/xhtml+xml,";  $header[0]. ="text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";  $header[] ="Cache-Control: max-age=0";  $header[] ="Connection: keep-alive";  $header[] ="Keep-Alive: 300";  $header[] ="Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";  $header[] ="Accept-Language: en-us,en;q=0.5";  $header[] ="Pragma:";//browsers keep this blank.  curl_setopt($this->curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7');首先,你获取或者将你的请求发送到指定的URL接下来你将收到作为响应返回的html最后,你将从html中分析你想要抓取的文本。

    其它类库11192017-12-16
  • cURL是利用PHP发送HTTP请求最常用的标准方式。它比fopen这种方式更强大。Guzzle, 是 cURL 的一个封装,使得这个功能甚至更好,此外还增了新的功能。使用这个框架内,我们可以发送并行 持久连接。并且能够通过插件实现缓存,OAuth, AWS集成All the power of cURL with a simple interface. 持久连接和并行请求 Streams request and response bodies Service descriptions for quickly building clients. Powered by the Symfony2 EventDispatcher. Use all of the code or only specific components. Plugins for caching, logging, OAuth, mocks, and more Includes a custom node.js webserver to test your clients.

    其它类库30102017-12-16
  • Httpful是一个简单的Http客户端库PHP 5.3 。有重点的可读性、简单性和灵活性——基本上提供完成工作的功能和灵活性,使这些功能很容易使用。可读的HTTP方法支持(GET、PUT、POST、DELETE、头、补丁和选项) 自定义标题“智能”自动解析自动负载序列化  基本认证客户端证书身份验证请求“模板”

    其它类库12652017-12-16
  • <?php namespace PHPImageWorkshop; use PHPImageWorkshop\Core\ImageWorkshopLayer as ImageWorkshopLayer; use PHPImageWorkshop\Core\ImageWorkshopLib as ImageWorkshopLib; use PHPImageWorkshop\Exception\ImageWorkshopException as ImageWorkshopException; class ImageWorkshop {      const ERROR_NOT_AN_IMAGE_FILE = 1;     const ERROR_IMAGE_NOT_FOUND = 2;     const ERROR_NOT_READABLE_FILE = 3;     const ERROR_CREATE_IMAGE_FROM_STRING = 4;     public static function initFromPath($path, $fixOrientation = false)     {         if (false === filter_var($path, FILTER_VALIDATE_URL) && !file_exists($path)) {             throw new ImageWorkshopException(sprintf('File "%s" not exists.', $path), static::ERROR_IMAGE_NOT_FOUND);         }   图像处理(image processing),用计算机对图像进行分析,以达到所需结果的技术。又称影像处理。图像处理一般指数字图像处理。数字图像是指用工业相机、摄像机、扫描仪等设备经过拍摄得到的一个大的二维数组,该数组的元素称为像素,其值称为灰度值。图像处理技术一般包括图像压缩,增强和复原,匹配、描述和识别3个部分。申明:PHP中文网下载站匠心打造中国最大的免费下载站!一切资源免费,所有资源都经过检测,请放心下载

    其它类库17772017-12-16
  • <?php namespace Lurker\Tests; use Lurker\ResourceWatcher; use Lurker\Resource\TrackedResource; use Lurker\Event\FilesystemEvent; use Lurker\Resource\FileResource; use Lurker\Resource\DirectoryResource; class ResourceWatcherTest extends \PHPUnit_Framework_TestCase {     private $tracker;     private $dispatcher;     protected function setUp()     {         $this->tracker = $this             ->getMockBuilder('Lurker\Tracker\TrackerInterface')             ->getMock();         $this->dispatcher = $this             ->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')             ->getMock();     }每个文件或文件夹都贴有一个RFID资源标签,这个标签包含独一无二的ID和可读信息。当文件被放入带有RFID功能的借出/归还托盘中时,表示文件夹的独一无二的ID就会被采集到并被发送至数据库,同时文件清单在任何时候都会被保留。RFID手持终端可帮助用户快速找到特定文件并且在需要时进行库存盘点。在查找过程中,一旦在特定位置的文件被定位,就会触发可闻可视报警。另一方面,有了具备WiFi 功能的移动装置,所有采集到的库存盘点数据都被同步发送至文件追踪系统的中央数据库用于验证目的。这就是资源跟踪

    其它类库8952017-12-16
  • <?php //curl类 class Curl {  function Curl(){   return true;  }  function execute($method, $url, $fields='', $userAgent='', $httpHeaders='', $username='', $password=''){   $ch = Curl::create();   if(false === $ch){    return false;   }   if(is_string($url) && strlen($url)){    $ret = curl_setopt($ch, CURLOPT_URL, $url);   }else{    return false;   }   //是否显示头部信息   curl_setopt($ch, CURLOPT_HEADER, false);   //   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);   if($username != ''){    curl_setopt($ch, CURLOPT_USERPWD, $username . ':' . $password);   }   $method = strtolower($method);   if('post' == $method){    curl_setopt($ch, CURLOPT_POST, true);    if(is_array($fields)){     $sets = array();     foreach ($fields AS $key => $val){      $sets[] = $key . '=' . urlencode($val);     }     $fields = implode('&',$sets);    }    curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);   }else if('put' == $method){    curl_setopt($ch, CURLOPT_PUT, true);   }GET用法:$curl = new Curl(); $curl->get('http://www.XXX.com/');POST用法: $curl = new Curl(); $curl->get('http://www.XXX.com/', 'p=1&time=0');

    其它类库17142017-12-16
  • phpFastCache是一个开源的PHP缓存库,只提供一个简单的PHP文件,可方便集成到已有项目,支持多种缓存方法,包括:apc, memcache, memcached, wincache, files, pdo and mpdo。可通过简单的API来定义缓存的有效时间。<?php    // In your config file     include("phpfastcache/phpfastcache.php");     phpFastCache::setup("storage","auto");    // phpFastCache support "apc", "memcache", "memcached", "wincache" ,"files", "sqlite" and "xcache"     // You don't need to change your code when you change your caching system. Or simple keep it auto     $cache = phpFastCache();    // In your Class, Functions, PHP Pages     // try to get from Cache first. product_page = YOUR Identity Keyword     $products = $cache->get("product_page");    if($products == null) {        $products = YOUR DB QUERIES || GET_PRODUCTS_FUNCTION;        // set products in to cache in 600 seconds = 10 minutes         $cache->set("product_page", $products,600);     }    // Output Your Contents $products HERE

    其它类库14202017-12-16
  • <?php require './PHPMailer-master/PHPMailerAutoload.php'; $mail = new PHPMailer; //$mail->SMTPDebug = 3; // 关闭SMTP调试功能 1 = error // Enable verbose debug output $mail->isSMTP(); // 使用SMTP服务 // Set mailer to use SMTP $mail->Host = 'smtp.163.com'; // 发送方的SMTP服务器地址 // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'xxxxxxx@163.com'; // 发送方的163邮箱用户名 // SMTP username $mail->Password = 'xxxxx'; // 发送方的邮箱密码,注意用163邮箱这里填写的是“客户端授权密码”而不是邮箱的登录密码! // SMTP password $mail->SMTPSecure = 'ssl'; // 使用ssl协议方式 // Enable TLS encryption, `ssl` also accepted $mail->Port = 994; // 163邮箱的ssl协议方式端口号是465/994 // TCP port to connect to $mail->CharSet = "utf8"; // 编码格式为utf8,不设置编码的话,中文会出现乱码 $mail->SMTPAuth = true; // 是否使用身份验证 $mail->setFrom('xxxxxxx@163.com', 'myafa'); // 设置发件人信息,如邮件格式说明中的发件人,这里会显示为Mailer(xxxx@163.com),Mailer是当做名字显示 $mail->addAddress('11111@aliyun.com', '老铁'); // 设置收件人信息// Add a recipient $mail->addAddress('22222@qq.com', '老铁'); // 设置收件人信息, $mail->addAddress('xxxxxxx@163.com', '老铁'); // 设置收件人信息, //$mail->addAddress('ellen@example.com'); // Name is optional //$mail->addReplyTo('info@example.com', 'Information'); // 设置回复人信息,指的是收件人收到邮件后,如果要回复,回复邮件将发送到的邮箱地址 //$mail->addCC('cc@example.com'); // 设置邮件抄送人,可以只写地址,上述的设置也可以只写地址 //$mail->addBCC('bcc@example.com'); // 设置秘密抄送人 //$mail->addAttachment('/var/tmp/file.tar.gz'); // 添加附件// Add attachments $mail->addAttachment('/61e8a1fdly1fcpvyl7dkzg20bi06d7wk.gif', '你.jpg'); // 添加附件// Optional name $mail->isHTML(true); // Set email format to HTML这是一款非常好用的邮件类,使用方法都已经在上面给大家贴出来了,需要的朋友可以直接下载使用

    其它类库25512017-12-16
  • 调用PHP qrCode非常简单,如下代码即可生成一张内容为"http://www.php.cn"的二维码.Php代码  include 'phpqrcode.php';   QRcode::png('"http://www.php.cn');    那么实际应用中,我们会在二维码的中间加上自己的LOGO,已增强宣传效果。那如何生成含有logo的二维码呢?其实原理很简单,先使用PHP qr Code生成一张二维码图片,然后再利用php的image相关函数,将事先准备好的logo图片加入到刚生成的原始二维码图片中间,然后重新生成一张新 的二维码图片。 <?php  include 'phpqrcode.php';  $value = 'http://www.learnphp.cn'; //二维码内容  $errorCorrectionLevel = 'L';//容错级别  $matrixPointSize = 6;//生成图片大小  //生成二维码图片  QRcode::png($value, 'qrcode.png', $errorCorrectionLevel, $matrixPointSize, 2);  $logo = 'logo.png';//准备好的logo图片  $QR = 'qrcode.png';//已经生成的原始二维码图     if ($logo !== FALSE) {  $QR = imagecreatefromstring(file_get_contents($QR));  $logo = imagecreatefromstring(file_get_contents($logo));  $QR_width = imagesx($QR);//二维码图片宽度  $QR_height = imagesy($QR);//二维码图片高度  $logo_width = imagesx($logo);//logo图片宽度  $logo_height = imagesy($logo);//logo图片高度  $logo_qr_width = $QR_width / 5;  $scale = $logo_width/$logo_qr_width;  $logo_qr_height = $logo_height/$scale;  $from_width = ($QR_width - $logo_qr_width) / 2;  //重新组合图片并调整大小  imagecopyresampled($QR, $logo, $from_width, $from_width, 0, 0, $logo_qr_width,  $logo_qr_height, $logo_width, $logo_height);  }  //输出图片  imagepng($QR, 'helloweba.png');  echo '<img src="helloweba.png">';  ?>

    其它类库23532017-12-16
  • <?php /**  * Whoops - php errors for cool kids  * @author Filipe Dobreira <http://github.com/filp>  */ namespace Whoops; use InvalidArgumentException; use Whoops\Exception\ErrorException; use Whoops\Exception\Inspector; use Whoops\Handler\CallbackHandler; use Whoops\Handler\Handler; use Whoops\Handler\HandlerInterface; use Whoops\Util\Misc; use Whoops\Util\SystemFacade; final class Run implements RunInterface {     private $isRegistered;     private $allowQuit       = true;     private $sendOutput      = true;     /**      * @var integer|false      */     private $sendHttpCode    = 500;     /**      * @var HandlerInterface[]      */     private $handlerStack = [];这是一款PHP环境的错误捕获与调试PHP的类库,需要的朋友可以直接下载使用

    其它类库11302017-12-16
  • <?php require_once dirname(__DIR__) . '/vendor/autoload.php'; call_user_func(function() {     $loader = new \Composer\Autoload\ClassLoader();     $loader->add('Purl\Test', __DIR__);     $loader->register(); });统一资源定位符是对可以从互联网上得到的资源的位置和访问方法的一种简洁的表示,是互联网上标准资源的地址。互联网上的每个文件都有一个唯一的URL,它包含的信息指出文件的位置以及浏览器应该怎么处理它。[1] 它最初是由蒂姆·伯纳斯·李发明用来作为万维网的地址。现在它已经被万维网联盟编制为互联网标准RFC1738了。

    其它类库10782017-12-16
  • Requests 一直在 Github 上积极地开发,你可以一直从这里获取到代码。你可以克隆公共版本库:git clone git://github.com/kennethreitz/requests.git也可以下载 tarball:$ curl -OL https://github.com/requests/requests/tarball/master# Windows 用户也可选择 zip 包获得代码之后,你就可以轻松的将它嵌入到你的 python 包里,或者安装到你的 site-packages:$ cd requests$ pip install .

    其它类库24012017-12-16