forked from lino/radar-wp
Initial import.
This commit is contained in:
commit
86383280c9
428 changed files with 68738 additions and 0 deletions
20
vendor/guzzle/http/Guzzle/Http/QueryAggregator/CommaAggregator.php
vendored
Normal file
20
vendor/guzzle/http/Guzzle/Http/QueryAggregator/CommaAggregator.php
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace Guzzle\Http\QueryAggregator;
|
||||
|
||||
use Guzzle\Http\QueryString;
|
||||
|
||||
/**
|
||||
* Aggregates nested query string variables using commas
|
||||
*/
|
||||
class CommaAggregator implements QueryAggregatorInterface
|
||||
{
|
||||
public function aggregate($key, $value, QueryString $query)
|
||||
{
|
||||
if ($query->isUrlEncoding()) {
|
||||
return array($query->encodeValue($key) => implode(',', array_map(array($query, 'encodeValue'), $value)));
|
||||
} else {
|
||||
return array($key => implode(',', $value));
|
||||
}
|
||||
}
|
||||
}
|
22
vendor/guzzle/http/Guzzle/Http/QueryAggregator/DuplicateAggregator.php
vendored
Normal file
22
vendor/guzzle/http/Guzzle/Http/QueryAggregator/DuplicateAggregator.php
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace Guzzle\Http\QueryAggregator;
|
||||
|
||||
use Guzzle\Http\QueryString;
|
||||
|
||||
/**
|
||||
* Does not aggregate nested query string values and allows duplicates in the resulting array
|
||||
*
|
||||
* Example: http://test.com?q=1&q=2
|
||||
*/
|
||||
class DuplicateAggregator implements QueryAggregatorInterface
|
||||
{
|
||||
public function aggregate($key, $value, QueryString $query)
|
||||
{
|
||||
if ($query->isUrlEncoding()) {
|
||||
return array($query->encodeValue($key) => array_map(array($query, 'encodeValue'), $value));
|
||||
} else {
|
||||
return array($key => $value);
|
||||
}
|
||||
}
|
||||
}
|
27
vendor/guzzle/http/Guzzle/Http/QueryAggregator/PhpAggregator.php
vendored
Normal file
27
vendor/guzzle/http/Guzzle/Http/QueryAggregator/PhpAggregator.php
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace Guzzle\Http\QueryAggregator;
|
||||
|
||||
use Guzzle\Http\QueryString;
|
||||
|
||||
/**
|
||||
* Aggregates nested query string variables using PHP style []
|
||||
*/
|
||||
class PhpAggregator implements QueryAggregatorInterface
|
||||
{
|
||||
public function aggregate($key, $value, QueryString $query)
|
||||
{
|
||||
$ret = array();
|
||||
|
||||
foreach ($value as $k => $v) {
|
||||
$k = "{$key}[{$k}]";
|
||||
if (is_array($v)) {
|
||||
$ret = array_merge($ret, self::aggregate($k, $v, $query));
|
||||
} else {
|
||||
$ret[$query->encodeValue($k)] = $query->encodeValue($v);
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
22
vendor/guzzle/http/Guzzle/Http/QueryAggregator/QueryAggregatorInterface.php
vendored
Normal file
22
vendor/guzzle/http/Guzzle/Http/QueryAggregator/QueryAggregatorInterface.php
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace Guzzle\Http\QueryAggregator;
|
||||
|
||||
use Guzzle\Http\QueryString;
|
||||
|
||||
/**
|
||||
* Interface used for aggregating nested query string variables into a flattened array of key value pairs
|
||||
*/
|
||||
interface QueryAggregatorInterface
|
||||
{
|
||||
/**
|
||||
* Aggregate multi-valued parameters into a flattened associative array
|
||||
*
|
||||
* @param string $key The name of the query string parameter
|
||||
* @param array $value The values of the parameter
|
||||
* @param QueryString $query The query string that is being aggregated
|
||||
*
|
||||
* @return array Returns an array of the combined values
|
||||
*/
|
||||
public function aggregate($key, $value, QueryString $query);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue