首頁 > 下載 >  類別庫下載

  • <?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