Releases: AnrDaemon/library-php
Release 1.14: Fixed Net\Browser initialization
Release 1.13.0.1: Typos are evil
- Fixed a typo in the docblock
Release 1.13: Added Simple PHP Template class.
The class is an implementation of an idea by Chad Minick.
Class interface inspired by Smarty.
Release 1.12: Net\Browser API stabilization
Release highlights
Net\Browser
basic API is stable and unlikely to change in the future;- Improved
CurlException
message construction; Net\Url
documentation improvements.
Net\Browser
Turned out, CURLOPT_HTTPGET
/CURLOPT_POST
/CURLOPT_PUT
is a request TYPE.
Yes, it implies default method name, but you can change it with CURLOPT_CUSTOMREQUEST
(a method NAME, which does not affect request TYPE).
CURLOPT_HTTPGET
performs a body-less request;CURLOPT_PUT
performs a request with body taken from stream resource;CURLOPT_POST
performs a request with body provided as value of a variable,
if the variable given as an array of values, it is further formatted
to conform to the [RFC 7578].
CurlException
After catching empty curl_error()
return on an obvious cURL error, it came to the realization, that curl_error()
returning an error message text, while curl_strerror(curl_errno())
returning textual equivalent of error code.
Net\Url
Improved documentation of some more obscure test cases and fixed typo(s).
Added Utility\Path wrapper class.
Utility\Path::info($path) - enhanced pathinfo() function.
- always returns all components;
- correctly report absence of extension for dot-files;
- adds missing dot to exceptions.
Utility\Path::normalize($path, …) - provides path normalization.
- handles both *NIX and Windows (X:...) style paths;
- handles leaking relative paths if explicitly allowed;
- tripping an exception if relative path is trying to escape itself;
- allows customizable output directory separator.
Major Net\Browser improvements
Net\Browser
- Added a (b)lo(a)t of docblocks to Net\Browser.
- Added __clone and __destruct handlers.
- Added HTTP PUT and custom request method implementations.
Sad but I can't make it any better than that. - Implemented ability to return basic request status as a single array.
- Fixed Net\Browser::setOpt to behave and report.
- Moved common request steps into a helper method.
Net\CurlOptions
- Added CurlOptions helper to better report errors.
Net\Url
- Repaired initial docblock, removing legacy behavior references.
- Used static $url in tests.
- Used assertEquals where applicable for better failure representation.
- Added PHPUnit v7 compatible exception trap.
Net\Url: Separated environment reconstructor.
Yes, this is a BC break. You gotta deal with it.
Some example replacement mappings are as follows:
new Net\Url; => Net\Url::fromHttp(["path" => null, "query" => null]);
(new Net\Url)->parse($_SERVER["REQUEST_URI"]); => Net\Url::fromHttp();
New Math namespace
Added Math\Point
class - ascended from Misc\Coordinate3D
class used to manipulate geometry points.
Added Math\GSeq
geometric sequence generator.
Welcome Net\Browser!
Added Net\Browser
- a thin (very thin!) wrapper over cURL extension.
Net\Browser
The aim of a class is to be a very, very, very lightweight OO wrapper on top of cURL extension, adding as little overhead, as practically possible, while maintaining usage consistency.
Currently implemented functionality:
GET
/POST
request methods.- Transparent session cookies handling.
- Transparent peer verification setup from existing OpenSSL extension configuration.
- Setting options, including batch setting via array.
- Easy retrieval of limited request status information via direct object property access.
Not yet implemented/waiting for implementation/potentially impossible to implement in a sane way
PUT
request method.- Custom request methods.
- Safe cloning and disposing of cURL handle.
Not going to be implemented within this class
curl_multi_*
features.curl_share_*
features.
Other changes in this release
- Split dev autoload.
- Code-unrelated tweaks.
- More
Net\Url
tests to cover known issues in PHP.
Release 1.6.5
Net\Url
: Fixed well-known ports dictionary reference.