Releases: gebn/Crackle
Crackle v2.6.0
This release includes two important bug fixes and several tweaks. It is largely compatible with previous releases of Crackle, however users of POSTFile
or PUTFile
will need to update these namespaces and use the renamed method (see below).
Improvements
- Switched to semantic versioning.
\Crackle\Response::writeTo()
can now be passed a single file path to write the response to. Additionally, if a permission error occurs, the relevant path is now included in the exception message.- Added Composer autoloader.
Changes
- Moved
POSTFile
andPUTFile
into a new\Crackle\Requests\Files
namespace. - Renamed
\Crackle\Requests\Files\File::factory()
tofromPath()
to be more descriptive. - Tweaked
\Crackle\Requests\Files\PUTFile
to always use memory for temporary files, regardless of size (previous limit was 1 MiB before being moved tosys_get_temp_dir()
). - Increased the number of concurrent requests issued by the
ChanThreadDownloader
example from 10 to 20.
Bug fixes
- Fixed class not found error if a dependency was unsatisfied.
- Fixed
\Crackle\Response::writeTo()
failing if a filename was not passed and one couldn't be determined from the request. It will now throw\Crackle\Exceptions\IOException
under these circumstances. - Fixed incorrect PHPDoc array notation.
- Fixed various typos in documentation.
Crackle v2.5
This is a minor release of Crackle that includes a major breaking change.
Improvements
- Added a string generator example using RANDOM.ORG's truly random generator.
Changes
- The
getContent()
method in\Crackle\Response
has been renamed togetBody()
. Apart from this, it functions in exactly the same way.
Crackle v2.4
This is a general release that is fully compatible with Crackle v2.3.
Improvements
- Is is now possible to set the raw POST data of a request using the new
setContent()
method. If both it and the fields mechanism are used, this takes priority. - Enhanced parsing of header values spanning multiple lines. To be more in line with the standard, each line of a value is now joined with a single space, with newline characters removed.
- Added an
import()
convenience method toCrackle\Requests\Fields\Fields
for specifying multiple fields at once from an array. Keys are interpreted as field names, and their corresponding values (which can be arrays) become the value sent under that name. - Various minor improvements to tidy up convoluted logic and remove unreachable code.
Changes
Crackle\Requests\GETRequest
'sgetUrl()
method now haspublic
visibility. You can now build a request, and see what URL it will be sent to, including any GET parameters added.- Updated
ChanThreadDownloader.php
to accept the new 4Chan URL format. Also added memory statistics to output.
Crackle v2.3
This release introduces a breaking change: requests now throw a RequestException
on failure. See the updated README for details on how to modify existing code.
Changes
fire()
is now called implicitly whengetResponse()
is called for the first time on a request. Code like the following is now perfectly legal:
$request = new GETRequest('google.co.uk');
echo $request->getResponse()->getContent();
- Changed
fire()
to throw\Crackle\Exceptions\RequestException
if the request fails. Any registered callback will be executed prior to this. This only affects cases wherefire()
was being called manually -Requester
usage is unchanged.
Crackle v2.2
This is a maintenance release incorporating several minor bug fixes. It is fully compatible with all 2.x releases of Crackle.
Improvements
- Added and enhanced the clarity of documentation.
- Made code formatting more consistent.
Changes
\Crackle\Requester
: reduced the defaultparallelLimit
from 40 to 20. This change can be overridden by manually specifying the parallel limit when creating a newRequester
instance, e.g.new Requester(40)
.
Bug fixes
- Fixed PHP notices being emitted from
\Crackle\Requests\Fields\Parameters
if Crackle was given a URL without a scheme or host. This happened in any of the following scenarios:google.co.uk
(no scheme)http://192.168.1.1/file.txt
(no host)192.168.1.1/file.txt
(no scheme or host)
- Fixed a bug in
\Crackle\Requester
where if the callback of the last request in the queue queued any more requests, they would not be executed due to the cURL multi-handle exiting prematurely. - Fixed old documentation in
\Crackle\Exceptions\ValidationException
.
Crackle v2.1
This release adds support for Composer. It does not contain any code changes.
Put the following in composer.json
to add Crackle to a new project:
{
"require": {
"crackle/crackle": ">=v2.1"
}
}
Crackle v2.0
This is easily the biggest release since v1.0, incorporating many improvements. As a result, it is unfortunately not backwards compatible with 1.x releases of Crackle.
Improvements
- Major improvements to
README.md
. Examples are now more detailed with additional notes, and they progress in a more logical way. - Overhauled field management. There are now abstractions for dealing with GET parameters, POST variables and POST files. The mechanism for nesting arrays within these is also much more intuitive.
- Refactored the exceptions hierarchy and improved quality of error messages. Check method documentation for specific details.
Changes
\Crackle\GETRequest
: RenamedisError()
tofailed()
, to be consistent withsucceeded()
.- Crackle now checks the response headers for a file name before falling back to the URL.
Bug fixes
\Crackle\Requests\Files\PUTFile
: Fixed a bug where the internal memory stream was not closed on destruct.- Fixed all cases where documentation contained erroneous namespaces.
Crackle v1.3
Improvements
- Added validation to pick up basic errors (e.g. sending a
PUT
request without a file). - Added
succeeded()
convenience method to\Crackle\Request
. Logic likeif(!$request->isError()) { ... }
can now be changed to the nicerif($request->succeeded()) { ... }
.
Changes
\Crackle\Requester
:Exception
(rather thanCurlException
) is now thrown if the multi-handle goes into an error state.
Bug fixes
\Crackle\Request
: FixedisFired()
returning false if the request was fired but failed.
Crackle v1.2
Improvements
- Added
PUT
andDELETE
verbs.
Changes
- Renamed
getResponseCode()
togetStatusCode()
in\Crackle\Response
. \Crackle\Requester
: callingfireAll()
no longer shrinks the parallel limit to the size of the queue.
Bug fixes
- Fixed backslashes in include paths, which confused non-Windows environments.
- Fixed a namespace typo which confused the autoloader.
- Fixed warning if GET and HEAD request URLs were not supplied with a path.
Crackle v1.1
Improvements
- An autoloader that plays more nicely with others.
- Default port numbers for SOCKS5 and HTTP proxies.
- Made credential username and password setters public - no longer have to be specified in the constructor.
Bug fixes
- Call to parent method
addTo()
inSOCKS5Proxy