Home > Download >  Library download

  • <?php declare(strict_types=1); namespace tests; use Phpml\Classification\SVC; use Phpml\FeatureExtraction\TfIdfTransformer; use Phpml\FeatureExtraction\TokenCountVectorizer; use Phpml\Pipeline; use Phpml\Preprocessing\Imputer; use Phpml\Preprocessing\Imputer\Strategy\MostFrequentStrategy; use Phpml\Preprocessing\Normalizer; use Phpml\Regression\SVR; use Phpml\Tokenization\WordTokenizer; use PHPUnit\Framework\TestCase; class PipelineTest extends TestCase {     public function testPipelineConstruction(): void     {         $transformers = [             new TfIdfTransformer(),         ];         $estimator = new SVC();         $pipeline = new Pipeline($transformers, $estimator);         $this->assertEquals($transformers, $pipeline->getTransformers());         $this->assertEquals($estimator, $pipeline->getEstimator());     }A machine is a device assembled from various metal and non-metal parts. It consumes energy and can operate and perform work. It is used to replace human labor, perform energy conversion, information processing, and produce useful work. Machines have been present throughout human history. But the real "machine" in modern times was gradually invented after the Western Industrial Revolution.

    Other libraries30602017-12-23
  • <?php namespace Flexihash\Hasher; /**  * Uses CRC32 to hash a value into a signed 32bit int address space.  * Under 32bit PHP this (safely) overflows into negatives ints.  *  * @author Paul Annesley  * @license http://www.opensource.org/licenses/mit-license.php  */ class Crc32Hasher implements HasherInterface {     public function hash($string)     {         return crc32($string);     } }Hash, generally translated as "hash", but also directly transliterated as "hash", is to convert input of any length (also called pre-mapping, pre-image) into a fixed length through a hash algorithm The output is the hash value. This conversion is a compressed mapping, that is, the space of hash values ​​is usually much smaller than the space of inputs. Different inputs may hash into the same output, so it is impossible to uniquely determine the input value from the hash value. Simply put, it is a function that compresses a message of any length into a message digest of a fixed length. HASH function (computer algorithm field)

    Other libraries17882017-12-23
  • <?php namespace Ricoa\CopyWritingCorrect; use Ricoa\CopyWritingCorrect\Correctors\CharacterCorrector; use Ricoa\CopyWritingCorrect\Correctors\ProperNounsCorrector; use Ricoa\CopyWritingCorrect\Correctors\SpaceCorrector; class CopyWritingCorrectService{ protected $corrects=[         ProperNounsCorrector::class,         CharacterCorrector::class,         SpaceCorrector::class,     ];     /**      * @param array $corrects      */     public function resetCorrectors(array $corrects)     {         $this->corrects=$corrects;     } Unifies the related usage of Chinese copywriting and typesetting, reduces communication costs between team members, and enhances the temperament of the website.

    Other libraries18312017-12-23
  • <?php namespace BotMan\BotMan; use React\Socket\Server; use BotMan\BotMan\Http\Curl; use React\EventLoop\LoopInterface; use BotMan\BotMan\Cache\ArrayCache; use BotMan\BotMan\Drivers\DriverManager; use BotMan\BotMan\Interfaces\CacheInterface; use Symfony\Component\HttpFoundation\Request; use BotMan\BotMan\Interfaces\StorageInterface; use BotMan\BotMan\Storages\Drivers\FileStorage; class BotManFactory {     private static $extensions = [];     /**      * @param $methodName      * @param $callable      */     public static function extend($methodName, $callable)     {         self::$extensions[$methodName] = $callable;     }This is a library for making chatbots. Friends who are interested can download and use

    Other libraries29952017-12-23
  • <?php /**  * @link      http://github.com/zendframework/zend-cache for the canonical source repository  * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)  * @license   http://framework.zend.com/license/new-bsd New BSD License  */ namespace Zend\Cache; class ConfigProvider {     /**      * Return default configuration for zend-cache.      *      * @return array      */     public function __invoke()     {         return [             'dependencies' => $this->getDependencyConfig(),         ];     }     /**      * Return default service mappings for zend-cache.      *      * @return array      */     public function getDependencyConfig()     {         return [             'abstract_factories' => [                 Service\StorageCacheAbstractServiceFactory::class,             ],             'factories' => [                 PatternPluginManager::class => Service\PatternPluginManagerFactory::class,                 Storage\AdapterPluginManager::class => Service\StorageAdapterPluginManagerFactory::class,                 Storage\PluginManager::class => Service\StoragePluginManagerFactory::class,             ],         ];     } }When everyone uses PHP, a very important point will be taken into consideration, which is security. So, today we will introduce to you the verification class library, the primary measure to ensure PHP security. Data verification is the most important habit you may adopt. And when it comes to input, it's very simple: don't trust the user. When validating data to secure PHP, remember that it's often easier to design and validate the values ​​your application allows than to protect against all unknown values.

    caching library48332017-12-22
  • <?php namespace Cake\Validation; use ReflectionClass; class RulesProvider {     /**      * The class/object to proxy.      *      * @var mixed      */     protected $_class;     /**      * The proxied class' reflection      *      * @var \ReflectionClass      */     protected $_reflection;     /**      * Constructor, sets the default class to use for calling methods      *      * @param string $class the default class to proxy      */     public function __construct($class = '\Cake\Validation\Validation')     {         $this->_class = $class;         $this->_reflection = new ReflectionClass($class);     }We know that in the process of using the language, we will definitely pay attention to the security issues in the actual development process. So, today we will introduce to you the verification class library, the primary measure to ensure PHP security. Data verification is the most important habit you may adopt. And when it comes to input, it's very simple: don't trust the user. When validating data to secure PHP, remember that it's often easier to design and validate the values ​​your application allows than to protect against all unknown values.

    Data validation library47832017-12-22
  • <?php namespace Illuminate\Validation; use Illuminate\Contracts\Validation\Rule as RuleContract; class ClosureValidationRule implements RuleContract {     public $callback;     public $failed = false;     public $message;     /**      * Create a new Closure based validation rule.      *      * @param  \Closure  $callback      * @return void      */     public function __construct($callback)     {         $this->callback = $callback;     }We know that in the process of using the language, we will definitely pay attention to the security issues in the actual development process. You need to go to our class library to verify data. Validation of data is the most important habit you can adopt. And when it comes to input, it's very simple: don't trust the user. When validating data to secure PHP, remember that it's often easier to design and validate the values ​​your application allows than to protect against all unknown values.

    Data validation library47132017-12-22
  • <?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');     }     public function testConstructor()     {         $this->assertAttributeEquals('foo', 'name', $this->fileWithExtension);         $this->assertAttributeEquals('txt', 'extension', $this->fileWithExtension);         $this->assertAttributeEquals('foo_wo_ext', 'name', $this->fileWithoutExtension);         $this->assertAttributeEquals('', 'extension', $this->fileWithoutExtension);     }We know that in the process of using the language, we will definitely pay attention to the security issues in the actual development process. So, today we will introduce to you the primary measure to ensure PHP security-verification data. Validation of data is the most important habit you can adopt. And when it comes to input, it's very simple: don't trust the user. When validating data to secure PHP, remember that it's often easier to design and validate the values ​​your application allows than to protect against all unknown values. General validation tips that apply to various types of validation data are listed below: 1. Use values ​​from the whitelist2. Always re-validate limited options3. Use the built-in escape function4. Verify that the correct data type (such as a number)The value in the white-listed value (White-listed value) is the correct value , as opposed to an invalid blacklist value (Black-listed value). The difference between the two is that typically when validating data, the list or range of possible values ​​is smaller than the list or range of invalid values, many of which may be unknown or unexpected values.

    Data validation library40862017-12-22
  • <?php /*  * This file is part of SwiftMailer.  * (c) 2004-2009 Chris Corbyn  *  * For the full copyright and license information, please view the LICENSE  * file that was distributed with this source code.  */ require __DIR__.'/classes/Swift.php'; Swift::registerAutoload(function () {     // Load in dependency maps     require __DIR__.'/dependency_maps/cache_deps.php';     require __DIR__.'/dependency_maps/mime_deps.php';     require __DIR__.'/dependency_maps/message_deps.php';     require __DIR__.'/dependency_maps/transport_deps.php';     // Load in global library preferences     require __DIR__.'/preferences.php'; });This library has the same function as phpmailer, but its performance is better than phpmailer, especially in the ability to process attachments, and the probability of sending emails successfully is also high

    Other libraries27522017-12-22
  • <?php /*  * This file is part of the Stash package.  *  * (c) Robert Hafner <tedivm@tedivm.com>  *  * For the full copyright and license information, please view the LICENSE  * file that was distributed with this source code.  */ spl_autoload_register(function ($class) {     $base = '/src/';     if (strpos($class, 'Stash\Test') === 0) {         $base = '/tests/';     }     $file = __DIR__.$base.strtr($class, '\', '/').'.php';     if (file_exists($file)) {         require $file;         return true;     } });Why should we cache query results? Caching query results can greatly improve script execution time and resource requirements. Caching SQL query results also allows you to post-process the data. If you use file caching to store the output of all scripts (the normal method of HTML is very resource-intensive and adversely affects the performance of the script). This can only be reconciled by the large amount of returned data obtained and the location of the database server. .Although continuous connections can improve the load when connecting to the database, it consumes very memory resources. If a large amount of data is obtained, the entire storage time will be very short. Therefore, the StashPHP caching library is specifically designed to solve this caching problem in PHP.

    caching library48522017-12-22
  • <?php if (!isset($argv[1]) || $argv[1] === '-h' || $argv[1] === '--help') { echo 'usage: php ' . $argv[0] . ' <version> <stability>' . PHP_EOL; echo PHP_EOL; echo '    version:' . PHP_EOL; echo '        Version of the package, in the form of major.minor.bug' . PHP_EOL; echo PHP_EOL; echo '    stability:' . PHP_EOL; echo '        One of alpha, beta, stable' . PHP_EOL; die(); } if (!isset($argv[2])) { die('You must provide the stability (alpha, beta, or stable)'); } $context = array( 'date'          => gmdate('Y-m-d'), 'time'          => gmdate('H:m:00'), 'version'       => $argv[1], 'api_version'   => $argv[1], 'stability'     => $argv[2], 'api_stability' => $argv[2], );Requests-1.7.0HTTP library is a PHP HTTP class library. Compared with libraries such as cURL, it has a simple, easy-to-use and friendly API and does not depend on cURL. It supports methods such as HEAD, GET, POST, PUT, DELETE and PATCH, and can basically satisfy any form of HTTP request. Requests does not depend on any extensions outside the PHP standard library. The only requirement is the PHP5.2 version. But if PHP's cURL is available, Requests will use it first, otherwise it will use socket.

    Other libraries25542017-12-22
  • <?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());     }     public function testFirstWithCallback()     {         $data = new Collection(['foo', 'bar', 'baz']);         $result = $data->first(function ($value) {             return $value === 'bar';         });         $this->assertEquals('bar', $result);     }PHP's Laravel collection library is a library for obtaining a collection. A collection is equivalent to a table.

    Other libraries19152017-12-22