Home > Download >  Library download

  • <?php if (!isset($argv)) {     fprintf(STDERR, "Must be run on command line");     exit(1); } if (!isset($argv[3])) {     fprintf(STDERR, "USAGE: %s archive_name stubfile source1 [source2...]" . PHP_EOL, $argv[0]);     exit(2); } $phar = new Phar($argv[1]); foreach (array_slice($argv, 2) as $file) {     $phar->addFile(__DIR__ . "/$file", $file); } $stub = $argv[2]; $phar->addFile(__DIR__ . "/$stub", $stub); $phar->setStub($phar->createDefaultStub($stub));Data structure is the way computers store and organize data. A data structure refers to a collection of data elements that have one or more specific relationships with each other. Often, carefully selected data structures can lead to higher operating or storage efficiency. Data structures are often related to efficient retrieval algorithms and indexing techniques.

    Other libraries11082017-12-14
  • <?php if (! ($loader = @include __DIR__ . '/../vendor/autoload.php')) {     die(<<<EOT You need to install the project dependencies using Composer: $ wget http://getcomposer.org/composer.phar OR $ curl -s https://getcomposer.org/installer | php $ php composer.phar install --dev $ phpunit EOT     ); } $loader->add('Negotiation\Tests', __DIR__);Content negotiation technology usually has three implementation schemes: (1) Client driverThe client initiates a request, the server sends a list of options, and after the client makes a selection, it sends the Second request. Advantages: relatively easy to implementDisadvantages: increased delay, at least two requests must be sent, the first request to obtain the resource list, and the second request to obtain the selected copy. (2) Server driverThe server checks the client's request header set and decides which version of the page to provide. Advantages: Faster than client-driven negotiation. HTTP provides a q mechanism that allows the server to approximate matching, and also provides a vary header for the server to tell downstream devices (such as proxy servers) how to evaluate the request. Disadvantages: The header set does not match, the server has to make guesses(3) Transparent negotiationAn intermediate device (usually a cache proxy) negotiates on behalf of the clientAdvantages: Eliminates the negotiation overhead of the web server and is faster than client-driven negotiation. Disadvantages: HTTP does not provide corresponding specifications

    Other libraries8112017-12-14
  • <?php /**  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)  *  * Licensed under The MIT License  * For full copyright and license information, please see the LICENSE.txt  * Redistributions of files must retain the above copyright notice.  *  * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)  * @link          https://cakephp.org CakePHP(tm) Project  * @since         3.0.0  * @license       https://opensource.org/licenses/mit-license.php MIT License  */ namespace Cake\Collection; use ArrayIterator; use InvalidArgumentException; use IteratorIterator; use LogicException; use Serializable; use Traversable; Class Library (Class Library) is a comprehensive collection of object-oriented reusable types, including: interfaces, abstract classes and concrete classes. Class libraries can solve a range of common programming tasks (including tasks such as string management, data collection, database connections, and file access), as well as a variety of specialized development tasks (console applications, desktop applications, WEB applications, etc. ).

    Other libraries16452017-12-14
  • Share this simple PHP verification library with everyone. Friends in need can come and refer to itclass ValidateCode {  private $charset = 'abcdefghkmnprstuvwxyzABCDEFGHKMNPRSTUVWXYZ23456789';//随机因子  private $code;//验证码  private $codelen = 4;//验证码长度  private $width = 130;//宽度  private $height = 50;//高度  private $img;//图形资源句柄  private $font;//指定的字体  private $fontsize = 20;//指定字体大小  private $fontcolor;//指定字体颜色  //构造方法初始化  public function __construct() {   $this->font = dirname(__FILE__).'/font/elephant.ttf';//注意字体路径要写对,否则显示不了图片  }

    Other libraries12802017-12-14
  • <?php require 'vendor/autoload.php'; use Filterus\Filter; $filter = Filter::map(array('foo' => 'string,min:4,default:test')); $tmp = array('foo' => 'bar'); var_dump(Filter::factory($filter)->filter($tmp)); //var_dump(Filter::factory($argv[1])->validate($argv[2]));In PHP, some very useful functions are open source and very convenient to prevent your website from various attacks, such as SQL injection attacks, XSS (Cross Site Scripting: Cross-site scripting) attacks, etc. The simple PHP filtering library is such a simple and easy-to-use filtering library

    Other libraries12402017-12-14
  • <?php // Copyright (c) Lellys Informática. All rights reserved. See License.txt in the project root for license information. namespace Collections; use Collections\Comparer\NumericKeyComparer; use Collections\Generic\ComparerInterface; use Easy\Generics\EquatableInterface; /**  * Provides the abstract base class for a strongly typed collection.  */ abstract class AbstractCollection implements EquatableInterface {      }With the widespread use of PHP, it is also very common to use different databases. PHP needs to support more database connection interfaces. If you only write programs for a single database through a single interface, this will greatly increase the complexity and learning threshold of PHP. The abstract PHP library for payment emerged to solve this problem. This defines a lightweight, consistent interface for PHP to access the database. It provides a data access abstraction layer. No matter what database PHP is connected to, it can perform queries and obtain data through consistent functions. PDO began to ship with the release of php5.1. Previous versions of php did not support the abstract PHP library for payment Features: (1) Flexibility, which can be used during php running, Load new databases directly without resetting and compiling when new databases are used. (2) Object-oriented: Control the use of the database through objects. (3) Fast. Since PDO is written in C language and compiled into PHP, it is much faster than those abstract classes written in PHP.

    Other libraries14872017-12-14
  • <?php namespace DMS\Filter; use DMS\Filter\Filters\Loader\FilterLoader; use DMS\Tests\FilterTestCase; use DMS\Tests\Dummy; class FilterTest extends FilterTestCase {     /**      * @var \DMS\Filter\Filter      */     protected $filter;     public function setUp()     {         parent::setUp();         $this->filter = new Filter($this->buildMetadataFactory(), new FilterLoader());     }     public function tearDown()     {         parent::tearDown();     }In PHP, some very useful functions are open source and very convenient to prevent your website from various attacks, such as SQL injection attacks, XSS (Cross Site Scripting: Cross-site scripting) attacks, etc. So there is this very easy-to-use annotation-based PHP filtering library.

    Other libraries14392017-12-14
  • Laravel is a simple and elegant PHP Web development framework (PHP Web Framework). It can free you from messy codes like noodles; it can help you build a perfect network APP, and every line of code can be concise and expressive. Laravel already has an advanced PHP ActiveRecord implementation -- Eloquent ORM. It can easily apply "constraints" to both sides of the relationship, so that you have complete control over the data and enjoy all the conveniences of ActiveRecord. Eloquent natively supports all methods of the query builder (query-builder) in Fluent. <?php namespace Illuminate\Tests\Support; use stdClass; use ArrayAccess; use Mockery as m; use ReflectionClass; use JsonSerializable; use PHPUnit\Framework\TestCase; use Illuminate\Support\Collection; use Illuminate\Contracts\Support\Jsonable; use Illuminate\Contracts\Support\Arrayable; class SupportCollectionTest extends TestCase {     public function testFirstReturnsFirstItemInCollection()     {         $c = new Collection(['foo', 'bar']);         $this->assertEquals('foo', $c->first());     }

    Other libraries15812017-12-14
  • <?php class FileInfoTest extends PHPUnit_Framework_TestCase {     protected $fileWithExtension;     protected $fileWithoutExtension;     public function setUp()     {         $this->fileWithExtension = new \Upload\FileInfo(dirname(__FILE__) . '/assets/foo.txt', 'foo.txt');         $this->fileWithoutExtension = new \Upload\FileInfo(dirname(__FILE__) . '/assets/foo_wo_ext', 'foo_wo_ext');     }The PHP upload mechanism of this library is completely encapsulated. Its implementation process is as followsUPLOAD the file to the temporary directory?>Use move_uploadde_file() to the specified directoryThis is the PHP upload process, or you can perform some verification in the middle. For example, determine whether the document is submitted through upload, or whether the file extension is allowed by us

    Other libraries10972017-12-14
  • <?php /**  * This file is part of the Hal library  * (c) Ben Longden <ben@nocarrier.co.uk  * For the full copyright and license information, please view the LICENSE  * file that was distributed with this source code.  * @package Nocarrier  */ namespace Nocarrier; class Hal {     protected $uri;Hypertext expression language is hypertext markup language. Hypertext Markup Language is an application under the Standard Universal Markup Language. It is also a specification and a standard. It uses markup symbols to mark various parts of the web page to be displayed. The web page file itself is a text file. By adding tags to the text file, you can tell the browser how to display the content (such as how to process text, how to arrange pictures, how to display pictures, etc.). The browser reads the web page files in order, and then interprets and displays the marked content according to the tags. The error will not be pointed out for wrongly written tags, and the interpretation and execution process will not be stopped. The compiler can only analyze the cause of the error through the display effect. and error location. However, it should be noted that different browsers may have different interpretations of the same tag, and thus may have different display effects.

    Other libraries13242017-12-14
  • <?php /*  * This file is part of Hashids.  * (c) Ivan Akimov <ivan@barreleye.com>  * For the full copyright and license information, please view the LICENSE  * file that was distributed with this source code.  */ namespace Hashids; use RuntimeException; /**  * This is the math class.  * @author Vincent Klaiber <hello@vinkla.com>  * @author Jakub Kramarz <lenwe@lenwe.net>  */ class Math {     /**      * Add two arbitrary-length integers.      * @param string $a      * @param string $b      * @throws \RuntimeException      * @return string      */     public static function add($a, $b)     {         if (function_exists('gmp_add')) {             return gmp_add($a, $b);         }         if (function_exists('bcadd')) {             return bcadd($a, $b, 0);         }         throw new RuntimeException('Missing BC Math or GMP extension.');     }A string or string (String) is a string of characters composed of numbers, letters, and underscores. Generally recorded as s=“a1a2···an” (n>=0). It is a data type that represents text in programming languages. In programming, a string is a continuous sequence of symbols or values, such as a symbol string (a string of characters) or a binary digit string (a string of binary digits). Usually the entire string is used as the operation object, such as: finding a substring in the string, obtaining a substring, inserting a substring at a certain position in the string, deleting a substring, etc. The necessary and sufficient conditions for two strings to be equal are: the lengths are equal, and the characters at each corresponding position are equal. Assume that p and q are two strings. The operation of finding the position where q first appears in p is called pattern matching. The two most basic storage methods of strings are sequential storage and linked storage.

    Other libraries20292017-12-14
  • This is a form data validation class implemented through a piece of PHP code. It is a very easy-to-use and convenient form data validation class<?php //验证类 class Fun{         function isEmpty($val)   {     if (!is_string($val)) return false; //是否是字符串类型        if (empty($val)) return false; //是否已设定        if ($val=='') return false; //是否为空     return true;          }

    Other libraries12272017-12-14