- GuzzleException
- SeekException
- TransferException
- RequestException (
RequestInterface;ResponseInterface|null)- TooManyRedirectsException
- ConnectException
- BadResponseException
- ServerException
- RequestException (
- ClientException
RequestInterface ; ResponseInterface | null )
| #!/bin/bash | |
| # Sign a file with a private key using OpenSSL | |
| # Encode the signature in Base64 format | |
| # | |
| # Usage: sign <file> <private_key> | |
| # | |
| # NOTE: to generate a public/private key use the following commands: | |
| # | |
| # openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048 | |
| # openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem |
| <?php | |
| namespace Fry; | |
| use JsonStreamingParser\Listener; | |
| /** | |
| * This implementation allows to process an object at a specific level | |
| * when it has been fully parsed | |
| */ | |
| class ObjectListener implements Listener | |
| { |
| <?php | |
| if (!function_exists('array_group_by')) { | |
| /** | |
| * Groups an array by a given key. | |
| * | |
| * Groups an array into arrays by a given key, or set of keys, shared between all array members. | |
| * | |
| * Based on {@author Jake Zatecky}'s {@link https://github.com/jakezatecky/array_group_by array_group_by()} function. | |
| * This variant allows $key to be closures. |
| $value = array( | |
| "deep"=>1, | |
| "data"=>null, | |
| "node"=>array( | |
| "deep"=>2, | |
| "data"=>null, | |
| "node"=>array( | |
| "deep"=>3 | |
| ) | |
| ), |
| /* | |
| ** client.c -- a stream socket client demo | |
| */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <errno.h> | |
| #include <string.h> | |
| #include <netdb.h> |
| <?php | |
| class ResumeDownload { | |
| private $file; | |
| private $name; | |
| private $boundary; | |
| private $delay = 0; | |
| private $size = 0; | |
| function __construct($file, $delay = 0) { | |
| if (! is_file($file)) { |
| <?php | |
| /** | |
| * A simple function that uses mtime to delete files older than a given age (in seconds) | |
| * Very handy to rotate backup or log files, for example... | |
| * | |
| * $dir String whhere the files are | |
| * $max_age Int in seconds | |
| * return String[] the list of deleted files | |
| */ |