首页 > 下载 >  类库下载

  • <?php /**  * Upload  *  * @author      Josh Lockhart <info@joshlockhart.com>  * @copyright   2012 Josh Lockhart  * @link        http://www.joshlockhart.com  * @version     2.0.0  *  * MIT LICENSE  *  * Permission is hereby granted, free of charge, to any person obtaining  * a copy of this software and associated documentation files (the  * "Software"), to deal in the Software without restriction, including  * without limitation the rights to use, copy, modify, merge, publish,  * distribute, sublicense, and/or sell copies of the Software, and to  * permit persons to whom the Software is furnished to do so, subject to  * the following conditions:  *  * The above copyright notice and this permission notice shall be  * included in all copies or substantial portions of the Software.  *  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */ namespace Upload; /**  * FileInfo Interface  *  * @author  Josh Lockhart <info@joshlockhart.com>  * @since   2.0.0  * @package Upload  */ interface FileInfoInterface {     public function getPathname();     public function getName();     public function setName($name);     public function getExtension();     public function setExtension($extension);     public function getNameWithExtension();     public function getMimetype();     public function getSize();     public function getMd5();     public function getDimensions();     public function isUploadedFile(); } File Upload 是一款非常强大的文件上传处理插件,支持多文件上传,拖拽上传,进度条,文件验证及图片音视频预览,跨域上传等等。可以说你能想到的功能它都有。你没想到的功能它也有。。不过由于功能太强大,使用起来还是需要点基本功,否则调试开发会遇到困难。

    其它类库62152017-12-21
  • <?php if(php_sapi_name() !== "cli") { echo "<p>Run this php script from the command line to see CLI syntax highlighting and formatting.  It support Unix pipes or command line argument style.</p>"; echo "<pre><code>php examples/cli.php \"SELECT * FROM MyTable WHERE (id>5 AND \`name\` LIKE \&quot;testing\&quot;);\"</code></pre>"; echo "<pre><code>echo \"SELECT * FROM MyTable WHERE (id>5 AND \`name\` LIKE \&quot;testing\&quot;);\" | php examples/cli.php</code></pre>"; } if(isset($argv[1])) { $sql = $argv[1]; } else { $sql = stream_get_contents(fopen("php://stdin", "r")); } require_once(__DIR__.'/../lib/SqlFormatter.php'); echo SqlFormatter::format($sql);SQL即结构化查询语言(Structured Query Language),是一种特殊目的的编程语言,是一种数据库查询和程序设计语言,用于存取数据以及查询、更新和管理关系数据库系统;同时也是数据库脚本文件的扩展名。SQL语句无论是种类还是数量都是繁多的,很多语句也是经常要用到的,SQL查询语句就是一个典型的例子,无论是高级查询还是低级查询,SQL查询语句的需求是最频繁的。

    其它类库23232017-12-21
  • <?php namespace PhpUnitsOfMeasure; /**  * Physical quantities with this trait  * have units which are metric and therefore have  * a standard set of prefixes.  */ trait HasSIUnitsTrait {     protected static function addMissingSIPrefixedUnits(         UnitOfMeasure $siUnit,         $toBaseSiUnitFactor,         $namePattern,         array $aliasPatterns = []     ) {         /**          * The standard set of SI prefixes          */         $siPrefixes = [             [                 'abbr_prefix' => 'Y',                 'long_prefix' => 'yotta',                 'factor'      => 1e24             ],             [测量是按照某种规律,用数据来描述观察到的现象,即对事物作出量化描述。测量是对非量化实物的量化过程。在机械工程里面,测量指将被测量与具有计量单位的标准量在数值上进行比较,从而确定二者比值的实验认识过程。

    其它类库16442017-12-21
  • <?php ini_set('display_errors', 1); error_reporting(E_ALL ^ E_NOTICE); use Crisu83\Conversion\Quantity\DigitalInformation\DigitalInformation; use Crisu83\Conversion\Quantity\Length\Length; use Crisu83\Conversion\NumberBase\NumberBase; use Crisu83\Conversion\Size\HatSize\HatSize; use Crisu83\Conversion\Size\ShoeSize\ChildShoeSize; use Crisu83\Conversion\Quantity\Length\Unit as LengthUnit; use Crisu83\Conversion\Quantity\DigitalInformation\Unit as DIUnit; use Crisu83\Conversion\Size\HatSize\System as HatSizeSystem; use Crisu83\Conversion\Size\ShoeSize\System as ShoeSizeSystem; require(dirname(__DIR__) . '/vendor/autoload.php'); $length = new Length(1, LengthUnit::METRE); echo $length . '<br>'; echo $length->add(1, LengthUnit::FOOT) . '<br>'; echo $length->add(5)->sub(2, LengthUnit::FOOT) . '<br>'; echo $length->to(LengthUnit::YARD) . '<br>'; echo '<br>';测量是按照某种规律,用数据来描述观察到的现象,即对事物作出量化描述。测量是对非量化实物的量化过程。在机械工程里面,测量指将被测量与具有计量单位的标准量在数值上进行比较,从而确定二者比值的实验认识过程。

    其它类库15962017-12-21
  • <?php require_once(__DIR__ . '/../vendor/autoload.php'); // Let's consider some really basic examples. echo '<pre>'; // Adding up elements in an array. But wait! First we need an array... // Let's get a random sample of 50 values, in the range 0, 100. $random = NumbersPHP\Statistic::randomSample(0, 100, 50); echo 'Random = {' . implode(', ', $random) . "}\n"; // Add them up... $sum = NumbersPHP\Basic::sum($random); echo 'Sum of Random = ' . $sum . "\n"; // We can do some other cool stuff as well. Like find the GCD between // two integers. $gcd = NumbersPHP\Basic::gcd(100, 10); echo 'GCD amongst 100 and 10 = ' . $gcd; echo '</pre>';如果你需要处理很多条数字数据,那么你一定能用得到本库。

    其它类库16132017-12-21
  • <?php if( file_exists(dirname(__FILE__).'/nicejson/nicejson.php') ) { include_once dirname(__FILE__).'/nicejson/nicejson.php'; } require_once dirname(__FILE__).'/../Mobile_Detect.php'; $detect = new Mobile_Detect; $json = array( // The current version of Mobile Detect class that // is being exported. 'version' => $detect->getScriptVersion(), // All headers that trigger 'isMobile' to be 'true', // before reaching the User-Agent match detection. 'headerMatch' => $detect->getMobileHeaders(), // All possible User-Agent headers. 'uaHttpHeaders' => $detect->getUaHttpHeaders(), // All the regexes that trigger 'isMobile' or 'isTablet' // to be true. 'uaMatch' => array( // If match is found, triggers 'isMobile' to be true. 'phones'   => $detect->getPhoneDevices(), // Triggers 'isTablet' to be true. 'tablets'  => $detect->getTabletDevices(), // If match is found, triggers 'isMobile' to be true. 'browsers' => $detect->getBrowsers(), // If match is found, triggers 'isMobile' to be true. 'os'       => $detect->getOperatingSystems(), // Various utilities. To be further discussed. 'utilities' => $detect->getUtilities() ) );字符串主要用于编程,概念说明、函数解释、用法详述见正文,这里补充一点:字符串在存储上类似字符数组,所以它每一位的单个元素都是可以提取的,如s=“abcdefghij”,则s[1]=“a”,s[10]="j",而字符串的零位正是它的长度,如s[0]=10(※上述功能Ansistring没有。),这可以给我们提供很多方便,如高精度运算时每一位都可以转化为数字存入数组。

    其它类库15882017-12-21
  • <?php use \mageekguy\atoum; define('COVERAGE_TITLE', 'MetaYaml'); define('COVERAGE_DIRECTORY', './web/coverage'); define('COVERAGE_WEB_PATH', 'http://localhost/meta-yaml/coverage'); if(false === is_dir(COVERAGE_DIRECTORY)) {     mkdir(COVERAGE_DIRECTORY, 0777, true); } $script->addTestAllDirectory(__DIR__ . '/test'); $stdOutWriter = new atoum\writers\std\out(); $coverageField = new atoum\report\fields\runner\coverage\html(COVERAGE_TITLE, COVERAGE_DIRECTORY); $coverageField->setRootUrl(COVERAGE_WEB_PATH); $cliReport = new atoum\reports\realtime\cli(); $cliReport     ->addWriter($stdOutWriter)     ->addField($coverageField, array(atoum\runner::runStop)) ; $runner->setBootstrapFile('test/bootstrap.php'); $runner->addReport($cliReport);AML是“另一种标记语言”的外语缩写;但为了强调这种语言以数据做为中心,而不是以置标语言为重点,而用返璞词重新命名。它是一种直观的能够被电脑识别的数据序列化格式,是一个可读性高并且容易被人类阅读,容易和脚本语言交互,用来表达资料序列的编程语言。它是类似于标准通用标记语言的子集XML的数据描述语言,语法比XML简单很多。

    其它类库15552017-12-21
  • <?php error_reporting(E_ALL | E_STRICT); // Ensure that composer has installed all dependencies if (!file_exists(dirname(__DIR__) . DIRECTORY_SEPARATOR . '/vendor/autoload.php')) {     die("Dependencies must be installed using composer:\n\nphp composer.phar install --dev\n\n"         . "See http://getcomposer.org for help with installing composer\n"); } // Include the Composer autoloader $loader = include realpath(dirname(__FILE__) . '/../vendor/autoload.php');网上看到有人提到这么一个需求,将十六进制数‘00e0b509f6259df8642dbc35662901477df22677ec152b5ff68ace615bb7b725152b3ab17a876aea8a5aa76d2e417629ec4ee341f56135fccf695280104e0312ecbda92557c93870114af6c9d05c4f7f0c3685b7a46bee255932575cce10b424d813cfe4875d3e82047b97ddef52741d546b8e289dc6935b3ece0462db0a22b8e7’转换成十进制,这么一个超大的数字,如果使用正常的hexdec()方法来解,结果为1.5779475026713E 308,数据严重丢失精度。所以就会用到我们这个math-master处理大数字的PHP库,有需要的朋友可以下载使用。

    其它类库20272017-12-21
  • <?php namespace libphonenumber; /**  * Class AsYouTypeFormatter  * A formatter which formats phone numbers as they are entered.  *  * An AsYouTypeFormatter instance can be created by invoking PhoneNumberUtil::getAsYouTypeFormatter().  * After that, digits can be added by invoking inputDigit() on the formatter instance, and the partially  * formatted phone number will be returned each time a digit is added. clear() can be invokved before  * formatting a new number.  */ class AsYouTypeFormatter {     /**      * @var string      */     private $currentOutput;     /**      * @var string      */     private $formattingTemplate;     /**      * The pattern from numberFormat that is currently used to create formattingTemplate.      * @var string      */     private $currentFormattingPattern;     /**      * @var string      */     private $accruedInput;本库可以对电话号码的数据库进行处理。

    其它类库21862017-12-21
  • <?php namespace Hashids; class Hashids implements HashidsInterface {     const SEP_DIV = 3.5;     const GUARD_DIV = 12;     /**      * The alphabet string.      *      * @var string      */     protected $alphabet;     /**      * The seps string.      *      * @var string      */     protected $seps = 'cfhistuCFHISTU';     /**      * The guards string.      *      * @var string      */     protected $guards;本库是让整数生成唯一字符串的加密库,可以隐藏用户ID等多种用途。

    其它类库21472017-12-21
  • <?php namespace Nocarrier; class Hal {     protected $uri;     protected $data;      protected $resources = array();     protected $links = null;     protected $arrayLinkRels = array();     protected $arrayResourceRels = array();     protected $shouldStripAttributes = true;HAL库在结构上,对每个外设抽象成了一个称为ppp_HandleTypeDef的结构体,其中ppp就是每个外设的名字。所有的函数都是工作在ppp_HandleTypeDef指针之下。   1. 多实例支持:每个外设/模块实例都有自己的句柄。 因此,实例资源是独立的   2. 外围进程相互通信:该句柄用于管理进程例程之间的共享数据资源。 

    其它类库10992017-12-21
  • <?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]));PHP 过滤器用于验证和过滤来自非安全来源的数据,比如用户的输入。什么是 PHP 过滤器?PHP 过滤器用于验证和过滤来自非安全来源的数据。验证和过滤用户输入或自定义数据是任何 Web 应用程序的重要组成部分。设计 PHP 的过滤器扩展的目的是使数据过滤更轻松快捷。为什么使用过滤器?几乎所有 web 应用程序都依赖外部的输入。这些数据通常来自用户或其他应用程序(比如 web 服务)。通过使用过滤器,您能够确保应有程序获得正确的输入类型。您应该始终对外部数据进行过滤!

    其它类库14342017-12-21