tagadvance / gilligan
...
Installs: 47
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:project
Requires
- php: ^8.1
- ext-apcu: *
- ext-bcmath: *
- ext-spl: *
Requires (Dev)
- phpunit/phpunit: ^10.5.2
This package is auto-updated.
Last update: 2024-04-10 02:33:02 UTC
README
Gilligan
Gilligan is a collection of PHP utilities I have created or gathered over the course of my career.
Some of these components are or were "pet projects" that I worked on simply because I thought they would be fun to implement.
The design of some of these tools was heavily influenced by libraries like Apache Commons and Guava.
Download / Install
The easiest way to install Gilligan is via Composer:
composer require "tagadvance/gilligan:dev-master"
{ "require": { "tagadvance/gilligan": "dev-master" } }
Highlights
Standard Print Streams, e.g.
Standard::output()->printLine('foo'); // prints 'foo'
Java-like IO Streams, e.g.
$fileName = 'test.php'; $file = new File( $fileName ); $stream = new FileInputStream( $file ); try { $bytes = $stream->read($length = 5); Standard::output()->printLine($bytes); } finally { $stream->close(); } // prints '<?php'
Backward Compatible Session Handlers, e.g.
$defaultHandler = new \SessionHandler(); $pdo = new \PDO($dsn); $supplier = new EagerPDOSupplier($pdo); $mysqlHandler = new MySQLSessionHandler($supplier, $remoteAddress = 'localhost'); $cascadeHandler = new CascadeSessionHandler($mysqlHandler, $defaultHandler); SessionSaveHandler::register($cascadeHandler); session_start();
StringClass
, e.g.
$true = StringClass::valueOf('abcxyz')->startsWith('abc');