-
-
-
-
__('VENCIMENTO') ?>
-
-
-
-
- Mês
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
-
-
-
-
-
+
+
__('Data Nascimento') ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
__('TELEFONE') ?>
+
+
+
+
+
+
+
+
+
+
__('ENDEREÇO') ?>
+
+
+
+
+
+
__('NÚMERO') ?>
+
+
+
+
+
+
+
+
+
+
+
+
__('BAIRRO') ?>
+
+
+
+
+
+
__('COMPLEMENTO') ?>
+
+
+
+
+
+
+
+
+
+
+
+
__('CIDADE') ?>
+
+
+
+
+
+
+
+
+
+
+
__('ESTADO') ?>
+
+
+ Selecione o Estado
+ billing_cc_data_state=="AC" || $this->billing_cc_data_state=="Acre") { ?>
+ selected >Acre
+ billing_cc_data_state=="AL" || $this->billing_cc_data_state=="Alagoas") { ?>
+ selected >Alagoas
+ billing_cc_data_state=="AP" || $this->billing_cc_data_state=="Amapá") { ?>
+ selected >Amapá
+ billing_cc_data_state=="AM" || $this->billing_cc_data_state=="Amazonas") { ?>
+ selected >Amazonas
+ billing_cc_data_state=="BA" || $this->billing_cc_data_state=="Bahia") { ?>
+ selected >Bahia
+ billing_cc_data_state=="CE" || $this->billing_cc_data_state=="Ceará") { ?>
+ selected >Ceará
+ billing_cc_data_state=="DF" || $this->billing_cc_data_state=="Distrito Federal") { ?>
+ selected >Distrito Federal
+ billing_cc_data_state=="ES" || $this->billing_cc_data_state=="Espírito Santo") { ?>
+ selected >Espírito Santo
+ billing_cc_data_state=="GO" || $this->billing_cc_data_state=="Goiás") { ?>
+ selected >Goiás
+ billing_cc_data_state=="MA" || $this->billing_cc_data_state=="Maranhão") { ?>
+ selected >Maranhão
+ billing_cc_data_state=="MT" || $this->billing_cc_data_state=="Mato Grosso") { ?>
+ selected >Mato Grosso
+ billing_cc_data_state=="MS" || $this->billing_cc_data_state=="Mato Grosso do Sul") { ?>
+ selected >Mato Grosso do Sul
+ billing_cc_data_state=="MG" || $this->billing_cc_data_state=="Minas Gerais") { ?>
+ selected >Minas Gerais
+ billing_cc_data_state=="PA" || $this->billing_cc_data_state=="Pará") { ?>
+ selected >Pará
+ billing_cc_data_state=="PB" || $this->billing_cc_data_state=="Paraíba") { ?>
+ selected >Paraíba
+ billing_cc_data_state=="PR" || $this->billing_cc_data_state=="Paraná") { ?>
+ selected >Paraná
+ billing_cc_data_state=="PE" || $this->billing_cc_data_state=="Pernambuco") { ?>
+ selected >Pernambuco
+ billing_cc_data_state=="PI" || $this->billing_cc_data_state=="Piauí") { ?>
+ selected >Piauí
+ billing_cc_data_state=="RJ" || $this->billing_cc_data_state=="Rio de Janeiro") { ?>
+ selected >Rio de Janeiro
+ billing_cc_data_state=="RN" || $this->billing_cc_data_state=="Rio Grande do Norte") { ?>
+ selected >Rio Grande do Norte
+ billing_cc_data_state=="RS" || $this->billing_cc_data_state=="Rio Grande do Sul") { ?>
+ selected >Rio Grande do Sul
+ billing_cc_data_state=="RO" || $this->billing_cc_data_state=="Rondônia") { ?>
+ selected >Rondônia
+ billing_cc_data_state=="RR" || $this->billing_cc_data_state=="Roraima") { ?>
+ selected >Roraima
+ billing_cc_data_state=="SC" || $this->billing_cc_data_state=="Santa Catarina") { ?>
+ selected >Santa Catarina
+ billing_cc_data_state=="SP" || $this->billing_cc_data_state=="São Paulo") { ?>
+ selected >São Paulo
+ billing_cc_data_state=="SE" || $this->billing_cc_data_state=="Sergipe") { ?>
+ selected >Sergipe
+ billing_cc_data_state=="TO" || $this->billing_cc_data_state=="Tocantins") { ?>
+ selected >Tocantins
+
+
+
+
+
+ order_total<5): ?>
+
+
@@ -322,33 +482,52 @@ Validation.defaultOptions.immediate = true;
-
diff --git a/app/design/frontend/base/default/template/gerencianet/pix/form.phtml b/app/design/frontend/base/default/template/gerencianet/pix/form.phtml
new file mode 100644
index 0000000..e82299f
--- /dev/null
+++ b/app/design/frontend/base/default/template/gerencianet/pix/form.phtml
@@ -0,0 +1,414 @@
+getMethodCode();
+$isSandbox = Mage::helper('gerencianet_transparent')->isSandbox();
+?>
+
+
+
+
+
+
+order_total<5): ?>
+
+
diff --git a/app/design/frontend/base/default/template/gerencianet/pix/info.phtml b/app/design/frontend/base/default/template/gerencianet/pix/info.phtml
new file mode 100644
index 0000000..54000ff
--- /dev/null
+++ b/app/design/frontend/base/default/template/gerencianet/pix/info.phtml
@@ -0,0 +1,22 @@
+
+getInfo()->getData('additional_data')); ?>
+Data de Vencimento:
+
+Imprimir Boleto
+
\ No newline at end of file
diff --git a/app/design/frontend/base/default/template/gerencianet/success.phtml b/app/design/frontend/base/default/template/gerencianet/success.phtml
index 7fa5835..c3a6c3d 100644
--- a/app/design/frontend/base/default/template/gerencianet/success.phtml
+++ b/app/design/frontend/base/default/template/gerencianet/success.phtml
@@ -15,6 +15,7 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
?>
+
__('Your order has been received') ?>
@@ -65,7 +66,28 @@
$addData = unserialize($order->getPayment()->getAdditionalData());
?>
+ getPayment()->getAdditionalData());
+ ?>
+
+
+
+
+
Pagamento via PIX
+
+
+
Escaneie o código abaixo e realize o pagamento através do Pix!
+
+
Ou copie o código abaixo e insira no seu app de pagamentos!
+
+
Copiar Código Pix!
+
+
+
+
@@ -81,4 +103,25 @@
height: 51px;
outline: none;
}
-
\ No newline at end of file
+
+.btnCopiar{
+ padding: 10px;
+ background: transparent;
+ border: solid 2px #000;
+ border-radius: 4px;
+ color: #000;
+}
+
+
+
+
\ No newline at end of file
diff --git a/js/gerencianet/transparent.js b/js/gerencianet/transparent.js
index 3d67b45..db590cb 100755
--- a/js/gerencianet/transparent.js
+++ b/js/gerencianet/transparent.js
@@ -13,27 +13,27 @@
* @author Gerencianet
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
- //v0.2.5
-var GerencianetTransparent = function GerencianetTransparent(){};
+//v0.2.5
+var GerencianetTransparent = function GerencianetTransparent() { };
var checkToken, cardOwner, cardNumber, cardCvv, cardExpM, cardExpY, generatedPaymentToken, brand, installmentSelected = null;
-GerencianetTransparent.onlyNumbers = function(elm){
+GerencianetTransparent.onlyNumbers = function (elm) {
value = elm.value;
- value = value.replace(/\D/g,"");
+ value = value.replace(/\D/g, "");
elm.value = value;
};
-GerencianetTransparent.sendError = function(msg) {
- if(isDebug)
+GerencianetTransparent.sendError = function (msg) {
+ if (isDebug)
console.error(msg);
};
-GerencianetTransparent.sendLog = function(msg) {
- if(isDebug)
+GerencianetTransparent.sendLog = function (msg) {
+ if (isDebug)
console.log(msg);
};
-GerencianetTransparent.payCardAsJuridical = function(element) {
+GerencianetTransparent.payCardAsJuridical = function (element) {
if (element.checked) {
document.getElementById('gerencianet_card_cc_juridical_data').style.display = 'block';
} else {
@@ -43,35 +43,30 @@ GerencianetTransparent.payCardAsJuridical = function(element) {
var cardDataChange = true;
-GerencianetTransparent.getPaymentToken = function() {
+GerencianetTransparent.getPaymentToken = function () {
if (cardDataChange) {
- cardDataChange=false;
- if ($$('input:checked[name="payment[cc_type]"]') && typeof $$('input:checked[name="payment[cc_type]"]') !== undefined) {
- var type = $$('input:checked[name="payment[cc_type]"]').first().value;
- } else {
- var type = document.getElementById('brandSave').value;
- }
- var number = document.getElementById('gerencianet_card_cc_number').value;
- var cvv = document.getElementById('gerencianet_card_cc_cid').value;
- var exp_month = document.getElementById('gerencianet_card_cc_expiration').value;
- var exp_year = document.getElementById('gerencianet_card_cc_expiration_yr').value;
- if (!type || !number || !cvv || !exp_month || !exp_year) {
+ cardDataChange = false;
+ var number = document.getElementById('gerencianet_card_cc_number').value;
+ var cvv = document.getElementById('gerencianet_card_cc_cid').value;
+ var exp_month = document.getElementById('gerencianet_card_cc_expiration').value;
+ var exp_year = document.getElementById('gerencianet_card_cc_expiration_yr').value;
+ if (!brand || !number || !cvv || !exp_month || !exp_year) {
return false;
}
- var callback = function(error, response) {
- if(error) {
+ var callback = function (error, response) {
+ if (error) {
alert("Os dados digitados do cartão são inválidos. Verifique as informações e tente novamente.");
- GerencianetTransparent.sendError(error);
+ GerencianetTransparent.sendError(error);
} else {
- document.getElementById('gerencianet_card_token').value = response.data.payment_token;
- generatedPaymentToken = response.data.payment_token;
- GerencianetTransparent.sendLog(response);
+ document.getElementById('gerencianet_card_token').value = response.data.payment_token;
+ generatedPaymentToken = response.data.payment_token;
+ GerencianetTransparent.sendLog(response);
}
};
$gn.checkout.getPaymentToken({
- brand: type,
+ brand: brand,
number: number,
cvv: cvv,
expiration_month: exp_month,
@@ -82,164 +77,223 @@ GerencianetTransparent.getPaymentToken = function() {
}
};
-GerencianetTransparent.calculateInstallments = function() {
+GerencianetTransparent.calculateInstallments = function (newBrand) {
if (document.getElementById('gn-payment-data-content-card') && typeof document.getElementById('gn-payment-data-content-card') !== undefined) {
document.getElementById("gn-payment-data-content-card").className = "gn-osc-card-info";
}
- newBrand = $$('input:checked[name=\"payment[cc_type]\"]').first().value;
- if (document.getElementById('gerencianet_card_cc_installments') && typeof document.getElementById('gerencianet_card_cc_installments') !== undefined) {
+ // newBrand = $$('input:checked[name=\"payment[cc_type]\"]').first().value;
+ if (document.getElementById('gerencianet_card_cc_installments') && typeof document.getElementById('gerencianet_card_cc_installments') !== undefined) {
- if(brand != newBrand || document.getElementById('gerencianet_card_cc_installments').length == 0) {
- brand = newBrand;
- document.getElementById('gerencianet_card_token').value = '';
+ if (brand != newBrand || document.getElementById('gerencianet_card_cc_installments').length == 0) {
+ brand = newBrand;
+ document.getElementById('gerencianet_card_token').value = '';
- if (newBrand === 'amex') {
+ if (newBrand === 'amex') {
document.getElementById('gerencianet_card_cc_cid').setAttribute('maxlength', 4);
} else {
document.getElementById('gerencianet_card_cc_cid').setAttribute('maxlength', 3);
}
- if (newBrand === 'aura') {
- document.getElementById('gerencianet_card_cc_number').setAttribute('maxlength', 19);
- } else {
- document.getElementById('gerencianet_card_cc_number').setAttribute('maxlength', 16);
- }
-
- new Ajax.Request( installmentsUrl, {
- method: 'POST',
- parameters: 'brand=' + brand,
- evalScripts: true,
- onLoading: function(transport) {
- $('installments').innerHTML = ' Carregando Parcelas... ';
- },
- onSuccess: function(transport) {
- if (200 == transport.status) {
- $('installments').innerHTML = transport.responseText;
- if (installmentSelected!=null) {
- $("installments select").val($('installmentSabe').val());
- }
- }
- },
- onFailure: function() {}
- });
- }
+ new Ajax.Request(installmentsUrl, {
+ method: 'POST',
+ parameters: 'brand=' + brand,
+ evalScripts: true,
+ onLoading: function (transport) {
+ $('installments').innerHTML = ' Carregando Parcelas... ';
+ },
+ onSuccess: function (transport) {
+ if (200 == transport.status) {
+ $('installments').innerHTML = transport.responseText;
+ if (installmentSelected != null) {
+ $("installments select").val($('installmentSabe').val());
+ }
+ }
+ },
+ onFailure: function () { }
+ });
+ }
}
};
-GerencianetTransparent.addFieldsObservers = function() {
- var ccNumElm = $('gerencianet_card_cc_number');
- if (ccNumElm != undefined) {
+GerencianetTransparent.addFieldsObservers = function () {
+ var ccNumElm = $('gerencianet_card_cc_number');
+ if (ccNumElm != undefined) {
- var ccExpMoElm = $('gerencianet_card_cc_expiration');
- var ccExpYrElm = $('gerencianet_card_cc_expiration_yr');
- var ccCvvElm = $('gerencianet_card_cc_cid');
+ var ccExpMoElm = $('gerencianet_card_cc_expiration');
+ var ccExpYrElm = $('gerencianet_card_cc_expiration_yr');
+ var ccCvvElm = $('gerencianet_card_cc_cid');
- clearInterval(declareObservers);
+ clearInterval(declareObservers);
- Element.observe(ccNumElm,'keyup',function(e){GerencianetTransparent.onlyNumbers(this);});
- Element.observe(ccCvvElm,'keyup',function(e){GerencianetTransparent.onlyNumbers(this);});
- }
-};
-
-GerencianetTransparent.cardPaymentValidate = function() {
- if (document.getElementById('gerencianet_card_cc_number').value.length >=14 &&
- document.getElementById('gerencianet_card_cc_data_name_card').value!="" &&
- document.getElementById('gerencianet_card_cc_cid').value.length>=3 &&
- document.getElementById('gerencianet_card_cc_expiration').value!="" &&
- document.getElementById('gerencianet_card_cc_expiration_yr').value!="") {
- cardDataChange = true;
- checkToken = GerencianetTransparent.getPaymentToken();
+ Element.observe(ccNumElm, 'keyup', function (e) { GerencianetTransparent.onlyNumbers(this); });
+ Element.observe(ccCvvElm, 'keyup', function (e) { GerencianetTransparent.onlyNumbers(this); });
}
- return true;
-}
+};
-GerencianetTransparent.rebuildSave = function() {
+GerencianetTransparent.rebuildSave = function () {
/* MAGENTO CHECKOUT METHODS SAVING */
if (typeof OSCPayment !== "undefined") { // One Step Checkout Brasil 6 Pro
- OSCPayment._savePayment = OSCPayment.savePayment;
- OSCPayment.savePayment = function() {
- if (OSCForm.validate()) {
- if (OSCPayment.currentMethod == 'gerencianet_card') {
- GerencianetTransparent.getPaymentToken();
- if (generatedPaymentToken == null)
- return false;
- }
- OSCPayment._savePayment();
- }
- }
+ OSCPayment._savePayment = OSCPayment.savePayment;
+ OSCPayment.savePayment = function () {
+ if (OSCForm.validate()) {
+ if (OSCPayment.currentMethod == 'gerencianet_card') {
+ GerencianetTransparent.getPaymentToken();
+ if (generatedPaymentToken == null)
+ return false;
+ }
+ OSCPayment._savePayment();
+ }
+ }
} else if (typeof OPC !== "undefined") { // One Step Checkout Brasil 4
- OPC.prototype._save = OPC.prototype.save;
- OPC.prototype.save = function() {
- if (this.validator.validate()) {
- if (payment.currentMethod == 'gerencianet_card') {
- GerencianetTransparent.getPaymentToken();
- if (generatedPaymentToken == null)
- return false;
- }
- this._save();
- }
- }
- } else if(typeof IWD !== "undefined" && typeof IWD.OPC !== "undefined") { // One Page Checkout IWD
- IWD.OPC._savePayment = IWD.OPC.savePayment;
- IWD.OPC.savePayment = function() {
- IWD.OPC.Checkout.lockPlaceOrder();
- if (payment.currentMethod == 'gerencianet_card') {
- GerencianetTransparent.getPaymentToken();
- if (generatedPaymentToken == null)
- return false;
- }
- this._savePayment();
- }
+ OPC.prototype._save = OPC.prototype.save;
+ OPC.prototype.save = function () {
+ if (this.validator.validate()) {
+ if (payment.currentMethod == 'gerencianet_card') {
+ GerencianetTransparent.getPaymentToken();
+ if (generatedPaymentToken == null)
+ return false;
+ }
+ this._save();
+ }
+ }
+ } else if (typeof IWD !== "undefined" && typeof IWD.OPC !== "undefined") { // One Page Checkout IWD
+ IWD.OPC._savePayment = IWD.OPC.savePayment;
+ IWD.OPC.savePayment = function () {
+ IWD.OPC.Checkout.lockPlaceOrder();
+ if (payment.currentMethod == 'gerencianet_card') {
+ GerencianetTransparent.getPaymentToken();
+ if (generatedPaymentToken == null)
+ return false;
+ }
+ this._savePayment();
+ }
} else if (typeof AWOnestepcheckoutForm !== "undefined") { //One Step Checkout by aheadWorks
- AWOnestepcheckoutForm.prototype._placeOrder = AWOnestepcheckoutForm.prototype.placeOrder;
- AWOnestepcheckoutForm.prototype.placeOrder = function() {
- if (this.validate()) {
- if (awOSCPayment.currentMethod == 'gerencianet_card') {
- GerencianetTransparent.getPaymentToken();
- if (generatedPaymentToken == null)
- return false;
- }
- this._placeOrder();
- }
- }
+ AWOnestepcheckoutForm.prototype._placeOrder = AWOnestepcheckoutForm.prototype.placeOrder;
+ AWOnestepcheckoutForm.prototype.placeOrder = function () {
+ if (this.validate()) {
+ if (awOSCPayment.currentMethod == 'gerencianet_card') {
+ GerencianetTransparent.getPaymentToken();
+ if (generatedPaymentToken == null)
+ return false;
+ }
+ this._placeOrder();
+ }
+ }
} else if (typeof FireCheckout !== "undefined") { // FireCheckout
- FireCheckout.prototype._save = FireCheckout.prototype.save;
- FireCheckout.prototype.save = function() {
- if (payment.currentMethod == 'gerencianet_card') {
- GerencianetTransparent.getPaymentToken();
- if (generatedPaymentToken == null)
- return false;
- }
- this._save();
- }
+ FireCheckout.prototype._save = FireCheckout.prototype.save;
+ FireCheckout.prototype.save = function () {
+ if (payment.currentMethod == 'gerencianet_card') {
+ GerencianetTransparent.getPaymentToken();
+ if (generatedPaymentToken == null)
+ return false;
+ }
+ this._save();
+ }
} else { // Default Magento Checkout
- Payment.prototype._save = Payment.prototype.save;
- Payment.prototype.save = function() {
- var validator = new Validation(this.form);
- if (this.validate() && validator.validate()) {
- if (this.currentMethod == 'gerencianet_card') {
- GerencianetTransparent.getPaymentToken();
- if (generatedPaymentToken == null)
- return false;
- }
- this._save();
- }
- };
-
- Review.prototype._save = Review.prototype.save;
- Review.prototype.save = function() {
- if (payment.currentMethod == 'gerencianet_card') {
- GerencianetTransparent.getPaymentToken();
- if (generatedPaymentToken == null)
- return false;
- }
- this._save();
- }
+ Payment.prototype._save = Payment.prototype.save;
+ Payment.prototype.save = function () {
+ var validator = new Validation(this.form);
+ if (this.validate() && validator.validate()) {
+ if (this.currentMethod == 'gerencianet_card') {
+ GerencianetTransparent.getPaymentToken();
+ if (generatedPaymentToken == null)
+ return false;
+ }
+ this._save();
+ }
+ };
+
+ Review.prototype._save = Review.prototype.save;
+ Review.prototype.save = function () {
+ if (payment.currentMethod == 'gerencianet_card') {
+ GerencianetTransparent.getPaymentToken();
+ if (generatedPaymentToken == null)
+ return false;
+ }
+ this._save();
+ }
}
};
-document.observe("dom:loaded", function() {
- declareObservers = setInterval(GerencianetTransparent.addFieldsObservers, 3000);
- GerencianetTransparent.rebuildSave();
-});
\ No newline at end of file
+document.observe("dom:loaded", function () {
+ declareObservers = setInterval(GerencianetTransparent.addFieldsObservers, 3000);
+ GerencianetTransparent.rebuildSave();
+});
+
+
+function getCardBrand(dirtynumber) {
+ let other = ' ';
+ let visa = ` `;
+ let mastercard = ` `;
+ let amex = ` `;
+ let elo = ' '
+ let hipercard = ''
+ + ' ';
+
+ var cardnumber = dirtynumber.replace(/[^0-9]+/g, '');
+ cardnumber = cardnumber.replaceAll(" ", "");
+
+ var brands = [
+ {
+ reg: /^4[0-9]{12}(?:[0-9]{3})/,
+ name: "visa"
+ },
+ {
+ reg: /^5[1-5][0-9]{14}/,
+ name: "mastercard"
+ },
+ {
+ reg: /^3[47][0-9]{13}/,
+ name: "amex"
+ },
+ {
+ reg: /^((((636368)|(438935)|(504175)|(451416)|(636297))\d{0,10})|((5067)|(4576)|(4011))\d{0,12})/,
+ name: "elo"
+ },
+ {
+ reg: /^(606282\d{10}(\d{3})?)|(3841\d{15})/,
+ name: "hipercard"
+ }
+ ];
+
+ let final = "";
+ brands.forEach(brand => {
+ if (brand.reg.test(cardnumber)) {
+ final = brand.name;
+ }
+ });
+
+
+
+ switch (final) {
+ case "visa":
+ document.getElementById('icon-div').innerHTML = visa;
+ break
+ case "mastercard":
+ document.getElementById('icon-div').innerHTML = mastercard;
+ break;
+ case "amex":
+ document.getElementById('icon-div').innerHTML = amex;
+ break;
+ case "elo":
+ document.getElementById('icon-div').innerHTML = elo;
+ break;
+ case "hipercard":
+ document.getElementById('icon-div').innerHTML = hipercard;
+ break;
+ default:
+ document.getElementById('icon-div').innerHTML = other;
+ }
+ // document.getElementById(final).click();
+ GerencianetTransparent.calculateInstallments(final)
+}
\ No newline at end of file
diff --git a/lib/composer.json b/lib/composer.json
new file mode 100644
index 0000000..b051b6d
--- /dev/null
+++ b/lib/composer.json
@@ -0,0 +1,5 @@
+{
+ "require": {
+ "gerencianet/gerencianet-sdk-php": "^4.0"
+ }
+}
\ No newline at end of file
diff --git a/lib/gerencianet/autoload.php b/lib/gerencianet/autoload.php
index 64f843e..a8b1380 100644
--- a/lib/gerencianet/autoload.php
+++ b/lib/gerencianet/autoload.php
@@ -2,6 +2,6 @@
// autoload.php @generated by Composer
-require_once __DIR__ . '/composer' . '/autoload_real.php';
+require_once __DIR__ . '/composer/autoload_real.php';
-return ComposerAutoloaderInit61bd9a13743a29d40c2a0bc9567934c6::getLoader();
+return ComposerAutoloaderInitbeb4b9bdc383f60c590c19c80369f330::getLoader();
diff --git a/lib/gerencianet/bin/coveralls b/lib/gerencianet/bin/coveralls
deleted file mode 120000
index 09f15b2..0000000
--- a/lib/gerencianet/bin/coveralls
+++ /dev/null
@@ -1 +0,0 @@
-../satooshi/php-coveralls/composer/bin/coveralls
\ No newline at end of file
diff --git a/lib/gerencianet/bin/test-reporter b/lib/gerencianet/bin/test-reporter
deleted file mode 120000
index e58f282..0000000
--- a/lib/gerencianet/bin/test-reporter
+++ /dev/null
@@ -1 +0,0 @@
-../codeclimate/php-test-reporter/composer/bin/test-reporter
\ No newline at end of file
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/.gitignore b/lib/gerencianet/codeclimate/php-test-reporter/.gitignore
deleted file mode 100644
index ef4219c..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-build/
-vendor/
-composer.lock
-composer.phar
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/.travis.yml b/lib/gerencianet/codeclimate/php-test-reporter/.travis.yml
deleted file mode 100644
index e82c53e..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/.travis.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-language: php
-php:
- - 5.5
-env:
- global:
- secure: Yc+Xohkr/iEUU7FCQuSLXAE9ywNW9g6CfrM1Ki0Hl+fS15F3AXT7dFY8EyCJ4dP1/oI0dBmwrGWrltXV0XWIjGV1Ms3tefCgQpBBAqwT+hImzVP3RbpZW8Iyo2d0VgiDemQF1LWYD/pKu6d8WljTnv5D77NIMdEJjQ0uzeTLWdw=
-install: composer install --dev
-before_script:
- - git config --global user.email "travis-ci@codeclimate.com"
- - git config --global user.name "Travis CI"
-after_script:
- - php composer/bin/test-reporter
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/DEVELOPING.md b/lib/gerencianet/codeclimate/php-test-reporter/DEVELOPING.md
deleted file mode 100644
index f353228..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/DEVELOPING.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# Developing
-
-- Get the source
-
- $ git clone https://github.com/codeclimate/php-test-reporter
-
-- Install dependencies
-
- $ curl -sS https://getcomposer.org/installer | php
- $ php composer.phar install --dev
-
-- Run the tests
-
- $ ./vendor/bin/phpunit
-
-- Submit PRs to https://github.com/codeclimate/php-test-reporter
-
-*Note*: all changes and fixes must have appropriate test coverage.
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/LICENSE b/lib/gerencianet/codeclimate/php-test-reporter/LICENSE
deleted file mode 100644
index 2c08c77..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/LICENSE
+++ /dev/null
@@ -1,40 +0,0 @@
-Copyright (c) 2014 Code Climate LLC
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-This package includes code by Kitamura Satoshi, distributed under the MIT license:
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/README.md b/lib/gerencianet/codeclimate/php-test-reporter/README.md
deleted file mode 100644
index a1b1145..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/README.md
+++ /dev/null
@@ -1,112 +0,0 @@
-[](https://codeclimate.com/github/codeclimate/php-test-reporter) [](https://travis-ci.org/codeclimate/php-test-reporter)
-
-# codeclimate-test-reporter
-
-Collects test coverage data from your PHP test suite and sends it to
-Code Climate's hosted, automated code review service.
-
-Code Climate - https://codeclimate.com
-
-**Important:** If you encounter an error involving SSL certificates, see the **Known Issue: SSL Certificate Error** section below.
-
-## Installation
-
-This package requires a user, but not necessarily a paid account, on
-Code Climate, so if you don't have one the first step is to signup at:
-https://codeclimate.com.
-
-To install php-test-reporter with Composer first add the following to
-your composer.json file:
-
-**composer.json**
-
-```javascript
-{
- "require-dev": {
- "codeclimate/php-test-reporter": "dev-master"
- }
-}
-```
-
-Then, run:
-
-```
-$ php composer.phar install --dev
-```
-
-If adding the test-reporter to an existing project, run:
-
-```
-$ php composer.phar update codeclimate/php-test-reporter --dev
-```
-
-## Usage
-
-- Generate coverage data to `build/logs/clover.xml`
-
-Add the following to phpunit.dist.xml:
-
-```xml
-
-
-
- ...
-
- ...
-
-
-```
-
-Or invoke `phpunit` as follows:
-
-```
-$ phpunit --coverage-clover build/logs/clover.xml
-```
-
-- Specifying your repo token as an environment variable, invoke the
- test-reporter:
-
-```
-$ CODECLIMATE_REPO_TOKEN="..." vendor/bin/test-reporter
-```
-
-The `CODECLIMATE_REPO_TOKEN` value is provided after you add your repo
-to your Code Climate account by clicking on "Setup Test Coverage" on the
-right hand side of your feed.
-
-Please contact hello@codeclimate.com if you need any assistance setting
-this up.
-
-## Known Issue: SSL Certificate Error
-
-If you encounter an error involving SSL certificates when trying to report
-coverage data from your CI server, you can work around it by manually posting
-the data via `curl`:
-
-```yaml
-after_script:
- - CODECLIMATE_REPO_TOKEN="..." bin/test-reporter --stdout > codeclimate.json
- - curl -X POST -d @codeclimate.json -H 'Content-Type: application/json' -H 'User-Agent: Code Climate (PHP Test Reporter v0.1.1)' https://codeclimate.com/test_reports
-```
-
-More details can be found in [this issue][issue].
-
-[issue]: https://github.com/codeclimate/php-test-reporter/issues/3
-
-
-## Contributions
-
-Patches, bug fixes, feature requests, and pull requests are welcome on
-the GitHub page for this project:
-
-https://github.com/codeclimate/php-test-reporter
-
-This package is maintained by Bryan Helmkamp (bryan@codeclimate.com).
-
-## Copyright
-
-See LICENSE.txt
-
-Portions of the implementation were inspired by the php-coveralls
-project.
-
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/composer.json b/lib/gerencianet/codeclimate/php-test-reporter/composer.json
deleted file mode 100644
index 830dbb0..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/composer.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "name": "codeclimate/php-test-reporter",
- "description": "PHP client for reporting test coverage to Code Climate",
- "keywords": ["codeclimate", "coverage"],
- "homepage": "https://github.com/codeclimate/php-test-reporter",
- "type": "library",
- "license": "MIT",
- "authors": [
- {
- "name": "Code Climate",
- "email": "hello@codeclimate.com",
- "homepage": "https://codeclimate.com"
- }
- ],
- "require": {
- "php": ">=5.3",
- "ext-curl": "*",
- "satooshi/php-coveralls": "0.6.*",
- "symfony/console": ">=2.0"
- },
- "require-dev": {
- "phpunit/phpunit": "3.7.*@stable"
- },
- "autoload": {
- "psr-0": {
- "CodeClimate\\Component": "src/",
- "CodeClimate\\Bundle": "src/"
- }
- },
- "bin": ["composer/bin/test-reporter"],
- "extra": {
- "branch-alias": {
- "dev-master": "0.1.x-dev"
- }
- }
-}
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/composer/bin/test-reporter b/lib/gerencianet/codeclimate/php-test-reporter/composer/bin/test-reporter
deleted file mode 100755
index 877de15..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/composer/bin/test-reporter
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env php
-run();
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/phpunit.xml.dist b/lib/gerencianet/codeclimate/php-test-reporter/phpunit.xml.dist
deleted file mode 100644
index c6d4905..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/phpunit.xml.dist
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
- ./tests/
-
-
-
-
-
-
-
-
-
- ./src
-
- ./composer
- ./tests
- ./vendor
-
-
-
-
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/ApiClient.php b/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/ApiClient.php
deleted file mode 100644
index 105c651..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/ApiClient.php
+++ /dev/null
@@ -1,55 +0,0 @@
-apiHost = "https://codeclimate.com";
-
- if (isset($_SERVER["CODECLIMATE_API_HOST"])) {
- $this->apiHost = $_SERVER["CODECLIMATE_API_HOST"];
- }
-
- }
-
- public function send($json)
- {
- $ch = curl_init();
- curl_setopt_array($ch, array(
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_URL => $this->apiHost.'/test_reports',
- CURLOPT_USERAGENT => 'Code Climate (PHP Test Reporter v'.Version::VERSION.')',
- CURLOPT_HTTPHEADER => array('Content-Type: application/json'),
- CURLOPT_HEADER => true,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_POSTFIELDS => (string)$json,
- ));
-
- $response = new \stdClass;
- if ($raw_response = curl_exec($ch)) {
- $this->buildResponse($response, $raw_response);
-
- while ($response->code == 100) { // Continue
- $this->buildResponse($response, $response->body);
- }
- } else {
- $response->code = -curl_errno($ch);
- $response->message = curl_error($ch);
- $response->headers = array();
- $response->body = NULL;
- }
- curl_close($ch);
-
- return $response;
- }
-
- private function buildResponse($response, $body)
- {
- list($response->headers, $response->body) = explode("\r\n\r\n", $body, 2);
- $response->headers = explode("\r\n", $response->headers);
- list(, $response->code, $response->message) = explode(' ', $response->headers[0], 3);
- }
-}
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Command/TestReporterCommand.php b/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Command/TestReporterCommand.php
deleted file mode 100644
index 4fd439d..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Command/TestReporterCommand.php
+++ /dev/null
@@ -1,98 +0,0 @@
-setName('test-reporter')
- ->setDescription('Code Climate PHP Test Reporter')
- ->addOption(
- 'stdout',
- null,
- InputOption::VALUE_NONE,
- 'Do not upload, print JSON payload to stdout'
- )
- ->addOption(
- 'coverage-report',
- null,
- InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
- 'Location of clover style CodeCoverage report, as produced by PHPUnit\'s --coverage-clover option.',
- array('build/logs/clover.xml')
- );
- }
-
- /**
- * {@inheritdoc}
- *
- * @see \Symfony\Component\Console\Command\Command::execute()
- */
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $ret = 0;
- $collector = new CoverageCollector($input->getOption('coverage-report'));
- $json = $collector->collectAsJson();
-
- if ($input->getOption('stdout')) {
- $output->writeln((string)$json);
- } else {
- $client = new ApiClient();
- $response = $client->send($json);
- switch ($response->code) {
- case 200:
- $output->writeln("Test coverage data sent.");
- break;
-
- case 401:
- $output->writeln("Invalid CODECLIMATE_REPO_TOKEN.");
- $ret = 1;
- break;
-
- default:
- $output->writeln("Unexpected response: ".$response->code." ".$response->message);
- $output->writeln($response->body);
- $ret = 1;
- break;
- }
- }
-
- return $ret;
- }
-
- // accessor
-
- /**
- * Set root directory.
- *
- * @param string $rootDir Path to project root directory.
- *
- * @return void
- */
- public function setRootDir($rootDir)
- {
- $this->rootDir = $rootDir;
- }
-}
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Console/Application.php b/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Console/Application.php
deleted file mode 100644
index f810645..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Console/Application.php
+++ /dev/null
@@ -1,91 +0,0 @@
-
- */
-class Application extends BaseApplication
-{
- /**
- * Path to project root directory.
- *
- * @var string
- */
- private $rootDir;
-
- /**
- * Constructor.
- *
- * @param string $rootDir Path to project root directory.
- * @param string $name The name of the application
- * @param string $version The version of the application
- */
- public function __construct($rootDir, $name = 'UNKNOWN', $version = 'UNKNOWN')
- {
- $this->rootDir = $rootDir;
-
- parent::__construct($name, $version);
- }
-
- // internal method
-
- /**
- * {@inheritdoc}
- *
- * @see \Symfony\Component\Console\Application::getCommandName()
- */
- protected function getCommandName(InputInterface $input)
- {
- return 'test-reporter';
- }
-
- /**
- * {@inheritdoc}
- *
- * @see \Symfony\Component\Console\Application::getDefaultCommands()
- */
- protected function getDefaultCommands()
- {
- // Keep the core default commands to have the HelpCommand
- // which is used when using the --help option
- $defaultCommands = parent::getDefaultCommands();
- $defaultCommands[] = $this->createTestReporterCommand();
-
- return $defaultCommands;
- }
-
- /**
- * Create TestReporterCommand.
- *
- * @return \CodeClimate\Bundle\TestReporterBundle\Command\TestReporterCommand
- */
- protected function createTestReporterCommand()
- {
- $command = new TestReporterCommand();
- $command->setRootDir($this->rootDir);
-
- return $command;
- }
-
- // accessor
-
- /**
- * {@inheritdoc}
- *
- * @see \Symfony\Component\Console\Application::getDefinition()
- */
- public function getDefinition()
- {
- $inputDefinition = parent::getDefinition();
- // clear out the normal first argument, which is the command name
- $inputDefinition->setArguments();
-
- return $inputDefinition;
- }
-}
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/CoverageCollector.php b/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/CoverageCollector.php
deleted file mode 100644
index 24e0f88..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/CoverageCollector.php
+++ /dev/null
@@ -1,66 +0,0 @@
-setSrcDir($rootDir);
- $this->setCloverPaths($paths);
- foreach ($this->getCloverPaths() as $path) {
- if (file_exists($path)) {
- $config->addCloverXmlPath($path);
- } else {
- $config->addCloverXmlPath($rootDir . DIRECTORY_SEPARATOR . $path);
- }
- }
-
- $this->api = new Jobs($config);
- }
-
- /**
- * Set a list of Clover XML paths
- * @param array $paths Array of relative paths to Clovers XML files
- */
- public function setCloverPaths($paths)
- {
- $this->cloverPaths = $paths;
- }
-
- /**
- * Get a list of Clover XML paths
- * @return array Array of relative Clover XML file locations
- */
- public function getCloverPaths()
- {
- return $this->cloverPaths;
- }
- public function collectAsJson()
- {
- $cloverJsonFile = $this->api->collectCloverXml()->getJsonFile();
-
- $jsonFile = new JsonFile();
- $jsonFile->setRunAt($cloverJsonFile->getRunAt());
-
- foreach ($cloverJsonFile->getSourceFiles() as $sourceFile) {
- $jsonFile->addSourceFile($sourceFile);
- }
-
- return $jsonFile;
- }
-}
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Entity/CiInfo.php b/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Entity/CiInfo.php
deleted file mode 100644
index f965a9a..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Entity/CiInfo.php
+++ /dev/null
@@ -1,94 +0,0 @@
-travisProperties();
- }
-
- if (isset($_SERVER["CIRCLECI"])) {
- return $this->circleProperties();
- }
-
- if (isset($_SERVER["SEMAPHORE"])) {
- return $this->semaphoreProperties();
- }
-
- if (isset($_SERVER["JENKINS_URL"])) {
- return $this->jenkinsProperties();
- }
-
- if (isset($_SERVER["TDDIUM"])) {
- return $this->tddiumProperties();
- }
-
- if (isset($_SERVER["CI_NAME"]) && preg_match('/codeship/i', $_SERVER["CI_NAME"])) {
- return $this->codeshipProperties();
- }
-
- return array();
- }
-
- protected function travisProperties()
- {
- return array(
- "name" => "travis-ci",
- "branch" => $_SERVER["TRAVIS_BRANCH"],
- "build_identifier" => $_SERVER["TRAVIS_JOB_ID"],
- "pull_request" => $_SERVER["TRAVIS_PULL_REQUEST"]
- );
- }
-
- protected function circleProperties()
- {
- return array(
- "name" => "circleci",
- "build_identifier" => $_SERVER["CIRCLE_BUILD_NUM"],
- "branch" => $_SERVER["CIRCLE_BRANCH"],
- "commit_sha" => $_SERVER["CIRCLE_SHA1"]
- );
- }
-
- protected function semaphoreProperties()
- {
- return array(
- "name" => "semaphore",
- "branch" => $_SERVER["BRANCH_NAME"],
- "build_identifier" => $_SERVER["SEMAPHORE_BUILD_NUMBER"]
- );
- }
-
- protected function jenkinsProperties()
- {
- return array(
- "name" => "jenkins",
- "build_identifier" => $_SERVER["BUILD_NUMBER"],
- "build_url" => $_SERVER["BUILD_URL"],
- "branch" => $_SERVER["GIT_BRANCH"],
- "commit_sha" => $_SERVER["GIT_COMMIT"]
- );
- }
-
- protected function tddiumProperties()
- {
- return array(
- "name" => "tddium",
- "build_identifier" => $_SERVER["TDDIUM_SESSION_ID"],
- "worker_id" => $_SERVER["TDDIUM_TID"]
- );
- }
-
- protected function codeshipProperties()
- {
- return array(
- "name" => "codeship",
- "build_identifier" => $_SERVER["CI_BUILD_NUMBER"],
- "build_url" => $_SERVER["CI_BUILD_URL"],
- "branch" => $_SERVER["CI_BRANCH"],
- "commit_sha" => $_SERVER["CI_COMMIT_ID"]
- );
- }
-}
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Entity/JsonFile.php b/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Entity/JsonFile.php
deleted file mode 100644
index 658c7d8..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Entity/JsonFile.php
+++ /dev/null
@@ -1,82 +0,0 @@
- false,
- "run_at" => $this->getRunAt(),
- "repo_token" => $this->getRepoToken(),
- "environment" => $this->getEnvironment(),
- "git" => $this->collectGitInfo(),
- "ci_service" => $this->collectCiServiceInfo(),
- "source_files" => $this->collectSourceFiles()
- );
- }
-
- public function getRunAt()
- {
- return strtotime(parent::getRunAt());
- }
-
- public function getRepoToken()
- {
- return $_SERVER["CODECLIMATE_REPO_TOKEN"];
- }
-
- protected function getEnvironment()
- {
- return array(
- "pwd" => getcwd(),
- "package_version" => Version::VERSION
- );
- }
-
- protected function collectGitInfo()
- {
- $command = new GitCommand();
-
- return array(
- "head" => $command->getHead(),
- "branch" => $command->getBranch(),
- "committed_at" => $command->getCommittedAt()
- );
- }
-
- protected function collectCiServiceInfo()
- {
- $ciInfo = new CiInfo();
-
- return $ciInfo->toArray();
- }
-
- protected function collectSourceFiles()
- {
- $sourceFiles = array();
-
- foreach ($this->getSourceFiles() as $sourceFile) {
- array_push($sourceFiles, array(
- "name" => $sourceFile->getName(),
- "coverage" => json_encode($sourceFile->getCoverage()),
- "blob_id" => $this->calculateBlobId($sourceFile)
- ));
- }
-
- return $sourceFiles;
- }
-
- protected function calculateBlobId($sourceFile)
- {
- $content = file_get_contents($sourceFile->getPath());
- $header = "blob ".strlen($content)."\0";
-
- return sha1($header.$content);
- }
-}
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Version.php b/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Version.php
deleted file mode 100644
index 103e7d8..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Version.php
+++ /dev/null
@@ -1,15 +0,0 @@
-createCommand("log -1 --pretty=format:'%H'");
-
- return current($this->executeCommand($command));
- }
-
- public function getBranch()
- {
- $command = $this->createCommand("branch");
- $branches = $this->executeCommand($command);
-
- foreach ($branches as $branch) {
- if ($branch[0] == "*") {
- return str_replace("* ", "", $branch);
- }
- }
-
- return null;
- }
-
- public function getCommittedAt()
- {
- $command = $this->createCommand("log -1 --pretty=format:'%ct'");
-
- return (int)current($this->executeCommand($command));
- }
-}
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/tests/CodeClimate/Bundle/TestReporterBundle/Console/ApplicationTest.php b/lib/gerencianet/codeclimate/php-test-reporter/tests/CodeClimate/Bundle/TestReporterBundle/Console/ApplicationTest.php
deleted file mode 100644
index b093f2c..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/tests/CodeClimate/Bundle/TestReporterBundle/Console/ApplicationTest.php
+++ /dev/null
@@ -1,57 +0,0 @@
-srcDir = realpath(__DIR__ . '/../../../../..');
- $this->setupProject();
- $this->setupEnvironment();
- }
-
- /**
- * @test
- */
- public function shouldExecuteSuccessfully()
- {
- $app = new Application($this->srcDir, 'PHP Test Reporter', '1.0.0');
- $app->setAutoExit(false);
- $tester = new ApplicationTester($app);
-
- $status = $tester->run(array('--stdout' => true));
-
- $this->assertEquals(0, $status);
- }
-
- private function setupProject()
- {
- shell_exec("rm -rf ".static::PROJECT_DIR);
- mkdir(static::PROJECT_DIR."/build/logs", 0755, true);
- copy("tests/files/test.php", static::PROJECT_DIR."/test.php");
- copy("tests/files/test.php", static::PROJECT_DIR."/test2.php");
- copy("tests/files/clover.xml", static::PROJECT_DIR."/build/logs/clover.xml");
-
- chdir(static::PROJECT_DIR);
-
- shell_exec("git init");
- shell_exec("git add test.php test2.php");
- shell_exec("git commit -m 'Initial commit'");
- shell_exec("git remote add origin git@github.com:foo/bar.git");
- }
-
- private function setupEnvironment()
- {
- $_SERVER["CODECLIMATE_REPO_TOKEN"] = 'abc123';
- $_SERVER["TRAVIS"] = "1";
- $_SERVER["TRAVIS_BRANCH"] = "master";
- $_SERVER["TRAVIS_JOB_ID"] = "1";
- $_SERVER["TRAVIS_PULL_REQUEST"] = "fb-feature";
- }
-}
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/tests/bootstrap.php b/lib/gerencianet/codeclimate/php-test-reporter/tests/bootstrap.php
deleted file mode 100644
index 727467f..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/tests/bootstrap.php
+++ /dev/null
@@ -1,4 +0,0 @@
-add('CodeClimate', __DIR__);
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/tests/files/clover.xml b/lib/gerencianet/codeclimate/php-test-reporter/tests/files/clover.xml
deleted file mode 100644
index 5a18d86..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/tests/files/clover.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/lib/gerencianet/codeclimate/php-test-reporter/tests/files/test.php b/lib/gerencianet/codeclimate/php-test-reporter/tests/files/test.php
deleted file mode 100644
index 5a2fb30..0000000
--- a/lib/gerencianet/codeclimate/php-test-reporter/tests/files/test.php
+++ /dev/null
@@ -1,8 +0,0 @@
-message = 'hoge';
- }
-}
diff --git a/lib/gerencianet/composer/ClassLoader.php b/lib/gerencianet/composer/ClassLoader.php
index ff6ecfb..fce8549 100644
--- a/lib/gerencianet/composer/ClassLoader.php
+++ b/lib/gerencianet/composer/ClassLoader.php
@@ -53,8 +53,9 @@ class ClassLoader
private $useIncludePath = false;
private $classMap = array();
-
private $classMapAuthoritative = false;
+ private $missingClasses = array();
+ private $apcuPrefix;
public function getPrefixes()
{
@@ -271,6 +272,26 @@ public function isClassMapAuthoritative()
return $this->classMapAuthoritative;
}
+ /**
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
+ *
+ * @param string|null $apcuPrefix
+ */
+ public function setApcuPrefix($apcuPrefix)
+ {
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
+ }
+
+ /**
+ * The APCu prefix in use, or null if APCu caching is not enabled.
+ *
+ * @return string|null
+ */
+ public function getApcuPrefix()
+ {
+ return $this->apcuPrefix;
+ }
+
/**
* Registers this instance as an autoloader.
*
@@ -313,29 +334,34 @@ public function loadClass($class)
*/
public function findFile($class)
{
- // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
- if ('\\' == $class[0]) {
- $class = substr($class, 1);
- }
-
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
- if ($this->classMapAuthoritative) {
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
+ if (null !== $this->apcuPrefix) {
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
+ if ($hit) {
+ return $file;
+ }
+ }
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
- if ($file === null && defined('HHVM_VERSION')) {
+ if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
- if ($file === null) {
+ if (null !== $this->apcuPrefix) {
+ apcu_add($this->apcuPrefix.$class, $file);
+ }
+
+ if (false === $file) {
// Remember that this class does not exist.
- return $this->classMap[$class] = false;
+ $this->missingClasses[$class] = true;
}
return $file;
@@ -348,10 +374,14 @@ private function findFileWithExtension($class, $ext)
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
- foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
- if (0 === strpos($class, $prefix)) {
- foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
+ $subPath = $class;
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
+ $subPath = substr($subPath, 0, $lastPos);
+ $search = $subPath . '\\';
+ if (isset($this->prefixDirsPsr4[$search])) {
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
+ if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
@@ -399,6 +429,8 @@ private function findFileWithExtension($class, $ext)
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
+
+ return false;
}
}
diff --git a/lib/gerencianet/composer/LICENSE b/lib/gerencianet/composer/LICENSE
index 1a28124..62ecfd8 100644
--- a/lib/gerencianet/composer/LICENSE
+++ b/lib/gerencianet/composer/LICENSE
@@ -1,5 +1,4 @@
-
-Copyright (c) 2016 Nils Adermann, Jordi Boggiano
+Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-
diff --git a/lib/gerencianet/composer/autoload_files.php b/lib/gerencianet/composer/autoload_files.php
index 7773804..0e9caa2 100644
--- a/lib/gerencianet/composer/autoload_files.php
+++ b/lib/gerencianet/composer/autoload_files.php
@@ -6,6 +6,8 @@
$baseDir = dirname($vendorDir);
return array(
- '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
- 'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php',
+ '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
+ 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
+ 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
+ '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
);
diff --git a/lib/gerencianet/composer/autoload_namespaces.php b/lib/gerencianet/composer/autoload_namespaces.php
index ee5a039..fb0efb8 100644
--- a/lib/gerencianet/composer/autoload_namespaces.php
+++ b/lib/gerencianet/composer/autoload_namespaces.php
@@ -6,12 +6,5 @@
$baseDir = dirname($vendorDir);
return array(
- 'Psr\\Log\\' => array($vendorDir . '/psr/log'),
- 'Guzzle\\Tests' => array($vendorDir . '/guzzle/guzzle/tests'),
- 'Guzzle' => array($vendorDir . '/guzzle/guzzle/src'),
'Gerencianet' => array($vendorDir . '/gerencianet/gerencianet-sdk-php/src'),
- 'Contrib\\Component' => array($vendorDir . '/satooshi/php-coveralls/src'),
- 'Contrib\\Bundle' => array($vendorDir . '/satooshi/php-coveralls/src'),
- 'CodeClimate\\Component' => array($vendorDir . '/codeclimate/php-test-reporter/src'),
- 'CodeClimate\\Bundle' => array($vendorDir . '/codeclimate/php-test-reporter/src'),
);
diff --git a/lib/gerencianet/composer/autoload_psr4.php b/lib/gerencianet/composer/autoload_psr4.php
index b84ab5f..01c8817 100644
--- a/lib/gerencianet/composer/autoload_psr4.php
+++ b/lib/gerencianet/composer/autoload_psr4.php
@@ -6,15 +6,9 @@
$baseDir = dirname($vendorDir);
return array(
- 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
- 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
- 'Symfony\\Component\\Stopwatch\\' => array($vendorDir . '/symfony/stopwatch'),
- 'Symfony\\Component\\Filesystem\\' => array($vendorDir . '/symfony/filesystem'),
- 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),
- 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'),
- 'Symfony\\Component\\Config\\' => array($vendorDir . '/symfony/config'),
- 'React\\Promise\\' => array($vendorDir . '/react/promise/src'),
- 'GuzzleHttp\\Stream\\' => array($vendorDir . '/guzzlehttp/streams/src'),
- 'GuzzleHttp\\Ring\\' => array($vendorDir . '/guzzlehttp/ringphp/src'),
+ 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
+ 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
+ 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
+ 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
);
diff --git a/lib/gerencianet/composer/autoload_real.php b/lib/gerencianet/composer/autoload_real.php
index a56fba0..67ea2a0 100644
--- a/lib/gerencianet/composer/autoload_real.php
+++ b/lib/gerencianet/composer/autoload_real.php
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInit61bd9a13743a29d40c2a0bc9567934c6
+class ComposerAutoloaderInitbeb4b9bdc383f60c590c19c80369f330
{
private static $loader;
@@ -13,43 +13,57 @@ public static function loadClassLoader($class)
}
}
+ /**
+ * @return \Composer\Autoload\ClassLoader
+ */
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
- spl_autoload_register(array('ComposerAutoloaderInit61bd9a13743a29d40c2a0bc9567934c6', 'loadClassLoader'), true, true);
+ spl_autoload_register(array('ComposerAutoloaderInitbeb4b9bdc383f60c590c19c80369f330', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
- spl_autoload_unregister(array('ComposerAutoloaderInit61bd9a13743a29d40c2a0bc9567934c6', 'loadClassLoader'));
+ spl_autoload_unregister(array('ComposerAutoloaderInitbeb4b9bdc383f60c590c19c80369f330', 'loadClassLoader'));
- $map = require __DIR__ . '/autoload_namespaces.php';
- foreach ($map as $namespace => $path) {
- $loader->set($namespace, $path);
- }
+ $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
+ if ($useStaticLoader) {
+ require_once __DIR__ . '/autoload_static.php';
- $map = require __DIR__ . '/autoload_psr4.php';
- foreach ($map as $namespace => $path) {
- $loader->setPsr4($namespace, $path);
- }
+ call_user_func(\Composer\Autoload\ComposerStaticInitbeb4b9bdc383f60c590c19c80369f330::getInitializer($loader));
+ } else {
+ $map = require __DIR__ . '/autoload_namespaces.php';
+ foreach ($map as $namespace => $path) {
+ $loader->set($namespace, $path);
+ }
- $classMap = require __DIR__ . '/autoload_classmap.php';
- if ($classMap) {
- $loader->addClassMap($classMap);
+ $map = require __DIR__ . '/autoload_psr4.php';
+ foreach ($map as $namespace => $path) {
+ $loader->setPsr4($namespace, $path);
+ }
+
+ $classMap = require __DIR__ . '/autoload_classmap.php';
+ if ($classMap) {
+ $loader->addClassMap($classMap);
+ }
}
$loader->register(true);
- $includeFiles = require __DIR__ . '/autoload_files.php';
+ if ($useStaticLoader) {
+ $includeFiles = Composer\Autoload\ComposerStaticInitbeb4b9bdc383f60c590c19c80369f330::$files;
+ } else {
+ $includeFiles = require __DIR__ . '/autoload_files.php';
+ }
foreach ($includeFiles as $fileIdentifier => $file) {
- composerRequire61bd9a13743a29d40c2a0bc9567934c6($fileIdentifier, $file);
+ composerRequirebeb4b9bdc383f60c590c19c80369f330($fileIdentifier, $file);
}
return $loader;
}
}
-function composerRequire61bd9a13743a29d40c2a0bc9567934c6($fileIdentifier, $file)
+function composerRequirebeb4b9bdc383f60c590c19c80369f330($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
diff --git a/lib/gerencianet/composer/autoload_static.php b/lib/gerencianet/composer/autoload_static.php
new file mode 100644
index 0000000..d5494a4
--- /dev/null
+++ b/lib/gerencianet/composer/autoload_static.php
@@ -0,0 +1,72 @@
+ __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
+ 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
+ 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php',
+ '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
+ );
+
+ public static $prefixLengthsPsr4 = array (
+ 'P' =>
+ array (
+ 'Psr\\Http\\Message\\' => 17,
+ 'Psr\\Http\\Client\\' => 16,
+ ),
+ 'G' =>
+ array (
+ 'GuzzleHttp\\Psr7\\' => 16,
+ 'GuzzleHttp\\Promise\\' => 19,
+ 'GuzzleHttp\\' => 11,
+ ),
+ );
+
+ public static $prefixDirsPsr4 = array (
+ 'Psr\\Http\\Message\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/psr/http-message/src',
+ ),
+ 'Psr\\Http\\Client\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/psr/http-client/src',
+ ),
+ 'GuzzleHttp\\Psr7\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
+ ),
+ 'GuzzleHttp\\Promise\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src',
+ ),
+ 'GuzzleHttp\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
+ ),
+ );
+
+ public static $prefixesPsr0 = array (
+ 'G' =>
+ array (
+ 'Gerencianet' =>
+ array (
+ 0 => __DIR__ . '/..' . '/gerencianet/gerencianet-sdk-php/src',
+ ),
+ ),
+ );
+
+ public static function getInitializer(ClassLoader $loader)
+ {
+ return \Closure::bind(function () use ($loader) {
+ $loader->prefixLengthsPsr4 = ComposerStaticInitbeb4b9bdc383f60c590c19c80369f330::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticInitbeb4b9bdc383f60c590c19c80369f330::$prefixDirsPsr4;
+ $loader->prefixesPsr0 = ComposerStaticInitbeb4b9bdc383f60c590c19c80369f330::$prefixesPsr0;
+
+ }, null, ClassLoader::class);
+ }
+}
diff --git a/lib/gerencianet/composer/installed.json b/lib/gerencianet/composer/installed.json
index 3b377d1..4bd5cbe 100644
--- a/lib/gerencianet/composer/installed.json
+++ b/lib/gerencianet/composer/installed.json
@@ -1,25 +1,29 @@
[
{
- "name": "psr/log",
- "version": "1.0.0",
- "version_normalized": "1.0.0.0",
+ "name": "gerencianet/gerencianet-sdk-php",
+ "version": "4.0.2",
+ "version_normalized": "4.0.2.0",
"source": {
"type": "git",
- "url": "https://github.com/php-fig/log.git",
- "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b"
+ "url": "https://github.com/gerencianet/gn-api-sdk-php.git",
+ "reference": "133a8c0113e2787f85d944567ad27d95ad017062"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
- "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
+ "url": "https://api.github.com/repos/gerencianet/gn-api-sdk-php/zipball/133a8c0113e2787f85d944567ad27d95ad017062",
+ "reference": "133a8c0113e2787f85d944567ad27d95ad017062",
"shasum": ""
},
- "time": "2012-12-21 11:40:51",
+ "require": {
+ "guzzlehttp/guzzle": "^7.0",
+ "php": ">=7.2"
+ },
+ "time": "2021-05-31T18:36:20+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
- "Psr\\Log\\": ""
+ "Gerencianet": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -28,437 +32,98 @@
],
"authors": [
{
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Common interface for logging libraries",
- "keywords": [
- "log",
- "psr",
- "psr-3"
- ]
- },
- {
- "name": "symfony/event-dispatcher",
- "version": "v2.8.3",
- "version_normalized": "2.8.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "78c468665c9568c3faaa9c416a7134308f2d85c3"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/78c468665c9568c3faaa9c416a7134308f2d85c3",
- "reference": "78c468665c9568c3faaa9c416a7134308f2d85c3",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.9"
- },
- "require-dev": {
- "psr/log": "~1.0",
- "symfony/config": "~2.0,>=2.0.5|~3.0.0",
- "symfony/dependency-injection": "~2.6|~3.0.0",
- "symfony/expression-language": "~2.6|~3.0.0",
- "symfony/stopwatch": "~2.3|~3.0.0"
- },
- "suggest": {
- "symfony/dependency-injection": "",
- "symfony/http-kernel": ""
- },
- "time": "2016-01-27 05:14:19",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.8-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\EventDispatcher\\": ""
+ "name": "Cecília Deveza"
},
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Danniel Hugo"
},
{
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony EventDispatcher Component",
- "homepage": "https://symfony.com"
- },
- {
- "name": "guzzle/guzzle",
- "version": "v3.9.3",
- "version_normalized": "3.9.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/guzzle/guzzle3.git",
- "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9",
- "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9",
- "shasum": ""
- },
- "require": {
- "ext-curl": "*",
- "php": ">=5.3.3",
- "symfony/event-dispatcher": "~2.1"
- },
- "replace": {
- "guzzle/batch": "self.version",
- "guzzle/cache": "self.version",
- "guzzle/common": "self.version",
- "guzzle/http": "self.version",
- "guzzle/inflection": "self.version",
- "guzzle/iterator": "self.version",
- "guzzle/log": "self.version",
- "guzzle/parser": "self.version",
- "guzzle/plugin": "self.version",
- "guzzle/plugin-async": "self.version",
- "guzzle/plugin-backoff": "self.version",
- "guzzle/plugin-cache": "self.version",
- "guzzle/plugin-cookie": "self.version",
- "guzzle/plugin-curlauth": "self.version",
- "guzzle/plugin-error-response": "self.version",
- "guzzle/plugin-history": "self.version",
- "guzzle/plugin-log": "self.version",
- "guzzle/plugin-md5": "self.version",
- "guzzle/plugin-mock": "self.version",
- "guzzle/plugin-oauth": "self.version",
- "guzzle/service": "self.version",
- "guzzle/stream": "self.version"
- },
- "require-dev": {
- "doctrine/cache": "~1.3",
- "monolog/monolog": "~1.0",
- "phpunit/phpunit": "3.7.*",
- "psr/log": "~1.0",
- "symfony/class-loader": "~2.1",
- "zendframework/zend-cache": "2.*,<2.3",
- "zendframework/zend-log": "2.*,<2.3"
- },
- "suggest": {
- "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated."
- },
- "time": "2015-03-18 18:23:50",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.9-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-0": {
- "Guzzle": "src/",
- "Guzzle\\Tests": "tests/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
+ "name": "Francisco Thiene"
+ },
{
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
+ "name": "Talita Campos"
},
{
- "name": "Guzzle Community",
- "homepage": "https://github.com/guzzle/guzzle/contributors"
- }
- ],
- "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle",
- "homepage": "http://guzzlephp.org/",
- "keywords": [
- "client",
- "curl",
- "framework",
- "http",
- "http client",
- "rest",
- "web service"
- ]
- },
- {
- "name": "symfony/stopwatch",
- "version": "v3.0.3",
- "version_normalized": "3.0.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/stopwatch.git",
- "reference": "4a204804952ff267ace88cf499e0b4bb302a475e"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/stopwatch/zipball/4a204804952ff267ace88cf499e0b4bb302a475e",
- "reference": "4a204804952ff267ace88cf499e0b4bb302a475e",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.9"
- },
- "time": "2016-01-03 15:35:16",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.0-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Stopwatch\\": ""
+ "name": "Thomaz Feitoza"
},
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Filipe Mata"
},
{
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Stopwatch Component",
- "homepage": "https://symfony.com"
- },
- {
- "name": "symfony/filesystem",
- "version": "v3.0.3",
- "version_normalized": "3.0.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/filesystem.git",
- "reference": "23ae8f9648d0a7fe94a47c8e20e5bf37c489a451"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/23ae8f9648d0a7fe94a47c8e20e5bf37c489a451",
- "reference": "23ae8f9648d0a7fe94a47c8e20e5bf37c489a451",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.9"
- },
- "time": "2016-02-23 15:16:06",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.0-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Filesystem\\": ""
+ "name": "Thiago Resende"
},
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Jéssica Gava"
},
{
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Filesystem Component",
- "homepage": "https://symfony.com"
- },
- {
- "name": "symfony/config",
- "version": "v3.0.3",
- "version_normalized": "3.0.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/config.git",
- "reference": "79a97025f7bf4bbf8352b5df1905aa136a531066"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/79a97025f7bf4bbf8352b5df1905aa136a531066",
- "reference": "79a97025f7bf4bbf8352b5df1905aa136a531066",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.9",
- "symfony/filesystem": "~2.8|~3.0"
- },
- "suggest": {
- "symfony/yaml": "To use the yaml reference dumper"
- },
- "time": "2016-02-23 15:16:06",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.0-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Config\\": ""
+ "name": "Guilherme Cota"
},
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Sady Coimbra"
},
{
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Config Component",
- "homepage": "https://symfony.com"
- },
- {
- "name": "symfony/polyfill-mbstring",
- "version": "v1.1.1",
- "version_normalized": "1.1.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "1289d16209491b584839022f29257ad859b8532d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d",
- "reference": "1289d16209491b584839022f29257ad859b8532d",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "suggest": {
- "ext-mbstring": "For best performance"
- },
- "time": "2016-01-20 09:13:37",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.1-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Mbstring\\": ""
+ "name": "Matheus Rodrigues"
},
- "files": [
- "bootstrap.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
{
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
+ "name": "João Oliveira"
},
{
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
+ "name": "Paloma Brito"
}
],
- "description": "Symfony polyfill for the Mbstring extension",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "mbstring",
- "polyfill",
- "portable",
- "shim"
- ]
+ "description": "GN API SDK PHP"
},
{
- "name": "symfony/console",
- "version": "v3.0.3",
- "version_normalized": "3.0.3.0",
+ "name": "guzzlehttp/guzzle",
+ "version": "7.3.0",
+ "version_normalized": "7.3.0.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/console.git",
- "reference": "2ed5e2706ce92313d120b8fe50d1063bcfd12e04"
+ "url": "https://github.com/guzzle/guzzle.git",
+ "reference": "7008573787b430c1c1f650e3722d9bba59967628"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/2ed5e2706ce92313d120b8fe50d1063bcfd12e04",
- "reference": "2ed5e2706ce92313d120b8fe50d1063bcfd12e04",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7008573787b430c1c1f650e3722d9bba59967628",
+ "reference": "7008573787b430c1c1f650e3722d9bba59967628",
"shasum": ""
},
"require": {
- "php": ">=5.5.9",
- "symfony/polyfill-mbstring": "~1.0"
+ "ext-json": "*",
+ "guzzlehttp/promises": "^1.4",
+ "guzzlehttp/psr7": "^1.7 || ^2.0",
+ "php": "^7.2.5 || ^8.0",
+ "psr/http-client": "^1.0"
+ },
+ "provide": {
+ "psr/http-client-implementation": "1.0"
},
"require-dev": {
- "psr/log": "~1.0",
- "symfony/event-dispatcher": "~2.8|~3.0",
- "symfony/process": "~2.8|~3.0"
+ "bamarni/composer-bin-plugin": "^1.4.1",
+ "ext-curl": "*",
+ "php-http/client-integration-tests": "^3.0",
+ "phpunit/phpunit": "^8.5.5 || ^9.3.5",
+ "psr/log": "^1.1"
},
"suggest": {
- "psr/log": "For using the console logger",
- "symfony/event-dispatcher": "",
- "symfony/process": ""
+ "ext-curl": "Required for CURL handler support",
+ "ext-intl": "Required for Internationalized Domain Name (IDN) support",
+ "psr/log": "Required for using the Log middleware"
},
- "time": "2016-02-28 16:24:34",
+ "time": "2021-03-23T11:33:13+00:00",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0-dev"
+ "dev-master": "7.3-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
- "Symfony\\Component\\Console\\": ""
+ "GuzzleHttp\\": "src/"
},
- "exclude-from-classmap": [
- "/Tests/"
+ "files": [
+ "src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -467,226 +132,80 @@
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
},
{
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://sagikazarmark.hu"
}
],
- "description": "Symfony Console Component",
- "homepage": "https://symfony.com"
- },
- {
- "name": "symfony/yaml",
- "version": "v3.0.3",
- "version_normalized": "3.0.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/yaml.git",
- "reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/b5ba64cd67ecd6887f63868fa781ca094bd1377c",
- "reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.9"
- },
- "time": "2016-02-23 15:16:06",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.0-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Yaml\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
+ "description": "Guzzle is a PHP HTTP client library",
+ "homepage": "http://guzzlephp.org/",
+ "keywords": [
+ "client",
+ "curl",
+ "framework",
+ "http",
+ "http client",
+ "psr-18",
+ "psr-7",
+ "rest",
+ "web service"
],
- "authors": [
+ "funding": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
},
{
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Yaml Component",
- "homepage": "https://symfony.com"
- },
- {
- "name": "satooshi/php-coveralls",
- "version": "v0.6.1",
- "version_normalized": "0.6.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/satooshi/php-coveralls.git",
- "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/dd0df95bd37a7cf5c5c50304dfe260ffe4b50760",
- "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760",
- "shasum": ""
- },
- "require": {
- "ext-curl": "*",
- "ext-json": "*",
- "ext-simplexml": "*",
- "guzzle/guzzle": ">=3.0",
- "php": ">=5.3",
- "psr/log": "1.0.0",
- "symfony/config": ">=2.0",
- "symfony/console": ">=2.0",
- "symfony/stopwatch": ">=2.2",
- "symfony/yaml": ">=2.0"
- },
- "require-dev": {
- "apigen/apigen": "2.8.*@stable",
- "pdepend/pdepend": "dev-master",
- "phpmd/phpmd": "dev-master",
- "phpunit/php-invoker": ">=1.1.0,<1.2.0",
- "phpunit/phpunit": "3.7.*@stable",
- "sebastian/finder-facade": "dev-master",
- "sebastian/phpcpd": "1.4.*@stable",
- "squizlabs/php_codesniffer": "1.4.*@stable",
- "theseer/fdomdocument": "dev-master"
- },
- "time": "2013-05-04 08:07:33",
- "bin": [
- "composer/bin/coveralls"
- ],
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-0": {
- "Contrib\\Component": "src/",
- "Contrib\\Bundle": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
+ "url": "https://github.com/Nyholm",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/alexeyshockov",
+ "type": "github"
+ },
{
- "name": "Kitamura Satoshi",
- "email": "with.no.parachute@gmail.com",
- "homepage": "https://www.facebook.com/satooshi.jp"
+ "url": "https://github.com/gmponos",
+ "type": "github"
}
- ],
- "description": "PHP client library for Coveralls API",
- "homepage": "https://github.com/satooshi/php-coveralls",
- "keywords": [
- "ci",
- "coverage",
- "github",
- "test"
]
},
{
- "name": "codeclimate/php-test-reporter",
- "version": "v0.1.2",
- "version_normalized": "0.1.2.0",
+ "name": "guzzlehttp/promises",
+ "version": "1.4.1",
+ "version_normalized": "1.4.1.0",
"source": {
"type": "git",
- "url": "https://github.com/codeclimate/php-test-reporter.git",
- "reference": "8ed24ff30f3663ecf40f1c12d6c97eb56c69e646"
+ "url": "https://github.com/guzzle/promises.git",
+ "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/codeclimate/php-test-reporter/zipball/8ed24ff30f3663ecf40f1c12d6c97eb56c69e646",
- "reference": "8ed24ff30f3663ecf40f1c12d6c97eb56c69e646",
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d",
+ "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d",
"shasum": ""
},
"require": {
- "ext-curl": "*",
- "php": ">=5.3",
- "satooshi/php-coveralls": "0.6.*",
- "symfony/console": ">=2.0"
+ "php": ">=5.5"
},
"require-dev": {
- "phpunit/phpunit": "3.7.*@stable"
- },
- "time": "2014-07-23 13:42:41",
- "bin": [
- "composer/bin/test-reporter"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "0.1.x-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-0": {
- "CodeClimate\\Component": "src/",
- "CodeClimate\\Bundle": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Code Climate",
- "email": "hello@codeclimate.com",
- "homepage": "https://codeclimate.com"
- }
- ],
- "description": "PHP client for reporting test coverage to Code Climate",
- "homepage": "https://github.com/codeclimate/php-test-reporter",
- "keywords": [
- "codeclimate",
- "coverage"
- ]
- },
- {
- "name": "react/promise",
- "version": "v2.2.2",
- "version_normalized": "2.2.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/reactphp/promise.git",
- "reference": "3aacad8bf10c7d83e6fa2089d413529888c2bedf"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/reactphp/promise/zipball/3aacad8bf10c7d83e6fa2089d413529888c2bedf",
- "reference": "3aacad8bf10c7d83e6fa2089d413529888c2bedf",
- "shasum": ""
+ "symfony/phpunit-bridge": "^4.4 || ^5.1"
},
- "require": {
- "php": ">=5.4.0"
- },
- "time": "2016-02-26 19:09:02",
+ "time": "2021-03-07T09:25:29+00:00",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0-dev"
+ "dev-master": "1.4-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
- "React\\Promise\\": "src/"
+ "GuzzleHttp\\Promise\\": "src/"
},
"files": [
"src/functions_include.php"
@@ -698,45 +217,61 @@
],
"authors": [
{
- "name": "Jan Sorgalla",
- "email": "jsorgalla@gmail.com"
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
}
],
- "description": "A lightweight implementation of CommonJS Promises/A for PHP"
+ "description": "Guzzle promises library",
+ "keywords": [
+ "promise"
+ ]
},
{
- "name": "guzzlehttp/streams",
- "version": "3.0.0",
- "version_normalized": "3.0.0.0",
+ "name": "guzzlehttp/psr7",
+ "version": "1.8.2",
+ "version_normalized": "1.8.2.0",
"source": {
"type": "git",
- "url": "https://github.com/guzzle/streams.git",
- "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5"
+ "url": "https://github.com/guzzle/psr7.git",
+ "reference": "dc960a912984efb74d0a90222870c72c87f10c91"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5",
- "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91",
+ "reference": "dc960a912984efb74d0a90222870c72c87f10c91",
"shasum": ""
},
"require": {
- "php": ">=5.4.0"
+ "php": ">=5.4.0",
+ "psr/http-message": "~1.0",
+ "ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
+ },
+ "provide": {
+ "psr/http-message-implementation": "1.0"
},
"require-dev": {
- "phpunit/phpunit": "~4.0"
+ "ext-zlib": "*",
+ "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10"
+ },
+ "suggest": {
+ "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
},
- "time": "2014-10-12 19:18:40",
+ "time": "2021-04-26T09:17:50+00:00",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0-dev"
+ "dev-master": "1.7-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
- "GuzzleHttp\\Stream\\": "src/"
- }
+ "GuzzleHttp\\Psr7\\": "src/"
+ },
+ "files": [
+ "src/functions_include.php"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -747,53 +282,54 @@
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Tobias Schultze",
+ "homepage": "https://github.com/Tobion"
}
],
- "description": "Provides a simple abstraction over streams of data",
- "homepage": "http://guzzlephp.org/",
+ "description": "PSR-7 message implementation that also provides common utility methods",
"keywords": [
- "Guzzle",
- "stream"
+ "http",
+ "message",
+ "psr-7",
+ "request",
+ "response",
+ "stream",
+ "uri",
+ "url"
]
},
{
- "name": "guzzlehttp/ringphp",
- "version": "1.1.0",
- "version_normalized": "1.1.0.0",
+ "name": "psr/http-client",
+ "version": "1.0.1",
+ "version_normalized": "1.0.1.0",
"source": {
"type": "git",
- "url": "https://github.com/guzzle/RingPHP.git",
- "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b"
+ "url": "https://github.com/php-fig/http-client.git",
+ "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/dbbb91d7f6c191e5e405e900e3102ac7f261bc0b",
- "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b",
+ "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
+ "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
"shasum": ""
},
"require": {
- "guzzlehttp/streams": "~3.0",
- "php": ">=5.4.0",
- "react/promise": "~2.0"
- },
- "require-dev": {
- "ext-curl": "*",
- "phpunit/phpunit": "~4.0"
- },
- "suggest": {
- "ext-curl": "Guzzle will use specific adapters if cURL is present"
+ "php": "^7.0 || ^8.0",
+ "psr/http-message": "^1.0"
},
- "time": "2015-05-20 03:37:09",
+ "time": "2020-06-29T06:28:15+00:00",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1-dev"
+ "dev-master": "1.0.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
- "GuzzleHttp\\Ring\\": "src/"
+ "Psr\\Http\\Client\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -802,48 +338,48 @@
],
"authors": [
{
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
}
],
- "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function."
+ "description": "Common interface for HTTP clients",
+ "homepage": "https://github.com/php-fig/http-client",
+ "keywords": [
+ "http",
+ "http-client",
+ "psr",
+ "psr-18"
+ ]
},
{
- "name": "guzzlehttp/guzzle",
- "version": "5.3.0",
- "version_normalized": "5.3.0.0",
+ "name": "psr/http-message",
+ "version": "1.0.1",
+ "version_normalized": "1.0.1.0",
"source": {
"type": "git",
- "url": "https://github.com/guzzle/guzzle.git",
- "reference": "f3c8c22471cb55475105c14769644a49c3262b93"
+ "url": "https://github.com/php-fig/http-message.git",
+ "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f3c8c22471cb55475105c14769644a49c3262b93",
- "reference": "f3c8c22471cb55475105c14769644a49c3262b93",
+ "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
+ "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
"shasum": ""
},
"require": {
- "guzzlehttp/ringphp": "^1.1",
- "php": ">=5.4.0"
+ "php": ">=5.3.0"
},
- "require-dev": {
- "ext-curl": "*",
- "phpunit/phpunit": "^4.0",
- "psr/log": "^1.0"
- },
- "time": "2015-05-20 03:47:55",
+ "time": "2016-08-06T14:39:51+00:00",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "5.0-dev"
+ "dev-master": "1.0.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
- "GuzzleHttp\\": "src/"
+ "Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -852,53 +388,50 @@
],
"authors": [
{
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
}
],
- "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients",
- "homepage": "http://guzzlephp.org/",
+ "description": "Common interface for HTTP messages",
+ "homepage": "https://github.com/php-fig/http-message",
"keywords": [
- "client",
- "curl",
- "framework",
"http",
- "http client",
- "rest",
- "web service"
+ "http-message",
+ "psr",
+ "psr-7",
+ "request",
+ "response"
]
},
{
- "name": "gerencianet/gerencianet-sdk-php",
- "version": "1.0.9",
- "version_normalized": "1.0.9.0",
+ "name": "ralouphie/getallheaders",
+ "version": "3.0.3",
+ "version_normalized": "3.0.3.0",
"source": {
"type": "git",
- "url": "https://github.com/gerencianet/gn-api-sdk-php.git",
- "reference": "e0426e6734efdff98b1b9969c48b635ff2fafdc8"
+ "url": "https://github.com/ralouphie/getallheaders.git",
+ "reference": "120b605dfeb996808c31b6477290a714d356e822"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/gerencianet/gn-api-sdk-php/zipball/e0426e6734efdff98b1b9969c48b635ff2fafdc8",
- "reference": "e0426e6734efdff98b1b9969c48b635ff2fafdc8",
+ "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
+ "reference": "120b605dfeb996808c31b6477290a714d356e822",
"shasum": ""
},
"require": {
- "codeclimate/php-test-reporter": "^0.1.2",
- "guzzlehttp/guzzle": "5.3.0",
- "php": ">=5.4.0"
+ "php": ">=5.6"
},
"require-dev": {
- "phpunit/phpunit": "~4.6"
+ "php-coveralls/php-coveralls": "^2.1",
+ "phpunit/phpunit": "^5 || ^6.5"
},
- "time": "2016-03-16 15:04:09",
+ "time": "2019-03-08T08:55:37+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
- "psr-0": {
- "Gerencianet": "src/"
- }
+ "files": [
+ "src/getallheaders.php"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -906,21 +439,10 @@
],
"authors": [
{
- "name": "Cecília Deveza"
- },
- {
- "name": "Danniel Hugo"
- },
- {
- "name": "Francisco Thiene"
- },
- {
- "name": "Talita Campos"
- },
- {
- "name": "Thomaz Feitoza"
+ "name": "Ralph Khattar",
+ "email": "ralph.khattar@gmail.com"
}
],
- "description": "GN API SDK PHP"
+ "description": "A polyfill for getallheaders."
}
]
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/.gitignore b/lib/gerencianet/gerencianet/gerencianet-sdk-php/.gitignore
index 2fde1bf..5eab799 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/.gitignore
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/.gitignore
@@ -5,3 +5,4 @@ phpunit.phar
phpunit.php
coverage/
build/
+.idea/
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/.travis.yml b/lib/gerencianet/gerencianet/gerencianet-sdk-php/.travis.yml
index 5a09c5e..da4d433 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/.travis.yml
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/.travis.yml
@@ -1,11 +1,15 @@
language: php
+dist: trusty
php:
- '5.5'
+- '5.6'
+- '7.0'
+- '7.1'
notifications:
email: false
install:
- composer install
-script: phpunit -c config.xml
+script: vendor/bin/phpunit -c config.xml
env:
secure: "VioTqvOA/qoJbA1yHS5RslsUNvFafK4IHI/ncYhWLBI97DO5tcC1juqnk9W/chf6c1GpfUab/S9RE1U3kTGADo9njGRRpf6c7AIyBBNCuRenR52u30W8PkaeIHSIegQU1on9zqApAoHPD1lt4GPU4DieE7Pm2UcNf4lFFZNRI72sLaNH3I0cjVRAC+MEv/HyitDPAxiwHFitlIXa/arlhyTKEP3bmnNAjhKiGoi64aRwbhJp8V83pxLxx0C+wmTyHxv5rO7CEongUJX1dHhnsTFDAYu1SFxMGdF33QVt5RK3DVmnjr+yTUv6R9PqVwg18tvQ0zaiGaeb4QF6ss3gdk/NHkj1LenmF41ndn9C/QgY5+/T6JYQL1I1BO9NFquFQjBVDSt8RDH+8ptzFoZFWwFhIGI8ir3uS3ciAfHzxMCT29Ksh1NPBsQ9bd4rjh49+DxXKluQoRUssQAgFJBvCNoH4O50xFthxnFhsNS1lB9aZNODswzucynqkEjjYVOX/6uqXm2sjPT9bXtwjzm7SOLeeFRxJjolcoBjpxiRQewt/32X2VTQy6HLKaIX0lUg08MAySqkvftssFLcgHqVbwBErCstGdn7KaFxTi07+o6N4ygsxWUcDvd1o8003MvLSJfEBM+IuAqMb9KLk4J5dhpR7PkWkdJXI0i10XdGz0w="
after_script:
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/CHANGELOG.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/CHANGELOG.md
index 7bdbde7..2e6b571 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/CHANGELOG.md
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/CHANGELOG.md
@@ -1,3 +1,72 @@
+# 3.1.0
+- Added: New endpoint pix (Create Evp)
+- Added: New endpoint pix (List Evp)
+- Added: New endpoint pix (Delete Evp)
+- Added: New endpoint pix (Update Settings)
+- Added: New endpoint pix (List Settings)
+- Added: New endpoint pix (List Balance)
+- Added: Function to define the endpoints file
+- Fix: Fefinition of timeout in settings
+- Fix: Fet default value in the map function
+- Updated: Field description "solicitacaoPagador"
+
+# 3.0.0
+- Added: api Pix
+- Fix: updated dependencies
+
+# 2.4.1
+
+- Fix: Files with endpoint oneStep charge
+
+# 2.4.0
+
+- Added: new endpoint (oneStep charge)
+
+# 2.3.0
+
+- Added: new endpoint (settle charge)
+- Added: new endpoint (settle carnet parcel)
+
+# 2.2.0
+
+- Added: new endpoint (create charge balance sheet)
+
+# 2.1.0
+
+- Added: new endpoint (update plan)
+- Added: new endpoint (create subscription history)
+
+# 2.0.0
+
+- Breaking change: Drop PHP 5.4 support
+- Breaking change: Update Guzzle version
+
+# 1.0.14
+
+- Added: timeout option
+
+# 1.0.13
+
+- Fix: code climate on dev dependencies
+
+# 1.0.12
+
+- Added: new endpoint (update charge link)
+
+# 1.0.11
+
+- Added: new endpoint (charge link)
+- Updated: docs
+
+# 1.0.10
+
+- Added: new endpoints (cancel carnet and cancel parcel)
+- Updated: docs
+
+# 1.0.9
+
+- Fix: Tests.
+
# 1.0.8
- Updated: Request
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/README.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/README.md
index b742a78..1de9eb7 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/README.md
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/README.md
@@ -1,36 +1,47 @@
-# SDK GERENCIANET FOR PHP
+
+
+SDK Gerencianet for PHP
-Sdk for Gerencianet Pagamentos' API.
+SDK for Gerencianet Pagamentos' API.
For more informations about parameters and values, please refer to [Gerencianet](http://gerencianet.com.br) documentation.
-**:warning: Gerencianet API is under BETA version, meaning that it's not available for all users right now. If you're interested, you can always send an email to suportetecnico@gerencianet.com.br and we'll enable it for your account.**
-
-
[](https://travis-ci.org/gerencianet/gn-api-sdk-php)
[](https://codeclimate.com/github/gerencianet/gn-api-sdk-php)
[](https://codeclimate.com/github/gerencianet/gn-api-sdk-php/coverage)
## Installation
-Require this package with [composer](https://getcomposer.org/):
+Clone this repository and execute the following command to install the dependencies
```
-$ composer require gerencianet/gerencianet-sdk-php
+$ composer install
```
-Or include it in your composer.json file:
+
+If you already have a project with composer, include the dependency in your composer.json file:
```
...
"require": {
- "gerencianet/gerencianet-sdk-php": "1.*"
+ "gerencianet/gerencianet-sdk-php": "4.*"
},
...
```
+Or require this package with [composer](https://getcomposer.org/):
+```
+$ composer require gerencianet/gerencianet-sdk-php
+```
+
## Requirements
-* PHP >= 5.4.0
+* PHP >= 7.2
+* Guzzle >= 7.0
+* Extension ext-simplexml
+## Tested with
+```
+php 7.2 and 7.4
+```
## Getting started
Require the module and namespaces:
```php
-require __DIR__ . '/../sdk/vendor/autoload.php';
+require __DIR__ . '/vendor/autoload.php';
use Gerencianet\Gerencianet;
```
@@ -45,13 +56,18 @@ try {
}
```
+To begin, you must configure the parameters in the config.json file. Instantiate the information `client_id`, `client_secret` for your application and `sandbox` equal to *true*, if your environment is Homologation, or *false*, if it is Production. If you use Pix charges, inform in the attribute `pix_cert` the directory and name of your certificate in .pem format.
+
### For development environment
Instantiate the module passing using your client_id, client_secret and sandbox equals true:
```php
$options = [
'client_id' => 'client_id',
'client_secret' => 'client_secret',
- 'sandbox' => true
+ 'pix_cert' => '../certs/developmentCertificate.pem',
+ 'sandbox' => true,
+ 'debug' => false,
+ 'timeout' => 30
];
$api = new Gerencianet($options);
@@ -63,71 +79,77 @@ To change the environment to production, just set the third sandbox to false:
$options = [
'client_id' => 'client_id',
'client_secret' => 'client_secret',
- 'sandbox' => false
+ 'pix_cert' => '../certs/productionCertificate.pem',
+ 'sandbox' => false,
+ 'debug' => false,
+ 'timeout' => 30
];
$api = new Gerencianet($options);
```
-## Running tests
+### If you use the Pix option:
-To run tests install [PHPUnit](https://phpunit.de/getting-started.html) and run the following command:
-```php
-$ phpunit -c config.xml
-```
+**To generate your certificate:** Access the menu API (1)-> Meus Certificados (2) and choose the environment you want the certificate: Produção or Homologação -> click in Novo Certificado (3).
+
-## Running examples
-Update examples/config.json file with client_id and client_secret of your application.
+**Create a new application to use the Pix API:** Access the menu API (1)-> Minhas Aplicações -> Nova Aplicação(2) -> Ative API Pix (3) and choose the scopes you want to release in Produção e/ou Homologação (remembering that these can be changed later). -> click in Criar Nova aplicação(4).
+
-You can run using any web server, like Apache or nginx, or simple start a php server as follow:
-```php
-php -S localhost:9000
-```
+**Change an existing application to use the Pix API:** Access the menu API (1)-> Minhas Aplicações e escolha a sua aplicação (2) -> Editar(Botão laranja) -> Ative API Pix (3) and choose the scopes you want to release in Produção e/ou Homologação. -> click in Atualizar aplicação (4).
+
-Then open any example in your browser.
-:warning: Some examples require you to change some parameters to work, like examples/charge/detail.php where you must change the id parameter.
+For use in PHP, the certificate must be converted to .pem.
+Below you will find example using the OpenSSL command for conversion.
-## Additional Documentation
+### Command OpenSSL
+```
+// Gerar certificado e chave em único arquivo
+openssl pkcs12 -in certificado.p12 -out certificado.pem -nodes
+```
-#### Charges
-- [Creating charges](/docs/CHARGE.md)
-- [Paying a charge](/docs/CHARGE_PAYMENT.md)
-- [Detailing charges](/docs/CHARGE_DETAIL.md)
-- [Updating informations](/docs/CHARGE_UPDATE.md)
-- [Resending billet](/docs/RESEND_BILLET.md)
-- [Adding information to charge's history](/docs/CHARGE_CREATE_HISTORY.md)
+### To register your Pix keys
+The registration of Pix keys can be done through the application. If you don't already have our app installed, click on [Android](https://play.google.com/store/apps/details?id=br.com.gerencianet.app) or [iOS](https://apps.apple.com/br/app/gerencianet/id1443363326), according to your smartphone's operating system, to download it.
-#### Carnets
+To register your Pix keys through the application:
+1. Access your account through **app Gerencianet**.
+2. In the side menu, touch **Pix** to start your registration.
+3. Read the information that appears on the screen and click **Registrar Chave**.
+ If this is no longer your first contact, tap **Minhas Chaves** and then the icon (➕).
+4. **Select the data** you are going to register as a Pix Key and tap **avançar** - you must choose at least 1 of the 4 available key options (cell, e-mail, CPF e/ou random key).
+5. After registering the desired Pix keys, click on **concluir**.
+6. **Ready! Your keys are already registered with us.**
-- [Creating carnets](/docs/CARNET.md)
-- [Detailing carnets](/docs/CARNET_DETAIL.md)
-- [Updating informations](/docs/CARNET_UPDATE.md)
-- [Resending the carnet](/docs/CARNET_RESEND.md)
-- [Resending carnet parcel](/docs/CARNET_RESEND_PARCEL.md)
-- [Adding information to carnet's history](/docs/CARNET_CREATE_HISTORY.md)
-#### Subscriptions
-- [Creating subscriptions](/docs/SUBSCRIPTION.md)
-- [Setting the payment method](/docs/SUBSCRIPTION_PAYMENT.md)
-- [Detailing subscriptions](/docs/SUBSCRIPTION_DETAIL.md)
-- [Updating informations](/docs/SUBSCRIPTION_UPDATE.md)
-- [Listing plans](/docs/PLAN_LIST.md)
+## Running examples
+You can run using any web server, like Apache or nginx, or simple start a php server as follow:
-#### Marketplace
+```php
+php -S localhost:9000
+```
-- [Creating a marketplace](/docs/MARKETPLACE.md)
+Then open any example in your browser.
-#### Notifications
+:warning: Some examples require you to change some parameters to work, like `examples/charge/oneStepBillet.php` or `examples/pix/charge/create.php` where you must change the id parameter.
-- [Getting notifications](/docs/NOTIFICATION.md)
-#### Payments
+## Version Guidance
+
+| Version | Status | Packagist | Repo | PHP Version |
+| --- | --- | --- | --- | --- |
+| 1.x | Maintained | `gerencianet/gerencianet-sdk-php` | [v1](https://github.com/gerencianet/gn-api-sdk-php/tree/1.x) | \>= 5.4 |
+| 2.x | Maintained | `gerencianet/gerencianet-sdk-php` | [v2](https://github.com/gerencianet/gn-api-sdk-php/tree/2.x) | \>= 5.5 |
+| 3.x | Maintained | `gerencianet/gerencianet-sdk-php` | [v3](https://github.com/gerencianet/gn-api-sdk-php/tree/3.x) | \>= 5.6 |
+| 4.x | Maintained | `gerencianet/gerencianet-sdk-php` | [v4](https://github.com/gerencianet/gn-api-sdk-php) | \>= 7.2 |
+
+## Additional Documentation
-- [Getting the payment data](/docs/PAYMENT_DATA.md)
+The full documentation with all available endpoints is in https://dev.gerencianet.com.br/.
+If you don't have a digital account atnetnet, [open yours now](https://sistema.gerencianet.com.br/)!
## License ##
[MIT](LICENSE)
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/composer.json b/lib/gerencianet/gerencianet/gerencianet-sdk-php/composer.json
index a302130..91bdd21 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/composer.json
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/composer.json
@@ -1,14 +1,10 @@
{
"name": "gerencianet/gerencianet-sdk-php",
"description": "GN API SDK PHP",
- "version": "1.0.9",
+ "version": "4.0.2",
"require": {
- "guzzlehttp/guzzle": "5.3.0",
- "php": ">=5.4.0",
- "codeclimate/php-test-reporter": "^0.1.2"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.6"
+ "guzzlehttp/guzzle": "^7.0",
+ "php": ">=7.2"
},
"license": "MIT",
"authors": [{
@@ -21,6 +17,22 @@
"name": "Talita Campos"
}, {
"name": "Thomaz Feitoza"
+ }, {
+ "name": "Filipe Mata"
+ }, {
+ "name": "Thiago Resende"
+ },{
+ "name": "Jéssica Gava"
+ },{
+ "name": "Guilherme Cota"
+ },{
+ "name": "Sady Coimbra"
+ },{
+ "name": "Matheus Rodrigues"
+ },{
+ "name": "João Oliveira"
+ },{
+ "name": "Paloma Brito"
}],
"autoload": {
"psr-0": {
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET.md
deleted file mode 100644
index 42360ab..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET.md
+++ /dev/null
@@ -1,316 +0,0 @@
-## Creating carnet billets
-
-Carnet is a payment method that generates a set of charges with the same payment information and customer in all of them.
-
-To generate a carnet, you have as required: the items, a customer, the expiration date of the first charge and the number of repeats (or parcels).
-
-If you want, you can also send some additional informations:
-
-- The metadata information (like in the banking billet), with notification_url and/or custom_id;
-- If the carnet must be send by post office service (choosing, inclusive, if you or your client must receive it);
-- If the total value must be split among every charges or if each charge must have the value;
-- The instructions to the carnet (At most 4 lines).
-
-Instantiate the module:
-
-```php
-require __DIR__.'/../../vendor/autoload.php';
-use Gerencianet\Exception\GerencianetException;
-use Gerencianet\Gerencianet;
-
-$options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'sandbox' => true
-];
-
-try {
- $api = new Gerencianet($options);
-
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-```
-
-### Setting the required properties to a carnet:
-`required`
-
-```php
-$items = [
- [
- 'name' => 'Item 1',
- 'amount' => 1,
- 'value' => 1000
- ],
- [
- 'name' => 'Item 2',
- 'amount' => 2,
- 'value' => 2000
- ]
-];
-
-$customer = [
- 'name' => 'Gorbadoc Oldbuck',
- 'cpf' => '04267484171',
- 'phone_number' => '5144916523'
-];
-
-$body = [
- 'items' => $items,
- 'customer' => $customer,
- 'repeats' => 5,
- 'expire_at' => '2020-12-02'
-];
-```
-
-### Setting metadata to a carnet:
-`optional`
-
-```php
-$items = [
- [
- 'name' => 'Item 1',
- 'amount' => 1,
- 'value' => 1000
- ],
- [
- 'name' => 'Item 2',
- 'amount' => 2,
- 'value' => 2000
- ]
-];
-
-$customer = [
- 'name' => 'Gorbadoc Oldbuck',
- 'cpf' => '04267484171',
- 'phone_number' => '5144916523'
-];
-
-$metadata = [
- 'custom_id' => 'Product 0001',
- 'notification_url' => 'http://domain.com/notification'
-];
-
-$body = [
- 'items' => $items,
- 'customer' => $customer,
- 'repeats' => 5,
- 'expire_at' => '2020-12-02',
- 'metadata' => $metadata
-];
-
-```
-
-The `notification_url` property will be used for notifications once things happen with charges status, as when it's payment was approved, for example. More about notifications [here](/docs/NOTIFICATION.md). The `custom_id` property can be used to set your own reference to the carnet.
-
-
-### Setting post office service information:
-`optional`
-
-If you want the carnet to arrive at your house or at your client's house, you can count on Gerencianet's post office service. Just send an extra attribute:
-
-```php
-$items = [
- [
- 'name' => 'Item 1',
- 'amount' => 1,
- 'value' => 1000
- ],
- [
- 'name' => 'Item 2',
- 'amount' => 2,
- 'value' => 2000
- ]
-];
-
-$customer = [
- 'name' => 'Gorbadoc Oldbuck',
- 'cpf' => '04267484171',
- 'phone_number' => '5144916523'
-];
-
-$postOfficeService = [
- 'send_to' => 'customer'
-];
-
-$body = [
- 'items' => $items,
- 'customer' => $customer,
- 'repeats' => 5,
- 'expire_at' => '2020-12-02',
- 'post_office_service' => $postOfficeService
-];
-```
-
-If `send_to` is set to *customer*, the carnet arrives at you customer's. If it is set to *seller*, just wait for it to arrive at your place!
-
-
-### Setting the split items information
-`optional`
-
-By default, each parcel has the total value of the carnet as its value. If you want to divide the total value of the carnet by all the parcels, set the `split_items` property to *true*.
-
-```php
-$items = [
- [
- 'name' => 'Item 1',
- 'amount' => 1,
- 'value' => 1000
- ],
- [
- 'name' => 'Item 2',
- 'amount' => 2,
- 'value' => 2000]
- ];
-
-$customer = [
- 'name' => 'Gorbadoc Oldbuck',
- 'cpf' => '04267484171',
- 'phone_number' => '5144916523'
-];
-
-$body = [
- 'items' => $items,
- 'customer' => $customer,
- 'repeats' => 5,
- 'expire_at' => '2020-12-02',
- 'splite_items' => true
-];
-```
-
-### Setting instructions
-`optional`
-
-If you want the carnet billet to have extra instructions, it's possible to send a maximum of 4 different instructions with a maximum of 90 caracters, just as follows:
-
-```php
-$items = [
- [
- 'name' => 'Item 1',
- 'amount' => 1,
- 'value' => 1000
- ],
- [
- 'name' => 'Item 2',
- 'amount' => 2,
- 'value' => 2000]
- ];
-
-$customer = [
- 'name' => 'Gorbadoc Oldbuck',
- 'cpf' => '04267484171',
- 'phone_number' => '5144916523'
-];
-
-$instructions = [
- 'Pay only with money',
- 'Do not pay with gold'
-];
-
-$body = [
- 'items' => $items,
- 'customer' => $customer,
- 'repeats' => 5,
- 'expire_at' => '2020-12-02',
- 'instructions' => $instructions
-];
-```
-
-### Finally, create the carnet:
-
-```php
-try {
- $api = new Gerencianet($options);
- $carnet = $api->createCarnet([], $body);
-
- print_r($carnet);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-Check out the response:
-
-```php
-
-Array
-(
- [code] => 200
- [data] => Array
- (
- [carnet_id] => 1002
- [charges] => Array
- (
- [0] => Array
- (
- [charge_id] => 1042
- [parcel] => 1
- [status] => waiting
- [value] => 5000
- [expire_at] => 2020-12-02
- [url] => https://visualizacao.gerencianet.com.br/emissao/28333_2579_NEMLUA0/A4CL-28333-65354-ENAMAL9/28333-65354-ENAMAL9
- [barcode] => 00190.00009 01523.894002 00065.354185 6 84570000005000
- )
-
- [1] => Array
- (
- [charge_id] => 1043
- [parcel] => 2
- [status] => waiting
- [value] => 5000
- [expire_at] => 2021-01-02
- [url] => https://visualizacao.gerencianet.com.br/emissao/28333_2579_NEMLUA0/A4CL-28333-65354-ENAMAL9/28333-65355-LELUA5
- [barcode] => 00190.00009 01523.894002 00065.354185 5 84880000005000
- )
-
- [2] => Array
- (
- [charge_id] => 1044
- [parcel] => 3
- [status] => waiting
- [value] => 5000
- [expire_at] => 2021-02-02
- [url] => https://visualizacao.gerencianet.com.br/emissao/28333_2579_NEMLUA0/A4CL-28333-65354-ENAMAL9/28333-65356-TANEM6
- [barcode] => 00190.00009 01523.894002 00065.354185 2 85190000005000
- )
-
- [3] => Array
- (
- [charge_id] => 1045
- [parcel] => 4
- [status] => waiting
- [value] => 5000
- [expire_at] => 2021-03-02
- [url] => https://visualizacao.gerencianet.com.br/emissao/28333_2579_NEMLUA0/A4CL-28333-65354-ENAMAL9/28333-65357-TADRO8
- [barcode] => 00190.00009 01523.894002 00065.354185 5 85470000005000
- )
-
- [4] => Array
- (
- [charge_id] => 1046
- [parcel] => 5
- [status] => waiting
- [value] => 5000
- [expire_at] => 2021-04-02
- [url] => https://visualizacao.gerencianet.com.br/emissao/28333_2579_NEMLUA0/A4CL-28333-65354-ENAMAL9/28333-65358-LUADA8
- [barcode] => 00190.00009 01523.894002 00065.354185 4 85780000005000
- )
-
- )
-
- )
-
-)
-
-```
-
-Notice that, as the `repeats` were set to 5, the output contains 5 charges with `waiting` status. The value of each charge is the sum of the items values, because the `split_items` property was set to *false*. Also notice that `expire_at` increases monthly.
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET_CREATE_HISTORY.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET_CREATE_HISTORY.md
deleted file mode 100644
index 08844f7..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET_CREATE_HISTORY.md
+++ /dev/null
@@ -1,44 +0,0 @@
-## Adding information to carnet's history
-
-It is possible to add information to the history of a carnet. These informations will be listed when [detailing a carnet](/docs/CARNET_DETAIL.md).
-
-The process to add information to history is shown below:
-
-
-```php
-require __DIR__.'/../../vendor/autoload.php';
-use Gerencianet\Exception\GerencianetException;
-use Gerencianet\Gerencianet;
-
-$options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'sandbox' => true
-];
-
-$params = ['id' => 1002];
-
-$body = ['description' => 'Info to be added to carnet history'];
-
-try {
- $api = new Gerencianet($options);
- $response = $api->createCarnetHistory($params, $body);
-
- print_r($response);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-```
-
-If everything goes well, the return will be:
-
-```php
-Array
-(
- [code] => 200
-)
-```
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET_DETAIL.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET_DETAIL.md
deleted file mode 100644
index 285f7e5..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET_DETAIL.md
+++ /dev/null
@@ -1,139 +0,0 @@
-## Detailing carnets
-
-In order to retrieve carnets, just provide the carnet_id:
-
-Instantiate the module:
-
-```php
-require __DIR__.'/../../vendor/autoload.php';
-use Gerencianet\Exception\GerencianetException;
-use Gerencianet\Gerencianet;
-
-$options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'sandbox' => true
-];
-
-try {
- $api = new Gerencianet($options);
-
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-```
-
-Then detail:
-
-
-```php
-$params = ['id' => 1002];
-
-try {
- $api = new Gerencianet($options);
- $carnet = $api->detailCarnet($params, []);
-
- print_r($carnet);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-As response, you will receive all information about the carnet:
-
-```php
-
-Array
-(
- [code] => 200
- [data] => Array
- (
- [carnet_id] => 1002
- [status] => active
- [repeats] => 5
- [cover] => https://visualizacao.gerencianet.com.br/emissao/28333_2579_NEMLUA0/A4CC-28333-65354-ENAMAL9/28333-65354-ENAMAL9
- [value] => 25000
- [split_items] => false
- [charges] => Array
- (
- [0] => Array
- (
- [charge_id] => 1042
- [parcel] => 1
- [status] => waiting
- [value] => 5000
- [expire_at] => 2020-12-02
- [url] => https://visualizacao.gerencianet.com.br/emissao/28333_2579_NEMLUA0/A4CL-28333-65354-ENAMAL9/28333-65354-ENAMAL9
- [barcode] => 00190.00009 01523.894002 00065.354185 6 84570000005000
- )
-
- [1] => Array
- (
- [charge_id] => 1043
- [parcel] => 2
- [status] => waiting
- [value] => 5000
- [expire_at] => 2021-01-02
- [url] => https://visualizacao.gerencianet.com.br/emissao/28333_2579_NEMLUA0/A4CL-28333-65354-ENAMAL9/28333-65355-LELUA5
- [barcode] => 00190.00009 01523.894002 00065.354185 5 84880000005000
- )
-
- [2] => Array
- (
- [charge_id] => 1044
- [parcel] => 3
- [status] => waiting
- [value] => 5000
- [expire_at] => 2021-02-02
- [url] => https://visualizacao.gerencianet.com.br/emissao/28333_2579_NEMLUA0/A4CL-28333-65354-ENAMAL9/28333-65356-TANEM6
- [barcode] => 00190.00009 01523.894002 00065.354185 2 85190000005000
- )
-
- [3] => Array
- (
- [charge_id] => 1045
- [parcel] => 4
- [status] => waiting
- [value] => 5000
- [expire_at] => 2021-03-02
- [url] => https://visualizacao.gerencianet.com.br/emissao/28333_2579_NEMLUA0/A4CL-28333-65354-ENAMAL9/28333-65357-TADRO8
- [barcode] => 00190.00009 01523.894002 00065.354185 5 85470000005000
- )
-
- [4] => Array
- (
- [charge_id] => 1046
- [parcel] => 5
- [status] => waiting
- [value] => 5000
- [expire_at] => 2021-04-02
- [url] => https://visualizacao.gerencianet.com.br/emissao/28333_2579_NEMLUA0/A4CL-28333-65354-ENAMAL9/28333-65358-LUADA8
- [barcode] => 00190.00009 01523.894002 00065.354185 4 85780000005000
- )
-
- )
-
- [created_at] => 2015-07-27 14:07:52
- [history] => Array
- (
- [0] => Array
- (
- [message] => Carnê ativo
- [created_at] => 2015-07-27 14:07:53
- )
-
- )
- )
-
-)
-
-```
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET_RESEND.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET_RESEND.md
deleted file mode 100644
index 136af4a..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET_RESEND.md
+++ /dev/null
@@ -1,38 +0,0 @@
-### Resending the carnet
-
-To resend the carnet, the carnet must have a `active` status.
-
-If the carnet contemplates this requirement, you just have to provide the carnet id and a email to resend it:
-
-```php
-$params = [
- 'id' => 1002
-];
-
-$body = [
- 'email' => 'oldbuck@gerencianet.com.br'
-];
-
-try {
- $api = new Gerencianet($options);
- $response = $api->resendCarnet($params, $body);
-
- print_r($response);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-If everything goes well, the return will be:
-
-```php
-Array
-(
- [code] => 200
-)
-```
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET_RESEND_PARCEL.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET_RESEND_PARCEL.md
deleted file mode 100644
index 0e7ffbc..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET_RESEND_PARCEL.md
+++ /dev/null
@@ -1,39 +0,0 @@
-### Resending carnet parcel
-
-To resend the carnet parcel, the parcel must have a `waiting` status.
-
-If the parcel contemplates this requirement, you just have to provide the carnet id, the parcel number and a email to resend it:
-
-```php
-$params = [
- 'id' => 1002,
- 'parcel' => 2
-];
-
-$body = [
- 'email' => 'oldbuck@gerencianet.com.br'
-];
-
-try {
- $api = new Gerencianet($options);
- $response = $api->resendParcel($params, $body);
-
- print_r($response);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-If everything goes well, the return will be:
-
-```php
-Array
-(
- [code] => 200
-)
-```
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET_UPDATE.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET_UPDATE.md
deleted file mode 100644
index 0b92d12..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CARNET_UPDATE.md
+++ /dev/null
@@ -1,100 +0,0 @@
-## Updating carnets
-
-### Changing the metadata
-
-You can update the `custom_id` or the `notification_url` of a carnet at any time you want.
-
-Is important to know that it updates all the charges of the carnet. If you want to update only one, see [Updating charges](/docs/CHARGE_UPDATE.md).
-
-Instantiate the module:
-
-```php
-require __DIR__.'/../../vendor/autoload.php';
-use Gerencianet\Exception\GerencianetException;
-use Gerencianet\Gerencianet;
-
-$options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'sandbox' => true
-];
-
-try {
- $api = new Gerencianet($options);
-
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-```
-Then update metadata:
-
-```php
-$params = ['id' => 1002];
-
-$body = [
- 'custom_id' => 'Carnet 0001',
- 'notification_url' => 'http://domain.com/notification'
-];
-
-try {
- $api = new Gerencianet($options);
- $carnet = $api->updateCarnetMetadata($params, $body);
-
- print_r($carnet);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-If everything goes well, the return will be:
-
-```php
-Array
-(
- [code] => 200
-)
-```
-
-### Updating the expiration date of a parcel
-
-To update or set an expiration date to a parcel, the parcel must have a `waiting` or 'unpaid' status. You just have to provide the `carnet_id`, the number of the parcel (`parcel`) and a new expiration date (`expire_at`):
-
-```php
-$params = ['id' => 1002, 'parcel' => 2];
-
-$body = [
- 'expire_at' => '2018-01-01'
-];
-
-try {
- $api = new Gerencianet($options);
- $carnet = $api->updateParcel($params, $body);
-
- print_r($carnet);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-If everything goes well, the return will be:
-
-```php
-Array
-(
- [code] => 200
-)
-```
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CHARGE.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CHARGE.md
deleted file mode 100644
index 13adaa0..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CHARGE.md
+++ /dev/null
@@ -1,150 +0,0 @@
-## Creating charges
-
-Charges have one or more items. That's it.
-
-Instantiate the module:
-
-```php
-require __DIR__.'/../../vendor/autoload.php';
-use Gerencianet\Exception\GerencianetException;
-use Gerencianet\Gerencianet;
-
-$options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'sandbox' => true
-];
-
-try {
- $api = new Gerencianet($options);
-
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-```
-
-### Adding items:
-```php
-$items = [
- [
- 'name' => 'Item 1',
- 'amount' => 1,
- 'value' => 1000
- ],
- [
- 'name' => 'Item 2',
- 'amount' => 2,
- 'value' => 2000
- ]
-];
-
-$body = [
- 'items' => $items
-];
-```
-
-### Adding shipping costs to a charge **(optional)**:
-
-In order to be the most agnostic as possible about how the user handles shippings, the API just receives an array with the values. You can add as many as you want. Sometimes you'll want a shipping cost to be received by another person/account. In this case, you must provide the `payee_code`. The *Additional Shipping* in the example below will be passed on to the referenced account after the payment.
-
-```php
-$items = [
- [
- 'name' => 'Item 1',
- 'amount' => 1,
- 'value' => 1000
- ],
- [
- 'name' => 'Item 2',
- 'amount' => 2,
- 'value' => 2000
- ]
-];
-
-$shippings = [
- [
- 'name' => 'My Shipping',
- 'value' => 2000
- ],
- [
- 'name' => 'Shipping to someone else',
- 'value' => 1000,
- 'payee_code' => 'GEZTAMJYHA3DAMBQGAYDAMRYGMZTGMBRGI'
- ]
-];
-
-$body = [
- 'items' => $items,
- 'shippings' => $shippings
-];
-```
-
-### Charge `metadata` attribute:
-
-```php
-$items = [
- [
- 'name' => 'Item 1',
- 'amount' => 1,
- 'value' => 1000
- ],
- [
- 'name' => 'Item 2',
- 'amount' => 2,
- 'value' => 2000
- ]
-];
-
-$metadata = [
- 'custom_id' => 'Product 0001',
- 'notification_url' => 'http://my_domain.com/notification'
-];
-
-$body = [
- 'items' => $items,
- 'metadata' => $metadata
-];
-```
-
-The `notification_url` property will be used for sending notifications once things happen with charges statuses, as when it's payment was approved, for example. More about notifications [here](/docs/NOTIFICATION.md). The `custom_id` property can be used to set your own reference to the charge.
-
-
-### Finally, create the charge:
-
-```php
-try {
- $api = new Gerencianet($options);
- $charge = $api->createCharge([], $body);
-
- print_r($charge);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-Check out the response:
-
-```php
-Array
-(
- [code] => 200
- [data] => Array
- (
- [charge_id] => 1000
- [total] => 5000
- [status] => new
- [custom_id] =>
- [created_at] => 2015-07-27 11:48:44
- )
-
-)
-```
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CHARGE_CREATE_HISTORY.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CHARGE_CREATE_HISTORY.md
deleted file mode 100644
index e5b8b3f..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CHARGE_CREATE_HISTORY.md
+++ /dev/null
@@ -1,44 +0,0 @@
-## Adding information to charge's history
-
-It is possible to add information to the history of a charge. These informations will be listed when [detailing a charge](/docs/CHARGE_DETAIL.md).
-
-The process to add information to history is shown below:
-
-
-```php
-require __DIR__.'/../../vendor/autoload.php';
-use Gerencianet\Exception\GerencianetException;
-use Gerencianet\Gerencianet;
-
-$options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'sandbox' => true
-];
-
-$params = ['id' => 1000];
-
-$body = ['description' => 'Info to be added to charges history'];
-
-try {
- $api = new Gerencianet($options);
- $response = $api->createChargeHistory($params, $body);
-
- print_r($response);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-```
-
-If everything goes well, the return will be:
-
-```php
-Array
-(
- [code] => 200
-)
-```
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CHARGE_DETAIL.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CHARGE_DETAIL.md
deleted file mode 100644
index 2540a83..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CHARGE_DETAIL.md
+++ /dev/null
@@ -1,102 +0,0 @@
-## Detailing charges
-
-Instantiate the module:
-
-```php
-require __DIR__.'/../../vendor/autoload.php';
-use Gerencianet\Exception\GerencianetException;
-use Gerencianet\Gerencianet;
-
-$options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'sandbox' => true
-];
-
-try {
- $api = new Gerencianet($options);
-
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-```
-
-It's very simple to get details from a charge. You just need the id:
-
-```php
-$params = ['id' => 1000];
-
-try {
- $api = new Gerencianet($options);
- $charge = $api->detailCharge($params, []);
-
- print_r($charge);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-As response, you will receive all the information about the charge (including if it belongs to a subscription or carnet):
-
-```php
-
-Array
-(
- [code] => 200
- [data] => Array
- (
- [charge_id] => 1000
- [total] => 5000
- [status] => canceled
- [custom_id] =>
- [created_at] => 2015-07-27 09:43:05
- [notification_url] =>
- [items] => Array
- (
- [0] => Array
- (
- [name] => Item 1
- [value] => 1000
- [amount] => 1
- )
-
- [1] => Array
- (
- [name] => Item 2
- [value] => 2000
- [amount] => 2
- )
-
- )
-
- [history] => Array
- (
- [0] => Array
- (
- [message] => Cobrança criada
- [created_at] => 2015-07-27 09:43:05
- )
-
- [1] => Array
- (
- [message] => Cobrança cancelada
- [created_at] => 2015-07-27 10:22:43
- )
-
- )
-
- )
-
-)
-
-
-```
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CHARGE_PAYMENT.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CHARGE_PAYMENT.md
deleted file mode 100644
index 395d8b3..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CHARGE_PAYMENT.md
+++ /dev/null
@@ -1,236 +0,0 @@
-## Paying charges
-
-There are two ways of giving sequence to a charge. You can generate a banking billet so it is payable until its due date, or can use the customer's credit card to submit the payment.
-
-Instantiate the module:
-
-```php
-require __DIR__.'/../../vendor/autoload.php';
-use Gerencianet\Exception\GerencianetException;
-use Gerencianet\Gerencianet;
-
-$options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'sandbox' => true
-];
-
-try {
- $api = new Gerencianet($options);
-
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-```
-
-### 1. Banking billets
-
-Setting banking billet as a charge's payment method is simple. You have to use `banking_billet` as the payment method and inform the `charge_id`.
-
-```php
-$params = ['id' => 1000];
-
-$customer = [
- 'name' => 'Gorbadoc Oldbuck',
- 'cpf' => '04267484171',
- 'phone_number' => '5144916523'
-];
-
-$body = [
- 'payment' => [
- 'banking_billet' => [
- 'expire_at' => '2018-12-12',
- 'customer' => $customer
- ]
- ]
-];
-
-try {
- $api = new Gerencianet($options);
- $charge = $api->payCharge($params, $body);
-
- print_r($charge);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-You'll receive the payment info, such as the barcode and the billet link:
-
-```php
-Array
-(
- [code] => 200
- [data] => Array
- (
- [charge_id] => 1000
- [total] => 5000
- [payment] => banking_billet
- [barcode] => 00190.00009 01523.894002 00065.309189 4 99280123005000
- [link] => https://visualizacao.gerencianet.com.br/emissao/99999_2578_ENASER3/A4XB-99999-65309-NEMDO2
- [expire_at] => 2018-12-12
- )
-
-)
-```
-
-If you want the banking billet to have extra instructions, it's possible to send a maximum of 4 different instructions with a maximum of 90 caracters, just as follows:
-
-```php
-$params = ['id' => 1000];
-
-$customer = [
- 'name' => 'Gorbadoc Oldbuck',
- 'cpf' => '04267484171',
- 'phone_number' => '5144916523'
-];
-
-$instructions = [
- 'Pay only with money',
- 'Do not pay with gold'
-];
-
-$body = [
- 'payment' => [
- 'banking_billet' => [
- 'expire_at' => '2018-12-12',
- 'customer' => $customer,
- 'instructions' => $instructions
- ]
- ]
-];
-
-```
-
-### 2. Credit card
-
-The most common payment method is to use a credit card in order to make things happen faster. Paying a charge with a credit card in Gerencianet is as simples as generating a banking billet, as seen above.
-
-The difference here is that we need to provide some extra information, as a `billing_address` and a `payment_token`. The former is used to make an anti-fraud analyze before accepting/appoving the payment, the latter identifies a credit card at Gerencianet, so that you don't need to bother about keeping track of credit card numbers. The `installments` attribute is self-explanatory.
-
-We'll talk about getting payment tokens later. For now, let's take a look at the snipet that does the work we're aiming for:
-
-```php
-$params = ['id' => 1000];
-
-$paymentToken = 'payment_token';
-
-$customer = [
- 'name' => 'Gorbadoc Oldbuck',
- 'cpf' => '04267484171',
- 'phone_number' => '5144916523',
- 'email' => 'oldbuck@gerencianet.com.br',
- 'birth' => '1977-01-15'
-];
-
-$billingAddress = [
- 'street' => 'Av. JK',
- 'number' => 909,
- 'neighborhood' => 'Bauxita',
- 'zipcode' => '35400000',
- 'city' => 'Ouro Preto',
- 'state' => 'MG',
-];
-
-$body = [
- 'payment' => [
- 'credit_card' => [
- 'installments' => 1,
- 'billing_address' => $billingAddress,
- 'payment_token' => $paymentToken,
- 'customer' => $customer
- ]
- ]
-];
-
-try {
- $api = new Gerencianet($options);
- $charge = $api->payCharge($params, $body);
-
- print_r($charge);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-If everything went well, the response will come with the total value, installments number and the value of each installment:
-
-```php
-
-Array
-(
- [code] => 200
- [data] => Array
- (
- [charge_id] => 1000
- [total] => 5000
- [payment] => credit_card
- [installments] => 1
- [installment_value] => 5000
- )
-
-)
-
-```
-
-##### Payment tokens
-
-A `payment_token` represents a credit card number at Gerencianet.
-
-For testing purposes, you can go to your application playground in your Gerencianet's account. At the payment endpoint you'll see a button that generates one token for you. This payment token will point to a random test credit card number.
-
-When in production, it will depend if your project is a web app or a mobile app.
-
-For web apps you should follow this [guide](https://docs.gerencianet.com.br/#!/charges/checkout/card). It basically consists of copying/pasting a script tag in your checkout page.
-
-For mobile apps you should use this [SDK for Android](https://github.com/gerencianet/gn-api-sdk-android) or this [SDK for iOS](https://github.com/gerencianet/gn-api-sdk-ios).
-
-### 3. Discount by payment method
-
-It is possible to set discounts based on payment. You just need to add an `discount` attribute within `banking_billet` or `credit_card` tags.
-
-The example below shows how to do this for credit card payments.
-
-```php
-
-$discount = [
- 'type' => 'currency',
- 'value'=> 1000
-];
-
-$body = [
- 'payment' => [
- 'credit_card' => [
- 'installments' => 1,
- 'billing_address' => $billingAddress,
- 'payment_token' => $paymentToken,
- 'customer' => $customer,
- 'discount' => $discount
- ]
- ]
-];
-
-```
-Discounts for banking billets works similar to credit cards. You just need to add the `discount` attribute.
-
-The discount may be applied as percentage or with a previous calculated value.
-
-The `type` property is used to specify how the discount will work. It may be set as *currency* or *percentage*.
-
-The first will discount the amount specified in `value` property as *cents*, so, in the example above the amount paid by the customer will be equal `(Charge's value) - R$ 10,00`.
-
-However, if the discount type is set to *percentage*, the amount will be `(Charge's value) - 10%`.
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CHARGE_UPDATE.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CHARGE_UPDATE.md
deleted file mode 100644
index 7df39cc..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/CHARGE_UPDATE.md
+++ /dev/null
@@ -1,99 +0,0 @@
-## Updating charges
-
-Instantiate the module:
-
-```php
-require __DIR__.'/../../vendor/autoload.php';
-use Gerencianet\Exception\GerencianetException;
-use Gerencianet\Gerencianet;
-
-$options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'sandbox' => true
-];
-
-try {
- $api = new Gerencianet($options);
-
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-```
-
-### Changing the metadata
-
-You can update the `custom_id` or the `notification_url` of a charge at any time you want:
-
-```php
-$params = ['id' => 1000];
-
-$body = [
- 'custom_id' => 'Product 0001',
- 'notification_url' => 'http://domain.com/notification'
-];
-
-try {
- $api = new Gerencianet($options);
- $charge = $api->updateChargeMetadata($params, $body);
-
- print_r($charge);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-If everything goes well, the return will be:
-
-```php
-Array
-(
- [code] => 200
-)
-```
-
-### Updating the expiration date of a billet
-
-To update or set a expiration date to a charge, the charge must have a `waiting` or `unpaid` status, and the payment method chosen must be `banking_billet`.
-
-If the charge contemplates these requirements, you just have to provide the charge id and a new expiration date:
-
-```php
-$params = ['id' => 1000];
-
-$body = [
- 'expire_at' => '2016-01-01'
-];
-
-try {
- $api = new Gerencianet($options);
- $charge = $api->updateBillet($params, $body);
-
- print_r($charge);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-If everything goes well, the return will be:
-
-```php
-Array
-(
- [code] => 200
-)
-```
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/MARKETPLACE.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/MARKETPLACE.md
deleted file mode 100644
index 3d63c42..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/MARKETPLACE.md
+++ /dev/null
@@ -1,100 +0,0 @@
-## Creating charges with marketplace
-
-What if your web store contains products from many different sellers from many different segments? The user can complete a single purchase with products from more than one seller, right? Here enters marketplace.
-
-With some extra attributes, you can tell Gerencianet to pass on a percentage amount of the purchase total value to someone else.
-
-Instantiate the module:
-
-```php
-require __DIR__.'/../../vendor/autoload.php';
-use Gerencianet\Exception\GerencianetException;
-use Gerencianet\Gerencianet;
-
-$options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'sandbox' => true
-];
-
-try {
- $api = new Gerencianet($options);
-
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-```
-
-Create the charge object including a marketplace object:
-
-```php
-$marketplace = [
- 'repasses' => [
- [
- payee_code => "GEZTAMJYHA3DAMBQGAYDAMRYGMZTGM",
- percentage => 2500
- ],
- [
- payee_code => "AKSLJI3DAMBQGSKLJDYDAMRTGOPWKS",
- percentage => 2500
- ]
- ]
-];
-
-$items = [
- [
- 'name' => 'Item 1',
- 'amount' => 1,
- 'value' => 1000,
- 'marketplace' => $marketplace
- ]
-];
-
-$body = [
- 'items' => $items
-];
-```
-
-Create the charge:
-
-```php
-try {
- $api = new Gerencianet($options);
- $charge = $api->createCharge([], $body);
-
- print_r($charge);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-The attribute `payee_code` identifies a Gerencianet account, just like in [creating charges with shippings](/docs/CHARGE.md). In order to get someone else's `payee_code` you need to ask the account owner. There is no other way. To visualize yours, log in your Gerencianet account and search for *Identificador de Conta* under *Dados Cadastrais*.
-
-In the example above, there are two repasses, both of 25%, but each one for a different account, whereas the `payee_code` differs. The integrator account will receive, at the end, 50% of the total value. Disregarding the rates, the integrator account would receive R$5,00. The other two accounts would receive R$ 2,50 each.
-
-The response is the same as usual:
-
-```php
-Array
-(
- [code] => 200
- [data] => Array
- (
- [charge_id] => 1039
- [total] => 5000
- [status] => new
- [custom_id] =>
- [created_at] => 2015-07-27 11:48:44
- )
-
-)
-```
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/NOTIFICATION.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/NOTIFICATION.md
deleted file mode 100644
index c75c4de..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/NOTIFICATION.md
+++ /dev/null
@@ -1,166 +0,0 @@
-# Notifications
-Instantiate the module:
-
-```php
-require __DIR__.'/../../vendor/autoload.php';
-use Gerencianet\Exception\GerencianetException;
-use Gerencianet\Gerencianet;
-
-$options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'sandbox' => true
-];
-
-try {
- $api = new Gerencianet($options);
-
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-```
-
-Any changes that happen in the charges will trigger an event that notifies the `notification_url` provided at creation time (see [creating charges](/docs/CHARGE.md)).
-
-It's also possible to set or change the `notification_url` for existing charges, see [updating informations](/docs/CHARGE_UPDATE.md).
-
-Given that a charge has a valid `notification_url`, when the notification time comes you'll receive a post with a `token`. This token must be used to get the notification payload data.
-
-The example below assumes that you're using receiving posts at php's $_POST variable.
-
-```php
-$params = ['token' => $_POST['notification']];
-
-try {
- $api = new Gerencianet($options);
- $notification = $api->getNotification($params, []);
-
- print_r($notification);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-```
-
-Response:
-
-```php
-Array
-(
- [code] => 200
- [data] => Array
- (
- [0] => Array
- (
- [id] => 1
- [type] => charge
- [custom_id] =>
- [status] => Array
- (
- [current] => new
- [previous] =>
- )
-
- [identifiers] => Array
- (
- [charge_id] => 1002
- )
-
- )
-
- [1] => Array
- (
- [id] => 2
- [type] => charge
- [custom_id] =>
- [status] => Array
- (
- [current] => waiting
- [previous] => new
- )
-
- [identifiers] => Array
- (
- [charge_id] => 1002
- )
-
- )
-
- [2] => Array
- (
- [id] => 3
- [type] => charge
- [custom_id] =>
- [status] => Array
- (
- [current] => paid
- [previous] => waiting
- )
-
- [identifiers] => Array
- (
- [charge_id] => 1002
- )
-
- [value] => 2000
- )
-
- [3] => Array
- (
- [id] => 4
- [type] => charge
- [custom_id] =>
- [status] => Array
- (
- [current] => refunded
- [previous] => paid
- )
-
- [identifiers] => Array
- (
- [charge_id] => 1002
- )
-
- )
-
- )
-
-)
-```
-
-Response will be an array with all changes of a token that happened within 6 months, and it contains the following parameters:
-
-* id: Each notification has its own sequence, starting from `1` and the `id` parameter is used to mark this sequence. This is useful if you need to keep track which change you have already processed.
-
-* type: The type of this change. The available values are:
- * `charge` - a charge have changed.
- * `subscription` - a subscription have changed.
- * `carnet` - a carnet have changed.
- * `subscription_charge` - one subscription's parcel have changed.
- * `carnet_charge` - one carnet's parcel have changed.
-
-
-* custom_id: Your custom_id.
-
-* status: Status of the transaction. It contains the `current` status and `previous` status (before the change) of this transaction.
-
- p.s.: if there is no `previous` status (i.e.: for new charges), the `previous` value will be null.
-
-* identifiers: Identifiers related to this change. It may have one or more identifier depending on the type:
- * for `charge` type: identifiers will contain only `charge_id`.
- * for `subscription` type: identifiers will contain only `subscription_id`.
- * for `carnet` type: identifiers will contain only `carnet_id`.
- * for `subscription_charge` type: identifiers will contain both `charge_id` and `subscription_id`.
- * for `carnet_charge` type: identifiers will contain both `charge_id` and `carnet_id`.
-
-
-* value: this parameter will only be shown when the change is about paid charges.
-
- For more informations about notifications, please, refer to [Gerencianet](https://docs.gerencianet.com.br/#!/charges/notifications).
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/PAYMENT_DATA.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/PAYMENT_DATA.md
deleted file mode 100644
index 2eeb6b1..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/PAYMENT_DATA.md
+++ /dev/null
@@ -1,165 +0,0 @@
-## Payment data - listing installments
-
-If you ever need to get the total value for a charge, including rates and interests, as well as each installment value, even before the payment itself, you can.
-
-Why would I need this?
-
-Sometimes you need to check the total for making a discount, or simple to show a combobox with the installments for your users.
-
-Stop bragging about. Here is the code:
-
-```php
-require __DIR__.'/../../vendor/autoload.php';
-use Gerencianet\Exception\GerencianetException;
-use Gerencianet\Gerencianet;
-
-$options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'sandbox' => true
-];
-
-$params = ['total' => '2000', 'brand' => 'visa'];
-
-try {
- $api = new Gerencianet($options);
- $installments = $api->getInstallments($params, []);
-
- print_r($installments);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-And the response:
-
-```php
-Array
-(
- [code] => 200
- [data] => Array
- (
- [rate] => 0
- [name] => visa
- [installments] => Array
- (
- [0] => Array
- (
- [installment] => 1
- [has_interest] =>
- [value] => 20000
- [currency] => 200,00
- [interest_percentage] => 199
- )
-
- [1] => Array
- (
- [installment] => 2
- [has_interest] => 1
- [value] => 10402
- [currency] => 104,02
- [interest_percentage] => 199
- )
-
- [2] => Array
- (
- [installment] => 3
- [has_interest] => 1
- [value] => 7073
- [currency] => 70,73
- [interest_percentage] => 199
- )
-
- [3] => Array
- (
- [installment] => 4
- [has_interest] => 1
- [value] => 5410
- [currency] => 54,10
- [interest_percentage] => 199
- )
-
- [4] => Array
- (
- [installment] => 5
- [has_interest] => 1
- [value] => 4414
- [currency] => 44,14
- [interest_percentage] => 199
- )
-
- [5] => Array
- (
- [installment] => 6
- [has_interest] => 1
- [value] => 3752
- [currency] => 37,52
- [interest_percentage] => 199
- )
-
- [6] => Array
- (
- [installment] => 7
- [has_interest] => 1
- [value] => 3280
- [currency] => 32,80
- [interest_percentage] => 199
- )
-
- [7] => Array
- (
- [installment] => 8
- [has_interest] => 1
- [value] => 2927
- [currency] => 29,27
- [interest_percentage] => 199
- )
-
- [8] => Array
- (
- [installment] => 9
- [has_interest] => 1
- [value] => 2653
- [currency] => 26,53
- [interest_percentage] => 199
- )
-
- [9] => Array
- (
- [installment] => 10
- [has_interest] => 1
- [value] => 2436
- [currency] => 24,36
- [interest_percentage] => 199
- )
-
- [10] => Array
- (
- [installment] => 11
- [has_interest] => 1
- [value] => 2258
- [currency] => 22,58
- [interest_percentage] => 199
- )
-
- [11] => Array
- (
- [installment] => 12
- [has_interest] => 1
- [value] => 2111
- [currency] => 21,11
- [interest_percentage] => 199
- )
-
- )
-
- )
-
-)
-
-```
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/PLAN_LIST.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/PLAN_LIST.md
deleted file mode 100644
index d623fe2..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/PLAN_LIST.md
+++ /dev/null
@@ -1,58 +0,0 @@
-## Listing plans
-
-Listing plans is pretty simple. There are no required parameters for this, although you can use special query parameters can be used to filter your search.
-By default, the search will bring back 20 registers and always start from offset 0.
-The example below shows how to use it:
-
-```php
-$params = [
- 'name' => 'My plan',
- 'limit' => 20,
- 'offset' => 0
-];
-
-try {
- $api = new Gerencianet($options);
- $plans = $api->getPlans($params, []);
-
- print_r($plans);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-```
-
-If the filters are correct, the response will be an array like this:
-```php
-
-Array
-(
- [code] => 200
- [data] => Array
- (
- [0] => Array
- (
- [id] => 1
- [name] => My plan
- [interval] => 12
- [repeats] => 2
- [created_at] => 2015-07-22T12:33:06.000Z
- [updated_at] => 2015-07-22T12:33:06.000Z
- )
- [1] => Array
- (
- [id] => 2
- [name] => My other plan
- [interval] => 1
- [repeats] => 12
- [created_at] => 2014-12-22T12:33:06.000Z
- [updated_at] => 2014-12-22T12:33:06.000Z
- )
-
- )
-
-)
-```
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/RESEND_BILLET.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/RESEND_BILLET.md
deleted file mode 100644
index c0e6c0f..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/RESEND_BILLET.md
+++ /dev/null
@@ -1,36 +0,0 @@
-### Resending billet
-
-To resend the charge's billet, the charge must have a `waiting` status, and the payment method chosen must be `banking_billet`.
-
-If the charge contemplates these requirements, you just have to provide the charge id and a email to resend the billet:
-
-```php
-$params = ['id' => 1000];
-
-$body = [
- 'email' => 'oldbuck@gerencianet.com.br'
-];
-
-try {
- $api = new Gerencianet($options);
- $response = $api->resendBillet($params, $body);
-
- print_r($response);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-If everything goes well, the return will be:
-
-```php
-Array
-(
- [code] => 200
-)
-```
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/SUBSCRIPTION.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/SUBSCRIPTION.md
deleted file mode 100644
index 9ef97e8..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/SUBSCRIPTION.md
+++ /dev/null
@@ -1,151 +0,0 @@
-## Creating subscriptions
-
-If you ever have to recurrently charge your clients, you can create a different kind of charge, one that belongs to a subscription. This way, subsequent charges will be automatically created based on plan configuration and the charge value is charged in your customers' credit card, or the banking billet is generated and sent to costumer, accoding to plan’s configuration.
-
-The plan configuration receive two params, that are repeats and interval:
-
-The `repeats` parameter defines how many times the transaction will be repeated. If you don't pass it, the subscription will create charges indefinitely.
-
-The `interval` parameter defines the interval, in months, that a charge has to be generated. The minimum value is 1, and the maximum is 24. So, define "1" if you want monthly creations for example.
-
-It's worth to mention that this mechanics is triggered only if the customer commits the subscription. In other words, it takes effect when the customer pays the first charge.
-
-At first, you need to to create a plan. Then, you create a charge passing a plan_id to generate a subscription. You can use the same plan_id whenever you want.
-
-First instantiate the module:
-
-```php
-require __DIR__.'/../../vendor/autoload.php';
-use Gerencianet\Exception\GerencianetException;
-use Gerencianet\Gerencianet;
-
-$options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'sandbox' => true
-];
-
-try {
- $api = new Gerencianet($options);
-
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-```
-
-### Creating and setting a plan to a subscription:
-
-```php
-$body = [
- 'name' => 'My plan',
- 'interval' => 2,
- 'repeats' => null
-];
-
-try {
- $api = new Gerencianet($options);
- $plan = $api->createPlan([], $body);
-
- print_r($plan);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-### Creating the subscription:
-
-```php
-$params = ['id' => 1000];
-
-$items = [
- [
- 'name' => 'Item 1',
- 'amount' => 1,
- 'value' => 1000
- ],
- [
- 'name' => 'Item 2',
- 'amount' => 2,
- 'value' => 2000
- ]
-];
-
-$body = [
- 'items' => $items
-];
-
-try {
- $api = new Gerencianet($options);
- $subscription = $api->createSubscription($params, $body);
-
- print_r($subscription);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-### Deleting a plan:
-*(works just for plans that hasn't a subscription associated):*
-
-```php
-$params = ['id' => 1000];
-
-try {
- $api = new Gerencianet($options);
- $plan = $api->deletePlan($params, []);
-
- print_r($plan);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-### Canceling subscriptions
-
-You can cancel active subscriptions at any time:
-
-```php
-$params = ['id' => 1000];
-
-try {
- $api = new Gerencianet($options);
- $subscription = $api->cancelSubscription($params, []);
-
- print_r($subscription);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-If everything goes well, the return will be:
-
-```php
-Array
-(
- [code] => 200
-)
-```
-
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/SUBSCRIPTION_DETAIL.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/SUBSCRIPTION_DETAIL.md
deleted file mode 100644
index 9b3de14..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/SUBSCRIPTION_DETAIL.md
+++ /dev/null
@@ -1,62 +0,0 @@
-## Detailing subscriptions
-
-Works just like the last example, but here you pass the subscription id:
-
-```php
-$params = ['id' => 0];
-
-try {
- $api = new Gerencianet($options);
- $subscription = $api->detailSubscription($params, []);
-
- print_r($subscription);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-If everything goes well, the return will be:
-
-```php
-Array
-(
- [code] => 200
- [data] => Array
- (
- [subscription_id] => 4
- [value] => 5000
- [status] => active
- [payment_method] => credit_card
- [next_execution] =>
- [next_expire_at] =>
- [plan] => Array
- (
- [plan_id] => 1
- [name] => Master of fear
- [interval] => 12
- [repeats] => 2
- )
-
- [occurrences] => 1
- [created_at] => 2015-07-27 10:51:12
- [history] => Array
- (
- [0] => Array
- (
- [charge_id] => 1034
- [status] => waiting
- [created_at] => 2015-07-27 10:51:12
- )
-
- )
-
- )
-
-)
-```
-
-Note that if you [detail a charge](/docs/CHARGE_DETAIL.md) that belongs to a subscription, the response will have a `subscription_id`.
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/SUBSCRIPTION_PAYMENT.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/SUBSCRIPTION_PAYMENT.md
deleted file mode 100644
index 290348e..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/SUBSCRIPTION_PAYMENT.md
+++ /dev/null
@@ -1,231 +0,0 @@
-## Paying subscriptions
-
-There is two ways of giving sequence to a subscription *banking billet* or *credit card*.
-
-Instantiate the module:
-
-```php
-require __DIR__.'/../../vendor/autoload.php';
-use Gerencianet\Exception\GerencianetException;
-use Gerencianet\Gerencianet;
-
-$options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'sandbox' => true
-];
-
-try {
- $api = new Gerencianet($options);
-
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-```
-
-
-### 1. Banking billets
-
-To submit the payment with banking billet, you just need define the customer and the expire at to first charge:
-
-```php
-$params = ['id' => 1000];
-
-$customer = [
- 'name' => 'Gorbadoc Oldbuck',
- 'cpf' => '04267484171',
- 'phone_number' => '5144916523'
-];
-
-$body = [
- 'payment' => [
- 'banking_billet' => [
- 'expire_at' => '2018-12-12',
- 'customer' => $customer
- ]
- ]
-];
-
-try {
- $api = new Gerencianet($options);
- $subscription = $api->paySubscription($params, $body);
-
- print_r($subscription);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-If everything went well, the response will come with barcode, link to banking billet and the value oh each installment:
-
-```php
-Array
-(
- [code] => 200
- [data] => Array
- (
- [subscription_id] => 6
- [status] => active
- [barcode] => 00190.00009 01523.894002 00065.309189 4 99280123005000
- [link] => https://visualizacao.gerencianet.com.br/emissao/99999_2578_ENASER3/A4XB-99999-65309-NEMDO2
- [expire_at] => 2018-12-12
- [plan] => Array
- (
- [id] => 1000
- [interval] => 2
- [repeats] =>
- )
- [charge] => Array
- (
- [id] => 1053
- [status] => waiting
- )
- [total] => 5000
- [payment] => banking_billet
- )
-)
-
-```
-
-### 2. Credit card
-
-As we know, the credit card information is confidential, so, you need to prepare your system to send this information in a securely way. See how to send it and receive the payment token in our official documentation. Here we show how to do the backend part.
-
-
-Then pay the subscription:
-
-```php
-$params = ['id' => 1000];
-
-$paymentToken = 'payment_token';
-
-$customer = [
- 'name' => 'Gorbadoc Oldbuck',
- 'cpf' => '04267484171',
- 'phone_number' => '5144916523',
- 'email' => 'oldbuck@gerencianet.com.br',
- 'birth' => '1977-01-15'
-];
-
-$billingAddress = [
- 'street' => 'Av. JK',
- 'number' => 909,
- 'neighborhood' => 'Bauxita',
- 'zipcode' => '35400000',
- 'city' => 'Ouro Preto',
- 'state' => 'MG',
-];
-
-$body = [
- 'payment' => [
- 'credit_card' => [
- 'billing_address' => $billingAddress,
- 'payment_token' => $paymentToken,
- 'customer' => $customer
- ]
- ]
-];
-
-try {
- $api = new Gerencianet($options);
- $subscription = $api->paySubscription($params, $body);
-
- print_r($subscription);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-
-If everything went well, the response will come with total value:
-
-```php
-Array
-(
- [code] => 200
- [data] => Array
- (
- [subscription_id] => 6
- [status] => active
- [plan] => Array
- (
- [id] => 1000
- [interval] => 2
- [repeats] =>
- )
- [charge] => Array
- (
- [id] => 1053
- [status] => waiting
- )
- [total] => 5000
- [payment] => credit_card
- )
-)
-
-```
-
-To know every installment value including interests for each brand, you can see [Getting the Payment Data](/docs/PAYMENT_DATA.md).
-
-
-##### Payment tokens
-
-A `payment_token` represents a credit card number at Gerencianet.
-
-For testing purposes, you can go to your application playground in your Gerencianet's account. At the payment endpoint you'll see a button that generates one token for you. This payment token will point to a random test credit card number.
-
-When in production, it will depend if your project is a web app or a mobile app.
-
-For web apps you should follow this [guide](https://api.gerencianet.com.br/checkout/card). It basically consists of copying/pasting a script tag in your checkout page.
-
-For mobile apps you should use this [SDK for Android](https://github.com/gerencianet/gn-api-sdk-android) or this [SDK for iOS](https://github.com/gerencianet/gn-api-sdk-ios).
-
-
-### 3. Discount by payment method
-
-It is possible to set discounts based on payment. You just need to add an `discount` attribute within `banking_billet` or `credit_card` tags.
-
-The example below shows how to do this for credit card payments.
-
-```php
-
-$discount = [
- 'type' => 'currency',
- 'value'=> 1000
-];
-
-$body = [
- 'payment' => [
- 'credit_card' => [
- 'billing_address' => $billingAddress,
- 'payment_token' => $paymentToken,
- 'customer' => $customer,
- 'discount' => $discount
- ]
- ]
-];
-
-```
-Discounts for banking billets works similar to credit cards. You just need to add the `discount` attribute.
-
-The discount may be applied as percentage or with a previously calculated value.
-
-The `type` property is used to specify how the discount will work. It may be set as *currency* or *percentage*.
-
-The first will discount the amount specified in `value` property as *cents*. So, in the example above, the amount paid by the customer will be equal `(Charge's value) - R$ 10,00`.
-
-However, if the discount type is set to *percentage*, the amount will be `(Charge's value) - 10%`.
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/SUBSCRIPTION_UPDATE.md b/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/SUBSCRIPTION_UPDATE.md
deleted file mode 100644
index d31a978..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/docs/SUBSCRIPTION_UPDATE.md
+++ /dev/null
@@ -1,47 +0,0 @@
-## Updating subscriptions
-
-### Changing the metadata
-
-You can update the `custom_id` or the `notification_url` of a subscription at any time you want.
-
-Is important to know that it updates all the charges of the subscription. If you want to update only one, see [Updating charges](/docs/CHARGE_UPDATE.md).
-
-```php
-require __DIR__.'/../../vendor/autoload.php';
-
-use Gerencianet\Exception\GerencianetException;
-use Gerencianet\Gerencianet;
-
-$file = file_get_contents(__DIR__.'/../config.json');
-$options = json_decode($file, true);
-
-$params = ['id' => 1000];
-
-$body = [
- 'notification_url' => 'http://localhost',
- 'custom_id' => 'Custom Subscription 0001'
-];
-
-try {
- $api = new Gerencianet($options);
- $subscription = $api->updateSubscriptionMetadata($params, $body);
-
- print_r($subscription);
-} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
-} catch (Exception $e) {
- print_r($e->getMessage());
-}
-
-```
-
-If everything goes well. the return will be:
-
-```php
-Array
-(
- [code] => 200
-)
-```
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/cancelCarnet.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/cancelCarnet.php
new file mode 100644
index 0000000..5e1dd06
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/cancelCarnet.php
@@ -0,0 +1,27 @@
+ 0
+];
+
+try {
+ $api = new Gerencianet($options);
+ $response = $api->cancelCarnet($params, []);
+
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+} catch (Exception $e) {
+ print_r($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/cancelParcel.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/cancelParcel.php
new file mode 100644
index 0000000..f0f623c
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/cancelParcel.php
@@ -0,0 +1,28 @@
+ 0,
+ 'parcel' => 1
+];
+
+try {
+ $api = new Gerencianet($options);
+ $response = $api->cancelParcel($params, []);
+
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+} catch (Exception $e) {
+ print_r($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/create.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/create.php
index a84ce88..813e00b 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/create.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/create.php
@@ -1,45 +1,46 @@
'Item 1',
- 'amount' => 1,
- 'value' => 1000
- ],
- [
- 'name' => 'Item 2',
- 'amount' => 2,
- 'value' => 2000
- ]
+ [
+ 'name' => 'Item 1',
+ 'amount' => 1,
+ 'value' => 1000
+ ],
+ [
+ 'name' => 'Item 2',
+ 'amount' => 2,
+ 'value' => 2000
+ ]
];
$customer = [
- 'name' => 'Gorbadoc Oldbuck',
- 'cpf' => '04267484171',
- 'phone_number' => '5144916523'
+ 'name' => 'Gorbadoc Oldbuck',
+ 'cpf' => '04267484171',
+ 'phone_number' => '5144916523'
];
$body = [
- 'items' => $items,
- 'customer' => $customer,
- 'expire_at' => '2020-12-02',
- 'repeats' => 5,
- 'split_items' => false
+ 'items' => $items,
+ 'customer' => $customer,
+ 'expire_at' => '2021-12-10',
+ 'repeats' => 5,
+ 'split_items' => false
];
try {
$api = new Gerencianet($options);
- $carnet = $api->createCarnet([], $body);
+ $response = $api->createCarnet([], $body);
- print_r($carnet);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/createCarnetHistory.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/createCarnetHistory.php
index e6ccf67..f4dbba0 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/createCarnetHistory.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/createCarnetHistory.php
@@ -1,24 +1,25 @@
0];
$body = [
- 'description' => 'This carnet is about a service'
+ 'description' => 'This carnet is about a service'
];
try {
$api = new Gerencianet($options);
$response = $api->createCarnetHistory($params, $body);
- print_r($response);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/detail.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/detail.php
index 333f0ad..25191bb 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/detail.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/detail.php
@@ -1,20 +1,21 @@
0];
try {
$api = new Gerencianet($options);
- $carnet = $api->detailCarnet($params, []);
+ $response = $api->detailCarnet($params, []);
- print_r($carnet);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/resendCarnet.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/resendCarnet.php
index 45bfa1c..16c690f 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/resendCarnet.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/resendCarnet.php
@@ -1,30 +1,31 @@
0
+ 'id' => 0
];
$body = [
- 'email' => 'oldbuck@gerencianet.com.br'
+ 'email' => 'oldbuck@gerencianet.com.br'
];
try {
$api = new Gerencianet($options);
$response = $api->resendCarnet($params, $body);
- print_r($response);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
print_r($e->errorDescription);
} catch (Exception $e) {
print_r($e->getMessage());
-}
\ No newline at end of file
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/resendParcel.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/resendParcel.php
index bd87043..7fc7296 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/resendParcel.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/resendParcel.php
@@ -1,31 +1,32 @@
0,
- 'parcel' => 0
+ 'id' => 0,
+ 'parcel' => 0
];
$body = [
- 'email' => 'oldbuck@gerencianet.com.br'
+ 'email' => 'oldbuck@gerencianet.com.br'
];
try {
$api = new Gerencianet($options);
$response = $api->resendParcel($params, $body);
- print_r($response);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
print_r($e->errorDescription);
} catch (Exception $e) {
print_r($e->getMessage());
-}
\ No newline at end of file
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/settleCarnetParcel.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/settleCarnetParcel.php
new file mode 100644
index 0000000..f6949f6
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/settleCarnetParcel.php
@@ -0,0 +1,25 @@
+ 0, 'parcel' => 0];
+
+try {
+ $api = new Gerencianet($options);
+ $response = $api->settleCarnetParcel($params, []);
+
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+} catch (Exception $e) {
+ print_r($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/updateMetadata.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/updateMetadata.php
index b40b289..f63bf65 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/updateMetadata.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/updateMetadata.php
@@ -1,25 +1,26 @@
0];
$body = [
- 'custom_id' => 'Carnet 0001',
- 'notification_url' => 'http://domain.com/notification'
+ 'custom_id' => 'Carnet0001',
+ 'notification_url' => 'http://domain.com/notification'
];
try {
$api = new Gerencianet($options);
- $carnet = $api->updateCarnetMetadata($params, $body);
+ $response = $api->updateCarnetMetadata($params, $body);
- print_r($carnet);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/updateParcel.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/updateParcel.php
index fceac08..a3e2429 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/updateParcel.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/carnet/updateParcel.php
@@ -1,24 +1,25 @@
0, 'parcel' => 1];
$body = [
- 'expire_at' => '2018-01-01'
+ 'expire_at' => '2021-12-10'
];
try {
$api = new Gerencianet($options);
- $carnet = $api->updateParcel($params, $body);
+ $response = $api->updateParcel($params, $body);
- print_r($carnet);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/billet.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/billet.php
index 1b7570d..70c7d47 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/billet.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/billet.php
@@ -1,35 +1,36 @@
0];
$customer = [
- 'name' => 'Gorbadoc Oldbuck',
- 'cpf' => '04267484171',
- 'phone_number' => '5144916523'
+ 'name' => 'Gorbadoc Oldbuck',
+ 'cpf' => '04267484171',
+ 'phone_number' => '5144916523'
];
$body = [
- 'payment' => [
- 'banking_billet' => [
- 'expire_at' => '2018-12-12',
- 'customer' => $customer
+ 'payment' => [
+ 'banking_billet' => [
+ 'expire_at' => '2021-12-10',
+ 'customer' => $customer
+ ]
]
- ]
];
try {
$api = new Gerencianet($options);
- $charge = $api->payCharge($params, $body);
+ $response = $api->payCharge($params, $body);
- print_r($charge);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/cancel.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/cancel.php
index 8024cee..783b162 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/cancel.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/cancel.php
@@ -1,19 +1,21 @@
0];
try {
$api = new Gerencianet($options);
- $charge = $api->cancelCharge($params, []);
+ $response = $api->cancelCharge($params, []);
- print_r($charge);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/card.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/card.php
index 3b92aff..b4d8b19 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/card.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/card.php
@@ -1,50 +1,51 @@
0];
-$paymentToken = 'payment_token';
+$paymentToken = 'Insira_aqui_seu_paymentToken';
$customer = [
- 'name' => 'Gorbadoc Oldbuck',
- 'cpf' => '04267484171',
- 'phone_number' => '5144916523',
- 'email' => 'oldbuck@gerencianet.com.br',
- 'birth' => '1977-01-15'
+ 'name' => 'Gorbadoc Oldbuck',
+ 'cpf' => '04267484171',
+ 'phone_number' => '5144916523',
+ 'email' => 'oldbuck@gerencianet.com.br',
+ 'birth' => '1990-01-15'
];
$billingAddress = [
- 'street' => 'Av JK',
- 'number' => 909,
- 'neighborhood' => 'Bauxita',
- 'zipcode' => '35400000',
- 'city' => 'Ouro Preto',
- 'state' => 'MG',
+ 'street' => 'Av JK',
+ 'number' => 909,
+ 'neighborhood' => 'Bauxita',
+ 'zipcode' => '35400000',
+ 'city' => 'Ouro Preto',
+ 'state' => 'MG',
];
$body = [
- 'payment' => [
- 'credit_card' => [
- 'installments' => 1,
- 'billing_address' => $billingAddress,
- 'payment_token' => $paymentToken,
- 'customer' => $customer
+ 'payment' => [
+ 'credit_card' => [
+ 'installments' => 1,
+ 'billing_address' => $billingAddress,
+ 'payment_token' => $paymentToken,
+ 'customer' => $customer
+ ]
]
- ]
];
try {
$api = new Gerencianet($options);
- $charge = $api->payCharge($params, $body);
+ $response = $api->payCharge($params, $body);
- print_r($charge);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/create.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/create.php
index 8553307..8b6aaac 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/create.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/create.php
@@ -1,35 +1,36 @@
'Item 1',
- 'amount' => 1,
- 'value' => 1000
- ],
- [
- 'name' => 'Item 2',
- 'amount' => 2,
- 'value' => 2000
- ]
+ [
+ 'name' => 'Item 1',
+ 'amount' => 1,
+ 'value' => 1000
+ ],
+ [
+ 'name' => 'Item 2',
+ 'amount' => 2,
+ 'value' => 2000
+ ]
];
$body = [
- 'items' => $items
+ 'items' => $items
];
try {
$api = new Gerencianet($options);
- $charge = $api->createCharge([], $body);
+ $response = $api->createCharge([], $body);
- print_r($charge);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/createChargeBalanceSheet.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/createChargeBalanceSheet.php
new file mode 100644
index 0000000..ffb8ebc
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/createChargeBalanceSheet.php
@@ -0,0 +1,107 @@
+ 1];
+
+$body = [
+ 'title' => 'Balancete Demonstrativo',
+ 'body' =>
+ [
+ 0 =>
+ [
+ 'header' => 'Demonstrativo de Consumo',
+ 'tables' =>
+ [
+ 0 =>
+ [
+ 'rows' =>
+ [
+ 0 =>
+ [
+ 0 =>
+ [
+ 'align' => 'left',
+ 'color' => '#000000',
+ 'style' => 'bold',
+ 'text' => 'Exemplo de despesa',
+ 'colspan' => 2,
+ ],
+ 1 =>
+ [
+ 'align' => 'left',
+ 'color' => '#000000',
+ 'style' => 'bold',
+ 'text' => 'Total lançado',
+ 'colspan' => 2,
+ ],
+ ],
+ 1 =>
+ [
+ 0 =>
+ [
+ 'align' => 'left',
+ 'color' => '#000000',
+ 'style' => 'normal',
+ 'text' => 'Instalação',
+ 'colspan' => 2,
+ ],
+ 1 =>
+ [
+ 'align' => 'left',
+ 'color' => '#000000',
+ 'style' => 'normal',
+ 'text' => 'R$ 100,00',
+ 'colspan' => 2,
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ 1 =>
+ [
+ 'header' => 'Balancete Geral',
+ 'tables' =>
+ [
+ 0 =>
+ [
+ 'rows' =>
+ [
+ 0 =>
+ [
+ 0 =>
+ [
+ 'align' => 'left',
+ 'color' => '#000000',
+ 'style' => 'normal',
+ 'text' => 'Confira na documentação da Gerencianet todas as configurações possíveis de um boleto balancete.',
+ 'colspan' => 4,
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+];
+
+try {
+ $api = new Gerencianet($options);
+ $response = $api->createChargeBalanceSheet($params, $body);
+
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+} catch (Exception $e) {
+ print_r($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/createChargeHistory.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/createChargeHistory.php
index 2242434..13a59f0 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/createChargeHistory.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/createChargeHistory.php
@@ -1,24 +1,25 @@
0];
$body = [
- 'description' => 'This charge was not fully paid'
+ 'description' => 'This charge was not fully paid'
];
try {
$api = new Gerencianet($options);
$response = $api->createChargeHistory($params, $body);
- print_r($response);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/detail.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/detail.php
index 0cd76bb..a78fdfe 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/detail.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/detail.php
@@ -1,20 +1,21 @@
0];
try {
$api = new Gerencianet($options);
- $charge = $api->detailCharge($params, []);
+ $response = $api->detailCharge($params, []);
- print_r($charge);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/link.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/link.php
new file mode 100644
index 0000000..0eb0c0c
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/link.php
@@ -0,0 +1,34 @@
+ 0];
+
+$body = [
+ 'billet_discount' => 0,
+ 'card_discount' => 0,
+ 'message' => '',
+ 'expire_at' => '2021-12-10',
+ 'request_delivery_address' => false,
+ 'payment_method' => 'all'
+];
+
+try {
+ $api = new Gerencianet($options);
+ $response = $api->chargeLink($params, $body);
+
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+} catch (Exception $e) {
+ print_r($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/oneStepBillet.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/oneStepBillet.php
new file mode 100644
index 0000000..53d5b26
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/oneStepBillet.php
@@ -0,0 +1,74 @@
+ 'Gorbadoc Oldbuck',
+ 'amount' => 1,
+ 'value' => 3000
+];
+
+$items = [
+ $item_1
+];
+
+$metadata = array('notification_url' => 'https://meuip.in/xxxxx.php');
+
+$customer = [
+ 'name' => 'Gorbadoc Oldbuck',
+ 'cpf' => '94271564656',
+ 'phone_number' => '5144916523'
+];
+
+$discount = [
+ 'type' => 'currency',
+ 'value' => 599
+];
+
+$configurations = [
+ 'fine' => 200,
+ 'interest' => 33
+];
+
+$conditional_discount = [
+ 'type' => 'percentage',
+ 'value' => 500,
+ 'until_date' => '2021-12-08'
+];
+
+$bankingBillet = [
+ 'expire_at' => '2021-12-10',
+ 'message' => 'teste\nteste\nteste\nteste',
+ 'customer' => $customer,
+ 'discount' => $discount,
+ 'conditional_discount' => $conditional_discount
+];
+
+$payment = [
+ 'banking_billet' => $bankingBillet
+];
+
+$body = [
+ 'items' => $items,
+ 'metadata' => $metadata,
+ 'payment' => $payment
+];
+
+try {
+ $api = new Gerencianet($options);
+ $response = $api->oneStep([], $body);
+
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+} catch (Exception $e) {
+ print_r($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/oneStepBilletMarketplace.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/oneStepBilletMarketplace.php
new file mode 100644
index 0000000..2b74fd3
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/oneStepBilletMarketplace.php
@@ -0,0 +1,90 @@
+ "Insira_aqui_o_indentificador_da conta_destino", // identificador da conta Gerencianet (repasse 1)
+ 'percentage' => 2500 // porcentagem de repasse (2500 = 25%)
+];
+
+$repass_2 = [
+ 'payee_code' => "Insira_aqui_o_indentificador_da conta_destino", // identificador da conta Gerencianet (repasse 2)
+ 'percentage' => 1500 // porcentagem de repasse (1500 = 15%)
+];
+
+$repasses = [
+ $repass_1,
+ $repass_2
+];
+
+$item_1 = [
+ 'name' => 'Item 1', // nome do item, produto ou serviço
+ 'amount' => 1, // quantidade
+ 'value' => 1500, // valor (1000 = R$ 10,00) (Obs: É possível a criação de itens com valores negativos. Porém, o valor total da fatura deve ser superior ao valor mínimo para geração de transações.)
+ 'marketplace' => array('repasses' => $repasses)
+];
+
+$items = [
+ $item_1
+];
+
+// $metadata = array('notification_url'=>'sua_url_de_notificacao_.com.br'); //Url de notificações
+$customer = [
+ 'name' => 'Gorbadoc Oldbuck', // nome do cliente
+ 'cpf' => '94271564656', // cpf válido do cliente
+ 'phone_number' => '5144916523', // telefone do cliente
+];
+
+$discount = [ // configuração de descontos
+ 'type' => 'currency', // tipo de desconto a ser aplicado
+ 'value' => 599 // valor de desconto
+];
+
+$configurations = [ // configurações de juros e mora
+ 'fine' => 200, // porcentagem de multa
+ 'interest' => 33 // porcentagem de juros
+];
+
+$conditional_discount = [ // configurações de desconto condicional
+ 'type' => 'percentage', // seleção do tipo de desconto
+ 'value' => 500, // porcentagem de desconto
+ 'until_date' => '2021-12-08' // data máxima para aplicação do desconto
+];
+
+$bankingBillet = [
+ 'expire_at' => '2021-12-10', // data de vencimento do titulo
+ 'message' => 'teste\nteste\nteste\nteste', // mensagem a ser exibida no boleto
+ 'customer' => $customer,
+ 'discount' => $discount,
+ 'conditional_discount' => $conditional_discount
+];
+
+$payment = [
+ 'banking_billet' => $bankingBillet // forma de pagamento (banking_billet = boleto)
+];
+
+$body = [
+ 'items' => $items,
+ // 'metadata' =>$metadata,
+ 'payment' => $payment
+];
+
+try {
+ $api = new Gerencianet($options);
+ $response = $api->oneStep([], $body);
+
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+} catch (Exception $e) {
+ print_r($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/oneStepCard.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/oneStepCard.php
new file mode 100644
index 0000000..c8b3081
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/oneStepCard.php
@@ -0,0 +1,83 @@
+ 'Gorbadoc Oldbuck',
+ 'amount' => 1,
+ 'value' => 3000
+];
+
+$items = [
+ $item_1
+];
+
+$metadata = array('notification_url' => 'https://meuip.in/xxxxx.php');
+
+$customer = [
+ 'name' => 'Gorbadoc Oldbuck',
+ 'cpf' => '04267484171',
+ 'phone_number' => '5144916523',
+ 'email' => 'oldbuck@gerencianet.com.br',
+ 'birth' => '1990-01-15'
+];
+
+$billingAddress = [
+ 'street' => 'Av JK',
+ 'number' => 909,
+ 'neighborhood' => 'Bauxita',
+ 'zipcode' => '35400000',
+ 'city' => 'Ouro Preto',
+ 'state' => 'MG'
+];
+
+$discount = [
+ 'type' => 'currency',
+ 'value' => 599
+];
+
+$configurations = [
+ 'fine' => 200,
+ 'interest' => 33
+];
+
+$credit_card = [
+ 'customer' => $customer,
+ 'installments' => 1,
+ 'discount' => $discount,
+ 'billing_address' => $billingAddress,
+ 'payment_token' => $paymentToken,
+ 'message' => 'teste\nteste\nteste\nteste'
+];
+
+$payment = [
+ 'credit_card' => $credit_card
+];
+
+$body = [
+ 'items' => $items,
+ 'metadata' => $metadata,
+ 'payment' => $payment
+];
+
+try {
+ $api = new Gerencianet($options);
+ $response = $api->oneStep([], $body);
+
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+} catch (Exception $e) {
+ print_r($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/oneStepCardMarketplace.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/oneStepCardMarketplace.php
new file mode 100644
index 0000000..82d969c
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/oneStepCardMarketplace.php
@@ -0,0 +1,99 @@
+ "Insira_aqui_o_indentificador_da conta_destino", // identificador da conta Gerencianet (repasse 1)
+ 'percentage' => 2500 // porcentagem de repasse (2500 = 25%)
+];
+
+$repass_2 = [
+ 'payee_code' => "Insira_aqui_o_indentificador_da conta_destino", // identificador da conta Gerencianet (repasse 2)
+ 'percentage' => 1500 // porcentagem de repasse (1500 = 15%)
+];
+
+$repasses = [
+ $repass_1,
+ $repass_2
+];
+
+$item_1 = [
+ 'name' => 'Item 1', // nome do item, produto ou serviço
+ 'amount' => 1, // quantidade
+ 'value' => 1500, // valor (1000 = R$ 10,00) (Obs: É possível a criação de itens com valores negativos. Porém, o valor total da fatura deve ser superior ao valor mínimo para geração de transações.)
+ 'marketplace' => array('repasses' => $repasses)
+];
+
+$items = [
+ $item_1
+];
+
+$metadata = array('notification_url' => 'https:/seu.dominio/retorno');
+
+$customer = [
+ 'name' => 'Gorbadoc Oldbuck',
+ 'cpf' => '04267484171',
+ 'phone_number' => '5144916523',
+ 'email' => 'oldbuck@gerencianet.com.br',
+ 'birth' => '1990-01-15'
+];
+
+$billingAddress = [
+ 'street' => 'Av JK',
+ 'number' => 909,
+ 'neighborhood' => 'Bauxita',
+ 'zipcode' => '35400000',
+ 'city' => 'Ouro Preto',
+ 'state' => 'MG'
+];
+
+$discount = [
+ 'type' => 'currency',
+ 'value' => 599
+];
+
+$configurations = [
+ 'fine' => 200,
+ 'interest' => 33
+];
+
+$credit_card = [
+ 'customer' => $customer,
+ 'installments' => 1,
+ 'discount' => $discount,
+ 'billing_address' => $billingAddress,
+ 'payment_token' => $paymentToken,
+ 'message' => 'teste\nteste\nteste\nteste'
+];
+
+$payment = [
+ 'credit_card' => $credit_card
+];
+
+$body = [
+ 'items' => $items,
+ 'metadata' => $metadata,
+ 'payment' => $payment
+];
+
+try {
+ $api = new Gerencianet($options);
+ $response = $api->oneStep([], $body);
+
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+} catch (Exception $e) {
+ print_r($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/resendBillet.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/resendBillet.php
index 16fe330..5f8160d 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/resendBillet.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/resendBillet.php
@@ -1,28 +1,29 @@
0];
$body = [
- 'email' => 'oldbuck@gerencianet.com.br'
+ 'email' => 'oldbuck@gerencianet.com.br'
];
try {
$api = new Gerencianet($options);
$response = $api->resendBillet($params, $body);
- print_r($response);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
print_r($e->errorDescription);
} catch (Exception $e) {
print_r($e->getMessage());
-}
\ No newline at end of file
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/settleCharge.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/settleCharge.php
new file mode 100644
index 0000000..cfe9e5e
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/settleCharge.php
@@ -0,0 +1,25 @@
+ 0];
+
+try {
+ $api = new Gerencianet($options);
+ $charge = $api->settleCharge($params, []);
+
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+} catch (Exception $e) {
+ print_r($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/shipping.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/shipping.php
index fb1f9d1..0353712 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/shipping.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/shipping.php
@@ -1,12 +1,13 @@
1,
'value' => 1000
],
- [
- 'name' => 'Item 2',
- 'amount' => 2,
- 'value' => 2000
- ]
+ [
+ 'name' => 'Item 2',
+ 'amount' => 2,
+ 'value' => 2000
+ ]
];
-
+
$shippings = [
[
'name' => 'My Shipping',
@@ -34,14 +35,14 @@
];
try {
- $api = new Gerencianet($options);
- $charge = $api->createCharge([], $body);
+ $api = new Gerencianet($options);
+ $response = $api->createCharge([], $body);
- print_r($charge);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
- print_r($e->code);
- print_r($e->error);
- print_r($e->errorDescription);
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
} catch (Exception $e) {
- print_r($e->getMessage());
+ print_r($e->getMessage());
}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/updateBillet.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/updateBillet.php
index a603e4d..7ec45a2 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/updateBillet.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/updateBillet.php
@@ -1,24 +1,25 @@
0];
$body = [
- 'expire_at' => '2020-12-12'
+ 'expire_at' => '2021-12-10'
];
try {
$api = new Gerencianet($options);
- $charge = $api->updateBillet($params, $body);
+ $response = $api->updateBillet($params, $body);
- print_r($charge);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/updateLink.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/updateLink.php
new file mode 100644
index 0000000..4a558e4
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/updateLink.php
@@ -0,0 +1,34 @@
+ 0];
+
+$body = [
+ 'billet_discount' => 0,
+ 'card_discount' => 0,
+ 'message' => '',
+ 'expire_at' => '2021-12-10',
+ 'request_delivery_address' => false,
+ 'payment_method' => 'all'
+];
+
+try {
+ $api = new Gerencianet($options);
+ $response = $api->updateChargeLink($params, $body);
+
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+} catch (Exception $e) {
+ print_r($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/updateMetadata.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/updateMetadata.php
index f30d667..141499f 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/updateMetadata.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/charge/updateMetadata.php
@@ -1,25 +1,26 @@
0];
$body = [
- 'custom_id' => 'Product 0001',
- 'notification_url' => 'http://domain.com/notification'
+ 'custom_id' => 'Product 0001',
+ 'notification_url' => 'http://domain.com/notification'
];
try {
$api = new Gerencianet($options);
- $charge = $api->updateChargeMetadata($params, $body);
+ $response = $api->updateChargeMetadata($params, $body);
- print_r($charge);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/config.json b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/config.json
index 8abbbbc..2198ae9 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/config.json
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/config.json
@@ -1,6 +1,8 @@
{
- "client_id": "client_id",
- "client_secret": "client_secret",
- "sandbox": true,
- "debug": false
-}
+ "client_id": "client_id",
+ "client_secret": "client_secret",
+ "pix_cert": "../certs/developmentCertificate.pem",
+ "sandbox": true,
+ "debug": false,
+ "timeout": 30
+}
\ No newline at end of file
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/extra/getInstallments.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/extra/getInstallments.php
index a230ebf..86eaf06 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/extra/getInstallments.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/extra/getInstallments.php
@@ -1,23 +1,24 @@
'20000',
- 'brand' => 'visa'
+ 'total' => '20000',
+ 'brand' => 'visa'
];
try {
$api = new Gerencianet($options);
- $installments = $api->getInstallments($params, []);
+ $response = $api->getInstallments($params, []);
- print_r($installments);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/notification/detail.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/notification/detail.php
index e9dec91..8c580de 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/notification/detail.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/notification/detail.php
@@ -1,20 +1,21 @@
'token'];
try {
$api = new Gerencianet($options);
- $notification = $api->getNotification($params, []);
+ $response = $api->getNotification($params, []);
- print_r($notification);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/account/balance.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/account/balance.php
new file mode 100644
index 0000000..98a9b43
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/account/balance.php
@@ -0,0 +1,24 @@
+pixListBalance([], []);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/account/listSettings.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/account/listSettings.php
new file mode 100644
index 0000000..2f09b8e
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/account/listSettings.php
@@ -0,0 +1,24 @@
+pixListSettings([], []);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/account/updateSettings.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/account/updateSettings.php
new file mode 100644
index 0000000..0b688f0
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/account/updateSettings.php
@@ -0,0 +1,48 @@
+ [
+ "receberSemChave" => true,
+ "chaves" => [
+ "isabelle@email.com" => [
+ "recebimento" => [
+ "txidObrigatorio" => false,
+ "qrCodeEstatico" => [
+ "recusarTodos" => false
+ ]
+ ]
+ ],
+ "efa1db8c-735b-4898-92e0-a54daabe65e6" => [
+ "recebimento" => [
+ "txidObrigatorio" => false,
+ "qrCodeEstatico" => [
+ "recusarTodos" => false
+ ]
+ ]
+ ]
+ ]
+ ]
+];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixUpdateSettings([], $body);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/guzzle/guzzle/docs/_templates/leftbar.html b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/certs/developmentCertificate.pem
similarity index 100%
rename from lib/gerencianet/guzzle/guzzle/docs/_templates/leftbar.html
rename to lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/certs/developmentCertificate.pem
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/FileBody.txt b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/certs/productionCertificate.pem
similarity index 100%
rename from lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/FileBody.txt
rename to lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/certs/productionCertificate.pem
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/charge/create.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/charge/create.php
new file mode 100644
index 0000000..1e8f154
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/charge/create.php
@@ -0,0 +1,67 @@
+ [
+ "expiracao" => 3600
+ ],
+ "devedor" => [
+ "cpf" => "12345678909",
+ "nome" => "Francisco da Silva"
+ ],
+ "valor" => [
+ "original" => "0.01"
+ ],
+ "chave" => "", // Chave pix da conta Gerencianet do recebedor
+ "solicitacaoPagador" => "Informe o número ou identificador do pedido.",
+ "infoAdicionais" => [
+ [
+ "nome" => "Campo 1", // Nome do campo string (Nome) ≤ 50 characters
+ "valor" => "Informação Adicional1 do PSP-Recebedor" // Dados do campo string (Valor) ≤ 200 characters
+ ],
+ [
+ "nome" => "Campo 2",
+ "valor" => "Informação Adicional2 do PSP-Recebedor"
+ ]
+ ]
+];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixCreateImmediateCharge([], $body);
+
+ if ($pix['txid']) {
+ $params = [
+ 'id' => $pix['loc']['id']
+ ];
+
+ // Gera QRCode
+ $qrcode = $api->pixGenerateQRCode($params);
+
+ echo 'Detalhes da cobrança:';
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+
+ echo 'QR Code:';
+ echo '' . json_encode($qrcode, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+
+ echo 'Imagem: ';
+ echo ' ';
+ } else {
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+ }
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/charge/detail.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/charge/detail.php
new file mode 100644
index 0000000..7078fb3
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/charge/detail.php
@@ -0,0 +1,26 @@
+ ''];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixDetailCharge($params);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/charge/list.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/charge/list.php
new file mode 100644
index 0000000..e1e51dc
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/charge/list.php
@@ -0,0 +1,26 @@
+ '2020-11-22T16:01:35Z', 'fim' => '2021-02-22T16:01:35Z'];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixListCharges($params);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/charge/update.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/charge/update.php
new file mode 100644
index 0000000..946a301
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/charge/update.php
@@ -0,0 +1,30 @@
+ ''];
+
+$body = [
+ "solicitacaoPagador" => "Informe o número ou identificador da cobrança."
+];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixUpdateCharge($params, $body);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/key/create.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/key/create.php
new file mode 100644
index 0000000..8288e57
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/key/create.php
@@ -0,0 +1,24 @@
+pixCreateEvp([], []);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/key/delete.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/key/delete.php
new file mode 100644
index 0000000..b4d0c7d
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/key/delete.php
@@ -0,0 +1,26 @@
+ ''];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixDeleteEvp($params);
+
+ echo json_encode(["code" => 200]);
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/key/list.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/key/list.php
new file mode 100644
index 0000000..9fa88e1
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/key/list.php
@@ -0,0 +1,24 @@
+pixListEvp([], []);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/location/create.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/location/create.php
new file mode 100644
index 0000000..f39be2e
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/location/create.php
@@ -0,0 +1,28 @@
+ 'cob'
+];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixLocationCreate([], $body);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/location/deleteTxid.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/location/deleteTxid.php
new file mode 100644
index 0000000..288c9ce
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/location/deleteTxid.php
@@ -0,0 +1,26 @@
+ ''];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixLocationDeleteTxid($params);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/location/getLoc.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/location/getLoc.php
new file mode 100644
index 0000000..73c6306
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/location/getLoc.php
@@ -0,0 +1,26 @@
+ ''];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixLocationGet($params);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/location/list.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/location/list.php
new file mode 100644
index 0000000..478bb4b
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/location/list.php
@@ -0,0 +1,26 @@
+ '2020-11-22T16:01:35Z', 'fim' => '2021-01-22T16:01:35Z'];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixLocationList($params);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/oauth/generateAuth.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/oauth/generateAuth.php
new file mode 100644
index 0000000..a9bbbc8
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/oauth/generateAuth.php
@@ -0,0 +1,24 @@
+authorize(); //generate Access Token
+
+ echo json_encode($auth->__get('accessToken'));
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/pix/createDevolution.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/pix/createDevolution.php
new file mode 100644
index 0000000..6e3e68a
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/pix/createDevolution.php
@@ -0,0 +1,33 @@
+ '',
+ 'id' => ''
+];
+
+$body = [
+ 'valor' => '0.01'
+];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixDevolution($params, $body);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/pix/devolutionList.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/pix/devolutionList.php
new file mode 100644
index 0000000..eca63f6
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/pix/devolutionList.php
@@ -0,0 +1,29 @@
+ '',
+ 'id' => ''
+];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixDevolutionGet($params);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/pix/pixList.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/pix/pixList.php
new file mode 100644
index 0000000..389e9d4
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/pix/pixList.php
@@ -0,0 +1,26 @@
+ ''];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixSendList($params);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/pix/pixListReceived.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/pix/pixListReceived.php
new file mode 100644
index 0000000..79b926b
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/pix/pixListReceived.php
@@ -0,0 +1,26 @@
+ '2020-11-22T16:01:35Z', 'fim' => '2021-01-22T16:01:35Z'];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixReceivedList($params);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/pix/pixSend.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/pix/pixSend.php
new file mode 100644
index 0000000..42f7fd7
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/pix/pixSend.php
@@ -0,0 +1,36 @@
+ '0.01',
+ 'pagador' => [
+ 'chave' => ''
+ ],
+ 'favorecido' => [
+ 'chave' => ''
+ ]
+];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixSend([], $body);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/webhooks/delete.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/webhooks/delete.php
new file mode 100644
index 0000000..0230556
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/webhooks/delete.php
@@ -0,0 +1,26 @@
+ ''];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixDeleteWebhook($params);
+
+ echo json_encode(["code" => 204]);
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/webhooks/detail.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/webhooks/detail.php
new file mode 100644
index 0000000..8c81b6b
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/webhooks/detail.php
@@ -0,0 +1,26 @@
+ ''];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixGetWebhook($params);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/webhooks/list.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/webhooks/list.php
new file mode 100644
index 0000000..72b0ed0
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/webhooks/list.php
@@ -0,0 +1,26 @@
+ '2020-11-22T16:01:35Z', 'fim' => '2021-02-22T16:01:35Z'];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixListWebhook($params);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/webhooks/update.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/webhooks/update.php
new file mode 100644
index 0000000..8071757
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/pix/webhooks/update.php
@@ -0,0 +1,31 @@
+ 'true',
+);
+
+$params = ['chave' => ''];
+$body = ['webhookUrl' => ''];
+
+try {
+ $api = Gerencianet::getInstance($options);
+ $pix = $api->pixConfigWebhook($params, $body);
+
+ echo '' . json_encode($pix, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+
+ throw new Error($e->error);
+} catch (Exception $e) {
+ throw new Error($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/cancelSubscription.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/cancelSubscription.php
index 52c95bb..f75fdb9 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/cancelSubscription.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/cancelSubscription.php
@@ -1,20 +1,21 @@
0];
try {
$api = new Gerencianet($options);
- $subscription = $api->cancelSubscription($params, []);
+ $response = $api->cancelSubscription($params, []);
- print_r($subscription);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/createPlan.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/createPlan.php
index 242ddaa..5d5ef16 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/createPlan.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/createPlan.php
@@ -1,24 +1,25 @@
'My plan',
- 'interval' => 2,
- 'repeats' => null
+ 'name' => 'My plan',
+ 'interval' => 2,
+ 'repeats' => null
];
try {
$api = new Gerencianet($options);
- $plan = $api->createPlan([], $body);
+ $response = $api->createPlan([], $body);
- print_r($plan);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/createSubscription.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/createSubscription.php
index 6fceaaa..bb923b5 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/createSubscription.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/createSubscription.php
@@ -1,37 +1,38 @@
0];
$items = [
- [
- 'name' => 'Item 1',
- 'amount' => 1,
- 'value' => 1000
- ],
- [
- 'name' => 'Item 2',
- 'amount' => 2,
- 'value' => 2000
- ]
+ [
+ 'name' => 'Item 1',
+ 'amount' => 1,
+ 'value' => 1000
+ ],
+ [
+ 'name' => 'Item 2',
+ 'amount' => 2,
+ 'value' => 2000
+ ]
];
$body = [
- 'items' => $items
+ 'items' => $items
];
try {
$api = new Gerencianet($options);
- $subscription = $api->createSubscription($params, $body);
+ $response = $api->createSubscription($params, $body);
- print_r($subscription);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/createSubscriptionHistory.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/createSubscriptionHistory.php
new file mode 100644
index 0000000..c29441a
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/createSubscriptionHistory.php
@@ -0,0 +1,29 @@
+ 0];
+
+$body = [
+ 'description' => 'This carnet is about a service'
+];
+
+try {
+ $api = new Gerencianet($options);
+ $response = $api->createSubscriptionHistory($params, $body);
+
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+} catch (Exception $e) {
+ print_r($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/deletePlan.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/deletePlan.php
index 3c2090b..895cf05 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/deletePlan.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/deletePlan.php
@@ -1,20 +1,21 @@
0];
try {
$api = new Gerencianet($options);
- $plan = $api->deletePlan($params, []);
+ $response = $api->deletePlan($params, []);
- print_r($plan);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/detailSubscription.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/detailSubscription.php
index 81c1d84..61d99d7 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/detailSubscription.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/detailSubscription.php
@@ -1,20 +1,21 @@
0];
try {
$api = new Gerencianet($options);
- $subscription = $api->detailSubscription($params, []);
+ $response = $api->detailSubscription($params, []);
- print_r($subscription);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/listPlans.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/listPlans.php
index aa83a3d..4500ede 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/listPlans.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/listPlans.php
@@ -1,20 +1,21 @@
20, 'offset' => 0];
try {
$api = new Gerencianet($options);
- $plans = $api->getPlans($params, []);
+ $response = $api->getPlans($params, []);
- print_r($plans);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/paySubscription.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/paySubscription.php
index 57b791c..a818028 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/paySubscription.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/paySubscription.php
@@ -1,49 +1,50 @@
0];
$paymentToken = 'payment_token';
$customer = [
- 'name' => 'Gorbadoc Oldbuck',
- 'cpf' => '04267484171' ,
- 'phone_number' => '5144916523',
- 'email' => 'oldbuck@gerencianet.com.br',
- 'birth' => '1977-01-15'
+ 'name' => 'Gorbadoc Oldbuck',
+ 'cpf' => '04267484171',
+ 'phone_number' => '5144916523',
+ 'email' => 'oldbuck@gerencianet.com.br',
+ 'birth' => '1977-01-15'
];
$billingAddress = [
- 'street' => 'Av. JK',
- 'number' => 909,
- 'neighborhood' => 'Bauxita',
- 'zipcode' => '35400000',
- 'city' => 'Ouro Preto',
- 'state' => 'MG',
+ 'street' => 'Av. JK',
+ 'number' => 909,
+ 'neighborhood' => 'Bauxita',
+ 'zipcode' => '35400000',
+ 'city' => 'Ouro Preto',
+ 'state' => 'MG',
];
$body = [
- 'payment' => [
- 'credit_card' => [
- 'billing_address' => $billingAddress,
- 'payment_token' => $paymentToken,
- 'customer' => $customer
+ 'payment' => [
+ 'credit_card' => [
+ 'billing_address' => $billingAddress,
+ 'payment_token' => $paymentToken,
+ 'customer' => $customer
+ ]
]
- ]
];
try {
$api = new Gerencianet($options);
- $subscription = $api->paySubscription($params, $body);
+ $response = $api->paySubscription($params, $body);
- print_r($subscription);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/updatePlan.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/updatePlan.php
new file mode 100644
index 0000000..086ca4a
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/updatePlan.php
@@ -0,0 +1,27 @@
+ 0];
+
+$body = ['name' => 'My new plan'];
+
+try {
+ $api = new Gerencianet($options);
+ $response = $api->updatePlan($params, $body);
+
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
+} catch (GerencianetException $e) {
+ print_r($e->code);
+ print_r($e->error);
+ print_r($e->errorDescription);
+} catch (Exception $e) {
+ print_r($e->getMessage());
+}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/updateSubscriptionMetadata.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/updateSubscriptionMetadata.php
index 59ec5fc..240ff53 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/updateSubscriptionMetadata.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/examples/subscription/updateSubscriptionMetadata.php
@@ -1,25 +1,26 @@
0];
$body = [
- 'notification_url' => 'http://localhost.com',
- 'custom_id' => 'Custom Subscription 0001'
+ 'notification_url' => 'http://localhost.com',
+ 'custom_id' => 'Custom Subscription 0001'
];
try {
$api = new Gerencianet($options);
- $subscription = $api->updateSubscriptionMetadata($params, $body);
+ $response = $api->updateSubscriptionMetadata($params, $body);
- print_r($subscription);
+ echo '' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ' ';
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/ApiRequest.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/ApiRequest.php
old mode 100755
new mode 100644
index bf30daf..26cc526
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/ApiRequest.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/ApiRequest.php
@@ -23,21 +23,20 @@ public function send($method, $route, $body)
$this->auth->authorize();
}
- $composerData = json_decode(file_get_contents(__DIR__ . '/../../composer.json'), true);
- $partner_token = isset($this->options['partner_token']) ? $this->options['partner_token'] : "";
-
+ $composerData = json_decode(file_get_contents(__DIR__.'/../../composer.json'), true);
+ $partner_token = isset($this->options['partner_token'])? $this->options['partner_token'] : "";
+ $requestTimeout = isset($this->options['timeout'])? (double)$this->options['timeout'] : 30.0;
+
try {
- return $this->request->send($method, $route, [
- 'json' => $body,
- 'headers' => ['Authorization' => 'Bearer ' . $this->auth->accessToken, 'api-sdk' => 'magento-0.4.2', 'partner-token' => $partner_token]
- ]);
+ return $this->request->send($method, $route, ['json' => $body,
+ 'timeout' => $requestTimeout,
+ 'headers' => ['Authorization' => 'Bearer '.$this->auth->accessToken, 'api-sdk' => 'php-' . $composerData['version'], 'partner-token' => $partner_token]]);
} catch (AuthorizationException $e) {
$this->auth->authorize();
- return $this->request->send($method, $route, [
- 'json' => $body,
- 'headers' => ['Authorization' => 'Bearer ' . $this->auth->accessToken, 'api-sdk' => 'magento-0.4.2', 'partner-token' => $partner_token]
- ]);
+ return $this->request->send($method, $route, ['json' => $body,
+ 'timeout' => $requestTimeout,
+ 'headers' => ['Authorization' => 'Bearer '.$this->auth->accessToken, 'api-sdk' => 'php-' . $composerData['version'], 'partner-token' => $partner_token]]);
}
}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Auth.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Auth.php
old mode 100755
new mode 100644
index ec8603c..c2acddd
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Auth.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Auth.php
@@ -11,9 +11,9 @@ class Auth
private $accessToken;
private $tokenType;
private $expires;
- private $sandbox = false;
private $config;
private $request;
+ private $pixCert;
public function __construct($options)
{
@@ -25,8 +25,8 @@ public function __construct($options)
}
$this->request = new Request($options);
-
$this->clientId = $this->config['clientId'];
+ $this->pixCert = isset($this->config['pixCert']) ? $this->config['pixCert'] : null;
$this->clientSecret = $this->config['clientSecret'];
}
@@ -34,11 +34,14 @@ public function authorize()
{
$endpoints = Config::get('ENDPOINTS');
+ $requestTimeout = isset($this->options['timeout'])? (double)$this->options['timeout'] : 30.0;
$requestOptions = ['auth' => [$this->clientId, $this->clientSecret],
- 'json' => ['grant_type' => 'client_credentials'], ];
+ 'json' => ['grant_type' => 'client_credentials'], 'timeout' => $requestTimeout];
+
+ $endpoints = $this->pixCert ? $endpoints['PIX'] : $endpoints['DEFAULT'];
$response = $this->request
- ->send($endpoints['authorize']['method'], $endpoints['authorize']['route'],
+ ->send($endpoints['authorize']['method'], $endpoints['authorize']['route'],
$requestOptions);
$this->accessToken = $response['access_token'];
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Config.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Config.php
index e98de40..370241e 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Config.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Config.php
@@ -4,11 +4,34 @@
class Config
{
+ /**
+ * @var string Arquivo de configuração dos endpoints
+ */
+ private static $endpointsConfigfile = __DIR__ . '/config.json';
+
+ /**
+ * Altera arquivo de configuração
+ * @param string $file Caminho do arquivo
+ */
+ public static function setEndpointsConfigFile($file)
+ {
+ self::$endpointsConfigfile = $file;
+ }
+
+ /**
+ * Carrega as configurações do arquivo de endpoints
+ * @param string $property Chave do parâmetro
+ * @return mixed
+ */
public static function get($property)
{
- $file = file_get_contents(__DIR__.'/config.json');
+ $file = file_get_contents(self::$endpointsConfigfile);
$config = json_decode($file, true);
+ if (json_last_error() !== JSON_ERROR_NONE) {
+ throw new \Exception("Erro ao carregar endpoints do arquivo");
+ }
+
if (isset($config[$property])) {
return $config[$property];
}
@@ -28,11 +51,18 @@ public static function options($options)
if (isset($options['client_secret'])) {
$conf['clientSecret'] = $options['client_secret'];
}
+ if (isset($options['timeout'])) {
+ $conf['timeout'] = $options['timeout'];
+ }
+
+ if(Config::isPix($options))
+ $conf['pixCert'] = $options['pix_cert'];
if (isset($options['url'])) {
$conf['baseUri'] = $options['url'];
} else {
$config = self::get('URL');
+ $config = Config::isPix($options) ? $config['PIX'] : $config['DEFAULT'];
$conf['baseUri'] = $config['production'];
if ($conf['sandbox']) {
@@ -40,6 +70,15 @@ public static function options($options)
}
}
+ if (isset($options['headers'])) {
+ $conf['headers'] = $options['headers'];
+ }
+
return $conf;
}
+
+ public static function isPix($options)
+ {
+ return (isset($options['pix_cert']) && is_string($options['pix_cert']));
+ }
}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Endpoints.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Endpoints.php
index 474c423..98332d1 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Endpoints.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Endpoints.php
@@ -9,6 +9,7 @@ class Endpoints
private $requester;
private $endpoints;
private $methods;
+ private static $instance;
public function __construct($options, $requester = null)
{
@@ -19,13 +20,35 @@ public function __construct($options, $requester = null)
}
$this->endpoints = Config::get('ENDPOINTS');
+ $this->endpoints = Config::isPix($options) ? $this->endpoints['PIX'] : $this->endpoints['DEFAULT'];
$this->map();
}
+ public static function getInstance($options = null, $requester = null)
+ {
+ if (!isset(self::$instance)) {
+ if(!isset($options)) {
+ throw new Exception('config not defined');
+ }
+
+ self::$instance = new self($options, $requester);
+ }
+ return self::$instance;
+ }
+
public function __call($method, $args)
{
if (isset($this->methods[$method])) {
- return $this->methods[$method]($args[0], $args[1]);
+ return $this->methods[$method]((isset($args[0]) ? $args[0] : null), (isset($args[1]) ? $args[1] : null));
+ } else {
+ throw new Exception('nonexistent endpoint');
+ }
+ }
+
+ public static function __callStatic($method, $args)
+ {
+ if (method_exists('\\Gerencianet\Utils', $method)) {
+ return Utils::$method((isset($args[0]) ? $args[0] : null), (isset($args[1]) ? $args[1] : null));
} else {
throw new Exception('nonexistent endpoint');
}
@@ -34,7 +57,7 @@ public function __call($method, $args)
private function map()
{
$this->methods = array_map(function ($endpoint) {
- return function ($params, $body) use ($endpoint) {
+ return function ($params = [], $body = []) use ($endpoint) {
$route = $this->getRoute($endpoint, $params);
$query = $this->getQueryString($params);
$route .= $query;
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Exception/GerencianetException.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Exception/GerencianetException.php
index feaea7e..feada15 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Exception/GerencianetException.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Exception/GerencianetException.php
@@ -14,8 +14,8 @@ public function __construct($exception)
{
$error = $exception;
- if ($exception instanceof \GuzzleHttp\Stream\Stream) {
- $error = $this->parseStream($exception);
+ if ($exception instanceof \GuzzleHttp\Psr7\Stream) {
+ $error = $this->parseStream($exception);
}
$message = isset($error['error_description']['message']) ? $error['error_description']['message'] : $error['error_description'];
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Gerencianet.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Gerencianet.php
index 0a757c6..08beca8 100644
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Gerencianet.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Gerencianet.php
@@ -4,4 +4,12 @@
class Gerencianet extends Endpoints
{
+ public function __construct($options, $requester = null, $endpointsConfigFile = null)
+ {
+ if ($endpointsConfigFile) {
+ Config::setEndpointsConfigFile($endpointsConfigFile);
+ }
+
+ parent::__construct($options, $requester);
+ }
}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Request.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Request.php
old mode 100755
new mode 100644
index 3874d94..dced4f1
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Request.php
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Request.php
@@ -5,52 +5,67 @@
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\ServerException;
+use GuzzleHttp\Exception\RequestException;
use Gerencianet\Exception\GerencianetException;
use Gerencianet\Exception\AuthorizationException;
class Request
{
private $client;
- private $baseUri;
- private $auth;
- private $request;
private $config;
private $certified_path;
public function __construct(array $options = null)
{
$this->config = Config::options($options);
- $composerData = json_decode(file_get_contents(__DIR__ . '/../../composer.json'), true);
- $partner_token = isset($options['partner_token']) ? $options['partner_token'] : "";
- $this->certified_path = file_exists(__DIR__ . "/../../../../../../certificado.crt") ? __DIR__ . "/../../../../../../certificado.crt" : false;
- $this->client = new Client([
+ $composerData = json_decode(file_get_contents(__DIR__.'/../../composer.json'), true);
+ $partner_token = isset($options['partner_token'])? $options['partner_token'] : "";
+ $this->certified_path = isset($options['certified_path'])? $options['certified_path'] : null;
+
+ $clientData = [
'debug' => $this->config['debug'],
- 'base_url' => $this->config['baseUri'],
+ 'base_uri' => $this->config['baseUri'],
'headers' => [
'Content-Type' => 'application/json',
- 'api-sdk' => 'magento-0.4.2',
+ 'api-sdk' => 'php-' . $composerData['version'],
'partner-token' => $partner_token
- ],
- ]);
+ ]
+ ];
+
+ $this->client = new Client($clientData);
}
public function send($method, $route, $requestOptions)
{
-
try {
- if ($this->certified_path) {
- $this->client->setDefaultOption("verify", $this->certified_path);
+ if($this->certified_path){
+ $this->client->setDefaultOption('verify', $this->certified_path);
+ }
+
+ if(isset($this->config['pixCert'])){
+ $requestOptions['cert'] = $this->config['pixCert'];
}
- $this->request = $this->client->createRequest($method, $route, $requestOptions);
- $response = $this->client->send($this->request);
- return json_decode($response->getBody(), true);
+ // Custom header data
+ if(isset($this->config['headers'])) {
+ foreach($this->config['headers'] as $key => $value) {
+ $requestOptions['headers'][$key] = $value;
+ }
+ }
+
+ try {
+ $response = $this->client->request($method, $route, $requestOptions);
+
+ return json_decode($response->getBody(), true);
+ } catch (RequestException $e) {
+ $response = ($e->getResponse()->getBody(true)) ? $e->getResponse()->getBody(true) : [];
+
+ return json_decode($response, true);
+ }
} catch (ClientException $e) {
- throw new AuthorizationException(
- $e->getResponse()->getStatusCode(),
- $e->getResponse()->getReasonPhrase(),
- $e->getResponse()->getBody()
- );
+ throw new AuthorizationException($e->getResponse()->getStatusCode(),
+ $e->getResponse()->getReasonPhrase(),
+ $e->getResponse()->getBody());
} catch (ServerException $se) {
throw new GerencianetException($se->getResponse()->getBody());
}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Utils.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Utils.php
new file mode 100644
index 0000000..934e506
--- /dev/null
+++ b/lib/gerencianet/gerencianet/gerencianet-sdk-php/src/Gerencianet/Utils.php
@@ -0,0 +1,28 @@
+ 'client_id',
- 'client_secret' => 'client_secret',
- 'url' => 'http://localhost:4404',
- ];
-
- private $authorization;
- private $response;
-
- public function setUp()
- {
- $this->authorization = json_encode(['access_token' => 'token', 'expires_in' => 500, 'token_type' => 'bearer']);
- $this->response = json_encode(['code' => 200]);
- }
-
- /**
- * @test
- */
- public function shouldRequestSuccessfully()
- {
- $request = $this->getMockBuilder('Request')
- ->setMethods(array('send'))
- ->disableOriginalConstructor()
- ->getMock();
- $request->method('send')
- ->willReturn(json_decode($this->response));
-
- $auth = $this->getMockBuilder('Auth')
- ->setMethods(array('authorize'))
- ->disableOriginalConstructor()
- ->getMock();
-
- $auth->method('authorize')
- ->willReturn(json_decode($this->authorization));
- $auth->expires = time() + 500;
- $auth->accessToken = 'accessToken';
-
- $api = new ApiRequest($this->options);
- $api->request = $request;
- $api->auth = $auth;
- $response = $api->send('POST', '/v1/charge', []);
-
- $this->assertEquals($response->code, 200);
- }
-
- /**
- * @test
- */
- public function shouldReauthorizeExpiredToken()
- {
- $request = $this->getMockBuilder('Request')
- ->setMethods(array('send'))
- ->disableOriginalConstructor()
- ->getMock();
- $request->method('send')
- ->willReturn(json_decode($this->response));
-
- $auth = $this->getMockBuilder('Auth')
- ->setMethods(array('authorize'))
- ->disableOriginalConstructor()
- ->getMock();
-
- $auth->method('authorize')
- ->willReturn(json_decode($this->authorization));
-
- $auth->expires = 500;
- $auth->accessToken = 'accessToken';
-
- $api = new ApiRequest($this->options);
- $api->request = $request;
- $api->auth = $auth;
- $response = $api->send('POST', '/v1/charge', []);
-
- $this->assertEquals($response->code, 200);
- }
-
- /**
- * @test
- */
- public function shouldReauthorizeWhenServerRespondsWithAuthError()
- {
- $request = $this->getMockBuilder('Request')
- ->setMethods(array('send'))
- ->disableOriginalConstructor()
- ->getMock();
- $exception = new AuthorizationException('401', 'Unauthorized');
- $request->method('send')
- ->will($this->onConsecutiveCalls(
- $this->throwException($exception),
- json_decode($this->response)
- )
- );
-
- $auth = $this->getMockBuilder('Auth')
- ->setMethods(array('authorize'))
- ->disableOriginalConstructor()
- ->getMock();
-
- $auth->method('authorize')
- ->willReturn(json_decode($this->authorization), json_decode($this->authorization));
-
- $auth->expires = time() + 500;
- $auth->accessToken = 'accessToken';
-
- $api = new ApiRequest($this->options);
- $api->request = $request;
- $api->auth = $auth;
- $response = $api->send('POST', '/v1/charge', []);
-
- $this->assertEquals($response->code, 200);
- }
-
- /**
- * @test
- */
- public function shouldGetPropertiesCorrectly()
- {
- $api = new ApiRequest($this->options);
-
- $this->assertNotNull($api->request);
- $this->assertNotNull($api->auth);
- $this->assertNull($api->notAProp);
- }
-
- /**
- * @test
- */
- public function shouldSetPropertiesCorrectly()
- {
- $api = new ApiRequest($this->options);
- $api->request = 'request';
- $api->notAProp = 'notAProp';
-
- $this->assertEquals($api->request, 'request');
- $this->assertNull($api->notAProp);
- }
-}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/test/Gerencianet/AuthTest.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/test/Gerencianet/AuthTest.php
deleted file mode 100644
index e8f2b60..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/test/Gerencianet/AuthTest.php
+++ /dev/null
@@ -1,79 +0,0 @@
- 'client_id',
- 'client_secret' => 'client_secret',
- 'url' => 'http://localhost:4404',
- ];
-
- private $success;
-
- public function setUp()
- {
- $this->success = json_encode(['access_token' => 'token', 'expires_in' => 500, 'token_type' => 'bearer']);
- }
-
- /**
- * @test
- * @expectedException Exception
- * @expectedExceptionMessage Client id or secret not found
- */
- public function shouldNotCreateAuthWithoutCredentials()
- {
- new Auth([]);
- }
-
- /**
- * @test
- */
- public function shouldAuthorizeSuccessfully()
- {
- $auth = new Auth($this->options);
-
- $request = $this->getMockBuilder('Request')
- ->setMethods(array('send'))
- ->disableOriginalConstructor()
- ->getMock();
- $request->method('send')
- ->willReturn(json_decode($this->success, true));
-
- $auth->request = $request;
- $auth->authorize();
-
- $this->assertEquals($auth->accessToken, 'token');
- $this->assertGreaterThan(500, $auth->expires);
- $this->assertEquals($auth->tokenType, 'bearer');
- }
-
- /**
- * @test
- */
- public function shouldGetPropertiesCorrectly()
- {
- $auth = new Auth($this->options);
- $this->assertEquals($auth->clientId, 'client_id');
- $this->assertEquals($auth->clientSecret, 'client_secret');
- $this->assertEquals($auth->notAProp, null);
- }
-
- /**
- * @test
- */
- public function shouldSetPropertiesCorrectly()
- {
- $auth = new Auth($this->options);
- $auth->clientId = 'new_client_id';
- $auth->clientSecret = 'new_client_secret';
- $auth->notAProp = 'notAProp';
-
- $this->assertEquals($auth->clientId, 'new_client_id');
- $this->assertEquals($auth->clientSecret, 'new_client_secret');
- $this->assertEquals($auth->notAProp, null);
- }
-}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/test/Gerencianet/ConfigTest.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/test/Gerencianet/ConfigTest.php
deleted file mode 100644
index 49616c7..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/test/Gerencianet/ConfigTest.php
+++ /dev/null
@@ -1,70 +0,0 @@
-assertInternalType('array', $property);
-
- $property = Config::get('ENDPOINTS');
-
- $this->assertInternalType('array', $property);
- }
-
- /**
- * @test
- */
- public function shouldReturnEmptyProperty()
- {
- $property = Config::get('NOTAPROP');
-
- $this->assertNull($property);
- }
-
- /**
- * @test
- */
- public function shouldBuildOptionsSuccessfully()
- {
- $options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'url' => 'http://dannielgnapi.gerencianet.com.br:4400',
- ];
-
- $opt = Config::options($options);
-
- $this->assertArrayHasKey('sandbox', $opt);
- $this->assertArrayHasKey('debug', $opt);
- $this->assertArrayHasKey('clientId', $opt);
- $this->assertArrayHasKey('clientSecret', $opt);
- $this->assertEquals($opt['sandbox'], false);
- }
-
- /**
- * @test
- */
- public function shouldBuildOptionsWithoutUrl()
- {
- $options = [
- 'client_id' => 'client_id',
- 'client_secret' => 'client_secret',
- 'sandbox' => true,
- ];
-
- $opt = Config::options($options);
-
- $this->assertArrayHasKey('sandbox', $opt);
- $this->assertArrayHasKey('debug', $opt);
- $this->assertArrayHasKey('clientId', $opt);
- $this->assertArrayHasKey('clientSecret', $opt);
- $this->assertEquals($opt['sandbox'], true);
- }
-}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/test/Gerencianet/EndpointsTest.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/test/Gerencianet/EndpointsTest.php
deleted file mode 100644
index f3456a5..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/test/Gerencianet/EndpointsTest.php
+++ /dev/null
@@ -1,109 +0,0 @@
-options = ['sandbox' => true, 'client_id' => 'client_id', 'client_secret' => 'client_secret'];
- $this->requester = $this->getMockBuilder('ApiRequest')
- ->setMethods(array('send'))
- ->disableOriginalConstructor()
- ->getMock();
-
- $this->requester->method('send')
- ->willReturn(true);
- }
-
- /**
- * @test
- */
- public function shouldForwarWithQueryString()
- {
- $method = 'post';
- $route = '/v1/charge?id=90&token=2039480293840923&name=francisco&lastname=carvalho';
- $body = ['content' => 'data'];
-
- $this->requester->expects($this->once())
- ->method('send')
- ->with($this->equalTo($method),
- $this->equalTo($route),
- $this->equalTo($body));
-
- $endpoints = new Endpoints($this->options, $this->requester);
- $params = ['id' => '90',
- 'token' => '2039480293840923',
- 'name' => 'francisco',
- 'lastname' => 'carvalho', ];
-
- $endpoints->createCharge($params, $body);
- }
-
- /**
- * @test
- * @expectedException Exception
- * @expectedExceptionMessage nonexistent endpoint
- */
- public function shouldThrowExceptionForWrongMethod()
- {
- $method = 'post';
- $route = '/v1/charge?id=90&token=2039480293840923&name=francisco&lastname=carvalho';
- $body = ['content' => 'data'];
-
- $this->requester->expects($this->never())
- ->method('send');
-
- $endpoints = new Endpoints($this->options, null);
- $params = ['id' => '90',
- 'token' => '2039480293840923',
- 'name' => 'francisco',
- 'lastname' => 'carvalho', ];
-
- $endpoints->notAMethod($params, $body);
- }
-
- /**
- * @test
- */
- public function shouldForwarWithParams()
- {
- $method = 'get';
- $route = '/v1/charge/90';
-
- $this->requester->expects($this->once())
- ->method('send')
- ->with($this->equalTo($method),
- $this->equalTo($route),
- $this->equalTo([]));
-
- $endpoints = new Endpoints($this->options, $this->requester);
- $params = ['id' => '90'];
-
- $endpoints->detailCharge($params, []);
- }
-
- /**
- * @test
- */
- public function shouldForwarWithParamsAndQueryString()
- {
- $method = 'get';
- $route = '/v1/charge/90?token=2039480293840923';
-
- $this->requester->expects($this->once())
- ->method('send')
- ->with($this->equalTo($method),
- $this->equalTo($route),
- $this->equalTo([]));
-
- $endpoints = new Endpoints($this->options, $this->requester);
- $params = ['id' => '90',
- 'token' => '2039480293840923', ];
-
- $endpoints->detailCharge($params, []);
- }
-}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/test/Gerencianet/RequestTest.php b/lib/gerencianet/gerencianet/gerencianet-sdk-php/test/Gerencianet/RequestTest.php
deleted file mode 100644
index 7ea6c54..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/test/Gerencianet/RequestTest.php
+++ /dev/null
@@ -1,110 +0,0 @@
- 'client_id',
- 'client_secret' => 'client_secret',
- 'url' => 'http://localhost:8082'
- ];
-
- private $success;
-
- public function setUp()
- {
- $this->success = json_encode(['access_token' => 'token', 'expires_in' => 500, 'token_type' => 'bearer']);
- }
-
- /**
- * @test
- */
- public function shouldAuthorizeSuccessfully()
- {
-
- $this->options['certified_path'] = __DIR__.'/ca.crt';
- $request = new Request($this->options);
-
- $client = $this->getMockBuilder('Client')
- ->setMethods(array('send', 'createRequest', 'setDefaultOption'))
- ->getMock();
-
- $response = $this->getMockBuilder('Response')
- ->setMethods(array('getBody'))
- ->getMock();
-
- $response->method('getBody')->willReturn($this->success);
-
- $client->expects($this->once())
- ->method('send')
- ->willReturn($response);
-
- $request->client = $client;
- $webResponse = $request->send('POST', '/v1/authorize', ['json' => ['grant_type' => 'client_credentials']]);
-
- $this->assertEquals($webResponse['access_token'], 'token');
- }
-
- /**
- * @test
- * @expectedException Gerencianet\Exception\AuthorizationException
- */
- public function shouldThrowExceptionForUnauthorized()
- {
- $request = new Request($this->options);
- // Create a mock and queue two responses.
- $mock = new Mock([
- new Response(401, ['Content-Length' => 100]),
- ]);
-
- $request->client->getEmitter()->attach($mock);
-
- $webResponse = $request->send('POST', '/authorize', ['json' => ['grant_type' => 'client_credentials']]);
- }
-
- /**
- * @test
- * @expectedException Gerencianet\Exception\GerencianetException
- */
- public function shouldThrowExceptionForServerError()
- {
- $request = new Request($this->options);
- // Create a mock and queue two responses.
- $mock = new Mock([
- new Response(500, ['Content-Length' => 100]),
- ]);
-
- $request->client->getEmitter()->attach($mock);
-
- $webResponse = $request->send('POST', '/v1/authorize', ['json' => ['grant_type' => 'client_credentials']]);
- }
-
- /**
- * @test
- */
- public function shouldGetPropertiesCorrectly()
- {
- $request = new Request($this->options);
- $request->client = 'client';
- $this->assertEquals($request->client, 'client');
- }
-
- /**
- * @test
- */
- public function shouldSetPropertiesCorrectly()
- {
- $request = new Request($this->options);
- $request->client = 'new_client_id';
- $request->notAProp = 'notAProp';
-
- $this->assertEquals($request->client, 'new_client_id');
- $this->assertEquals($request->notAProp, null);
- }
-}
diff --git a/lib/gerencianet/gerencianet/gerencianet-sdk-php/test/Gerencianet/ca.crt b/lib/gerencianet/gerencianet/gerencianet-sdk-php/test/Gerencianet/ca.crt
deleted file mode 100644
index 3b0365c..0000000
--- a/lib/gerencianet/gerencianet/gerencianet-sdk-php/test/Gerencianet/ca.crt
+++ /dev/null
@@ -1,46 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIEJTCCAw2gAwIBAgIDAjp3MA0GCSqGSIb3DQEBCwUAMEIxCzAJBgNVBAYTAlVT
-MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i
-YWwgQ0EwHhcNMTQwODI5MjEzOTMyWhcNMjIwNTIwMjEzOTMyWjBHMQswCQYDVQQG
-EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXUmFwaWRTU0wg
-U0hBMjU2IENBIC0gRzMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCv
-VJvZWF0eLFbG1eh/9H0WA//Qi1rkjqfdVC7UBMBdmJyNkA+8EGVf2prWRHzAn7Xp
-SowLBkMEu/SW4ib2YQGRZjEiwzQ0Xz8/kS9EX9zHFLYDn4ZLDqP/oIACg8PTH2lS
-1p1kD8mD5xvEcKyU58Okaiy9uJ5p2L4KjxZjWmhxgHsw3hUEv8zTvz5IBVV6s9cQ
-DAP8m/0Ip4yM26eO8R5j3LMBL3+vV8M8SKeDaCGnL+enP/C1DPz1hNFTvA5yT2AM
-QriYrRmIV9cE7Ie/fodOoyH5U/02mEiN1vi7SPIpyGTRzFRIU4uvt2UevykzKdkp
-YEj4/5G8V1jlNS67abZZAgMBAAGjggEdMIIBGTAfBgNVHSMEGDAWgBTAephojYn7
-qwVkDBF9qn1luMrMTjAdBgNVHQ4EFgQUw5zz/NNGCDS7zkZ/oHxb8+IIy1kwEgYD
-VR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAQYwNQYDVR0fBC4wLDAqoCig
-JoYkaHR0cDovL2cuc3ltY2IuY29tL2NybHMvZ3RnbG9iYWwuY3JsMC4GCCsGAQUF
-BwEBBCIwIDAeBggrBgEFBQcwAYYSaHR0cDovL2cuc3ltY2QuY29tMEwGA1UdIARF
-MEMwQQYKYIZIAYb4RQEHNjAzMDEGCCsGAQUFBwIBFiVodHRwOi8vd3d3Lmdlb3Ry
-dXN0LmNvbS9yZXNvdXJjZXMvY3BzMA0GCSqGSIb3DQEBCwUAA4IBAQCjWB7GQzKs
-rC+TeLfqrlRARy1+eI1Q9vhmrNZPc9ZE768LzFvB9E+aj0l+YK/CJ8cW8fuTgZCp
-fO9vfm5FlBaEvexJ8cQO9K8EWYOHDyw7l8NaEpt7BDV7o5UzCHuTcSJCs6nZb0+B
-kvwHtnm8hEqddwnxxYny8LScVKoSew26T++TGezvfU5ho452nFnPjJSxhJf3GrkH
-uLLGTxN5279PURt/aQ1RKsHWFf83UTRlUfQevjhq7A6rvz17OQV79PP7GqHQyH5O
-ZI3NjGFVkP46yl0lD/gdo0p0Vk8aVUBwdSWmMy66S6VdU5oNMOGNX2Esr8zvsJmh
-gP8L8mJMcCaY
------END CERTIFICATE-----
------BEGIN CERTIFICATE-----
-MIIDfTCCAuagAwIBAgIDErvmMA0GCSqGSIb3DQEBBQUAME4xCzAJBgNVBAYTAlVT
-MRAwDgYDVQQKEwdFcXVpZmF4MS0wKwYDVQQLEyRFcXVpZmF4IFNlY3VyZSBDZXJ0
-aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDIwNTIxMDQwMDAwWhcNMTgwODIxMDQwMDAw
-WjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UE
-AxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
-CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9m
-OSm9BXiLnTjoBbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIu
-T8rxh0PBFpVXLVDviS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6c
-JmTM386DGXHKTubU1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmR
-Cw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5asz
-PeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo4HwMIHtMB8GA1UdIwQYMBaAFEjm
-aPkr0rKV10fYIyAQTzOYkJ/UMB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrM
-TjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjA6BgNVHR8EMzAxMC+g
-LaArhilodHRwOi8vY3JsLmdlb3RydXN0LmNvbS9jcmxzL3NlY3VyZWNhLmNybDBO
-BgNVHSAERzBFMEMGBFUdIAAwOzA5BggrBgEFBQcCARYtaHR0cHM6Ly93d3cuZ2Vv
-dHJ1c3QuY29tL3Jlc291cmNlcy9yZXBvc2l0b3J5MA0GCSqGSIb3DQEBBQUAA4GB
-AHbhEm5OSxYShjAGsoEIz/AIx8dxfmbuwu3UOx//8PDITtZDOLC5MH0Y0FWDomrL
-NhGc6Ehmo21/uBPUR/6LWlxz/K7ZGzIZOKuXNBSqltLroxwUCEm2u+WR74M26x1W
-b8ravHNjkOR/ez4iyz0H7V84dJzjA1BOoa+Y7mHyhD8S
------END CERTIFICATE-----
\ No newline at end of file
diff --git a/lib/gerencianet/guzzle/guzzle/.gitignore b/lib/gerencianet/guzzle/guzzle/.gitignore
deleted file mode 100644
index 893035d..0000000
--- a/lib/gerencianet/guzzle/guzzle/.gitignore
+++ /dev/null
@@ -1,27 +0,0 @@
-# Ingore common cruft
-.DS_STORE
-coverage
-.idea
-
-# Ignore binary files
-guzzle.phar
-guzzle-min.phar
-
-# Ignore potentially sensitive phpunit file
-phpunit.xml
-
-# Ignore composer generated files
-composer.phar
-composer.lock
-composer-test.lock
-vendor/
-
-# Ignore build files
-build/
-phing/build.properties
-
-# Ignore subsplit working directory
-.subsplit
-
-docs/_build
-docs/*.pyc
diff --git a/lib/gerencianet/guzzle/guzzle/.travis.yml b/lib/gerencianet/guzzle/guzzle/.travis.yml
deleted file mode 100644
index 209e05c..0000000
--- a/lib/gerencianet/guzzle/guzzle/.travis.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-language: php
-
-php:
- - 5.3
- - 5.4
- - 5.5
- - 5.6
- - hhvm
-
-before_script:
- - curl --version
- - pecl install uri_template-beta || echo "pecl uri_template not available"
- - composer self-update
- - composer install --no-interaction --prefer-source --dev
- - ~/.nvm/nvm.sh install v0.6.14
-
-script: composer test
diff --git a/lib/gerencianet/guzzle/guzzle/CHANGELOG.md b/lib/gerencianet/guzzle/guzzle/CHANGELOG.md
deleted file mode 100644
index f0dc544..0000000
--- a/lib/gerencianet/guzzle/guzzle/CHANGELOG.md
+++ /dev/null
@@ -1,751 +0,0 @@
-# CHANGELOG
-
-## 3.9.3 - 2015-03-18
-
-* Ensuring Content-Length is not stripped from a request when it is `0`.
-* Added more information to stream wrapper exceptions.
-* Message parser will no longer throw warnings for malformed messages.
-* Giving a valid cache TTL when max-age is 0.
-
-## 3.9.2 - 2014-09-10
-
-* Retrying "Connection died, retrying a fresh connect" curl errors.
-* Automatically extracting the cacert from the phar in client constructor.
-* Added EntityBody support for OPTIONS requests.
-
-## 3.9.1 - 2014-05-07
-
-* Added a fix to ReadLimitEntityBody to ensure it doesn't infinitely loop.
-* Added a fix to the stream checksum function so that when the first read
- returns a falsey value, it still continues to consume the stream until EOF.
-
-## 3.9.0 - 2014-04-23
-
-* `null`, `false`, and `"_guzzle_blank_"` all now serialize as an empty value
- with no trailing "=". See dc1d824277.
-* No longer performing an MD5 check on the cacert each time the phar is used,
- but rather copying the cacert to the temp directory.
-* `"0"` can now be added as a URL path
-* Deleting cookies that are set to empty
-* If-Modified-Since is no longer unnecessarily added to the CachePlugin
-* Cookie path matching now follows RFC 6265 s5.1.4
-* Updated service descriptions are now added to a service client's composite
- factory.
-* MockPlugin now throws an exception if the queue is empty.
-* Properly parsing URLs that start with "http" but are not absolute
-* Added the ability to configure the curl_multi_select timeout setting
-* OAuth parameters are now sorted using lexicographical byte value ordering
-* Fixing invalid usage of an out of range PHP feature in the ErrorResponsePlugin
-
-## 3.8.1 -2014-01-28
-
-* Bug: Always using GET requests when redirecting from a 303 response
-* Bug: CURLOPT_SSL_VERIFYHOST is now correctly set to false when setting `$certificateAuthority` to false in
- `Guzzle\Http\ClientInterface::setSslVerification()`
-* Bug: RedirectPlugin now uses strict RFC 3986 compliance when combining a base URL with a relative URL
-* Bug: The body of a request can now be set to `"0"`
-* Sending PHP stream requests no longer forces `HTTP/1.0`
-* Adding more information to ExceptionCollection exceptions so that users have more context, including a stack trace of
- each sub-exception
-* Updated the `$ref` attribute in service descriptions to merge over any existing parameters of a schema (rather than
- clobbering everything).
-* Merging URLs will now use the query string object from the relative URL (thus allowing custom query aggregators)
-* Query strings are now parsed in a way that they do no convert empty keys with no value to have a dangling `=`.
- For example `foo&bar=baz` is now correctly parsed and recognized as `foo&bar=baz` rather than `foo=&bar=baz`.
-* Now properly escaping the regular expression delimiter when matching Cookie domains.
-* Network access is now disabled when loading XML documents
-
-## 3.8.0 - 2013-12-05
-
-* Added the ability to define a POST name for a file
-* JSON response parsing now properly walks additionalProperties
-* cURL error code 18 is now retried automatically in the BackoffPlugin
-* Fixed a cURL error when URLs contain fragments
-* Fixed an issue in the BackoffPlugin retry event where it was trying to access all exceptions as if they were
- CurlExceptions
-* CURLOPT_PROGRESS function fix for PHP 5.5 (69fcc1e)
-* Added the ability for Guzzle to work with older versions of cURL that do not support `CURLOPT_TIMEOUT_MS`
-* Fixed a bug that was encountered when parsing empty header parameters
-* UriTemplate now has a `setRegex()` method to match the docs
-* The `debug` request parameter now checks if it is truthy rather than if it exists
-* Setting the `debug` request parameter to true shows verbose cURL output instead of using the LogPlugin
-* Added the ability to combine URLs using strict RFC 3986 compliance
-* Command objects can now return the validation errors encountered by the command
-* Various fixes to cache revalidation (#437 and 29797e5)
-* Various fixes to the AsyncPlugin
-* Cleaned up build scripts
-
-## 3.7.4 - 2013-10-02
-
-* Bug fix: 0 is now an allowed value in a description parameter that has a default value (#430)
-* Bug fix: SchemaFormatter now returns an integer when formatting to a Unix timestamp
- (see https://github.com/aws/aws-sdk-php/issues/147)
-* Bug fix: Cleaned up and fixed URL dot segment removal to properly resolve internal dots
-* Minimum PHP version is now properly specified as 5.3.3 (up from 5.3.2) (#420)
-* Updated the bundled cacert.pem (#419)
-* OauthPlugin now supports adding authentication to headers or query string (#425)
-
-## 3.7.3 - 2013-09-08
-
-* Added the ability to get the exception associated with a request/command when using `MultiTransferException` and
- `CommandTransferException`.
-* Setting `additionalParameters` of a response to false is now honored when parsing responses with a service description
-* Schemas are only injected into response models when explicitly configured.
-* No longer guessing Content-Type based on the path of a request. Content-Type is now only guessed based on the path of
- an EntityBody.
-* Bug fix: ChunkedIterator can now properly chunk a \Traversable as well as an \Iterator.
-* Bug fix: FilterIterator now relies on `\Iterator` instead of `\Traversable`.
-* Bug fix: Gracefully handling malformed responses in RequestMediator::writeResponseBody()
-* Bug fix: Replaced call to canCache with canCacheRequest in the CallbackCanCacheStrategy of the CachePlugin
-* Bug fix: Visiting XML attributes first before visting XML children when serializing requests
-* Bug fix: Properly parsing headers that contain commas contained in quotes
-* Bug fix: mimetype guessing based on a filename is now case-insensitive
-
-## 3.7.2 - 2013-08-02
-
-* Bug fix: Properly URL encoding paths when using the PHP-only version of the UriTemplate expander
- See https://github.com/guzzle/guzzle/issues/371
-* Bug fix: Cookie domains are now matched correctly according to RFC 6265
- See https://github.com/guzzle/guzzle/issues/377
-* Bug fix: GET parameters are now used when calculating an OAuth signature
-* Bug fix: Fixed an issue with cache revalidation where the If-None-Match header was being double quoted
-* `Guzzle\Common\AbstractHasDispatcher::dispatch()` now returns the event that was dispatched
-* `Guzzle\Http\QueryString::factory()` now guesses the most appropriate query aggregator to used based on the input.
- See https://github.com/guzzle/guzzle/issues/379
-* Added a way to add custom domain objects to service description parsing using the `operation.parse_class` event. See
- https://github.com/guzzle/guzzle/pull/380
-* cURL multi cleanup and optimizations
-
-## 3.7.1 - 2013-07-05
-
-* Bug fix: Setting default options on a client now works
-* Bug fix: Setting options on HEAD requests now works. See #352
-* Bug fix: Moving stream factory before send event to before building the stream. See #353
-* Bug fix: Cookies no longer match on IP addresses per RFC 6265
-* Bug fix: Correctly parsing header parameters that are in `<>` and quotes
-* Added `cert` and `ssl_key` as request options
-* `Host` header can now diverge from the host part of a URL if the header is set manually
-* `Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor` was rewritten to change from using SimpleXML to XMLWriter
-* OAuth parameters are only added via the plugin if they aren't already set
-* Exceptions are now thrown when a URL cannot be parsed
-* Returning `false` if `Guzzle\Http\EntityBody::getContentMd5()` fails
-* Not setting a `Content-MD5` on a command if calculating the Content-MD5 fails via the CommandContentMd5Plugin
-
-## 3.7.0 - 2013-06-10
-
-* See UPGRADING.md for more information on how to upgrade.
-* Requests now support the ability to specify an array of $options when creating a request to more easily modify a
- request. You can pass a 'request.options' configuration setting to a client to apply default request options to
- every request created by a client (e.g. default query string variables, headers, curl options, etc).
-* Added a static facade class that allows you to use Guzzle with static methods and mount the class to `\Guzzle`.
- See `Guzzle\Http\StaticClient::mount`.
-* Added `command.request_options` to `Guzzle\Service\Command\AbstractCommand` to pass request options to requests
- created by a command (e.g. custom headers, query string variables, timeout settings, etc).
-* Stream size in `Guzzle\Stream\PhpStreamRequestFactory` will now be set if Content-Length is returned in the
- headers of a response
-* Added `Guzzle\Common\Collection::setPath($path, $value)` to set a value into an array using a nested key
- (e.g. `$collection->setPath('foo/baz/bar', 'test'); echo $collection['foo']['bar']['bar'];`)
-* ServiceBuilders now support storing and retrieving arbitrary data
-* CachePlugin can now purge all resources for a given URI
-* CachePlugin can automatically purge matching cached items when a non-idempotent request is sent to a resource
-* CachePlugin now uses the Vary header to determine if a resource is a cache hit
-* `Guzzle\Http\Message\Response` now implements `\Serializable`
-* Added `Guzzle\Cache\CacheAdapterFactory::fromCache()` to more easily create cache adapters
-* `Guzzle\Service\ClientInterface::execute()` now accepts an array, single command, or Traversable
-* Fixed a bug in `Guzzle\Http\Message\Header\Link::addLink()`
-* Better handling of calculating the size of a stream in `Guzzle\Stream\Stream` using fstat() and caching the size
-* `Guzzle\Common\Exception\ExceptionCollection` now creates a more readable exception message
-* Fixing BC break: Added back the MonologLogAdapter implementation rather than extending from PsrLog so that older
- Symfony users can still use the old version of Monolog.
-* Fixing BC break: Added the implementation back in for `Guzzle\Http\Message\AbstractMessage::getTokenizedHeader()`.
- Now triggering an E_USER_DEPRECATED warning when used. Use `$message->getHeader()->parseParams()`.
-* Several performance improvements to `Guzzle\Common\Collection`
-* Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`:
- createRequest, head, delete, put, patch, post, options, prepareRequest
-* Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()`
-* Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface`
-* Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to
- `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a
- resource, string, or EntityBody into the $options parameter to specify the download location of the response.
-* Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a
- default `array()`
-* Added `Guzzle\Stream\StreamInterface::isRepeatable`
-* Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use
- $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or
- $client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))`.
-* Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use $client->getConfig()->getPath('request.options/headers')`.
-* Removed `Guzzle\Http\ClientInterface::expandTemplate()`
-* Removed `Guzzle\Http\ClientInterface::setRequestFactory()`
-* Removed `Guzzle\Http\ClientInterface::getCurlMulti()`
-* Removed `Guzzle\Http\Message\RequestInterface::canCache`
-* Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`
-* Removed `Guzzle\Http\Message\RequestInterface::isRedirect`
-* Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods.
-* You can now enable E_USER_DEPRECATED warnings to see if you are using a deprecated method by setting
- `Guzzle\Common\Version::$emitWarnings` to true.
-* Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use
- `$request->getResponseBody()->isRepeatable()` instead.
-* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use
- `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead.
-* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use
- `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead.
-* Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead.
-* Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead.
-* Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated
-* Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand.
- These will work through Guzzle 4.0
-* Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use [request.options][params].
-* Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client.
-* Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use $client->getConfig()->getPath('request.options/headers')`.
-* Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`.
-* Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8.
-* Marked `Guzzle\Common\Collection::inject()` as deprecated.
-* Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');`
-* CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a
- CacheStorageInterface. These two objects and interface will be removed in a future version.
-* Always setting X-cache headers on cached responses
-* Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin
-* `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface
- $request, Response $response);`
-* `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);`
-* `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);`
-* Added `CacheStorageInterface::purge($url)`
-* `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin
- $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache,
- CanCacheStrategyInterface $canCache = null)`
-* Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)`
-
-## 3.6.0 - 2013-05-29
-
-* ServiceDescription now implements ToArrayInterface
-* Added command.hidden_params to blacklist certain headers from being treated as additionalParameters
-* Guzzle can now correctly parse incomplete URLs
-* Mixed casing of headers are now forced to be a single consistent casing across all values for that header.
-* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution
-* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader().
-* Specific header implementations can be created for complex headers. When a message creates a header, it uses a
- HeaderFactory which can map specific headers to specific header classes. There is now a Link header and
- CacheControl header implementation.
-* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate
-* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti()
-* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in
- Guzzle\Http\Curl\RequestMediator
-* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string.
-* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface
-* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders()
-* Removed Guzzle\Parser\ParserRegister::get(). Use getParser()
-* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser().
-* All response header helper functions return a string rather than mixing Header objects and strings inconsistently
-* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc are managed by Guzzle
- directly via interfaces
-* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist
- but are a no-op until removed.
-* Most classes that used to require a ``Guzzle\Service\Command\CommandInterface` typehint now request a
- `Guzzle\Service\Command\ArrayCommandInterface`.
-* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response
- on a request while the request is still being transferred
-* The ability to case-insensitively search for header values
-* Guzzle\Http\Message\Header::hasExactHeader
-* Guzzle\Http\Message\Header::raw. Use getAll()
-* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object
- instead.
-* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess
-* Added the ability to cast Model objects to a string to view debug information.
-
-## 3.5.0 - 2013-05-13
-
-* Bug: Fixed a regression so that request responses are parsed only once per oncomplete event rather than multiple times
-* Bug: Better cleanup of one-time events accross the board (when an event is meant to fire once, it will now remove
- itself from the EventDispatcher)
-* Bug: `Guzzle\Log\MessageFormatter` now properly writes "total_time" and "connect_time" values
-* Bug: Cloning an EntityEnclosingRequest now clones the EntityBody too
-* Bug: Fixed an undefined index error when parsing nested JSON responses with a sentAs parameter that reference a
- non-existent key
-* Bug: All __call() method arguments are now required (helps with mocking frameworks)
-* Deprecating Response::getRequest() and now using a shallow clone of a request object to remove a circular reference
- to help with refcount based garbage collection of resources created by sending a request
-* Deprecating ZF1 cache and log adapters. These will be removed in the next major version.
-* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it'sdeprecated). Use the
- HistoryPlugin for a history.
-* Added a `responseBody` alias for the `response_body` location
-* Refactored internals to no longer rely on Response::getRequest()
-* HistoryPlugin can now be cast to a string
-* HistoryPlugin now logs transactions rather than requests and responses to more accurately keep track of the requests
- and responses that are sent over the wire
-* Added `getEffectiveUrl()` and `getRedirectCount()` to Response objects
-
-## 3.4.3 - 2013-04-30
-
-* Bug fix: Fixing bug introduced in 3.4.2 where redirect responses are duplicated on the final redirected response
-* Added a check to re-extract the temp cacert bundle from the phar before sending each request
-
-## 3.4.2 - 2013-04-29
-
-* Bug fix: Stream objects now work correctly with "a" and "a+" modes
-* Bug fix: Removing `Transfer-Encoding: chunked` header when a Content-Length is present
-* Bug fix: AsyncPlugin no longer forces HEAD requests
-* Bug fix: DateTime timezones are now properly handled when using the service description schema formatter
-* Bug fix: CachePlugin now properly handles stale-if-error directives when a request to the origin server fails
-* Setting a response on a request will write to the custom request body from the response body if one is specified
-* LogPlugin now writes to php://output when STDERR is undefined
-* Added the ability to set multiple POST files for the same key in a single call
-* application/x-www-form-urlencoded POSTs now use the utf-8 charset by default
-* Added the ability to queue CurlExceptions to the MockPlugin
-* Cleaned up how manual responses are queued on requests (removed "queued_response" and now using request.before_send)
-* Configuration loading now allows remote files
-
-## 3.4.1 - 2013-04-16
-
-* Large refactoring to how CurlMulti handles work. There is now a proxy that sits in front of a pool of CurlMulti
- handles. This greatly simplifies the implementation, fixes a couple bugs, and provides a small performance boost.
-* Exceptions are now properly grouped when sending requests in parallel
-* Redirects are now properly aggregated when a multi transaction fails
-* Redirects now set the response on the original object even in the event of a failure
-* Bug fix: Model names are now properly set even when using $refs
-* Added support for PHP 5.5's CurlFile to prevent warnings with the deprecated @ syntax
-* Added support for oauth_callback in OAuth signatures
-* Added support for oauth_verifier in OAuth signatures
-* Added support to attempt to retrieve a command first literally, then ucfirst, the with inflection
-
-## 3.4.0 - 2013-04-11
-
-* Bug fix: URLs are now resolved correctly based on http://tools.ietf.org/html/rfc3986#section-5.2. #289
-* Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289
-* Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263
-* Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264.
-* Bug fix: Added `number` type to service descriptions.
-* Bug fix: empty parameters are removed from an OAuth signature
-* Bug fix: Revalidating a cache entry prefers the Last-Modified over the Date header
-* Bug fix: Fixed "array to string" error when validating a union of types in a service description
-* Bug fix: Removed code that attempted to determine the size of a stream when data is written to the stream
-* Bug fix: Not including an `oauth_token` if the value is null in the OauthPlugin.
-* Bug fix: Now correctly aggregating successful requests and failed requests in CurlMulti when a redirect occurs.
-* The new default CURLOPT_TIMEOUT setting has been increased to 150 seconds so that Guzzle works on poor connections.
-* Added a feature to EntityEnclosingRequest::setBody() that will automatically set the Content-Type of the request if
- the Content-Type can be determined based on the entity body or the path of the request.
-* Added the ability to overwrite configuration settings in a client when grabbing a throwaway client from a builder.
-* Added support for a PSR-3 LogAdapter.
-* Added a `command.after_prepare` event
-* Added `oauth_callback` parameter to the OauthPlugin
-* Added the ability to create a custom stream class when using a stream factory
-* Added a CachingEntityBody decorator
-* Added support for `additionalParameters` in service descriptions to define how custom parameters are serialized.
-* The bundled SSL certificate is now provided in the phar file and extracted when running Guzzle from a phar.
-* You can now send any EntityEnclosingRequest with POST fields or POST files and cURL will handle creating bodies
-* POST requests using a custom entity body are now treated exactly like PUT requests but with a custom cURL method. This
- means that the redirect behavior of POST requests with custom bodies will not be the same as POST requests that use
- POST fields or files (the latter is only used when emulating a form POST in the browser).
-* Lots of cleanup to CurlHandle::factory and RequestFactory::createRequest
-
-## 3.3.1 - 2013-03-10
-
-* Added the ability to create PHP streaming responses from HTTP requests
-* Bug fix: Running any filters when parsing response headers with service descriptions
-* Bug fix: OauthPlugin fixes to allow for multi-dimensional array signing, and sorting parameters before signing
-* Bug fix: Removed the adding of default empty arrays and false Booleans to responses in order to be consistent across
- response location visitors.
-* Bug fix: Removed the possibility of creating configuration files with circular dependencies
-* RequestFactory::create() now uses the key of a POST file when setting the POST file name
-* Added xmlAllowEmpty to serialize an XML body even if no XML specific parameters are set
-
-## 3.3.0 - 2013-03-03
-
-* A large number of performance optimizations have been made
-* Bug fix: Added 'wb' as a valid write mode for streams
-* Bug fix: `Guzzle\Http\Message\Response::json()` now allows scalar values to be returned
-* Bug fix: Fixed bug in `Guzzle\Http\Message\Response` where wrapping quotes were stripped from `getEtag()`
-* BC: Removed `Guzzle\Http\Utils` class
-* BC: Setting a service description on a client will no longer modify the client's command factories.
-* BC: Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using
- the 'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io'
-* BC: `Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to
- lowercase
-* Operation parameter objects are now lazy loaded internally
-* Added ErrorResponsePlugin that can throw errors for responses defined in service description operations' errorResponses
-* Added support for instantiating responseType=class responseClass classes. Classes must implement
- `Guzzle\Service\Command\ResponseClassInterface`
-* Added support for additionalProperties for top-level parameters in responseType=model responseClasses. These
- additional properties also support locations and can be used to parse JSON responses where the outermost part of the
- JSON is an array
-* Added support for nested renaming of JSON models (rename sentAs to name)
-* CachePlugin
- * Added support for stale-if-error so that the CachePlugin can now serve stale content from the cache on error
- * Debug headers can now added to cached response in the CachePlugin
-
-## 3.2.0 - 2013-02-14
-
-* CurlMulti is no longer reused globally. A new multi object is created per-client. This helps to isolate clients.
-* URLs with no path no longer contain a "/" by default
-* Guzzle\Http\QueryString does no longer manages the leading "?". This is now handled in Guzzle\Http\Url.
-* BadResponseException no longer includes the full request and response message
-* Adding setData() to Guzzle\Service\Description\ServiceDescriptionInterface
-* Adding getResponseBody() to Guzzle\Http\Message\RequestInterface
-* Various updates to classes to use ServiceDescriptionInterface type hints rather than ServiceDescription
-* Header values can now be normalized into distinct values when multiple headers are combined with a comma separated list
-* xmlEncoding can now be customized for the XML declaration of a XML service description operation
-* Guzzle\Http\QueryString now uses Guzzle\Http\QueryAggregator\QueryAggregatorInterface objects to add custom value
- aggregation and no longer uses callbacks
-* The URL encoding implementation of Guzzle\Http\QueryString can now be customized
-* Bug fix: Filters were not always invoked for array service description parameters
-* Bug fix: Redirects now use a target response body rather than a temporary response body
-* Bug fix: The default exponential backoff BackoffPlugin was not giving when the request threshold was exceeded
-* Bug fix: Guzzle now takes the first found value when grabbing Cache-Control directives
-
-## 3.1.2 - 2013-01-27
-
-* Refactored how operation responses are parsed. Visitors now include a before() method responsible for parsing the
- response body. For example, the XmlVisitor now parses the XML response into an array in the before() method.
-* Fixed an issue where cURL would not automatically decompress responses when the Accept-Encoding header was sent
-* CURLOPT_SSL_VERIFYHOST is never set to 1 because it is deprecated (see 5e0ff2ef20f839e19d1eeb298f90ba3598784444)
-* Fixed a bug where redirect responses were not chained correctly using getPreviousResponse()
-* Setting default headers on a client after setting the user-agent will not erase the user-agent setting
-
-## 3.1.1 - 2013-01-20
-
-* Adding wildcard support to Guzzle\Common\Collection::getPath()
-* Adding alias support to ServiceBuilder configs
-* Adding Guzzle\Service\Resource\CompositeResourceIteratorFactory and cleaning up factory interface
-
-## 3.1.0 - 2013-01-12
-
-* BC: CurlException now extends from RequestException rather than BadResponseException
-* BC: Renamed Guzzle\Plugin\Cache\CanCacheStrategyInterface::canCache() to canCacheRequest() and added CanCacheResponse()
-* Added getData to ServiceDescriptionInterface
-* Added context array to RequestInterface::setState()
-* Bug: Removing hard dependency on the BackoffPlugin from Guzzle\Http
-* Bug: Adding required content-type when JSON request visitor adds JSON to a command
-* Bug: Fixing the serialization of a service description with custom data
-* Made it easier to deal with exceptions thrown when transferring commands or requests in parallel by providing
- an array of successful and failed responses
-* Moved getPath from Guzzle\Service\Resource\Model to Guzzle\Common\Collection
-* Added Guzzle\Http\IoEmittingEntityBody
-* Moved command filtration from validators to location visitors
-* Added `extends` attributes to service description parameters
-* Added getModels to ServiceDescriptionInterface
-
-## 3.0.7 - 2012-12-19
-
-* Fixing phar detection when forcing a cacert to system if null or true
-* Allowing filename to be passed to `Guzzle\Http\Message\Request::setResponseBody()`
-* Cleaning up `Guzzle\Common\Collection::inject` method
-* Adding a response_body location to service descriptions
-
-## 3.0.6 - 2012-12-09
-
-* CurlMulti performance improvements
-* Adding setErrorResponses() to Operation
-* composer.json tweaks
-
-## 3.0.5 - 2012-11-18
-
-* Bug: Fixing an infinite recursion bug caused from revalidating with the CachePlugin
-* Bug: Response body can now be a string containing "0"
-* Bug: Using Guzzle inside of a phar uses system by default but now allows for a custom cacert
-* Bug: QueryString::fromString now properly parses query string parameters that contain equal signs
-* Added support for XML attributes in service description responses
-* DefaultRequestSerializer now supports array URI parameter values for URI template expansion
-* Added better mimetype guessing to requests and post files
-
-## 3.0.4 - 2012-11-11
-
-* Bug: Fixed a bug when adding multiple cookies to a request to use the correct glue value
-* Bug: Cookies can now be added that have a name, domain, or value set to "0"
-* Bug: Using the system cacert bundle when using the Phar
-* Added json and xml methods to Response to make it easier to parse JSON and XML response data into data structures
-* Enhanced cookie jar de-duplication
-* Added the ability to enable strict cookie jars that throw exceptions when invalid cookies are added
-* Added setStream to StreamInterface to actually make it possible to implement custom rewind behavior for entity bodies
-* Added the ability to create any sort of hash for a stream rather than just an MD5 hash
-
-## 3.0.3 - 2012-11-04
-
-* Implementing redirects in PHP rather than cURL
-* Added PECL URI template extension and using as default parser if available
-* Bug: Fixed Content-Length parsing of Response factory
-* Adding rewind() method to entity bodies and streams. Allows for custom rewinding of non-repeatable streams.
-* Adding ToArrayInterface throughout library
-* Fixing OauthPlugin to create unique nonce values per request
-
-## 3.0.2 - 2012-10-25
-
-* Magic methods are enabled by default on clients
-* Magic methods return the result of a command
-* Service clients no longer require a base_url option in the factory
-* Bug: Fixed an issue with URI templates where null template variables were being expanded
-
-## 3.0.1 - 2012-10-22
-
-* Models can now be used like regular collection objects by calling filter, map, etc
-* Models no longer require a Parameter structure or initial data in the constructor
-* Added a custom AppendIterator to get around a PHP bug with the `\AppendIterator`
-
-## 3.0.0 - 2012-10-15
-
-* Rewrote service description format to be based on Swagger
- * Now based on JSON schema
- * Added nested input structures and nested response models
- * Support for JSON and XML input and output models
- * Renamed `commands` to `operations`
- * Removed dot class notation
- * Removed custom types
-* Broke the project into smaller top-level namespaces to be more component friendly
-* Removed support for XML configs and descriptions. Use arrays or JSON files.
-* Removed the Validation component and Inspector
-* Moved all cookie code to Guzzle\Plugin\Cookie
-* Magic methods on a Guzzle\Service\Client now return the command un-executed.
-* Calling getResult() or getResponse() on a command will lazily execute the command if needed.
-* Now shipping with cURL's CA certs and using it by default
-* Added previousResponse() method to response objects
-* No longer sending Accept and Accept-Encoding headers on every request
-* Only sending an Expect header by default when a payload is greater than 1MB
-* Added/moved client options:
- * curl.blacklist to curl.option.blacklist
- * Added ssl.certificate_authority
-* Added a Guzzle\Iterator component
-* Moved plugins from Guzzle\Http\Plugin to Guzzle\Plugin
-* Added a more robust backoff retry strategy (replaced the ExponentialBackoffPlugin)
-* Added a more robust caching plugin
-* Added setBody to response objects
-* Updating LogPlugin to use a more flexible MessageFormatter
-* Added a completely revamped build process
-* Cleaning up Collection class and removing default values from the get method
-* Fixed ZF2 cache adapters
-
-## 2.8.8 - 2012-10-15
-
-* Bug: Fixed a cookie issue that caused dot prefixed domains to not match where popular browsers did
-
-## 2.8.7 - 2012-09-30
-
-* Bug: Fixed config file aliases for JSON includes
-* Bug: Fixed cookie bug on a request object by using CookieParser to parse cookies on requests
-* Bug: Removing the path to a file when sending a Content-Disposition header on a POST upload
-* Bug: Hardening request and response parsing to account for missing parts
-* Bug: Fixed PEAR packaging
-* Bug: Fixed Request::getInfo
-* Bug: Fixed cases where CURLM_CALL_MULTI_PERFORM return codes were causing curl transactions to fail
-* Adding the ability for the namespace Iterator factory to look in multiple directories
-* Added more getters/setters/removers from service descriptions
-* Added the ability to remove POST fields from OAuth signatures
-* OAuth plugin now supports 2-legged OAuth
-
-## 2.8.6 - 2012-09-05
-
-* Added the ability to modify and build service descriptions
-* Added the use of visitors to apply parameters to locations in service descriptions using the dynamic command
-* Added a `json` parameter location
-* Now allowing dot notation for classes in the CacheAdapterFactory
-* Using the union of two arrays rather than an array_merge when extending service builder services and service params
-* Ensuring that a service is a string before doing strpos() checks on it when substituting services for references
- in service builder config files.
-* Services defined in two different config files that include one another will by default replace the previously
- defined service, but you can now create services that extend themselves and merge their settings over the previous
-* The JsonLoader now supports aliasing filenames with different filenames. This allows you to alias something like
- '_default' with a default JSON configuration file.
-
-## 2.8.5 - 2012-08-29
-
-* Bug: Suppressed empty arrays from URI templates
-* Bug: Added the missing $options argument from ServiceDescription::factory to enable caching
-* Added support for HTTP responses that do not contain a reason phrase in the start-line
-* AbstractCommand commands are now invokable
-* Added a way to get the data used when signing an Oauth request before a request is sent
-
-## 2.8.4 - 2012-08-15
-
-* Bug: Custom delay time calculations are no longer ignored in the ExponentialBackoffPlugin
-* Added the ability to transfer entity bodies as a string rather than streamed. This gets around curl error 65. Set `body_as_string` in a request's curl options to enable.
-* Added a StreamInterface, EntityBodyInterface, and added ftell() to Guzzle\Common\Stream
-* Added an AbstractEntityBodyDecorator and a ReadLimitEntityBody decorator to transfer only a subset of a decorated stream
-* Stream and EntityBody objects will now return the file position to the previous position after a read required operation (e.g. getContentMd5())
-* Added additional response status codes
-* Removed SSL information from the default User-Agent header
-* DELETE requests can now send an entity body
-* Added an EventDispatcher to the ExponentialBackoffPlugin and added an ExponentialBackoffLogger to log backoff retries
-* Added the ability of the MockPlugin to consume mocked request bodies
-* LogPlugin now exposes request and response objects in the extras array
-
-## 2.8.3 - 2012-07-30
-
-* Bug: Fixed a case where empty POST requests were sent as GET requests
-* Bug: Fixed a bug in ExponentialBackoffPlugin that caused fatal errors when retrying an EntityEnclosingRequest that does not have a body
-* Bug: Setting the response body of a request to null after completing a request, not when setting the state of a request to new
-* Added multiple inheritance to service description commands
-* Added an ApiCommandInterface and added ``getParamNames()`` and ``hasParam()``
-* Removed the default 2mb size cutoff from the Md5ValidatorPlugin so that it now defaults to validating everything
-* Changed CurlMulti::perform to pass a smaller timeout to CurlMulti::executeHandles
-
-## 2.8.2 - 2012-07-24
-
-* Bug: Query string values set to 0 are no longer dropped from the query string
-* Bug: A Collection object is no longer created each time a call is made to ``Guzzle\Service\Command\AbstractCommand::getRequestHeaders()``
-* Bug: ``+`` is now treated as an encoded space when parsing query strings
-* QueryString and Collection performance improvements
-* Allowing dot notation for class paths in filters attribute of a service descriptions
-
-## 2.8.1 - 2012-07-16
-
-* Loosening Event Dispatcher dependency
-* POST redirects can now be customized using CURLOPT_POSTREDIR
-
-## 2.8.0 - 2012-07-15
-
-* BC: Guzzle\Http\Query
- * Query strings with empty variables will always show an equal sign unless the variable is set to QueryString::BLANK (e.g. ?acl= vs ?acl)
- * Changed isEncodingValues() and isEncodingFields() to isUrlEncoding()
- * Changed setEncodeValues(bool) and setEncodeFields(bool) to useUrlEncoding(bool)
- * Changed the aggregation functions of QueryString to be static methods
- * Can now use fromString() with querystrings that have a leading ?
-* cURL configuration values can be specified in service descriptions using ``curl.`` prefixed parameters
-* Content-Length is set to 0 before emitting the request.before_send event when sending an empty request body
-* Cookies are no longer URL decoded by default
-* Bug: URI template variables set to null are no longer expanded
-
-## 2.7.2 - 2012-07-02
-
-* BC: Moving things to get ready for subtree splits. Moving Inflection into Common. Moving Guzzle\Http\Parser to Guzzle\Parser.
-* BC: Removing Guzzle\Common\Batch\Batch::count() and replacing it with isEmpty()
-* CachePlugin now allows for a custom request parameter function to check if a request can be cached
-* Bug fix: CachePlugin now only caches GET and HEAD requests by default
-* Bug fix: Using header glue when transferring headers over the wire
-* Allowing deeply nested arrays for composite variables in URI templates
-* Batch divisors can now return iterators or arrays
-
-## 2.7.1 - 2012-06-26
-
-* Minor patch to update version number in UA string
-* Updating build process
-
-## 2.7.0 - 2012-06-25
-
-* BC: Inflection classes moved to Guzzle\Inflection. No longer static methods. Can now inject custom inflectors into classes.
-* BC: Removed magic setX methods from commands
-* BC: Magic methods mapped to service description commands are now inflected in the command factory rather than the client __call() method
-* Verbose cURL options are no longer enabled by default. Set curl.debug to true on a client to enable.
-* Bug: Now allowing colons in a response start-line (e.g. HTTP/1.1 503 Service Unavailable: Back-end server is at capacity)
-* Guzzle\Service\Resource\ResourceIteratorApplyBatched now internally uses the Guzzle\Common\Batch namespace
-* Added Guzzle\Service\Plugin namespace and a PluginCollectionPlugin
-* Added the ability to set POST fields and files in a service description
-* Guzzle\Http\EntityBody::factory() now accepts objects with a __toString() method
-* Adding a command.before_prepare event to clients
-* Added BatchClosureTransfer and BatchClosureDivisor
-* BatchTransferException now includes references to the batch divisor and transfer strategies
-* Fixed some tests so that they pass more reliably
-* Added Guzzle\Common\Log\ArrayLogAdapter
-
-## 2.6.6 - 2012-06-10
-
-* BC: Removing Guzzle\Http\Plugin\BatchQueuePlugin
-* BC: Removing Guzzle\Service\Command\CommandSet
-* Adding generic batching system (replaces the batch queue plugin and command set)
-* Updating ZF cache and log adapters and now using ZF's composer repository
-* Bug: Setting the name of each ApiParam when creating through an ApiCommand
-* Adding result_type, result_doc, deprecated, and doc_url to service descriptions
-* Bug: Changed the default cookie header casing back to 'Cookie'
-
-## 2.6.5 - 2012-06-03
-
-* BC: Renaming Guzzle\Http\Message\RequestInterface::getResourceUri() to getResource()
-* BC: Removing unused AUTH_BASIC and AUTH_DIGEST constants from
-* BC: Guzzle\Http\Cookie is now used to manage Set-Cookie data, not Cookie data
-* BC: Renaming methods in the CookieJarInterface
-* Moving almost all cookie logic out of the CookiePlugin and into the Cookie or CookieJar implementations
-* Making the default glue for HTTP headers ';' instead of ','
-* Adding a removeValue to Guzzle\Http\Message\Header
-* Adding getCookies() to request interface.
-* Making it easier to add event subscribers to HasDispatcherInterface classes. Can now directly call addSubscriber()
-
-## 2.6.4 - 2012-05-30
-
-* BC: Cleaning up how POST files are stored in EntityEnclosingRequest objects. Adding PostFile class.
-* BC: Moving ApiCommand specific functionality from the Inspector and on to the ApiCommand
-* Bug: Fixing magic method command calls on clients
-* Bug: Email constraint only validates strings
-* Bug: Aggregate POST fields when POST files are present in curl handle
-* Bug: Fixing default User-Agent header
-* Bug: Only appending or prepending parameters in commands if they are specified
-* Bug: Not requiring response reason phrases or status codes to match a predefined list of codes
-* Allowing the use of dot notation for class namespaces when using instance_of constraint
-* Added any_match validation constraint
-* Added an AsyncPlugin
-* Passing request object to the calculateWait method of the ExponentialBackoffPlugin
-* Allowing the result of a command object to be changed
-* Parsing location and type sub values when instantiating a service description rather than over and over at runtime
-
-## 2.6.3 - 2012-05-23
-
-* [BC] Guzzle\Common\FromConfigInterface no longer requires any config options.
-* [BC] Refactoring how POST files are stored on an EntityEnclosingRequest. They are now separate from POST fields.
-* You can now use an array of data when creating PUT request bodies in the request factory.
-* Removing the requirement that HTTPS requests needed a Cache-Control: public directive to be cacheable.
-* [Http] Adding support for Content-Type in multipart POST uploads per upload
-* [Http] Added support for uploading multiple files using the same name (foo[0], foo[1])
-* Adding more POST data operations for easier manipulation of POST data.
-* You can now set empty POST fields.
-* The body of a request is only shown on EntityEnclosingRequest objects that do not use POST files.
-* Split the Guzzle\Service\Inspector::validateConfig method into two methods. One to initialize when a command is created, and one to validate.
-* CS updates
-
-## 2.6.2 - 2012-05-19
-
-* [Http] Better handling of nested scope requests in CurlMulti. Requests are now always prepares in the send() method rather than the addRequest() method.
-
-## 2.6.1 - 2012-05-19
-
-* [BC] Removing 'path' support in service descriptions. Use 'uri'.
-* [BC] Guzzle\Service\Inspector::parseDocBlock is now protected. Adding getApiParamsForClass() with cache.
-* [BC] Removing Guzzle\Common\NullObject. Use https://github.com/mtdowling/NullObject if you need it.
-* [BC] Removing Guzzle\Common\XmlElement.
-* All commands, both dynamic and concrete, have ApiCommand objects.
-* Adding a fix for CurlMulti so that if all of the connections encounter some sort of curl error, then the loop exits.
-* Adding checks to EntityEnclosingRequest so that empty POST files and fields are ignored.
-* Making the method signature of Guzzle\Service\Builder\ServiceBuilder::factory more flexible.
-
-## 2.6.0 - 2012-05-15
-
-* [BC] Moving Guzzle\Service\Builder to Guzzle\Service\Builder\ServiceBuilder
-* [BC] Executing a Command returns the result of the command rather than the command
-* [BC] Moving all HTTP parsing logic to Guzzle\Http\Parsers. Allows for faster C implementations if needed.
-* [BC] Changing the Guzzle\Http\Message\Response::setProtocol() method to accept a protocol and version in separate args.
-* [BC] Moving ResourceIterator* to Guzzle\Service\Resource
-* [BC] Completely refactored ResourceIterators to iterate over a cloned command object
-* [BC] Moved Guzzle\Http\UriTemplate to Guzzle\Http\Parser\UriTemplate\UriTemplate
-* [BC] Guzzle\Guzzle is now deprecated
-* Moving Guzzle\Common\Guzzle::inject to Guzzle\Common\Collection::inject
-* Adding Guzzle\Version class to give version information about Guzzle
-* Adding Guzzle\Http\Utils class to provide getDefaultUserAgent() and getHttpDate()
-* Adding Guzzle\Curl\CurlVersion to manage caching curl_version() data
-* ServiceDescription and ServiceBuilder are now cacheable using similar configs
-* Changing the format of XML and JSON service builder configs. Backwards compatible.
-* Cleaned up Cookie parsing
-* Trimming the default Guzzle User-Agent header
-* Adding a setOnComplete() method to Commands that is called when a command completes
-* Keeping track of requests that were mocked in the MockPlugin
-* Fixed a caching bug in the CacheAdapterFactory
-* Inspector objects can be injected into a Command object
-* Refactoring a lot of code and tests to be case insensitive when dealing with headers
-* Adding Guzzle\Http\Message\HeaderComparison for easy comparison of HTTP headers using a DSL
-* Adding the ability to set global option overrides to service builder configs
-* Adding the ability to include other service builder config files from within XML and JSON files
-* Moving the parseQuery method out of Url and on to QueryString::fromString() as a static factory method.
-
-## 2.5.0 - 2012-05-08
-
-* Major performance improvements
-* [BC] Simplifying Guzzle\Common\Collection. Please check to see if you are using features that are now deprecated.
-* [BC] Using a custom validation system that allows a flyweight implementation for much faster validation. No longer using Symfony2 Validation component.
-* [BC] No longer supporting "{{ }}" for injecting into command or UriTemplates. Use "{}"
-* Added the ability to passed parameters to all requests created by a client
-* Added callback functionality to the ExponentialBackoffPlugin
-* Using microtime in ExponentialBackoffPlugin to allow more granular backoff strategies.
-* Rewinding request stream bodies when retrying requests
-* Exception is thrown when JSON response body cannot be decoded
-* Added configurable magic method calls to clients and commands. This is off by default.
-* Fixed a defect that added a hash to every parsed URL part
-* Fixed duplicate none generation for OauthPlugin.
-* Emitting an event each time a client is generated by a ServiceBuilder
-* Using an ApiParams object instead of a Collection for parameters of an ApiCommand
-* cache.* request parameters should be renamed to params.cache.*
-* Added the ability to set arbitrary curl options on requests (disable_wire, progress, etc). See CurlHandle.
-* Added the ability to disable type validation of service descriptions
-* ServiceDescriptions and ServiceBuilders are now Serializable
diff --git a/lib/gerencianet/guzzle/guzzle/LICENSE b/lib/gerencianet/guzzle/guzzle/LICENSE
deleted file mode 100644
index d51aa69..0000000
--- a/lib/gerencianet/guzzle/guzzle/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2011 Michael Dowling, https://github.com/mtdowling
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/lib/gerencianet/guzzle/guzzle/README.md b/lib/gerencianet/guzzle/guzzle/README.md
deleted file mode 100644
index 6be06bf..0000000
--- a/lib/gerencianet/guzzle/guzzle/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-Guzzle, PHP HTTP client and webservice framework
-================================================
-
-# This is an old version of Guzzle
-
-This repository is for Guzzle 3.x. Guzzle 5.x, the new version of Guzzle, has
-been released and is available at
-[https://github.com/guzzle/guzzle](https://github.com/guzzle/guzzle). The
-documentation for Guzzle version 5+ can be found at
-[http://guzzlephp.org](http://guzzlephp.org).
-
-Guzzle 3 is only maintained for bug and security fixes. Guzzle 3 will be EOL
-at some point in late 2015.
-
-### About Guzzle 3
-
-[](https://packagist.org/packages/guzzle/guzzle)
- [](http://travis-ci.org/guzzle/guzzle3)
-
-- Extremely powerful API provides all the power of cURL with a simple interface.
-- Truly take advantage of HTTP/1.1 with persistent connections, connection pooling, and parallel requests.
-- Service description DSL allows you build awesome web service clients faster.
-- Symfony2 event-based plugin system allows you to completely modify the behavior of a request.
-
-Get answers with: [Documentation](http://guzzle3.readthedocs.org/en/latest/), [Forums](https://groups.google.com/forum/?hl=en#!forum/guzzle), IRC ([#guzzlephp](irc://irc.freenode.net/#guzzlephp) @ irc.freenode.net)
-
-### Installing via Composer
-
-The recommended way to install Guzzle is through [Composer](http://getcomposer.org).
-
-```bash
-# Install Composer
-curl -sS https://getcomposer.org/installer | php
-
-# Add Guzzle as a dependency
-php composer.phar require guzzle/guzzle:~3.9
-```
-
-After installing, you need to require Composer's autoloader:
-
-```php
-require 'vendor/autoload.php';
-```
-## Known Issues
-
-1. Problem following a specific redirect: https://github.com/guzzle/guzzle/issues/385.
- This has been fixed in Guzzle 4/5.
-2. Root XML attributes not serialized in a service description: https://github.com/guzzle/guzzle3/issues/5.
- This has been fixed in Guzzle 4/5.
-3. Accept-Encoding not preserved when following redirect: https://github.com/guzzle/guzzle3/issues/9
- Fixed in Guzzle 4/5.
-4. String "Array" Transmitted w/ PostFiles and Duplicate Aggregator: https://github.com/guzzle/guzzle3/issues/10
- Fixed in Guzzle 4/5.
-5. Recursive model references with array items: https://github.com/guzzle/guzzle3/issues/13
- Fixed in Guzzle 4/5
-6. String "Array" Transmitted w/ PostFiles and Duplicate Aggregator: https://github.com/guzzle/guzzle3/issues/10
- Fixed in Guzzle 4/5.
diff --git a/lib/gerencianet/guzzle/guzzle/UPGRADING.md b/lib/gerencianet/guzzle/guzzle/UPGRADING.md
deleted file mode 100644
index f58bf11..0000000
--- a/lib/gerencianet/guzzle/guzzle/UPGRADING.md
+++ /dev/null
@@ -1,537 +0,0 @@
-Guzzle Upgrade Guide
-====================
-
-3.6 to 3.7
-----------
-
-### Deprecations
-
-- You can now enable E_USER_DEPRECATED warnings to see if you are using any deprecated methods.:
-
-```php
-\Guzzle\Common\Version::$emitWarnings = true;
-```
-
-The following APIs and options have been marked as deprecated:
-
-- Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use `$request->getResponseBody()->isRepeatable()` instead.
-- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead.
-- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead.
-- Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead.
-- Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead.
-- Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated
-- Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client.
-- Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8.
-- Marked `Guzzle\Common\Collection::inject()` as deprecated.
-- Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use
- `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` or
- `$client->setDefaultOption('auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));`
-
-3.7 introduces `request.options` as a parameter for a client configuration and as an optional argument to all creational
-request methods. When paired with a client's configuration settings, these options allow you to specify default settings
-for various aspects of a request. Because these options make other previous configuration options redundant, several
-configuration options and methods of a client and AbstractCommand have been deprecated.
-
-- Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use `$client->getDefaultOption('headers')`.
-- Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use `$client->setDefaultOption('headers/{header_name}', 'value')`.
-- Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use `$client->setDefaultOption('params/{param_name}', 'value')`
-- Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. These will work through Guzzle 4.0
-
- $command = $client->getCommand('foo', array(
- 'command.headers' => array('Test' => '123'),
- 'command.response_body' => '/path/to/file'
- ));
-
- // Should be changed to:
-
- $command = $client->getCommand('foo', array(
- 'command.request_options' => array(
- 'headers' => array('Test' => '123'),
- 'save_as' => '/path/to/file'
- )
- ));
-
-### Interface changes
-
-Additions and changes (you will need to update any implementations or subclasses you may have created):
-
-- Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`:
- createRequest, head, delete, put, patch, post, options, prepareRequest
-- Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()`
-- Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface`
-- Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to
- `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a
- resource, string, or EntityBody into the $options parameter to specify the download location of the response.
-- Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a
- default `array()`
-- Added `Guzzle\Stream\StreamInterface::isRepeatable`
-- Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods.
-
-The following methods were removed from interfaces. All of these methods are still available in the concrete classes
-that implement them, but you should update your code to use alternative methods:
-
-- Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use
- `$client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or
- `$client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))` or
- `$client->setDefaultOption('headers/{header_name}', 'value')`. or
- `$client->setDefaultOption('headers', array('header_name' => 'value'))`.
-- Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use `$client->getConfig()->getPath('request.options/headers')`.
-- Removed `Guzzle\Http\ClientInterface::expandTemplate()`. This is an implementation detail.
-- Removed `Guzzle\Http\ClientInterface::setRequestFactory()`. This is an implementation detail.
-- Removed `Guzzle\Http\ClientInterface::getCurlMulti()`. This is a very specific implementation detail.
-- Removed `Guzzle\Http\Message\RequestInterface::canCache`. Use the CachePlugin.
-- Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`. Use the HistoryPlugin.
-- Removed `Guzzle\Http\Message\RequestInterface::isRedirect`. Use the HistoryPlugin.
-
-### Cache plugin breaking changes
-
-- CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a
- CacheStorageInterface. These two objects and interface will be removed in a future version.
-- Always setting X-cache headers on cached responses
-- Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin
-- `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface
- $request, Response $response);`
-- `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);`
-- `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);`
-- Added `CacheStorageInterface::purge($url)`
-- `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin
- $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache,
- CanCacheStrategyInterface $canCache = null)`
-- Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)`
-
-3.5 to 3.6
-----------
-
-* Mixed casing of headers are now forced to be a single consistent casing across all values for that header.
-* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution
-* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader().
- For example, setHeader() first removes the header using unset on a HeaderCollection and then calls addHeader().
- Keeping the Host header and URL host in sync is now handled by overriding the addHeader method in Request.
-* Specific header implementations can be created for complex headers. When a message creates a header, it uses a
- HeaderFactory which can map specific headers to specific header classes. There is now a Link header and
- CacheControl header implementation.
-* Moved getLinks() from Response to just be used on a Link header object.
-
-If you previously relied on Guzzle\Http\Message\Header::raw(), then you will need to update your code to use the
-HeaderInterface (e.g. toArray(), getAll(), etc).
-
-### Interface changes
-
-* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate
-* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti()
-* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in
- Guzzle\Http\Curl\RequestMediator
-* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string.
-* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface
-* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders()
-
-### Removed deprecated functions
-
-* Removed Guzzle\Parser\ParserRegister::get(). Use getParser()
-* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser().
-
-### Deprecations
-
-* The ability to case-insensitively search for header values
-* Guzzle\Http\Message\Header::hasExactHeader
-* Guzzle\Http\Message\Header::raw. Use getAll()
-* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object
- instead.
-
-### Other changes
-
-* All response header helper functions return a string rather than mixing Header objects and strings inconsistently
-* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc are managed by Guzzle
- directly via interfaces
-* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist
- but are a no-op until removed.
-* Most classes that used to require a ``Guzzle\Service\Command\CommandInterface` typehint now request a
- `Guzzle\Service\Command\ArrayCommandInterface`.
-* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response
- on a request while the request is still being transferred
-* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess
-
-3.3 to 3.4
-----------
-
-Base URLs of a client now follow the rules of http://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs.
-
-3.2 to 3.3
-----------
-
-### Response::getEtag() quote stripping removed
-
-`Guzzle\Http\Message\Response::getEtag()` no longer strips quotes around the ETag response header
-
-### Removed `Guzzle\Http\Utils`
-
-The `Guzzle\Http\Utils` class was removed. This class was only used for testing.
-
-### Stream wrapper and type
-
-`Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to lowercase.
-
-### curl.emit_io became emit_io
-
-Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using the
-'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io'
-
-3.1 to 3.2
-----------
-
-### CurlMulti is no longer reused globally
-
-Before 3.2, the same CurlMulti object was reused globally for each client. This can cause issue where plugins added
-to a single client can pollute requests dispatched from other clients.
-
-If you still wish to reuse the same CurlMulti object with each client, then you can add a listener to the
-ServiceBuilder's `service_builder.create_client` event to inject a custom CurlMulti object into each client as it is
-created.
-
-```php
-$multi = new Guzzle\Http\Curl\CurlMulti();
-$builder = Guzzle\Service\Builder\ServiceBuilder::factory('/path/to/config.json');
-$builder->addListener('service_builder.create_client', function ($event) use ($multi) {
- $event['client']->setCurlMulti($multi);
-}
-});
-```
-
-### No default path
-
-URLs no longer have a default path value of '/' if no path was specified.
-
-Before:
-
-```php
-$request = $client->get('http://www.foo.com');
-echo $request->getUrl();
-// >> http://www.foo.com/
-```
-
-After:
-
-```php
-$request = $client->get('http://www.foo.com');
-echo $request->getUrl();
-// >> http://www.foo.com
-```
-
-### Less verbose BadResponseException
-
-The exception message for `Guzzle\Http\Exception\BadResponseException` no longer contains the full HTTP request and
-response information. You can, however, get access to the request and response object by calling `getRequest()` or
-`getResponse()` on the exception object.
-
-### Query parameter aggregation
-
-Multi-valued query parameters are no longer aggregated using a callback function. `Guzzle\Http\Query` now has a
-setAggregator() method that accepts a `Guzzle\Http\QueryAggregator\QueryAggregatorInterface` object. This object is
-responsible for handling the aggregation of multi-valued query string variables into a flattened hash.
-
-2.8 to 3.x
-----------
-
-### Guzzle\Service\Inspector
-
-Change `\Guzzle\Service\Inspector::fromConfig` to `\Guzzle\Common\Collection::fromConfig`
-
-**Before**
-
-```php
-use Guzzle\Service\Inspector;
-
-class YourClient extends \Guzzle\Service\Client
-{
- public static function factory($config = array())
- {
- $default = array();
- $required = array('base_url', 'username', 'api_key');
- $config = Inspector::fromConfig($config, $default, $required);
-
- $client = new self(
- $config->get('base_url'),
- $config->get('username'),
- $config->get('api_key')
- );
- $client->setConfig($config);
-
- $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json'));
-
- return $client;
- }
-```
-
-**After**
-
-```php
-use Guzzle\Common\Collection;
-
-class YourClient extends \Guzzle\Service\Client
-{
- public static function factory($config = array())
- {
- $default = array();
- $required = array('base_url', 'username', 'api_key');
- $config = Collection::fromConfig($config, $default, $required);
-
- $client = new self(
- $config->get('base_url'),
- $config->get('username'),
- $config->get('api_key')
- );
- $client->setConfig($config);
-
- $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json'));
-
- return $client;
- }
-```
-
-### Convert XML Service Descriptions to JSON
-
-**Before**
-
-```xml
-
-
-
-
-
- Get a list of groups
-
-
- Uses a search query to get a list of groups
-
-
-
- Create a group
-
-
-
-
- Delete a group by ID
-
-
-
-
-
-
- Update a group
-
-
-
-
-
-
-```
-
-**After**
-
-```json
-{
- "name": "Zendesk REST API v2",
- "apiVersion": "2012-12-31",
- "description":"Provides access to Zendesk views, groups, tickets, ticket fields, and users",
- "operations": {
- "list_groups": {
- "httpMethod":"GET",
- "uri": "groups.json",
- "summary": "Get a list of groups"
- },
- "search_groups":{
- "httpMethod":"GET",
- "uri": "search.json?query=\"{query} type:group\"",
- "summary": "Uses a search query to get a list of groups",
- "parameters":{
- "query":{
- "location": "uri",
- "description":"Zendesk Search Query",
- "type": "string",
- "required": true
- }
- }
- },
- "create_group": {
- "httpMethod":"POST",
- "uri": "groups.json",
- "summary": "Create a group",
- "parameters":{
- "data": {
- "type": "array",
- "location": "body",
- "description":"Group JSON",
- "filters": "json_encode",
- "required": true
- },
- "Content-Type":{
- "type": "string",
- "location":"header",
- "static": "application/json"
- }
- }
- },
- "delete_group": {
- "httpMethod":"DELETE",
- "uri": "groups/{id}.json",
- "summary": "Delete a group",
- "parameters":{
- "id":{
- "location": "uri",
- "description":"Group to delete by ID",
- "type": "integer",
- "required": true
- }
- }
- },
- "get_group": {
- "httpMethod":"GET",
- "uri": "groups/{id}.json",
- "summary": "Get a ticket",
- "parameters":{
- "id":{
- "location": "uri",
- "description":"Group to get by ID",
- "type": "integer",
- "required": true
- }
- }
- },
- "update_group": {
- "httpMethod":"PUT",
- "uri": "groups/{id}.json",
- "summary": "Update a group",
- "parameters":{
- "id": {
- "location": "uri",
- "description":"Group to update by ID",
- "type": "integer",
- "required": true
- },
- "data": {
- "type": "array",
- "location": "body",
- "description":"Group JSON",
- "filters": "json_encode",
- "required": true
- },
- "Content-Type":{
- "type": "string",
- "location":"header",
- "static": "application/json"
- }
- }
- }
-}
-```
-
-### Guzzle\Service\Description\ServiceDescription
-
-Commands are now called Operations
-
-**Before**
-
-```php
-use Guzzle\Service\Description\ServiceDescription;
-
-$sd = new ServiceDescription();
-$sd->getCommands(); // @returns ApiCommandInterface[]
-$sd->hasCommand($name);
-$sd->getCommand($name); // @returns ApiCommandInterface|null
-$sd->addCommand($command); // @param ApiCommandInterface $command
-```
-
-**After**
-
-```php
-use Guzzle\Service\Description\ServiceDescription;
-
-$sd = new ServiceDescription();
-$sd->getOperations(); // @returns OperationInterface[]
-$sd->hasOperation($name);
-$sd->getOperation($name); // @returns OperationInterface|null
-$sd->addOperation($operation); // @param OperationInterface $operation
-```
-
-### Guzzle\Common\Inflection\Inflector
-
-Namespace is now `Guzzle\Inflection\Inflector`
-
-### Guzzle\Http\Plugin
-
-Namespace is now `Guzzle\Plugin`. Many other changes occur within this namespace and are detailed in their own sections below.
-
-### Guzzle\Http\Plugin\LogPlugin and Guzzle\Common\Log
-
-Now `Guzzle\Plugin\Log\LogPlugin` and `Guzzle\Log` respectively.
-
-**Before**
-
-```php
-use Guzzle\Common\Log\ClosureLogAdapter;
-use Guzzle\Http\Plugin\LogPlugin;
-
-/** @var \Guzzle\Http\Client */
-$client;
-
-// $verbosity is an integer indicating desired message verbosity level
-$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $verbosity = LogPlugin::LOG_VERBOSE);
-```
-
-**After**
-
-```php
-use Guzzle\Log\ClosureLogAdapter;
-use Guzzle\Log\MessageFormatter;
-use Guzzle\Plugin\Log\LogPlugin;
-
-/** @var \Guzzle\Http\Client */
-$client;
-
-// $format is a string indicating desired message format -- @see MessageFormatter
-$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $format = MessageFormatter::DEBUG_FORMAT);
-```
-
-### Guzzle\Http\Plugin\CurlAuthPlugin
-
-Now `Guzzle\Plugin\CurlAuth\CurlAuthPlugin`.
-
-### Guzzle\Http\Plugin\ExponentialBackoffPlugin
-
-Now `Guzzle\Plugin\Backoff\BackoffPlugin`, and other changes.
-
-**Before**
-
-```php
-use Guzzle\Http\Plugin\ExponentialBackoffPlugin;
-
-$backoffPlugin = new ExponentialBackoffPlugin($maxRetries, array_merge(
- ExponentialBackoffPlugin::getDefaultFailureCodes(), array(429)
- ));
-
-$client->addSubscriber($backoffPlugin);
-```
-
-**After**
-
-```php
-use Guzzle\Plugin\Backoff\BackoffPlugin;
-use Guzzle\Plugin\Backoff\HttpBackoffStrategy;
-
-// Use convenient factory method instead -- see implementation for ideas of what
-// you can do with chaining backoff strategies
-$backoffPlugin = BackoffPlugin::getExponentialBackoff($maxRetries, array_merge(
- HttpBackoffStrategy::getDefaultFailureCodes(), array(429)
- ));
-$client->addSubscriber($backoffPlugin);
-```
-
-### Known Issues
-
-#### [BUG] Accept-Encoding header behavior changed unintentionally.
-
-(See #217) (Fixed in 09daeb8c666fb44499a0646d655a8ae36456575e)
-
-In version 2.8 setting the `Accept-Encoding` header would set the CURLOPT_ENCODING option, which permitted cURL to
-properly handle gzip/deflate compressed responses from the server. In versions affected by this bug this does not happen.
-See issue #217 for a workaround, or use a version containing the fix.
diff --git a/lib/gerencianet/guzzle/guzzle/build.xml b/lib/gerencianet/guzzle/guzzle/build.xml
deleted file mode 100644
index 2aa62ba..0000000
--- a/lib/gerencianet/guzzle/guzzle/build.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/lib/gerencianet/guzzle/guzzle/composer.json b/lib/gerencianet/guzzle/guzzle/composer.json
deleted file mode 100644
index 59424b3..0000000
--- a/lib/gerencianet/guzzle/guzzle/composer.json
+++ /dev/null
@@ -1,82 +0,0 @@
-{
- "name": "guzzle/guzzle",
- "type": "library",
- "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle",
- "keywords": ["framework", "http", "rest", "web service", "curl", "client", "HTTP client"],
- "homepage": "http://guzzlephp.org/",
- "license": "MIT",
-
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- },
- {
- "name": "Guzzle Community",
- "homepage": "https://github.com/guzzle/guzzle/contributors"
- }
- ],
-
- "replace": {
- "guzzle/batch": "self.version",
- "guzzle/cache": "self.version",
- "guzzle/common": "self.version",
- "guzzle/http": "self.version",
- "guzzle/inflection": "self.version",
- "guzzle/iterator": "self.version",
- "guzzle/log": "self.version",
- "guzzle/parser": "self.version",
- "guzzle/plugin": "self.version",
- "guzzle/plugin-async": "self.version",
- "guzzle/plugin-backoff": "self.version",
- "guzzle/plugin-cache": "self.version",
- "guzzle/plugin-cookie": "self.version",
- "guzzle/plugin-curlauth": "self.version",
- "guzzle/plugin-error-response": "self.version",
- "guzzle/plugin-history": "self.version",
- "guzzle/plugin-log": "self.version",
- "guzzle/plugin-md5": "self.version",
- "guzzle/plugin-mock": "self.version",
- "guzzle/plugin-oauth": "self.version",
- "guzzle/service": "self.version",
- "guzzle/stream": "self.version"
- },
-
- "require": {
- "php": ">=5.3.3",
- "ext-curl": "*",
- "symfony/event-dispatcher": "~2.1"
- },
-
- "autoload": {
- "psr-0": {
- "Guzzle": "src/",
- "Guzzle\\Tests": "tests/"
- }
- },
-
- "suggest": {
- "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated."
- },
-
- "scripts": {
- "test": "phpunit"
- },
-
- "require-dev": {
- "doctrine/cache": "~1.3",
- "symfony/class-loader": "~2.1",
- "monolog/monolog": "~1.0",
- "psr/log": "~1.0",
- "zendframework/zend-cache": "2.*,<2.3",
- "zendframework/zend-log": "2.*,<2.3",
- "phpunit/phpunit": "3.7.*"
- },
-
- "extra": {
- "branch-alias": {
- "dev-master": "3.9-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/docs/Makefile b/lib/gerencianet/guzzle/guzzle/docs/Makefile
deleted file mode 100644
index d92e03f..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/Makefile
+++ /dev/null
@@ -1,153 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = sphinx-build
-PAPER =
-BUILDDIR = _build
-
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-# the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
-
-help:
- @echo "Please use \`make ' where is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " texinfo to make Texinfo files"
- @echo " info to make Texinfo files and run them through makeinfo"
- @echo " gettext to make PO message catalogs"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
-
-clean:
- -rm -rf $(BUILDDIR)/*
-
-html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-dirhtml:
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-singlehtml:
- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
-
-pickle:
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
- @echo
- @echo "Build finished; now you can process the pickle files."
-
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-htmlhelp:
- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
- @echo
- @echo "Build finished; now you can run HTML Help Workshop with the" \
- ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-qthelp:
- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
- @echo
- @echo "Build finished; now you can run "qcollectiongenerator" with the" \
- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Guzzle.qhcp"
- @echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Guzzle.qhc"
-
-devhelp:
- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
- @echo
- @echo "Build finished."
- @echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/Guzzle"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Guzzle"
- @echo "# devhelp"
-
-epub:
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
- "(use \`make latexpdf' here to do that automatically)."
-
-latexpdf:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through pdflatex..."
- $(MAKE) -C $(BUILDDIR)/latex all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-text:
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-man:
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-texinfo:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo
- @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
- @echo "Run \`make' in that directory to run these through makeinfo" \
- "(use \`make info' here to do that automatically)."
-
-info:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo "Running Texinfo files through makeinfo..."
- make -C $(BUILDDIR)/texinfo info
- @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
-
-gettext:
- $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
- @echo
- @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
-
-changes:
- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
- @echo
- @echo "The overview file is in $(BUILDDIR)/changes."
-
-linkcheck:
- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
- @echo
- @echo "Link check complete; look for any errors in the above output " \
- "or in $(BUILDDIR)/linkcheck/output.txt."
-
-doctest:
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/lib/gerencianet/guzzle/guzzle/docs/_downloads/guzzle-schema-1.0.json b/lib/gerencianet/guzzle/guzzle/docs/_downloads/guzzle-schema-1.0.json
deleted file mode 100644
index 8168302..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/_downloads/guzzle-schema-1.0.json
+++ /dev/null
@@ -1,176 +0,0 @@
-{
- "additionalProperties": true,
- "name": {
- "type": "string",
- "description": "Name of the web service"
- },
- "apiVersion": {
- "type": ["string", "number"],
- "description": "Version identifier that the service description is compatible with"
- },
- "baseUrl": {
- "type": "string",
- "description": "Base URL of the web service. Any relative URI specified in an operation will be merged with the baseUrl using the process defined in RFC 2396"
- },
- "basePath": {
- "type": "string",
- "description": "Alias of baseUrl"
- },
- "_description": {
- "type": "string",
- "description": "Short summary of the web service. This is actually called 'description' but this JSON schema wont validate using just description."
- },
- "operations": {
- "description": "Operations of the web service",
- "type": "object",
- "properties": {
- "extends": {
- "type": "string",
- "description": "Extend from another operation by name. The parent operation must be defined before the child."
- },
- "httpMethod": {
- "type": "string",
- "description": "HTTP method used with the operation (e.g. GET, POST, PUT, DELETE, PATCH, etc)"
- },
- "uri": {
- "type": "string",
- "description": "URI of the operation. The uri attribute can contain URI templates. The variables of the URI template are parameters of the operation with a location value of uri"
- },
- "summary": {
- "type": "string",
- "description": "Short summary of what the operation does"
- },
- "class": {
- "type": "string",
- "description": "Custom class to instantiate instead of the default Guzzle\\Service\\Command\\OperationCommand"
- },
- "responseClass": {
- "type": "string",
- "description": "This is what is returned from the method. Can be a primitive, class name, or model name."
- },
- "responseNotes": {
- "type": "string",
- "description": "A description of the response returned by the operation"
- },
- "responseType": {
- "type": "string",
- "description": "The type of response that the operation creates. If not specified, this value will be automatically inferred based on whether or not there is a model matching the name, if a matching class name is found, or set to 'primitive' by default.",
- "enum": [ "primitive", "class", "model", "documentation" ]
- },
- "deprecated": {
- "type": "boolean",
- "description": "Whether or not the operation is deprecated"
- },
- "errorResponses": {
- "description": "Errors that could occur while executing the operation",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "code": {
- "type": "number",
- "description": "HTTP response status code of the error"
- },
- "reason": {
- "type": "string",
- "description": "Response reason phrase or description of the error"
- },
- "class": {
- "type": "string",
- "description": "A custom exception class that would be thrown if the error is encountered"
- }
- }
- }
- },
- "data": {
- "type": "object",
- "additionalProperties": "true"
- },
- "parameters": {
- "$ref": "parameters",
- "description": "Parameters of the operation. Parameters are used to define how input data is serialized into a HTTP request."
- },
- "additionalParameters": {
- "$ref": "parameters",
- "description": "Validation and serialization rules for any parameter supplied to the operation that was not explicitly defined."
- }
- }
- },
- "models": {
- "description": "Schema models that can be referenced throughout the service description. Models can be used to define how an HTTP response is parsed into a Guzzle\\Service\\Resource\\Model object.",
- "type": "object",
- "properties": {
- "$ref": "parameters",
- "description": "Parameters of the model. When a model is referenced in a responseClass attribute of an operation, parameters define how a HTTP response message is parsed into a Guzzle\\Service\\Resource\\Model."
- }
- },
- "includes": {
- "description": "Service description files to include and extend from (can be a .json, .js, or .php file)",
- "type": "array",
- "items": {
- "type": "string",
- "pattern": ".+\\.(js|json|php)$"
- }
- },
- "definitions": {
- "parameters": {
- "extends": "http://json-schema.org/schema",
- "id": "parameters",
- "name": {
- "type": "string",
- "description": "Unique name of the parameter"
- },
- "type": {
- "type": ["string", "array"],
- "description": "Type of variable (string, number, integer, boolean, object, array, numeric, null, any). Types are using for validation and determining the structure of a parameter. You can use a union type by providing an array of simple types. If one of the union types matches the provided value, then the value is valid."
- },
- "instanceOf": {
- "type": "string",
- "description": "When the type is an object, you can specify the class that the object must implement"
- },
- "required": {
- "type": "boolean",
- "description": "Whether or not the parameter is required"
- },
- "default": {
- "description": "Default value to use if no value is supplied"
- },
- "static": {
- "type": "bool",
- "description": "Set to true to specify that the parameter value cannot be changed from the default setting"
- },
- "description": {
- "type": "string",
- "description": "Documentation of the parameter"
- },
- "location": {
- "type": "string",
- "description": "The location of a request used to apply a parameter. Custom locations can be registered with a command, but the defaults are uri, query, statusCode, reasonPhrase, header, body, json, xml, postField, postFile, responseBody"
- },
- "sentAs": {
- "type": "string",
- "description": "Specifies how the data being modeled is sent over the wire. For example, you may wish to include certain headers in a response model that have a normalized casing of FooBar, but the actual header is x-foo-bar. In this case, sentAs would be set to x-foo-bar."
- },
- "filters": {
- "type": "array",
- "description": "Array of static method names to to run a parameter value through. Each value in the array must be a string containing the full class path to a static method or an array of complex filter information. You can specify static methods of classes using the full namespace class name followed by ‘::’ (e.g. FooBar::baz()). Some filters require arguments in order to properly filter a value. For complex filters, use a hash containing a ‘method’ key pointing to a static method, and an ‘args’ key containing an array of positional arguments to pass to the method. Arguments can contain keywords that are replaced when filtering a value: '@value‘ is replaced with the value being validated, '@api‘ is replaced with the Parameter object.",
- "items": {
- "type": ["string", {
- "object": {
- "properties": {
- "method": {
- "type": "string",
- "description": "PHP function to call",
- "required": true
- },
- "args": {
- "type": "array"
- }
- }
- }
- }]
- }
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/docs/_static/guzzle-icon.png b/lib/gerencianet/guzzle/guzzle/docs/_static/guzzle-icon.png
deleted file mode 100644
index f1017f7..0000000
Binary files a/lib/gerencianet/guzzle/guzzle/docs/_static/guzzle-icon.png and /dev/null differ
diff --git a/lib/gerencianet/guzzle/guzzle/docs/_static/homepage.css b/lib/gerencianet/guzzle/guzzle/docs/_static/homepage.css
deleted file mode 100644
index 70c46d8..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/_static/homepage.css
+++ /dev/null
@@ -1,122 +0,0 @@
-/* Hero unit on homepage */
-
-.hero-unit h1 {
- font-size: 49px;
- margin-bottom: 12px;
-}
-
-.hero-unit {
- padding: 40px;
-}
-
-.hero-unit p {
- font-size: 17px;
-}
-
-.masthead img {
- float: left;
- margin-right: 17px;
-}
-
-.hero-unit ul li {
- margin-left: 220px;
-}
-
-.hero-unit .buttons {
- text-align: center;
-}
-
-.jumbotron {
- position: relative;
- padding: 40px 0;
- color: #fff;
- text-shadow: 0 1px 3px rgba(0,0,0,.4), 0 0 30px rgba(0,0,0,.075);
- background: #00312F;
- background: -moz-linear-gradient(45deg, #002F31 0%, #335A6D 100%);
- background: -webkit-gradient(linear, left bottom, right top, color-stop(0%,#00312D), color-stop(100%,#33566D));
- background: -webkit-linear-gradient(45deg, #020031 0%,#334F6D 100%);
- background: -o-linear-gradient(45deg, #002D31 0%,#334D6D 100%);
- background: -ms-linear-gradient(45deg, #002F31 0%,#33516D 100%);
- background: linear-gradient(45deg, #020031 0%,#33516D 100%);
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#020031', endColorstr='#6d3353',GradientType=1 );
- -webkit-box-shadow: inset 0 3px 7px rgba(0, 0, 0, .2), inset 0 -3px 7px rgba(0, 0, 0, .2);
- -moz-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2);
- box-shadow: inset 0 3px 7px rgba(0, 0, 0, .2), inset 0 -3px 7px rgba(0, 0, 0, .2);
-}
-
-.jumbotron h1 {
- font-size: 80px;
- font-weight: bold;
- letter-spacing: -1px;
- line-height: 1;
-}
-
-.jumbotron p {
- font-size: 24px;
- font-weight: 300;
- line-height: 1.25;
- margin-bottom: 30px;
-}
-
-.masthead {
- padding: 40px 0 30px;
- margin-bottom: 0;
- color: #fff;
- margin-top: -19px;
-}
-
-.masthead h1 {
- display: none;
-}
-
-.masthead p {
- font-size: 40px;
- font-weight: 200;
- line-height: 1.25;
- margin: 12px 0 0 0;
-}
-
-.masthead .btn {
- padding: 19px 24px;
- font-size: 24px;
- font-weight: 200;
- border: 0;
-}
-
-/* Social bar on homepage */
-
-.social {
- padding: 2px 0;
- text-align: center;
- background-color: #f5f5f5;
- border-top: 1px solid #fff;
- border-bottom: 1px solid #ddd;
- margin: 0 0 20px 0;
-}
-
-.social ul {
- margin-top: 0;
-}
-
-.social-buttons {
- margin-left: 0;
- margin-bottom: 0;
- padding-left: 0;
- list-style: none;
-}
-
-.social-buttons li {
- display: inline-block;
- padding: 5px 8px;
- line-height: 1;
- *display: inline;
- *zoom: 1;
-}
-
-.center-announcement {
- padding: 10px;
- background-color: rgb(238, 243, 255);
- border-radius: 8px;
- text-align: center;
- margin: 24px 0;
-}
diff --git a/lib/gerencianet/guzzle/guzzle/docs/_static/logo.png b/lib/gerencianet/guzzle/guzzle/docs/_static/logo.png
deleted file mode 100644
index 965a4ef..0000000
Binary files a/lib/gerencianet/guzzle/guzzle/docs/_static/logo.png and /dev/null differ
diff --git a/lib/gerencianet/guzzle/guzzle/docs/_static/prettify.css b/lib/gerencianet/guzzle/guzzle/docs/_static/prettify.css
deleted file mode 100644
index 4d410b1..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/_static/prettify.css
+++ /dev/null
@@ -1,41 +0,0 @@
-.com {
- color: #93A1A1;
-}
-.lit {
- color: #195F91;
-}
-.pun, .opn, .clo {
- color: #93A1A1;
-}
-.fun {
- color: #DC322F;
-}
-.str, .atv {
- color: #DD1144;
-}
-.kwd, .linenums .tag {
- color: #1E347B;
-}
-.typ, .atn, .dec, .var {
- color: teal;
-}
-.pln {
- color: #48484C;
-}
-.prettyprint {
- background-color: #F7F7F9;
- border: 1px solid #E1E1E8;
- padding: 8px;
-}
-.prettyprint.linenums {
- box-shadow: 40px 0 0 #FBFBFC inset, 41px 0 0 #ECECF0 inset;
-}
-ol.linenums {
- margin: 0 0 0 33px;
-}
-ol.linenums li {
- color: #BEBEC5;
- line-height: 18px;
- padding-left: 12px;
- text-shadow: 0 1px 0 #FFFFFF;
-}
diff --git a/lib/gerencianet/guzzle/guzzle/docs/_static/prettify.js b/lib/gerencianet/guzzle/guzzle/docs/_static/prettify.js
deleted file mode 100644
index eef5ad7..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/_static/prettify.js
+++ /dev/null
@@ -1,28 +0,0 @@
-var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
-(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
-[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
-l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
-q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
-q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
-"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
-a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
-for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
-"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
-H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
-J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
-I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]+/],["dec",/^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^
-
-
-
-
-
-
-
-
-
-
Introducing Guzzle
-
-
Guzzle takes the pain out of sending HTTP requests and the redundancy out of creating web service clients. It's
- a framework that includes the tools needed to create a robust web service client, including:
- Service descriptions for defining the inputs and outputs of an API, resource iterators for traversing
- paginated resources, batching for sending a large number of requests as efficiently as possible.
-
-
- All the power of cURL with a simple interface.
- Persistent connections and parallel requests.
- Streams request and response bodies
- Service descriptions for quickly building clients.
- Powered by the Symfony2 EventDispatcher.
- Use all of the code or only specific components .
- Plugins for caching, logging, OAuth, mocks, and more
- Includes a custom node.js webserver to test your clients .
-
-
-
- Guzzle is now part of Drupal 8 core and powers the official
AWS SDK for PHP
-
-
-
GitHub Example
-
-
<?php
-require_once 'vendor/autoload.php';
-use Guzzle\Http\Client;
-
-// Create a client and provide a base URL
-$client = new Client('https://api.github.com');
-// Create a request with basic Auth
-$request = $client->get('/user')->setAuth('user', 'pass');
-// Send the request and get the response
-$response = $request->send();
-echo $response->getBody();
-// >>> {"type":"User", ...
-echo $response->getHeader('Content-Length');
-// >>> 792
-
-
-
Twitter Example
-
<?php
-// Create a client to work with the Twitter API
-$client = new Client('https://api.twitter.com/{version}', array(
- 'version' => '1.1'
-));
-
-// Sign all requests with the OauthPlugin
-$client->addSubscriber(new Guzzle\Plugin\Oauth\OauthPlugin(array(
- 'consumer_key' => '***',
- 'consumer_secret' => '***',
- 'token' => '***',
- 'token_secret' => '***'
-)));
-
-echo $client->get('statuses/user_timeline.json')->send()->getBody();
-// >>> {"public_gists":6,"type":"User" ...
-
-// Create a tweet using POST
-$request = $client->post('statuses/update.json', null, array(
- 'status' => 'Tweeted with Guzzle, http://guzzlephp.org'
-));
-
-// Send the request and parse the JSON response into an array
-$data = $request->send()->json();
-echo $data['text'];
-// >>> Tweeted with Guzzle, http://t.co/kngJMfRk
-
-
-
-
diff --git a/lib/gerencianet/guzzle/guzzle/docs/_templates/nav_links.html b/lib/gerencianet/guzzle/guzzle/docs/_templates/nav_links.html
deleted file mode 100644
index d4f2165..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/_templates/nav_links.html
+++ /dev/null
@@ -1,5 +0,0 @@
- Docs
-API
-GitHub
-Forum
-IRC
diff --git a/lib/gerencianet/guzzle/guzzle/docs/batching/batching.rst b/lib/gerencianet/guzzle/guzzle/docs/batching/batching.rst
deleted file mode 100644
index 57f04d8..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/batching/batching.rst
+++ /dev/null
@@ -1,183 +0,0 @@
-========
-Batching
-========
-
-Guzzle provides a fairly generic and very customizable batching framework that allows developers to efficiently
-transfer requests in parallel.
-
-Sending requests and commands in parallel
------------------------------------------
-
-You can send HTTP requests in parallel by passing an array of ``Guzzle\Http\Message\RequestInterface`` objects to
-``Guzzle\Http\Client::send()``:
-
-.. code-block:: php
-
- $responses = $client->send(array(
- $client->get('http://www.example.com/foo'),
- $client->get('http://www.example.com/baz')
- $client->get('http://www.example.com/bar')
- ));
-
-You can send commands in parallel by passing an array of ``Guzzle\Service\Command\CommandInterface`` objects
-``Guzzle\Service\Client::execute()``:
-
-.. code-block:: php
-
- $commands = $client->execute(array(
- $client->getCommand('foo'),
- $client->getCommand('baz'),
- $client->getCommand('bar')
- ));
-
-These approaches work well for most use-cases. When you need more control over the requests that are sent in
-parallel or you need to send a large number of requests, you need to use the functionality provided in the
-``Guzzle\Batch`` namespace.
-
-Batching overview
------------------
-
-The batch object, ``Guzzle\Batch\Batch``, is a queue. You add requests to the queue until you are ready to transfer
-all of the requests. In order to efficiently transfer the items in the queue, the batch object delegates the
-responsibility of dividing the queue into manageable parts to a divisor (``Guzzle\Batch\BatchDivisorInterface``).
-The batch object then iterates over each array of items created by the divisor and sends them to the batch object's
-``Guzzle\Batch\BatchTransferInterface``.
-
-.. code-block:: php
-
- use Guzzle\Batch\Batch;
- use Guzzle\Http\BatchRequestTransfer;
-
- // BatchRequestTransfer acts as both the divisor and transfer strategy
- $transferStrategy = new BatchRequestTransfer(10);
- $divisorStrategy = $transferStrategy;
-
- $batch = new Batch($transferStrategy, $divisorStrategy);
-
- // Add some requests to the batch queue
- $batch->add($request1)
- ->add($request2)
- ->add($request3);
-
- // Flush the queue and retrieve the flushed items
- $arrayOfTransferredRequests = $batch->flush();
-
-.. note::
-
- You might find that your transfer strategy will need to act as both the divisor and transfer strategy.
-
-Using the BatchBuilder
-----------------------
-
-The ``Guzzle\Batch\BatchBuilder`` makes it easier to create batch objects. The batch builder also provides an easier
-way to add additional behaviors to your batch object.
-
-Transferring requests
-~~~~~~~~~~~~~~~~~~~~~
-
-The ``Guzzle\Http\BatchRequestTransfer`` class efficiently transfers HTTP requests in parallel by grouping batches of
-requests by the curl_multi handle that is used to transfer the requests.
-
-.. code-block:: php
-
- use Guzzle\Batch\BatchBuilder;
-
- $batch = BatchBuilder::factory()
- ->transferRequests(10)
- ->build();
-
-Transferring commands
-~~~~~~~~~~~~~~~~~~~~~
-
-The ``Guzzle\Service\Command\BatchCommandTransfer`` class efficiently transfers service commands by grouping commands
-by the client that is used to transfer them. You can add commands to a batch object that are transferred by different
-clients, and the batch will handle the rest.
-
-.. code-block:: php
-
- use Guzzle\Batch\BatchBuilder;
-
- $batch = BatchBuilder::factory()
- ->transferCommands(10)
- ->build();
-
- $batch->add($client->getCommand('foo'))
- ->add($client->getCommand('baz'))
- ->add($client->getCommand('bar'));
-
- $commands = $batch->flush();
-
-Batch behaviors
----------------
-
-You can add various behaviors to your batch that allow for more customizable transfers.
-
-Automatically flushing a queue
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Use the ``Guzzle\Batch\FlushingBatch`` decorator when you want to pump a large number of items into a batch queue and
-have the queue automatically flush when the size of the queue reaches a certain threshold.
-
-.. code-block:: php
-
- use Guzzle\Batch\BatchBuilder;
-
- $batch = BatchBuilder::factory()
- ->transferRequests(10)
- ->autoFlushAt(10)
- ->build();
-
-Batch builder method: ``autoFlushAt($threshold)``
-
-Notifying on flush
-~~~~~~~~~~~~~~~~~~
-
-Use the ``Guzzle\Batch\NotifyingBatch`` decorator if you want a function to be notified each time the batch queue is
-flushed. This is useful when paired with the flushing batch decorator. Pass a callable to the ``notify()`` method of
-a batch builder to use this decorator with the builder.
-
-.. code-block:: php
-
- use Guzzle\Batch\BatchBuilder;
-
- $batch = BatchBuilder::factory()
- ->transferRequests(10)
- ->autoFlushAt(10)
- ->notify(function (array $transferredItems) {
- echo 'Transferred ' . count($transferredItems) . "items\n";
- })
- ->build();
-
-Batch builder method:: ``notify(callable $callback)``
-
-Keeping a history
-~~~~~~~~~~~~~~~~~
-
-Use the ``Guzzle\Batch\HistoryBatch`` decorator if you want to maintain a history of all the items transferred with
-the batch queue.
-
-.. code-block:: php
-
- use Guzzle\Batch\BatchBuilder;
-
- $batch = BatchBuilder::factory()
- ->transferRequests(10)
- ->keepHistory()
- ->build();
-
-After transferring items, you can use the ``getHistory()`` of a batch to retrieve an array of transferred items. Be
-sure to periodically clear the history using ``clearHistory()``.
-
-Batch builder method: ``keepHistory()``
-
-Exception buffering
-~~~~~~~~~~~~~~~~~~~
-
-Use the ``Guzzle\Batch\ExceptionBufferingBatch`` decorator to buffer exceptions during a transfer so that you can
-transfer as many items as possible then deal with the errored batches after the transfer completes. After transfer,
-use the ``getExceptions()`` method of a batch to retrieve an array of
-``Guzzle\Batch\Exception\BatchTransferException`` objects. You can use these exceptions to attempt to retry the
-failed batches. Be sure to clear the buffered exceptions when you are done with them by using the
-``clearExceptions()`` method.
-
-Batch builder method: ``bufferExceptions()``
diff --git a/lib/gerencianet/guzzle/guzzle/docs/conf.py b/lib/gerencianet/guzzle/guzzle/docs/conf.py
deleted file mode 100644
index 92bc46b..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/conf.py
+++ /dev/null
@@ -1,94 +0,0 @@
-import sys, os
-from sphinx.highlighting import lexers
-from pygments.lexers.web import PhpLexer
-
-lexers['php'] = PhpLexer(startinline=True, linenos=1)
-lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1)
-primary_domain = 'php'
-
-# -- General configuration -----------------------------------------------------
-
-extensions = []
-templates_path = ['_templates']
-source_suffix = '.rst'
-master_doc = 'index'
-
-project = u'Guzzle'
-copyright = u'2012, Michael Dowling'
-version = '3.0.0'
-release = '3.0.0'
-
-exclude_patterns = ['_build']
-
-# -- Options for HTML output ---------------------------------------------------
-
-# The name for this set of Sphinx documents. If None, it defaults to
-# " v documentation".
-html_title = "Guzzle documentation"
-html_short_title = "Guzzle"
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
-
-# Custom sidebar templates, maps document names to template names.
-html_sidebars = {
- '**': ['localtoc.html', 'leftbar.html', 'searchbox.html']
-}
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'Guzzledoc'
-
-# -- Guzzle Sphinx theme setup ------------------------------------------------
-
-sys.path.insert(0, '/Users/dowling/projects/guzzle_sphinx_theme')
-
-import guzzle_sphinx_theme
-html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator'
-html_theme_path = guzzle_sphinx_theme.html_theme_path()
-html_theme = 'guzzle_sphinx_theme'
-
-# Guzzle theme options (see theme.conf for more information)
-html_theme_options = {
- "index_template": "index.html",
- "project_nav_name": "Guzzle",
- "github_user": "guzzle",
- "github_repo": "guzzle",
- "disqus_comments_shortname": "guzzle",
- "google_analytics_account": "UA-22752917-1"
-}
-
-# -- Options for LaTeX output --------------------------------------------------
-
-latex_elements = {}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
-latex_documents = [
- ('index', 'Guzzle.tex', u'Guzzle Documentation',
- u'Michael Dowling', 'manual'),
-]
-
-# -- Options for manual page output --------------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
- ('index', 'guzzle', u'Guzzle Documentation',
- [u'Michael Dowling'], 1)
-]
-
-# If true, show URL addresses after external links.
-#man_show_urls = False
-
-# -- Options for Texinfo output ------------------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-# dir menu entry, description, category)
-texinfo_documents = [
- ('index', 'Guzzle', u'Guzzle Documentation',
- u'Michael Dowling', 'Guzzle', 'One line description of project.',
- 'Miscellaneous'),
-]
diff --git a/lib/gerencianet/guzzle/guzzle/docs/docs.rst b/lib/gerencianet/guzzle/guzzle/docs/docs.rst
deleted file mode 100644
index cf87908..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/docs.rst
+++ /dev/null
@@ -1,73 +0,0 @@
-.. title:: Guzzle | PHP HTTP client and framework for consuming RESTful web services
-
-====================
-Guzzle Documentation
-====================
-
-Getting started
----------------
-
-.. toctree::
- :maxdepth: 1
-
- getting-started/overview
- getting-started/installation
- getting-started/faq
-
-The HTTP client
----------------
-
-.. toctree::
- :maxdepth: 2
-
- http-client/client
- http-client/request
- http-client/response
- http-client/entity-bodies
- http-client/http-redirects
- http-client/uri-templates
-
-Plugins
--------
-
-.. toctree::
- :maxdepth: 1
-
- plugins/plugins-overview
- plugins/creating-plugins
- plugins/async-plugin
- plugins/backoff-plugin
- plugins/cache-plugin
- plugins/cookie-plugin
- plugins/curl-auth-plugin
- plugins/history-plugin
- plugins/log-plugin
- plugins/md5-validator-plugin
- plugins/mock-plugin
- plugins/oauth-plugin
-
-The web service client
-----------------------
-
-.. toctree::
- :maxdepth: 1
-
- webservice-client/webservice-client
- webservice-client/using-the-service-builder
- webservice-client/guzzle-service-descriptions
- batching/batching
- iterators/resource-iterators
- iterators/guzzle-iterators
-
-Testing
--------
-
-.. toctree::
- :maxdepth: 2
-
- testing/unit-testing
-
-API Docs
---------
-
-`Read the API docs `_
diff --git a/lib/gerencianet/guzzle/guzzle/docs/getting-started/faq.rst b/lib/gerencianet/guzzle/guzzle/docs/getting-started/faq.rst
deleted file mode 100644
index a0a3fdb..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/getting-started/faq.rst
+++ /dev/null
@@ -1,29 +0,0 @@
-===
-FAQ
-===
-
-What should I do if I get this error: Fatal error: Maximum function nesting level of '100' reached, aborting!
--------------------------------------------------------------------------------------------------------------
-
-You could run into this error if you have the XDebug extension installed and you execute a lot of requests in
-callbacks. This error message comes specifically from the XDebug extension. PHP itself does not have a function
-nesting limit. Change this setting in your php.ini to increase the limit::
-
- xdebug.max_nesting_level = 1000
-
-[`source `_]
-
-How can I speed up my client?
------------------------------
-
-There are several things you can do to speed up your client:
-
-1. Utilize a C based HTTP message parser (e.g. ``Guzzle\Parser\Message\PeclHttpMessageParser``)
-2. Disable operation validation by setting the ``command.disable_validation`` option to true on a command
-
-Why am I getting a 417 error response?
---------------------------------------
-
-This can occur for a number of reasons, but if you are sending PUT, POST, or PATCH requests with an
-``Expect: 100-Continue`` header, a server that does not support this header will return a 417 response. You can work
-around this by calling ``$request->removeHeader('Expect');`` after setting the entity body of a request.
diff --git a/lib/gerencianet/guzzle/guzzle/docs/getting-started/installation.rst b/lib/gerencianet/guzzle/guzzle/docs/getting-started/installation.rst
deleted file mode 100644
index 77d4001..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/getting-started/installation.rst
+++ /dev/null
@@ -1,154 +0,0 @@
-============
-Installation
-============
-
-Requirements
-------------
-
-#. PHP 5.3.3+ compiled with the cURL extension
-#. A recent version of cURL 7.16.2+ compiled with OpenSSL and zlib
-
-Installing Guzzle
------------------
-
-Composer
-~~~~~~~~
-
-The recommended way to install Guzzle is with `Composer `_. Composer is a dependency
-management tool for PHP that allows you to declare the dependencies your project needs and installs them into your
-project.
-
-.. code-block:: bash
-
- # Install Composer
- curl -sS https://getcomposer.org/installer | php
-
- # Add Guzzle as a dependency
- php composer.phar require guzzle/guzzle:~3.9
-
-After installing, you need to require Composer's autoloader:
-
-.. code-block:: php
-
- require 'vendor/autoload.php';
-
-You can find out more on how to install Composer, configure autoloading, and other best-practices for defining
-dependencies at `getcomposer.org `_.
-
-Using only specific parts of Guzzle
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-While you can always just rely on ``guzzle/guzzle``, Guzzle provides several smaller parts of Guzzle as individual
-packages available through Composer.
-
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| Package name | Description |
-+===============================================================================================+==========================================+
-| `guzzle/common `_ | Provides ``Guzzle\Common`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/http `_ | Provides ``Guzzle\Http`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/parser `_ | Provides ``Guzzle\Parser`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/batch `_ | Provides ``Guzzle\Batch`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/cache `_ | Provides ``Guzzle\Cache`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/inflection `_ | Provides ``Guzzle\Inflection`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/iterator `_ | Provides ``Guzzle\Iterator`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/log `_ | Provides ``Guzzle\Log`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/plugin `_ | Provides ``Guzzle\Plugin`` (all plugins) |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/plugin-async `_ | Provides ``Guzzle\Plugin\Async`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/plugin-backoff `_ | Provides ``Guzzle\Plugin\BackoffPlugin`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/plugin-cache `_ | Provides ``Guzzle\Plugin\Cache`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/plugin-cookie `_ | Provides ``Guzzle\Plugin\Cookie`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/plugin-error-response `_ | Provides ``Guzzle\Plugin\ErrorResponse`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/plugin-history `_ | Provides ``Guzzle\Plugin\History`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/plugin-log `_ | Provides ``Guzzle\Plugin\Log`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/plugin-md5 `_ | Provides ``Guzzle\Plugin\Md5`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/plugin-mock `_ | Provides ``Guzzle\Plugin\Mock`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/plugin-oauth `_ | Provides ``Guzzle\Plugin\Oauth`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/service `_ | Provides ``Guzzle\Service`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-| `guzzle/stream `_ | Provides ``Guzzle\Stream`` |
-+-----------------------------------------------------------------------------------------------+------------------------------------------+
-
-Bleeding edge
-^^^^^^^^^^^^^
-
-During your development, you can keep up with the latest changes on the master branch by setting the version
-requirement for Guzzle to ``dev-master``.
-
-.. code-block:: js
-
- {
- "require": {
- "guzzle/guzzle": "dev-master"
- }
- }
-
-PEAR
-~~~~
-
-Guzzle can be installed through PEAR:
-
-.. code-block:: bash
-
- pear channel-discover guzzlephp.org/pear
- pear install guzzle/guzzle
-
-You can install a specific version of Guzzle by providing a version number suffix:
-
-.. code-block:: bash
-
- pear install guzzle/guzzle-3.9.0
-
-Contributing to Guzzle
-----------------------
-
-In order to contribute, you'll need to checkout the source from GitHub and install Guzzle's dependencies using
-Composer:
-
-.. code-block:: bash
-
- git clone https://github.com/guzzle/guzzle.git
- cd guzzle && curl -s http://getcomposer.org/installer | php && ./composer.phar install --dev
-
-Guzzle is unit tested with PHPUnit. You will need to create your own phpunit.xml file in order to run the unit tests
-(or just copy phpunit.xml.dist to phpunit.xml). Run the tests using the vendored PHPUnit binary:
-
-.. code-block:: bash
-
- vendor/bin/phpunit
-
-You'll need to install node.js v0.5.0 or newer in order to test the cURL implementation.
-
-Framework integrations
-----------------------
-
-Using Guzzle with Symfony
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Bundles are available on GitHub:
-
-- `DdeboerGuzzleBundle `_ for Guzzle 2
-- `MisdGuzzleBundle `_ for Guzzle 3
-
-Using Guzzle with Silex
-~~~~~~~~~~~~~~~~~~~~~~~
-
-A `Guzzle Silex service provider `_ is available on GitHub.
diff --git a/lib/gerencianet/guzzle/guzzle/docs/getting-started/overview.rst b/lib/gerencianet/guzzle/guzzle/docs/getting-started/overview.rst
deleted file mode 100644
index 505b409..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/getting-started/overview.rst
+++ /dev/null
@@ -1,85 +0,0 @@
-=================
-Welcome to Guzzle
-=================
-
-What is Guzzle?
-~~~~~~~~~~~~~~~
-
-Guzzle is a PHP HTTP client and framework for building web service clients. Guzzle takes the pain out of sending HTTP
-requests and the redundancy out of creating web service clients.
-
-Features at a glance
---------------------
-
-- All the power of cURL with a simple interface.
-- Persistent connections and parallel requests.
-- Streams request and response bodies
-- Service descriptions for quickly building clients.
-- Powered by the Symfony2 EventDispatcher.
-- Use all of the code or only specific components.
-- Plugins for caching, logging, OAuth, mocks, and more
-- Includes a custom node.js webserver to test your clients.
-- Service descriptions for defining the inputs and outputs of an API
-- Resource iterators for traversing paginated resources
-- Batching for sending a large number of requests as efficiently as possible
-
-.. code-block:: php
-
- // Really simple using a static facade
- Guzzle\Http\StaticClient::mount();
- $response = Guzzle::get('http://guzzlephp.org');
-
- // More control using a client class
- $client = new \Guzzle\Http\Client('http://guzzlephp.org');
- $request = $client->get('/');
- $response = $request->send();
-
-License
--------
-
-Licensed using the `MIT license `_.
-
- Copyright (c) 2013 Michael Dowling
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-
-Contributing
-------------
-
-Guidelines
-~~~~~~~~~~
-
-This is still a work in progress, but there are only a few rules:
-
-1. Guzzle follows PSR-0, PSR-1, and PSR-2
-2. All pull requests must include unit tests to ensure the change works as expected and to prevent future regressions
-
-Reporting a security vulnerability
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-We want to ensure that Guzzle is a secure HTTP client library for everyone. If you've discovered a security
-vulnerability in Guzzle, we appreciate your help in disclosing it to us in a
-`responsible manner `_.
-
-Publicly disclosing a vulnerability can put the entire community at risk. If you've discovered a security concern,
-please email us at security@guzzlephp.org. We'll work with you to make sure that we understand the scope of the issue,
-and that we fully address your concern. We consider correspondence sent to security@guzzlephp.org our highest priority,
-and work to address any issues that arise as quickly as possible.
-
-After a security vulnerability has been corrected, a security hotfix release will be deployed as soon as possible.
diff --git a/lib/gerencianet/guzzle/guzzle/docs/http-client/client.rst b/lib/gerencianet/guzzle/guzzle/docs/http-client/client.rst
deleted file mode 100644
index 723d729..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/http-client/client.rst
+++ /dev/null
@@ -1,569 +0,0 @@
-======================
-The Guzzle HTTP client
-======================
-
-Guzzle gives PHP developers complete control over HTTP requests while utilizing HTTP/1.1 best practices. Guzzle's HTTP
-functionality is a robust framework built on top of the `PHP libcurl bindings `_.
-
-The three main parts of the Guzzle HTTP client are:
-
-+--------------+-------------------------------------------------------------------------------------------------------+
-| Clients | ``Guzzle\Http\Client`` (creates and sends requests, associates a response with a request) |
-+--------------+-------------------------------------------------------------------------------------------------------+
-| Requests | ``Guzzle\Http\Message\Request`` (requests with no body), |
-| | ``Guzzle\Http\Message\EntityEnclosingRequest`` (requests with a body) |
-+--------------+-------------------------------------------------------------------------------------------------------+
-| Responses | ``Guzzle\Http\Message\Response`` |
-+--------------+-------------------------------------------------------------------------------------------------------+
-
-Creating a Client
------------------
-
-Clients create requests, send requests, and set responses on a request object. When instantiating a client object,
-you can pass an optional "base URL" and optional array of configuration options. A base URL is a
-:doc:`URI template ` that contains the URL of a remote server. When creating requests with a relative
-URL, the base URL of a client will be merged into the request's URL.
-
-.. code-block:: php
-
- use Guzzle\Http\Client;
-
- // Create a client and provide a base URL
- $client = new Client('https://api.github.com');
-
- $request = $client->get('/user');
- $request->setAuth('user', 'pass');
- echo $request->getUrl();
- // >>> https://api.github.com/user
-
- // You must send a request in order for the transfer to occur
- $response = $request->send();
-
- echo $response->getBody();
- // >>> {"type":"User", ...
-
- echo $response->getHeader('Content-Length');
- // >>> 792
-
- $data = $response->json();
- echo $data['type'];
- // >>> User
-
-Base URLs
-~~~~~~~~~
-
-Notice that the URL provided to the client's ``get()`` method is relative. Relative URLs will always merge into the
-base URL of the client. There are a few rules that control how the URLs are merged.
-
-.. tip::
-
- Guzzle follows `RFC 3986 `_ when merging base URLs and
- relative URLs.
-
-In the above example, we passed ``/user`` to the ``get()`` method of the client. This is a relative URL, so it will
-merge into the base URL of the client-- resulting in the derived URL of ``https://api.github.com/users``.
-
-``/user`` is a relative URL but uses an absolute path because it contains the leading slash. Absolute paths will
-overwrite any existing path of the base URL. If an absolute path is provided (e.g. ``/path/to/something``), then the
-path specified in the base URL of the client will be replaced with the absolute path, and the query string provided
-by the relative URL will replace the query string of the base URL.
-
-Omitting the leading slash and using relative paths will add to the path of the base URL of the client. So using a
-client base URL of ``https://api.twitter.com/v1.1`` and creating a GET request with ``statuses/user_timeline.json``
-will result in a URL of ``https://api.twitter.com/v1.1/statuses/user_timeline.json``. If a relative path and a query
-string are provided, then the relative path will be appended to the base URL path, and the query string provided will
-be merged into the query string of the base URL.
-
-If an absolute URL is provided (e.g. ``http://httpbin.org/ip``), then the request will completely use the absolute URL
-as-is without merging in any of the URL parts specified in the base URL.
-
-Configuration options
-~~~~~~~~~~~~~~~~~~~~~
-
-The second argument of the client's constructor is an array of configuration data. This can include URI template data
-or special options that alter the client's behavior:
-
-+-------------------------------+-------------------------------------------------------------------------------------+
-| ``request.options`` | Associative array of :ref:`Request options ` to apply to every |
-| | request created by the client. |
-+-------------------------------+-------------------------------------------------------------------------------------+
-| ``redirect.disable`` | Disable HTTP redirects for every request created by the client. |
-+-------------------------------+-------------------------------------------------------------------------------------+
-| ``curl.options`` | Associative array of cURL options to apply to every request created by the client. |
-| | if either the key or value of an entry in the array is a string, Guzzle will |
-| | attempt to find a matching defined cURL constant automatically (e.g. |
-| | "CURLOPT_PROXY" will be converted to the constant ``CURLOPT_PROXY``). |
-+-------------------------------+-------------------------------------------------------------------------------------+
-| ``ssl.certificate_authority`` | Set to true to use the Guzzle bundled SSL certificate bundle (this is used by |
-| | default, 'system' to use the bundle on your system, a string pointing to a file to |
-| | use a specific certificate file, a string pointing to a directory to use multiple |
-| | certificates, or ``false`` to disable SSL validation (not recommended). |
-| | |
-| | When using Guzzle inside of a phar file, the bundled SSL certificate will be |
-| | extracted to your system's temp folder, and each time a client is created an MD5 |
-| | check will be performed to ensure the integrity of the certificate. |
-+-------------------------------+-------------------------------------------------------------------------------------+
-| ``command.params`` | When using a ``Guzzle\Service\Client`` object, this is an associative array of |
-| | default options to set on each command created by the client. |
-+-------------------------------+-------------------------------------------------------------------------------------+
-
-Here's an example showing how to set various configuration options, including default headers to send with each request,
-default query string parameters to add to each request, a default auth scheme for each request, and a proxy to use for
-each request. Values can be injected into the client's base URL using variables from the configuration array.
-
-.. code-block:: php
-
- use Guzzle\Http\Client;
-
- $client = new Client('https://api.twitter.com/{version}', array(
- 'version' => 'v1.1',
- 'request.options' => array(
- 'headers' => array('Foo' => 'Bar'),
- 'query' => array('testing' => '123'),
- 'auth' => array('username', 'password', 'Basic|Digest|NTLM|Any'),
- 'proxy' => 'tcp://localhost:80'
- )
- ));
-
-Setting a custom User-Agent
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The default Guzzle User-Agent header is ``Guzzle/ curl/ PHP/``. You can
-customize the User-Agent header of a client by calling the ``setUserAgent()`` method of a Client object.
-
-.. code-block:: php
-
- // Completely override the default User-Agent
- $client->setUserAgent('Test/123');
-
- // Prepend a string to the default User-Agent
- $client->setUserAgent('Test/123', true);
-
-Creating requests with a client
--------------------------------
-
-A Client object exposes several methods used to create Request objects:
-
-* Create a custom HTTP request: ``$client->createRequest($method, $uri, array $headers, $body, $options)``
-* Create a GET request: ``$client->get($uri, array $headers, $options)``
-* Create a HEAD request: ``$client->head($uri, array $headers, $options)``
-* Create a DELETE request: ``$client->delete($uri, array $headers, $body, $options)``
-* Create a POST request: ``$client->post($uri, array $headers, $postBody, $options)``
-* Create a PUT request: ``$client->put($uri, array $headers, $body, $options)``
-* Create a PATCH request: ``$client->patch($uri, array $headers, $body, $options)``
-
-.. code-block:: php
-
- use Guzzle\Http\Client;
-
- $client = new Client('http://baseurl.com/api/v1');
-
- // Create a GET request using Relative to base URL
- // URL of the request: http://baseurl.com/api/v1/path?query=123&value=abc)
- $request = $client->get('path?query=123&value=abc');
- $response = $request->send();
-
- // Create HEAD request using a relative URL with an absolute path
- // URL of the request: http://baseurl.com/path?query=123&value=abc
- $request = $client->head('/path?query=123&value=abc');
- $response = $request->send();
-
- // Create a DELETE request using an absolute URL
- $request = $client->delete('http://www.example.com/path?query=123&value=abc');
- $response = $request->send();
-
- // Create a PUT request using the contents of a PHP stream as the body
- // Specify custom HTTP headers
- $request = $client->put('http://www.example.com/upload', array(
- 'X-Header' => 'My Header'
- ), fopen('http://www.test.com/', 'r'));
- $response = $request->send();
-
- // Create a POST request and add the POST files manually
- $request = $client->post('http://localhost:8983/solr/update')
- ->addPostFiles(array('file' => '/path/to/documents.xml'));
- $response = $request->send();
-
- // Check if a resource supports the DELETE method
- $supportsDelete = $client->options('/path')->send()->isMethodAllowed('DELETE');
- $response = $request->send();
-
-Client objects create Request objects using a request factory (``Guzzle\Http\Message\RequestFactoryInterface``).
-You can inject a custom request factory into the Client using ``$client->setRequestFactory()``, but you can typically
-rely on a Client's default request factory.
-
-Static clients
---------------
-
-You can use Guzzle's static client facade to more easily send simple HTTP requests.
-
-.. code-block:: php
-
- // Mount the client so that you can access it at \Guzzle
- Guzzle\Http\StaticClient::mount();
- $response = Guzzle::get('http://guzzlephp.org');
-
-Each request method of the static client (e.g. ``get()``, ``post()`, ``put()``, etc) accepts an associative array of request
-options to apply to the request.
-
-.. code-block:: php
-
- $response = Guzzle::post('http://test.com', array(
- 'headers' => array('X-Foo' => 'Bar'),
- 'body' => array('Test' => '123'),
- 'timeout' => 10
- ));
-
-.. _request-options:
-
-Request options
----------------
-
-Request options can be specified when creating a request or in the ``request.options`` parameter of a client. These
-options can control various aspects of a request including: headers to send, query string data, where the response
-should be downloaded, proxies, auth, etc.
-
-headers
-~~~~~~~
-
-Associative array of headers to apply to the request. When specified in the ``$options`` argument of a client creational
-method (e.g. ``get()``, ``post()``, etc), the headers in the ``$options`` array will overwrite headers specified in the
-``$headers`` array.
-
-.. code-block:: php
-
- $request = $client->get($url, array(), array(
- 'headers' => array('X-Foo' => 'Bar')
- ));
-
-Headers can be specified on a client to add default headers to every request sent by a client.
-
-.. code-block:: php
-
- $client = new Guzzle\Http\Client();
-
- // Set a single header using path syntax
- $client->setDefaultOption('headers/X-Foo', 'Bar');
-
- // Set all headers
- $client->setDefaultOption('headers', array('X-Foo' => 'Bar'));
-
-.. note::
-
- In addition to setting request options when creating requests or using the ``setDefaultOption()`` method, any
- default client request option can be set using a client's config object:
-
- .. code-block:: php
-
- $client->getConfig()->setPath('request.options/headers/X-Foo', 'Bar');
-
-query
-~~~~~
-
-Associative array of query string parameters to the request. When specified in the ``$options`` argument of a client
-creational method, the query string parameters in the ``$options`` array will overwrite query string parameters
-specified in the `$url`.
-
-.. code-block:: php
-
- $request = $client->get($url, array(), array(
- 'query' => array('abc' => '123')
- ));
-
-Query string parameters can be specified on a client to add default query string parameters to every request sent by a
-client.
-
-.. code-block:: php
-
- $client = new Guzzle\Http\Client();
-
- // Set a single query string parameter using path syntax
- $client->setDefaultOption('query/abc', '123');
-
- // Set an array of default query string parameters
- $client->setDefaultOption('query', array('abc' => '123'));
-
-body
-~~~~
-
-Sets the body of a request. The value supplied to the body option can be a ``Guzzle\Http\EntityBodyInterface``, string,
-fopen resource, or array when sending POST requests. When a ``body`` request option is supplied, the option value will
-overwrite the ``$body`` argument of a client creational method.
-
-auth
-~~~~
-
-Specifies and array of HTTP authorization parameters parameters to use with the request. The array must contain the
-username in index [0], the password in index [1], and can optionally contain the authentication type in index [2].
-The available authentication types are: "Basic" (default), "Digest", "NTLM", or "Any".
-
-.. code-block:: php
-
- $request = $client->get($url, array(), array(
- 'auth' => array('username', 'password', 'Digest')
- ));
-
- // You can add auth headers to every request of a client
- $client->setDefaultOption('auth', array('username', 'password', 'Digest'));
-
-cookies
-~~~~~~~
-
-Specifies an associative array of cookies to add to the request.
-
-allow_redirects
-~~~~~~~~~~~~~~~
-
-Specifies whether or not the request should follow redirects. Requests will follow redirects by default. Set
-``allow_redirects`` to ``false`` to disable redirects.
-
-save_to
-~~~~~~~
-
-The ``save_to`` option specifies where the body of a response is downloaded. You can pass the path to a file, an fopen
-resource, or a ``Guzzle\Http\EntityBodyInterface`` object.
-
-See :ref:`Changing where a response is downloaded ` for more information on setting the
-`save_to` option.
-
-events
-~~~~~~
-
-The `events` option makes it easy to attach listeners to the various events emitted by a request object. The `events`
-options must be an associative array mapping an event name to a Closure or array the contains a Closure and the
-priority of the event.
-
-.. code-block:: php
-
- $request = $client->get($url, array(), array(
- 'events' => array(
- 'request.before_send' => function (\Guzzle\Common\Event $e) {
- echo 'About to send ' . $e['request'];
- }
- )
- ));
-
- // Using the static client:
- Guzzle::get($url, array(
- 'events' => array(
- 'request.before_send' => function (\Guzzle\Common\Event $e) {
- echo 'About to send ' . $e['request'];
- }
- )
- ));
-
-plugins
-~~~~~~~
-
-The `plugins` options makes it easy to attach an array of plugins to a request.
-
-.. code-block:: php
-
- // Using the static client:
- Guzzle::get($url, array(
- 'plugins' => array(
- new Guzzle\Plugin\Cache\CachePlugin(),
- new Guzzle\Plugin\Cookie\CookiePlugin()
- )
- ));
-
-exceptions
-~~~~~~~~~~
-
-The `exceptions` option can be used to disable throwing exceptions for unsuccessful HTTP response codes
-(e.g. 404, 500, etc). Set `exceptions` to false to not throw exceptions.
-
-params
-~~~~~~
-
-The `params` options can be used to specify an associative array of data parameters to add to a request. Note that
-these are not query string parameters.
-
-timeout / connect_timeout
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You can specify the maximum number of seconds to allow for an entire transfer to take place before timing out using
-the `timeout` request option. You can specify the maximum number of seconds to wait while trying to connect using the
-`connect_timeout` request option. Set either of these options to 0 to wait indefinitely.
-
-.. code-block:: php
-
- $request = $client->get('http://www.example.com', array(), array(
- 'timeout' => 20,
- 'connect_timeout' => 1.5
- ));
-
-verify
-~~~~~~
-
-Set to true to enable SSL certificate validation (the default), false to disable SSL certificate validation, or supply
-the path to a CA bundle to enable verification using a custom certificate.
-
-cert
-~~~~
-
-The `cert` option lets you specify a PEM formatted SSL client certificate to use with servers that require one. If the
-certificate requires a password, provide an array with the password as the second item.
-
-This would typically be used in conjunction with the `ssl_key` option.
-
-.. code-block:: php
-
- $request = $client->get('https://www.example.com', array(), array(
- 'cert' => '/etc/pki/client_certificate.pem'
- )
-
- $request = $client->get('https://www.example.com', array(), array(
- 'cert' => array('/etc/pki/client_certificate.pem', 's3cr3tp455w0rd')
- )
-
-ssl_key
-~~~~~~~
-
-The `ssl_key` option lets you specify a file containing your PEM formatted private key, optionally protected by a password.
-Note: your password is sensitive, keep the PHP script containing it safe.
-
-This would typically be used in conjunction with the `cert` option.
-
-.. code-block:: php
-
- $request = $client->get('https://www.example.com', array(), array(
- 'ssl_key' => '/etc/pki/private_key.pem'
- )
-
- $request = $client->get('https://www.example.com', array(), array(
- 'ssl_key' => array('/etc/pki/private_key.pem', 's3cr3tp455w0rd')
- )
-
-proxy
-~~~~~
-
-The `proxy` option is used to specify an HTTP proxy (e.g. `http://username:password@192.168.16.1:10`).
-
-debug
-~~~~~
-
-The `debug` option is used to show verbose cURL output for a transfer.
-
-stream
-~~~~~~
-
-When using a static client, you can set the `stream` option to true to return a `Guzzle\Stream\Stream` object that can
-be used to pull data from a stream as needed (rather than have cURL download the entire contents of a response to a
-stream all at once).
-
-.. code-block:: php
-
- $stream = Guzzle::get('http://guzzlephp.org', array('stream' => true));
- while (!$stream->feof()) {
- echo $stream->readLine();
- }
-
-Sending requests
-----------------
-
-Requests can be sent by calling the ``send()`` method of a Request object, but you can also send requests using the
-``send()`` method of a Client.
-
-.. code-block:: php
-
- $request = $client->get('http://www.amazon.com');
- $response = $client->send($request);
-
-Sending requests in parallel
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The Client's ``send()`` method accept a single ``Guzzle\Http\Message\RequestInterface`` object or an array of
-RequestInterface objects. When an array is specified, the requests will be sent in parallel.
-
-Sending many HTTP requests serially (one at a time) can cause an unnecessary delay in a script's execution. Each
-request must complete before a subsequent request can be sent. By sending requests in parallel, a pool of HTTP
-requests can complete at the speed of the slowest request in the pool, significantly reducing the amount of time
-needed to execute multiple HTTP requests. Guzzle provides a wrapper for the curl_multi functions in PHP.
-
-Here's an example of sending three requests in parallel using a client object:
-
-.. code-block:: php
-
- use Guzzle\Common\Exception\MultiTransferException;
-
- try {
- $responses = $client->send(array(
- $client->get('http://www.google.com/'),
- $client->head('http://www.google.com/'),
- $client->get('https://www.github.com/')
- ));
- } catch (MultiTransferException $e) {
-
- echo "The following exceptions were encountered:\n";
- foreach ($e as $exception) {
- echo $exception->getMessage() . "\n";
- }
-
- echo "The following requests failed:\n";
- foreach ($e->getFailedRequests() as $request) {
- echo $request . "\n\n";
- }
-
- echo "The following requests succeeded:\n";
- foreach ($e->getSuccessfulRequests() as $request) {
- echo $request . "\n\n";
- }
- }
-
-If the requests succeed, an array of ``Guzzle\Http\Message\Response`` objects are returned. A single request failure
-will not cause the entire pool of requests to fail. Any exceptions thrown while transferring a pool of requests will
-be aggregated into a ``Guzzle\Common\Exception\MultiTransferException`` exception.
-
-Plugins and events
-------------------
-
-Guzzle provides easy to use request plugins that add behavior to requests based on signal slot event notifications
-powered by the
-`Symfony2 Event Dispatcher component `_. Any
-event listener or subscriber attached to a Client object will automatically be attached to each request created by the
-client.
-
-Using the same cookie session for each request
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Attach a ``Guzzle\Plugin\Cookie\CookiePlugin`` to a client which will in turn add support for cookies to every request
-created by a client, and each request will use the same cookie session:
-
-.. code-block:: php
-
- use Guzzle\Plugin\Cookie\CookiePlugin;
- use Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar;
-
- // Create a new cookie plugin
- $cookiePlugin = new CookiePlugin(new ArrayCookieJar());
-
- // Add the cookie plugin to the client
- $client->addSubscriber($cookiePlugin);
-
-.. _client-events:
-
-Events emitted from a client
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-A ``Guzzle\Http\Client`` object emits the following events:
-
-+------------------------------+--------------------------------------------+------------------------------------------+
-| Event name | Description | Event data |
-+==============================+============================================+==========================================+
-| client.create_request | Called when a client creates a request | * client: The client |
-| | | * request: The created request |
-+------------------------------+--------------------------------------------+------------------------------------------+
-
-.. code-block:: php
-
- use Guzzle\Common\Event;
- use Guzzle\Http\Client;
-
- $client = new Client();
-
- // Add a listener that will echo out requests as they are created
- $client->getEventDispatcher()->addListener('client.create_request', function (Event $e) {
- echo 'Client object: ' . spl_object_hash($e['client']) . "\n";
- echo "Request object: {$e['request']}\n";
- });
diff --git a/lib/gerencianet/guzzle/guzzle/docs/http-client/entity-bodies.rst b/lib/gerencianet/guzzle/guzzle/docs/http-client/entity-bodies.rst
deleted file mode 100644
index 823b0c0..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/http-client/entity-bodies.rst
+++ /dev/null
@@ -1,151 +0,0 @@
-===========================
-Request and response bodies
-===========================
-
-`Entity body `_ is the term used for the body of an HTTP
-message. The entity body of requests and responses is inherently a
-`PHP stream `_ in Guzzle. The body of the request can be either a string or
-a PHP stream which are converted into a ``Guzzle\Http\EntityBody`` object using its factory method. When using a
-string, the entity body is stored in a `temp PHP stream `_. The use of
-temp PHP streams helps to protect your application from running out of memory when sending or receiving large entity
-bodies in your messages. When more than 2MB of data is stored in a temp stream, it automatically stores the data on
-disk rather than in memory.
-
-EntityBody objects provide a great deal of functionality: compression, decompression, calculate the Content-MD5,
-calculate the Content-Length (when the resource is repeatable), guessing the Content-Type, and more. Guzzle doesn't
-need to load an entire entity body into a string when sending or retrieving data; entity bodies are streamed when
-being uploaded and downloaded.
-
-Here's an example of gzip compressing a text file then sending the file to a URL:
-
-.. code-block:: php
-
- use Guzzle\Http\EntityBody;
-
- $body = EntityBody::factory(fopen('/path/to/file.txt', 'r+'));
- echo $body->read(1024);
- $body->seek(0, SEEK_END);
- $body->write('foo');
- echo $body->ftell();
- $body->rewind();
-
- // Send a request using the body
- $response = $client->put('http://localhost:8080/uploads', null, $body)->send();
-
-The body of the request can be specified in the ``Client::put()`` or ``Client::post()`` method, or, you can specify
-the body of the request by calling the ``setBody()`` method of any
-``Guzzle\Http\Message\EntityEnclosingRequestInterface`` object.
-
-Compression
------------
-
-You can compress the contents of an EntityBody object using the ``compress()`` method. The compress method accepts a
-filter that must match to one of the supported
-`PHP stream filters `_ on your system (e.g. `zlib.deflate`,
-``bzip2.compress``, etc). Compressing an entity body will stream the entire entity body through a stream compression
-filter into a temporary PHP stream. You can uncompress an entity body using the ``uncompress()`` method and passing
-the PHP stream filter to use when decompressing the stream (e.g. ``zlib.inflate``).
-
-.. code-block:: php
-
- use Guzzle\Http\EntityBody;
-
- $body = EntityBody::factory(fopen('/tmp/test.txt', 'r+'));
- echo $body->getSize();
- // >>> 1048576
-
- // Compress using the default zlib.deflate filter
- $body->compress();
- echo $body->getSize();
- // >>> 314572
-
- // Decompress the stream
- $body->uncompress();
- echo $body->getSize();
- // >>> 1048576
-
-Decorators
-----------
-
-Guzzle provides several EntityBody decorators that can be used to add functionality to an EntityBody at runtime.
-
-IoEmittingEntityBody
-~~~~~~~~~~~~~~~~~~~~
-
-This decorator will emit events when data is read from a stream or written to a stream. Add an event subscriber to the
-entity body's ``body.read`` or ``body.write`` methods to receive notifications when data data is transferred.
-
-.. code-block:: php
-
- use Guzzle\Common\Event;
- use Guzzle\Http\EntityBody;
- use Guzzle\Http\IoEmittingEntityBody;
-
- $original = EntityBody::factory(fopen('/tmp/test.txt', 'r+'));
- $body = new IoEmittingEntityBody($original);
-
- // Listen for read events
- $body->getEventDispatcher()->addListener('body.read', function (Event $e) {
- // Grab data from the event
- $entityBody = $e['body'];
- // Amount of data retrieved from the body
- $lengthOfData = $e['length'];
- // The actual data that was read
- $data = $e['read'];
- });
-
- // Listen for write events
- $body->getEventDispatcher()->addListener('body.write', function (Event $e) {
- // Grab data from the event
- $entityBody = $e['body'];
- // The data that was written
- $data = $e['write'];
- // The actual amount of data that was written
- $data = $e['read'];
- });
-
-ReadLimitEntityBody
-~~~~~~~~~~~~~~~~~~~
-
-The ReadLimitEntityBody decorator can be used to transfer a subset or slice of an existing EntityBody object. This can
-be useful for breaking a large file into smaller pieces to be sent in chunks (e.g. Amazon S3's multipart upload API).
-
-.. code-block:: php
-
- use Guzzle\Http\EntityBody;
- use Guzzle\Http\ReadLimitEntityBody;
-
- $original = EntityBody::factory(fopen('/tmp/test.txt', 'r+'));
- echo $original->getSize();
- // >>> 1048576
-
- // Limit the size of the body to 1024 bytes and start reading from byte 2048
- $body = new ReadLimitEntityBody($original, 1024, 2048);
- echo $body->getSize();
- // >>> 1024
- echo $body->ftell();
- // >>> 0
-
-CachingEntityBody
-~~~~~~~~~~~~~~~~~
-
-The CachingEntityBody decorator is used to allow seeking over previously read bytes on non-seekable read streams. This
-can be useful when transferring a non-seekable entity body fails due to needing to rewind the stream (for example,
-resulting from a redirect). Data that is read from the remote stream will be buffered in a PHP temp stream so that
-previously read bytes are cached first in memory, then on disk.
-
-.. code-block:: php
-
- use Guzzle\Http\EntityBody;
- use Guzzle\Http\CachingEntityBody;
-
- $original = EntityBody::factory(fopen('http://www.google.com', 'r'));
- $body = new CachingEntityBody($original);
-
- $body->read(1024);
- echo $body->ftell();
- // >>> 1024
-
- $body->seek(0);
- echo $body->ftell();
- // >>> 0
diff --git a/lib/gerencianet/guzzle/guzzle/docs/http-client/http-redirects.rst b/lib/gerencianet/guzzle/guzzle/docs/http-client/http-redirects.rst
deleted file mode 100644
index 32ba268..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/http-client/http-redirects.rst
+++ /dev/null
@@ -1,99 +0,0 @@
-==============
-HTTP redirects
-==============
-
-By default, Guzzle will automatically follow redirects using the non-RFC compliant implementation used by most web
-browsers. This means that redirects for POST requests are followed by a GET request. You can force RFC compliance by
-enabling the strict mode on a request's parameter object:
-
-.. code-block:: php
-
- // Set per request
- $request = $client->post();
- $request->getParams()->set('redirect.strict', true);
-
- // You can set globally on a client so all requests use strict redirects
- $client->getConfig()->set('request.params', array(
- 'redirect.strict' => true
- ));
-
-By default, Guzzle will redirect up to 5 times before throwing a ``Guzzle\Http\Exception\TooManyRedirectsException``.
-You can raise or lower this value using the ``redirect.max`` parameter of a request object:
-
-.. code-block:: php
-
- $request->getParams()->set('redirect.max', 2);
-
-Redirect history
-----------------
-
-You can get the number of redirects of a request using the resulting response object's ``getRedirectCount()`` method.
-Similar to cURL's ``effective_url`` property, Guzzle provides the effective URL, or the last redirect URL that returned
-the request, in a response's ``getEffectiveUrl()`` method.
-
-When testing or debugging, it is often useful to see a history of redirects for a particular request. This can be
-achieved using the HistoryPlugin.
-
-.. code-block:: php
-
- $request = $client->get('/');
- $history = new Guzzle\Plugin\History\HistoryPlugin();
- $request->addSubscriber($history);
- $response = $request->send();
-
- // Get the last redirect URL or the URL of the request that received
- // this response
- echo $response->getEffectiveUrl();
-
- // Get the number of redirects
- echo $response->getRedirectCount();
-
- // Iterate over each sent request and response
- foreach ($history->getAll() as $transaction) {
- // Request object
- echo $transaction['request']->getUrl() . "\n";
- // Response object
- echo $transaction['response']->getEffectiveUrl() . "\n";
- }
-
- // Or, simply cast the HistoryPlugin to a string to view each request and response
- echo $history;
-
-Disabling redirects
--------------------
-
-You can disable redirects on a client by passing a configuration option in the client's constructor:
-
-.. code-block:: php
-
- $client = new Client(null, array('redirect.disable' => true));
-
-You can also disable redirects per request:
-
-.. code-block:: php
-
- $request = $client->get($url, array(), array('allow_redirects' => false));
-
-Redirects and non-repeatable streams
-------------------------------------
-
-If you are redirected when sending data from a non-repeatable stream and some of the data has been read off of the
-stream, then you will get a ``Guzzle\Http\Exception\CouldNotRewindStreamException``. You can get around this error by
-adding a custom rewind method to the entity body object being sent in the request.
-
-.. code-block:: php
-
- $request = $client->post(
- 'http://httpbin.com/redirect/2',
- null,
- fopen('http://httpbin.com/get', 'r')
- );
-
- // Add a custom function that can be used to rewind the stream
- // (reopen in this example)
- $request->getBody()->setRewindFunction(function ($body) {
- $body->setStream(fopen('http://httpbin.com/get', 'r'));
- return true;
- );
-
- $response = $client->send();
diff --git a/lib/gerencianet/guzzle/guzzle/docs/http-client/request.rst b/lib/gerencianet/guzzle/guzzle/docs/http-client/request.rst
deleted file mode 100644
index a8387a9..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/http-client/request.rst
+++ /dev/null
@@ -1,667 +0,0 @@
-=====================
-Using Request objects
-=====================
-
-HTTP request messages
----------------------
-
-Request objects are all about building an HTTP message. Each part of an HTTP request message can be set individually
-using methods on the request object or set in bulk using the ``setUrl()`` method. Here's the format of an HTTP request
-with each part of the request referencing the method used to change it::
-
- PUT(a) /path(b)?query=123(c) HTTP/1.1(d)
- X-Header(e): header
- Content-Length(e): 4
-
- data(f)
-
-+-------------------------+---------------------------------------------------------------------------------+
-| a. **Method** | The request method can only be set when instantiating a request |
-+-------------------------+---------------------------------------------------------------------------------+
-| b. **Path** | ``$request->setPath('/path');`` |
-+-------------------------+---------------------------------------------------------------------------------+
-| c. **Query** | ``$request->getQuery()->set('query', '123');`` |
-+-------------------------+---------------------------------------------------------------------------------+
-| d. **Protocol version** | ``$request->setProtocolVersion('1.1');`` |
-+-------------------------+---------------------------------------------------------------------------------+
-| e. **Header** | ``$request->setHeader('X-Header', 'header');`` |
-+-------------------------+---------------------------------------------------------------------------------+
-| f. **Entity Body** | ``$request->setBody('data'); // Only available with PUT, POST, PATCH, DELETE`` |
-+-------------------------+---------------------------------------------------------------------------------+
-
-Creating requests with a client
--------------------------------
-
-Client objects are responsible for creating HTTP request objects.
-
-GET requests
-~~~~~~~~~~~~
-
-`GET requests `_ are the most common form of HTTP
-requests. When you visit a website in your browser, the HTML of the website is downloaded using a GET request. GET
-requests are idempotent requests that are typically used to download content (an entity) identified by a request URL.
-
-.. code-block:: php
-
- use Guzzle\Http\Client;
-
- $client = new Client();
-
- // Create a request that has a query string and an X-Foo header
- $request = $client->get('http://www.amazon.com?a=1', array('X-Foo' => 'Bar'));
-
- // Send the request and get the response
- $response = $request->send();
-
-You can change where the body of a response is downloaded on any request using the
-``$request->setResponseBody(string|EntityBodyInterface|resource)`` method of a request. You can also set the ``save_to``
-option of a request:
-
-.. code-block:: php
-
- // Send the response body to a file
- $request = $client->get('http://test.com', array(), array('save_to' => '/path/to/file'));
-
- // Send the response body to an fopen resource
- $request = $client->get('http://test.com', array(), array('save_to' => fopen('/path/to/file', 'w')));
-
-HEAD requests
-~~~~~~~~~~~~~
-
-`HEAD requests `_ work exactly like GET requests except
-that they do not actually download the response body (entity) of the response message. HEAD requests are useful for
-retrieving meta information about an entity identified by a Request-URI.
-
-.. code-block:: php
-
- $client = new Guzzle\Http\Client();
- $request = $client->head('http://www.amazon.com');
- $response = $request->send();
- echo $response->getContentLength();
- // >>> Will output the Content-Length header value
-
-DELETE requests
-~~~~~~~~~~~~~~~
-
-A `DELETE method `_ requests that the origin server
-delete the resource identified by the Request-URI.
-
-.. code-block:: php
-
- $client = new Guzzle\Http\Client();
- $request = $client->delete('http://example.com');
- $response = $request->send();
-
-POST requests
-~~~~~~~~~~~~~
-
-While `POST requests `_ can be used for a number of
-reasons, POST requests are often used when submitting HTML form data to a website. POST requests can include an entity
-body in the HTTP request.
-
-POST requests in Guzzle are sent with an ``application/x-www-form-urlencoded`` Content-Type header if POST fields are
-present but no files are being sent in the POST. If files are specified in the POST request, then the Content-Type
-header will become ``multipart/form-data``.
-
-The ``post()`` method of a client object accepts four arguments: the URL, optional headers, post fields, and an array of
-request options. To send files in the POST request, prepend the ``@`` symbol to the array value (just like you would if
-you were using the PHP ``curl_setopt`` function).
-
-Here's how to create a multipart/form-data POST request containing files and fields:
-
-.. code-block:: php
-
- $request = $client->post('http://httpbin.org/post', array(), array(
- 'custom_field' => 'my custom value',
- 'file_field' => '@/path/to/file.xml'
- ));
-
- $response = $request->send();
-
-.. note::
-
- Remember to **always** sanitize user input when sending POST requests:
-
- .. code-block:: php
-
- // Prevent users from accessing sensitive files by sanitizing input
- $_POST = array('firstname' => '@/etc/passwd');
- $request = $client->post('http://www.example.com', array(), array (
- 'firstname' => str_replace('@', '', $_POST['firstname'])
- ));
-
-You can alternatively build up the contents of a POST request.
-
-.. code-block:: php
-
- $request = $client->post('http://httpbin.org/post')
- ->setPostField('custom_field', 'my custom value')
- ->addPostFile('file', '/path/to/file.xml');
-
- $response = $request->send();
-
-Raw POST data
-^^^^^^^^^^^^^
-
-POST requests can also contain raw POST data that is not related to HTML forms.
-
-.. code-block:: php
-
- $request = $client->post('http://httpbin.org/post', array(), 'this is the body');
- $response = $request->send();
-
-You can set the body of POST request using the ``setBody()`` method of the
-``Guzzle\Http\Message\EntityEnclosingRequest`` object. This method accepts a string, a resource returned from
-``fopen``, or a ``Guzzle\Http\EntityBodyInterface`` object.
-
-.. code-block:: php
-
- $request = $client->post('http://httpbin.org/post');
- // Set the body of the POST to stream the contents of /path/to/large_body.txt
- $request->setBody(fopen('/path/to/large_body.txt', 'r'));
- $response = $request->send();
-
-PUT requests
-~~~~~~~~~~~~
-
-The `PUT method `_ requests that the enclosed entity be
-stored under the supplied Request-URI. PUT requests are similar to POST requests in that they both can send an entity
-body in the request message.
-
-The body of a PUT request (any any ``Guzzle\Http\Message\EntityEnclosingRequestInterface`` object) is always stored as
-a ``Guzzle\Http\Message\EntityBodyInterface`` object. This allows a great deal of flexibility when sending data to a
-remote server. For example, you can stream the contents of a stream returned by fopen, stream the contents of a
-callback function, or simply send a string of data.
-
-.. code-block:: php
-
- $request = $client->put('http://httpbin.org/put', array(), 'this is the body');
- $response = $request->send();
-
-Just like with POST, PATH, and DELETE requests, you can set the body of a PUT request using the ``setBody()`` method.
-
-.. code-block:: php
-
- $request = $client->put('http://httpbin.org/put');
- $request->setBody(fopen('/path/to/large_body.txt', 'r'));
- $response = $request->send();
-
-PATCH requests
-~~~~~~~~~~~~~~
-
-`PATCH requests `_ are used to modify a resource.
-
-.. code-block:: php
-
- $request = $client->patch('http://httpbin.org', array(), 'this is the body');
- $response = $request->send();
-
-OPTIONS requests
-~~~~~~~~~~~~~~~~
-
-The `OPTIONS method `_ represents a request for
-information about the communication options available on the request/response chain identified by the Request-URI.
-
-.. code-block:: php
-
- $request = $client->options('http://httpbin.org');
- $response = $request->send();
-
- // Check if the PUT method is supported by this resource
- var_export($response->isMethodAllows('PUT'));
-
-Custom requests
-~~~~~~~~~~~~~~~
-
-You can create custom HTTP requests that use non-standard HTTP methods using the ``createRequest()`` method of a
-client object.
-
-.. code-block:: php
-
- $request = $client->createRequest('COPY', 'http://example.com/foo', array(
- 'Destination' => 'http://example.com/bar',
- 'Overwrite' => 'T'
- ));
- $response = $request->send();
-
-Query string parameters
------------------------
-
-Query string parameters of a request are owned by a request's ``Guzzle\Http\Query`` object that is accessible by
-calling ``$request->getQuery()``. The Query class extends from ``Guzzle\Common\Collection`` and allows you to set one
-or more query string parameters as key value pairs. You can set a parameter on a Query object using the
-``set($key, $value)`` method or access the query string object like an associative array. Any previously specified
-value for a key will be overwritten when using ``set()``. Use ``add($key, $value)`` to add a value to query string
-object, and in the event of a collision with an existing value at a specific key, the value will be converted to an
-array that contains all of the previously set values.
-
-.. code-block:: php
-
- $request = new Guzzle\Http\Message\Request('GET', 'http://www.example.com?foo=bar&abc=123');
-
- $query = $request->getQuery();
- echo "{$query}\n";
- // >>> foo=bar&abc=123
-
- $query->remove('abc');
- echo "{$query}\n";
- // >>> foo=bar
-
- $query->set('foo', 'baz');
- echo "{$query}\n";
- // >>> foo=baz
-
- $query->add('foo', 'bar');
- echo "{$query}\n";
- // >>> foo%5B0%5D=baz&foo%5B1%5D=bar
-
-Whoah! What happened there? When ``foo=bar`` was added to the existing ``foo=baz`` query string parameter, the
-aggregator associated with the Query object was used to help convert multi-value query string parameters into a string.
-Let's disable URL-encoding to better see what's happening.
-
-.. code-block:: php
-
- $query->useUrlEncoding(false);
- echo "{$query}\n";
- // >>> foo[0]=baz&foo[1]=bar
-
-.. note::
-
- URL encoding can be disabled by passing false, enabled by passing true, set to use RFC 1738 by passing
- ``Query::FORM_URLENCODED`` (internally uses PHP's ``urlencode`` function), or set to RFC 3986 by passing
- ``Query::RFC_3986`` (this is the default and internally uses PHP's ``rawurlencode`` function).
-
-As you can see, the multiple values were converted into query string parameters following the default PHP convention of
-adding numerically indexed square bracket suffixes to each key (``foo[0]=baz&foo[1]=bar``). The strategy used to convert
-multi-value parameters into a string can be customized using the ``setAggregator()`` method of the Query class. Guzzle
-ships with the following query string aggregators by default:
-
-1. ``Guzzle\Http\QueryAggregator\PhpAggregator``: Aggregates using PHP style brackets (e.g. ``foo[0]=baz&foo[1]=bar``)
-2. ``Guzzle\Http\QueryAggregator\DuplicateAggregator``: Performs no aggregation and allows for key value pairs to be
- repeated in a URL (e.g. ``foo=baz&foo=bar``)
-3. ``Guzzle\Http\QueryAggregator\CommaAggregator``: Aggregates using commas (e.g. ``foo=baz,bar``)
-
-.. _http-message-headers:
-
-HTTP Message Headers
---------------------
-
-HTTP message headers are case insensitive, multiple occurrences of any header can be present in an HTTP message
-(whether it's valid or not), and some servers require specific casing of particular headers. Because of this, request
-and response headers are stored in ``Guzzle\Http\Message\Header`` objects. The Header object can be cast as a string,
-counted, or iterated to retrieve each value from the header. Casting a Header object to a string will return all of
-the header values concatenated together using a glue string (typically ", ").
-
-A request (and response) object have several methods that allow you to retrieve and modify headers.
-
-* ``getHeaders()``: Get all of the headers of a message as a ``Guzzle\Http\Message\Header\HeaderCollection`` object.
-* ``getHeader($header)``: Get a specific header from a message. If the header exists, you'll get a
- ``Guzzle\Http\Message\Header`` object. If the header does not exist, this methods returns ``null``.
-* ``hasHeader($header)``: Returns true or false based on if the message has a particular header.
-* ``setHeader($header, $value)``: Set a header value and overwrite any previously set value for this header.
-* ``addHeader($header, $value)``: Add a header with a particular name. If a previous value was already set by the same,
- then the header will contain multiple values.
-* ``removeHeader($header)``: Remove a header by name from the message.
-
-.. code-block:: php
-
- $request = new Request('GET', 'http://httpbin.com/cookies');
- // addHeader will set and append to any existing header values
- $request->addHeader('Foo', 'bar');
- $request->addHeader('foo', 'baz');
- // setHeader overwrites any existing values
- $request->setHeader('Test', '123');
-
- // Request headers can be cast as a string
- echo $request->getHeader('Foo');
- // >>> bar, baz
- echo $request->getHeader('Test');
- // >>> 123
-
- // You can count the number of headers of a particular case insensitive name
- echo count($request->getHeader('foO'));
- // >>> 2
-
- // You can iterate over Header objects
- foreach ($request->getHeader('foo') as $header) {
- echo $header . "\n";
- }
-
- // You can get all of the request headers as a Guzzle\Http\Message\Header\HeaderCollection object
- $headers = $request->getHeaders();
-
- // Missing headers return NULL
- var_export($request->getHeader('Missing'));
- // >>> null
-
- // You can see all of the different variations of a header by calling raw() on the Header
- var_export($request->getHeader('foo')->raw());
-
-Setting the body of a request
------------------------------
-
-Requests that can send a body (e.g. PUT, POST, DELETE, PATCH) are instances of
-``Guzzle\Http\Message\EntityEnclosingRequestInterface``. Entity enclosing requests contain several methods that allow
-you to specify the body to send with a request.
-
-Use the ``setBody()`` method of a request to set the body that will be sent with a request. This method accepts a
-string, a resource returned by ``fopen()``, an array, or an instance of ``Guzzle\Http\EntityBodyInterface``. The body
-will then be streamed from the underlying ``EntityBodyInterface`` object owned by the request. When setting the body
-of the request, you can optionally specify a Content-Type header and whether or not to force the request to use
-chunked Transfer-Encoding.
-
-.. code-block:: php
-
- $request = $client->put('/user.json');
- $request->setBody('{"foo":"baz"}', 'application/json');
-
-Content-Type header
-~~~~~~~~~~~~~~~~~~~
-
-Guzzle will automatically add a Content-Type header to a request if the Content-Type can be guessed based on the file
-extension of the payload being sent or the file extension present in the path of a request.
-
-.. code-block:: php
-
- $request = $client->put('/user.json', array(), '{"foo":"bar"}');
- // The Content-Type was guessed based on the path of the request
- echo $request->getHeader('Content-Type');
- // >>> application/json
-
- $request = $client->put('/user.json');
- $request->setBody(fopen('/tmp/user_data.json', 'r'));
- // The Content-Type was guessed based on the path of the entity body
- echo $request->getHeader('Content-Type');
- // >>> application/json
-
-Transfer-Encoding: chunked header
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-When sending HTTP requests that contain a payload, you must let the remote server know how to determine when the entire
-message has been sent. This usually is done by supplying a ``Content-Length`` header that tells the origin server the
-size of the body that is to be sent. In some cases, the size of the payload being sent in a request cannot be known
-before initiating the transfer. In these cases (when using HTTP/1.1), you can use the ``Transfer-Encoding: chunked``
-header.
-
-If the Content-Length cannot be determined (i.e. using a PHP ``http://`` stream), then Guzzle will automatically add
-the ``Transfer-Encoding: chunked`` header to the request.
-
-.. code-block:: php
-
- $request = $client->put('/user.json');
- $request->setBody(fopen('http://httpbin.org/get', 'r'));
-
- // The Content-Length could not be determined
- echo $request->getHeader('Transfer-Encoding');
- // >>> chunked
-
-See :doc:`/http-client/entity-bodies` for more information on entity bodies.
-
-Expect: 100-Continue header
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The ``Expect: 100-Continue`` header is used to help a client prevent sending a large payload to a server that will
-reject the request. This allows clients to fail fast rather than waste bandwidth sending an erroneous payload. Guzzle
-will automatically add the ``Expect: 100-Continue`` header to a request when the size of the payload exceeds 1MB or if
-the body of the request is not seekable (this helps to prevent errors when a non-seekable body request is redirected).
-
-.. note::
-
- If you find that your larger requests are taking too long to complete, you should first check if the
- ``Expect: 100-Continue`` header is being sent with the request. Some servers do not respond well to this header,
- which causes cURL to sleep for `1 second `_.
-
-POST fields and files
-~~~~~~~~~~~~~~~~~~~~~
-
-Any entity enclosing request can send POST style fields and files. This includes POST, PUT, PATCH, and DELETE requests.
-Any request that has set POST fields or files will use cURL's POST message functionality.
-
-.. code-block:: php
-
- $request = $client->post('/post');
- // Set an overwrite any previously specified value
- $request->setPostField('foo', 'bar');
- // Append a value to any existing values
- $request->getPostFields()->add('foo', 'baz');
- // Remove a POST field by name
- $request->removePostField('fizz');
-
- // Add a file to upload (forces multipart/form-data)
- $request->addPostFile('my_file', '/path/to/file', 'plain/text');
- // Remove a POST file by POST key name
- $request->removePostFile('my_other_file');
-
-.. tip::
-
- Adding a large number of POST fields to a POST request is faster if you use the ``addPostFields()`` method so that
- you can add and process multiple fields with a single call. Adding multiple POST files is also faster using
- ``addPostFiles()``.
-
-Working with cookies
---------------------
-
-Cookies can be modified and retrieved from a request using the following methods:
-
-.. code-block:: php
-
- $request->addCookie($name, $value);
- $request->removeCookie($name);
- $value = $request->getCookie($name);
- $valueArray = $request->getCookies();
-
-Use the :doc:`cookie plugin ` if you need to reuse cookies between requests.
-
-.. _request-set-response-body:
-
-Changing where a response is downloaded
-----------------------------------------
-
-When a request is sent, the body of the response will be stored in a PHP temp stream by default. You can change the
-location in which the response will be downloaded using ``$request->setResponseBody($body)`` or the ``save_to`` request
-option. This can be useful for downloading the contents of a URL to a specific file.
-
-Here's an example of using request options:
-
-.. code-block:: php
-
- $request = $this->client->get('http://example.com/large.mov', array(), array(
- 'save_to' => '/tmp/large_file.mov'
- ));
- $request->send();
- var_export(file_exists('/tmp/large_file.mov'));
- // >>> true
-
-Here's an example of using ``setResponseBody()``:
-
-.. code-block:: php
-
- $body = fopen('/tmp/large_file.mov', 'w');
- $request = $this->client->get('http://example.com/large.mov');
- $request->setResponseBody($body);
-
- // You can more easily specify the name of a file to save the contents
- // of the response to by passing a string to ``setResponseBody()``.
-
- $request = $this->client->get('http://example.com/large.mov');
- $request->setResponseBody('/tmp/large_file.mov');
-
-Custom cURL options
--------------------
-
-Most of the functionality implemented in the libcurl bindings has been simplified and abstracted by Guzzle. Developers
-who need access to `cURL specific functionality `_ can still add cURL handle
-specific behavior to Guzzle HTTP requests by modifying the cURL options collection of a request:
-
-.. code-block:: php
-
- $request->getCurlOptions()->set(CURLOPT_LOW_SPEED_LIMIT, 200);
-
-Other special options that can be set in the ``curl.options`` array include:
-
-+-------------------------+---------------------------------------------------------------------------------+
-| debug | Adds verbose cURL output to a temp stream owned by the cURL handle object |
-+-------------------------+---------------------------------------------------------------------------------+
-| progress | Instructs cURL to emit events when IO events occur. This allows you to be |
-| | notified when bytes are transferred over the wire by subscribing to a request's |
-| | ``curl.callback.read``, ``curl.callback.write``, and ``curl.callback.progress`` |
-| | events. |
-+-------------------------+---------------------------------------------------------------------------------+
-
-Request options
----------------
-
-Requests options can be specified when creating a request or in the ``request.options`` parameter of a client. These
-options can control various aspects of a request including: headers to send, query string data, where the response
-should be downloaded, proxies, auth, etc.
-
-.. code-block:: php
-
- $request = $client->get($url, $headers, array('proxy' => 'http://proxy.com'));
-
-See :ref:`Request options ` for more information.
-
-Working with errors
--------------------
-
-HTTP errors
-~~~~~~~~~~~
-
-Requests that receive a 4xx or 5xx response will throw a ``Guzzle\Http\Exception\BadResponseException``. More
-specifically, 4xx errors throw a ``Guzzle\Http\Exception\ClientErrorResponseException``, and 5xx errors throw a
-``Guzzle\Http\Exception\ServerErrorResponseException``. You can catch the specific exceptions or just catch the
-BadResponseException to deal with either type of error. Here's an example of catching a generic BadResponseException:
-
-.. code-block:: php
-
- try {
- $response = $client->get('/not_found.xml')->send();
- } catch (Guzzle\Http\Exception\BadResponseException $e) {
- echo 'Uh oh! ' . $e->getMessage();
- echo 'HTTP request URL: ' . $e->getRequest()->getUrl() . "\n";
- echo 'HTTP request: ' . $e->getRequest() . "\n";
- echo 'HTTP response status: ' . $e->getResponse()->getStatusCode() . "\n";
- echo 'HTTP response: ' . $e->getResponse() . "\n";
- }
-
-Throwing an exception when a 4xx or 5xx response is encountered is the default behavior of Guzzle requests. This
-behavior can be overridden by adding an event listener with a higher priority than -255 that stops event propagation.
-You can subscribe to ``request.error`` to receive notifications any time an unsuccessful response is received.
-
-You can change the response that will be associated with the request by calling ``setResponse()`` on the
-``$event['request']`` object passed into your listener, or by changing the ``$event['response']`` value of the
-``Guzzle\Common\Event`` object that is passed to your listener. Transparently changing the response associated with a
-request by modifying the event allows you to retry failed requests without complicating the code that uses the client.
-This might be useful for sending requests to a web service that has expiring auth tokens. When a response shows that
-your token has expired, you can get a new token, retry the request with the new token, and return the successful
-response to the user.
-
-Here's an example of retrying a request using updated authorization credentials when a 401 response is received,
-overriding the response of the original request with the new response, and still allowing the default exception
-behavior to be called when other non-200 response status codes are encountered:
-
-.. code-block:: php
-
- // Add custom error handling to any request created by this client
- $client->getEventDispatcher()->addListener('request.error', function(Event $event) {
-
- if ($event['response']->getStatusCode() == 401) {
-
- $newRequest = $event['request']->clone();
- $newRequest->setHeader('X-Auth-Header', MyApplication::getNewAuthToken());
- $newResponse = $newRequest->send();
-
- // Set the response object of the request without firing more events
- $event['response'] = $newResponse;
-
- // You can also change the response and fire the normal chain of
- // events by calling $event['request']->setResponse($newResponse);
-
- // Stop other events from firing when you override 401 responses
- $event->stopPropagation();
- }
-
- });
-
-cURL errors
-~~~~~~~~~~~
-
-Connection problems and cURL specific errors can also occur when transferring requests using Guzzle. When Guzzle
-encounters cURL specific errors while transferring a single request, a ``Guzzle\Http\Exception\CurlException`` is
-thrown with an informative error message and access to the cURL error message.
-
-A ``Guzzle\Http\Exception\MultiTransferException`` exception is thrown when a cURL specific error occurs while
-transferring multiple requests in parallel. You can then iterate over all of the exceptions encountered during the
-transfer.
-
-Plugins and events
-------------------
-
-Guzzle request objects expose various events that allow you to hook in custom logic. A request object owns a
-``Symfony\Component\EventDispatcher\EventDispatcher`` object that can be accessed by calling
-``$request->getEventDispatcher()``. You can use the event dispatcher to add listeners (a simple callback function) or
-event subscribers (classes that listen to specific events of a dispatcher). You can add event subscribers to a request
-directly by just calling ``$request->addSubscriber($mySubscriber);``.
-
-.. _request-events:
-
-Events emitted from a request
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-A ``Guzzle\Http\Message\Request`` and ``Guzzle\Http\Message\EntityEnclosingRequest`` object emit the following events:
-
-+------------------------------+--------------------------------------------+------------------------------------------+
-| Event name | Description | Event data |
-+==============================+============================================+==========================================+
-| request.before_send | About to send request | * request: Request to be sent |
-+------------------------------+--------------------------------------------+------------------------------------------+
-| request.sent | Sent the request | * request: Request that was sent |
-| | | * response: Received response |
-+------------------------------+--------------------------------------------+------------------------------------------+
-| request.complete | Completed a full HTTP transaction | * request: Request that was sent |
-| | | * response: Received response |
-+------------------------------+--------------------------------------------+------------------------------------------+
-| request.success | Completed a successful request | * request: Request that was sent |
-| | | * response: Received response |
-+------------------------------+--------------------------------------------+------------------------------------------+
-| request.error | Completed an unsuccessful request | * request: Request that was sent |
-| | | * response: Received response |
-+------------------------------+--------------------------------------------+------------------------------------------+
-| request.exception | An unsuccessful response was | * request: Request |
-| | received. | * response: Received response |
-| | | * exception: BadResponseException |
-+------------------------------+--------------------------------------------+------------------------------------------+
-| request.receive.status_line | Received the start of a response | * line: Full response start line |
-| | | * status_code: Status code |
-| | | * reason_phrase: Reason phrase |
-| | | * previous_response: (e.g. redirect) |
-+------------------------------+--------------------------------------------+------------------------------------------+
-| curl.callback.progress | cURL progress event (only dispatched when | * handle: CurlHandle |
-| | ``emit_io`` is set on a request's curl | * download_size: Total download size |
-| | options) | * downloaded: Bytes downloaded |
-| | | * upload_size: Total upload bytes |
-| | | * uploaded: Bytes uploaded |
-+------------------------------+--------------------------------------------+------------------------------------------+
-| curl.callback.write | cURL event called when data is written to | * request: Request |
-| | an outgoing stream | * write: Data being written |
-+------------------------------+--------------------------------------------+------------------------------------------+
-| curl.callback.read | cURL event called when data is written to | * request: Request |
-| | an incoming stream | * read: Data being read |
-+------------------------------+--------------------------------------------+------------------------------------------+
-
-Creating a request event listener
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Here's an example that listens to the ``request.complete`` event of a request and prints the request and response.
-
-.. code-block:: php
-
- use Guzzle\Common\Event;
-
- $request = $client->get('http://www.google.com');
-
- // Echo out the response that was received
- $request->getEventDispatcher()->addListener('request.complete', function (Event $e) {
- echo $e['request'] . "\n\n";
- echo $e['response'];
- });
diff --git a/lib/gerencianet/guzzle/guzzle/docs/http-client/response.rst b/lib/gerencianet/guzzle/guzzle/docs/http-client/response.rst
deleted file mode 100644
index ba48731..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/http-client/response.rst
+++ /dev/null
@@ -1,141 +0,0 @@
-======================
-Using Response objects
-======================
-
-Sending a request will return a ``Guzzle\Http\Message\Response`` object. You can view the raw HTTP response message by
-casting the Response object to a string. Casting the response to a string will return the entity body of the response
-as a string too, so this might be an expensive operation if the entity body is stored in a file or network stream. If
-you only want to see the response headers, you can call ``getRawHeaders()``.
-
-Response status line
---------------------
-
-The different parts of a response's `status line `_
-(the first line of the response HTTP message) are easily retrievable.
-
-.. code-block:: php
-
- $response = $client->get('http://www.amazon.com')->send();
-
- echo $response->getStatusCode(); // >>> 200
- echo $response->getReasonPhrase(); // >>> OK
- echo $response->getProtocol(); // >>> HTTP
- echo $response->getProtocolVersion(); // >>> 1.1
-
-You can determine the type of the response using several helper methods:
-
-.. code-block:: php
-
- $response->isSuccessful(); // true
- $response->isInformational();
- $response->isRedirect();
- $response->isClientError();
- $response->isServerError();
-
-Response headers
-----------------
-
-The Response object contains helper methods for retrieving common response headers. These helper methods normalize the
-variations of HTTP response headers.
-
-.. code-block:: php
-
- $response->getCacheControl();
- $response->getContentType();
- $response->getContentLength();
- $response->getContentEncoding();
- $response->getContentMd5();
- $response->getEtag();
- // etc... There are methods for every known response header
-
-You can interact with the Response headers using the same exact methods used to interact with Request headers. See
-:ref:`http-message-headers` for more information.
-
-.. code-block:: php
-
- echo $response->getHeader('Content-Type');
- echo $response->getHeader('Content-Length');
- echo $response->getHeaders()['Content-Type']; // PHP 5.4
-
-Response body
--------------
-
-The entity body object of a response can be retrieved by calling ``$response->getBody()``. The response EntityBody can
-be cast to a string, or you can pass ``true`` to this method to retrieve the body as a string.
-
-.. code-block:: php
-
- $request = $client->get('http://www.amazon.com');
- $response = $request->send();
- echo $response->getBody();
-
-See :doc:`/http-client/entity-bodies` for more information on entity bodies.
-
-JSON Responses
-~~~~~~~~~~~~~~
-
-You can easily parse and use a JSON response as an array using the ``json()`` method of a response. This method will
-always return an array if the response is valid JSON or if the response body is empty. You will get an exception if you
-call this method and the response is not valid JSON.
-
-.. code-block:: php
-
- $data = $response->json();
- echo gettype($data);
- // >>> array
-
-XML Responses
-~~~~~~~~~~~~~
-
-You can easily parse and use a XML response as SimpleXMLElement object using the ``xml()`` method of a response. This
-method will always return a SimpleXMLElement object if the response is valid XML or if the response body is empty. You
-will get an exception if you call this method and the response is not valid XML.
-
-.. code-block:: php
-
- $xml = $response->xml();
- echo $xml->foo;
- // >>> Bar!
-
-Streaming responses
--------------------
-
-Some web services provide streaming APIs that allow a client to keep a HTTP request open for an extended period of
-time while polling and reading. Guzzle provides a simple way to convert HTTP request messages into
-``Guzzle\Stream\Stream`` objects so that you can send the initial headers of a request, read the response headers, and
-pull in the response body manually as needed.
-
-Here's an example using the Twitter Streaming API to track the keyword "bieber":
-
-.. code-block:: php
-
- use Guzzle\Http\Client;
- use Guzzle\Stream\PhpStreamRequestFactory;
-
- $client = new Client('https://stream.twitter.com/1');
-
- $request = $client->post('statuses/filter.json', null, array(
- 'track' => 'bieber'
- ));
-
- $request->setAuth('myusername', 'mypassword');
-
- $factory = new PhpStreamRequestFactory();
- $stream = $factory->fromRequest($request);
-
- // Read until the stream is closed
- while (!$stream->feof()) {
- // Read a line from the stream
- $line = $stream->readLine();
- // JSON decode the line of data
- $data = json_decode($line, true);
- }
-
-You can use the ``stream`` request option when using a static client to more easily create a streaming response.
-
-.. code-block:: php
-
- $stream = Guzzle::get('http://guzzlephp.org', array('stream' => true));
- while (!$stream->feof()) {
- echo $stream->readLine();
- }
diff --git a/lib/gerencianet/guzzle/guzzle/docs/http-client/uri-templates.rst b/lib/gerencianet/guzzle/guzzle/docs/http-client/uri-templates.rst
deleted file mode 100644
index c18ac3e..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/http-client/uri-templates.rst
+++ /dev/null
@@ -1,52 +0,0 @@
-=============
-URI templates
-=============
-
-The ``$uri`` passed to one of the client's request creational methods or the base URL of a client can utilize URI
-templates. Guzzle supports the entire `URI templates RFC `_. URI templates add a
-special syntax to URIs that replace template place holders with user defined variables.
-
-Every request created by a Guzzle HTTP client passes through a URI template so that URI template expressions are
-automatically expanded:
-
-.. code-block:: php
-
- $client = new Guzzle\Http\Client('https://example.com/', array('a' => 'hi'));
- $request = $client->get('/{a}');
-
-Because of URI template expansion, the URL of the above request will become ``https://example.com/hi``. Notice that
-the template was expanded using configuration variables of the client. You can pass in custom URI template variables
-by passing the URI of your request as an array where the first index of the array is the URI template and the second
-index of the array are template variables that are merged into the client's configuration variables.
-
-.. code-block:: php
-
- $request = $client->get(array('/test{?a,b}', array('b' => 'there')));
-
-The URL for this request will become ``https://test.com?a=hi&b=there``. URI templates aren't limited to just simple
-variable replacements; URI templates can provide an enormous amount of flexibility when creating request URIs.
-
-.. code-block:: php
-
- $request = $client->get(array('http://example.com{+path}{/segments*}{?query,data*}', array(
- 'path' => '/foo/bar',
- 'segments' => array('one', 'two'),
- 'query' => 'test',
- 'data' => array(
- 'more' => 'value'
- )
- )));
-
-The resulting URL would become ``http://example.com/foo/bar/one/two?query=test&more=value``.
-
-By default, URI template expressions are enclosed in an opening and closing brace (e.g. ``{var}``). If you are working
-with a web service that actually uses braces (e.g. Solr), then you can specify a custom regular expression to use to
-match URI template expressions.
-
-.. code-block:: php
-
- $client->getUriTemplate()->setRegex('/\<\$(.+)\>/');
- $client->get('/<$a>');
-
-You can learn about all of the different features of URI templates by reading the
-`URI templates RFC `_.
diff --git a/lib/gerencianet/guzzle/guzzle/docs/index.rst b/lib/gerencianet/guzzle/guzzle/docs/index.rst
deleted file mode 100644
index f76f3bb..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/index.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-.. title:: Guzzle | PHP HTTP client and framework for consuming RESTful web services
-.. toctree::
- :hidden:
-
- docs.rst
diff --git a/lib/gerencianet/guzzle/guzzle/docs/iterators/guzzle-iterators.rst b/lib/gerencianet/guzzle/guzzle/docs/iterators/guzzle-iterators.rst
deleted file mode 100644
index a5c7fd3..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/iterators/guzzle-iterators.rst
+++ /dev/null
@@ -1,97 +0,0 @@
-================
-Guzzle iterators
-================
-
-Guzzle provides several SPL iterators that can be used with other SPL iterators, including Guzzle resource iterators.
-Guzzle's ``guzzle/iterator`` component can also be used independently of the rest of Guzzle through Packagist and
-Composer: https://packagist.org/packages/guzzle/iterator
-
-ChunkedIterator
----------------
-
-Pulls out multiple values from an inner iterator and yields and array of values for each outer iteration -- essentially
-pulling out chunks of values from the inner iterator.
-
-.. code-block:: php
-
- use Guzzle\Iterator\ChunkedIterator;
-
- $inner = new ArrayIterator(range(0, 8));
- $chunkedIterator = new ChunkedIterator($inner, 2);
-
- foreach ($chunkedIterator as $chunk) {
- echo implode(', ', $chunk) . "\n";
- }
-
- // >>> 0, 1
- // >>> 2, 3
- // >>> 4, 5
- // >>> 6, 7
- // >>> 8
-
-FilterIterator
---------------
-
-This iterator is used to filter values out of the inner iterator. This iterator can be used when PHP 5.4's
-CallbackFilterIterator is not available.
-
-.. code-block:: php
-
- use Guzzle\Iterator\FilterIterator;
-
- $inner = new ArrayIterator(range(1, 10));
- $filterIterator = new FilterIterator($inner, function ($value) {
- return $value % 2;
- });
-
- foreach ($filterIterator as $value) {
- echo $value . "\n";
- }
-
- // >>> 2
- // >>> 4
- // >>> 6
- // >>> 8
- // >>> 10
-
-MapIterator
------------
-
-This iterator modifies the values of the inner iterator before yielding.
-
-.. code-block:: php
-
- use Guzzle\Iterator\MapIterator;
-
- $inner = new ArrayIterator(range(0, 3));
-
- $mapIterator = new MapIterator($inner, function ($value) {
- return $value * 10;
- });
-
- foreach ($mapIterator as $value) {
- echo $value . "\n";
- }
-
- // >>> 0
- // >>> 10
- // >>> 20
- // >>> 30
-
-MethodProxyIterator
--------------------
-
-This decorator is useful when you need to expose a specific method from an inner iterator that might be wrapper
-by one or more iterator decorators. This decorator proxies missing method calls to each inner iterator until one
-of the inner iterators can fulfill the call.
-
-.. code-block:: php
-
- use Guzzle\Iterator\MethodProxyIterator;
-
- $inner = new \ArrayIterator();
- $proxy = new MethodProxyIterator($inner);
-
- // Proxy method calls to the ArrayIterator
- $proxy->append('a');
- $proxy->append('b');
diff --git a/lib/gerencianet/guzzle/guzzle/docs/iterators/resource-iterators.rst b/lib/gerencianet/guzzle/guzzle/docs/iterators/resource-iterators.rst
deleted file mode 100644
index ce0bee5..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/iterators/resource-iterators.rst
+++ /dev/null
@@ -1,149 +0,0 @@
-==================
-Resource iterators
-==================
-
-Web services often implement pagination in their responses which requires the end-user to issue a series of consecutive
-requests in order to fetch all of the data they asked for. Users of your web service client should not be responsible
-for implementing the logic involved in iterating through pages of results. Guzzle provides a simple resource iterator
-foundation to make it easier on web service client developers to offer a useful abstraction layer.
-
-Getting an iterator from a client
----------------------------------
-
- ResourceIteratorInterface Guzzle\Service\Client::getIterator($command [, array $commandOptions, array $iteratorOptions ])
-
-The ``getIterator`` method of a ``Guzzle\Service\ClientInterface`` object provides a convenient interface for
-instantiating a resource iterator for a specific command. This method implicitly uses a
-``Guzzle\Service\Resource\ResourceIteratorFactoryInterface`` object to create resource iterators. Pass an
-instantiated command object or the name of a command in the first argument. When passing the name of a command, the
-command factory of the client will create the command by name using the ``$commandOptions`` array. The third argument
-may be used to pass an array of options to the constructor of the instantiated ``ResourceIteratorInterface`` object.
-
-.. code-block:: php
-
- $iterator = $client->getIterator('get_users');
-
- foreach ($iterator as $user) {
- echo $user['name'] . ' age ' . $user['age'] . PHP_EOL;
- }
-
-The above code sample might execute a single request or a thousand requests. As a consumer of a web service, I don't
-care. I just want to iterate over all of the users.
-
-Iterator options
-~~~~~~~~~~~~~~~~
-
-The two universal options that iterators should support are ``limit`` and ``page_size``. Using the ``limit`` option
-tells the resource iterator to attempt to limit the total number of iterated resources to a specific amount. Keep in
-mind that this is not always possible due to limitations that may be inherent to a web service. The ``page_size``
-option is used to tell a resource iterator how many resources to request per page of results. Much like the ``limit``
-option, you can not rely on getting back exactly the number of resources your specify in the ``page_size`` option.
-
-.. note::
-
- The ``limit`` and ``page_size`` options can also be specified on an iterator using the ``setLimit($limit)`` and
- ``setPageSize($pageSize)`` methods.
-
-Resolving iterator class names
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The default resource iterator factory of a client object expects that your iterators are stored under the ``Model``
-folder of your client and that an iterator is names after the CamelCase name of a command followed by the word
-"Iterator". For example, if you wanted to create an iterator for the ``get_users`` command, then your iterator class
-would be ``Model\GetUsersIterator`` and would be stored in ``Model/GetUsersIterator.php``.
-
-Creating an iterator
---------------------
-
-While not required, resource iterators in Guzzle typically iterate using a ``Guzzle\Service\Command\CommandInterface``
-object. ``Guzzle\Service\Resource\ResourceIterator``, the default iterator implementation that you should extend,
-accepts a command object and array of iterator options in its constructor. The command object passed to the resource
-iterator is expected to be ready to execute and not previously executed. The resource iterator keeps a reference of
-this command and clones the original command each time a subsequent request needs to be made to fetch more data.
-
-Implement the sendRequest method
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The most important thing (and usually the only thing) you need to do when creating a resource iterator is to implement
-the ``sendRequest()`` method of the resource iterator. The ``sendRequest()`` method is called when you begin
-iterating or if there are no resources left to iterate and it you expect to retrieve more resources by making a
-subsequent request. The ``$this->command`` property of the resource iterator is updated with a cloned copy of the
-original command object passed into the constructor of the iterator. Use this command object to issue your subsequent
-requests.
-
-The ``sendRequest()`` method must return an array of the resources you retrieved from making the subsequent call.
-Returning an empty array will stop the iteration. If you suspect that your web service client will occasionally return
-an empty result set but still requires further iteration, then you must implement a sort of loop in your
-``sendRequest()`` method that will continue to issue subsequent requests until your reach the end of the paginated
-result set or until additional resources are retrieved from the web service.
-
-Update the nextToken property
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Beyond fetching more results, the ``sendRequest()`` method is responsible for updating the ``$this->nextToken``
-property of the iterator. Setting this property to anything other than null tells the iterator that issuing a
-subsequent request using the nextToken value will probably return more results. You must continually update this
-value in your ``sendRequest()`` method as each response is received from the web service.
-
-Example iterator
-----------------
-
-Let's say you want to implement a resource iterator for the ``get_users`` command of your web service. The
-``get_users`` command receives a response that contains a list of users, and if there are more pages of results to
-retrieve, returns a value called ``next_user``. This return value is known as the **next token** and should be used to
-issue subsequent requests.
-
-Assume the response to a ``get_users`` command returns JSON data that looks like this:
-
-.. code-block:: javascript
-
- {
- "users": [
- { "name": "Craig Johnson", "age": 10 },
- { "name": "Tom Barker", "age": 20 },
- { "name": "Bob Mitchell", "age": 74 }
- ],
- "next_user": "Michael Dowling"
- }
-
-Assume that because there is a ``next_user`` value, there will be more users if a subsequent request is issued. If the
-``next_user`` value is missing or null, then we know there are no more results to fetch. Let's implement a resource
-iterator for this command.
-
-.. code-block:: php
-
- namespace MyService\Model;
-
- use Guzzle\Service\Resource\ResourceIterator;
-
- /**
- * Iterate over a get_users command
- */
- class GetUsersIterator extends ResourceIterator
- {
- protected function sendRequest()
- {
- // If a next token is set, then add it to the command
- if ($this->nextToken) {
- $this->command->set('next_user', $this->nextToken);
- }
-
- // Execute the command and parse the result
- $result = $this->command->execute();
-
- // Parse the next token
- $this->nextToken = isset($result['next_user']) ? $result['next_user'] : false;
-
- return $result['users'];
- }
- }
-
-As you can see, it's pretty simple to implement an iterator. There are a few things that you should notice from this
-example:
-
-1. You do not need to create a new command in the ``sendRequest()`` method. A new command object is cloned from the
- original command passed into the constructor of the iterator before the ``sendRequest()`` method is called.
- Remember that the resource iterator expects a command that has not been executed.
-2. When the ``sendRequest()`` method is first called, you will not have a ``$this->nextToken`` value, so always check
- before setting it on a command. Notice that the next token is being updated each time a request is sent.
-3. After fetching more resources from the service, always return an array of resources.
diff --git a/lib/gerencianet/guzzle/guzzle/docs/plugins/async-plugin.rst b/lib/gerencianet/guzzle/guzzle/docs/plugins/async-plugin.rst
deleted file mode 100644
index 9bd8f42..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/plugins/async-plugin.rst
+++ /dev/null
@@ -1,18 +0,0 @@
-============
-Async plugin
-============
-
-The AsyncPlugin allows you to send requests that do not wait on a response. This is handled through cURL by utilizing
-the progress event. When a request has sent all of its data to the remote server, Guzzle adds a 1ms timeout on the
-request and instructs cURL to not download the body of the response. The async plugin then catches the exception and
-adds a mock response to the request, along with an X-Guzzle-Async header to let you know that the response was not
-fully downloaded.
-
-.. code-block:: php
-
- use Guzzle\Http\Client;
- use Guzzle\Plugin\Async\AsyncPlugin;
-
- $client = new Client('http://www.example.com');
- $client->addSubscriber(new AsyncPlugin());
- $response = $client->get()->send();
diff --git a/lib/gerencianet/guzzle/guzzle/docs/plugins/backoff-plugin.rst b/lib/gerencianet/guzzle/guzzle/docs/plugins/backoff-plugin.rst
deleted file mode 100644
index 5a76941..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/plugins/backoff-plugin.rst
+++ /dev/null
@@ -1,22 +0,0 @@
-====================
-Backoff retry plugin
-====================
-
-The ``Guzzle\Plugin\Backoff\BackoffPlugin`` automatically retries failed HTTP requests using custom backoff strategies:
-
-.. code-block:: php
-
- use Guzzle\Http\Client;
- use Guzzle\Plugin\Backoff\BackoffPlugin;
-
- $client = new Client('http://www.test.com/');
- // Use a static factory method to get a backoff plugin using the exponential backoff strategy
- $backoffPlugin = BackoffPlugin::getExponentialBackoff();
-
- // Add the backoff plugin to the client object
- $client->addSubscriber($backoffPlugin);
-
-The BackoffPlugin's constructor accepts a ``Guzzle\Plugin\Backoff\BackoffStrategyInterface`` object that is used to
-determine when a retry should be issued and how long to delay between retries. The above code example shows how to
-attach a BackoffPlugin to a client that is pre-configured to retry failed 500 and 503 responses using truncated
-exponential backoff (emulating the behavior of Guzzle 2's ExponentialBackoffPlugin).
diff --git a/lib/gerencianet/guzzle/guzzle/docs/plugins/cache-plugin.rst b/lib/gerencianet/guzzle/guzzle/docs/plugins/cache-plugin.rst
deleted file mode 100644
index d2fd5df..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/plugins/cache-plugin.rst
+++ /dev/null
@@ -1,169 +0,0 @@
-=================
-HTTP Cache plugin
-=================
-
-Guzzle can leverage HTTP's caching specifications using the ``Guzzle\Plugin\Cache\CachePlugin``. The CachePlugin
-provides a private transparent proxy cache that caches HTTP responses. The caching logic, based on
-`RFC 2616 `_, uses HTTP headers to control caching behavior,
-cache lifetime, and supports Vary, ETag, and Last-Modified based revalidation:
-
-.. code-block:: php
-
- use Guzzle\Http\Client;
- use Doctrine\Common\Cache\FilesystemCache;
- use Guzzle\Cache\DoctrineCacheAdapter;
- use Guzzle\Plugin\Cache\CachePlugin;
- use Guzzle\Plugin\Cache\DefaultCacheStorage;
-
- $client = new Client('http://www.test.com/');
-
- $cachePlugin = new CachePlugin(array(
- 'storage' => new DefaultCacheStorage(
- new DoctrineCacheAdapter(
- new FilesystemCache('/path/to/cache/files')
- )
- )
- ));
-
- // Add the cache plugin to the client object
- $client->addSubscriber($cachePlugin);
- $client->get('http://www.wikipedia.org/')->send();
-
- // The next request will revalidate against the origin server to see if it
- // has been modified. If a 304 response is received the response will be
- // served from cache
- $client->get('http://www.wikipedia.org/')->send();
-
-The cache plugin intercepts GET and HEAD requests before they are actually transferred to the origin server. The cache
-plugin then generates a hash key based on the request method and URL, and checks to see if a response exists in the cache. If
-a response exists in the cache, the cache adapter then checks to make sure that the caching rules associated with the response
-satisfy the request, and ensures that response still fresh. If the response is acceptable for the request any required
-revalidation, then the cached response is served instead of contacting the origin server.
-
-Vary
-----
-
-Cache keys are derived from a request method and a request URL. Multiple responses can map to the same cache key and
-stored in Guzzle's underlying cache storage object. You should use the ``Vary`` HTTP header to tell the cache storage
-object that the cache response must have been cached for a request that matches the headers specified in the Vary header
-of the request. This allows you to have specific cache entries for the same request URL but variations in a request's
-headers determine which cache entry is served. Please see the http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44
-for more information.
-
-Cache options
--------------
-
-There are several options you can add to requests or clients to modify the behavior of the cache plugin.
-
-Override cache TTL
-~~~~~~~~~~~~~~~~~~
-
-You can override the number of seconds a cacheable response is stored in the cache by setting the
-``cache.override_ttl`` parameter on the params object of a request:
-
-.. code-block:: php
-
- // If the response to the request is cacheable, then the response will be cached for 100 seconds
- $request->getParams()->set('cache.override_ttl', 100);
-
-If a response doesn't specify any freshness policy, it will be kept in cache for 3600 seconds by default.
-
-Custom caching decision
-~~~~~~~~~~~~~~~~~~~~~~~
-
-If the service you are interacting with does not return caching headers or returns responses that are normally
-something that would not be cached, you can set a custom ``can_cache`` object on the constructor of the CachePlugin
-and provide a ``Guzzle\Plugin\Cache\CanCacheInterface`` object. You can use the
-``Guzzle\Plugin\Cache\CallbackCanCacheStrategy`` to easily make a caching decision based on an HTTP request and
-response.
-
-Revalidation options
-~~~~~~~~~~~~~~~~~~~~
-
-You can change the revalidation behavior of a request using the ``cache.revalidate`` parameter. Setting this
-parameter to ``never`` will ensure that a revalidation request is never sent, and the response is always served from
-the origin server. Setting this parameter to ``skip`` will never revalidate and uses the response stored in the cache.
-
-Normalizing requests for caching
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Use the ``cache.key_filter`` parameter if you wish to strip certain query string parameters from your
-request before creating a unique hash for the request. This parameter can be useful if your requests have query
-string values that cause each request URL to be unique (thus preventing a cache hit). The ``cache.key_filter``
-format is simply a comma separated list of query string values to remove from the URL when creating a cache key.
-For example, here we are saying that the ``a`` and ``q`` query string variables should be ignored when generating a
-cache key for the request:
-
-.. code-block:: php
-
- $request->getParams()->set('cache.key_filter', 'a, q');
-
-Other options
-~~~~~~~~~~~~~
-
-There are many other options available to the CachePlugin that can meet almost any caching requirement, including
-custom revalidation implementations, custom cache key generators, custom caching decision strategies, and custom
-cache storage objects. Take a look the constructor of ``Guzzle\Plugin\Cache\CachePlugin`` for more information.
-
-Setting Client-wide cache settings
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You can specify cache settings for every request created by a client by adding cache settings to the configuration
-options of a client.
-
-.. code-block:: php
-
- $client = new Guzzle\Http\Client('http://www.test.com', array(
- 'request.params' => array(
- 'cache.override_ttl' => 3600,
- 'params.cache.revalidate' => 'never'
- )
- ));
-
- echo $client->get('/')->getParams()->get('cache.override_ttl');
- // >>> 3600
-
- echo $client->get('/')->getParams()->get('cache.revalidate');
- // >>> never
-
-Cache revalidation
-------------------
-
-If the cache plugin determines that a response to a GET request needs revalidation, a conditional GET is transferred
-to the origin server. If the origin server returns a 304 response, then a response containing the merged headers of
-the cached response with the new response and the entity body of the cached response is returned. Custom revalidation
-strategies can be injected into a CachePlugin if needed.
-
-Cache adapters
---------------
-
-Guzzle doesn't try to reinvent the wheel when it comes to caching or logging. Plenty of other frameworks have
-excellent solutions in place that you are probably already using in your applications. Guzzle uses adapters for
-caching and logging. The cache plugin requires a cache adapter so that is can store responses in a cache. Guzzle
-currently supports cache adapters for `Doctrine 2.0 `_ and the
-`Zend Framework `_.
-
-Doctrine cache adapter
-~~~~~~~~~~~~~~~~~~~~~~
-
-.. code-block:: php
-
- use Doctrine\Common\Cache\ArrayCache;
- use Guzzle\Cache\DoctrineCacheAdapter;
- use Guzzle\Plugin\Cache\CachePlugin;
-
- $backend = new ArrayCache();
- $adapter = new DoctrineCacheAdapter($backend);
- $cache = new CachePlugin($adapter);
-
-Zend Framework cache adapter
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-.. code-block:: php
-
- use Guzzle\Cache\ZendCacheAdapter;
- use Zend\Cache\Backend\TestBackend;
-
- $backend = new TestBackend();
- $adapter = new ZendCacheAdapter($backend);
- $cache = new CachePlugin($adapter);
diff --git a/lib/gerencianet/guzzle/guzzle/docs/plugins/cookie-plugin.rst b/lib/gerencianet/guzzle/guzzle/docs/plugins/cookie-plugin.rst
deleted file mode 100644
index a6cc7d9..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/plugins/cookie-plugin.rst
+++ /dev/null
@@ -1,33 +0,0 @@
-=============
-Cookie plugin
-=============
-
-Some web services require a Cookie in order to maintain a session. The ``Guzzle\Plugin\Cookie\CookiePlugin`` will add
-cookies to requests and parse cookies from responses using a CookieJar object:
-
-.. code-block:: php
-
- use Guzzle\Http\Client;
- use Guzzle\Plugin\Cookie\CookiePlugin;
- use Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar;
-
- $cookiePlugin = new CookiePlugin(new ArrayCookieJar());
-
- // Add the cookie plugin to a client
- $client = new Client('http://www.test.com/');
- $client->addSubscriber($cookiePlugin);
-
- // Send the request with no cookies and parse the returned cookies
- $client->get('http://www.yahoo.com/')->send();
-
- // Send the request again, noticing that cookies are being sent
- $request = $client->get('http://www.yahoo.com/');
- $request->send();
-
- echo $request;
-
-You can disable cookies per-request by setting the ``cookies.disable`` value to true on a request's params object.
-
-.. code-block:: php
-
- $request->getParams()->set('cookies.disable', true);
diff --git a/lib/gerencianet/guzzle/guzzle/docs/plugins/creating-plugins.rst b/lib/gerencianet/guzzle/guzzle/docs/plugins/creating-plugins.rst
deleted file mode 100644
index 0870155..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/plugins/creating-plugins.rst
+++ /dev/null
@@ -1,93 +0,0 @@
-================
-Creating plugins
-================
-
-.. highlight:: php
-
-Guzzle is extremely extensible because of the behavioral modifications that can be added to requests, clients, and
-commands using an event system. Before and after the majority of actions are taken in the library, an event is emitted
-with the name of the event and context surrounding the event. Observers can subscribe to a subject and modify the
-subject based on the events received. Guzzle's event system utilizes the Symfony2 EventDispatcher and is the backbone
-of its plugin architecture.
-
-Overview
---------
-
-Plugins must implement the ``Symfony\Component\EventDispatcher\EventSubscriberInterface`` interface. The
-``EventSubscriberInterface`` requires that your class implements a static method, ``getSubscribedEvents()``, that
-returns an associative array mapping events to methods on the object. See the
-`Symfony2 documentation `_ for more information.
-
-Plugins can be attached to any subject, or object in Guzzle that implements that
-``Guzzle\Common\HasDispatcherInterface``.
-
-Subscribing to a subject
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-You can subscribe an instantiated observer to an event by calling ``addSubscriber`` on a subject.
-
-.. code-block:: php
-
- $testPlugin = new TestPlugin();
- $client->addSubscriber($testPlugin);
-
-You can also subscribe to only specific events using a closure::
-
- $client->getEventDispatcher()->addListener('request.create', function(Event $event) {
- echo $event->getName();
- echo $event['request'];
- });
-
-``Guzzle\Common\Event`` objects are passed to notified functions. The Event object has a ``getName()`` method which
-return the name of the emitted event and may contain contextual information that can be accessed like an array.
-
-Knowing what events to listen to
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Any class that implements the ``Guzzle\Common\HasDispatcherInterface`` must implement a static method,
-``getAllEvents()``, that returns an array of the events that are emitted from the object. You can browse the source
-to see each event, or you can call the static method directly in your code to get a list of available events.
-
-Event hooks
------------
-
-* :ref:`client-events`
-* :ref:`service-client-events`
-* :ref:`request-events`
-* ``Guzzle\Http\Curl\CurlMulti``:
-* :ref:`service-builder-events`
-
-Examples of the event system
-----------------------------
-
-Simple Echo plugin
-~~~~~~~~~~~~~~~~~~
-
-This simple plugin prints a string containing the request that is about to be sent by listening to the
-``request.before_send`` event::
-
- use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-
- class EchoPlugin implements EventSubscriberInterface
- {
- public static function getSubscribedEvents()
- {
- return array('request.before_send' => 'onBeforeSend');
- }
-
- public function onBeforeSend(Guzzle\Common\Event $event)
- {
- echo 'About to send a request: ' . $event['request'] . "\n";
- }
- }
-
- $client = new Guzzle\Service\Client('http://www.test.com/');
-
- // Create the plugin and add it as an event subscriber
- $plugin = new EchoPlugin();
- $client->addSubscriber($plugin);
-
- // Send a request and notice that the request is printed to the screen
- $client->get('/')->send();
-
-Running the above code will print a string containing the HTTP request that is about to be sent.
diff --git a/lib/gerencianet/guzzle/guzzle/docs/plugins/curl-auth-plugin.rst b/lib/gerencianet/guzzle/guzzle/docs/plugins/curl-auth-plugin.rst
deleted file mode 100644
index 66d4a01..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/plugins/curl-auth-plugin.rst
+++ /dev/null
@@ -1,32 +0,0 @@
-==========================
-cURL authentication plugin
-==========================
-
-.. warning::
-
- The CurlAuthPlugin is deprecated. You should use the `auth` parameter of a client to add authorization headers to
- every request created by a client.
-
- .. code-block:: php
-
- $client->setDefaultOption('auth', array('username', 'password', 'Basic|Digest|NTLM|Any'));
-
-If your web service client requires basic authorization, then you can use the CurlAuthPlugin to easily add an
-Authorization header to each request sent by the client.
-
-.. code-block:: php
-
- use Guzzle\Http\Client;
- use Guzzle\Plugin\CurlAuth\CurlAuthPlugin;
-
- $client = new Client('http://www.test.com/');
-
- // Add the auth plugin to the client object
- $authPlugin = new CurlAuthPlugin('username', 'password');
- $client->addSubscriber($authPlugin);
-
- $response = $client->get('projects/1/people')->send();
- $xml = new SimpleXMLElement($response->getBody(true));
- foreach ($xml->person as $person) {
- echo $person->email . "\n";
- }
diff --git a/lib/gerencianet/guzzle/guzzle/docs/plugins/history-plugin.rst b/lib/gerencianet/guzzle/guzzle/docs/plugins/history-plugin.rst
deleted file mode 100644
index b96befe..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/plugins/history-plugin.rst
+++ /dev/null
@@ -1,24 +0,0 @@
-==============
-History plugin
-==============
-
-The history plugin tracks all of the requests and responses sent through a request or client. This plugin can be
-useful for crawling or unit testing. By default, the history plugin stores up to 10 requests and responses.
-
-.. code-block:: php
-
- use Guzzle\Http\Client;
- use Guzzle\Plugin\History\HistoryPlugin;
-
- $client = new Client('http://www.test.com/');
-
- // Add the history plugin to the client object
- $history = new HistoryPlugin();
- $history->setLimit(5);
- $client->addSubscriber($history);
-
- $client->get('http://www.yahoo.com/')->send();
-
- echo $history->getLastRequest();
- echo $history->getLastResponse();
- echo count($history);
diff --git a/lib/gerencianet/guzzle/guzzle/docs/plugins/log-plugin.rst b/lib/gerencianet/guzzle/guzzle/docs/plugins/log-plugin.rst
deleted file mode 100644
index 3e2b229..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/plugins/log-plugin.rst
+++ /dev/null
@@ -1,69 +0,0 @@
-==========
-Log plugin
-==========
-
-Use the ``Guzzle\Plugin\Log\LogPlugin`` to view all data sent over the wire, including entity bodies and redirects.
-
-.. code-block:: php
-
- use Guzzle\Http\Client;
- use Guzzle\Log\Zf1LogAdapter;
- use Guzzle\Plugin\Log\LogPlugin;
- use Guzzle\Log\MessageFormatter;
-
- $client = new Client('http://www.test.com/');
-
- $adapter = new Zf1LogAdapter(
- new \Zend_Log(new \Zend_Log_Writer_Stream('php://output'))
- );
- $logPlugin = new LogPlugin($adapter, MessageFormatter::DEBUG_FORMAT);
-
- // Attach the plugin to the client, which will in turn be attached to all
- // requests generated by the client
- $client->addSubscriber($logPlugin);
-
- $response = $client->get('http://google.com')->send();
-
-The code sample above wraps a ``Zend_Log`` object using a ``Guzzle\Log\Zf1LogAdapter``. After attaching the plugin to
-the client, all data sent over the wire will be logged to stdout.
-
-The first argument of the LogPlugin's constructor accepts a ``Guzzle\Log\LogAdapterInterface`` object. This object is
-an adapter that allows you to use the logging capabilities of your favorite log implementation. The second argument of
-the constructor accepts a ``Guzzle\Log\MessageFormatter`` or a log messaged format string. The format string uses
-variable substitution and allows you to define the log data that is important to your application. The different
-variables that can be injected are as follows:
-
-================== ====================================================================================
-Variable Substitution
-================== ====================================================================================
-{request} Full HTTP request message
-{response} Full HTTP response message
-{ts} Timestamp
-{host} Host of the request
-{method} Method of the request
-{url} URL of the request
-{host} Host of the request
-{protocol} Request protocol
-{version} Protocol version
-{resource} Resource of the request (path + query + fragment)
-{port} Port of the request
-{hostname} Hostname of the machine that sent the request
-{code} Status code of the response (if available)
-{phrase} Reason phrase of the response (if available)
-{curl_error} Curl error message (if available)
-{curl_code} Curl error code (if available)
-{curl_stderr} Curl standard error (if available)
-{connect_time} Time in seconds it took to establish the connection (if available)
-{total_time} Total transaction time in seconds for last transfer (if available)
-{req_header_*} Replace `*` with the lowercased name of a request header to add to the message
-{res_header_*} Replace `*` with the lowercased name of a response header to add to the message
-{req_body} Request body
-{res_body} Response body
-================== ====================================================================================
-
-The LogPlugin has a helper method that can be used when debugging that will output the full HTTP request and
-response of a transaction:
-
-.. code-block:: php
-
- $client->addSubscriber(LogPlugin::getDebugPlugin());
diff --git a/lib/gerencianet/guzzle/guzzle/docs/plugins/md5-validator-plugin.rst b/lib/gerencianet/guzzle/guzzle/docs/plugins/md5-validator-plugin.rst
deleted file mode 100644
index 1b1cfa8..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/plugins/md5-validator-plugin.rst
+++ /dev/null
@@ -1,29 +0,0 @@
-====================
-MD5 validator plugin
-====================
-
-Entity bodies can sometimes be modified over the wire due to a faulty TCP transport or misbehaving proxy. If an HTTP
-response contains a Content-MD5 header, then a MD5 hash of the entity body of a response can be compared against the
-Content-MD5 header of the response to determine if the response was delivered intact. The
-``Guzzle\Plugin\Md5\Md5ValidatorPlugin`` will throw an ``UnexpectedValueException`` if the calculated MD5 hash does
-not match the Content-MD5 header value:
-
-.. code-block:: php
-
- use Guzzle\Http\Client;
- use Guzzle\Plugin\Md5\Md5ValidatorPlugin;
-
- $client = new Client('http://www.test.com/');
-
- $md5Plugin = new Md5ValidatorPlugin();
-
- // Add the md5 plugin to the client object
- $client->addSubscriber($md5Plugin);
-
- $request = $client->get('http://www.yahoo.com/');
- $request->send();
-
-Calculating the MD5 hash of a large entity body or an entity body that was transferred using a Content-Encoding is an
-expensive operation. When working in high performance applications, you might consider skipping the MD5 hash
-validation for entity bodies bigger than a certain size or Content-Encoded entity bodies
-(see ``Guzzle\Plugin\Md5\Md5ValidatorPlugin`` for more information).
diff --git a/lib/gerencianet/guzzle/guzzle/docs/plugins/mock-plugin.rst b/lib/gerencianet/guzzle/guzzle/docs/plugins/mock-plugin.rst
deleted file mode 100644
index 4900cb5..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/plugins/mock-plugin.rst
+++ /dev/null
@@ -1,27 +0,0 @@
-===========
-Mock plugin
-===========
-
-The mock plugin is useful for testing Guzzle clients. The mock plugin allows you to queue an array of responses that
-will satisfy requests sent from a client by consuming the request queue in FIFO order.
-
-.. code-block:: php
-
- use Guzzle\Http\Client;
- use Guzzle\Plugin\Mock\MockPlugin;
- use Guzzle\Http\Message\Response;
-
- $client = new Client('http://www.test.com/');
-
- $mock = new MockPlugin();
- $mock->addResponse(new Response(200))
- ->addResponse(new Response(404));
-
- // Add the mock plugin to the client object
- $client->addSubscriber($mock);
-
- // The following request will receive a 200 response from the plugin
- $client->get('http://www.example.com/')->send();
-
- // The following request will receive a 404 response from the plugin
- $client->get('http://www.test.com/')->send();
diff --git a/lib/gerencianet/guzzle/guzzle/docs/plugins/oauth-plugin.rst b/lib/gerencianet/guzzle/guzzle/docs/plugins/oauth-plugin.rst
deleted file mode 100644
index e67eaba..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/plugins/oauth-plugin.rst
+++ /dev/null
@@ -1,30 +0,0 @@
-============
-OAuth plugin
-============
-
-Guzzle ships with an OAuth 1.0 plugin that can sign requests using a consumer key, consumer secret, OAuth token,
-and OAuth secret. Here's an example showing how to send an authenticated request to the Twitter REST API:
-
-.. code-block:: php
-
- use Guzzle\Http\Client;
- use Guzzle\Plugin\Oauth\OauthPlugin;
-
- $client = new Client('http://api.twitter.com/1');
- $oauth = new OauthPlugin(array(
- 'consumer_key' => 'my_key',
- 'consumer_secret' => 'my_secret',
- 'token' => 'my_token',
- 'token_secret' => 'my_token_secret'
- ));
- $client->addSubscriber($oauth);
-
- $response = $client->get('statuses/public_timeline.json')->send();
-
-If you need to use a custom signing method, you can pass a ``signature_method`` configuration option in the
-constructor of the OAuth plugin. The ``signature_method`` option must be a callable variable that accepts a string to
-sign and signing key and returns a signed string.
-
-.. note::
-
- You can omit the ``token`` and ``token_secret`` options to use two-legged OAuth.
diff --git a/lib/gerencianet/guzzle/guzzle/docs/plugins/plugins-list.rst.inc b/lib/gerencianet/guzzle/guzzle/docs/plugins/plugins-list.rst.inc
deleted file mode 100644
index 8d6d09b..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/plugins/plugins-list.rst.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-* :doc:`/plugins/async-plugin`
-* :doc:`/plugins/backoff-plugin`
-* :doc:`/plugins/cache-plugin`
-* :doc:`/plugins/cookie-plugin`
-* :doc:`/plugins/history-plugin`
-* :doc:`/plugins/log-plugin`
-* :doc:`/plugins/md5-validator-plugin`
-* :doc:`/plugins/mock-plugin`
-* :doc:`/plugins/oauth-plugin`
diff --git a/lib/gerencianet/guzzle/guzzle/docs/plugins/plugins-overview.rst b/lib/gerencianet/guzzle/guzzle/docs/plugins/plugins-overview.rst
deleted file mode 100644
index 19ae57e..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/plugins/plugins-overview.rst
+++ /dev/null
@@ -1,59 +0,0 @@
-======================
-Plugin system overview
-======================
-
-The workflow of sending a request and parsing a response is driven by Guzzle's event system, which is powered by the
-`Symfony2 Event Dispatcher component `_.
-
-Any object in Guzzle that emits events will implement the ``Guzzle\Common\HasEventDispatcher`` interface. You can add
-event subscribers directly to these objects using the ``addSubscriber()`` method, or you can grab the
-``Symfony\Component\EventDispatcher\EventDispatcher`` object owned by the object using ``getEventDispatcher()`` and
-add a listener or event subscriber.
-
-Adding event subscribers to clients
------------------------------------
-
-Any event subscriber or event listener attached to the EventDispatcher of a ``Guzzle\Http\Client`` or
-``Guzzle\Service\Client`` object will automatically be attached to all request objects created by the client. This
-allows you to attach, for example, a HistoryPlugin to a client object, and from that point on, every request sent
-through that client will utilize the HistoryPlugin.
-
-.. code-block:: php
-
- use Guzzle\Plugin\History\HistoryPlugin;
- use Guzzle\Service\Client;
-
- $client = new Client();
-
- // Create a history plugin and attach it to the client
- $history = new HistoryPlugin();
- $client->addSubscriber($history);
-
- // Create and send a request. This request will also utilize the HistoryPlugin
- $client->get('http://httpbin.org')->send();
-
- // Echo out the last sent request by the client
- echo $history->getLastRequest();
-
-.. tip::
-
- :doc:`Create event subscribers `, or *plugins*, to implement reusable logic that can be
- shared across clients. Event subscribers are also easier to test than anonymous functions.
-
-Pre-Built plugins
------------------
-
-Guzzle provides easy to use request plugins that add behavior to requests based on signal slot event notifications
-powered by the Symfony2 Event Dispatcher component.
-
-* :doc:`async-plugin`
-* :doc:`backoff-plugin`
-* :doc:`cache-plugin`
-* :doc:`cookie-plugin`
-* :doc:`curl-auth-plugin`
-* :doc:`history-plugin`
-* :doc:`log-plugin`
-* :doc:`md5-validator-plugin`
-* :doc:`mock-plugin`
-* :doc:`oauth-plugin`
-
diff --git a/lib/gerencianet/guzzle/guzzle/docs/requirements.txt b/lib/gerencianet/guzzle/guzzle/docs/requirements.txt
deleted file mode 100644
index f62e318..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/requirements.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Sphinx>=1.2b1
-guzzle_sphinx_theme>=0.5.0
diff --git a/lib/gerencianet/guzzle/guzzle/docs/testing/unit-testing.rst b/lib/gerencianet/guzzle/guzzle/docs/testing/unit-testing.rst
deleted file mode 100644
index f4297af..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/testing/unit-testing.rst
+++ /dev/null
@@ -1,201 +0,0 @@
-===========================
-Unit Testing Guzzle clients
-===========================
-
-Guzzle provides several tools that will enable you to easily unit test your web service clients.
-
-* PHPUnit integration
-* Mock responses
-* node.js web server for integration testing
-
-PHPUnit integration
--------------------
-
-Guzzle is unit tested using `PHPUnit `_. Your web service client's unit tests should extend
-``Guzzle\Tests\GuzzleTestCase`` so that you can take advantage of some of the built in helpers.
-
-In order to unit test your client, a developer would need to copy phpunit.xml.dist to phpunit.xml and make any needed
-modifications. As a best practice and security measure for you and your contributors, it is recommended to add an
-ignore statement to your SCM so that phpunit.xml is ignored.
-
-Bootstrapping
-~~~~~~~~~~~~~
-
-Your web service client should have a tests/ folder that contains a bootstrap.php file. The bootstrap.php file
-responsible for autoloading and configuring a ``Guzzle\Service\Builder\ServiceBuilder`` that is used throughout your
-unit tests for loading a configured client. You can add custom parameters to your phpunit.xml file that expects users
-to provide the path to their configuration data.
-
-.. code-block:: php
-
- Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Aws\Common\Aws::factory($_SERVER['CONFIG']));
-
- Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array(
- 'test.unfuddle' => array(
- 'class' => 'Guzzle.Unfuddle.UnfuddleClient',
- 'params' => array(
- 'username' => 'test_user',
- 'password' => '****',
- 'subdomain' => 'test'
- )
- )
- )));
-
-The above code registers a service builder that can be used throughout your unit tests. You would then be able to
-retrieve an instantiated and configured Unfuddle client by calling ``$this->getServiceBuilder()->get('test.unfuddle)``.
-The above code assumes that ``$_SERVER['CONFIG']`` contains the path to a file that stores service description
-configuration.
-
-Unit testing remote APIs
-------------------------
-
-Mock responses
-~~~~~~~~~~~~~~
-
-One of the benefits of unit testing is the ability to quickly determine if there are errors in your code. If your
-unit tests run slowly, then they become tedious and will likely be run less frequently. Guzzle's philosophy on unit
-testing web service clients is that no network access should be required to run the unit tests. This means that
-responses are served from mock responses or local servers. By adhering to this principle, tests will run much faster
-and will not require an external resource to be available. The problem with this approach is that your mock responses
-must first be gathered and then subsequently updated each time the remote API changes.
-
-Integration testing over the internet
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You can perform integration testing with a web service over the internet by making calls directly to the service. If
-the web service you are requesting uses a complex signing algorithm or some other specific implementation, then you
-may want to include at least one actual network test that can be run specifically through the command line using
-`PHPUnit group annotations `_.
-
-@group internet annotation
-^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-When creating tests that require an internet connection, it is recommended that you add ``@group internet`` annotations
-to your unit tests to specify which tests require network connectivity.
-
-You can then `run PHPUnit tests `_ that exclude the @internet
-group by running ``phpunit --exclude-group internet``.
-
-API credentials
-^^^^^^^^^^^^^^^
-
-If API credentials are required to run your integration tests, you must add ```` parameters to your
-phpunit.xml.dist file and extract these parameters in your bootstrap.php file.
-
-.. code-block:: xml
-
-
-
-
-
-
-
-
-
-
-
-
- ./Tests
-
-
-
-
-You can then extract the ``server`` variables in your bootstrap.php file by grabbing them from the ``$_SERVER``
-superglobal: ``$apiUser = $_SERVER['API_USER'];``
-
-Further reading
-^^^^^^^^^^^^^^^
-
-A good discussion on the topic of testing remote APIs can be found in Sebastian Bergmann's
-`Real-World Solutions for Developing High-Quality PHP Frameworks and Applications `_.
-
-Queueing Mock responses
------------------------
-
-Mock responses can be used to test if requests are being generated correctly and responses and handled correctly by
-your client. Mock responses can be queued up for a client using the ``$this->setMockResponse($client, $path)`` method
-of your test class. Pass the client you are adding mock responses to and a single path or array of paths to mock
-response files relative to the ``/tests/mock/ folder``. This will queue one or more mock responses for your client by
-creating a simple observer on the client. Mock response files must contain a full HTTP response message:
-
-.. code-block:: none
-
- HTTP/1.1 200 OK
- Date: Wed, 25 Nov 2009 12:00:00 GMT
- Connection: close
- Server: AmazonS3
- Content-Type: application/xml
-
-
- EU
-
-After queuing mock responses for a client, you can get an array of the requests that were sent by the client that
-were issued a mock response by calling ``$this->getMockedRequests()``.
-
-You can also use the ``Guzzle\Plugin\Mock\MockPlugin`` object directly with your clients.
-
-.. code-block:: php
-
- $plugin = new Guzzle\Plugin\Mock\MockPlugin();
- $plugin->addResponse(new Guzzle\Http\Message\Response(200));
- $client = new Guzzle\Http\Client();
- $client->addSubscriber($plugin);
-
- // The following request will get the mock response from the plugin in FIFO order
- $request = $client->get('http://www.test.com/');
- $request->send();
-
- // The MockPlugin maintains a list of requests that were mocked
- $this->assertContainsOnly($request, $plugin->getReceivedRequests());
-
-node.js web server for integration testing
-------------------------------------------
-
-Using mock responses is usually enough when testing a web service client. If your client needs to add custom cURL
-options to requests, then you should use the node.js test web server to ensure that your HTTP request message is
-being created correctly.
-
-Guzzle is based around PHP's libcurl bindings. cURL sometimes modifies an HTTP request message based on
-``CURLOPT_*`` options. Headers that are added to your request by cURL will not be accounted for if you inject mock
-responses into your tests. Additionally, some request entity bodies cannot be loaded by the client before transmitting
-it to the sever (for example, when using a client as a sort of proxy and streaming content from a remote server). You
-might also need to inspect the entity body of a ``multipart/form-data`` POST request.
-
-.. note::
-
- You can skip all of the tests that require the node.js test web server by excluding the ``server`` group:
- ``phpunit --exclude-group server``
-
-Using the test server
-~~~~~~~~~~~~~~~~~~~~~
-
-The node.js test server receives requests and returns queued responses. The test server exposes a simple API that is
-used to enqueue responses and inspect the requests that it has received.
-
-Retrieve the server object by calling ``$this->getServer()``. If the node.js server is not running, it will be
-started as a forked process and an object that interfaces with the server will be returned. (note: stopping the
-server is handled internally by Guzzle.)
-
-You can queue an HTTP response or an array of responses by calling ``$this->getServer()->enqueue()``:
-
-.. code-block:: php
-
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
-
-The above code queues a single 200 response with an empty body. Responses are queued using a FIFO order; this
-response will be returned by the server when it receives the first request and then removed from the queue. If a
-request is received by a server with no queued responses, an exception will be thrown in your unit test.
-
-You can inspect the requests that the server has retrieved by calling ``$this->getServer()->getReceivedRequests()``.
-This method accepts an optional ``$hydrate`` parameter that specifies if you are retrieving an array of string HTTP
-requests or an array of ``Guzzle\Http\RequestInterface`` subclassed objects. "Hydrating" the requests will allow
-greater flexibility in your unit tests so that you can easily assert the state of the various parts of a request.
-
-You will need to modify the base_url of your web service client in order to use it against the test server.
-
-.. code-block:: php
-
- $client = $this->getServiceBuilder()->get('my_client');
- $client->setBaseUrl($this->getServer()->getUrl());
-
-After running the above code, all calls made from the ``$client`` object will be sent to the test web server.
diff --git a/lib/gerencianet/guzzle/guzzle/docs/webservice-client/guzzle-service-descriptions.rst b/lib/gerencianet/guzzle/guzzle/docs/webservice-client/guzzle-service-descriptions.rst
deleted file mode 100644
index ad6070b..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/webservice-client/guzzle-service-descriptions.rst
+++ /dev/null
@@ -1,619 +0,0 @@
-===========================
-Guzzle service descriptions
-===========================
-
-Guzzle allows you to serialize HTTP requests and parse HTTP responses using a DSL called a service descriptions.
-Service descriptions define web service APIs by documenting each operation, the operation's parameters, validation
-options for each parameter, an operation's response, how the response is parsed, and any errors that can be raised for
-an operation. Writing a service description for a web service allows you to more quickly consume a web service than
-writing concrete commands for each web service operation.
-
-Guzzle service descriptions can be representing using a PHP array or JSON document. Guzzle's service descriptions are
-heavily inspired by `Swagger `_.
-
-Service description schema
-==========================
-
-A Guzzle Service description must match the following JSON schema document. This document can also serve as a guide when
-implementing a Guzzle service description.
-
-Download the schema here: :download:`Guzzle JSON schema document `
-
-.. class:: overflow-height-500px
-
- .. literalinclude:: ../_downloads/guzzle-schema-1.0.json
- :language: json
-
-Top-level attributes
---------------------
-
-Service descriptions are comprised of the following top-level attributes:
-
-.. code-block:: json
-
- {
- "name": "string",
- "apiVersion": "string|number",
- "baseUrl": "string",
- "description": "string",
- "operations": {},
- "models": {},
- "includes": ["string.php", "string.json"]
- }
-
-+-----------------------------------------+-------------------------+-----------------------------------------------------------------------------------------------------------------------+
-| Property Name | Value | Description |
-+=========================================+=========================+=======================================================================================================================+
-| name | string | Name of the web service |
-+-----------------------------------------+-------------------------+-----------------------------------------------------------------------------------------------------------------------+
-| apiVersion | string|number | Version identifier that the service description is compatible with |
-+-----------------------------------------+-------------------------+-----------------------------------------------------------------------------------------------------------------------+
-| baseUrl or basePath | string | Base URL of the web service. Any relative URI specified in an operation will be merged with the baseUrl using the |
-| | | process defined in RFC 2396. Some clients require custom logic to determine the baseUrl. In those cases, it is best |
-| | | to not include a baseUrl in the service description, but rather allow the factory method of the client to configure |
-| | | the client’s baseUrl. |
-+-----------------------------------------+-------------------------+-----------------------------------------------------------------------------------------------------------------------+
-| description | string | Short summary of the web service |
-+-----------------------------------------+-------------------------+-----------------------------------------------------------------------------------------------------------------------+
-| operations | object containing | Operations of the service. The key is the name of the operation and value is the attributes of the operation. |
-| | :ref:`operation-schema` | |
-| | | |
-+-----------------------------------------+-------------------------+-----------------------------------------------------------------------------------------------------------------------+
-| models | object containing | Schema models that can be referenced throughout the service description. Models can be used to define how an HTTP |
-| | :ref:`model-schema` | response is parsed into a ``Guzzle\Service\Resource\Model`` object when an operation uses a ``model`` ``responseType``|
-+-----------------------------------------+-------------------------+-----------------------------------------------------------------------------------------------------------------------+
-| includes | array of .js, | Service description files to include and extend from (can be a .json, .js, or .php file) |
-| | .json, or .php | |
-| | files. | |
-+-----------------------------------------+-------------------------+-----------------------------------------------------------------------------------------------------------------------+
-| (any additional properties) | mixed | Any additional properties specified as top-level attributes are allowed and will be treated as arbitrary data |
-+-----------------------------------------+-------------------------+-----------------------------------------------------------------------------------------------------------------------+
-
-.. _operation-schema:
-
-Operations
-----------
-
-Operations are the actions that can be taken on a service. Each operation is given a unique name and has a distinct
-endpoint and HTTP method. If an API has a ``DELETE /users/:id`` operation, a satisfactory operation name might be
-``DeleteUser`` with a parameter of ``id`` that is inserted into the URI.
-
-.. class:: overflow-height-250px
-
- .. code-block:: json
-
- {
- "operations": {
- "operationName": {
- "extends": "string",
- "httpMethod": "GET|POST|PUT|DELETE|PATCH|string",
- "uri": "string",
- "summary": "string",
- "class": "string",
- "responseClass": "string",
- "responseNotes": "string",
- "type": "string",
- "description": "string",
- "responseType": "primitive|class|(model by name)|documentation|(string)",
- "deprecated": false,
- "errorResponses": [
- {
- "code": 500,
- "reason": "Unexpected Error",
- "class": "string"
- }
- ],
- "data": {
- "foo": "bar",
- "baz": "bam"
- },
- "parameters": {}
- }
- }
- }
-
-.. csv-table::
- :header: "Property Name", "Value", "Description"
- :widths: 20, 15, 65
-
- "extends", "string", "Extend from another operation by name. The parent operation must be defined before the child."
- "httpMethod", "string", "HTTP method used with the operation (e.g. GET, POST, PUT, DELETE, PATCH, etc)"
- "uri", "string", "URI of the operation. The uri attribute can contain URI templates. The variables of the URI template are parameters of the operation with a location value of uri"
- "summary", "string", "Short summary of what the operation does"
- "class", "string", "Custom class to instantiate instead of the default Guzzle\\Service\\Command\\OperationCommand. Using this attribute allows you to define an operation using a service description, but allows more customized logic to be implemented in user-land code."
- "responseClass", "string", "Defined what is returned from the method. Can be a primitive, class name, or model name. You can specify the name of a class to return a more customized result from the operation (for example, a domain model object). When using the name of a PHP class, the class must implement ``Guzzle\Service\Command\ResponseClassInterface``."
- "responseNotes", "string", "A description of the response returned by the operation"
- "responseType", "string", "The type of response that the operation creates: one of primitive, class, model, or documentation. If not specified, this value will be automatically inferred based on whether or not there is a model matching the name, if a matching class name is found, or set to 'primitive' by default."
- "deprecated", "boolean", "Whether or not the operation is deprecated"
- "errorResponses", "array", "Errors that could occur while executing the operation. Each item of the array is an object that can contain a 'code' (HTTP response status code of the error), 'reason' (reason phrase or description of the error), and 'class' (an exception class that will be raised when this error is encountered)"
- "data", "object", "Any arbitrary data to associate with the operation"
- "parameters", "object containing :ref:`parameter-schema` objects", "Parameters of the operation. Parameters are used to define how input data is serialized into a HTTP request."
- "additionalParameters", "A single :ref:`parameter-schema` object", "Validation and serialization rules for any parameter supplied to the operation that was not explicitly defined."
-
-additionalParameters
-~~~~~~~~~~~~~~~~~~~~
-
-When a webservice offers a large number of parameters that all are set in the same location (for example the query
-string or a JSON document), defining each parameter individually can require a lot of time and repetition. Furthermore,
-some web services allow for completely arbitrary parameters to be supplied for an operation. The
-``additionalParameters`` attribute can be used to solve both of these issues.
-
-As an example, we can define a Twitter API operation quite easily using ``additionalParameters``. The
-GetMentions operation accepts a large number of query string parameters. Defining each of these parameters
-is ideal because it provide much more introspection for the client and opens the possibility to use the description with
-other tools (e.g. a documentation generator). However, you can very quickly provide a "catch-all" serialization rule
-that will place any custom parameters supplied to an operation the generated request's query string parameters.
-
-.. class:: overflow-height-250px
-
- .. code-block:: json
-
- {
- "name": "Twitter",
- "apiVersion": "1.1",
- "baseUrl": "https://api.twitter.com/1.1",
- "operations": {
- "GetMentions": {
- "httpMethod": "GET",
- "uri": "statuses/mentions_timeline.json",
- "responseClass": "GetMentionsOutput",
- "additionalParameters": {
- "location": "query"
- }
- }
- },
- "models": {
- "GetMentionsOutput": {
- "type": "object",
- "additionalProperties": {
- "location": "json"
- }
- }
- }
- }
-
-responseClass
-~~~~~~~~~~~~~
-
-The ``responseClass`` attribute is used to define the return value of an operation (what is returned by calling the
-``getResult()`` method of a command object). The value set in the responseClass attribute can be one of "primitive"
-(meaning the result with be primitive type like a string), a class name meaning the result will be an instance of a
-specific user-land class, or a model name meaning the result will be a ``Guzzle\Service\Resource\Model`` object that
-uses a :ref:`model schema ` to define how the HTTP response is parsed.
-
-.. note::
-
- Using a class name with a ``responseClass`` will only work if it is supported by the ``class`` that is instantiated
- for the operation. Keep this in mind when specifying a custom ``class`` attribute that points to a custom
- ``Guzzle\Service\Command\CommandInterface`` class. The default ``class``,
- ``Guzzle\Service\Command\OperationCommand``, does support setting custom ``class`` attributes.
-
-You can specify the name of a class to return a more customized result from the operation (for example, a domain model
-object). When using the name of a PHP class, the class must implement ``Guzzle\Service\Command\ResponseClassInterface``.
-Here's a very simple example of implementing a custom responseClass object.
-
-.. code-block:: json
-
- {
- "operations": {
- "test": {
- "responseClass": "MyApplication\\User"
- }
- }
- }
-
-.. code-block:: php
-
- namespace MyApplication;
-
- use Guzzle\Service\Command\ResponseClassInterface;
- use Guzzle\Service\Command\OperationCommand;
-
- class User implements ResponseClassInterface
- {
- protected $name;
-
- public static function fromCommand(OperationCommand $command)
- {
- $response = $command->getResponse();
- $xml = $response->xml();
-
- return new self((string) $xml->name);
- }
-
- public function __construct($name)
- {
- $this->name = $name;
- }
- }
-
-errorResponses
-~~~~~~~~~~~~~~
-
-``errorResponses`` is an array containing objects that define the errors that could occur while executing the
-operation. Each item of the array is an object that can contain a 'code' (HTTP response status code of the error),
-'reason' (reason phrase or description of the error), and 'class' (an exception class that will be raised when this
-error is encountered).
-
-ErrorResponsePlugin
-^^^^^^^^^^^^^^^^^^^
-
-Error responses are by default only used for documentation. If you don't need very complex exception logic for your web
-service errors, then you can use the ``Guzzle\Plugin\ErrorResponse\ErrorResponsePlugin`` to automatically throw defined
-exceptions when one of the ``errorResponse`` rules are matched. The error response plugin will listen for the
-``request.complete`` event of a request created by a command object. Every response (including a successful response) is
-checked against the list of error responses for an exact match using the following order of checks:
-
-1. Does the errorResponse have a defined ``class``?
-2. Is the errorResponse ``code`` equal to the status code of the response?
-3. Is the errorResponse ``reason`` equal to the reason phrase of the response?
-4. Throw the exception stored in the ``class`` attribute of the errorResponse.
-
-The ``class`` attribute must point to a class that implements
-``Guzzle\Plugin\ErrorResponse\ErrorResponseExceptionInterface``. This interface requires that an error response class
-implements ``public static function fromCommand(CommandInterface $command, Response $response)``. This method must
-return an object that extends from ``\Exception``. After an exception is returned, it is thrown by the plugin.
-
-.. _parameter-schema:
-
-Parameter schema
-----------------
-
-Parameters in both operations and models are represented using the
-`JSON schema `_ syntax.
-
-.. csv-table::
- :header: "Property Name", "Value", "Description"
- :widths: 20, 15, 65
-
- "name", "string", "Unique name of the parameter"
- "type", "string|array", "Type of variable (string, number, integer, boolean, object, array, numeric, null, any). Types are using for validation and determining the structure of a parameter. You can use a union type by providing an array of simple types. If one of the union types matches the provided value, then the value is valid."
- "instanceOf", "string", "When the type is an object, you can specify the class that the object must implement"
- "required", "boolean", "Whether or not the parameter is required"
- "default", "mixed", "Default value to use if no value is supplied"
- "static", "boolean", "Set to true to specify that the parameter value cannot be changed from the default setting"
- "description", "string", "Documentation of the parameter"
- "location", "string", "The location of a request used to apply a parameter. Custom locations can be registered with a command, but the defaults are uri, query, statusCode, reasonPhrase, header, body, json, xml, postField, postFile, responseBody"
- "sentAs", "string", "Specifies how the data being modeled is sent over the wire. For example, you may wish to include certain headers in a response model that have a normalized casing of FooBar, but the actual header is x-foo-bar. In this case, sentAs would be set to x-foo-bar."
- "filters", "array", "Array of functions to to run a parameter value through."
-
-filters
-~~~~~~~
-
-Each value in the array must be a string containing the full class path to a static method or an array of complex
-filter information. You can specify static methods of classes using the full namespace class name followed by
-"::" (e.g. ``FooBar::baz()``). Some filters require arguments in order to properly filter a value. For complex filters,
-use an object containing a ``method`` attribute pointing to a function, and an ``args`` attribute containing an
-array of positional arguments to pass to the function. Arguments can contain keywords that are replaced when filtering
-a value: ``@value`` is replaced with the value being filtered, and ``@api`` is replaced with the actual Parameter
-object.
-
-.. code-block:: json
-
- {
- "filters": [
- "strtolower",
- {
- "method": "MyClass::convertString",
- "args": [ "test", "@value", "@api" ]
- }
- ]
- }
-
-The above example will filter a parameter using ``strtolower``. It will then call the ``convertString`` static method
-of ``MyClass``, passing in "test", the actual value of the parameter, and a ``Guzzle\Service\Description\Parameter``
-object.
-
-Operation parameter location attributes
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The location field of top-level parameters control how a parameter is serialized when generating a request.
-
-uri location
-^^^^^^^^^^^^
-
-Parameters are injected into the ``uri`` attribute of the operation using
-`URI-template expansion `_.
-
-.. code-block:: json
-
- {
- "operations": {
- "uriTest": {
- "uri": "/test/{testValue}",
- "parameters": {
- "testValue": {
- "location": "uri"
- }
- }
- }
- }
- }
-
-query location
-^^^^^^^^^^^^^^
-
-Parameters are injected into the query string of a request. Query values can be nested, which would result in a PHP
-style nested query string. The name of a parameter is the default name of the query string parameter added to the
-request. You can override this behavior by specifying the ``sentAs`` attribute on the parameter.
-
-.. code-block:: json
-
- {
- "operations": {
- "queryTest": {
- "parameters": {
- "testValue": {
- "location": "query",
- "sentAs": "test_value"
- }
- }
- }
- }
- }
-
-header location
-^^^^^^^^^^^^^^^
-
-Parameters are injected as headers on an HTTP request. The name of the parameter is used as the name of the header by
-default. You can change the name of the header created by the parameter using the ``sentAs`` attribute.
-
-Headers that are of type ``object`` will be added as multiple headers to a request using the key of the input array as
-the header key. Setting a ``sentAs`` attribute along with a type ``object`` will use the value of ``sentAs`` as a
-prefix for each header key.
-
-body location
-^^^^^^^^^^^^^
-
-Parameters are injected as the body of a request. The input of these parameters may be anything that can be cast to a
-string or a ``Guzzle\Http\EntityBodyInterface`` object.
-
-postField location
-^^^^^^^^^^^^^^^^^^
-
-Parameters are inserted as POST fields in a request. Nested values may be supplied and will be represented using
-PHP style nested query strings. The POST field name is the same as the parameter name by default. You can use the
-``sentAs`` parameter to override the POST field name.
-
-postFile location
-^^^^^^^^^^^^^^^^^
-
-Parameters are added as POST files. A postFile value may be a string pointing to a local filename or a
-``Guzzle\Http\Message\PostFileInterface`` object. The name of the POST file will be the name of the parameter by
-default. You can use a custom POST file name by using the ``sentAs`` attribute.
-
-Supports "string" and "array" types.
-
-json location
-^^^^^^^^^^^^^
-
-Parameters are added to the body of a request as top level keys of a JSON document. Nested values may be specified,
-with any number of nested ``Guzzle\Common\ToArrayInterface`` objects. When JSON parameters are specified, the
-``Content-Type`` of the request will change to ``application/json`` if a ``Content-Type`` has not already been specified
-on the request.
-
-xml location
-^^^^^^^^^^^^
-
-Parameters are added to the body of a request as top level nodes of an XML document. Nested values may be specified,
-with any number of nested ``Guzzle\Common\ToArrayInterface`` objects. When XML parameters are specified, the
-``Content-Type`` of the request will change to ``application/xml`` if a ``Content-Type`` has not already been specified
-on the request.
-
-responseBody location
-^^^^^^^^^^^^^^^^^^^^^
-
-Specifies the EntityBody of a response. This can be used to download the response body to a file or a custom Guzzle
-EntityBody object.
-
-No location
-^^^^^^^^^^^
-
-If a parameter has no location attribute, then the parameter is simply used as a data value.
-
-Other locations
-^^^^^^^^^^^^^^^
-
-Custom locations can be registered as new locations or override default locations if needed.
-
-.. _model-schema:
-
-Model Schema
-------------
-
-Models are used in service descriptions to provide generic JSON schema definitions that can be extended from or used in
-``$ref`` attributes. Models can also be referenced in a ``responseClass`` attribute to provide valuable output to an
-operation. Models are JSON schema documents and use the exact syntax and attributes used in parameters.
-
-Response Models
-~~~~~~~~~~~~~~~
-
-Response models describe how a response is parsed into a ``Guzzle\Service\Resource\Model`` object. Response models are
-always modeled as JSON schema objects. When an HTTP response is parsed using a response model, the rules specified on
-each property of a response model will translate 1:1 as keys in a PHP associative array. When a ``sentAs`` attribute is
-found in response model parameters, the value retrieved from the HTTP response is retrieved using the ``sentAs``
-parameter but stored in the response model using the name of the parameter.
-
-The location field of top-level parameters in a response model tell response parsers how data is retrieved from a
-response.
-
-statusCode location
-^^^^^^^^^^^^^^^^^^^
-
-Retrieves the status code of the response.
-
-reasonPhrase location
-^^^^^^^^^^^^^^^^^^^^^
-
-Retrieves the reason phrase of the response.
-
-header location
-^^^^^^^^^^^^^^^
-
-Retrieves a header from the HTTP response.
-
-body location
-^^^^^^^^^^^^^
-
-Retrieves the body of an HTTP response.
-
-json location
-^^^^^^^^^^^^^
-
-Retrieves a top-level parameter from a JSON document contained in an HTTP response.
-
-You can use ``additionalProperties`` if the JSON document is wrapped in an outer array. This allows you to parse the
-contents of each item in the array using the parsing rules defined in the ``additionalProperties`` schema.
-
-xml location
-^^^^^^^^^^^^
-
-Retrieves a top-level node value from an XML document contained in an HTTP response.
-
-Other locations
-^^^^^^^^^^^^^^^
-
-Custom locations can be registered as new locations or override default locations if needed.
-
-Example service description
----------------------------
-
-Let's say you're interacting with a web service called 'Foo' that allows for the following routes and methods::
-
- GET/POST /users
- GET/DELETE /users/:id
-
-The following JSON service description implements this simple web service:
-
-.. class:: overflow-height-500px
-
- .. code-block:: json
-
- {
- "name": "Foo",
- "apiVersion": "2012-10-14",
- "baseUrl": "http://api.foo.com",
- "description": "Foo is an API that allows you to Baz Bar",
- "operations": {
- "GetUsers": {
- "httpMethod": "GET",
- "uri": "/users",
- "summary": "Gets a list of users",
- "responseClass": "GetUsersOutput"
- },
- "CreateUser": {
- "httpMethod": "POST",
- "uri": "/users",
- "summary": "Creates a new user",
- "responseClass": "CreateUserOutput",
- "parameters": {
- "name": {
- "location": "json",
- "type": "string"
- },
- "age": {
- "location": "json",
- "type": "integer"
- }
- }
- },
- "GetUser": {
- "httpMethod": "GET",
- "uri": "/users/{id}",
- "summary": "Retrieves a single user",
- "responseClass": "GetUserOutput",
- "parameters": {
- "id": {
- "location": "uri",
- "description": "User to retrieve by ID",
- "required": true
- }
- }
- },
- "DeleteUser": {
- "httpMethod": "DELETE",
- "uri": "/users/{id}",
- "summary": "Deletes a user",
- "responseClass": "DeleteUserOutput",
- "parameters": {
- "id": {
- "location": "uri",
- "description": "User to delete by ID",
- "required": true
- }
- }
- }
- },
- "models": {
- "GetUsersOutput": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "name": {
- "location": "json",
- "type": "string"
- },
- "age": {
- "location": "json",
- "type": "integer"
- }
- }
- }
- },
- "CreateUserOutput": {
- "type": "object",
- "properties": {
- "id": {
- "location": "json",
- "type": "string"
- },
- "location": {
- "location": "header",
- "sentAs": "Location",
- "type": "string"
- }
- }
- },
- "GetUserOutput": {
- "type": "object",
- "properties": {
- "name": {
- "location": "json",
- "type": "string"
- },
- "age": {
- "location": "json",
- "type": "integer"
- }
- }
- },
- "DeleteUserOutput": {
- "type": "object",
- "properties": {
- "status": {
- "location": "statusCode",
- "type": "integer"
- }
- }
- }
- }
- }
-
-If you attach this service description to a client, you would completely configure the client to interact with the
-Foo web service and provide valuable response models for each operation.
-
-.. code-block:: php
-
- use Guzzle\Service\Description\ServiceDescription;
-
- $description = ServiceDescription::factory('/path/to/client.json');
- $client->setDescription($description);
-
- $command = $client->getCommand('DeleteUser', array('id' => 123));
- $responseModel = $client->execute($command);
- echo $responseModel['status'];
-
-.. note::
-
- You can add the service description to your client's factory method or constructor.
diff --git a/lib/gerencianet/guzzle/guzzle/docs/webservice-client/using-the-service-builder.rst b/lib/gerencianet/guzzle/guzzle/docs/webservice-client/using-the-service-builder.rst
deleted file mode 100644
index b7113d6..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/webservice-client/using-the-service-builder.rst
+++ /dev/null
@@ -1,316 +0,0 @@
-=======================
-Using a service builder
-=======================
-
-The best way to instantiate Guzzle web service clients is to let Guzzle handle building the clients for you using a
-ServiceBuilder. A ServiceBuilder is responsible for creating concrete client objects based on configuration settings
-and helps to manage credentials for different environments.
-
-You don't have to use a service builder, but they help to decouple your application from concrete classes and help to
-share configuration data across multiple clients. Consider the following example. Here we are creating two clients that
-require the same API public key and secret key. The clients are created using their ``factory()`` methods.
-
-.. code-block:: php
-
- use MyService\FooClient;
- use MyService\BarClient;
-
- $foo = FooClient::factory(array(
- 'key' => 'abc',
- 'secret' => '123',
- 'custom' => 'and above all'
- ));
-
- $bar = BarClient::factory(array(
- 'key' => 'abc',
- 'secret' => '123',
- 'custom' => 'listen to me'
- ));
-
-The redundant specification of the API keys can be removed using a service builder.
-
-.. code-block:: php
-
- use Guzzle\Service\Builder\ServiceBuilder;
-
- $builder = ServiceBuilder::factory(array(
- 'services' => array(
- 'abstract_client' => array(
- 'params' => array(
- 'key' => 'abc',
- 'secret' => '123'
- )
- ),
- 'foo' => array(
- 'extends' => 'abstract_client',
- 'class' => 'MyService\FooClient',
- 'params' => array(
- 'custom' => 'and above all'
- )
- ),
- 'bar' => array(
- 'extends' => 'abstract_client',
- 'class' => 'MyService\FooClient',
- 'params' => array(
- 'custom' => 'listen to me'
- )
- )
- )
- ));
-
- $foo = $builder->get('foo');
- $bar = $builder->get('bar');
-
-You can make managing your API keys even easier by saving the service builder configuration in a JSON format in a
-.json file.
-
-Creating a service builder
---------------------------
-
-A ServiceBuilder can source information from an array, an PHP include file that returns an array, or a JSON file.
-
-.. code-block:: php
-
- use Guzzle\Service\Builder\ServiceBuilder;
-
- // Source service definitions from a JSON file
- $builder = ServiceBuilder::factory('services.json');
-
-Sourcing data from an array
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Data can be source from a PHP array. The array must contain an associative ``services`` array that maps the name of a
-client to the configuration information used by the service builder to create the client. Clients are given names
-which are used to identify how a client is retrieved from a service builder. This can be useful for using multiple
-accounts for the same service or creating development clients vs. production clients.
-
-.. code-block:: php
-
- $services = array(
- 'includes' => array(
- '/path/to/other/services.json',
- '/path/to/other/php_services.php'
- ),
- 'services' => array(
- 'abstract.foo' => array(
- 'params' => array(
- 'username' => 'foo',
- 'password' => 'bar'
- )
- ),
- 'bar' => array(
- 'extends' => 'abstract.foo',
- 'class' => 'MyClientClass',
- 'params' => array(
- 'other' => 'abc'
- )
- )
- )
- );
-
-A service builder configuration array contains two top-level array keys:
-
-+------------+---------------------------------------------------------------------------------------------------------+
-| Key | Description |
-+============+=========================================================================================================+
-| includes | Array of paths to JSON or PHP include files to include in the configuration. |
-+------------+---------------------------------------------------------------------------------------------------------+
-| services | Associative array of defined services that can be created by the service builder. Each service can |
-| | contain the following keys: |
-| | |
-| | +------------+----------------------------------------------------------------------------------------+ |
-| | | Key | Description | |
-| | +============+========================================================================================+ |
-| | | class | The concrete class to instantiate that implements the | |
-| | | | ``Guzzle\Common\FromConfigInterface``. | |
-| | +------------+----------------------------------------------------------------------------------------+ |
-| | | extends | The name of a previously defined service to extend from | |
-| | +------------+----------------------------------------------------------------------------------------+ |
-| | | params | Associative array of parameters to pass to the factory method of the service it is | |
-| | | | instantiated | |
-| | +------------+----------------------------------------------------------------------------------------+ |
-| | | alias | An alias that can be used in addition to the array key for retrieving a client from | |
-| | | | the service builder. | |
-| | +------------+----------------------------------------------------------------------------------------+ |
-+------------+---------------------------------------------------------------------------------------------------------+
-
-The first client defined, ``abstract.foo``, is used as a placeholder of shared configuration values. Any service
-extending abstract.foo will inherit its params. As an example, this can be useful when clients share the same username
-and password.
-
-The next client, ``bar``, extends from ``abstract.foo`` using the ``extends`` attribute referencing the client from
-which to extend. Additional parameters can be merged into the original service definition when extending a parent
-service.
-
-.. important::
-
- Each client that you intend to instantiate must specify a ``class`` attribute that references the full class name
- of the client being created. The class referenced in the ``class`` parameter must implement a static ``factory()``
- method that accepts an array or ``Guzzle\Common\Collection`` object and returns an instantiated object.
-
-Sourcing from a PHP include
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You can create service builder configurations using a PHP include file. This can be useful if you wish to take
-advantage of an opcode cache like APC to speed up the process of loading and processing the configuration. The PHP
-include file is the same format as an array, but you simply create a PHP script that returns an array and save the
-file with the .php file extension.
-
-.. code-block:: php
-
- '...');
- // Saved as config.php
-
-This configuration file can then be used with a service builder.
-
-.. code-block:: php
-
- $builder = ServiceBuilder::factory('/path/to/config.php');
-
-Sourcing from a JSON document
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You can use JSON documents to serialize your service descriptions. The JSON format uses the exact same structure as
-the PHP array syntax, but it's just serialized using JSON.
-
-.. code-block:: javascript
-
- {
- "includes": ["/path/to/other/services.json", "/path/to/other/php_services.php"],
- "services": {
- "abstract.foo": {
- "params": {
- "username": "foo",
- "password": "bar"
- }
- },
- "bar": {
- "extends": "abstract.foo",
- "class": "MyClientClass",
- "params": {
- "other": "abc"
- }
- }
- }
- }
-
-Referencing other clients in parameters
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-If one of your clients depends on another client as one of its parameters, you can reference that client by name by
-enclosing the client's reference key in ``{}``.
-
-.. code-block:: javascript
-
- {
- "services": {
- "token": {
- "class": "My\Token\TokenFactory",
- "params": {
- "access_key": "xyz"
- }
- },
- "client": {
- "class": "My\Client",
- "params": {
- "token_client": "{token}",
- "version": "1.0"
- }
- }
- }
- }
-
-When ``client`` is constructed by the service builder, the service builder will first create the ``token`` service
-and then inject the token service into ``client``'s factory method in the ``token_client`` parameter.
-
-Retrieving clients from a service builder
------------------------------------------
-
-Clients are referenced using a customizable name you provide in your service definition. The ServiceBuilder is a sort
-of multiton object-- it will only instantiate a client once and return that client for subsequent retrievals. Clients
-are retrieved by name (the array key used in the configuration) or by the ``alias`` setting of a service.
-
-Here's an example of retrieving a client from your ServiceBuilder:
-
-.. code-block:: php
-
- $client = $builder->get('foo');
-
- // You can also use the ServiceBuilder object as an array
- $client = $builder['foo'];
-
-Creating throwaway clients
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You can get a "throwaway" client (a client that is not persisted by the ServiceBuilder) by passing ``true`` in the
-second argument of ``ServiceBuilder::get()``. This allows you to create a client that will not be returned by other
-parts of your code that use the service builder. Instead of passing ``true``, you can pass an array of configuration
-settings that will override the configuration settings specified in the service builder.
-
-.. code-block:: php
-
- // Get a throwaway client and overwrite the "custom" setting of the client
- $foo = $builder->get('foo', array(
- 'custom' => 'in this world there are rules'
- ));
-
-Getting raw configuration settings
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You can get the raw configuration settings provided to the service builder for a specific service using the
-``getData($name)`` method of a service builder. This method will null if the service was not found in the service
-builder or an array of configuration settings if the service was found.
-
-.. code-block:: php
-
- $data = $builder->getData('foo');
- echo $data['key'] . "\n";
- echo $data['secret'] . "\n";
- echo $data['custom'] . "\n";
-
-Adding a plugin to all clients
-------------------------------
-
-You can add a plugin to all clients created by a service builder using the ``addGlobalPlugin($plugin)`` method of a
-service builder and passing a ``Symfony\Component\EventDispatcher\EventSubscriberInterface`` object. The service builder
-will then attach each global plugin to every client as it is created. This allows you to, for example, add a LogPlugin
-to every request created by a service builder for easy debugging.
-
-.. code-block:: php
-
- use Guzzle\Plugin\Log\LogPlugin;
-
- // Add a debug log plugin to every client as it is created
- $builder->addGlobalPlugin(LogPlugin::getDebugPlugin());
-
- $foo = $builder->get('foo');
- $foo->get('/')->send();
- // Should output all of the data sent over the wire
-
-.. _service-builder-events:
-
-Events emitted from a service builder
--------------------------------------
-
-A ``Guzzle\Service\Builder\ServiceBuilder`` object emits the following events:
-
-+-------------------------------+--------------------------------------------+-----------------------------------------+
-| Event name | Description | Event data |
-+===============================+============================================+=========================================+
-| service_builder.create_client | Called when a client is created | * client: The created client object |
-+-------------------------------+--------------------------------------------+-----------------------------------------+
-
-.. code-block:: php
-
- use Guzzle\Common\Event;
- use Guzzle\Service\Builder\ServiceBuilder;
-
- $builder = ServiceBuilder::factory('/path/to/config.json');
-
- // Add an event listener to print out each client client as it is created
- $builder->getEventDispatcher()->addListener('service_builder.create_client', function (Event $e) {
- echo 'Client created: ' . get_class($e['client']) . "\n";
- });
-
- $foo = $builder->get('foo');
- // Should output the class used for the "foo" client
diff --git a/lib/gerencianet/guzzle/guzzle/docs/webservice-client/webservice-client.rst b/lib/gerencianet/guzzle/guzzle/docs/webservice-client/webservice-client.rst
deleted file mode 100644
index 7ec771e..0000000
--- a/lib/gerencianet/guzzle/guzzle/docs/webservice-client/webservice-client.rst
+++ /dev/null
@@ -1,659 +0,0 @@
-======================
-The web service client
-======================
-
-The ``Guzzle\Service`` namespace contains various abstractions that help to make it easier to interact with a web
-service API, including commands, service descriptions, and resource iterators.
-
-In this chapter, we'll build a simple `Twitter API client `_.
-
-Creating a client
-=================
-
-A class that extends from ``Guzzle\Service\Client`` or implements ``Guzzle\Service\ClientInterface`` must implement a
-``factory()`` method in order to be used with a :doc:`service builder `.
-
-Factory method
---------------
-
-You can use the ``factory()`` method of a client directly if you do not need a service builder.
-
-.. code-block:: php
-
- use mtdowling\TwitterClient;
-
- // Create a client and pass an array of configuration data
- $twitter = TwitterClient::factory(array(
- 'consumer_key' => '****',
- 'consumer_secret' => '****',
- 'token' => '****',
- 'token_secret' => '****'
- ));
-
-.. note::
-
- If you'd like to follow along, here's how to get your Twitter API credentials:
-
- 1. Visit https://dev.twitter.com/apps
- 2. Click on an application that you've created
- 3. Click on the "OAuth tool" tab
- 4. Copy all of the settings under "OAuth Settings"
-
-Implementing a factory method
------------------------------
-
-Creating a client and its factory method is pretty simple. You just need to implement ``Guzzle\Service\ClientInterface``
-or extend from ``Guzzle\Service\Client``.
-
-.. code-block:: php
-
- namespace mtdowling;
-
- use Guzzle\Common\Collection;
- use Guzzle\Plugin\Oauth\OauthPlugin;
- use Guzzle\Service\Client;
- use Guzzle\Service\Description\ServiceDescription;
-
- /**
- * A simple Twitter API client
- */
- class TwitterClient extends Client
- {
- public static function factory($config = array())
- {
- // Provide a hash of default client configuration options
- $default = array('base_url' => 'https://api.twitter.com/1.1');
-
- // The following values are required when creating the client
- $required = array(
- 'base_url',
- 'consumer_key',
- 'consumer_secret',
- 'token',
- 'token_secret'
- );
-
- // Merge in default settings and validate the config
- $config = Collection::fromConfig($config, $default, $required);
-
- // Create a new Twitter client
- $client = new self($config->get('base_url'), $config);
-
- // Ensure that the OauthPlugin is attached to the client
- $client->addSubscriber(new OauthPlugin($config->toArray()));
-
- return $client;
- }
- }
-
-Service Builder
----------------
-
-A service builder is used to easily create web service clients, provides a simple configuration driven approach to
-creating clients, and allows you to share configuration settings across multiple clients. You can find out more about
-Guzzle's service builder in :doc:`using-the-service-builder`.
-
-.. code-block:: php
-
- use Guzzle\Service\Builder\ServiceBuilder;
-
- // Create a service builder and provide client configuration data
- $builder = ServiceBuilder::factory('/path/to/client_config.json');
-
- // Get the client from the service builder by name
- $twitter = $builder->get('twitter');
-
-The above example assumes you have JSON data similar to the following stored in "/path/to/client_config.json":
-
-.. code-block:: json
-
- {
- "services": {
- "twitter": {
- "class": "mtdowling\\TwitterClient",
- "params": {
- "consumer_key": "****",
- "consumer_secret": "****",
- "token": "****",
- "token_secret": "****"
- }
- }
- }
- }
-
-.. note::
-
- A service builder becomes much more valuable when using multiple web service clients in a single application or
- if you need to utilize the same client with varying configuration settings (e.g. multiple accounts).
-
-Commands
-========
-
-Commands are a concept in Guzzle that helps to hide the underlying implementation of an API by providing an easy to use
-parameter driven object for each action of an API. A command is responsible for accepting an array of configuration
-parameters, serializing an HTTP request, and parsing an HTTP response. Following the
-`command pattern `_, commands in Guzzle offer a greater level of
-flexibility when implementing and utilizing a web service client.
-
-Executing commands
-------------------
-
-You must explicitly execute a command after creating a command using the ``getCommand()`` method. A command has an
-``execute()`` method that may be called, or you can use the ``execute()`` method of a client object and pass in the
-command object. Calling either of these execute methods will return the result value of the command. The result value is
-the result of parsing the HTTP response with the ``process()`` method.
-
-.. code-block:: php
-
- // Get a command from the client and pass an array of parameters
- $command = $twitter->getCommand('getMentions', array(
- 'count' => 5
- ));
-
- // Other parameters can be set on the command after it is created
- $command['trim_user'] = false;
-
- // Execute the command using the command object.
- // The result value contains an array of JSON data from the response
- $result = $command->execute();
-
- // You can retrieve the result of the command later too
- $result = $command->getResult().
-
-Command object also contains methods that allow you to inspect the HTTP request and response that was utilized with
-the command.
-
-.. code-block:: php
-
- $request = $command->getRequest();
- $response = $command->getResponse();
-
-.. note::
-
- The format and notation used to retrieve commands from a client can be customized by injecting a custom command
- factory, ``Guzzle\Service\Command\Factory\FactoryInterface``, on the client using ``$client->setCommandFactory()``.
-
-Executing with magic methods
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-When using method missing magic methods with a command, the command will be executed right away and the result of the
-command is returned.
-
-.. code-block:: php
-
- $jsonData = $twitter->getMentions(array(
- 'count' => 5,
- 'trim_user' => true
- ));
-
-Creating commands
------------------
-
-Commands are created using either the ``getCommand()`` method of a client or a magic missing method of a client. Using
-the ``getCommand()`` method allows you to create a command without executing it, allowing for customization of the
-command or the request serialized by the command.
-
-When a client attempts to create a command, it uses the client's ``Guzzle\Service\Command\Factory\FactoryInterface``.
-By default, Guzzle will utilize a command factory that first looks for a concrete class for a particular command
-(concrete commands) followed by a command defined by a service description (operation commands). We'll learn more about
-concrete commands and operation commands later in this chapter.
-
-.. code-block:: php
-
- // Get a command from the twitter client.
- $command = $twitter->getCommand('getMentions');
- $result = $command->execute();
-
-Unless you've skipped ahead, running the above code will throw an exception.
-
- PHP Fatal error: Uncaught exception 'Guzzle\Common\Exception\InvalidArgumentException' with message
- 'Command was not found matching getMentions'
-
-This exception was thrown because the "getMentions" command has not yet been implemented. Let's implement one now.
-
-Concrete commands
-~~~~~~~~~~~~~~~~~
-
-Commands can be created in one of two ways: create a concrete command class that extends
-``Guzzle\Service\Command\AbstractCommand`` or
-:doc:`create an OperationCommand based on a service description `. The recommended
-approach is to use a service description to define your web service, but you can use concrete commands when custom
-logic must be implemented for marshaling or unmarshaling a HTTP message.
-
-Commands are the method in which you abstract away the underlying format of the requests that need to be sent to take
-action on a web service. Commands in Guzzle are meant to be built by executing a series of setter methods on a command
-object. Commands are only validated right before they are executed. A ``Guzzle\Service\Client`` object is responsible
-for executing commands. Commands created for your web service must implement
-``Guzzle\Service\Command\CommandInterface``, but it's easier to extend the ``Guzzle\Service\Command\AbstractCommand``
-class, implement the ``build()`` method, and optionally implement the ``process()`` method.
-
-Serializing requests
-^^^^^^^^^^^^^^^^^^^^
-
-The ``build()`` method of a command is responsible for using the arguments of the command to build and serialize a
-HTTP request and set the request on the ``$request`` property of the command object. This step is usually taken care of
-for you when using a service description driven command that uses the default
-``Guzzle\Service\Command\OperationCommand``. You may wish to implement the process method yourself when you aren't
-using a service description or need to implement more complex request serialization.
-
-.. important::::
-
- When implementing a custom ``build()`` method, be sure to set the class property of ``$this->request`` to an
- instantiated and ready to send request.
-
-The following example shows how to implement the ``getMentions``
-`Twitter API `_ method using a concrete command.
-
-.. code-block:: php
-
- namespace mtdowling\Twitter\Command;
-
- use Guzzle\Service\Command\AbstractCommand;
-
- class GetMentions extends AbstractCommand
- {
- protected function build()
- {
- // Create the request property of the command
- $this->request = $this->client->get('statuses/mentions_timeline.json');
-
- // Grab the query object of the request because we will use it for
- // serializing command parameters on the request
- $query = $this->request->getQuery();
-
- if ($this['count']) {
- $query->set('count', $this['count']);
- }
-
- if ($this['since_id']) {
- $query->set('since_id', $this['since_id']);
- }
-
- if ($this['max_id']) {
- $query->set('max_id', $this['max_id']);
- }
-
- if ($this['trim_user'] !== null) {
- $query->set('trim_user', $this['trim_user'] ? 'true' : 'false');
- }
-
- if ($this['contributor_details'] !== null) {
- $query->set('contributor_details', $this['contributor_details'] ? 'true' : 'false');
- }
-
- if ($this['include_entities'] !== null) {
- $query->set('include_entities', $this['include_entities'] ? 'true' : 'false');
- }
- }
- }
-
-By default, a client will attempt to find concrete command classes under the ``Command`` namespace of a client. First
-the client will attempt to find an exact match for the name of the command to the name of the command class. If an
-exact match is not found, the client will calculate a class name using inflection. This is calculated based on the
-folder hierarchy of a command and converting the CamelCased named commands into snake_case. Here are some examples on
-how the command names are calculated:
-
-#. ``Foo\Command\JarJar`` **->** jar_jar
-#. ``Foo\Command\Test`` **->** test
-#. ``Foo\Command\People\GetCurrentPerson`` **->** people.get_current_person
-
-Notice how any sub-namespace beneath ``Command`` is converted from ``\`` to ``.`` (a period). CamelCasing is converted
-to lowercased snake_casing (e.g. JarJar == jar_jar).
-
-Parsing responses
-^^^^^^^^^^^^^^^^^
-
-The ``process()`` method of a command is responsible for converting an HTTP response into something more useful. For
-example, a service description operation that has specified a model object in the ``responseClass`` attribute of the
-operation will set a ``Guzzle\Service\Resource\Model`` object as the result of the command. This behavior can be
-completely modified as needed-- even if you are using operations and responseClass models. Simply implement a custom
-``process()`` method that sets the ``$this->result`` class property to whatever you choose. You can reuse parts of the
-default Guzzle response parsing functionality or get inspiration from existing code by using
-``Guzzle\Service\Command\OperationResponseParser`` and ``Guzzle\Service\Command\DefaultResponseParser`` classes.
-
-If you do not implement a custom ``process()`` method and are not using a service description, then Guzzle will attempt
-to guess how a response should be processed based on the Content-Type header of the response. Because the Twitter API
-sets a ``Content-Type: application/json`` header on this response, we do not need to implement any custom response
-parsing.
-
-Operation commands
-~~~~~~~~~~~~~~~~~~
-
-Operation commands are commands in which the serialization of an HTTP request and the parsing of an HTTP response are
-driven by a Guzzle service description. Because request serialization, validation, and response parsing are
-described using a DSL, creating operation commands is a much faster process than writing concrete commands.
-
-Creating operation commands for our Twitter client can remove a great deal of redundancy from the previous concrete
-command, and allows for a deeper runtime introspection of the API. Here's an example service description we can use to
-create the Twitter API client:
-
-.. code-block:: json
-
- {
- "name": "Twitter",
- "apiVersion": "1.1",
- "baseUrl": "https://api.twitter.com/1.1",
- "description": "Twitter REST API client",
- "operations": {
- "GetMentions": {
- "httpMethod": "GET",
- "uri": "statuses/mentions_timeline.json",
- "summary": "Returns the 20 most recent mentions for the authenticating user.",
- "responseClass": "GetMentionsOutput",
- "parameters": {
- "count": {
- "description": "Specifies the number of tweets to try and retrieve",
- "type": "integer",
- "location": "query"
- },
- "since_id": {
- "description": "Returns results with an ID greater than the specified ID",
- "type": "integer",
- "location": "query"
- },
- "max_id": {
- "description": "Returns results with an ID less than or equal to the specified ID.",
- "type": "integer",
- "location": "query"
- },
- "trim_user": {
- "description": "Limits the amount of data returned for each user",
- "type": "boolean",
- "location": "query"
- },
- "contributor_details": {
- "description": "Adds more data to contributor elements",
- "type": "boolean",
- "location": "query"
- },
- "include_entities": {
- "description": "The entities node will be disincluded when set to false.",
- "type": "boolean",
- "location": "query"
- }
- }
- }
- },
- "models": {
- "GetMentionsOutput": {
- "type": "object",
- "additionalProperties": {
- "location": "json"
- }
- }
- }
- }
-
-If you're lazy, you can define the API in a less descriptive manner using ``additionalParameters``.
-``additionalParameters`` define the serialization and validation rules of parameters that are not explicitly defined
-in a service description.
-
-.. code-block:: json
-
- {
- "name": "Twitter",
- "apiVersion": "1.1",
- "baseUrl": "https://api.twitter.com/1.1",
- "description": "Twitter REST API client",
- "operations": {
- "GetMentions": {
- "httpMethod": "GET",
- "uri": "statuses/mentions_timeline.json",
- "summary": "Returns the 20 most recent mentions for the authenticating user.",
- "responseClass": "GetMentionsOutput",
- "additionalParameters": {
- "location": "query"
- }
- }
- },
- "models": {
- "GetMentionsOutput": {
- "type": "object",
- "additionalProperties": {
- "location": "json"
- }
- }
- }
- }
-
-You should attach the service description to the client at the end of the client's factory method:
-
-.. code-block:: php
-
- // ...
- class TwitterClient extends Client
- {
- public static function factory($config = array())
- {
- // ... same code as before ...
-
- // Set the service description
- $client->setDescription(ServiceDescription::factory('path/to/twitter.json'));
-
- return $client;
- }
- }
-
-The client can now use operations defined in the service description instead of requiring you to create concrete
-command classes. Feel free to delete the concrete command class we created earlier.
-
-.. code-block:: php
-
- $jsonData = $twitter->getMentions(array(
- 'count' => 5,
- 'trim_user' => true
- ));
-
-Executing commands in parallel
-------------------------------
-
-Much like HTTP requests, Guzzle allows you to send multiple commands in parallel. You can send commands in parallel by
-passing an array of command objects to a client's ``execute()`` method. The client will serialize each request and
-send them all in parallel. If an error is encountered during the transfer, then a
-``Guzzle\Service\Exception\CommandTransferException`` is thrown, which allows you to retrieve a list of commands that
-succeeded and a list of commands that failed.
-
-.. code-block:: php
-
- use Guzzle\Service\Exception\CommandTransferException;
-
- $commands = array();
- $commands[] = $twitter->getCommand('getMentions');
- $commands[] = $twitter->getCommand('otherCommandName');
- // etc...
-
- try {
- $result = $client->execute($commands);
- foreach ($result as $command) {
- echo $command->getName() . ': ' . $command->getResponse()->getStatusCode() . "\n";
- }
- } catch (CommandTransferException $e) {
- // Get an array of the commands that succeeded
- foreach ($e->getSuccessfulCommands() as $command) {
- echo $command->getName() . " succeeded\n";
- }
- // Get an array of the commands that failed
- foreach ($e->getFailedCommands() as $command) {
- echo $command->getName() . " failed\n";
- }
- }
-
-.. note::
-
- All commands executed from a client using an array must originate from the same client.
-
-Special command options
------------------------
-
-Guzzle exposes several options that help to control how commands are validated, serialized, and parsed.
-Command options can be specified when creating a command or in the ``command.params`` parameter in the
-``Guzzle\Service\Client``.
-
-=========================== ============================================================================================
-command.request_options Option used to add :ref:`Request options ` to the request created by a
- command
-command.hidden_params An array of the names of parameters ignored by the ``additionalParameters`` parameter schema
-command.disable_validation Set to true to disable JSON schema validation of the command's input parameters
-command.response_processing Determines how the default response parser will parse the command. One of "raw" no parsing,
- "model" (the default method used to parse commands using response models defined in service
- descriptions)
-command.headers (deprecated) Option used to specify custom headers. Use ``command.request_options`` instead
-command.on_complete (deprecated) Option used to add an onComplete method to a command. Use
- ``command.after_send`` event instead
-command.response_body (deprecated) Option used to change the entity body used to store a response.
- Use ``command.request_options`` instead
-=========================== ============================================================================================
-
-Advanced client configuration
-=============================
-
-Default command parameters
---------------------------
-
-When creating a client object, you can specify default command parameters to pass into all commands. Any key value pair
-present in the ``command.params`` settings of a client will be added as default parameters to any command created
-by the client.
-
-.. code-block:: php
-
- $client = new Guzzle\Service\Client(array(
- 'command.params' => array(
- 'default_1' => 'foo',
- 'another' => 'bar'
- )
- ));
-
-Magic methods
--------------
-
-Client objects will, by default, attempt to create and execute commands when a missing method is invoked on a client.
-This powerful concept applies to both concrete commands and operation commands powered by a service description. This
-makes it appear to the end user that you have defined actual methods on a client object, when in fact, the methods are
-invoked using PHP's magic ``__call`` method.
-
-The ``__call`` method uses the ``getCommand()`` method of a client, which uses the client's internal
-``Guzzle\Service\Command\Factory\FactoryInterface`` object. The default command factory allows you to instantiate
-operations defined in a client's service description. The method in which a client determines which command to
-execute is defined as follows:
-
-1. The client will first try to find a literal match for an operation in the service description.
-2. If the literal match is not found, the client will try to uppercase the first character of the operation and find
- the match again.
-3. If a match is still not found, the command factory will inflect the method name from CamelCase to snake_case and
- attempt to find a matching command.
-4. If a command still does not match, an exception is thrown.
-
-.. code-block:: php
-
- // Use the magic method
- $result = $twitter->getMentions();
-
- // This is exactly the same as:
- $result = $twitter->getCommand('getMentions')->execute();
-
-You can disable magic methods on a client by passing ``false`` to the ``enableMagicMethod()`` method.
-
-Custom command factory
-----------------------
-
-A client by default uses the ``Guzzle\Service\Command\Factory\CompositeFactory`` which allows multiple command
-factories to attempt to create a command by a certain name. The default CompositeFactory uses a ``ConcreteClassFactory``
-and a ``ServiceDescriptionFactory`` if a service description is specified on a client. You can specify a custom
-command factory if your client requires custom command creation logic using the ``setCommandFactory()`` method of
-a client.
-
-Custom resource Iterator factory
---------------------------------
-
-Resource iterators can be retrieved from a client using the ``getIterator($name)`` method of a client. This method uses
-a client's internal ``Guzzle\Service\Resource\ResourceIteratorFactoryInterface`` object. A client by default uses a
-``Guzzle\Service\Resource\ResourceIteratorClassFactory`` to attempt to find concrete classes that implement resource
-iterators. The default factory will first look for matching iterators in the ``Iterator`` subdirectory of the client
-followed by the ``Model`` subdirectory of a client. Use the ``setResourceIteratorFactory()`` method of a client to
-specify a custom resource iterator factory.
-
-Plugins and events
-==================
-
-``Guzzle\Service\Client`` exposes various events that allow you to hook in custom logic. A client object owns a
-``Symfony\Component\EventDispatcher\EventDispatcher`` object that can be accessed by calling
-``$client->getEventDispatcher()``. You can use the event dispatcher to add listeners (a simple callback function) or
-event subscribers (classes that listen to specific events of a dispatcher).
-
-.. _service-client-events:
-
-Events emitted from a Service Client
-------------------------------------
-
-A ``Guzzle\Service\Client`` object emits the following events:
-
-+------------------------------+--------------------------------------------+------------------------------------------+
-| Event name | Description | Event data |
-+==============================+============================================+==========================================+
-| client.command.create | The client created a command object | * client: Client object |
-| | | * command: Command object |
-+------------------------------+--------------------------------------------+------------------------------------------+
-| command.before_prepare | Before a command is validated and built. | * command: Command being prepared |
-| | This is also before a request is created. | |
-+------------------------------+--------------------------------------------+------------------------------------------+
-| command.after_prepare | After a command instantiates and | * command: Command that was prepared |
-| | configures its request object. | |
-+------------------------------+--------------------------------------------+------------------------------------------+
-| command.before_send | The client is about to execute a prepared | * command: Command to execute |
-| | command | |
-+------------------------------+--------------------------------------------+------------------------------------------+
-| command.after_send | The client successfully completed | * command: The command that was executed |
-| | executing a command | |
-+------------------------------+--------------------------------------------+------------------------------------------+
-| command.parse_response | Called when ``responseType`` is ``class`` | * command: The command with a response |
-| | and the response is about to be parsed. | about to be parsed. |
-+------------------------------+--------------------------------------------+------------------------------------------+
-
-.. code-block:: php
-
- use Guzzle\Common\Event;
- use Guzzle\Service\Client;
-
- $client = new Client();
-
- // create an event listener that operates on request objects
- $client->getEventDispatcher()->addListener('command.after_prepare', function (Event $event) {
- $command = $event['command'];
- $request = $command->getRequest();
-
- // do something with request
- });
-
-.. code-block:: php
-
- use Guzzle\Common\Event;
- use Guzzle\Common\Client;
- use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-
- class EventSubscriber implements EventSubscriberInterface
- {
- public static function getSubscribedEvents()
- {
- return array(
- 'client.command.create' => 'onCommandCreate',
- 'command.parse_response' => 'onParseResponse'
- );
- }
-
- public function onCommandCreate(Event $event)
- {
- $client = $event['client'];
- $command = $event['command'];
- // operate on client and command
- }
-
- public function onParseResponse(Event $event)
- {
- $command = $event['command'];
- // operate on the command
- }
- }
-
- $client = new Client();
-
- $client->addSubscriber(new EventSubscriber());
diff --git a/lib/gerencianet/guzzle/guzzle/phar-stub.php b/lib/gerencianet/guzzle/guzzle/phar-stub.php
deleted file mode 100644
index cc2b53f..0000000
--- a/lib/gerencianet/guzzle/guzzle/phar-stub.php
+++ /dev/null
@@ -1,16 +0,0 @@
-registerNamespaces(array(
- 'Guzzle' => 'phar://guzzle.phar/src',
- 'Symfony\\Component\\EventDispatcher' => 'phar://guzzle.phar/vendor/symfony/event-dispatcher',
- 'Doctrine' => 'phar://guzzle.phar/vendor/doctrine/common/lib',
- 'Monolog' => 'phar://guzzle.phar/vendor/monolog/monolog/src'
-));
-$classLoader->register();
-
-__HALT_COMPILER();
diff --git a/lib/gerencianet/guzzle/guzzle/phing/build.properties.dist b/lib/gerencianet/guzzle/guzzle/phing/build.properties.dist
deleted file mode 100644
index c60d3d9..0000000
--- a/lib/gerencianet/guzzle/guzzle/phing/build.properties.dist
+++ /dev/null
@@ -1,16 +0,0 @@
-# you may need to update this if you're working on a fork.
-guzzle.remote=git@github.com:guzzle/guzzle.git
-
-# github credentials -- only used by GitHub API calls to create subtree repos
-github.basicauth=username:password
-# for the subtree split and testing
-github.org=guzzle
-
-# your git path
-cmd.git=git
-
-# your composer command
-cmd.composer=composer
-
-# test server start
-cmd.testserver=node
diff --git a/lib/gerencianet/guzzle/guzzle/phing/imports/dependencies.xml b/lib/gerencianet/guzzle/guzzle/phing/imports/dependencies.xml
deleted file mode 100644
index e40e037..0000000
--- a/lib/gerencianet/guzzle/guzzle/phing/imports/dependencies.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- using git at ${cmd.git}
-
-
-
- found git at ${cmd.git}
-
-
-
-
-
-
-
-
-
-
diff --git a/lib/gerencianet/guzzle/guzzle/phing/imports/deploy.xml b/lib/gerencianet/guzzle/guzzle/phing/imports/deploy.xml
deleted file mode 100644
index 109e5ec..0000000
--- a/lib/gerencianet/guzzle/guzzle/phing/imports/deploy.xml
+++ /dev/null
@@ -1,142 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- On branch ${head}
-
-
-
-
-
-
-
-
-
- working directory clean
-
-
- ${git.status}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ChangeLog Match: ${version.changelog}
- Guzzle\Common\Version Match: ${version.version}
-
-
-
- releasing: phing -Dnew.version=3.0.x -Dhead=master release
- --
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- BEGINNING RELEASE FOR ${new.version}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Tip: to create a new release, do: phing -Dnew.version=[TAG] -Dhead=[BRANCH] release
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/lib/gerencianet/guzzle/guzzle/phing/tasks/ComposerLintTask.php b/lib/gerencianet/guzzle/guzzle/phing/tasks/ComposerLintTask.php
deleted file mode 100644
index 3b70409..0000000
--- a/lib/gerencianet/guzzle/guzzle/phing/tasks/ComposerLintTask.php
+++ /dev/null
@@ -1,152 +0,0 @@
-
- * @license http://claylo.mit-license.org/2012/ MIT License
- */
-
-require_once 'phing/Task.php';
-
-class ComposerLintTask extends Task
-{
- protected $dir = null;
- protected $file = null;
- protected $passthru = false;
- protected $composer = null;
-
- /**
- * The setter for the dir
- *
- * @param string $str Directory to crawl recursively for composer files
- */
- public function setDir($str)
- {
- $this->dir = $str;
- }
-
- /**
- * The setter for the file
- *
- * @param string $str Individual file to validate
- */
- public function setFile($str)
- {
- $this->file = $str;
- }
-
- /**
- * Whether to use PHP's passthru() function instead of exec()
- *
- * @param boolean $passthru If passthru shall be used
- */
- public function setPassthru($passthru)
- {
- $this->passthru = (bool) $passthru;
- }
-
- /**
- * Composer to execute. If unset, will attempt composer.phar in project
- * basedir, and if that fails, will attempt global composer
- * installation.
- *
- * @param string $str Individual file to validate
- */
- public function setComposer($str)
- {
- $this->file = $str;
- }
-
- /**
- * The init method: do init steps
- */
- public function init()
- {
- // nothing needed here
- }
-
- /**
- * The main entry point
- */
- public function main()
- {
- if ($this->composer === null) {
- $this->findComposer();
- }
-
- $files = array();
- if (!empty($this->file) && file_exists($this->file)) {
- $files[] = $this->file;
- }
-
- if (!empty($this->dir)) {
- $found = $this->findFiles();
- foreach ($found as $file) {
- $files[] = $this->dir . DIRECTORY_SEPARATOR . $file;
- }
- }
-
- foreach ($files as $file) {
-
- $cmd = $this->composer . ' validate ' . $file;
- $cmd = escapeshellcmd($cmd);
-
- if ($this->passthru) {
- $retval = null;
- passthru($cmd, $retval);
- if ($retval == 1) {
- throw new BuildException('invalid composer.json');
- }
- } else {
- $out = array();
- $retval = null;
- exec($cmd, $out, $retval);
- if ($retval == 1) {
- $err = join("\n", $out);
- throw new BuildException($err);
- } else {
- $this->log($out[0]);
- }
- }
-
- }
-
- }
-
- /**
- * Find the composer.json files using Phing's directory scanner
- *
- * @return array
- */
- protected function findFiles()
- {
- $ds = new DirectoryScanner();
- $ds->setBasedir($this->dir);
- $ds->setIncludes(array('**/composer.json'));
- $ds->scan();
- return $ds->getIncludedFiles();
- }
-
- /**
- * Find composer installation
- *
- */
- protected function findComposer()
- {
- $basedir = $this->project->getBasedir();
- $php = $this->project->getProperty('php.interpreter');
-
- if (file_exists($basedir . '/composer.phar')) {
- $this->composer = "$php $basedir/composer.phar";
- } else {
- $out = array();
- exec('which composer', $out);
- if (empty($out)) {
- throw new BuildException(
- 'Could not determine composer location.'
- );
- }
- $this->composer = $out[0];
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/phing/tasks/GuzzlePearPharPackageTask.php b/lib/gerencianet/guzzle/guzzle/phing/tasks/GuzzlePearPharPackageTask.php
deleted file mode 100644
index f72a6b5..0000000
--- a/lib/gerencianet/guzzle/guzzle/phing/tasks/GuzzlePearPharPackageTask.php
+++ /dev/null
@@ -1,338 +0,0 @@
-
- * @license http://claylo.mit-license.org/2012/ MIT License
- */
-
-require_once 'phing/Task.php';
-require_once 'PEAR/PackageFileManager2.php';
-require_once 'PEAR/PackageFileManager/File.php';
-require_once 'PEAR/Packager.php';
-
-class GuzzlePearPharPackageTask extends Task
-{
- private $version;
- private $deploy = true;
- private $makephar = true;
-
- private $subpackages = array();
-
- public function setVersion($str)
- {
- $this->version = $str;
- }
-
- public function getVersion()
- {
- return $this->version;
- }
-
- public function setDeploy($deploy)
- {
- $this->deploy = (bool) $deploy;
- }
-
- public function getDeploy()
- {
- return $this->deploy;
- }
-
- public function setMakephar($makephar)
- {
- $this->makephar = (bool) $makephar;
- }
-
- public function getMakephar()
- {
- return $this->makephar;
- }
-
- private $basedir;
- private $guzzleinfo;
- private $changelog_release_date;
- private $changelog_notes = '-';
-
- public function main()
- {
- $this->basedir = $this->getProject()->getBasedir();
-
- if (!is_dir((string) $this->basedir.'/.subsplit')) {
- throw new BuildException('PEAR packaging requires .subsplit directory');
- }
-
- // main composer file
- $composer_file = file_get_contents((string) $this->basedir.'/.subsplit/composer.json');
- $this->guzzleinfo = json_decode($composer_file, true);
-
- // make sure we have a target
- $pearwork = (string) $this->basedir . '/build/pearwork';
- if (!is_dir($pearwork)) {
- mkdir($pearwork, 0777, true);
- }
- $pearlogs = (string) $this->basedir . '/build/artifacts/logs';
- if (!is_dir($pearlogs)) {
- mkdir($pearlogs, 0777, true);
- }
-
- $version = $this->getVersion();
- $this->grabChangelog();
- if ($version[0] == '2') {
- $this->log('building single PEAR package');
- $this->buildSinglePackage();
- } else {
- // $this->log("building PEAR subpackages");
- // $this->createSubPackages();
- // $this->log("building PEAR bundle package");
- $this->buildSinglePackage();
- }
-
- if ($this->getMakephar()) {
- $this->log("building PHAR");
- $this->getProject()->executeTarget('package-phar');
- }
-
- if ($this->getDeploy()) {
- $this->doDeployment();
- }
- }
-
- public function doDeployment()
- {
- $basedir = (string) $this->basedir;
- $this->log('beginning PEAR/PHAR deployment');
-
- chdir($basedir . '/build/pearwork');
- if (!is_dir('./channel')) {
- mkdir('./channel');
- }
-
- // Pull the PEAR channel down locally
- passthru('aws s3 sync s3://pear.guzzlephp.org ./channel');
-
- // add PEAR packages
- foreach (scandir('./') as $file) {
- if (substr($file, -4) == '.tgz') {
- passthru('pirum add ./channel ' . $file);
- }
- }
-
- // if we have a new phar, add it
- if ($this->getMakephar() && file_exists($basedir . '/build/artifacts/guzzle.phar')) {
- rename($basedir . '/build/artifacts/guzzle.phar', './channel/guzzle.phar');
- }
-
- // Sync up with the S3 bucket
- chdir($basedir . '/build/pearwork/channel');
- passthru('aws s3 sync . s3://pear.guzzlephp.org');
- }
-
- public function buildSinglePackage()
- {
- $v = $this->getVersion();
- $apiversion = $v[0] . '.0.0';
-
- $opts = array(
- 'packagedirectory' => (string) $this->basedir . '/.subsplit/src/',
- 'filelistgenerator' => 'file',
- 'ignore' => array('*composer.json'),
- 'baseinstalldir' => '/',
- 'packagefile' => 'package.xml'
- //'outputdirectory' => (string) $this->basedir . '/build/pearwork/'
- );
- $pfm = new PEAR_PackageFileManager2();
- $pfm->setOptions($opts);
- $pfm->addRole('md', 'doc');
- $pfm->addRole('pem', 'php');
- $pfm->setPackage('Guzzle');
- $pfm->setSummary("Object-oriented PHP HTTP Client for PHP 5.3+");
- $pfm->setDescription($this->guzzleinfo['description']);
- $pfm->setPackageType('php');
- $pfm->setChannel('guzzlephp.org/pear');
- $pfm->setAPIVersion($apiversion);
- $pfm->setReleaseVersion($this->getVersion());
- $pfm->setAPIStability('stable');
- $pfm->setReleaseStability('stable');
- $pfm->setNotes($this->changelog_notes);
- $pfm->setPackageType('php');
- $pfm->setLicense('MIT', 'http://github.com/guzzle/guzzle/blob/master/LICENSE');
- $pfm->addMaintainer('lead', 'mtdowling', 'Michael Dowling', 'mtdowling@gmail.com', 'yes');
- $pfm->setDate($this->changelog_release_date);
- $pfm->generateContents();
-
- $phpdep = $this->guzzleinfo['require']['php'];
- $phpdep = str_replace('>=', '', $phpdep);
- $pfm->setPhpDep($phpdep);
- $pfm->addExtensionDep('required', 'curl');
- $pfm->setPearinstallerDep('1.4.6');
- $pfm->addPackageDepWithChannel('required', 'EventDispatcher', 'pear.symfony.com', '2.1.0');
- if (!empty($this->subpackages)) {
- foreach ($this->subpackages as $package) {
- $pkg = dirname($package);
- $pkg = str_replace('/', '_', $pkg);
- $pfm->addConflictingPackageDepWithChannel($pkg, 'guzzlephp.org/pear', false, $apiversion);
- }
- }
-
- ob_start();
- $startdir = getcwd();
- chdir((string) $this->basedir . '/build/pearwork');
-
- echo "DEBUGGING GENERATED PACKAGE FILE\n";
- $result = $pfm->debugPackageFile();
- if ($result) {
- $out = $pfm->writePackageFile();
- echo "\n\n\nWRITE PACKAGE FILE RESULT:\n";
- var_dump($out);
- // load up package file and build package
- $packager = new PEAR_Packager();
- echo "\n\n\nBUILDING PACKAGE FROM PACKAGE FILE:\n";
- $dest_package = $packager->package($opts['packagedirectory'].'package.xml');
- var_dump($dest_package);
- } else {
- echo "\n\n\nDEBUGGING RESULT:\n";
- var_dump($result);
- }
- echo "removing package.xml";
- unlink($opts['packagedirectory'].'package.xml');
- $log = ob_get_clean();
- file_put_contents((string) $this->basedir . '/build/artifacts/logs/pear_package.log', $log);
- chdir($startdir);
- }
-
- public function createSubPackages()
- {
- $this->findComponents();
-
- foreach ($this->subpackages as $package) {
- $baseinstalldir = dirname($package);
- $dir = (string) $this->basedir.'/.subsplit/src/' . $baseinstalldir;
- $composer_file = file_get_contents((string) $this->basedir.'/.subsplit/src/'. $package);
- $package_info = json_decode($composer_file, true);
- $this->log('building ' . $package_info['target-dir'] . ' subpackage');
- $this->buildSubPackage($dir, $baseinstalldir, $package_info);
- }
- }
-
- public function buildSubPackage($dir, $baseinstalldir, $info)
- {
- $package = str_replace('/', '_', $baseinstalldir);
- $opts = array(
- 'packagedirectory' => $dir,
- 'filelistgenerator' => 'file',
- 'ignore' => array('*composer.json', '*package.xml'),
- 'baseinstalldir' => '/' . $info['target-dir'],
- 'packagefile' => 'package.xml'
- );
- $pfm = new PEAR_PackageFileManager2();
- $pfm->setOptions($opts);
- $pfm->setPackage($package);
- $pfm->setSummary($info['description']);
- $pfm->setDescription($info['description']);
- $pfm->setPackageType('php');
- $pfm->setChannel('guzzlephp.org/pear');
- $pfm->setAPIVersion('3.0.0');
- $pfm->setReleaseVersion($this->getVersion());
- $pfm->setAPIStability('stable');
- $pfm->setReleaseStability('stable');
- $pfm->setNotes($this->changelog_notes);
- $pfm->setPackageType('php');
- $pfm->setLicense('MIT', 'http://github.com/guzzle/guzzle/blob/master/LICENSE');
- $pfm->addMaintainer('lead', 'mtdowling', 'Michael Dowling', 'mtdowling@gmail.com', 'yes');
- $pfm->setDate($this->changelog_release_date);
- $pfm->generateContents();
-
- $phpdep = $this->guzzleinfo['require']['php'];
- $phpdep = str_replace('>=', '', $phpdep);
- $pfm->setPhpDep($phpdep);
- $pfm->setPearinstallerDep('1.4.6');
-
- foreach ($info['require'] as $type => $version) {
- if ($type == 'php') {
- continue;
- }
- if ($type == 'symfony/event-dispatcher') {
- $pfm->addPackageDepWithChannel('required', 'EventDispatcher', 'pear.symfony.com', '2.1.0');
- }
- if ($type == 'ext-curl') {
- $pfm->addExtensionDep('required', 'curl');
- }
- if (substr($type, 0, 6) == 'guzzle') {
- $gdep = str_replace('/', ' ', $type);
- $gdep = ucwords($gdep);
- $gdep = str_replace(' ', '_', $gdep);
- $pfm->addPackageDepWithChannel('required', $gdep, 'guzzlephp.org/pear', $this->getVersion());
- }
- }
-
- // can't have main Guzzle package AND sub-packages
- $pfm->addConflictingPackageDepWithChannel('Guzzle', 'guzzlephp.org/pear', false, $apiversion);
-
- ob_start();
- $startdir = getcwd();
- chdir((string) $this->basedir . '/build/pearwork');
-
- echo "DEBUGGING GENERATED PACKAGE FILE\n";
- $result = $pfm->debugPackageFile();
- if ($result) {
- $out = $pfm->writePackageFile();
- echo "\n\n\nWRITE PACKAGE FILE RESULT:\n";
- var_dump($out);
- // load up package file and build package
- $packager = new PEAR_Packager();
- echo "\n\n\nBUILDING PACKAGE FROM PACKAGE FILE:\n";
- $dest_package = $packager->package($opts['packagedirectory'].'/package.xml');
- var_dump($dest_package);
- } else {
- echo "\n\n\nDEBUGGING RESULT:\n";
- var_dump($result);
- }
- echo "removing package.xml";
- unlink($opts['packagedirectory'].'/package.xml');
- $log = ob_get_clean();
- file_put_contents((string) $this->basedir . '/build/artifacts/logs/pear_package_'.$package.'.log', $log);
- chdir($startdir);
- }
-
- public function findComponents()
- {
- $ds = new DirectoryScanner();
- $ds->setBasedir((string) $this->basedir.'/.subsplit/src');
- $ds->setIncludes(array('**/composer.json'));
- $ds->scan();
- $files = $ds->getIncludedFiles();
- $this->subpackages = $files;
- }
-
- public function grabChangelog()
- {
- $cl = file((string) $this->basedir.'/.subsplit/CHANGELOG.md');
- $notes = '';
- $in_version = false;
- $release_date = null;
-
- foreach ($cl as $line) {
- $line = trim($line);
- if (preg_match('/^\* '.$this->getVersion().' \(([0-9\-]+)\)$/', $line, $matches)) {
- $release_date = $matches[1];
- $in_version = true;
- continue;
- }
- if ($in_version && empty($line) && empty($notes)) {
- continue;
- }
- if ($in_version && ! empty($line)) {
- $notes .= $line."\n";
- }
- if ($in_version && empty($line) && !empty($notes)) {
- $in_version = false;
- }
- }
- $this->changelog_release_date = $release_date;
-
- if (! empty($notes)) {
- $this->changelog_notes = $notes;
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/phing/tasks/GuzzleSubSplitTask.php b/lib/gerencianet/guzzle/guzzle/phing/tasks/GuzzleSubSplitTask.php
deleted file mode 100644
index 5d56a5b..0000000
--- a/lib/gerencianet/guzzle/guzzle/phing/tasks/GuzzleSubSplitTask.php
+++ /dev/null
@@ -1,385 +0,0 @@
-
- * @license http://claylo.mit-license.org/2012/ MIT License
- */
-
-require_once 'phing/tasks/ext/git/GitBaseTask.php';
-
-// base - base of tree to split out
-// subIndicatorFile - composer.json, package.xml?
-class GuzzleSubSplitTask extends GitBaseTask
-{
- /**
- * What git repository to pull from and publish to
- */
- protected $remote = null;
-
- /**
- * Publish for comma-separated heads instead of all heads
- */
- protected $heads = null;
-
- /**
- * Publish for comma-separated tags instead of all tags
- */
- protected $tags = null;
-
- /**
- * Base of the tree RELATIVE TO .subsplit working dir
- */
- protected $base = null;
-
- /**
- * The presence of this file will indicate that the directory it resides
- * in is at the top level of a split.
- */
- protected $subIndicatorFile = 'composer.json';
-
- /**
- * Do everything except actually send the update.
- */
- protected $dryRun = null;
-
- /**
- * Do not sync any heads.
- */
- protected $noHeads = false;
-
- /**
- * Do not sync any tags.
- */
- protected $noTags = false;
-
- /**
- * The splits we found in the heads
- */
- protected $splits;
-
- public function setRemote($str)
- {
- $this->remote = $str;
- }
-
- public function getRemote()
- {
- return $this->remote;
- }
-
- public function setHeads($str)
- {
- $this->heads = explode(',', $str);
- }
-
- public function getHeads()
- {
- return $this->heads;
- }
-
- public function setTags($str)
- {
- $this->tags = explode(',', $str);
- }
-
- public function getTags()
- {
- return $this->tags;
- }
-
- public function setBase($str)
- {
- $this->base = $str;
- }
-
- public function getBase()
- {
- return $this->base;
- }
-
- public function setSubIndicatorFile($str)
- {
- $this->subIndicatorFile = $str;
- }
-
- public function getSubIndicatorFile()
- {
- return $this->subIndicatorFile;
- }
-
- public function setDryRun($bool)
- {
- $this->dryRun = (bool) $bool;
- }
-
- public function getDryRun()
- {
- return $this->dryRun;
- }
-
- public function setNoHeads($bool)
- {
- $this->noHeads = (bool) $bool;
- }
-
- public function getNoHeads()
- {
- return $this->noHeads;
- }
-
- public function setNoTags($bool)
- {
- $this->noTags = (bool) $bool;
- }
-
- public function getNoTags()
- {
- return $this->noTags;
- }
-
- /**
- * GitClient from VersionControl_Git
- */
- protected $client = null;
-
- /**
- * The main entry point
- */
- public function main()
- {
- $repo = $this->getRepository();
- if (empty($repo)) {
- throw new BuildException('"repository" is a required parameter');
- }
-
- $remote = $this->getRemote();
- if (empty($remote)) {
- throw new BuildException('"remote" is a required parameter');
- }
-
- chdir($repo);
- $this->client = $this->getGitClient(false, $repo);
-
- // initalized yet?
- if (!is_dir('.subsplit')) {
- $this->subsplitInit();
- } else {
- // update
- $this->subsplitUpdate();
- }
-
- // find all splits based on heads requested
- $this->findSplits();
-
- // check that GitHub has the repos
- $this->verifyRepos();
-
- // execute the subsplits
- $this->publish();
- }
-
- public function publish()
- {
- $this->log('DRY RUN ONLY FOR NOW');
- $base = $this->getBase();
- $base = rtrim($base, '/') . '/';
- $org = $this->getOwningTarget()->getProject()->getProperty('github.org');
-
- $splits = array();
-
- $heads = $this->getHeads();
- foreach ($heads as $head) {
- foreach ($this->splits[$head] as $component => $meta) {
- $splits[] = $base . $component . ':git@github.com:'. $org.'/'.$meta['repo'];
- }
-
- $cmd = 'git subsplit publish ';
- $cmd .= escapeshellarg(implode(' ', $splits));
-
- if ($this->getNoHeads()) {
- $cmd .= ' --no-heads';
- } else {
- $cmd .= ' --heads='.$head;
- }
-
- if ($this->getNoTags()) {
- $cmd .= ' --no-tags';
- } else {
- if ($this->getTags()) {
- $cmd .= ' --tags=' . escapeshellarg(implode(' ', $this->getTags()));
- }
- }
-
- passthru($cmd);
- }
- }
-
- /**
- * Runs `git subsplit update`
- */
- public function subsplitUpdate()
- {
- $repo = $this->getRepository();
- $this->log('git-subsplit update...');
- $cmd = $this->client->getCommand('subsplit');
- $cmd->addArgument('update');
- try {
- $cmd->execute();
- } catch (Exception $e) {
- throw new BuildException('git subsplit update failed'. $e);
- }
- chdir($repo . '/.subsplit');
- passthru('php ../composer.phar update --dev');
- chdir($repo);
- }
-
- /**
- * Runs `git subsplit init` based on the remote repository.
- */
- public function subsplitInit()
- {
- $remote = $this->getRemote();
- $cmd = $this->client->getCommand('subsplit');
- $this->log('running git-subsplit init ' . $remote);
-
- $cmd->setArguments(array(
- 'init',
- $remote
- ));
-
- try {
- $output = $cmd->execute();
- } catch (Exception $e) {
- throw new BuildException('git subsplit init failed'. $e);
- }
- $this->log(trim($output), Project::MSG_INFO);
- $repo = $this->getRepository();
- chdir($repo . '/.subsplit');
- passthru('php ../composer.phar install --dev');
- chdir($repo);
- }
-
- /**
- * Find the composer.json files using Phing's directory scanner
- *
- * @return array
- */
- protected function findSplits()
- {
- $this->log("checking heads for subsplits");
- $repo = $this->getRepository();
- $base = $this->getBase();
-
- $splits = array();
- $heads = $this->getHeads();
-
- if (!empty($base)) {
- $base = '/' . ltrim($base, '/');
- } else {
- $base = '/';
- }
-
- chdir($repo . '/.subsplit');
- foreach ($heads as $head) {
- $splits[$head] = array();
-
- // check each head requested *BEFORE* the actual subtree split command gets it
- passthru("git checkout '$head'");
- $ds = new DirectoryScanner();
- $ds->setBasedir($repo . '/.subsplit' . $base);
- $ds->setIncludes(array('**/'.$this->subIndicatorFile));
- $ds->scan();
- $files = $ds->getIncludedFiles();
-
- // Process the files we found
- foreach ($files as $file) {
- $pkg = file_get_contents($repo . '/.subsplit' . $base .'/'. $file);
- $pkg_json = json_decode($pkg, true);
- $name = $pkg_json['name'];
- $component = str_replace('/composer.json', '', $file);
- // keep this for split cmd
- $tmpreponame = explode('/', $name);
- $reponame = $tmpreponame[1];
- $splits[$head][$component]['repo'] = $reponame;
- $nscomponent = str_replace('/', '\\', $component);
- $splits[$head][$component]['desc'] = "[READ ONLY] Subtree split of $nscomponent: " . $pkg_json['description'];
- }
- }
-
- // go back to how we found it
- passthru("git checkout master");
- chdir($repo);
- $this->splits = $splits;
- }
-
- /**
- * Based on list of repositories we determined we *should* have, talk
- * to GitHub and make sure they're all there.
- *
- */
- protected function verifyRepos()
- {
- $this->log('verifying GitHub target repos');
- $github_org = $this->getOwningTarget()->getProject()->getProperty('github.org');
- $github_creds = $this->getOwningTarget()->getProject()->getProperty('github.basicauth');
-
- if ($github_creds == 'username:password') {
- $this->log('Skipping GitHub repo checks. Update github.basicauth in build.properties to verify repos.', 1);
- return;
- }
-
- $ch = curl_init('https://api.github.com/orgs/'.$github_org.'/repos?type=all');
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_USERPWD, $github_creds);
- // change this when we know we can use our bundled CA bundle!
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- $result = curl_exec($ch);
- curl_close($ch);
- $repos = json_decode($result, true);
- $existing_repos = array();
-
- // parse out the repos we found on GitHub
- foreach ($repos as $repo) {
- $tmpreponame = explode('/', $repo['full_name']);
- $reponame = $tmpreponame[1];
- $existing_repos[$reponame] = $repo['description'];
- }
-
- $heads = $this->getHeads();
- foreach ($heads as $head) {
- foreach ($this->splits[$head] as $component => $meta) {
-
- $reponame = $meta['repo'];
-
- if (!isset($existing_repos[$reponame])) {
- $this->log("Creating missing repo $reponame");
- $payload = array(
- 'name' => $reponame,
- 'description' => $meta['desc'],
- 'homepage' => 'http://www.guzzlephp.org/',
- 'private' => true,
- 'has_issues' => false,
- 'has_wiki' => false,
- 'has_downloads' => true,
- 'auto_init' => false
- );
- $ch = curl_init('https://api.github.com/orgs/'.$github_org.'/repos');
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_USERPWD, $github_creds);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
- // change this when we know we can use our bundled CA bundle!
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- $result = curl_exec($ch);
- echo "Response code: ".curl_getinfo($ch, CURLINFO_HTTP_CODE)."\n";
- curl_close($ch);
- } else {
- $this->log("Repo $reponame exists", 2);
- }
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/phpunit.xml.dist b/lib/gerencianet/guzzle/guzzle/phpunit.xml.dist
deleted file mode 100644
index 208fdc0..0000000
--- a/lib/gerencianet/guzzle/guzzle/phpunit.xml.dist
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
- ./tests/Guzzle/Tests
-
-
-
-
-
-
-
-
-
- ./src/Guzzle
-
- ./src/Guzzle
- ./src/Guzzle/Common/Exception/GuzzleException.php
- ./src/Guzzle/Http/Exception/HttpException.php
- ./src/Guzzle/Http/Exception/ServerErrorResponseException.php
- ./src/Guzzle/Http/Exception/ClientErrorResponseException.php
- ./src/Guzzle/Http/Exception/TooManyRedirectsException.php
- ./src/Guzzle/Http/Exception/CouldNotRewindStreamException.php
- ./src/Guzzle/Common/Exception/BadMethodCallException.php
- ./src/Guzzle/Common/Exception/InvalidArgumentException.php
- ./src/Guzzle/Common/Exception/RuntimeException.php
- ./src/Guzzle/Common/Exception/UnexpectedValueException.php
- ./src/Guzzle/Service/Exception/ClientNotFoundException.php
- ./src/Guzzle/Service/Exception/CommandException.php
- ./src/Guzzle/Service/Exception/DescriptionBuilderException.php
- ./src/Guzzle/Service/Exception/ServiceBuilderException.php
- ./src/Guzzle/Service/Exception/ServiceNotFoundException.php
- ./src/Guzzle/Service/Exception/ValidationException.php
- ./src/Guzzle/Service/Exception/JsonException.php
-
-
-
-
-
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/AbstractBatchDecorator.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/AbstractBatchDecorator.php
deleted file mode 100644
index 0625d71..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/AbstractBatchDecorator.php
+++ /dev/null
@@ -1,66 +0,0 @@
-decoratedBatch = $decoratedBatch;
- }
-
- /**
- * Allow decorators to implement custom methods
- *
- * @param string $method Missing method name
- * @param array $args Method arguments
- *
- * @return mixed
- * @codeCoverageIgnore
- */
- public function __call($method, array $args)
- {
- return call_user_func_array(array($this->decoratedBatch, $method), $args);
- }
-
- public function add($item)
- {
- $this->decoratedBatch->add($item);
-
- return $this;
- }
-
- public function flush()
- {
- return $this->decoratedBatch->flush();
- }
-
- public function isEmpty()
- {
- return $this->decoratedBatch->isEmpty();
- }
-
- /**
- * Trace the decorators associated with the batch
- *
- * @return array
- */
- public function getDecorators()
- {
- $found = array($this);
- if (method_exists($this->decoratedBatch, 'getDecorators')) {
- $found = array_merge($found, $this->decoratedBatch->getDecorators());
- }
-
- return $found;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/Batch.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/Batch.php
deleted file mode 100644
index 4d41c54..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/Batch.php
+++ /dev/null
@@ -1,92 +0,0 @@
-transferStrategy = $transferStrategy;
- $this->divisionStrategy = $divisionStrategy;
- $this->queue = new \SplQueue();
- $this->queue->setIteratorMode(\SplQueue::IT_MODE_DELETE);
- $this->dividedBatches = array();
- }
-
- public function add($item)
- {
- $this->queue->enqueue($item);
-
- return $this;
- }
-
- public function flush()
- {
- $this->createBatches();
-
- $items = array();
- foreach ($this->dividedBatches as $batchIndex => $dividedBatch) {
- while ($dividedBatch->valid()) {
- $batch = $dividedBatch->current();
- $dividedBatch->next();
- try {
- $this->transferStrategy->transfer($batch);
- $items = array_merge($items, $batch);
- } catch (\Exception $e) {
- throw new BatchTransferException($batch, $items, $e, $this->transferStrategy, $this->divisionStrategy);
- }
- }
- // Keep the divided batch down to a minimum in case of a later exception
- unset($this->dividedBatches[$batchIndex]);
- }
-
- return $items;
- }
-
- public function isEmpty()
- {
- return count($this->queue) == 0 && count($this->dividedBatches) == 0;
- }
-
- /**
- * Create batches for any queued items
- */
- protected function createBatches()
- {
- if (count($this->queue)) {
- if ($batches = $this->divisionStrategy->createBatches($this->queue)) {
- // Convert arrays into iterators
- if (is_array($batches)) {
- $batches = new \ArrayIterator($batches);
- }
- $this->dividedBatches[] = $batches;
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchBuilder.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchBuilder.php
deleted file mode 100644
index ea99b4d..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchBuilder.php
+++ /dev/null
@@ -1,199 +0,0 @@
- 'Guzzle\Batch\BatchRequestTransfer',
- 'command' => 'Guzzle\Batch\BatchCommandTransfer'
- );
-
- /**
- * Create a new instance of the BatchBuilder
- *
- * @return BatchBuilder
- */
- public static function factory()
- {
- return new self();
- }
-
- /**
- * Automatically flush the batch when the size of the queue reaches a certain threshold. Adds {@see FlushingBatch}.
- *
- * @param $threshold Number of items to allow in the queue before a flush
- *
- * @return BatchBuilder
- */
- public function autoFlushAt($threshold)
- {
- $this->autoFlush = $threshold;
-
- return $this;
- }
-
- /**
- * Maintain a history of all items that have been transferred using the batch. Adds {@see HistoryBatch}.
- *
- * @return BatchBuilder
- */
- public function keepHistory()
- {
- $this->history = true;
-
- return $this;
- }
-
- /**
- * Buffer exceptions thrown during transfer so that you can transfer as much as possible, and after a transfer
- * completes, inspect each exception that was thrown. Enables the {@see ExceptionBufferingBatch} decorator.
- *
- * @return BatchBuilder
- */
- public function bufferExceptions()
- {
- $this->exceptionBuffering = true;
-
- return $this;
- }
-
- /**
- * Notify a callable each time a batch flush completes. Enables the {@see NotifyingBatch} decorator.
- *
- * @param mixed $callable Callable function to notify
- *
- * @return BatchBuilder
- * @throws InvalidArgumentException if the argument is not callable
- */
- public function notify($callable)
- {
- $this->afterFlush = $callable;
-
- return $this;
- }
-
- /**
- * Configures the batch to transfer batches of requests. Associates a {@see \Guzzle\Http\BatchRequestTransfer}
- * object as both the transfer and divisor strategy.
- *
- * @param int $batchSize Batch size for each batch of requests
- *
- * @return BatchBuilder
- */
- public function transferRequests($batchSize = 50)
- {
- $className = self::$mapping['request'];
- $this->transferStrategy = new $className($batchSize);
- $this->divisorStrategy = $this->transferStrategy;
-
- return $this;
- }
-
- /**
- * Configures the batch to transfer batches commands. Associates as
- * {@see \Guzzle\Service\Command\BatchCommandTransfer} as both the transfer and divisor strategy.
- *
- * @param int $batchSize Batch size for each batch of commands
- *
- * @return BatchBuilder
- */
- public function transferCommands($batchSize = 50)
- {
- $className = self::$mapping['command'];
- $this->transferStrategy = new $className($batchSize);
- $this->divisorStrategy = $this->transferStrategy;
-
- return $this;
- }
-
- /**
- * Specify the strategy used to divide the queue into an array of batches
- *
- * @param BatchDivisorInterface $divisorStrategy Strategy used to divide a batch queue into batches
- *
- * @return BatchBuilder
- */
- public function createBatchesWith(BatchDivisorInterface $divisorStrategy)
- {
- $this->divisorStrategy = $divisorStrategy;
-
- return $this;
- }
-
- /**
- * Specify the strategy used to transport the items when flush is called
- *
- * @param BatchTransferInterface $transferStrategy How items are transferred
- *
- * @return BatchBuilder
- */
- public function transferWith(BatchTransferInterface $transferStrategy)
- {
- $this->transferStrategy = $transferStrategy;
-
- return $this;
- }
-
- /**
- * Create and return the instantiated batch
- *
- * @return BatchInterface
- * @throws RuntimeException if no transfer strategy has been specified
- */
- public function build()
- {
- if (!$this->transferStrategy) {
- throw new RuntimeException('No transfer strategy has been specified');
- }
-
- if (!$this->divisorStrategy) {
- throw new RuntimeException('No divisor strategy has been specified');
- }
-
- $batch = new Batch($this->transferStrategy, $this->divisorStrategy);
-
- if ($this->exceptionBuffering) {
- $batch = new ExceptionBufferingBatch($batch);
- }
-
- if ($this->afterFlush) {
- $batch = new NotifyingBatch($batch, $this->afterFlush);
- }
-
- if ($this->autoFlush) {
- $batch = new FlushingBatch($batch, $this->autoFlush);
- }
-
- if ($this->history) {
- $batch = new HistoryBatch($batch);
- }
-
- return $batch;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchClosureDivisor.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchClosureDivisor.php
deleted file mode 100644
index e0a2d95..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchClosureDivisor.php
+++ /dev/null
@@ -1,39 +0,0 @@
-callable = $callable;
- $this->context = $context;
- }
-
- public function createBatches(\SplQueue $queue)
- {
- return call_user_func($this->callable, $queue, $this->context);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchClosureTransfer.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchClosureTransfer.php
deleted file mode 100644
index 9cbf1ab..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchClosureTransfer.php
+++ /dev/null
@@ -1,40 +0,0 @@
-callable = $callable;
- $this->context = $context;
- }
-
- public function transfer(array $batch)
- {
- return empty($batch) ? null : call_user_func($this->callable, $batch, $this->context);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchCommandTransfer.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchCommandTransfer.php
deleted file mode 100644
index d55ac7d..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchCommandTransfer.php
+++ /dev/null
@@ -1,75 +0,0 @@
-batchSize = $batchSize;
- }
-
- /**
- * Creates batches by grouping commands by their associated client
- * {@inheritdoc}
- */
- public function createBatches(\SplQueue $queue)
- {
- $groups = new \SplObjectStorage();
- foreach ($queue as $item) {
- if (!$item instanceof CommandInterface) {
- throw new InvalidArgumentException('All items must implement Guzzle\Service\Command\CommandInterface');
- }
- $client = $item->getClient();
- if (!$groups->contains($client)) {
- $groups->attach($client, new \ArrayObject(array($item)));
- } else {
- $groups[$client]->append($item);
- }
- }
-
- $batches = array();
- foreach ($groups as $batch) {
- $batches = array_merge($batches, array_chunk($groups[$batch]->getArrayCopy(), $this->batchSize));
- }
-
- return $batches;
- }
-
- public function transfer(array $batch)
- {
- if (empty($batch)) {
- return;
- }
-
- // Get the client of the first found command
- $client = reset($batch)->getClient();
-
- // Keep a list of all commands with invalid clients
- $invalid = array_filter($batch, function ($command) use ($client) {
- return $command->getClient() !== $client;
- });
-
- if (!empty($invalid)) {
- throw new InconsistentClientTransferException($invalid);
- }
-
- $client->execute($batch);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchDivisorInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchDivisorInterface.php
deleted file mode 100644
index 0214f05..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchDivisorInterface.php
+++ /dev/null
@@ -1,18 +0,0 @@
-batchSize = $batchSize;
- }
-
- /**
- * Creates batches of requests by grouping requests by their associated curl multi object.
- * {@inheritdoc}
- */
- public function createBatches(\SplQueue $queue)
- {
- // Create batches by client objects
- $groups = new \SplObjectStorage();
- foreach ($queue as $item) {
- if (!$item instanceof RequestInterface) {
- throw new InvalidArgumentException('All items must implement Guzzle\Http\Message\RequestInterface');
- }
- $client = $item->getClient();
- if (!$groups->contains($client)) {
- $groups->attach($client, array($item));
- } else {
- $current = $groups[$client];
- $current[] = $item;
- $groups[$client] = $current;
- }
- }
-
- $batches = array();
- foreach ($groups as $batch) {
- $batches = array_merge($batches, array_chunk($groups[$batch], $this->batchSize));
- }
-
- return $batches;
- }
-
- public function transfer(array $batch)
- {
- if ($batch) {
- reset($batch)->getClient()->send($batch);
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchSizeDivisor.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchSizeDivisor.php
deleted file mode 100644
index 67f90a5..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchSizeDivisor.php
+++ /dev/null
@@ -1,47 +0,0 @@
-size = $size;
- }
-
- /**
- * Set the size of each batch
- *
- * @param int $size Size of each batch
- *
- * @return BatchSizeDivisor
- */
- public function setSize($size)
- {
- $this->size = $size;
-
- return $this;
- }
-
- /**
- * Get the size of each batch
- *
- * @return int
- */
- public function getSize()
- {
- return $this->size;
- }
-
- public function createBatches(\SplQueue $queue)
- {
- return array_chunk(iterator_to_array($queue, false), $this->size);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchTransferInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchTransferInterface.php
deleted file mode 100644
index 2e0b60d..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/BatchTransferInterface.php
+++ /dev/null
@@ -1,16 +0,0 @@
-batch = $batch;
- $this->transferredItems = $transferredItems;
- $this->transferStrategy = $transferStrategy;
- $this->divisorStrategy = $divisorStrategy;
- parent::__construct(
- 'Exception encountered while transferring batch: ' . $exception->getMessage(),
- $exception->getCode(),
- $exception
- );
- }
-
- /**
- * Get the batch that we being sent when the exception occurred
- *
- * @return array
- */
- public function getBatch()
- {
- return $this->batch;
- }
-
- /**
- * Get the items transferred at the point in which the exception was encountered
- *
- * @return array
- */
- public function getTransferredItems()
- {
- return $this->transferredItems;
- }
-
- /**
- * Get the transfer strategy
- *
- * @return TransferStrategy
- */
- public function getTransferStrategy()
- {
- return $this->transferStrategy;
- }
-
- /**
- * Get the divisor strategy
- *
- * @return DivisorStrategy
- */
- public function getDivisorStrategy()
- {
- return $this->divisorStrategy;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/ExceptionBufferingBatch.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/ExceptionBufferingBatch.php
deleted file mode 100644
index d7a8928..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/ExceptionBufferingBatch.php
+++ /dev/null
@@ -1,50 +0,0 @@
-decoratedBatch->isEmpty()) {
- try {
- $transferredItems = $this->decoratedBatch->flush();
- } catch (BatchTransferException $e) {
- $this->exceptions[] = $e;
- $transferredItems = $e->getTransferredItems();
- }
- $items = array_merge($items, $transferredItems);
- }
-
- return $items;
- }
-
- /**
- * Get the buffered exceptions
- *
- * @return array Array of BatchTransferException objects
- */
- public function getExceptions()
- {
- return $this->exceptions;
- }
-
- /**
- * Clear the buffered exceptions
- */
- public function clearExceptions()
- {
- $this->exceptions = array();
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/FlushingBatch.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/FlushingBatch.php
deleted file mode 100644
index 367b684..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/FlushingBatch.php
+++ /dev/null
@@ -1,60 +0,0 @@
-threshold = $threshold;
- parent::__construct($decoratedBatch);
- }
-
- /**
- * Set the auto-flush threshold
- *
- * @param int $threshold The auto-flush threshold
- *
- * @return FlushingBatch
- */
- public function setThreshold($threshold)
- {
- $this->threshold = $threshold;
-
- return $this;
- }
-
- /**
- * Get the auto-flush threshold
- *
- * @return int
- */
- public function getThreshold()
- {
- return $this->threshold;
- }
-
- public function add($item)
- {
- $this->decoratedBatch->add($item);
- if (++$this->currentTotal >= $this->threshold) {
- $this->currentTotal = 0;
- $this->decoratedBatch->flush();
- }
-
- return $this;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/HistoryBatch.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/HistoryBatch.php
deleted file mode 100644
index e345fdc..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/HistoryBatch.php
+++ /dev/null
@@ -1,39 +0,0 @@
-history[] = $item;
- $this->decoratedBatch->add($item);
-
- return $this;
- }
-
- /**
- * Get the batch history
- *
- * @return array
- */
- public function getHistory()
- {
- return $this->history;
- }
-
- /**
- * Clear the batch history
- */
- public function clearHistory()
- {
- $this->history = array();
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/NotifyingBatch.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/NotifyingBatch.php
deleted file mode 100644
index 96d04da..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/NotifyingBatch.php
+++ /dev/null
@@ -1,38 +0,0 @@
-callable = $callable;
- parent::__construct($decoratedBatch);
- }
-
- public function flush()
- {
- $items = $this->decoratedBatch->flush();
- call_user_func($this->callable, $items);
-
- return $items;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/composer.json b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/composer.json
deleted file mode 100644
index 12404d3..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Batch/composer.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "name": "guzzle/batch",
- "description": "Guzzle batch component for batching requests, commands, or custom transfers",
- "homepage": "http://guzzlephp.org/",
- "keywords": ["batch", "HTTP", "REST", "guzzle"],
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.3.2",
- "guzzle/common": "self.version"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Batch": "" }
- },
- "suggest": {
- "guzzle/http": "self.version",
- "guzzle/service": "self.version"
- },
- "target-dir": "Guzzle/Batch",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/AbstractCacheAdapter.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/AbstractCacheAdapter.php
deleted file mode 100644
index a5c5271..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/AbstractCacheAdapter.php
+++ /dev/null
@@ -1,21 +0,0 @@
-cache;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/CacheAdapterFactory.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/CacheAdapterFactory.php
deleted file mode 100644
index 94e6234..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/CacheAdapterFactory.php
+++ /dev/null
@@ -1,117 +0,0 @@
-newInstanceArgs($args);
- }
- } catch (\Exception $e) {
- throw new RuntimeException($e->getMessage(), $e->getCode(), $e);
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/CacheAdapterInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/CacheAdapterInterface.php
deleted file mode 100644
index 970c9e2..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/CacheAdapterInterface.php
+++ /dev/null
@@ -1,55 +0,0 @@
-callables = $callables;
- }
-
- public function contains($id, array $options = null)
- {
- return call_user_func($this->callables['contains'], $id, $options);
- }
-
- public function delete($id, array $options = null)
- {
- return call_user_func($this->callables['delete'], $id, $options);
- }
-
- public function fetch($id, array $options = null)
- {
- return call_user_func($this->callables['fetch'], $id, $options);
- }
-
- public function save($id, $data, $lifeTime = false, array $options = null)
- {
- return call_user_func($this->callables['save'], $id, $data, $lifeTime, $options);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/DoctrineCacheAdapter.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/DoctrineCacheAdapter.php
deleted file mode 100644
index e1aaf9f..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/DoctrineCacheAdapter.php
+++ /dev/null
@@ -1,41 +0,0 @@
-cache = $cache;
- }
-
- public function contains($id, array $options = null)
- {
- return $this->cache->contains($id);
- }
-
- public function delete($id, array $options = null)
- {
- return $this->cache->delete($id);
- }
-
- public function fetch($id, array $options = null)
- {
- return $this->cache->fetch($id);
- }
-
- public function save($id, $data, $lifeTime = false, array $options = null)
- {
- return $this->cache->save($id, $data, $lifeTime !== false ? $lifeTime : 0);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/NullCacheAdapter.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/NullCacheAdapter.php
deleted file mode 100644
index 68bd4af..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/NullCacheAdapter.php
+++ /dev/null
@@ -1,31 +0,0 @@
-cache = $cache;
- }
-
- public function contains($id, array $options = null)
- {
- return $this->cache->test($id);
- }
-
- public function delete($id, array $options = null)
- {
- return $this->cache->remove($id);
- }
-
- public function fetch($id, array $options = null)
- {
- return $this->cache->load($id);
- }
-
- public function save($id, $data, $lifeTime = false, array $options = null)
- {
- return $this->cache->save($data, $id, array(), $lifeTime);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/Zf2CacheAdapter.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/Zf2CacheAdapter.php
deleted file mode 100644
index 1fc18a5..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/Zf2CacheAdapter.php
+++ /dev/null
@@ -1,41 +0,0 @@
-cache = $cache;
- }
-
- public function contains($id, array $options = null)
- {
- return $this->cache->hasItem($id);
- }
-
- public function delete($id, array $options = null)
- {
- return $this->cache->removeItem($id);
- }
-
- public function fetch($id, array $options = null)
- {
- return $this->cache->getItem($id);
- }
-
- public function save($id, $data, $lifeTime = false, array $options = null)
- {
- return $this->cache->setItem($id, $data);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/composer.json b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/composer.json
deleted file mode 100644
index a5d999b..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Cache/composer.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "guzzle/cache",
- "description": "Guzzle cache adapter component",
- "homepage": "http://guzzlephp.org/",
- "keywords": ["cache", "adapter", "zf", "doctrine", "guzzle"],
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.3.2",
- "guzzle/common": "self.version"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Cache": "" }
- },
- "target-dir": "Guzzle/Cache",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Common/AbstractHasDispatcher.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Common/AbstractHasDispatcher.php
deleted file mode 100644
index d1e842b..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Common/AbstractHasDispatcher.php
+++ /dev/null
@@ -1,49 +0,0 @@
-eventDispatcher = $eventDispatcher;
-
- return $this;
- }
-
- public function getEventDispatcher()
- {
- if (!$this->eventDispatcher) {
- $this->eventDispatcher = new EventDispatcher();
- }
-
- return $this->eventDispatcher;
- }
-
- public function dispatch($eventName, array $context = array())
- {
- return $this->getEventDispatcher()->dispatch($eventName, new Event($context));
- }
-
- public function addSubscriber(EventSubscriberInterface $subscriber)
- {
- $this->getEventDispatcher()->addSubscriber($subscriber);
-
- return $this;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Common/Collection.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Common/Collection.php
deleted file mode 100644
index 5cb1535..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Common/Collection.php
+++ /dev/null
@@ -1,403 +0,0 @@
-data = $data;
- }
-
- /**
- * Create a new collection from an array, validate the keys, and add default values where missing
- *
- * @param array $config Configuration values to apply.
- * @param array $defaults Default parameters
- * @param array $required Required parameter names
- *
- * @return self
- * @throws InvalidArgumentException if a parameter is missing
- */
- public static function fromConfig(array $config = array(), array $defaults = array(), array $required = array())
- {
- $data = $config + $defaults;
-
- if ($missing = array_diff($required, array_keys($data))) {
- throw new InvalidArgumentException('Config is missing the following keys: ' . implode(', ', $missing));
- }
-
- return new self($data);
- }
-
- public function count()
- {
- return count($this->data);
- }
-
- public function getIterator()
- {
- return new \ArrayIterator($this->data);
- }
-
- public function toArray()
- {
- return $this->data;
- }
-
- /**
- * Removes all key value pairs
- *
- * @return Collection
- */
- public function clear()
- {
- $this->data = array();
-
- return $this;
- }
-
- /**
- * Get all or a subset of matching key value pairs
- *
- * @param array $keys Pass an array of keys to retrieve only a subset of key value pairs
- *
- * @return array Returns an array of all matching key value pairs
- */
- public function getAll(array $keys = null)
- {
- return $keys ? array_intersect_key($this->data, array_flip($keys)) : $this->data;
- }
-
- /**
- * Get a specific key value.
- *
- * @param string $key Key to retrieve.
- *
- * @return mixed|null Value of the key or NULL
- */
- public function get($key)
- {
- return isset($this->data[$key]) ? $this->data[$key] : null;
- }
-
- /**
- * Set a key value pair
- *
- * @param string $key Key to set
- * @param mixed $value Value to set
- *
- * @return Collection Returns a reference to the object
- */
- public function set($key, $value)
- {
- $this->data[$key] = $value;
-
- return $this;
- }
-
- /**
- * Add a value to a key. If a key of the same name has already been added, the key value will be converted into an
- * array and the new value will be pushed to the end of the array.
- *
- * @param string $key Key to add
- * @param mixed $value Value to add to the key
- *
- * @return Collection Returns a reference to the object.
- */
- public function add($key, $value)
- {
- if (!array_key_exists($key, $this->data)) {
- $this->data[$key] = $value;
- } elseif (is_array($this->data[$key])) {
- $this->data[$key][] = $value;
- } else {
- $this->data[$key] = array($this->data[$key], $value);
- }
-
- return $this;
- }
-
- /**
- * Remove a specific key value pair
- *
- * @param string $key A key to remove
- *
- * @return Collection
- */
- public function remove($key)
- {
- unset($this->data[$key]);
-
- return $this;
- }
-
- /**
- * Get all keys in the collection
- *
- * @return array
- */
- public function getKeys()
- {
- return array_keys($this->data);
- }
-
- /**
- * Returns whether or not the specified key is present.
- *
- * @param string $key The key for which to check the existence.
- *
- * @return bool
- */
- public function hasKey($key)
- {
- return array_key_exists($key, $this->data);
- }
-
- /**
- * Case insensitive search the keys in the collection
- *
- * @param string $key Key to search for
- *
- * @return bool|string Returns false if not found, otherwise returns the key
- */
- public function keySearch($key)
- {
- foreach (array_keys($this->data) as $k) {
- if (!strcasecmp($k, $key)) {
- return $k;
- }
- }
-
- return false;
- }
-
- /**
- * Checks if any keys contains a certain value
- *
- * @param string $value Value to search for
- *
- * @return mixed Returns the key if the value was found FALSE if the value was not found.
- */
- public function hasValue($value)
- {
- return array_search($value, $this->data);
- }
-
- /**
- * Replace the data of the object with the value of an array
- *
- * @param array $data Associative array of data
- *
- * @return Collection Returns a reference to the object
- */
- public function replace(array $data)
- {
- $this->data = $data;
-
- return $this;
- }
-
- /**
- * Add and merge in a Collection or array of key value pair data.
- *
- * @param Collection|array $data Associative array of key value pair data
- *
- * @return Collection Returns a reference to the object.
- */
- public function merge($data)
- {
- foreach ($data as $key => $value) {
- $this->add($key, $value);
- }
-
- return $this;
- }
-
- /**
- * Over write key value pairs in this collection with all of the data from an array or collection.
- *
- * @param array|\Traversable $data Values to override over this config
- *
- * @return self
- */
- public function overwriteWith($data)
- {
- if (is_array($data)) {
- $this->data = $data + $this->data;
- } elseif ($data instanceof Collection) {
- $this->data = $data->toArray() + $this->data;
- } else {
- foreach ($data as $key => $value) {
- $this->data[$key] = $value;
- }
- }
-
- return $this;
- }
-
- /**
- * Returns a Collection containing all the elements of the collection after applying the callback function to each
- * one. The Closure should accept three parameters: (string) $key, (string) $value, (array) $context and return a
- * modified value
- *
- * @param \Closure $closure Closure to apply
- * @param array $context Context to pass to the closure
- * @param bool $static Set to TRUE to use the same class as the return rather than returning a Collection
- *
- * @return Collection
- */
- public function map(\Closure $closure, array $context = array(), $static = true)
- {
- $collection = $static ? new static() : new self();
- foreach ($this as $key => $value) {
- $collection->add($key, $closure($key, $value, $context));
- }
-
- return $collection;
- }
-
- /**
- * Iterates over each key value pair in the collection passing them to the Closure. If the Closure function returns
- * true, the current value from input is returned into the result Collection. The Closure must accept three
- * parameters: (string) $key, (string) $value and return Boolean TRUE or FALSE for each value.
- *
- * @param \Closure $closure Closure evaluation function
- * @param bool $static Set to TRUE to use the same class as the return rather than returning a Collection
- *
- * @return Collection
- */
- public function filter(\Closure $closure, $static = true)
- {
- $collection = ($static) ? new static() : new self();
- foreach ($this->data as $key => $value) {
- if ($closure($key, $value)) {
- $collection->add($key, $value);
- }
- }
-
- return $collection;
- }
-
- public function offsetExists($offset)
- {
- return isset($this->data[$offset]);
- }
-
- public function offsetGet($offset)
- {
- return isset($this->data[$offset]) ? $this->data[$offset] : null;
- }
-
- public function offsetSet($offset, $value)
- {
- $this->data[$offset] = $value;
- }
-
- public function offsetUnset($offset)
- {
- unset($this->data[$offset]);
- }
-
- /**
- * Set a value into a nested array key. Keys will be created as needed to set the value.
- *
- * @param string $path Path to set
- * @param mixed $value Value to set at the key
- *
- * @return self
- * @throws RuntimeException when trying to setPath using a nested path that travels through a scalar value
- */
- public function setPath($path, $value)
- {
- $current =& $this->data;
- $queue = explode('/', $path);
- while (null !== ($key = array_shift($queue))) {
- if (!is_array($current)) {
- throw new RuntimeException("Trying to setPath {$path}, but {$key} is set and is not an array");
- } elseif (!$queue) {
- $current[$key] = $value;
- } elseif (isset($current[$key])) {
- $current =& $current[$key];
- } else {
- $current[$key] = array();
- $current =& $current[$key];
- }
- }
-
- return $this;
- }
-
- /**
- * Gets a value from the collection using an array path (e.g. foo/baz/bar would retrieve bar from two nested arrays)
- * Allows for wildcard searches which recursively combine matches up to the level at which the wildcard occurs. This
- * can be useful for accepting any key of a sub-array and combining matching keys from each diverging path.
- *
- * @param string $path Path to traverse and retrieve a value from
- * @param string $separator Character used to add depth to the search
- * @param mixed $data Optional data to descend into (used when wildcards are encountered)
- *
- * @return mixed|null
- */
- public function getPath($path, $separator = '/', $data = null)
- {
- if ($data === null) {
- $data =& $this->data;
- }
-
- $path = is_array($path) ? $path : explode($separator, $path);
- while (null !== ($part = array_shift($path))) {
- if (!is_array($data)) {
- return null;
- } elseif (isset($data[$part])) {
- $data =& $data[$part];
- } elseif ($part != '*') {
- return null;
- } else {
- // Perform a wildcard search by diverging and merging paths
- $result = array();
- foreach ($data as $value) {
- if (!$path) {
- $result = array_merge_recursive($result, (array) $value);
- } elseif (null !== ($test = $this->getPath($path, $separator, $value))) {
- $result = array_merge_recursive($result, (array) $test);
- }
- }
- return $result;
- }
- }
-
- return $data;
- }
-
- /**
- * Inject configuration settings into an input string
- *
- * @param string $input Input to inject
- *
- * @return string
- * @deprecated
- */
- public function inject($input)
- {
- Version::warn(__METHOD__ . ' is deprecated');
- $replace = array();
- foreach ($this->data as $key => $val) {
- $replace['{' . $key . '}'] = $val;
- }
-
- return strtr($input, $replace);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Common/Event.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Common/Event.php
deleted file mode 100644
index fad76a9..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Common/Event.php
+++ /dev/null
@@ -1,52 +0,0 @@
-context = $context;
- }
-
- public function getIterator()
- {
- return new \ArrayIterator($this->context);
- }
-
- public function offsetGet($offset)
- {
- return isset($this->context[$offset]) ? $this->context[$offset] : null;
- }
-
- public function offsetSet($offset, $value)
- {
- $this->context[$offset] = $value;
- }
-
- public function offsetExists($offset)
- {
- return isset($this->context[$offset]);
- }
-
- public function offsetUnset($offset)
- {
- unset($this->context[$offset]);
- }
-
- public function toArray()
- {
- return $this->context;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Common/Exception/BadMethodCallException.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Common/Exception/BadMethodCallException.php
deleted file mode 100644
index 08d1c72..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Common/Exception/BadMethodCallException.php
+++ /dev/null
@@ -1,5 +0,0 @@
-shortMessage = $message;
- }
-
- /**
- * Set all of the exceptions
- *
- * @param array $exceptions Array of exceptions
- *
- * @return self
- */
- public function setExceptions(array $exceptions)
- {
- $this->exceptions = array();
- foreach ($exceptions as $exception) {
- $this->add($exception);
- }
-
- return $this;
- }
-
- /**
- * Add exceptions to the collection
- *
- * @param ExceptionCollection|\Exception $e Exception to add
- *
- * @return ExceptionCollection;
- */
- public function add($e)
- {
- $this->exceptions[] = $e;
- if ($this->message) {
- $this->message .= "\n";
- }
-
- $this->message .= $this->getExceptionMessage($e, 0);
-
- return $this;
- }
-
- /**
- * Get the total number of request exceptions
- *
- * @return int
- */
- public function count()
- {
- return count($this->exceptions);
- }
-
- /**
- * Allows array-like iteration over the request exceptions
- *
- * @return \ArrayIterator
- */
- public function getIterator()
- {
- return new \ArrayIterator($this->exceptions);
- }
-
- /**
- * Get the first exception in the collection
- *
- * @return \Exception
- */
- public function getFirst()
- {
- return $this->exceptions ? $this->exceptions[0] : null;
- }
-
- private function getExceptionMessage(\Exception $e, $depth = 0)
- {
- static $sp = ' ';
- $prefix = $depth ? str_repeat($sp, $depth) : '';
- $message = "{$prefix}(" . get_class($e) . ') ' . $e->getFile() . ' line ' . $e->getLine() . "\n";
-
- if ($e instanceof self) {
- if ($e->shortMessage) {
- $message .= "\n{$prefix}{$sp}" . str_replace("\n", "\n{$prefix}{$sp}", $e->shortMessage) . "\n";
- }
- foreach ($e as $ee) {
- $message .= "\n" . $this->getExceptionMessage($ee, $depth + 1);
- }
- } else {
- $message .= "\n{$prefix}{$sp}" . str_replace("\n", "\n{$prefix}{$sp}", $e->getMessage()) . "\n";
- $message .= "\n{$prefix}{$sp}" . str_replace("\n", "\n{$prefix}{$sp}", $e->getTraceAsString()) . "\n";
- }
-
- return str_replace(getcwd(), '.', $message);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Common/Exception/GuzzleException.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Common/Exception/GuzzleException.php
deleted file mode 100644
index 458e6f2..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Common/Exception/GuzzleException.php
+++ /dev/null
@@ -1,8 +0,0 @@
-=5.3.2",
- "symfony/event-dispatcher": ">=2.1"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Common": "" }
- },
- "target-dir": "Guzzle/Common",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/AbstractEntityBodyDecorator.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/AbstractEntityBodyDecorator.php
deleted file mode 100644
index 5005a88..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/AbstractEntityBodyDecorator.php
+++ /dev/null
@@ -1,221 +0,0 @@
-body = $body;
- }
-
- public function __toString()
- {
- return (string) $this->body;
- }
-
- /**
- * Allow decorators to implement custom methods
- *
- * @param string $method Missing method name
- * @param array $args Method arguments
- *
- * @return mixed
- */
- public function __call($method, array $args)
- {
- return call_user_func_array(array($this->body, $method), $args);
- }
-
- public function close()
- {
- return $this->body->close();
- }
-
- public function setRewindFunction($callable)
- {
- $this->body->setRewindFunction($callable);
-
- return $this;
- }
-
- public function rewind()
- {
- return $this->body->rewind();
- }
-
- public function compress($filter = 'zlib.deflate')
- {
- return $this->body->compress($filter);
- }
-
- public function uncompress($filter = 'zlib.inflate')
- {
- return $this->body->uncompress($filter);
- }
-
- public function getContentLength()
- {
- return $this->getSize();
- }
-
- public function getContentType()
- {
- return $this->body->getContentType();
- }
-
- public function getContentMd5($rawOutput = false, $base64Encode = false)
- {
- $hash = Stream::getHash($this, 'md5', $rawOutput);
-
- return $hash && $base64Encode ? base64_encode($hash) : $hash;
- }
-
- public function getContentEncoding()
- {
- return $this->body->getContentEncoding();
- }
-
- public function getMetaData($key = null)
- {
- return $this->body->getMetaData($key);
- }
-
- public function getStream()
- {
- return $this->body->getStream();
- }
-
- public function setStream($stream, $size = 0)
- {
- $this->body->setStream($stream, $size);
-
- return $this;
- }
-
- public function detachStream()
- {
- $this->body->detachStream();
-
- return $this;
- }
-
- public function getWrapper()
- {
- return $this->body->getWrapper();
- }
-
- public function getWrapperData()
- {
- return $this->body->getWrapperData();
- }
-
- public function getStreamType()
- {
- return $this->body->getStreamType();
- }
-
- public function getUri()
- {
- return $this->body->getUri();
- }
-
- public function getSize()
- {
- return $this->body->getSize();
- }
-
- public function isReadable()
- {
- return $this->body->isReadable();
- }
-
- public function isRepeatable()
- {
- return $this->isSeekable() && $this->isReadable();
- }
-
- public function isWritable()
- {
- return $this->body->isWritable();
- }
-
- public function isConsumed()
- {
- return $this->body->isConsumed();
- }
-
- /**
- * Alias of isConsumed()
- * {@inheritdoc}
- */
- public function feof()
- {
- return $this->isConsumed();
- }
-
- public function isLocal()
- {
- return $this->body->isLocal();
- }
-
- public function isSeekable()
- {
- return $this->body->isSeekable();
- }
-
- public function setSize($size)
- {
- $this->body->setSize($size);
-
- return $this;
- }
-
- public function seek($offset, $whence = SEEK_SET)
- {
- return $this->body->seek($offset, $whence);
- }
-
- public function read($length)
- {
- return $this->body->read($length);
- }
-
- public function write($string)
- {
- return $this->body->write($string);
- }
-
- public function readLine($maxLength = null)
- {
- return $this->body->readLine($maxLength);
- }
-
- public function ftell()
- {
- return $this->body->ftell();
- }
-
- public function getCustomData($key)
- {
- return $this->body->getCustomData($key);
- }
-
- public function setCustomData($key, $value)
- {
- $this->body->setCustomData($key, $value);
-
- return $this;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/CachingEntityBody.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/CachingEntityBody.php
deleted file mode 100644
index c65c136..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/CachingEntityBody.php
+++ /dev/null
@@ -1,229 +0,0 @@
-remoteStream = $body;
- $this->body = new EntityBody(fopen('php://temp', 'r+'));
- }
-
- /**
- * Will give the contents of the buffer followed by the exhausted remote stream.
- *
- * Warning: Loads the entire stream into memory
- *
- * @return string
- */
- public function __toString()
- {
- $pos = $this->ftell();
- $this->rewind();
-
- $str = '';
- while (!$this->isConsumed()) {
- $str .= $this->read(16384);
- }
-
- $this->seek($pos);
-
- return $str;
- }
-
- public function getSize()
- {
- return max($this->body->getSize(), $this->remoteStream->getSize());
- }
-
- /**
- * {@inheritdoc}
- * @throws RuntimeException When seeking with SEEK_END or when seeking past the total size of the buffer stream
- */
- public function seek($offset, $whence = SEEK_SET)
- {
- if ($whence == SEEK_SET) {
- $byte = $offset;
- } elseif ($whence == SEEK_CUR) {
- $byte = $offset + $this->ftell();
- } else {
- throw new RuntimeException(__CLASS__ . ' supports only SEEK_SET and SEEK_CUR seek operations');
- }
-
- // You cannot skip ahead past where you've read from the remote stream
- if ($byte > $this->body->getSize()) {
- throw new RuntimeException(
- "Cannot seek to byte {$byte} when the buffered stream only contains {$this->body->getSize()} bytes"
- );
- }
-
- return $this->body->seek($byte);
- }
-
- public function rewind()
- {
- return $this->seek(0);
- }
-
- /**
- * Does not support custom rewind functions
- *
- * @throws RuntimeException
- */
- public function setRewindFunction($callable)
- {
- throw new RuntimeException(__CLASS__ . ' does not support custom stream rewind functions');
- }
-
- public function read($length)
- {
- // Perform a regular read on any previously read data from the buffer
- $data = $this->body->read($length);
- $remaining = $length - strlen($data);
-
- // More data was requested so read from the remote stream
- if ($remaining) {
- // If data was written to the buffer in a position that would have been filled from the remote stream,
- // then we must skip bytes on the remote stream to emulate overwriting bytes from that position. This
- // mimics the behavior of other PHP stream wrappers.
- $remoteData = $this->remoteStream->read($remaining + $this->skipReadBytes);
-
- if ($this->skipReadBytes) {
- $len = strlen($remoteData);
- $remoteData = substr($remoteData, $this->skipReadBytes);
- $this->skipReadBytes = max(0, $this->skipReadBytes - $len);
- }
-
- $data .= $remoteData;
- $this->body->write($remoteData);
- }
-
- return $data;
- }
-
- public function write($string)
- {
- // When appending to the end of the currently read stream, you'll want to skip bytes from being read from
- // the remote stream to emulate other stream wrappers. Basically replacing bytes of data of a fixed length.
- $overflow = (strlen($string) + $this->ftell()) - $this->remoteStream->ftell();
- if ($overflow > 0) {
- $this->skipReadBytes += $overflow;
- }
-
- return $this->body->write($string);
- }
-
- /**
- * {@inheritdoc}
- * @link http://php.net/manual/en/function.fgets.php
- */
- public function readLine($maxLength = null)
- {
- $buffer = '';
- $size = 0;
- while (!$this->isConsumed()) {
- $byte = $this->read(1);
- $buffer .= $byte;
- // Break when a new line is found or the max length - 1 is reached
- if ($byte == PHP_EOL || ++$size == $maxLength - 1) {
- break;
- }
- }
-
- return $buffer;
- }
-
- public function isConsumed()
- {
- return $this->body->isConsumed() && $this->remoteStream->isConsumed();
- }
-
- /**
- * Close both the remote stream and buffer stream
- */
- public function close()
- {
- return $this->remoteStream->close() && $this->body->close();
- }
-
- public function setStream($stream, $size = 0)
- {
- $this->remoteStream->setStream($stream, $size);
- }
-
- public function getContentType()
- {
- return $this->remoteStream->getContentType();
- }
-
- public function getContentEncoding()
- {
- return $this->remoteStream->getContentEncoding();
- }
-
- public function getMetaData($key = null)
- {
- return $this->remoteStream->getMetaData($key);
- }
-
- public function getStream()
- {
- return $this->remoteStream->getStream();
- }
-
- public function getWrapper()
- {
- return $this->remoteStream->getWrapper();
- }
-
- public function getWrapperData()
- {
- return $this->remoteStream->getWrapperData();
- }
-
- public function getStreamType()
- {
- return $this->remoteStream->getStreamType();
- }
-
- public function getUri()
- {
- return $this->remoteStream->getUri();
- }
-
- /**
- * Always retrieve custom data from the remote stream
- * {@inheritdoc}
- */
- public function getCustomData($key)
- {
- return $this->remoteStream->getCustomData($key);
- }
-
- /**
- * Always set custom data on the remote stream
- * {@inheritdoc}
- */
- public function setCustomData($key, $value)
- {
- $this->remoteStream->setCustomData($key, $value);
-
- return $this;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Client.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Client.php
deleted file mode 100644
index 3d7298d..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Client.php
+++ /dev/null
@@ -1,524 +0,0 @@
-setConfig($config ?: new Collection());
- $this->initSsl();
- $this->setBaseUrl($baseUrl);
- $this->defaultHeaders = new Collection();
- $this->setRequestFactory(RequestFactory::getInstance());
- $this->userAgent = $this->getDefaultUserAgent();
- if (!$this->config[self::DISABLE_REDIRECTS]) {
- $this->addSubscriber(new RedirectPlugin());
- }
- }
-
- final public function setConfig($config)
- {
- if ($config instanceof Collection) {
- $this->config = $config;
- } elseif (is_array($config)) {
- $this->config = new Collection($config);
- } else {
- throw new InvalidArgumentException('Config must be an array or Collection');
- }
-
- return $this;
- }
-
- final public function getConfig($key = false)
- {
- return $key ? $this->config[$key] : $this->config;
- }
-
- /**
- * Set a default request option on the client that will be used as a default for each request
- *
- * @param string $keyOrPath request.options key (e.g. allow_redirects) or path to a nested key (e.g. headers/foo)
- * @param mixed $value Value to set
- *
- * @return $this
- */
- public function setDefaultOption($keyOrPath, $value)
- {
- $keyOrPath = self::REQUEST_OPTIONS . '/' . $keyOrPath;
- $this->config->setPath($keyOrPath, $value);
-
- return $this;
- }
-
- /**
- * Retrieve a default request option from the client
- *
- * @param string $keyOrPath request.options key (e.g. allow_redirects) or path to a nested key (e.g. headers/foo)
- *
- * @return mixed|null
- */
- public function getDefaultOption($keyOrPath)
- {
- $keyOrPath = self::REQUEST_OPTIONS . '/' . $keyOrPath;
-
- return $this->config->getPath($keyOrPath);
- }
-
- final public function setSslVerification($certificateAuthority = true, $verifyPeer = true, $verifyHost = 2)
- {
- $opts = $this->config[self::CURL_OPTIONS] ?: array();
-
- if ($certificateAuthority === true) {
- // use bundled CA bundle, set secure defaults
- $opts[CURLOPT_CAINFO] = __DIR__ . '/Resources/cacert.pem';
- $opts[CURLOPT_SSL_VERIFYPEER] = true;
- $opts[CURLOPT_SSL_VERIFYHOST] = 2;
- } elseif ($certificateAuthority === false) {
- unset($opts[CURLOPT_CAINFO]);
- $opts[CURLOPT_SSL_VERIFYPEER] = false;
- $opts[CURLOPT_SSL_VERIFYHOST] = 0;
- } elseif ($verifyPeer !== true && $verifyPeer !== false && $verifyPeer !== 1 && $verifyPeer !== 0) {
- throw new InvalidArgumentException('verifyPeer must be 1, 0 or boolean');
- } elseif ($verifyHost !== 0 && $verifyHost !== 1 && $verifyHost !== 2) {
- throw new InvalidArgumentException('verifyHost must be 0, 1 or 2');
- } else {
- $opts[CURLOPT_SSL_VERIFYPEER] = $verifyPeer;
- $opts[CURLOPT_SSL_VERIFYHOST] = $verifyHost;
- if (is_file($certificateAuthority)) {
- unset($opts[CURLOPT_CAPATH]);
- $opts[CURLOPT_CAINFO] = $certificateAuthority;
- } elseif (is_dir($certificateAuthority)) {
- unset($opts[CURLOPT_CAINFO]);
- $opts[CURLOPT_CAPATH] = $certificateAuthority;
- } else {
- throw new RuntimeException(
- 'Invalid option passed to ' . self::SSL_CERT_AUTHORITY . ': ' . $certificateAuthority
- );
- }
- }
-
- $this->config->set(self::CURL_OPTIONS, $opts);
-
- return $this;
- }
-
- public function createRequest($method = 'GET', $uri = null, $headers = null, $body = null, array $options = array())
- {
- if (!$uri) {
- $url = $this->getBaseUrl();
- } else {
- if (!is_array($uri)) {
- $templateVars = null;
- } else {
- list($uri, $templateVars) = $uri;
- }
- if (strpos($uri, '://')) {
- // Use absolute URLs as-is
- $url = $this->expandTemplate($uri, $templateVars);
- } else {
- $url = Url::factory($this->getBaseUrl())->combine($this->expandTemplate($uri, $templateVars));
- }
- }
-
- // If default headers are provided, then merge them under any explicitly provided headers for the request
- if (count($this->defaultHeaders)) {
- if (!$headers) {
- $headers = $this->defaultHeaders->toArray();
- } elseif (is_array($headers)) {
- $headers += $this->defaultHeaders->toArray();
- } elseif ($headers instanceof Collection) {
- $headers = $headers->toArray() + $this->defaultHeaders->toArray();
- }
- }
-
- return $this->prepareRequest($this->requestFactory->create($method, (string) $url, $headers, $body), $options);
- }
-
- public function getBaseUrl($expand = true)
- {
- return $expand ? $this->expandTemplate($this->baseUrl) : $this->baseUrl;
- }
-
- public function setBaseUrl($url)
- {
- $this->baseUrl = $url;
-
- return $this;
- }
-
- public function setUserAgent($userAgent, $includeDefault = false)
- {
- if ($includeDefault) {
- $userAgent .= ' ' . $this->getDefaultUserAgent();
- }
- $this->userAgent = $userAgent;
-
- return $this;
- }
-
- /**
- * Get the default User-Agent string to use with Guzzle
- *
- * @return string
- */
- public function getDefaultUserAgent()
- {
- return 'Guzzle/' . Version::VERSION
- . ' curl/' . CurlVersion::getInstance()->get('version')
- . ' PHP/' . PHP_VERSION;
- }
-
- public function get($uri = null, $headers = null, $options = array())
- {
- // BC compat: $options can be a string, resource, etc to specify where the response body is downloaded
- return is_array($options)
- ? $this->createRequest('GET', $uri, $headers, null, $options)
- : $this->createRequest('GET', $uri, $headers, $options);
- }
-
- public function head($uri = null, $headers = null, array $options = array())
- {
- return $this->createRequest('HEAD', $uri, $headers, null, $options);
- }
-
- public function delete($uri = null, $headers = null, $body = null, array $options = array())
- {
- return $this->createRequest('DELETE', $uri, $headers, $body, $options);
- }
-
- public function put($uri = null, $headers = null, $body = null, array $options = array())
- {
- return $this->createRequest('PUT', $uri, $headers, $body, $options);
- }
-
- public function patch($uri = null, $headers = null, $body = null, array $options = array())
- {
- return $this->createRequest('PATCH', $uri, $headers, $body, $options);
- }
-
- public function post($uri = null, $headers = null, $postBody = null, array $options = array())
- {
- return $this->createRequest('POST', $uri, $headers, $postBody, $options);
- }
-
- public function options($uri = null, array $options = array())
- {
- return $this->createRequest('OPTIONS', $uri, $options);
- }
-
- public function send($requests)
- {
- if (!($requests instanceof RequestInterface)) {
- return $this->sendMultiple($requests);
- }
-
- try {
- /** @var $requests RequestInterface */
- $this->getCurlMulti()->add($requests)->send();
- return $requests->getResponse();
- } catch (ExceptionCollection $e) {
- throw $e->getFirst();
- }
- }
-
- /**
- * Set a curl multi object to be used internally by the client for transferring requests.
- *
- * @param CurlMultiInterface $curlMulti Multi object
- *
- * @return self
- */
- public function setCurlMulti(CurlMultiInterface $curlMulti)
- {
- $this->curlMulti = $curlMulti;
-
- return $this;
- }
-
- /**
- * @return CurlMultiInterface|CurlMultiProxy
- */
- public function getCurlMulti()
- {
- if (!$this->curlMulti) {
- $this->curlMulti = new CurlMultiProxy(
- self::MAX_HANDLES,
- $this->getConfig('select_timeout') ?: self::DEFAULT_SELECT_TIMEOUT
- );
- }
-
- return $this->curlMulti;
- }
-
- public function setRequestFactory(RequestFactoryInterface $factory)
- {
- $this->requestFactory = $factory;
-
- return $this;
- }
-
- /**
- * Set the URI template expander to use with the client
- *
- * @param UriTemplateInterface $uriTemplate URI template expander
- *
- * @return self
- */
- public function setUriTemplate(UriTemplateInterface $uriTemplate)
- {
- $this->uriTemplate = $uriTemplate;
-
- return $this;
- }
-
- /**
- * Expand a URI template while merging client config settings into the template variables
- *
- * @param string $template Template to expand
- * @param array $variables Variables to inject
- *
- * @return string
- */
- protected function expandTemplate($template, array $variables = null)
- {
- $expansionVars = $this->getConfig()->toArray();
- if ($variables) {
- $expansionVars = $variables + $expansionVars;
- }
-
- return $this->getUriTemplate()->expand($template, $expansionVars);
- }
-
- /**
- * Get the URI template expander used by the client
- *
- * @return UriTemplateInterface
- */
- protected function getUriTemplate()
- {
- if (!$this->uriTemplate) {
- $this->uriTemplate = ParserRegistry::getInstance()->getParser('uri_template');
- }
-
- return $this->uriTemplate;
- }
-
- /**
- * Send multiple requests in parallel
- *
- * @param array $requests Array of RequestInterface objects
- *
- * @return array Returns an array of Response objects
- */
- protected function sendMultiple(array $requests)
- {
- $curlMulti = $this->getCurlMulti();
- foreach ($requests as $request) {
- $curlMulti->add($request);
- }
- $curlMulti->send();
-
- /** @var $request RequestInterface */
- $result = array();
- foreach ($requests as $request) {
- $result[] = $request->getResponse();
- }
-
- return $result;
- }
-
- /**
- * Prepare a request to be sent from the Client by adding client specific behaviors and properties to the request.
- *
- * @param RequestInterface $request Request to prepare for the client
- * @param array $options Options to apply to the request
- *
- * @return RequestInterface
- */
- protected function prepareRequest(RequestInterface $request, array $options = array())
- {
- $request->setClient($this)->setEventDispatcher(clone $this->getEventDispatcher());
-
- if ($curl = $this->config[self::CURL_OPTIONS]) {
- $request->getCurlOptions()->overwriteWith(CurlHandle::parseCurlConfig($curl));
- }
-
- if ($params = $this->config[self::REQUEST_PARAMS]) {
- Version::warn('request.params is deprecated. Use request.options to add default request options.');
- $request->getParams()->overwriteWith($params);
- }
-
- if ($this->userAgent && !$request->hasHeader('User-Agent')) {
- $request->setHeader('User-Agent', $this->userAgent);
- }
-
- if ($defaults = $this->config[self::REQUEST_OPTIONS]) {
- $this->requestFactory->applyOptions($request, $defaults, RequestFactoryInterface::OPTIONS_AS_DEFAULTS);
- }
-
- if ($options) {
- $this->requestFactory->applyOptions($request, $options);
- }
-
- $this->dispatch('client.create_request', array('client' => $this, 'request' => $request));
-
- return $request;
- }
-
- /**
- * Initializes SSL settings
- */
- protected function initSsl()
- {
- $authority = $this->config[self::SSL_CERT_AUTHORITY];
-
- if ($authority === 'system') {
- return;
- }
-
- if ($authority === null) {
- $authority = true;
- }
-
- if ($authority === true && substr(__FILE__, 0, 7) == 'phar://') {
- $authority = self::extractPharCacert(__DIR__ . '/Resources/cacert.pem');
- }
-
- $this->setSslVerification($authority);
- }
-
- /**
- * @deprecated
- */
- public function getDefaultHeaders()
- {
- Version::warn(__METHOD__ . ' is deprecated. Use the request.options array to retrieve default request options');
- return $this->defaultHeaders;
- }
-
- /**
- * @deprecated
- */
- public function setDefaultHeaders($headers)
- {
- Version::warn(__METHOD__ . ' is deprecated. Use the request.options array to specify default request options');
- if ($headers instanceof Collection) {
- $this->defaultHeaders = $headers;
- } elseif (is_array($headers)) {
- $this->defaultHeaders = new Collection($headers);
- } else {
- throw new InvalidArgumentException('Headers must be an array or Collection');
- }
-
- return $this;
- }
-
- /**
- * @deprecated
- */
- public function preparePharCacert($md5Check = true)
- {
- return sys_get_temp_dir() . '/guzzle-cacert.pem';
- }
-
- /**
- * Copies the phar cacert from a phar into the temp directory.
- *
- * @param string $pharCacertPath Path to the phar cacert. For example:
- * 'phar://aws.phar/Guzzle/Http/Resources/cacert.pem'
- *
- * @return string Returns the path to the extracted cacert file.
- * @throws \RuntimeException Throws if the phar cacert cannot be found or
- * the file cannot be copied to the temp dir.
- */
- public static function extractPharCacert($pharCacertPath)
- {
- // Copy the cacert.pem file from the phar if it is not in the temp
- // folder.
- $certFile = sys_get_temp_dir() . '/guzzle-cacert.pem';
-
- if (!file_exists($pharCacertPath)) {
- throw new \RuntimeException("Could not find $pharCacertPath");
- }
-
- if (!file_exists($certFile) ||
- filesize($certFile) != filesize($pharCacertPath)
- ) {
- if (!copy($pharCacertPath, $certFile)) {
- throw new \RuntimeException(
- "Could not copy {$pharCacertPath} to {$certFile}: "
- . var_export(error_get_last(), true)
- );
- }
- }
-
- return $certFile;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/ClientInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/ClientInterface.php
deleted file mode 100644
index 10e4de2..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/ClientInterface.php
+++ /dev/null
@@ -1,223 +0,0 @@
-getCurlOptions();
- $mediator = new RequestMediator($request, $requestCurlOptions->get('emit_io'));
- $tempContentLength = null;
- $method = $request->getMethod();
- $bodyAsString = $requestCurlOptions->get(self::BODY_AS_STRING);
-
- // Prepare url
- $url = (string)$request->getUrl();
- if(($pos = strpos($url, '#')) !== false ){
- // strip fragment from url
- $url = substr($url, 0, $pos);
- }
-
- // Array of default cURL options.
- $curlOptions = array(
- CURLOPT_URL => $url,
- CURLOPT_CONNECTTIMEOUT => 150,
- CURLOPT_RETURNTRANSFER => false,
- CURLOPT_HEADER => false,
- CURLOPT_PORT => $request->getPort(),
- CURLOPT_HTTPHEADER => array(),
- CURLOPT_WRITEFUNCTION => array($mediator, 'writeResponseBody'),
- CURLOPT_HEADERFUNCTION => array($mediator, 'receiveResponseHeader'),
- CURLOPT_HTTP_VERSION => $request->getProtocolVersion() === '1.0'
- ? CURL_HTTP_VERSION_1_0 : CURL_HTTP_VERSION_1_1,
- // Verifies the authenticity of the peer's certificate
- CURLOPT_SSL_VERIFYPEER => 1,
- // Certificate must indicate that the server is the server to which you meant to connect
- CURLOPT_SSL_VERIFYHOST => 2
- );
-
- if (defined('CURLOPT_PROTOCOLS')) {
- // Allow only HTTP and HTTPS protocols
- $curlOptions[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;
- }
-
- // Add CURLOPT_ENCODING if Accept-Encoding header is provided
- if ($acceptEncodingHeader = $request->getHeader('Accept-Encoding')) {
- $curlOptions[CURLOPT_ENCODING] = (string) $acceptEncodingHeader;
- // Let cURL set the Accept-Encoding header, prevents duplicate values
- $request->removeHeader('Accept-Encoding');
- }
-
- // Enable curl debug information if the 'debug' param was set
- if ($requestCurlOptions->get('debug')) {
- $curlOptions[CURLOPT_STDERR] = fopen('php://temp', 'r+');
- // @codeCoverageIgnoreStart
- if (false === $curlOptions[CURLOPT_STDERR]) {
- throw new RuntimeException('Unable to create a stream for CURLOPT_STDERR');
- }
- // @codeCoverageIgnoreEnd
- $curlOptions[CURLOPT_VERBOSE] = true;
- }
-
- // Specify settings according to the HTTP method
- if ($method == 'GET') {
- $curlOptions[CURLOPT_HTTPGET] = true;
- } elseif ($method == 'HEAD') {
- $curlOptions[CURLOPT_NOBODY] = true;
- // HEAD requests do not use a write function
- unset($curlOptions[CURLOPT_WRITEFUNCTION]);
- } elseif (!($request instanceof EntityEnclosingRequest)) {
- $curlOptions[CURLOPT_CUSTOMREQUEST] = $method;
- } else {
-
- $curlOptions[CURLOPT_CUSTOMREQUEST] = $method;
-
- // Handle sending raw bodies in a request
- if ($request->getBody()) {
- // You can send the body as a string using curl's CURLOPT_POSTFIELDS
- if ($bodyAsString) {
- $curlOptions[CURLOPT_POSTFIELDS] = (string) $request->getBody();
- // Allow curl to add the Content-Length for us to account for the times when
- // POST redirects are followed by GET requests
- if ($tempContentLength = $request->getHeader('Content-Length')) {
- $tempContentLength = (int) (string) $tempContentLength;
- }
- // Remove the curl generated Content-Type header if none was set manually
- if (!$request->hasHeader('Content-Type')) {
- $curlOptions[CURLOPT_HTTPHEADER][] = 'Content-Type:';
- }
- } else {
- $curlOptions[CURLOPT_UPLOAD] = true;
- // Let cURL handle setting the Content-Length header
- if ($tempContentLength = $request->getHeader('Content-Length')) {
- $tempContentLength = (int) (string) $tempContentLength;
- $curlOptions[CURLOPT_INFILESIZE] = $tempContentLength;
- }
- // Add a callback for curl to read data to send with the request only if a body was specified
- $curlOptions[CURLOPT_READFUNCTION] = array($mediator, 'readRequestBody');
- // Attempt to seek to the start of the stream
- $request->getBody()->seek(0);
- }
-
- } else {
-
- // Special handling for POST specific fields and files
- $postFields = false;
- if (count($request->getPostFiles())) {
- $postFields = $request->getPostFields()->useUrlEncoding(false)->urlEncode();
- foreach ($request->getPostFiles() as $key => $data) {
- $prefixKeys = count($data) > 1;
- foreach ($data as $index => $file) {
- // Allow multiple files in the same key
- $fieldKey = $prefixKeys ? "{$key}[{$index}]" : $key;
- $postFields[$fieldKey] = $file->getCurlValue();
- }
- }
- } elseif (count($request->getPostFields())) {
- $postFields = (string) $request->getPostFields()->useUrlEncoding(true);
- }
-
- if ($postFields !== false) {
- if ($method == 'POST') {
- unset($curlOptions[CURLOPT_CUSTOMREQUEST]);
- $curlOptions[CURLOPT_POST] = true;
- }
- $curlOptions[CURLOPT_POSTFIELDS] = $postFields;
- $request->removeHeader('Content-Length');
- }
- }
-
- // If the Expect header is not present, prevent curl from adding it
- if (!$request->hasHeader('Expect')) {
- $curlOptions[CURLOPT_HTTPHEADER][] = 'Expect:';
- }
- }
-
- // If a Content-Length header was specified but we want to allow curl to set one for us
- if (null !== $tempContentLength) {
- $request->removeHeader('Content-Length');
- }
-
- // Set custom cURL options
- foreach ($requestCurlOptions->toArray() as $key => $value) {
- if (is_numeric($key)) {
- $curlOptions[$key] = $value;
- }
- }
-
- // Do not set an Accept header by default
- if (!isset($curlOptions[CURLOPT_ENCODING])) {
- $curlOptions[CURLOPT_HTTPHEADER][] = 'Accept:';
- }
-
- // Add any custom headers to the request. Empty headers will cause curl to not send the header at all.
- foreach ($request->getHeaderLines() as $line) {
- $curlOptions[CURLOPT_HTTPHEADER][] = $line;
- }
-
- // Add the content-length header back if it was temporarily removed
- if (null !== $tempContentLength) {
- $request->setHeader('Content-Length', $tempContentLength);
- }
-
- // Apply the options to a new cURL handle.
- $handle = curl_init();
-
- // Enable the progress function if the 'progress' param was set
- if ($requestCurlOptions->get('progress')) {
- // Wrap the function in a function that provides the curl handle to the mediator's progress function
- // Using this rather than injecting the handle into the mediator prevents a circular reference
- $curlOptions[CURLOPT_PROGRESSFUNCTION] = function () use ($mediator, $handle) {
- $args = func_get_args();
- $args[] = $handle;
-
- // PHP 5.5 pushed the handle onto the start of the args
- if (is_resource($args[0])) {
- array_shift($args);
- }
-
- call_user_func_array(array($mediator, 'progress'), $args);
- };
- $curlOptions[CURLOPT_NOPROGRESS] = false;
- }
-
- curl_setopt_array($handle, $curlOptions);
-
- return new static($handle, $curlOptions);
- }
-
- /**
- * Construct a new CurlHandle object that wraps a cURL handle
- *
- * @param resource $handle Configured cURL handle resource
- * @param Collection|array $options Curl options to use with the handle
- *
- * @throws InvalidArgumentException
- */
- public function __construct($handle, $options)
- {
- if (!is_resource($handle)) {
- throw new InvalidArgumentException('Invalid handle provided');
- }
- if (is_array($options)) {
- $this->options = new Collection($options);
- } elseif ($options instanceof Collection) {
- $this->options = $options;
- } else {
- throw new InvalidArgumentException('Expected array or Collection');
- }
- $this->handle = $handle;
- }
-
- /**
- * Destructor
- */
- public function __destruct()
- {
- $this->close();
- }
-
- /**
- * Close the curl handle
- */
- public function close()
- {
- if (is_resource($this->handle)) {
- curl_close($this->handle);
- }
- $this->handle = null;
- }
-
- /**
- * Check if the handle is available and still OK
- *
- * @return bool
- */
- public function isAvailable()
- {
- return is_resource($this->handle);
- }
-
- /**
- * Get the last error that occurred on the cURL handle
- *
- * @return string
- */
- public function getError()
- {
- return $this->isAvailable() ? curl_error($this->handle) : '';
- }
-
- /**
- * Get the last error number that occurred on the cURL handle
- *
- * @return int
- */
- public function getErrorNo()
- {
- if ($this->errorNo) {
- return $this->errorNo;
- }
-
- return $this->isAvailable() ? curl_errno($this->handle) : CURLE_OK;
- }
-
- /**
- * Set the curl error number
- *
- * @param int $error Error number to set
- *
- * @return CurlHandle
- */
- public function setErrorNo($error)
- {
- $this->errorNo = $error;
-
- return $this;
- }
-
- /**
- * Get cURL curl_getinfo data
- *
- * @param int $option Option to retrieve. Pass null to retrieve all data as an array.
- *
- * @return array|mixed
- */
- public function getInfo($option = null)
- {
- if (!is_resource($this->handle)) {
- return null;
- }
-
- if (null !== $option) {
- return curl_getinfo($this->handle, $option) ?: null;
- }
-
- return curl_getinfo($this->handle) ?: array();
- }
-
- /**
- * Get the stderr output
- *
- * @param bool $asResource Set to TRUE to get an fopen resource
- *
- * @return string|resource|null
- */
- public function getStderr($asResource = false)
- {
- $stderr = $this->getOptions()->get(CURLOPT_STDERR);
- if (!$stderr) {
- return null;
- }
-
- if ($asResource) {
- return $stderr;
- }
-
- fseek($stderr, 0);
- $e = stream_get_contents($stderr);
- fseek($stderr, 0, SEEK_END);
-
- return $e;
- }
-
- /**
- * Get the URL that this handle is connecting to
- *
- * @return Url
- */
- public function getUrl()
- {
- return Url::factory($this->options->get(CURLOPT_URL));
- }
-
- /**
- * Get the wrapped curl handle
- *
- * @return resource|null Returns the cURL handle or null if it was closed
- */
- public function getHandle()
- {
- return $this->isAvailable() ? $this->handle : null;
- }
-
- /**
- * Get the cURL setopt options of the handle. Changing values in the return object will have no effect on the curl
- * handle after it is created.
- *
- * @return Collection
- */
- public function getOptions()
- {
- return $this->options;
- }
-
- /**
- * Update a request based on the log messages of the CurlHandle
- *
- * @param RequestInterface $request Request to update
- */
- public function updateRequestFromTransfer(RequestInterface $request)
- {
- if (!$request->getResponse()) {
- return;
- }
-
- // Update the transfer stats of the response
- $request->getResponse()->setInfo($this->getInfo());
-
- if (!$log = $this->getStderr(true)) {
- return;
- }
-
- // Parse the cURL stderr output for outgoing requests
- $headers = '';
- fseek($log, 0);
- while (($line = fgets($log)) !== false) {
- if ($line && $line[0] == '>') {
- $headers = substr(trim($line), 2) . "\r\n";
- while (($line = fgets($log)) !== false) {
- if ($line[0] == '*' || $line[0] == '<') {
- break;
- } else {
- $headers .= trim($line) . "\r\n";
- }
- }
- }
- }
-
- // Add request headers to the request exactly as they were sent
- if ($headers) {
- $parsed = ParserRegistry::getInstance()->getParser('message')->parseRequest($headers);
- if (!empty($parsed['headers'])) {
- $request->setHeaders(array());
- foreach ($parsed['headers'] as $name => $value) {
- $request->setHeader($name, $value);
- }
- }
- if (!empty($parsed['version'])) {
- $request->setProtocolVersion($parsed['version']);
- }
- }
- }
-
- /**
- * Parse the config and replace curl.* configurators into the constant based values so it can be used elsewhere
- *
- * @param array|Collection $config The configuration we want to parse
- *
- * @return array
- */
- public static function parseCurlConfig($config)
- {
- $curlOptions = array();
- foreach ($config as $key => $value) {
- if (is_string($key) && defined($key)) {
- // Convert constants represented as string to constant int values
- $key = constant($key);
- }
- if (is_string($value) && defined($value)) {
- $value = constant($value);
- }
- $curlOptions[$key] = $value;
- }
-
- return $curlOptions;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php
deleted file mode 100644
index 9e4e637..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php
+++ /dev/null
@@ -1,423 +0,0 @@
- array('CURLM_BAD_HANDLE', 'The passed-in handle is not a valid CURLM handle.'),
- CURLM_BAD_EASY_HANDLE => array('CURLM_BAD_EASY_HANDLE', "An easy handle was not good/valid. It could mean that it isn't an easy handle at all, or possibly that the handle already is in used by this or another multi handle."),
- CURLM_OUT_OF_MEMORY => array('CURLM_OUT_OF_MEMORY', 'You are doomed.'),
- CURLM_INTERNAL_ERROR => array('CURLM_INTERNAL_ERROR', 'This can only be returned if libcurl bugs. Please report it to us!')
- );
-
- /** @var float */
- protected $selectTimeout;
-
- public function __construct($selectTimeout = 1.0)
- {
- $this->selectTimeout = $selectTimeout;
- $this->multiHandle = curl_multi_init();
- // @codeCoverageIgnoreStart
- if ($this->multiHandle === false) {
- throw new CurlException('Unable to create multi handle');
- }
- // @codeCoverageIgnoreEnd
- $this->reset();
- }
-
- public function __destruct()
- {
- if (is_resource($this->multiHandle)) {
- curl_multi_close($this->multiHandle);
- }
- }
-
- public function add(RequestInterface $request)
- {
- $this->requests[] = $request;
- // If requests are currently transferring and this is async, then the
- // request must be prepared now as the send() method is not called.
- $this->beforeSend($request);
- $this->dispatch(self::ADD_REQUEST, array('request' => $request));
-
- return $this;
- }
-
- public function all()
- {
- return $this->requests;
- }
-
- public function remove(RequestInterface $request)
- {
- $this->removeHandle($request);
- if (($index = array_search($request, $this->requests, true)) !== false) {
- $request = $this->requests[$index];
- unset($this->requests[$index]);
- $this->requests = array_values($this->requests);
- $this->dispatch(self::REMOVE_REQUEST, array('request' => $request));
- return true;
- }
-
- return false;
- }
-
- public function reset($hard = false)
- {
- // Remove each request
- if ($this->requests) {
- foreach ($this->requests as $request) {
- $this->remove($request);
- }
- }
-
- $this->handles = new \SplObjectStorage();
- $this->requests = $this->resourceHash = $this->exceptions = $this->successful = array();
- }
-
- public function send()
- {
- $this->perform();
- $exceptions = $this->exceptions;
- $successful = $this->successful;
- $this->reset();
-
- if ($exceptions) {
- $this->throwMultiException($exceptions, $successful);
- }
- }
-
- public function count()
- {
- return count($this->requests);
- }
-
- /**
- * Build and throw a MultiTransferException
- *
- * @param array $exceptions Exceptions encountered
- * @param array $successful Successful requests
- * @throws MultiTransferException
- */
- protected function throwMultiException(array $exceptions, array $successful)
- {
- $multiException = new MultiTransferException('Errors during multi transfer');
-
- while ($e = array_shift($exceptions)) {
- $multiException->addFailedRequestWithException($e['request'], $e['exception']);
- }
-
- // Add successful requests
- foreach ($successful as $request) {
- if (!$multiException->containsRequest($request)) {
- $multiException->addSuccessfulRequest($request);
- }
- }
-
- throw $multiException;
- }
-
- /**
- * Prepare for sending
- *
- * @param RequestInterface $request Request to prepare
- * @throws \Exception on error preparing the request
- */
- protected function beforeSend(RequestInterface $request)
- {
- try {
- $state = $request->setState(RequestInterface::STATE_TRANSFER);
- if ($state == RequestInterface::STATE_TRANSFER) {
- $this->addHandle($request);
- } else {
- // Requests might decide they don't need to be sent just before
- // transfer (e.g. CachePlugin)
- $this->remove($request);
- if ($state == RequestInterface::STATE_COMPLETE) {
- $this->successful[] = $request;
- }
- }
- } catch (\Exception $e) {
- // Queue the exception to be thrown when sent
- $this->removeErroredRequest($request, $e);
- }
- }
-
- private function addHandle(RequestInterface $request)
- {
- $handle = $this->createCurlHandle($request)->getHandle();
- $this->checkCurlResult(
- curl_multi_add_handle($this->multiHandle, $handle)
- );
- }
-
- /**
- * Create a curl handle for a request
- *
- * @param RequestInterface $request Request
- *
- * @return CurlHandle
- */
- protected function createCurlHandle(RequestInterface $request)
- {
- $wrapper = CurlHandle::factory($request);
- $this->handles[$request] = $wrapper;
- $this->resourceHash[(int) $wrapper->getHandle()] = $request;
-
- return $wrapper;
- }
-
- /**
- * Get the data from the multi handle
- */
- protected function perform()
- {
- $event = new Event(array('curl_multi' => $this));
-
- while ($this->requests) {
- // Notify each request as polling
- $blocking = $total = 0;
- foreach ($this->requests as $request) {
- ++$total;
- $event['request'] = $request;
- $request->getEventDispatcher()->dispatch(self::POLLING_REQUEST, $event);
- // The blocking variable just has to be non-falsey to block the loop
- if ($request->getParams()->hasKey(self::BLOCKING)) {
- ++$blocking;
- }
- }
- if ($blocking == $total) {
- // Sleep to prevent eating CPU because no requests are actually pending a select call
- usleep(500);
- } else {
- $this->executeHandles();
- }
- }
- }
-
- /**
- * Execute and select curl handles
- */
- private function executeHandles()
- {
- // The first curl_multi_select often times out no matter what, but is usually required for fast transfers
- $selectTimeout = 0.001;
- $active = false;
- do {
- while (($mrc = curl_multi_exec($this->multiHandle, $active)) == CURLM_CALL_MULTI_PERFORM);
- $this->checkCurlResult($mrc);
- $this->processMessages();
- if ($active && curl_multi_select($this->multiHandle, $selectTimeout) === -1) {
- // Perform a usleep if a select returns -1: https://bugs.php.net/bug.php?id=61141
- usleep(150);
- }
- $selectTimeout = $this->selectTimeout;
- } while ($active);
- }
-
- /**
- * Process any received curl multi messages
- */
- private function processMessages()
- {
- while ($done = curl_multi_info_read($this->multiHandle)) {
- $request = $this->resourceHash[(int) $done['handle']];
- try {
- $this->processResponse($request, $this->handles[$request], $done);
- $this->successful[] = $request;
- } catch (\Exception $e) {
- $this->removeErroredRequest($request, $e);
- }
- }
- }
-
- /**
- * Remove a request that encountered an exception
- *
- * @param RequestInterface $request Request to remove
- * @param \Exception $e Exception encountered
- */
- protected function removeErroredRequest(RequestInterface $request, \Exception $e = null)
- {
- $this->exceptions[] = array('request' => $request, 'exception' => $e);
- $this->remove($request);
- $this->dispatch(self::MULTI_EXCEPTION, array('exception' => $e, 'all_exceptions' => $this->exceptions));
- }
-
- /**
- * Check for errors and fix headers of a request based on a curl response
- *
- * @param RequestInterface $request Request to process
- * @param CurlHandle $handle Curl handle object
- * @param array $curl Array returned from curl_multi_info_read
- *
- * @throws CurlException on Curl error
- */
- protected function processResponse(RequestInterface $request, CurlHandle $handle, array $curl)
- {
- // Set the transfer stats on the response
- $handle->updateRequestFromTransfer($request);
- // Check if a cURL exception occurred, and if so, notify things
- $curlException = $this->isCurlException($request, $handle, $curl);
-
- // Always remove completed curl handles. They can be added back again
- // via events if needed (e.g. ExponentialBackoffPlugin)
- $this->removeHandle($request);
-
- if (!$curlException) {
- if ($this->validateResponseWasSet($request)) {
- $state = $request->setState(
- RequestInterface::STATE_COMPLETE,
- array('handle' => $handle)
- );
- // Only remove the request if it wasn't resent as a result of
- // the state change
- if ($state != RequestInterface::STATE_TRANSFER) {
- $this->remove($request);
- }
- }
- return;
- }
-
- // Set the state of the request to an error
- $state = $request->setState(RequestInterface::STATE_ERROR, array('exception' => $curlException));
- // Allow things to ignore the error if possible
- if ($state != RequestInterface::STATE_TRANSFER) {
- $this->remove($request);
- }
-
- // The error was not handled, so fail
- if ($state == RequestInterface::STATE_ERROR) {
- /** @var CurlException $curlException */
- throw $curlException;
- }
- }
-
- /**
- * Remove a curl handle from the curl multi object
- *
- * @param RequestInterface $request Request that owns the handle
- */
- protected function removeHandle(RequestInterface $request)
- {
- if (isset($this->handles[$request])) {
- $handle = $this->handles[$request];
- curl_multi_remove_handle($this->multiHandle, $handle->getHandle());
- unset($this->handles[$request]);
- unset($this->resourceHash[(int) $handle->getHandle()]);
- $handle->close();
- }
- }
-
- /**
- * Check if a cURL transfer resulted in what should be an exception
- *
- * @param RequestInterface $request Request to check
- * @param CurlHandle $handle Curl handle object
- * @param array $curl Array returned from curl_multi_info_read
- *
- * @return CurlException|bool
- */
- private function isCurlException(RequestInterface $request, CurlHandle $handle, array $curl)
- {
- if (CURLM_OK == $curl['result'] || CURLM_CALL_MULTI_PERFORM == $curl['result']) {
- return false;
- }
-
- $handle->setErrorNo($curl['result']);
- $e = new CurlException(sprintf('[curl] %s: %s [url] %s',
- $handle->getErrorNo(), $handle->getError(), $handle->getUrl()));
- $e->setCurlHandle($handle)
- ->setRequest($request)
- ->setCurlInfo($handle->getInfo())
- ->setError($handle->getError(), $handle->getErrorNo());
-
- return $e;
- }
-
- /**
- * Throw an exception for a cURL multi response if needed
- *
- * @param int $code Curl response code
- * @throws CurlException
- */
- private function checkCurlResult($code)
- {
- if ($code != CURLM_OK && $code != CURLM_CALL_MULTI_PERFORM) {
- throw new CurlException(isset($this->multiErrors[$code])
- ? "cURL error: {$code} ({$this->multiErrors[$code][0]}): cURL message: {$this->multiErrors[$code][1]}"
- : 'Unexpected cURL error: ' . $code
- );
- }
- }
-
- /**
- * @link https://github.com/guzzle/guzzle/issues/710
- */
- private function validateResponseWasSet(RequestInterface $request)
- {
- if ($request->getResponse()) {
- return true;
- }
-
- $body = $request instanceof EntityEnclosingRequestInterface
- ? $request->getBody()
- : null;
-
- if (!$body) {
- $rex = new RequestException(
- 'No response was received for a request with no body. This'
- . ' could mean that you are saturating your network.'
- );
- $rex->setRequest($request);
- $this->removeErroredRequest($request, $rex);
- } elseif (!$body->isSeekable() || !$body->seek(0)) {
- // Nothing we can do with this. Sorry!
- $rex = new RequestException(
- 'The connection was unexpectedly closed. The request would'
- . ' have been retried, but attempting to rewind the'
- . ' request body failed.'
- );
- $rex->setRequest($request);
- $this->removeErroredRequest($request, $rex);
- } else {
- $this->remove($request);
- // Add the request back to the batch to retry automatically.
- $this->requests[] = $request;
- $this->addHandle($request);
- }
-
- return false;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMultiInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMultiInterface.php
deleted file mode 100644
index 0ead757..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMultiInterface.php
+++ /dev/null
@@ -1,58 +0,0 @@
-maxHandles = $maxHandles;
- $this->selectTimeout = $selectTimeout;
- // You can get some weird "Too many open files" errors when sending a large amount of requests in parallel.
- // These two statements autoload classes before a system runs out of file descriptors so that you can get back
- // valuable error messages if you run out.
- class_exists('Guzzle\Http\Message\Response');
- class_exists('Guzzle\Http\Exception\CurlException');
- }
-
- public function add(RequestInterface $request)
- {
- $this->queued[] = $request;
-
- return $this;
- }
-
- public function all()
- {
- $requests = $this->queued;
- foreach ($this->handles as $handle) {
- $requests = array_merge($requests, $handle->all());
- }
-
- return $requests;
- }
-
- public function remove(RequestInterface $request)
- {
- foreach ($this->queued as $i => $r) {
- if ($request === $r) {
- unset($this->queued[$i]);
- return true;
- }
- }
-
- foreach ($this->handles as $handle) {
- if ($handle->remove($request)) {
- return true;
- }
- }
-
- return false;
- }
-
- public function reset($hard = false)
- {
- $this->queued = array();
- $this->groups = array();
- foreach ($this->handles as $handle) {
- $handle->reset();
- }
- if ($hard) {
- $this->handles = array();
- }
-
- return $this;
- }
-
- public function send()
- {
- if ($this->queued) {
- $group = $this->getAvailableHandle();
- // Add this handle to a list of handles than is claimed
- $this->groups[] = $group;
- while ($request = array_shift($this->queued)) {
- $group->add($request);
- }
- try {
- $group->send();
- array_pop($this->groups);
- $this->cleanupHandles();
- } catch (\Exception $e) {
- // Remove the group and cleanup if an exception was encountered and no more requests in group
- if (!$group->count()) {
- array_pop($this->groups);
- $this->cleanupHandles();
- }
- throw $e;
- }
- }
- }
-
- public function count()
- {
- return count($this->all());
- }
-
- /**
- * Get an existing available CurlMulti handle or create a new one
- *
- * @return CurlMulti
- */
- protected function getAvailableHandle()
- {
- // Grab a handle that is not claimed
- foreach ($this->handles as $h) {
- if (!in_array($h, $this->groups, true)) {
- return $h;
- }
- }
-
- // All are claimed, so create one
- $handle = new CurlMulti($this->selectTimeout);
- $handle->setEventDispatcher($this->getEventDispatcher());
- $this->handles[] = $handle;
-
- return $handle;
- }
-
- /**
- * Trims down unused CurlMulti handles to limit the number of open connections
- */
- protected function cleanupHandles()
- {
- if ($diff = max(0, count($this->handles) - $this->maxHandles)) {
- for ($i = count($this->handles) - 1; $i > 0 && $diff > 0; $i--) {
- if (!count($this->handles[$i])) {
- unset($this->handles[$i]);
- $diff--;
- }
- }
- $this->handles = array_values($this->handles);
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Curl/CurlVersion.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Curl/CurlVersion.php
deleted file mode 100644
index c3f99dd..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Curl/CurlVersion.php
+++ /dev/null
@@ -1,66 +0,0 @@
-version) {
- $this->version = curl_version();
- }
-
- return $this->version;
- }
-
- /**
- * Get a specific type of curl information
- *
- * @param string $type Version information to retrieve. This value is one of:
- * - version_number: cURL 24 bit version number
- * - version: cURL version number, as a string
- * - ssl_version_number: OpenSSL 24 bit version number
- * - ssl_version: OpenSSL version number, as a string
- * - libz_version: zlib version number, as a string
- * - host: Information about the host where cURL was built
- * - features: A bitmask of the CURL_VERSION_XXX constants
- * - protocols: An array of protocols names supported by cURL
- *
- * @return string|float|bool if the $type is found, and false if not found
- */
- public function get($type)
- {
- $version = $this->getAll();
-
- return isset($version[$type]) ? $version[$type] : false;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Curl/RequestMediator.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Curl/RequestMediator.php
deleted file mode 100644
index 5d1a0cd..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Curl/RequestMediator.php
+++ /dev/null
@@ -1,147 +0,0 @@
-request = $request;
- $this->emitIo = $emitIo;
- }
-
- /**
- * Receive a response header from curl
- *
- * @param resource $curl Curl handle
- * @param string $header Received header
- *
- * @return int
- */
- public function receiveResponseHeader($curl, $header)
- {
- static $normalize = array("\r", "\n");
- $length = strlen($header);
- $header = str_replace($normalize, '', $header);
-
- if (strpos($header, 'HTTP/') === 0) {
-
- $startLine = explode(' ', $header, 3);
- $code = $startLine[1];
- $status = isset($startLine[2]) ? $startLine[2] : '';
-
- // Only download the body of the response to the specified response
- // body when a successful response is received.
- if ($code >= 200 && $code < 300) {
- $body = $this->request->getResponseBody();
- } else {
- $body = EntityBody::factory();
- }
-
- $response = new Response($code, null, $body);
- $response->setStatus($code, $status);
- $this->request->startResponse($response);
-
- $this->request->dispatch('request.receive.status_line', array(
- 'request' => $this,
- 'line' => $header,
- 'status_code' => $code,
- 'reason_phrase' => $status
- ));
-
- } elseif ($pos = strpos($header, ':')) {
- $this->request->getResponse()->addHeader(
- trim(substr($header, 0, $pos)),
- trim(substr($header, $pos + 1))
- );
- }
-
- return $length;
- }
-
- /**
- * Received a progress notification
- *
- * @param int $downloadSize Total download size
- * @param int $downloaded Amount of bytes downloaded
- * @param int $uploadSize Total upload size
- * @param int $uploaded Amount of bytes uploaded
- * @param resource $handle CurlHandle object
- */
- public function progress($downloadSize, $downloaded, $uploadSize, $uploaded, $handle = null)
- {
- $this->request->dispatch('curl.callback.progress', array(
- 'request' => $this->request,
- 'handle' => $handle,
- 'download_size' => $downloadSize,
- 'downloaded' => $downloaded,
- 'upload_size' => $uploadSize,
- 'uploaded' => $uploaded
- ));
- }
-
- /**
- * Write data to the response body of a request
- *
- * @param resource $curl Curl handle
- * @param string $write Data that was received
- *
- * @return int
- */
- public function writeResponseBody($curl, $write)
- {
- if ($this->emitIo) {
- $this->request->dispatch('curl.callback.write', array(
- 'request' => $this->request,
- 'write' => $write
- ));
- }
-
- if ($response = $this->request->getResponse()) {
- return $response->getBody()->write($write);
- } else {
- // Unexpected data received before response headers - abort transfer
- return 0;
- }
- }
-
- /**
- * Read data from the request body and send it to curl
- *
- * @param resource $ch Curl handle
- * @param resource $fd File descriptor
- * @param int $length Amount of data to read
- *
- * @return string
- */
- public function readRequestBody($ch, $fd, $length)
- {
- if (!($body = $this->request->getBody())) {
- return '';
- }
-
- $read = (string) $body->read($length);
- if ($this->emitIo) {
- $this->request->dispatch('curl.callback.read', array('request' => $this->request, 'read' => $read));
- }
-
- return $read;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/EntityBody.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/EntityBody.php
deleted file mode 100644
index b60d170..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/EntityBody.php
+++ /dev/null
@@ -1,201 +0,0 @@
-rewindFunction = $callable;
-
- return $this;
- }
-
- public function rewind()
- {
- return $this->rewindFunction ? call_user_func($this->rewindFunction, $this) : parent::rewind();
- }
-
- /**
- * Create a new EntityBody from a string
- *
- * @param string $string String of data
- *
- * @return EntityBody
- */
- public static function fromString($string)
- {
- $stream = fopen('php://temp', 'r+');
- if ($string !== '') {
- fwrite($stream, $string);
- rewind($stream);
- }
-
- return new static($stream);
- }
-
- public function compress($filter = 'zlib.deflate')
- {
- $result = $this->handleCompression($filter);
- $this->contentEncoding = $result ? $filter : false;
-
- return $result;
- }
-
- public function uncompress($filter = 'zlib.inflate')
- {
- $offsetStart = 0;
-
- // When inflating gzipped data, the first 10 bytes must be stripped
- // if a gzip header is present
- if ($filter == 'zlib.inflate') {
- // @codeCoverageIgnoreStart
- if (!$this->isReadable() || ($this->isConsumed() && !$this->isSeekable())) {
- return false;
- }
- // @codeCoverageIgnoreEnd
- if (stream_get_contents($this->stream, 3, 0) === "\x1f\x8b\x08") {
- $offsetStart = 10;
- }
- }
-
- $this->contentEncoding = false;
-
- return $this->handleCompression($filter, $offsetStart);
- }
-
- public function getContentLength()
- {
- return $this->getSize();
- }
-
- public function getContentType()
- {
- return $this->getUri() ? Mimetypes::getInstance()->fromFilename($this->getUri()) : null;
- }
-
- public function getContentMd5($rawOutput = false, $base64Encode = false)
- {
- if ($hash = self::getHash($this, 'md5', $rawOutput)) {
- return $hash && $base64Encode ? base64_encode($hash) : $hash;
- } else {
- return false;
- }
- }
-
- /**
- * Calculate the MD5 hash of an entity body
- *
- * @param EntityBodyInterface $body Entity body to calculate the hash for
- * @param bool $rawOutput Whether or not to use raw output
- * @param bool $base64Encode Whether or not to base64 encode raw output (only if raw output is true)
- *
- * @return bool|string Returns an MD5 string on success or FALSE on failure
- * @deprecated This will be deprecated soon
- * @codeCoverageIgnore
- */
- public static function calculateMd5(EntityBodyInterface $body, $rawOutput = false, $base64Encode = false)
- {
- Version::warn(__CLASS__ . ' is deprecated. Use getContentMd5()');
- return $body->getContentMd5($rawOutput, $base64Encode);
- }
-
- public function setStreamFilterContentEncoding($streamFilterContentEncoding)
- {
- $this->contentEncoding = $streamFilterContentEncoding;
-
- return $this;
- }
-
- public function getContentEncoding()
- {
- return strtr($this->contentEncoding, array(
- 'zlib.deflate' => 'gzip',
- 'bzip2.compress' => 'compress'
- )) ?: false;
- }
-
- protected function handleCompression($filter, $offsetStart = 0)
- {
- // @codeCoverageIgnoreStart
- if (!$this->isReadable() || ($this->isConsumed() && !$this->isSeekable())) {
- return false;
- }
- // @codeCoverageIgnoreEnd
-
- $handle = fopen('php://temp', 'r+');
- $filter = @stream_filter_append($handle, $filter, STREAM_FILTER_WRITE);
- if (!$filter) {
- return false;
- }
-
- // Seek to the offset start if possible
- $this->seek($offsetStart);
- while ($data = fread($this->stream, 8096)) {
- fwrite($handle, $data);
- }
-
- fclose($this->stream);
- $this->stream = $handle;
- stream_filter_remove($filter);
- $stat = fstat($this->stream);
- $this->size = $stat['size'];
- $this->rebuildCache();
- $this->seek(0);
-
- // Remove any existing rewind function as the underlying stream has been replaced
- $this->rewindFunction = null;
-
- return true;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/EntityBodyInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/EntityBodyInterface.php
deleted file mode 100644
index e640f57..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/EntityBodyInterface.php
+++ /dev/null
@@ -1,73 +0,0 @@
-isClientError()) {
- $label = 'Client error response';
- $class = __NAMESPACE__ . '\\ClientErrorResponseException';
- } elseif ($response->isServerError()) {
- $label = 'Server error response';
- $class = __NAMESPACE__ . '\\ServerErrorResponseException';
- } else {
- $label = 'Unsuccessful response';
- $class = __CLASS__;
- }
-
- $message = $label . PHP_EOL . implode(PHP_EOL, array(
- '[status code] ' . $response->getStatusCode(),
- '[reason phrase] ' . $response->getReasonPhrase(),
- '[url] ' . $request->getUrl(),
- ));
-
- $e = new $class($message);
- $e->setResponse($response);
- $e->setRequest($request);
-
- return $e;
- }
-
- /**
- * Set the response that caused the exception
- *
- * @param Response $response Response to set
- */
- public function setResponse(Response $response)
- {
- $this->response = $response;
- }
-
- /**
- * Get the response that caused the exception
- *
- * @return Response
- */
- public function getResponse()
- {
- return $this->response;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Exception/ClientErrorResponseException.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Exception/ClientErrorResponseException.php
deleted file mode 100644
index 04d7ddc..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Exception/ClientErrorResponseException.php
+++ /dev/null
@@ -1,8 +0,0 @@
-curlError = $error;
- $this->curlErrorNo = $number;
-
- return $this;
- }
-
- /**
- * Set the associated curl handle
- *
- * @param CurlHandle $handle Curl handle
- *
- * @return self
- */
- public function setCurlHandle(CurlHandle $handle)
- {
- $this->handle = $handle;
-
- return $this;
- }
-
- /**
- * Get the associated cURL handle
- *
- * @return CurlHandle|null
- */
- public function getCurlHandle()
- {
- return $this->handle;
- }
-
- /**
- * Get the associated cURL error message
- *
- * @return string|null
- */
- public function getError()
- {
- return $this->curlError;
- }
-
- /**
- * Get the associated cURL error number
- *
- * @return int|null
- */
- public function getErrorNo()
- {
- return $this->curlErrorNo;
- }
-
- /**
- * Returns curl information about the transfer
- *
- * @return array
- */
- public function getCurlInfo()
- {
- return $this->curlInfo;
- }
-
- /**
- * Set curl transfer information
- *
- * @param array $info Array of curl transfer information
- *
- * @return self
- * @link http://php.net/manual/en/function.curl-getinfo.php
- */
- public function setCurlInfo(array $info)
- {
- $this->curlInfo = $info;
-
- return $this;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Exception/HttpException.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Exception/HttpException.php
deleted file mode 100644
index ee87295..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Exception/HttpException.php
+++ /dev/null
@@ -1,10 +0,0 @@
-successfulRequests, $this->failedRequests);
- }
-
- /**
- * Add to the array of successful requests
- *
- * @param RequestInterface $request Successful request
- *
- * @return self
- */
- public function addSuccessfulRequest(RequestInterface $request)
- {
- $this->successfulRequests[] = $request;
-
- return $this;
- }
-
- /**
- * Add to the array of failed requests
- *
- * @param RequestInterface $request Failed request
- *
- * @return self
- */
- public function addFailedRequest(RequestInterface $request)
- {
- $this->failedRequests[] = $request;
-
- return $this;
- }
-
- /**
- * Add to the array of failed requests and associate with exceptions
- *
- * @param RequestInterface $request Failed request
- * @param \Exception $exception Exception to add and associate with
- *
- * @return self
- */
- public function addFailedRequestWithException(RequestInterface $request, \Exception $exception)
- {
- $this->add($exception)
- ->addFailedRequest($request)
- ->exceptionForRequest[spl_object_hash($request)] = $exception;
-
- return $this;
- }
-
- /**
- * Get the Exception that caused the given $request to fail
- *
- * @param RequestInterface $request Failed command
- *
- * @return \Exception|null
- */
- public function getExceptionForFailedRequest(RequestInterface $request)
- {
- $oid = spl_object_hash($request);
-
- return isset($this->exceptionForRequest[$oid]) ? $this->exceptionForRequest[$oid] : null;
- }
-
- /**
- * Set all of the successful requests
- *
- * @param array Array of requests
- *
- * @return self
- */
- public function setSuccessfulRequests(array $requests)
- {
- $this->successfulRequests = $requests;
-
- return $this;
- }
-
- /**
- * Set all of the failed requests
- *
- * @param array Array of requests
- *
- * @return self
- */
- public function setFailedRequests(array $requests)
- {
- $this->failedRequests = $requests;
-
- return $this;
- }
-
- /**
- * Get an array of successful requests sent in the multi transfer
- *
- * @return array
- */
- public function getSuccessfulRequests()
- {
- return $this->successfulRequests;
- }
-
- /**
- * Get an array of failed requests sent in the multi transfer
- *
- * @return array
- */
- public function getFailedRequests()
- {
- return $this->failedRequests;
- }
-
- /**
- * Check if the exception object contains a request
- *
- * @param RequestInterface $request Request to check
- *
- * @return bool
- */
- public function containsRequest(RequestInterface $request)
- {
- return in_array($request, $this->failedRequests, true) || in_array($request, $this->successfulRequests, true);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Exception/RequestException.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Exception/RequestException.php
deleted file mode 100644
index 274df2c..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Exception/RequestException.php
+++ /dev/null
@@ -1,39 +0,0 @@
-request = $request;
-
- return $this;
- }
-
- /**
- * Get the request that caused the exception
- *
- * @return RequestInterface
- */
- public function getRequest()
- {
- return $this->request;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Exception/ServerErrorResponseException.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Exception/ServerErrorResponseException.php
deleted file mode 100644
index f0f7cfe..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Exception/ServerErrorResponseException.php
+++ /dev/null
@@ -1,8 +0,0 @@
-eventDispatcher = $eventDispatcher;
-
- return $this;
- }
-
- public function getEventDispatcher()
- {
- if (!$this->eventDispatcher) {
- $this->eventDispatcher = new EventDispatcher();
- }
-
- return $this->eventDispatcher;
- }
-
- public function dispatch($eventName, array $context = array())
- {
- return $this->getEventDispatcher()->dispatch($eventName, new Event($context));
- }
-
- /**
- * {@inheritdoc}
- * @codeCoverageIgnore
- */
- public function addSubscriber(EventSubscriberInterface $subscriber)
- {
- $this->getEventDispatcher()->addSubscriber($subscriber);
-
- return $this;
- }
-
- public function read($length)
- {
- $event = array(
- 'body' => $this,
- 'length' => $length,
- 'read' => $this->body->read($length)
- );
- $this->dispatch('body.read', $event);
-
- return $event['read'];
- }
-
- public function write($string)
- {
- $event = array(
- 'body' => $this,
- 'write' => $string,
- 'result' => $this->body->write($string)
- );
- $this->dispatch('body.write', $event);
-
- return $event['result'];
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/AbstractMessage.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/AbstractMessage.php
deleted file mode 100644
index 0d066ff..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/AbstractMessage.php
+++ /dev/null
@@ -1,220 +0,0 @@
-params = new Collection();
- $this->headerFactory = new HeaderFactory();
- $this->headers = new HeaderCollection();
- }
-
- /**
- * Set the header factory to use to create headers
- *
- * @param HeaderFactoryInterface $factory
- *
- * @return self
- */
- public function setHeaderFactory(HeaderFactoryInterface $factory)
- {
- $this->headerFactory = $factory;
-
- return $this;
- }
-
- public function getParams()
- {
- return $this->params;
- }
-
- public function addHeader($header, $value)
- {
- if (isset($this->headers[$header])) {
- $this->headers[$header]->add($value);
- } elseif ($value instanceof HeaderInterface) {
- $this->headers[$header] = $value;
- } else {
- $this->headers[$header] = $this->headerFactory->createHeader($header, $value);
- }
-
- return $this;
- }
-
- public function addHeaders(array $headers)
- {
- foreach ($headers as $key => $value) {
- $this->addHeader($key, $value);
- }
-
- return $this;
- }
-
- public function getHeader($header)
- {
- return $this->headers[$header];
- }
-
- public function getHeaders()
- {
- return $this->headers;
- }
-
- public function getHeaderLines()
- {
- $headers = array();
- foreach ($this->headers as $value) {
- $headers[] = $value->getName() . ': ' . $value;
- }
-
- return $headers;
- }
-
- public function setHeader($header, $value)
- {
- unset($this->headers[$header]);
- $this->addHeader($header, $value);
-
- return $this;
- }
-
- public function setHeaders(array $headers)
- {
- $this->headers->clear();
- foreach ($headers as $key => $value) {
- $this->addHeader($key, $value);
- }
-
- return $this;
- }
-
- public function hasHeader($header)
- {
- return isset($this->headers[$header]);
- }
-
- public function removeHeader($header)
- {
- unset($this->headers[$header]);
-
- return $this;
- }
-
- /**
- * @deprecated Use $message->getHeader()->parseParams()
- * @codeCoverageIgnore
- */
- public function getTokenizedHeader($header, $token = ';')
- {
- Version::warn(__METHOD__ . ' is deprecated. Use $message->getHeader()->parseParams()');
- if ($this->hasHeader($header)) {
- $data = new Collection();
- foreach ($this->getHeader($header)->parseParams() as $values) {
- foreach ($values as $key => $value) {
- if ($value === '') {
- $data->set($data->count(), $key);
- } else {
- $data->add($key, $value);
- }
- }
- }
- return $data;
- }
- }
-
- /**
- * @deprecated
- * @codeCoverageIgnore
- */
- public function setTokenizedHeader($header, $data, $token = ';')
- {
- Version::warn(__METHOD__ . ' is deprecated.');
- return $this;
- }
-
- /**
- * @deprecated
- * @codeCoverageIgnore
- */
- public function getCacheControlDirective($directive)
- {
- Version::warn(__METHOD__ . ' is deprecated. Use $message->getHeader(\'Cache-Control\')->getDirective()');
- if (!($header = $this->getHeader('Cache-Control'))) {
- return null;
- }
-
- return $header->getDirective($directive);
- }
-
- /**
- * @deprecated
- * @codeCoverageIgnore
- */
- public function hasCacheControlDirective($directive)
- {
- Version::warn(__METHOD__ . ' is deprecated. Use $message->getHeader(\'Cache-Control\')->hasDirective()');
- if ($header = $this->getHeader('Cache-Control')) {
- return $header->hasDirective($directive);
- } else {
- return false;
- }
- }
-
- /**
- * @deprecated
- * @codeCoverageIgnore
- */
- public function addCacheControlDirective($directive, $value = true)
- {
- Version::warn(__METHOD__ . ' is deprecated. Use $message->getHeader(\'Cache-Control\')->addDirective()');
- if (!($header = $this->getHeader('Cache-Control'))) {
- $this->addHeader('Cache-Control', '');
- $header = $this->getHeader('Cache-Control');
- }
-
- $header->addDirective($directive, $value);
-
- return $this;
- }
-
- /**
- * @deprecated
- * @codeCoverageIgnore
- */
- public function removeCacheControlDirective($directive)
- {
- Version::warn(__METHOD__ . ' is deprecated. Use $message->getHeader(\'Cache-Control\')->removeDirective()');
- if ($header = $this->getHeader('Cache-Control')) {
- $header->removeDirective($directive);
- }
-
- return $this;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/EntityEnclosingRequest.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/EntityEnclosingRequest.php
deleted file mode 100644
index 212850a..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/EntityEnclosingRequest.php
+++ /dev/null
@@ -1,247 +0,0 @@
-postFields = new QueryString();
- parent::__construct($method, $url, $headers);
- }
-
- /**
- * @return string
- */
- public function __toString()
- {
- // Only attempt to include the POST data if it's only fields
- if (count($this->postFields) && empty($this->postFiles)) {
- return parent::__toString() . (string) $this->postFields;
- }
-
- return parent::__toString() . $this->body;
- }
-
- public function setState($state, array $context = array())
- {
- parent::setState($state, $context);
- if ($state == self::STATE_TRANSFER && !$this->body && !count($this->postFields) && !count($this->postFiles)) {
- $this->setHeader('Content-Length', 0)->removeHeader('Transfer-Encoding');
- }
-
- return $this->state;
- }
-
- public function setBody($body, $contentType = null)
- {
- $this->body = EntityBody::factory($body);
-
- // Auto detect the Content-Type from the path of the request if possible
- if ($contentType === null && !$this->hasHeader('Content-Type')) {
- $contentType = $this->body->getContentType();
- }
-
- if ($contentType) {
- $this->setHeader('Content-Type', $contentType);
- }
-
- // Always add the Expect 100-Continue header if the body cannot be rewound. This helps with redirects.
- if (!$this->body->isSeekable() && $this->expectCutoff !== false) {
- $this->setHeader('Expect', '100-Continue');
- }
-
- // Set the Content-Length header if it can be determined
- $size = $this->body->getContentLength();
- if ($size !== null && $size !== false) {
- $this->setHeader('Content-Length', $size);
- if ($size > $this->expectCutoff) {
- $this->setHeader('Expect', '100-Continue');
- }
- } elseif (!$this->hasHeader('Content-Length')) {
- if ('1.1' == $this->protocolVersion) {
- $this->setHeader('Transfer-Encoding', 'chunked');
- } else {
- throw new RequestException(
- 'Cannot determine Content-Length and cannot use chunked Transfer-Encoding when using HTTP/1.0'
- );
- }
- }
-
- return $this;
- }
-
- public function getBody()
- {
- return $this->body;
- }
-
- /**
- * Set the size that the entity body of the request must exceed before adding the Expect: 100-Continue header.
- *
- * @param int|bool $size Cutoff in bytes. Set to false to never send the expect header (even with non-seekable data)
- *
- * @return self
- */
- public function setExpectHeaderCutoff($size)
- {
- $this->expectCutoff = $size;
- if ($size === false || !$this->body) {
- $this->removeHeader('Expect');
- } elseif ($this->body && $this->body->getSize() && $this->body->getSize() > $size) {
- $this->setHeader('Expect', '100-Continue');
- }
-
- return $this;
- }
-
- public function configureRedirects($strict = false, $maxRedirects = 5)
- {
- $this->getParams()->set(RedirectPlugin::STRICT_REDIRECTS, $strict);
- if ($maxRedirects == 0) {
- $this->getParams()->set(RedirectPlugin::DISABLE, true);
- } else {
- $this->getParams()->set(RedirectPlugin::MAX_REDIRECTS, $maxRedirects);
- }
-
- return $this;
- }
-
- public function getPostField($field)
- {
- return $this->postFields->get($field);
- }
-
- public function getPostFields()
- {
- return $this->postFields;
- }
-
- public function setPostField($key, $value)
- {
- $this->postFields->set($key, $value);
- $this->processPostFields();
-
- return $this;
- }
-
- public function addPostFields($fields)
- {
- $this->postFields->merge($fields);
- $this->processPostFields();
-
- return $this;
- }
-
- public function removePostField($field)
- {
- $this->postFields->remove($field);
- $this->processPostFields();
-
- return $this;
- }
-
- public function getPostFiles()
- {
- return $this->postFiles;
- }
-
- public function getPostFile($fieldName)
- {
- return isset($this->postFiles[$fieldName]) ? $this->postFiles[$fieldName] : null;
- }
-
- public function removePostFile($fieldName)
- {
- unset($this->postFiles[$fieldName]);
- $this->processPostFields();
-
- return $this;
- }
-
- public function addPostFile($field, $filename = null, $contentType = null, $postname = null)
- {
- $data = null;
-
- if ($field instanceof PostFileInterface) {
- $data = $field;
- } elseif (is_array($filename)) {
- // Allow multiple values to be set in a single key
- foreach ($filename as $file) {
- $this->addPostFile($field, $file, $contentType);
- }
- return $this;
- } elseif (!is_string($filename)) {
- throw new RequestException('The path to a file must be a string');
- } elseif (!empty($filename)) {
- // Adding an empty file will cause cURL to error out
- $data = new PostFile($field, $filename, $contentType, $postname);
- }
-
- if ($data) {
- if (!isset($this->postFiles[$data->getFieldName()])) {
- $this->postFiles[$data->getFieldName()] = array($data);
- } else {
- $this->postFiles[$data->getFieldName()][] = $data;
- }
- $this->processPostFields();
- }
-
- return $this;
- }
-
- public function addPostFiles(array $files)
- {
- foreach ($files as $key => $file) {
- if ($file instanceof PostFileInterface) {
- $this->addPostFile($file, null, null, false);
- } elseif (is_string($file)) {
- // Convert non-associative array keys into 'file'
- if (is_numeric($key)) {
- $key = 'file';
- }
- $this->addPostFile($key, $file, null, false);
- } else {
- throw new RequestException('File must be a string or instance of PostFileInterface');
- }
- }
-
- return $this;
- }
-
- /**
- * Determine what type of request should be sent based on post fields
- */
- protected function processPostFields()
- {
- if (!$this->postFiles) {
- $this->removeHeader('Expect')->setHeader('Content-Type', self::URL_ENCODED);
- } else {
- $this->setHeader('Content-Type', self::MULTIPART);
- if ($this->expectCutoff !== false) {
- $this->setHeader('Expect', '100-Continue');
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/EntityEnclosingRequestInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/EntityEnclosingRequestInterface.php
deleted file mode 100644
index 49ad459..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/EntityEnclosingRequestInterface.php
+++ /dev/null
@@ -1,137 +0,0 @@
- filenames where filename can be a string or PostFileInterface
- *
- * @return self
- */
- public function addPostFiles(array $files);
-
- /**
- * Configure how redirects are handled for the request
- *
- * @param bool $strict Set to true to follow strict RFC compliance when redirecting POST requests. Most
- * browsers with follow a 301-302 redirect for a POST request with a GET request. This is
- * the default behavior of Guzzle. Enable strict redirects to redirect these responses
- * with a POST rather than a GET request.
- * @param int $maxRedirects Specify the maximum number of allowed redirects. Set to 0 to disable redirects.
- *
- * @return self
- */
- public function configureRedirects($strict = false, $maxRedirects = 5);
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/Header.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/Header.php
deleted file mode 100644
index 50597b2..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/Header.php
+++ /dev/null
@@ -1,182 +0,0 @@
-header = trim($header);
- $this->glue = $glue;
-
- foreach ((array) $values as $value) {
- foreach ((array) $value as $v) {
- $this->values[] = $v;
- }
- }
- }
-
- public function __toString()
- {
- return implode($this->glue . ' ', $this->toArray());
- }
-
- public function add($value)
- {
- $this->values[] = $value;
-
- return $this;
- }
-
- public function getName()
- {
- return $this->header;
- }
-
- public function setName($name)
- {
- $this->header = $name;
-
- return $this;
- }
-
- public function setGlue($glue)
- {
- $this->glue = $glue;
-
- return $this;
- }
-
- public function getGlue()
- {
- return $this->glue;
- }
-
- /**
- * Normalize the header to be a single header with an array of values.
- *
- * If any values of the header contains the glue string value (e.g. ","), then the value will be exploded into
- * multiple entries in the header.
- *
- * @return self
- */
- public function normalize()
- {
- $values = $this->toArray();
-
- for ($i = 0, $total = count($values); $i < $total; $i++) {
- if (strpos($values[$i], $this->glue) !== false) {
- // Explode on glue when the glue is not inside of a comma
- foreach (preg_split('/' . preg_quote($this->glue) . '(?=([^"]*"[^"]*")*[^"]*$)/', $values[$i]) as $v) {
- $values[] = trim($v);
- }
- unset($values[$i]);
- }
- }
-
- $this->values = array_values($values);
-
- return $this;
- }
-
- public function hasValue($searchValue)
- {
- return in_array($searchValue, $this->toArray());
- }
-
- public function removeValue($searchValue)
- {
- $this->values = array_values(array_filter($this->values, function ($value) use ($searchValue) {
- return $value != $searchValue;
- }));
-
- return $this;
- }
-
- public function toArray()
- {
- return $this->values;
- }
-
- public function count()
- {
- return count($this->toArray());
- }
-
- public function getIterator()
- {
- return new \ArrayIterator($this->toArray());
- }
-
- public function parseParams()
- {
- $params = $matches = array();
- $callback = array($this, 'trimHeader');
-
- // Normalize the header into a single array and iterate over all values
- foreach ($this->normalize()->toArray() as $val) {
- $part = array();
- foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) {
- if (!preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) {
- continue;
- }
- $pieces = array_map($callback, $matches[0]);
- $part[$pieces[0]] = isset($pieces[1]) ? $pieces[1] : '';
- }
- if ($part) {
- $params[] = $part;
- }
- }
-
- return $params;
- }
-
- /**
- * @deprecated
- * @codeCoverageIgnore
- */
- public function hasExactHeader($header)
- {
- Version::warn(__METHOD__ . ' is deprecated');
- return $this->header == $header;
- }
-
- /**
- * @deprecated
- * @codeCoverageIgnore
- */
- public function raw()
- {
- Version::warn(__METHOD__ . ' is deprecated. Use toArray()');
- return $this->toArray();
- }
-
- /**
- * Trim a header by removing excess spaces and wrapping quotes
- *
- * @param $str
- *
- * @return string
- */
- protected function trimHeader($str)
- {
- static $trimmed = "\"' \n\t";
-
- return trim($str, $trimmed);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/Header/CacheControl.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/Header/CacheControl.php
deleted file mode 100644
index 77789e5..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/Header/CacheControl.php
+++ /dev/null
@@ -1,121 +0,0 @@
-directives = null;
- }
-
- public function removeValue($searchValue)
- {
- parent::removeValue($searchValue);
- $this->directives = null;
- }
-
- /**
- * Check if a specific cache control directive exists
- *
- * @param string $param Directive to retrieve
- *
- * @return bool
- */
- public function hasDirective($param)
- {
- $directives = $this->getDirectives();
-
- return isset($directives[$param]);
- }
-
- /**
- * Get a specific cache control directive
- *
- * @param string $param Directive to retrieve
- *
- * @return string|bool|null
- */
- public function getDirective($param)
- {
- $directives = $this->getDirectives();
-
- return isset($directives[$param]) ? $directives[$param] : null;
- }
-
- /**
- * Add a cache control directive
- *
- * @param string $param Directive to add
- * @param string $value Value to set
- *
- * @return self
- */
- public function addDirective($param, $value)
- {
- $directives = $this->getDirectives();
- $directives[$param] = $value;
- $this->updateFromDirectives($directives);
-
- return $this;
- }
-
- /**
- * Remove a cache control directive by name
- *
- * @param string $param Directive to remove
- *
- * @return self
- */
- public function removeDirective($param)
- {
- $directives = $this->getDirectives();
- unset($directives[$param]);
- $this->updateFromDirectives($directives);
-
- return $this;
- }
-
- /**
- * Get an associative array of cache control directives
- *
- * @return array
- */
- public function getDirectives()
- {
- if ($this->directives === null) {
- $this->directives = array();
- foreach ($this->parseParams() as $collection) {
- foreach ($collection as $key => $value) {
- $this->directives[$key] = $value === '' ? true : $value;
- }
- }
- }
-
- return $this->directives;
- }
-
- /**
- * Updates the header value based on the parsed directives
- *
- * @param array $directives Array of cache control directives
- */
- protected function updateFromDirectives(array $directives)
- {
- $this->directives = $directives;
- $this->values = array();
-
- foreach ($directives as $key => $value) {
- $this->values[] = $value === true ? $key : "{$key}={$value}";
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/Header/HeaderCollection.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/Header/HeaderCollection.php
deleted file mode 100644
index 8c7f6ae..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/Header/HeaderCollection.php
+++ /dev/null
@@ -1,108 +0,0 @@
-headers = $headers;
- }
-
- public function __clone()
- {
- foreach ($this->headers as &$header) {
- $header = clone $header;
- }
- }
-
- /**
- * Clears the header collection
- */
- public function clear()
- {
- $this->headers = array();
- }
-
- /**
- * Set a header on the collection
- *
- * @param HeaderInterface $header Header to add
- *
- * @return self
- */
- public function add(HeaderInterface $header)
- {
- $this->headers[strtolower($header->getName())] = $header;
-
- return $this;
- }
-
- /**
- * Get an array of header objects
- *
- * @return array
- */
- public function getAll()
- {
- return $this->headers;
- }
-
- /**
- * Alias of offsetGet
- */
- public function get($key)
- {
- return $this->offsetGet($key);
- }
-
- public function count()
- {
- return count($this->headers);
- }
-
- public function offsetExists($offset)
- {
- return isset($this->headers[strtolower($offset)]);
- }
-
- public function offsetGet($offset)
- {
- $l = strtolower($offset);
-
- return isset($this->headers[$l]) ? $this->headers[$l] : null;
- }
-
- public function offsetSet($offset, $value)
- {
- $this->add($value);
- }
-
- public function offsetUnset($offset)
- {
- unset($this->headers[strtolower($offset)]);
- }
-
- public function getIterator()
- {
- return new \ArrayIterator($this->headers);
- }
-
- public function toArray()
- {
- $result = array();
- foreach ($this->headers as $header) {
- $result[$header->getName()] = $header->toArray();
- }
-
- return $result;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/Header/HeaderFactory.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/Header/HeaderFactory.php
deleted file mode 100644
index 0273be5..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/Header/HeaderFactory.php
+++ /dev/null
@@ -1,26 +0,0 @@
- 'Guzzle\Http\Message\Header\CacheControl',
- 'link' => 'Guzzle\Http\Message\Header\Link',
- );
-
- public function createHeader($header, $value = null)
- {
- $lowercase = strtolower($header);
-
- return isset($this->mapping[$lowercase])
- ? new $this->mapping[$lowercase]($header, $value)
- : new Header($header, $value);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/Header/HeaderFactoryInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/Header/HeaderFactoryInterface.php
deleted file mode 100644
index 9457cf6..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/Header/HeaderFactoryInterface.php
+++ /dev/null
@@ -1,19 +0,0 @@
-", "rel=\"{$rel}\"");
-
- foreach ($params as $k => $v) {
- $values[] = "{$k}=\"{$v}\"";
- }
-
- return $this->add(implode('; ', $values));
- }
-
- /**
- * Check if a specific link exists for a given rel attribute
- *
- * @param string $rel rel value
- *
- * @return bool
- */
- public function hasLink($rel)
- {
- return $this->getLink($rel) !== null;
- }
-
- /**
- * Get a specific link for a given rel attribute
- *
- * @param string $rel Rel value
- *
- * @return array|null
- */
- public function getLink($rel)
- {
- foreach ($this->getLinks() as $link) {
- if (isset($link['rel']) && $link['rel'] == $rel) {
- return $link;
- }
- }
-
- return null;
- }
-
- /**
- * Get an associative array of links
- *
- * For example:
- * Link: ; rel=front; type="image/jpeg", ; rel=back; type="image/jpeg"
- *
- *
- * var_export($response->getLinks());
- * array(
- * array(
- * 'url' => 'http:/.../front.jpeg',
- * 'rel' => 'back',
- * 'type' => 'image/jpeg',
- * )
- * )
- *
- *
- * @return array
- */
- public function getLinks()
- {
- $links = $this->parseParams();
-
- foreach ($links as &$link) {
- $key = key($link);
- unset($link[$key]);
- $link['url'] = trim($key, '<> ');
- }
-
- return $links;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/MessageInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/MessageInterface.php
deleted file mode 100644
index 62bcd43..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/MessageInterface.php
+++ /dev/null
@@ -1,102 +0,0 @@
-fieldName = $fieldName;
- $this->setFilename($filename);
- $this->postname = $postname ? $postname : basename($filename);
- $this->contentType = $contentType ?: $this->guessContentType();
- }
-
- public function setFieldName($name)
- {
- $this->fieldName = $name;
-
- return $this;
- }
-
- public function getFieldName()
- {
- return $this->fieldName;
- }
-
- public function setFilename($filename)
- {
- // Remove leading @ symbol
- if (strpos($filename, '@') === 0) {
- $filename = substr($filename, 1);
- }
-
- if (!is_readable($filename)) {
- throw new InvalidArgumentException("Unable to open {$filename} for reading");
- }
-
- $this->filename = $filename;
-
- return $this;
- }
-
- public function setPostname($postname)
- {
- $this->postname = $postname;
-
- return $this;
- }
-
- public function getFilename()
- {
- return $this->filename;
- }
-
- public function getPostname()
- {
- return $this->postname;
- }
-
- public function setContentType($type)
- {
- $this->contentType = $type;
-
- return $this;
- }
-
- public function getContentType()
- {
- return $this->contentType;
- }
-
- public function getCurlValue()
- {
- // PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax
- // See: https://wiki.php.net/rfc/curl-file-upload
- if (function_exists('curl_file_create')) {
- return curl_file_create($this->filename, $this->contentType, $this->postname);
- }
-
- // Use the old style if using an older version of PHP
- $value = "@{$this->filename};filename=" . $this->postname;
- if ($this->contentType) {
- $value .= ';type=' . $this->contentType;
- }
-
- return $value;
- }
-
- /**
- * @deprecated
- * @codeCoverageIgnore
- */
- public function getCurlString()
- {
- Version::warn(__METHOD__ . ' is deprecated. Use getCurlValue()');
- return $this->getCurlValue();
- }
-
- /**
- * Determine the Content-Type of the file
- */
- protected function guessContentType()
- {
- return Mimetypes::getInstance()->fromFilename($this->filename) ?: 'application/octet-stream';
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/PostFileInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/PostFileInterface.php
deleted file mode 100644
index 7f0779d..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/PostFileInterface.php
+++ /dev/null
@@ -1,83 +0,0 @@
-method = strtoupper($method);
- $this->curlOptions = new Collection();
- $this->setUrl($url);
-
- if ($headers) {
- // Special handling for multi-value headers
- foreach ($headers as $key => $value) {
- // Deal with collisions with Host and Authorization
- if ($key == 'host' || $key == 'Host') {
- $this->setHeader($key, $value);
- } elseif ($value instanceof HeaderInterface) {
- $this->addHeader($key, $value);
- } else {
- foreach ((array) $value as $v) {
- $this->addHeader($key, $v);
- }
- }
- }
- }
-
- $this->setState(self::STATE_NEW);
- }
-
- public function __clone()
- {
- if ($this->eventDispatcher) {
- $this->eventDispatcher = clone $this->eventDispatcher;
- }
- $this->curlOptions = clone $this->curlOptions;
- $this->params = clone $this->params;
- $this->url = clone $this->url;
- $this->response = $this->responseBody = null;
- $this->headers = clone $this->headers;
-
- $this->setState(RequestInterface::STATE_NEW);
- $this->dispatch('request.clone', array('request' => $this));
- }
-
- /**
- * Get the HTTP request as a string
- *
- * @return string
- */
- public function __toString()
- {
- return $this->getRawHeaders() . "\r\n\r\n";
- }
-
- /**
- * Default method that will throw exceptions if an unsuccessful response is received.
- *
- * @param Event $event Received
- * @throws BadResponseException if the response is not successful
- */
- public static function onRequestError(Event $event)
- {
- $e = BadResponseException::factory($event['request'], $event['response']);
- $event['request']->setState(self::STATE_ERROR, array('exception' => $e) + $event->toArray());
- throw $e;
- }
-
- public function setClient(ClientInterface $client)
- {
- $this->client = $client;
-
- return $this;
- }
-
- public function getClient()
- {
- return $this->client;
- }
-
- public function getRawHeaders()
- {
- $protocolVersion = $this->protocolVersion ?: '1.1';
-
- return trim($this->method . ' ' . $this->getResource()) . ' '
- . strtoupper(str_replace('https', 'http', $this->url->getScheme()))
- . '/' . $protocolVersion . "\r\n" . implode("\r\n", $this->getHeaderLines());
- }
-
- public function setUrl($url)
- {
- if ($url instanceof Url) {
- $this->url = $url;
- } else {
- $this->url = Url::factory($url);
- }
-
- // Update the port and host header
- $this->setPort($this->url->getPort());
-
- if ($this->url->getUsername() || $this->url->getPassword()) {
- $this->setAuth($this->url->getUsername(), $this->url->getPassword());
- // Remove the auth info from the URL
- $this->url->setUsername(null);
- $this->url->setPassword(null);
- }
-
- return $this;
- }
-
- public function send()
- {
- if (!$this->client) {
- throw new RuntimeException('A client must be set on the request');
- }
-
- return $this->client->send($this);
- }
-
- public function getResponse()
- {
- return $this->response;
- }
-
- public function getQuery($asString = false)
- {
- return $asString
- ? (string) $this->url->getQuery()
- : $this->url->getQuery();
- }
-
- public function getMethod()
- {
- return $this->method;
- }
-
- public function getScheme()
- {
- return $this->url->getScheme();
- }
-
- public function setScheme($scheme)
- {
- $this->url->setScheme($scheme);
-
- return $this;
- }
-
- public function getHost()
- {
- return $this->url->getHost();
- }
-
- public function setHost($host)
- {
- $this->url->setHost($host);
- $this->setPort($this->url->getPort());
-
- return $this;
- }
-
- public function getProtocolVersion()
- {
- return $this->protocolVersion;
- }
-
- public function setProtocolVersion($protocol)
- {
- $this->protocolVersion = $protocol;
-
- return $this;
- }
-
- public function getPath()
- {
- return '/' . ltrim($this->url->getPath(), '/');
- }
-
- public function setPath($path)
- {
- $this->url->setPath($path);
-
- return $this;
- }
-
- public function getPort()
- {
- return $this->url->getPort();
- }
-
- public function setPort($port)
- {
- $this->url->setPort($port);
-
- // Include the port in the Host header if it is not the default port for the scheme of the URL
- $scheme = $this->url->getScheme();
- if ($port && (($scheme == 'http' && $port != 80) || ($scheme == 'https' && $port != 443))) {
- $this->headers['host'] = $this->headerFactory->createHeader('Host', $this->url->getHost() . ':' . $port);
- } else {
- $this->headers['host'] = $this->headerFactory->createHeader('Host', $this->url->getHost());
- }
-
- return $this;
- }
-
- public function getUsername()
- {
- return $this->username;
- }
-
- public function getPassword()
- {
- return $this->password;
- }
-
- public function setAuth($user, $password = '', $scheme = CURLAUTH_BASIC)
- {
- static $authMap = array(
- 'basic' => CURLAUTH_BASIC,
- 'digest' => CURLAUTH_DIGEST,
- 'ntlm' => CURLAUTH_NTLM,
- 'any' => CURLAUTH_ANY
- );
-
- // If we got false or null, disable authentication
- if (!$user) {
- $this->password = $this->username = null;
- $this->removeHeader('Authorization');
- $this->getCurlOptions()->remove(CURLOPT_HTTPAUTH);
- return $this;
- }
-
- if (!is_numeric($scheme)) {
- $scheme = strtolower($scheme);
- if (!isset($authMap[$scheme])) {
- throw new InvalidArgumentException($scheme . ' is not a valid authentication type');
- }
- $scheme = $authMap[$scheme];
- }
-
- $this->username = $user;
- $this->password = $password;
-
- // Bypass CURL when using basic auth to promote connection reuse
- if ($scheme == CURLAUTH_BASIC) {
- $this->getCurlOptions()->remove(CURLOPT_HTTPAUTH);
- $this->setHeader('Authorization', 'Basic ' . base64_encode($this->username . ':' . $this->password));
- } else {
- $this->getCurlOptions()
- ->set(CURLOPT_HTTPAUTH, $scheme)
- ->set(CURLOPT_USERPWD, $this->username . ':' . $this->password);
- }
-
- return $this;
- }
-
- public function getResource()
- {
- $resource = $this->getPath();
- if ($query = (string) $this->url->getQuery()) {
- $resource .= '?' . $query;
- }
-
- return $resource;
- }
-
- public function getUrl($asObject = false)
- {
- return $asObject ? clone $this->url : (string) $this->url;
- }
-
- public function getState()
- {
- return $this->state;
- }
-
- public function setState($state, array $context = array())
- {
- $oldState = $this->state;
- $this->state = $state;
-
- switch ($state) {
- case self::STATE_NEW:
- $this->response = null;
- break;
- case self::STATE_TRANSFER:
- if ($oldState !== $state) {
- // Fix Content-Length and Transfer-Encoding collisions
- if ($this->hasHeader('Transfer-Encoding') && $this->hasHeader('Content-Length')) {
- $this->removeHeader('Transfer-Encoding');
- }
- $this->dispatch('request.before_send', array('request' => $this));
- }
- break;
- case self::STATE_COMPLETE:
- if ($oldState !== $state) {
- $this->processResponse($context);
- $this->responseBody = null;
- }
- break;
- case self::STATE_ERROR:
- if (isset($context['exception'])) {
- $this->dispatch('request.exception', array(
- 'request' => $this,
- 'response' => isset($context['response']) ? $context['response'] : $this->response,
- 'exception' => isset($context['exception']) ? $context['exception'] : null
- ));
- }
- }
-
- return $this->state;
- }
-
- public function getCurlOptions()
- {
- return $this->curlOptions;
- }
-
- public function startResponse(Response $response)
- {
- $this->state = self::STATE_TRANSFER;
- $response->setEffectiveUrl((string) $this->getUrl());
- $this->response = $response;
-
- return $this;
- }
-
- public function setResponse(Response $response, $queued = false)
- {
- $response->setEffectiveUrl((string) $this->url);
-
- if ($queued) {
- $ed = $this->getEventDispatcher();
- $ed->addListener('request.before_send', $f = function ($e) use ($response, &$f, $ed) {
- $e['request']->setResponse($response);
- $ed->removeListener('request.before_send', $f);
- }, -9999);
- } else {
- $this->response = $response;
- // If a specific response body is specified, then use it instead of the response's body
- if ($this->responseBody && !$this->responseBody->getCustomData('default') && !$response->isRedirect()) {
- $this->getResponseBody()->write((string) $this->response->getBody());
- } else {
- $this->responseBody = $this->response->getBody();
- }
- $this->setState(self::STATE_COMPLETE);
- }
-
- return $this;
- }
-
- public function setResponseBody($body)
- {
- // Attempt to open a file for writing if a string was passed
- if (is_string($body)) {
- // @codeCoverageIgnoreStart
- if (!($body = fopen($body, 'w+'))) {
- throw new InvalidArgumentException('Could not open ' . $body . ' for writing');
- }
- // @codeCoverageIgnoreEnd
- }
-
- $this->responseBody = EntityBody::factory($body);
-
- return $this;
- }
-
- public function getResponseBody()
- {
- if ($this->responseBody === null) {
- $this->responseBody = EntityBody::factory()->setCustomData('default', true);
- }
-
- return $this->responseBody;
- }
-
- /**
- * Determine if the response body is repeatable (readable + seekable)
- *
- * @return bool
- * @deprecated Use getResponseBody()->isSeekable()
- * @codeCoverageIgnore
- */
- public function isResponseBodyRepeatable()
- {
- Version::warn(__METHOD__ . ' is deprecated. Use $request->getResponseBody()->isRepeatable()');
- return !$this->responseBody ? true : $this->responseBody->isRepeatable();
- }
-
- public function getCookies()
- {
- if ($cookie = $this->getHeader('Cookie')) {
- $data = ParserRegistry::getInstance()->getParser('cookie')->parseCookie($cookie);
- return $data['cookies'];
- }
-
- return array();
- }
-
- public function getCookie($name)
- {
- $cookies = $this->getCookies();
-
- return isset($cookies[$name]) ? $cookies[$name] : null;
- }
-
- public function addCookie($name, $value)
- {
- if (!$this->hasHeader('Cookie')) {
- $this->setHeader('Cookie', "{$name}={$value}");
- } else {
- $this->getHeader('Cookie')->add("{$name}={$value}");
- }
-
- // Always use semicolons to separate multiple cookie headers
- $this->getHeader('Cookie')->setGlue(';');
-
- return $this;
- }
-
- public function removeCookie($name)
- {
- if ($cookie = $this->getHeader('Cookie')) {
- foreach ($cookie as $cookieValue) {
- if (strpos($cookieValue, $name . '=') === 0) {
- $cookie->removeValue($cookieValue);
- }
- }
- }
-
- return $this;
- }
-
- public function setEventDispatcher(EventDispatcherInterface $eventDispatcher)
- {
- $this->eventDispatcher = $eventDispatcher;
- $this->eventDispatcher->addListener('request.error', array(__CLASS__, 'onRequestError'), -255);
-
- return $this;
- }
-
- public function getEventDispatcher()
- {
- if (!$this->eventDispatcher) {
- $this->setEventDispatcher(new EventDispatcher());
- }
-
- return $this->eventDispatcher;
- }
-
- public function dispatch($eventName, array $context = array())
- {
- $context['request'] = $this;
-
- return $this->getEventDispatcher()->dispatch($eventName, new Event($context));
- }
-
- public function addSubscriber(EventSubscriberInterface $subscriber)
- {
- $this->getEventDispatcher()->addSubscriber($subscriber);
-
- return $this;
- }
-
- /**
- * Get an array containing the request and response for event notifications
- *
- * @return array
- */
- protected function getEventArray()
- {
- return array(
- 'request' => $this,
- 'response' => $this->response
- );
- }
-
- /**
- * Process a received response
- *
- * @param array $context Contextual information
- * @throws RequestException|BadResponseException on unsuccessful responses
- */
- protected function processResponse(array $context = array())
- {
- if (!$this->response) {
- // If no response, then processResponse shouldn't have been called
- $e = new RequestException('Error completing request');
- $e->setRequest($this);
- throw $e;
- }
-
- $this->state = self::STATE_COMPLETE;
-
- // A request was sent, but we don't know if we'll send more or if the final response will be successful
- $this->dispatch('request.sent', $this->getEventArray() + $context);
-
- // Some response processors will remove the response or reset the state (example: ExponentialBackoffPlugin)
- if ($this->state == RequestInterface::STATE_COMPLETE) {
-
- // The request completed, so the HTTP transaction is complete
- $this->dispatch('request.complete', $this->getEventArray());
-
- // If the response is bad, allow listeners to modify it or throw exceptions. You can change the response by
- // modifying the Event object in your listeners or calling setResponse() on the request
- if ($this->response->isError()) {
- $event = new Event($this->getEventArray());
- $this->getEventDispatcher()->dispatch('request.error', $event);
- // Allow events of request.error to quietly change the response
- if ($event['response'] !== $this->response) {
- $this->response = $event['response'];
- }
- }
-
- // If a successful response was received, dispatch an event
- if ($this->response->isSuccessful()) {
- $this->dispatch('request.success', $this->getEventArray());
- }
- }
- }
-
- /**
- * @deprecated Use Guzzle\Plugin\Cache\DefaultCanCacheStrategy
- * @codeCoverageIgnore
- */
- public function canCache()
- {
- Version::warn(__METHOD__ . ' is deprecated. Use Guzzle\Plugin\Cache\DefaultCanCacheStrategy.');
- if (class_exists('Guzzle\Plugin\Cache\DefaultCanCacheStrategy')) {
- $canCache = new \Guzzle\Plugin\Cache\DefaultCanCacheStrategy();
- return $canCache->canCacheRequest($this);
- } else {
- return false;
- }
- }
-
- /**
- * @deprecated Use the history plugin (not emitting a warning as this is built-into the RedirectPlugin for now)
- * @codeCoverageIgnore
- */
- public function setIsRedirect($isRedirect)
- {
- $this->isRedirect = $isRedirect;
-
- return $this;
- }
-
- /**
- * @deprecated Use the history plugin
- * @codeCoverageIgnore
- */
- public function isRedirect()
- {
- Version::warn(__METHOD__ . ' is deprecated. Use the HistoryPlugin to track this.');
- return $this->isRedirect;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/RequestFactory.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/RequestFactory.php
deleted file mode 100644
index ba00a76..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/RequestFactory.php
+++ /dev/null
@@ -1,359 +0,0 @@
-methods = array_flip(get_class_methods(__CLASS__));
- }
-
- public function fromMessage($message)
- {
- $parsed = ParserRegistry::getInstance()->getParser('message')->parseRequest($message);
-
- if (!$parsed) {
- return false;
- }
-
- $request = $this->fromParts($parsed['method'], $parsed['request_url'],
- $parsed['headers'], $parsed['body'], $parsed['protocol'],
- $parsed['version']);
-
- // EntityEnclosingRequest adds an "Expect: 100-Continue" header when using a raw request body for PUT or POST
- // requests. This factory method should accurately reflect the message, so here we are removing the Expect
- // header if one was not supplied in the message.
- if (!isset($parsed['headers']['Expect']) && !isset($parsed['headers']['expect'])) {
- $request->removeHeader('Expect');
- }
-
- return $request;
- }
-
- public function fromParts(
- $method,
- array $urlParts,
- $headers = null,
- $body = null,
- $protocol = 'HTTP',
- $protocolVersion = '1.1'
- ) {
- return $this->create($method, Url::buildUrl($urlParts), $headers, $body)
- ->setProtocolVersion($protocolVersion);
- }
-
- public function create($method, $url, $headers = null, $body = null, array $options = array())
- {
- $method = strtoupper($method);
-
- if ($method == 'GET' || $method == 'HEAD' || $method == 'TRACE') {
- // Handle non-entity-enclosing request methods
- $request = new $this->requestClass($method, $url, $headers);
- if ($body) {
- // The body is where the response body will be stored
- $type = gettype($body);
- if ($type == 'string' || $type == 'resource' || $type == 'object') {
- $request->setResponseBody($body);
- }
- }
- } else {
- // Create an entity enclosing request by default
- $request = new $this->entityEnclosingRequestClass($method, $url, $headers);
- if ($body || $body === '0') {
- // Add POST fields and files to an entity enclosing request if an array is used
- if (is_array($body) || $body instanceof Collection) {
- // Normalize PHP style cURL uploads with a leading '@' symbol
- foreach ($body as $key => $value) {
- if (is_string($value) && substr($value, 0, 1) == '@') {
- $request->addPostFile($key, $value);
- unset($body[$key]);
- }
- }
- // Add the fields if they are still present and not all files
- $request->addPostFields($body);
- } else {
- // Add a raw entity body body to the request
- $request->setBody($body, (string) $request->getHeader('Content-Type'));
- if ((string) $request->getHeader('Transfer-Encoding') == 'chunked') {
- $request->removeHeader('Content-Length');
- }
- }
- }
- }
-
- if ($options) {
- $this->applyOptions($request, $options);
- }
-
- return $request;
- }
-
- /**
- * Clone a request while changing the method. Emulates the behavior of
- * {@see Guzzle\Http\Message\Request::clone}, but can change the HTTP method.
- *
- * @param RequestInterface $request Request to clone
- * @param string $method Method to set
- *
- * @return RequestInterface
- */
- public function cloneRequestWithMethod(RequestInterface $request, $method)
- {
- // Create the request with the same client if possible
- if ($request->getClient()) {
- $cloned = $request->getClient()->createRequest($method, $request->getUrl(), $request->getHeaders());
- } else {
- $cloned = $this->create($method, $request->getUrl(), $request->getHeaders());
- }
-
- $cloned->getCurlOptions()->replace($request->getCurlOptions()->toArray());
- $cloned->setEventDispatcher(clone $request->getEventDispatcher());
- // Ensure that that the Content-Length header is not copied if changing to GET or HEAD
- if (!($cloned instanceof EntityEnclosingRequestInterface)) {
- $cloned->removeHeader('Content-Length');
- } elseif ($request instanceof EntityEnclosingRequestInterface) {
- $cloned->setBody($request->getBody());
- }
- $cloned->getParams()->replace($request->getParams()->toArray());
- $cloned->dispatch('request.clone', array('request' => $cloned));
-
- return $cloned;
- }
-
- public function applyOptions(RequestInterface $request, array $options = array(), $flags = self::OPTIONS_NONE)
- {
- // Iterate over each key value pair and attempt to apply a config using function visitors
- foreach ($options as $key => $value) {
- $method = "visit_{$key}";
- if (isset($this->methods[$method])) {
- $this->{$method}($request, $value, $flags);
- }
- }
- }
-
- protected function visit_headers(RequestInterface $request, $value, $flags)
- {
- if (!is_array($value)) {
- throw new InvalidArgumentException('headers value must be an array');
- }
-
- if ($flags & self::OPTIONS_AS_DEFAULTS) {
- // Merge headers in but do not overwrite existing values
- foreach ($value as $key => $header) {
- if (!$request->hasHeader($key)) {
- $request->setHeader($key, $header);
- }
- }
- } else {
- $request->addHeaders($value);
- }
- }
-
- protected function visit_body(RequestInterface $request, $value, $flags)
- {
- if ($request instanceof EntityEnclosingRequestInterface) {
- $request->setBody($value);
- } else {
- throw new InvalidArgumentException('Attempting to set a body on a non-entity-enclosing request');
- }
- }
-
- protected function visit_allow_redirects(RequestInterface $request, $value, $flags)
- {
- if ($value === false) {
- $request->getParams()->set(RedirectPlugin::DISABLE, true);
- }
- }
-
- protected function visit_auth(RequestInterface $request, $value, $flags)
- {
- if (!is_array($value)) {
- throw new InvalidArgumentException('auth value must be an array');
- }
-
- $request->setAuth($value[0], isset($value[1]) ? $value[1] : null, isset($value[2]) ? $value[2] : 'basic');
- }
-
- protected function visit_query(RequestInterface $request, $value, $flags)
- {
- if (!is_array($value)) {
- throw new InvalidArgumentException('query value must be an array');
- }
-
- if ($flags & self::OPTIONS_AS_DEFAULTS) {
- // Merge query string values in but do not overwrite existing values
- $query = $request->getQuery();
- $query->overwriteWith(array_diff_key($value, $query->toArray()));
- } else {
- $request->getQuery()->overwriteWith($value);
- }
- }
-
- protected function visit_cookies(RequestInterface $request, $value, $flags)
- {
- if (!is_array($value)) {
- throw new InvalidArgumentException('cookies value must be an array');
- }
-
- foreach ($value as $name => $v) {
- $request->addCookie($name, $v);
- }
- }
-
- protected function visit_events(RequestInterface $request, $value, $flags)
- {
- if (!is_array($value)) {
- throw new InvalidArgumentException('events value must be an array');
- }
-
- foreach ($value as $name => $method) {
- if (is_array($method)) {
- $request->getEventDispatcher()->addListener($name, $method[0], $method[1]);
- } else {
- $request->getEventDispatcher()->addListener($name, $method);
- }
- }
- }
-
- protected function visit_plugins(RequestInterface $request, $value, $flags)
- {
- if (!is_array($value)) {
- throw new InvalidArgumentException('plugins value must be an array');
- }
-
- foreach ($value as $plugin) {
- $request->addSubscriber($plugin);
- }
- }
-
- protected function visit_exceptions(RequestInterface $request, $value, $flags)
- {
- if ($value === false || $value === 0) {
- $dispatcher = $request->getEventDispatcher();
- foreach ($dispatcher->getListeners('request.error') as $listener) {
- if (is_array($listener) && $listener[0] == 'Guzzle\Http\Message\Request' && $listener[1] = 'onRequestError') {
- $dispatcher->removeListener('request.error', $listener);
- break;
- }
- }
- }
- }
-
- protected function visit_save_to(RequestInterface $request, $value, $flags)
- {
- $request->setResponseBody($value);
- }
-
- protected function visit_params(RequestInterface $request, $value, $flags)
- {
- if (!is_array($value)) {
- throw new InvalidArgumentException('params value must be an array');
- }
-
- $request->getParams()->overwriteWith($value);
- }
-
- protected function visit_timeout(RequestInterface $request, $value, $flags)
- {
- if (defined('CURLOPT_TIMEOUT_MS')) {
- $request->getCurlOptions()->set(CURLOPT_TIMEOUT_MS, $value * 1000);
- } else {
- $request->getCurlOptions()->set(CURLOPT_TIMEOUT, $value);
- }
- }
-
- protected function visit_connect_timeout(RequestInterface $request, $value, $flags)
- {
- if (defined('CURLOPT_CONNECTTIMEOUT_MS')) {
- $request->getCurlOptions()->set(CURLOPT_CONNECTTIMEOUT_MS, $value * 1000);
- } else {
- $request->getCurlOptions()->set(CURLOPT_CONNECTTIMEOUT, $value);
- }
- }
-
- protected function visit_debug(RequestInterface $request, $value, $flags)
- {
- if ($value) {
- $request->getCurlOptions()->set(CURLOPT_VERBOSE, true);
- }
- }
-
- protected function visit_verify(RequestInterface $request, $value, $flags)
- {
- $curl = $request->getCurlOptions();
- if ($value === true || is_string($value)) {
- $curl[CURLOPT_SSL_VERIFYHOST] = 2;
- $curl[CURLOPT_SSL_VERIFYPEER] = true;
- if ($value !== true) {
- $curl[CURLOPT_CAINFO] = $value;
- }
- } elseif ($value === false) {
- unset($curl[CURLOPT_CAINFO]);
- $curl[CURLOPT_SSL_VERIFYHOST] = 0;
- $curl[CURLOPT_SSL_VERIFYPEER] = false;
- }
- }
-
- protected function visit_proxy(RequestInterface $request, $value, $flags)
- {
- $request->getCurlOptions()->set(CURLOPT_PROXY, $value, $flags);
- }
-
- protected function visit_cert(RequestInterface $request, $value, $flags)
- {
- if (is_array($value)) {
- $request->getCurlOptions()->set(CURLOPT_SSLCERT, $value[0]);
- $request->getCurlOptions()->set(CURLOPT_SSLCERTPASSWD, $value[1]);
- } else {
- $request->getCurlOptions()->set(CURLOPT_SSLCERT, $value);
- }
- }
-
- protected function visit_ssl_key(RequestInterface $request, $value, $flags)
- {
- if (is_array($value)) {
- $request->getCurlOptions()->set(CURLOPT_SSLKEY, $value[0]);
- $request->getCurlOptions()->set(CURLOPT_SSLKEYPASSWD, $value[1]);
- } else {
- $request->getCurlOptions()->set(CURLOPT_SSLKEY, $value);
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/RequestFactoryInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/RequestFactoryInterface.php
deleted file mode 100644
index 6088f10..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Message/RequestFactoryInterface.php
+++ /dev/null
@@ -1,105 +0,0 @@
- 'Continue',
- 101 => 'Switching Protocols',
- 102 => 'Processing',
- 200 => 'OK',
- 201 => 'Created',
- 202 => 'Accepted',
- 203 => 'Non-Authoritative Information',
- 204 => 'No Content',
- 205 => 'Reset Content',
- 206 => 'Partial Content',
- 207 => 'Multi-Status',
- 208 => 'Already Reported',
- 226 => 'IM Used',
- 300 => 'Multiple Choices',
- 301 => 'Moved Permanently',
- 302 => 'Found',
- 303 => 'See Other',
- 304 => 'Not Modified',
- 305 => 'Use Proxy',
- 307 => 'Temporary Redirect',
- 308 => 'Permanent Redirect',
- 400 => 'Bad Request',
- 401 => 'Unauthorized',
- 402 => 'Payment Required',
- 403 => 'Forbidden',
- 404 => 'Not Found',
- 405 => 'Method Not Allowed',
- 406 => 'Not Acceptable',
- 407 => 'Proxy Authentication Required',
- 408 => 'Request Timeout',
- 409 => 'Conflict',
- 410 => 'Gone',
- 411 => 'Length Required',
- 412 => 'Precondition Failed',
- 413 => 'Request Entity Too Large',
- 414 => 'Request-URI Too Long',
- 415 => 'Unsupported Media Type',
- 416 => 'Requested Range Not Satisfiable',
- 417 => 'Expectation Failed',
- 422 => 'Unprocessable Entity',
- 423 => 'Locked',
- 424 => 'Failed Dependency',
- 425 => 'Reserved for WebDAV advanced collections expired proposal',
- 426 => 'Upgrade required',
- 428 => 'Precondition Required',
- 429 => 'Too Many Requests',
- 431 => 'Request Header Fields Too Large',
- 500 => 'Internal Server Error',
- 501 => 'Not Implemented',
- 502 => 'Bad Gateway',
- 503 => 'Service Unavailable',
- 504 => 'Gateway Timeout',
- 505 => 'HTTP Version Not Supported',
- 506 => 'Variant Also Negotiates (Experimental)',
- 507 => 'Insufficient Storage',
- 508 => 'Loop Detected',
- 510 => 'Not Extended',
- 511 => 'Network Authentication Required',
- );
-
- /** @var EntityBodyInterface The response body */
- protected $body;
-
- /** @var string The reason phrase of the response (human readable code) */
- protected $reasonPhrase;
-
- /** @var string The status code of the response */
- protected $statusCode;
-
- /** @var array Information about the request */
- protected $info = array();
-
- /** @var string The effective URL that returned this response */
- protected $effectiveUrl;
-
- /** @var array Cacheable response codes (see RFC 2616:13.4) */
- protected static $cacheResponseCodes = array(200, 203, 206, 300, 301, 410);
-
- /**
- * Create a new Response based on a raw response message
- *
- * @param string $message Response message
- *
- * @return self|bool Returns false on error
- */
- public static function fromMessage($message)
- {
- $data = ParserRegistry::getInstance()->getParser('message')->parseResponse($message);
- if (!$data) {
- return false;
- }
-
- $response = new static($data['code'], $data['headers'], $data['body']);
- $response->setProtocol($data['protocol'], $data['version'])
- ->setStatus($data['code'], $data['reason_phrase']);
-
- // Set the appropriate Content-Length if the one set is inaccurate (e.g. setting to X)
- $contentLength = (string) $response->getHeader('Content-Length');
- $actualLength = strlen($data['body']);
- if (strlen($data['body']) > 0 && $contentLength != $actualLength) {
- $response->setHeader('Content-Length', $actualLength);
- }
-
- return $response;
- }
-
- /**
- * Construct the response
- *
- * @param string $statusCode The response status code (e.g. 200, 404, etc)
- * @param ToArrayInterface|array $headers The response headers
- * @param string|resource|EntityBodyInterface $body The body of the response
- *
- * @throws BadResponseException if an invalid response code is given
- */
- public function __construct($statusCode, $headers = null, $body = null)
- {
- parent::__construct();
- $this->setStatus($statusCode);
- $this->body = EntityBody::factory($body !== null ? $body : '');
-
- if ($headers) {
- if (is_array($headers)) {
- $this->setHeaders($headers);
- } elseif ($headers instanceof ToArrayInterface) {
- $this->setHeaders($headers->toArray());
- } else {
- throw new BadResponseException('Invalid headers argument received');
- }
- }
- }
-
- /**
- * @return string
- */
- public function __toString()
- {
- return $this->getMessage();
- }
-
- public function serialize()
- {
- return json_encode(array(
- 'status' => $this->statusCode,
- 'body' => (string) $this->body,
- 'headers' => $this->headers->toArray()
- ));
- }
-
- public function unserialize($serialize)
- {
- $data = json_decode($serialize, true);
- $this->__construct($data['status'], $data['headers'], $data['body']);
- }
-
- /**
- * Get the response entity body
- *
- * @param bool $asString Set to TRUE to return a string of the body rather than a full body object
- *
- * @return EntityBodyInterface|string
- */
- public function getBody($asString = false)
- {
- return $asString ? (string) $this->body : $this->body;
- }
-
- /**
- * Set the response entity body
- *
- * @param EntityBodyInterface|string $body Body to set
- *
- * @return self
- */
- public function setBody($body)
- {
- $this->body = EntityBody::factory($body);
-
- return $this;
- }
-
- /**
- * Set the protocol and protocol version of the response
- *
- * @param string $protocol Response protocol
- * @param string $version Protocol version
- *
- * @return self
- */
- public function setProtocol($protocol, $version)
- {
- $this->protocol = $protocol;
- $this->protocolVersion = $version;
-
- return $this;
- }
-
- /**
- * Get the protocol used for the response (e.g. HTTP)
- *
- * @return string
- */
- public function getProtocol()
- {
- return $this->protocol;
- }
-
- /**
- * Get the HTTP protocol version
- *
- * @return string
- */
- public function getProtocolVersion()
- {
- return $this->protocolVersion;
- }
-
- /**
- * Get a cURL transfer information
- *
- * @param string $key A single statistic to check
- *
- * @return array|string|null Returns all stats if no key is set, a single stat if a key is set, or null if a key
- * is set and not found
- * @link http://www.php.net/manual/en/function.curl-getinfo.php
- */
- public function getInfo($key = null)
- {
- if ($key === null) {
- return $this->info;
- } elseif (array_key_exists($key, $this->info)) {
- return $this->info[$key];
- } else {
- return null;
- }
- }
-
- /**
- * Set the transfer information
- *
- * @param array $info Array of cURL transfer stats
- *
- * @return self
- */
- public function setInfo(array $info)
- {
- $this->info = $info;
-
- return $this;
- }
-
- /**
- * Set the response status
- *
- * @param int $statusCode Response status code to set
- * @param string $reasonPhrase Response reason phrase
- *
- * @return self
- * @throws BadResponseException when an invalid response code is received
- */
- public function setStatus($statusCode, $reasonPhrase = '')
- {
- $this->statusCode = (int) $statusCode;
-
- if (!$reasonPhrase && isset(self::$statusTexts[$this->statusCode])) {
- $this->reasonPhrase = self::$statusTexts[$this->statusCode];
- } else {
- $this->reasonPhrase = $reasonPhrase;
- }
-
- return $this;
- }
-
- /**
- * Get the response status code
- *
- * @return integer
- */
- public function getStatusCode()
- {
- return $this->statusCode;
- }
-
- /**
- * Get the entire response as a string
- *
- * @return string
- */
- public function getMessage()
- {
- $message = $this->getRawHeaders();
-
- // Only include the body in the message if the size is < 2MB
- $size = $this->body->getSize();
- if ($size < 2097152) {
- $message .= (string) $this->body;
- }
-
- return $message;
- }
-
- /**
- * Get the the raw message headers as a string
- *
- * @return string
- */
- public function getRawHeaders()
- {
- $headers = 'HTTP/1.1 ' . $this->statusCode . ' ' . $this->reasonPhrase . "\r\n";
- $lines = $this->getHeaderLines();
- if (!empty($lines)) {
- $headers .= implode("\r\n", $lines) . "\r\n";
- }
-
- return $headers . "\r\n";
- }
-
- /**
- * Get the response reason phrase- a human readable version of the numeric
- * status code
- *
- * @return string
- */
- public function getReasonPhrase()
- {
- return $this->reasonPhrase;
- }
-
- /**
- * Get the Accept-Ranges HTTP header
- *
- * @return string Returns what partial content range types this server supports.
- */
- public function getAcceptRanges()
- {
- return (string) $this->getHeader('Accept-Ranges');
- }
-
- /**
- * Calculate the age of the response
- *
- * @return integer
- */
- public function calculateAge()
- {
- $age = $this->getHeader('Age');
-
- if ($age === null && $this->getDate()) {
- $age = time() - strtotime($this->getDate());
- }
-
- return $age === null ? null : (int) (string) $age;
- }
-
- /**
- * Get the Age HTTP header
- *
- * @return integer|null Returns the age the object has been in a proxy cache in seconds.
- */
- public function getAge()
- {
- return (string) $this->getHeader('Age');
- }
-
- /**
- * Get the Allow HTTP header
- *
- * @return string|null Returns valid actions for a specified resource. To be used for a 405 Method not allowed.
- */
- public function getAllow()
- {
- return (string) $this->getHeader('Allow');
- }
-
- /**
- * Check if an HTTP method is allowed by checking the Allow response header
- *
- * @param string $method Method to check
- *
- * @return bool
- */
- public function isMethodAllowed($method)
- {
- $allow = $this->getHeader('Allow');
- if ($allow) {
- foreach (explode(',', $allow) as $allowable) {
- if (!strcasecmp(trim($allowable), $method)) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * Get the Cache-Control HTTP header
- *
- * @return string
- */
- public function getCacheControl()
- {
- return (string) $this->getHeader('Cache-Control');
- }
-
- /**
- * Get the Connection HTTP header
- *
- * @return string
- */
- public function getConnection()
- {
- return (string) $this->getHeader('Connection');
- }
-
- /**
- * Get the Content-Encoding HTTP header
- *
- * @return string|null
- */
- public function getContentEncoding()
- {
- return (string) $this->getHeader('Content-Encoding');
- }
-
- /**
- * Get the Content-Language HTTP header
- *
- * @return string|null Returns the language the content is in.
- */
- public function getContentLanguage()
- {
- return (string) $this->getHeader('Content-Language');
- }
-
- /**
- * Get the Content-Length HTTP header
- *
- * @return integer Returns the length of the response body in bytes
- */
- public function getContentLength()
- {
- return (int) (string) $this->getHeader('Content-Length');
- }
-
- /**
- * Get the Content-Location HTTP header
- *
- * @return string|null Returns an alternate location for the returned data (e.g /index.htm)
- */
- public function getContentLocation()
- {
- return (string) $this->getHeader('Content-Location');
- }
-
- /**
- * Get the Content-Disposition HTTP header
- *
- * @return string|null Returns the Content-Disposition header
- */
- public function getContentDisposition()
- {
- return (string) $this->getHeader('Content-Disposition');
- }
-
- /**
- * Get the Content-MD5 HTTP header
- *
- * @return string|null Returns a Base64-encoded binary MD5 sum of the content of the response.
- */
- public function getContentMd5()
- {
- return (string) $this->getHeader('Content-MD5');
- }
-
- /**
- * Get the Content-Range HTTP header
- *
- * @return string Returns where in a full body message this partial message belongs (e.g. bytes 21010-47021/47022).
- */
- public function getContentRange()
- {
- return (string) $this->getHeader('Content-Range');
- }
-
- /**
- * Get the Content-Type HTTP header
- *
- * @return string Returns the mime type of this content.
- */
- public function getContentType()
- {
- return (string) $this->getHeader('Content-Type');
- }
-
- /**
- * Checks if the Content-Type is of a certain type. This is useful if the
- * Content-Type header contains charset information and you need to know if
- * the Content-Type matches a particular type.
- *
- * @param string $type Content type to check against
- *
- * @return bool
- */
- public function isContentType($type)
- {
- return stripos($this->getHeader('Content-Type'), $type) !== false;
- }
-
- /**
- * Get the Date HTTP header
- *
- * @return string|null Returns the date and time that the message was sent.
- */
- public function getDate()
- {
- return (string) $this->getHeader('Date');
- }
-
- /**
- * Get the ETag HTTP header
- *
- * @return string|null Returns an identifier for a specific version of a resource, often a Message digest.
- */
- public function getEtag()
- {
- return (string) $this->getHeader('ETag');
- }
-
- /**
- * Get the Expires HTTP header
- *
- * @return string|null Returns the date/time after which the response is considered stale.
- */
- public function getExpires()
- {
- return (string) $this->getHeader('Expires');
- }
-
- /**
- * Get the Last-Modified HTTP header
- *
- * @return string|null Returns the last modified date for the requested object, in RFC 2822 format
- * (e.g. Tue, 15 Nov 1994 12:45:26 GMT)
- */
- public function getLastModified()
- {
- return (string) $this->getHeader('Last-Modified');
- }
-
- /**
- * Get the Location HTTP header
- *
- * @return string|null Used in redirection, or when a new resource has been created.
- */
- public function getLocation()
- {
- return (string) $this->getHeader('Location');
- }
-
- /**
- * Get the Pragma HTTP header
- *
- * @return Header|null Returns the implementation-specific headers that may have various effects anywhere along
- * the request-response chain.
- */
- public function getPragma()
- {
- return (string) $this->getHeader('Pragma');
- }
-
- /**
- * Get the Proxy-Authenticate HTTP header
- *
- * @return string|null Authentication to access the proxy (e.g. Basic)
- */
- public function getProxyAuthenticate()
- {
- return (string) $this->getHeader('Proxy-Authenticate');
- }
-
- /**
- * Get the Retry-After HTTP header
- *
- * @return int|null If an entity is temporarily unavailable, this instructs the client to try again after a
- * specified period of time.
- */
- public function getRetryAfter()
- {
- return (string) $this->getHeader('Retry-After');
- }
-
- /**
- * Get the Server HTTP header
- *
- * @return string|null A name for the server
- */
- public function getServer()
- {
- return (string) $this->getHeader('Server');
- }
-
- /**
- * Get the Set-Cookie HTTP header
- *
- * @return string|null An HTTP cookie.
- */
- public function getSetCookie()
- {
- return (string) $this->getHeader('Set-Cookie');
- }
-
- /**
- * Get the Trailer HTTP header
- *
- * @return string|null The Trailer general field value indicates that the given set of header fields is present in
- * the trailer of a message encoded with chunked transfer-coding.
- */
- public function getTrailer()
- {
- return (string) $this->getHeader('Trailer');
- }
-
- /**
- * Get the Transfer-Encoding HTTP header
- *
- * @return string|null The form of encoding used to safely transfer the entity to the user
- */
- public function getTransferEncoding()
- {
- return (string) $this->getHeader('Transfer-Encoding');
- }
-
- /**
- * Get the Vary HTTP header
- *
- * @return string|null Tells downstream proxies how to match future request headers to decide whether the cached
- * response can be used rather than requesting a fresh one from the origin server.
- */
- public function getVary()
- {
- return (string) $this->getHeader('Vary');
- }
-
- /**
- * Get the Via HTTP header
- *
- * @return string|null Informs the client of proxies through which the response was sent.
- */
- public function getVia()
- {
- return (string) $this->getHeader('Via');
- }
-
- /**
- * Get the Warning HTTP header
- *
- * @return string|null A general warning about possible problems with the entity body
- */
- public function getWarning()
- {
- return (string) $this->getHeader('Warning');
- }
-
- /**
- * Get the WWW-Authenticate HTTP header
- *
- * @return string|null Indicates the authentication scheme that should be used to access the requested entity
- */
- public function getWwwAuthenticate()
- {
- return (string) $this->getHeader('WWW-Authenticate');
- }
-
- /**
- * Checks if HTTP Status code is a Client Error (4xx)
- *
- * @return bool
- */
- public function isClientError()
- {
- return $this->statusCode >= 400 && $this->statusCode < 500;
- }
-
- /**
- * Checks if HTTP Status code is Server OR Client Error (4xx or 5xx)
- *
- * @return boolean
- */
- public function isError()
- {
- return $this->isClientError() || $this->isServerError();
- }
-
- /**
- * Checks if HTTP Status code is Information (1xx)
- *
- * @return bool
- */
- public function isInformational()
- {
- return $this->statusCode < 200;
- }
-
- /**
- * Checks if HTTP Status code is a Redirect (3xx)
- *
- * @return bool
- */
- public function isRedirect()
- {
- return $this->statusCode >= 300 && $this->statusCode < 400;
- }
-
- /**
- * Checks if HTTP Status code is Server Error (5xx)
- *
- * @return bool
- */
- public function isServerError()
- {
- return $this->statusCode >= 500 && $this->statusCode < 600;
- }
-
- /**
- * Checks if HTTP Status code is Successful (2xx | 304)
- *
- * @return bool
- */
- public function isSuccessful()
- {
- return ($this->statusCode >= 200 && $this->statusCode < 300) || $this->statusCode == 304;
- }
-
- /**
- * Check if the response can be cached based on the response headers
- *
- * @return bool Returns TRUE if the response can be cached or false if not
- */
- public function canCache()
- {
- // Check if the response is cacheable based on the code
- if (!in_array((int) $this->getStatusCode(), self::$cacheResponseCodes)) {
- return false;
- }
-
- // Make sure a valid body was returned and can be cached
- if ((!$this->getBody()->isReadable() || !$this->getBody()->isSeekable())
- && ($this->getContentLength() > 0 || $this->getTransferEncoding() == 'chunked')) {
- return false;
- }
-
- // Never cache no-store resources (this is a private cache, so private
- // can be cached)
- if ($this->getHeader('Cache-Control') && $this->getHeader('Cache-Control')->hasDirective('no-store')) {
- return false;
- }
-
- return $this->isFresh() || $this->getFreshness() === null || $this->canValidate();
- }
-
- /**
- * Gets the number of seconds from the current time in which this response is still considered fresh
- *
- * @return int|null Returns the number of seconds
- */
- public function getMaxAge()
- {
- if ($header = $this->getHeader('Cache-Control')) {
- // s-max-age, then max-age, then Expires
- if ($age = $header->getDirective('s-maxage')) {
- return $age;
- }
- if ($age = $header->getDirective('max-age')) {
- return $age;
- }
- }
-
- if ($this->getHeader('Expires')) {
- return strtotime($this->getExpires()) - time();
- }
-
- return null;
- }
-
- /**
- * Check if the response is considered fresh.
- *
- * A response is considered fresh when its age is less than or equal to the freshness lifetime (maximum age) of the
- * response.
- *
- * @return bool|null
- */
- public function isFresh()
- {
- $fresh = $this->getFreshness();
-
- return $fresh === null ? null : $fresh >= 0;
- }
-
- /**
- * Check if the response can be validated against the origin server using a conditional GET request.
- *
- * @return bool
- */
- public function canValidate()
- {
- return $this->getEtag() || $this->getLastModified();
- }
-
- /**
- * Get the freshness of the response by returning the difference of the maximum lifetime of the response and the
- * age of the response (max-age - age).
- *
- * Freshness values less than 0 mean that the response is no longer fresh and is ABS(freshness) seconds expired.
- * Freshness values of greater than zero is the number of seconds until the response is no longer fresh. A NULL
- * result means that no freshness information is available.
- *
- * @return int
- */
- public function getFreshness()
- {
- $maxAge = $this->getMaxAge();
- $age = $this->calculateAge();
-
- return $maxAge && $age ? ($maxAge - $age) : null;
- }
-
- /**
- * Parse the JSON response body and return an array
- *
- * @return array|string|int|bool|float
- * @throws RuntimeException if the response body is not in JSON format
- */
- public function json()
- {
- $data = json_decode((string) $this->body, true);
- if (JSON_ERROR_NONE !== json_last_error()) {
- throw new RuntimeException('Unable to parse response body into JSON: ' . json_last_error());
- }
-
- return $data === null ? array() : $data;
- }
-
- /**
- * Parse the XML response body and return a \SimpleXMLElement.
- *
- * In order to prevent XXE attacks, this method disables loading external
- * entities. If you rely on external entities, then you must parse the
- * XML response manually by accessing the response body directly.
- *
- * @return \SimpleXMLElement
- * @throws RuntimeException if the response body is not in XML format
- * @link http://websec.io/2012/08/27/Preventing-XXE-in-PHP.html
- */
- public function xml()
- {
- $errorMessage = null;
- $internalErrors = libxml_use_internal_errors(true);
- $disableEntities = libxml_disable_entity_loader(true);
- libxml_clear_errors();
-
- try {
- $xml = new \SimpleXMLElement((string) $this->body ?: ' ', LIBXML_NONET);
- if ($error = libxml_get_last_error()) {
- $errorMessage = $error->message;
- }
- } catch (\Exception $e) {
- $errorMessage = $e->getMessage();
- }
-
- libxml_clear_errors();
- libxml_use_internal_errors($internalErrors);
- libxml_disable_entity_loader($disableEntities);
-
- if ($errorMessage) {
- throw new RuntimeException('Unable to parse response body into XML: ' . $errorMessage);
- }
-
- return $xml;
- }
-
- /**
- * Get the redirect count of this response
- *
- * @return int
- */
- public function getRedirectCount()
- {
- return (int) $this->params->get(RedirectPlugin::REDIRECT_COUNT);
- }
-
- /**
- * Set the effective URL that resulted in this response (e.g. the last redirect URL)
- *
- * @param string $url The effective URL
- *
- * @return self
- */
- public function setEffectiveUrl($url)
- {
- $this->effectiveUrl = $url;
-
- return $this;
- }
-
- /**
- * Get the effective URL that resulted in this response (e.g. the last redirect URL)
- *
- * @return string
- */
- public function getEffectiveUrl()
- {
- return $this->effectiveUrl;
- }
-
- /**
- * @deprecated
- * @codeCoverageIgnore
- */
- public function getPreviousResponse()
- {
- Version::warn(__METHOD__ . ' is deprecated. Use the HistoryPlugin.');
- return null;
- }
-
- /**
- * @deprecated
- * @codeCoverageIgnore
- */
- public function setRequest($request)
- {
- Version::warn(__METHOD__ . ' is deprecated');
- return $this;
- }
-
- /**
- * @deprecated
- * @codeCoverageIgnore
- */
- public function getRequest()
- {
- Version::warn(__METHOD__ . ' is deprecated');
- return null;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Mimetypes.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Mimetypes.php
deleted file mode 100644
index d71586a..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Mimetypes.php
+++ /dev/null
@@ -1,962 +0,0 @@
- 'text/vnd.in3d.3dml',
- '3g2' => 'video/3gpp2',
- '3gp' => 'video/3gpp',
- '7z' => 'application/x-7z-compressed',
- 'aab' => 'application/x-authorware-bin',
- 'aac' => 'audio/x-aac',
- 'aam' => 'application/x-authorware-map',
- 'aas' => 'application/x-authorware-seg',
- 'abw' => 'application/x-abiword',
- 'ac' => 'application/pkix-attr-cert',
- 'acc' => 'application/vnd.americandynamics.acc',
- 'ace' => 'application/x-ace-compressed',
- 'acu' => 'application/vnd.acucobol',
- 'acutc' => 'application/vnd.acucorp',
- 'adp' => 'audio/adpcm',
- 'aep' => 'application/vnd.audiograph',
- 'afm' => 'application/x-font-type1',
- 'afp' => 'application/vnd.ibm.modcap',
- 'ahead' => 'application/vnd.ahead.space',
- 'ai' => 'application/postscript',
- 'aif' => 'audio/x-aiff',
- 'aifc' => 'audio/x-aiff',
- 'aiff' => 'audio/x-aiff',
- 'air' => 'application/vnd.adobe.air-application-installer-package+zip',
- 'ait' => 'application/vnd.dvb.ait',
- 'ami' => 'application/vnd.amiga.ami',
- 'apk' => 'application/vnd.android.package-archive',
- 'application' => 'application/x-ms-application',
- 'apr' => 'application/vnd.lotus-approach',
- 'asa' => 'text/plain',
- 'asax' => 'application/octet-stream',
- 'asc' => 'application/pgp-signature',
- 'ascx' => 'text/plain',
- 'asf' => 'video/x-ms-asf',
- 'ashx' => 'text/plain',
- 'asm' => 'text/x-asm',
- 'asmx' => 'text/plain',
- 'aso' => 'application/vnd.accpac.simply.aso',
- 'asp' => 'text/plain',
- 'aspx' => 'text/plain',
- 'asx' => 'video/x-ms-asf',
- 'atc' => 'application/vnd.acucorp',
- 'atom' => 'application/atom+xml',
- 'atomcat' => 'application/atomcat+xml',
- 'atomsvc' => 'application/atomsvc+xml',
- 'atx' => 'application/vnd.antix.game-component',
- 'au' => 'audio/basic',
- 'avi' => 'video/x-msvideo',
- 'aw' => 'application/applixware',
- 'axd' => 'text/plain',
- 'azf' => 'application/vnd.airzip.filesecure.azf',
- 'azs' => 'application/vnd.airzip.filesecure.azs',
- 'azw' => 'application/vnd.amazon.ebook',
- 'bat' => 'application/x-msdownload',
- 'bcpio' => 'application/x-bcpio',
- 'bdf' => 'application/x-font-bdf',
- 'bdm' => 'application/vnd.syncml.dm+wbxml',
- 'bed' => 'application/vnd.realvnc.bed',
- 'bh2' => 'application/vnd.fujitsu.oasysprs',
- 'bin' => 'application/octet-stream',
- 'bmi' => 'application/vnd.bmi',
- 'bmp' => 'image/bmp',
- 'book' => 'application/vnd.framemaker',
- 'box' => 'application/vnd.previewsystems.box',
- 'boz' => 'application/x-bzip2',
- 'bpk' => 'application/octet-stream',
- 'btif' => 'image/prs.btif',
- 'bz' => 'application/x-bzip',
- 'bz2' => 'application/x-bzip2',
- 'c' => 'text/x-c',
- 'c11amc' => 'application/vnd.cluetrust.cartomobile-config',
- 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg',
- 'c4d' => 'application/vnd.clonk.c4group',
- 'c4f' => 'application/vnd.clonk.c4group',
- 'c4g' => 'application/vnd.clonk.c4group',
- 'c4p' => 'application/vnd.clonk.c4group',
- 'c4u' => 'application/vnd.clonk.c4group',
- 'cab' => 'application/vnd.ms-cab-compressed',
- 'car' => 'application/vnd.curl.car',
- 'cat' => 'application/vnd.ms-pki.seccat',
- 'cc' => 'text/x-c',
- 'cct' => 'application/x-director',
- 'ccxml' => 'application/ccxml+xml',
- 'cdbcmsg' => 'application/vnd.contact.cmsg',
- 'cdf' => 'application/x-netcdf',
- 'cdkey' => 'application/vnd.mediastation.cdkey',
- 'cdmia' => 'application/cdmi-capability',
- 'cdmic' => 'application/cdmi-container',
- 'cdmid' => 'application/cdmi-domain',
- 'cdmio' => 'application/cdmi-object',
- 'cdmiq' => 'application/cdmi-queue',
- 'cdx' => 'chemical/x-cdx',
- 'cdxml' => 'application/vnd.chemdraw+xml',
- 'cdy' => 'application/vnd.cinderella',
- 'cer' => 'application/pkix-cert',
- 'cfc' => 'application/x-coldfusion',
- 'cfm' => 'application/x-coldfusion',
- 'cgm' => 'image/cgm',
- 'chat' => 'application/x-chat',
- 'chm' => 'application/vnd.ms-htmlhelp',
- 'chrt' => 'application/vnd.kde.kchart',
- 'cif' => 'chemical/x-cif',
- 'cii' => 'application/vnd.anser-web-certificate-issue-initiation',
- 'cil' => 'application/vnd.ms-artgalry',
- 'cla' => 'application/vnd.claymore',
- 'class' => 'application/java-vm',
- 'clkk' => 'application/vnd.crick.clicker.keyboard',
- 'clkp' => 'application/vnd.crick.clicker.palette',
- 'clkt' => 'application/vnd.crick.clicker.template',
- 'clkw' => 'application/vnd.crick.clicker.wordbank',
- 'clkx' => 'application/vnd.crick.clicker',
- 'clp' => 'application/x-msclip',
- 'cmc' => 'application/vnd.cosmocaller',
- 'cmdf' => 'chemical/x-cmdf',
- 'cml' => 'chemical/x-cml',
- 'cmp' => 'application/vnd.yellowriver-custom-menu',
- 'cmx' => 'image/x-cmx',
- 'cod' => 'application/vnd.rim.cod',
- 'com' => 'application/x-msdownload',
- 'conf' => 'text/plain',
- 'cpio' => 'application/x-cpio',
- 'cpp' => 'text/x-c',
- 'cpt' => 'application/mac-compactpro',
- 'crd' => 'application/x-mscardfile',
- 'crl' => 'application/pkix-crl',
- 'crt' => 'application/x-x509-ca-cert',
- 'cryptonote' => 'application/vnd.rig.cryptonote',
- 'cs' => 'text/plain',
- 'csh' => 'application/x-csh',
- 'csml' => 'chemical/x-csml',
- 'csp' => 'application/vnd.commonspace',
- 'css' => 'text/css',
- 'cst' => 'application/x-director',
- 'csv' => 'text/csv',
- 'cu' => 'application/cu-seeme',
- 'curl' => 'text/vnd.curl',
- 'cww' => 'application/prs.cww',
- 'cxt' => 'application/x-director',
- 'cxx' => 'text/x-c',
- 'dae' => 'model/vnd.collada+xml',
- 'daf' => 'application/vnd.mobius.daf',
- 'dataless' => 'application/vnd.fdsn.seed',
- 'davmount' => 'application/davmount+xml',
- 'dcr' => 'application/x-director',
- 'dcurl' => 'text/vnd.curl.dcurl',
- 'dd2' => 'application/vnd.oma.dd2+xml',
- 'ddd' => 'application/vnd.fujixerox.ddd',
- 'deb' => 'application/x-debian-package',
- 'def' => 'text/plain',
- 'deploy' => 'application/octet-stream',
- 'der' => 'application/x-x509-ca-cert',
- 'dfac' => 'application/vnd.dreamfactory',
- 'dic' => 'text/x-c',
- 'dir' => 'application/x-director',
- 'dis' => 'application/vnd.mobius.dis',
- 'dist' => 'application/octet-stream',
- 'distz' => 'application/octet-stream',
- 'djv' => 'image/vnd.djvu',
- 'djvu' => 'image/vnd.djvu',
- 'dll' => 'application/x-msdownload',
- 'dmg' => 'application/octet-stream',
- 'dms' => 'application/octet-stream',
- 'dna' => 'application/vnd.dna',
- 'doc' => 'application/msword',
- 'docm' => 'application/vnd.ms-word.document.macroenabled.12',
- 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
- 'dot' => 'application/msword',
- 'dotm' => 'application/vnd.ms-word.template.macroenabled.12',
- 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
- 'dp' => 'application/vnd.osgi.dp',
- 'dpg' => 'application/vnd.dpgraph',
- 'dra' => 'audio/vnd.dra',
- 'dsc' => 'text/prs.lines.tag',
- 'dssc' => 'application/dssc+der',
- 'dtb' => 'application/x-dtbook+xml',
- 'dtd' => 'application/xml-dtd',
- 'dts' => 'audio/vnd.dts',
- 'dtshd' => 'audio/vnd.dts.hd',
- 'dump' => 'application/octet-stream',
- 'dvi' => 'application/x-dvi',
- 'dwf' => 'model/vnd.dwf',
- 'dwg' => 'image/vnd.dwg',
- 'dxf' => 'image/vnd.dxf',
- 'dxp' => 'application/vnd.spotfire.dxp',
- 'dxr' => 'application/x-director',
- 'ecelp4800' => 'audio/vnd.nuera.ecelp4800',
- 'ecelp7470' => 'audio/vnd.nuera.ecelp7470',
- 'ecelp9600' => 'audio/vnd.nuera.ecelp9600',
- 'ecma' => 'application/ecmascript',
- 'edm' => 'application/vnd.novadigm.edm',
- 'edx' => 'application/vnd.novadigm.edx',
- 'efif' => 'application/vnd.picsel',
- 'ei6' => 'application/vnd.pg.osasli',
- 'elc' => 'application/octet-stream',
- 'eml' => 'message/rfc822',
- 'emma' => 'application/emma+xml',
- 'eol' => 'audio/vnd.digital-winds',
- 'eot' => 'application/vnd.ms-fontobject',
- 'eps' => 'application/postscript',
- 'epub' => 'application/epub+zip',
- 'es3' => 'application/vnd.eszigno3+xml',
- 'esf' => 'application/vnd.epson.esf',
- 'et3' => 'application/vnd.eszigno3+xml',
- 'etx' => 'text/x-setext',
- 'exe' => 'application/x-msdownload',
- 'exi' => 'application/exi',
- 'ext' => 'application/vnd.novadigm.ext',
- 'ez' => 'application/andrew-inset',
- 'ez2' => 'application/vnd.ezpix-album',
- 'ez3' => 'application/vnd.ezpix-package',
- 'f' => 'text/x-fortran',
- 'f4v' => 'video/x-f4v',
- 'f77' => 'text/x-fortran',
- 'f90' => 'text/x-fortran',
- 'fbs' => 'image/vnd.fastbidsheet',
- 'fcs' => 'application/vnd.isac.fcs',
- 'fdf' => 'application/vnd.fdf',
- 'fe_launch' => 'application/vnd.denovo.fcselayout-link',
- 'fg5' => 'application/vnd.fujitsu.oasysgp',
- 'fgd' => 'application/x-director',
- 'fh' => 'image/x-freehand',
- 'fh4' => 'image/x-freehand',
- 'fh5' => 'image/x-freehand',
- 'fh7' => 'image/x-freehand',
- 'fhc' => 'image/x-freehand',
- 'fig' => 'application/x-xfig',
- 'fli' => 'video/x-fli',
- 'flo' => 'application/vnd.micrografx.flo',
- 'flv' => 'video/x-flv',
- 'flw' => 'application/vnd.kde.kivio',
- 'flx' => 'text/vnd.fmi.flexstor',
- 'fly' => 'text/vnd.fly',
- 'fm' => 'application/vnd.framemaker',
- 'fnc' => 'application/vnd.frogans.fnc',
- 'for' => 'text/x-fortran',
- 'fpx' => 'image/vnd.fpx',
- 'frame' => 'application/vnd.framemaker',
- 'fsc' => 'application/vnd.fsc.weblaunch',
- 'fst' => 'image/vnd.fst',
- 'ftc' => 'application/vnd.fluxtime.clip',
- 'fti' => 'application/vnd.anser-web-funds-transfer-initiation',
- 'fvt' => 'video/vnd.fvt',
- 'fxp' => 'application/vnd.adobe.fxp',
- 'fxpl' => 'application/vnd.adobe.fxp',
- 'fzs' => 'application/vnd.fuzzysheet',
- 'g2w' => 'application/vnd.geoplan',
- 'g3' => 'image/g3fax',
- 'g3w' => 'application/vnd.geospace',
- 'gac' => 'application/vnd.groove-account',
- 'gdl' => 'model/vnd.gdl',
- 'geo' => 'application/vnd.dynageo',
- 'gex' => 'application/vnd.geometry-explorer',
- 'ggb' => 'application/vnd.geogebra.file',
- 'ggt' => 'application/vnd.geogebra.tool',
- 'ghf' => 'application/vnd.groove-help',
- 'gif' => 'image/gif',
- 'gim' => 'application/vnd.groove-identity-message',
- 'gmx' => 'application/vnd.gmx',
- 'gnumeric' => 'application/x-gnumeric',
- 'gph' => 'application/vnd.flographit',
- 'gqf' => 'application/vnd.grafeq',
- 'gqs' => 'application/vnd.grafeq',
- 'gram' => 'application/srgs',
- 'gre' => 'application/vnd.geometry-explorer',
- 'grv' => 'application/vnd.groove-injector',
- 'grxml' => 'application/srgs+xml',
- 'gsf' => 'application/x-font-ghostscript',
- 'gtar' => 'application/x-gtar',
- 'gtm' => 'application/vnd.groove-tool-message',
- 'gtw' => 'model/vnd.gtw',
- 'gv' => 'text/vnd.graphviz',
- 'gxt' => 'application/vnd.geonext',
- 'h' => 'text/x-c',
- 'h261' => 'video/h261',
- 'h263' => 'video/h263',
- 'h264' => 'video/h264',
- 'hal' => 'application/vnd.hal+xml',
- 'hbci' => 'application/vnd.hbci',
- 'hdf' => 'application/x-hdf',
- 'hh' => 'text/x-c',
- 'hlp' => 'application/winhlp',
- 'hpgl' => 'application/vnd.hp-hpgl',
- 'hpid' => 'application/vnd.hp-hpid',
- 'hps' => 'application/vnd.hp-hps',
- 'hqx' => 'application/mac-binhex40',
- 'hta' => 'application/octet-stream',
- 'htc' => 'text/html',
- 'htke' => 'application/vnd.kenameaapp',
- 'htm' => 'text/html',
- 'html' => 'text/html',
- 'hvd' => 'application/vnd.yamaha.hv-dic',
- 'hvp' => 'application/vnd.yamaha.hv-voice',
- 'hvs' => 'application/vnd.yamaha.hv-script',
- 'i2g' => 'application/vnd.intergeo',
- 'icc' => 'application/vnd.iccprofile',
- 'ice' => 'x-conference/x-cooltalk',
- 'icm' => 'application/vnd.iccprofile',
- 'ico' => 'image/x-icon',
- 'ics' => 'text/calendar',
- 'ief' => 'image/ief',
- 'ifb' => 'text/calendar',
- 'ifm' => 'application/vnd.shana.informed.formdata',
- 'iges' => 'model/iges',
- 'igl' => 'application/vnd.igloader',
- 'igm' => 'application/vnd.insors.igm',
- 'igs' => 'model/iges',
- 'igx' => 'application/vnd.micrografx.igx',
- 'iif' => 'application/vnd.shana.informed.interchange',
- 'imp' => 'application/vnd.accpac.simply.imp',
- 'ims' => 'application/vnd.ms-ims',
- 'in' => 'text/plain',
- 'ini' => 'text/plain',
- 'ipfix' => 'application/ipfix',
- 'ipk' => 'application/vnd.shana.informed.package',
- 'irm' => 'application/vnd.ibm.rights-management',
- 'irp' => 'application/vnd.irepository.package+xml',
- 'iso' => 'application/octet-stream',
- 'itp' => 'application/vnd.shana.informed.formtemplate',
- 'ivp' => 'application/vnd.immervision-ivp',
- 'ivu' => 'application/vnd.immervision-ivu',
- 'jad' => 'text/vnd.sun.j2me.app-descriptor',
- 'jam' => 'application/vnd.jam',
- 'jar' => 'application/java-archive',
- 'java' => 'text/x-java-source',
- 'jisp' => 'application/vnd.jisp',
- 'jlt' => 'application/vnd.hp-jlyt',
- 'jnlp' => 'application/x-java-jnlp-file',
- 'joda' => 'application/vnd.joost.joda-archive',
- 'jpe' => 'image/jpeg',
- 'jpeg' => 'image/jpeg',
- 'jpg' => 'image/jpeg',
- 'jpgm' => 'video/jpm',
- 'jpgv' => 'video/jpeg',
- 'jpm' => 'video/jpm',
- 'js' => 'text/javascript',
- 'json' => 'application/json',
- 'kar' => 'audio/midi',
- 'karbon' => 'application/vnd.kde.karbon',
- 'kfo' => 'application/vnd.kde.kformula',
- 'kia' => 'application/vnd.kidspiration',
- 'kml' => 'application/vnd.google-earth.kml+xml',
- 'kmz' => 'application/vnd.google-earth.kmz',
- 'kne' => 'application/vnd.kinar',
- 'knp' => 'application/vnd.kinar',
- 'kon' => 'application/vnd.kde.kontour',
- 'kpr' => 'application/vnd.kde.kpresenter',
- 'kpt' => 'application/vnd.kde.kpresenter',
- 'ksp' => 'application/vnd.kde.kspread',
- 'ktr' => 'application/vnd.kahootz',
- 'ktx' => 'image/ktx',
- 'ktz' => 'application/vnd.kahootz',
- 'kwd' => 'application/vnd.kde.kword',
- 'kwt' => 'application/vnd.kde.kword',
- 'lasxml' => 'application/vnd.las.las+xml',
- 'latex' => 'application/x-latex',
- 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop',
- 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml',
- 'les' => 'application/vnd.hhe.lesson-player',
- 'lha' => 'application/octet-stream',
- 'link66' => 'application/vnd.route66.link66+xml',
- 'list' => 'text/plain',
- 'list3820' => 'application/vnd.ibm.modcap',
- 'listafp' => 'application/vnd.ibm.modcap',
- 'log' => 'text/plain',
- 'lostxml' => 'application/lost+xml',
- 'lrf' => 'application/octet-stream',
- 'lrm' => 'application/vnd.ms-lrm',
- 'ltf' => 'application/vnd.frogans.ltf',
- 'lvp' => 'audio/vnd.lucent.voice',
- 'lwp' => 'application/vnd.lotus-wordpro',
- 'lzh' => 'application/octet-stream',
- 'm13' => 'application/x-msmediaview',
- 'm14' => 'application/x-msmediaview',
- 'm1v' => 'video/mpeg',
- 'm21' => 'application/mp21',
- 'm2a' => 'audio/mpeg',
- 'm2v' => 'video/mpeg',
- 'm3a' => 'audio/mpeg',
- 'm3u' => 'audio/x-mpegurl',
- 'm3u8' => 'application/vnd.apple.mpegurl',
- 'm4a' => 'audio/mp4',
- 'm4u' => 'video/vnd.mpegurl',
- 'm4v' => 'video/mp4',
- 'ma' => 'application/mathematica',
- 'mads' => 'application/mads+xml',
- 'mag' => 'application/vnd.ecowin.chart',
- 'maker' => 'application/vnd.framemaker',
- 'man' => 'text/troff',
- 'mathml' => 'application/mathml+xml',
- 'mb' => 'application/mathematica',
- 'mbk' => 'application/vnd.mobius.mbk',
- 'mbox' => 'application/mbox',
- 'mc1' => 'application/vnd.medcalcdata',
- 'mcd' => 'application/vnd.mcd',
- 'mcurl' => 'text/vnd.curl.mcurl',
- 'mdb' => 'application/x-msaccess',
- 'mdi' => 'image/vnd.ms-modi',
- 'me' => 'text/troff',
- 'mesh' => 'model/mesh',
- 'meta4' => 'application/metalink4+xml',
- 'mets' => 'application/mets+xml',
- 'mfm' => 'application/vnd.mfmp',
- 'mgp' => 'application/vnd.osgeo.mapguide.package',
- 'mgz' => 'application/vnd.proteus.magazine',
- 'mid' => 'audio/midi',
- 'midi' => 'audio/midi',
- 'mif' => 'application/vnd.mif',
- 'mime' => 'message/rfc822',
- 'mj2' => 'video/mj2',
- 'mjp2' => 'video/mj2',
- 'mlp' => 'application/vnd.dolby.mlp',
- 'mmd' => 'application/vnd.chipnuts.karaoke-mmd',
- 'mmf' => 'application/vnd.smaf',
- 'mmr' => 'image/vnd.fujixerox.edmics-mmr',
- 'mny' => 'application/x-msmoney',
- 'mobi' => 'application/x-mobipocket-ebook',
- 'mods' => 'application/mods+xml',
- 'mov' => 'video/quicktime',
- 'movie' => 'video/x-sgi-movie',
- 'mp2' => 'audio/mpeg',
- 'mp21' => 'application/mp21',
- 'mp2a' => 'audio/mpeg',
- 'mp3' => 'audio/mpeg',
- 'mp4' => 'video/mp4',
- 'mp4a' => 'audio/mp4',
- 'mp4s' => 'application/mp4',
- 'mp4v' => 'video/mp4',
- 'mpc' => 'application/vnd.mophun.certificate',
- 'mpe' => 'video/mpeg',
- 'mpeg' => 'video/mpeg',
- 'mpg' => 'video/mpeg',
- 'mpg4' => 'video/mp4',
- 'mpga' => 'audio/mpeg',
- 'mpkg' => 'application/vnd.apple.installer+xml',
- 'mpm' => 'application/vnd.blueice.multipass',
- 'mpn' => 'application/vnd.mophun.application',
- 'mpp' => 'application/vnd.ms-project',
- 'mpt' => 'application/vnd.ms-project',
- 'mpy' => 'application/vnd.ibm.minipay',
- 'mqy' => 'application/vnd.mobius.mqy',
- 'mrc' => 'application/marc',
- 'mrcx' => 'application/marcxml+xml',
- 'ms' => 'text/troff',
- 'mscml' => 'application/mediaservercontrol+xml',
- 'mseed' => 'application/vnd.fdsn.mseed',
- 'mseq' => 'application/vnd.mseq',
- 'msf' => 'application/vnd.epson.msf',
- 'msh' => 'model/mesh',
- 'msi' => 'application/x-msdownload',
- 'msl' => 'application/vnd.mobius.msl',
- 'msty' => 'application/vnd.muvee.style',
- 'mts' => 'model/vnd.mts',
- 'mus' => 'application/vnd.musician',
- 'musicxml' => 'application/vnd.recordare.musicxml+xml',
- 'mvb' => 'application/x-msmediaview',
- 'mwf' => 'application/vnd.mfer',
- 'mxf' => 'application/mxf',
- 'mxl' => 'application/vnd.recordare.musicxml',
- 'mxml' => 'application/xv+xml',
- 'mxs' => 'application/vnd.triscape.mxs',
- 'mxu' => 'video/vnd.mpegurl',
- 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install',
- 'n3' => 'text/n3',
- 'nb' => 'application/mathematica',
- 'nbp' => 'application/vnd.wolfram.player',
- 'nc' => 'application/x-netcdf',
- 'ncx' => 'application/x-dtbncx+xml',
- 'ngdat' => 'application/vnd.nokia.n-gage.data',
- 'nlu' => 'application/vnd.neurolanguage.nlu',
- 'nml' => 'application/vnd.enliven',
- 'nnd' => 'application/vnd.noblenet-directory',
- 'nns' => 'application/vnd.noblenet-sealer',
- 'nnw' => 'application/vnd.noblenet-web',
- 'npx' => 'image/vnd.net-fpx',
- 'nsf' => 'application/vnd.lotus-notes',
- 'oa2' => 'application/vnd.fujitsu.oasys2',
- 'oa3' => 'application/vnd.fujitsu.oasys3',
- 'oas' => 'application/vnd.fujitsu.oasys',
- 'obd' => 'application/x-msbinder',
- 'oda' => 'application/oda',
- 'odb' => 'application/vnd.oasis.opendocument.database',
- 'odc' => 'application/vnd.oasis.opendocument.chart',
- 'odf' => 'application/vnd.oasis.opendocument.formula',
- 'odft' => 'application/vnd.oasis.opendocument.formula-template',
- 'odg' => 'application/vnd.oasis.opendocument.graphics',
- 'odi' => 'application/vnd.oasis.opendocument.image',
- 'odm' => 'application/vnd.oasis.opendocument.text-master',
- 'odp' => 'application/vnd.oasis.opendocument.presentation',
- 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
- 'odt' => 'application/vnd.oasis.opendocument.text',
- 'oga' => 'audio/ogg',
- 'ogg' => 'audio/ogg',
- 'ogv' => 'video/ogg',
- 'ogx' => 'application/ogg',
- 'onepkg' => 'application/onenote',
- 'onetmp' => 'application/onenote',
- 'onetoc' => 'application/onenote',
- 'onetoc2' => 'application/onenote',
- 'opf' => 'application/oebps-package+xml',
- 'oprc' => 'application/vnd.palm',
- 'org' => 'application/vnd.lotus-organizer',
- 'osf' => 'application/vnd.yamaha.openscoreformat',
- 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml',
- 'otc' => 'application/vnd.oasis.opendocument.chart-template',
- 'otf' => 'application/x-font-otf',
- 'otg' => 'application/vnd.oasis.opendocument.graphics-template',
- 'oth' => 'application/vnd.oasis.opendocument.text-web',
- 'oti' => 'application/vnd.oasis.opendocument.image-template',
- 'otp' => 'application/vnd.oasis.opendocument.presentation-template',
- 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
- 'ott' => 'application/vnd.oasis.opendocument.text-template',
- 'oxt' => 'application/vnd.openofficeorg.extension',
- 'p' => 'text/x-pascal',
- 'p10' => 'application/pkcs10',
- 'p12' => 'application/x-pkcs12',
- 'p7b' => 'application/x-pkcs7-certificates',
- 'p7c' => 'application/pkcs7-mime',
- 'p7m' => 'application/pkcs7-mime',
- 'p7r' => 'application/x-pkcs7-certreqresp',
- 'p7s' => 'application/pkcs7-signature',
- 'p8' => 'application/pkcs8',
- 'pas' => 'text/x-pascal',
- 'paw' => 'application/vnd.pawaafile',
- 'pbd' => 'application/vnd.powerbuilder6',
- 'pbm' => 'image/x-portable-bitmap',
- 'pcf' => 'application/x-font-pcf',
- 'pcl' => 'application/vnd.hp-pcl',
- 'pclxl' => 'application/vnd.hp-pclxl',
- 'pct' => 'image/x-pict',
- 'pcurl' => 'application/vnd.curl.pcurl',
- 'pcx' => 'image/x-pcx',
- 'pdb' => 'application/vnd.palm',
- 'pdf' => 'application/pdf',
- 'pfa' => 'application/x-font-type1',
- 'pfb' => 'application/x-font-type1',
- 'pfm' => 'application/x-font-type1',
- 'pfr' => 'application/font-tdpfr',
- 'pfx' => 'application/x-pkcs12',
- 'pgm' => 'image/x-portable-graymap',
- 'pgn' => 'application/x-chess-pgn',
- 'pgp' => 'application/pgp-encrypted',
- 'php' => 'text/x-php',
- 'phps' => 'application/x-httpd-phps',
- 'pic' => 'image/x-pict',
- 'pkg' => 'application/octet-stream',
- 'pki' => 'application/pkixcmp',
- 'pkipath' => 'application/pkix-pkipath',
- 'plb' => 'application/vnd.3gpp.pic-bw-large',
- 'plc' => 'application/vnd.mobius.plc',
- 'plf' => 'application/vnd.pocketlearn',
- 'pls' => 'application/pls+xml',
- 'pml' => 'application/vnd.ctc-posml',
- 'png' => 'image/png',
- 'pnm' => 'image/x-portable-anymap',
- 'portpkg' => 'application/vnd.macports.portpkg',
- 'pot' => 'application/vnd.ms-powerpoint',
- 'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12',
- 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
- 'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12',
- 'ppd' => 'application/vnd.cups-ppd',
- 'ppm' => 'image/x-portable-pixmap',
- 'pps' => 'application/vnd.ms-powerpoint',
- 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12',
- 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
- 'ppt' => 'application/vnd.ms-powerpoint',
- 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12',
- 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
- 'pqa' => 'application/vnd.palm',
- 'prc' => 'application/x-mobipocket-ebook',
- 'pre' => 'application/vnd.lotus-freelance',
- 'prf' => 'application/pics-rules',
- 'ps' => 'application/postscript',
- 'psb' => 'application/vnd.3gpp.pic-bw-small',
- 'psd' => 'image/vnd.adobe.photoshop',
- 'psf' => 'application/x-font-linux-psf',
- 'pskcxml' => 'application/pskc+xml',
- 'ptid' => 'application/vnd.pvi.ptid1',
- 'pub' => 'application/x-mspublisher',
- 'pvb' => 'application/vnd.3gpp.pic-bw-var',
- 'pwn' => 'application/vnd.3m.post-it-notes',
- 'pya' => 'audio/vnd.ms-playready.media.pya',
- 'pyv' => 'video/vnd.ms-playready.media.pyv',
- 'qam' => 'application/vnd.epson.quickanime',
- 'qbo' => 'application/vnd.intu.qbo',
- 'qfx' => 'application/vnd.intu.qfx',
- 'qps' => 'application/vnd.publishare-delta-tree',
- 'qt' => 'video/quicktime',
- 'qwd' => 'application/vnd.quark.quarkxpress',
- 'qwt' => 'application/vnd.quark.quarkxpress',
- 'qxb' => 'application/vnd.quark.quarkxpress',
- 'qxd' => 'application/vnd.quark.quarkxpress',
- 'qxl' => 'application/vnd.quark.quarkxpress',
- 'qxt' => 'application/vnd.quark.quarkxpress',
- 'ra' => 'audio/x-pn-realaudio',
- 'ram' => 'audio/x-pn-realaudio',
- 'rar' => 'application/x-rar-compressed',
- 'ras' => 'image/x-cmu-raster',
- 'rb' => 'text/plain',
- 'rcprofile' => 'application/vnd.ipunplugged.rcprofile',
- 'rdf' => 'application/rdf+xml',
- 'rdz' => 'application/vnd.data-vision.rdz',
- 'rep' => 'application/vnd.businessobjects',
- 'res' => 'application/x-dtbresource+xml',
- 'resx' => 'text/xml',
- 'rgb' => 'image/x-rgb',
- 'rif' => 'application/reginfo+xml',
- 'rip' => 'audio/vnd.rip',
- 'rl' => 'application/resource-lists+xml',
- 'rlc' => 'image/vnd.fujixerox.edmics-rlc',
- 'rld' => 'application/resource-lists-diff+xml',
- 'rm' => 'application/vnd.rn-realmedia',
- 'rmi' => 'audio/midi',
- 'rmp' => 'audio/x-pn-realaudio-plugin',
- 'rms' => 'application/vnd.jcp.javame.midlet-rms',
- 'rnc' => 'application/relax-ng-compact-syntax',
- 'roff' => 'text/troff',
- 'rp9' => 'application/vnd.cloanto.rp9',
- 'rpss' => 'application/vnd.nokia.radio-presets',
- 'rpst' => 'application/vnd.nokia.radio-preset',
- 'rq' => 'application/sparql-query',
- 'rs' => 'application/rls-services+xml',
- 'rsd' => 'application/rsd+xml',
- 'rss' => 'application/rss+xml',
- 'rtf' => 'application/rtf',
- 'rtx' => 'text/richtext',
- 's' => 'text/x-asm',
- 'saf' => 'application/vnd.yamaha.smaf-audio',
- 'sbml' => 'application/sbml+xml',
- 'sc' => 'application/vnd.ibm.secure-container',
- 'scd' => 'application/x-msschedule',
- 'scm' => 'application/vnd.lotus-screencam',
- 'scq' => 'application/scvp-cv-request',
- 'scs' => 'application/scvp-cv-response',
- 'scurl' => 'text/vnd.curl.scurl',
- 'sda' => 'application/vnd.stardivision.draw',
- 'sdc' => 'application/vnd.stardivision.calc',
- 'sdd' => 'application/vnd.stardivision.impress',
- 'sdkd' => 'application/vnd.solent.sdkm+xml',
- 'sdkm' => 'application/vnd.solent.sdkm+xml',
- 'sdp' => 'application/sdp',
- 'sdw' => 'application/vnd.stardivision.writer',
- 'see' => 'application/vnd.seemail',
- 'seed' => 'application/vnd.fdsn.seed',
- 'sema' => 'application/vnd.sema',
- 'semd' => 'application/vnd.semd',
- 'semf' => 'application/vnd.semf',
- 'ser' => 'application/java-serialized-object',
- 'setpay' => 'application/set-payment-initiation',
- 'setreg' => 'application/set-registration-initiation',
- 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data',
- 'sfs' => 'application/vnd.spotfire.sfs',
- 'sgl' => 'application/vnd.stardivision.writer-global',
- 'sgm' => 'text/sgml',
- 'sgml' => 'text/sgml',
- 'sh' => 'application/x-sh',
- 'shar' => 'application/x-shar',
- 'shf' => 'application/shf+xml',
- 'sig' => 'application/pgp-signature',
- 'silo' => 'model/mesh',
- 'sis' => 'application/vnd.symbian.install',
- 'sisx' => 'application/vnd.symbian.install',
- 'sit' => 'application/x-stuffit',
- 'sitx' => 'application/x-stuffitx',
- 'skd' => 'application/vnd.koan',
- 'skm' => 'application/vnd.koan',
- 'skp' => 'application/vnd.koan',
- 'skt' => 'application/vnd.koan',
- 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12',
- 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
- 'slt' => 'application/vnd.epson.salt',
- 'sm' => 'application/vnd.stepmania.stepchart',
- 'smf' => 'application/vnd.stardivision.math',
- 'smi' => 'application/smil+xml',
- 'smil' => 'application/smil+xml',
- 'snd' => 'audio/basic',
- 'snf' => 'application/x-font-snf',
- 'so' => 'application/octet-stream',
- 'spc' => 'application/x-pkcs7-certificates',
- 'spf' => 'application/vnd.yamaha.smaf-phrase',
- 'spl' => 'application/x-futuresplash',
- 'spot' => 'text/vnd.in3d.spot',
- 'spp' => 'application/scvp-vp-response',
- 'spq' => 'application/scvp-vp-request',
- 'spx' => 'audio/ogg',
- 'src' => 'application/x-wais-source',
- 'sru' => 'application/sru+xml',
- 'srx' => 'application/sparql-results+xml',
- 'sse' => 'application/vnd.kodak-descriptor',
- 'ssf' => 'application/vnd.epson.ssf',
- 'ssml' => 'application/ssml+xml',
- 'st' => 'application/vnd.sailingtracker.track',
- 'stc' => 'application/vnd.sun.xml.calc.template',
- 'std' => 'application/vnd.sun.xml.draw.template',
- 'stf' => 'application/vnd.wt.stf',
- 'sti' => 'application/vnd.sun.xml.impress.template',
- 'stk' => 'application/hyperstudio',
- 'stl' => 'application/vnd.ms-pki.stl',
- 'str' => 'application/vnd.pg.format',
- 'stw' => 'application/vnd.sun.xml.writer.template',
- 'sub' => 'image/vnd.dvb.subtitle',
- 'sus' => 'application/vnd.sus-calendar',
- 'susp' => 'application/vnd.sus-calendar',
- 'sv4cpio' => 'application/x-sv4cpio',
- 'sv4crc' => 'application/x-sv4crc',
- 'svc' => 'application/vnd.dvb.service',
- 'svd' => 'application/vnd.svd',
- 'svg' => 'image/svg+xml',
- 'svgz' => 'image/svg+xml',
- 'swa' => 'application/x-director',
- 'swf' => 'application/x-shockwave-flash',
- 'swi' => 'application/vnd.aristanetworks.swi',
- 'sxc' => 'application/vnd.sun.xml.calc',
- 'sxd' => 'application/vnd.sun.xml.draw',
- 'sxg' => 'application/vnd.sun.xml.writer.global',
- 'sxi' => 'application/vnd.sun.xml.impress',
- 'sxm' => 'application/vnd.sun.xml.math',
- 'sxw' => 'application/vnd.sun.xml.writer',
- 't' => 'text/troff',
- 'tao' => 'application/vnd.tao.intent-module-archive',
- 'tar' => 'application/x-tar',
- 'tcap' => 'application/vnd.3gpp2.tcap',
- 'tcl' => 'application/x-tcl',
- 'teacher' => 'application/vnd.smart.teacher',
- 'tei' => 'application/tei+xml',
- 'teicorpus' => 'application/tei+xml',
- 'tex' => 'application/x-tex',
- 'texi' => 'application/x-texinfo',
- 'texinfo' => 'application/x-texinfo',
- 'text' => 'text/plain',
- 'tfi' => 'application/thraud+xml',
- 'tfm' => 'application/x-tex-tfm',
- 'thmx' => 'application/vnd.ms-officetheme',
- 'tif' => 'image/tiff',
- 'tiff' => 'image/tiff',
- 'tmo' => 'application/vnd.tmobile-livetv',
- 'torrent' => 'application/x-bittorrent',
- 'tpl' => 'application/vnd.groove-tool-template',
- 'tpt' => 'application/vnd.trid.tpt',
- 'tr' => 'text/troff',
- 'tra' => 'application/vnd.trueapp',
- 'trm' => 'application/x-msterminal',
- 'tsd' => 'application/timestamped-data',
- 'tsv' => 'text/tab-separated-values',
- 'ttc' => 'application/x-font-ttf',
- 'ttf' => 'application/x-font-ttf',
- 'ttl' => 'text/turtle',
- 'twd' => 'application/vnd.simtech-mindmapper',
- 'twds' => 'application/vnd.simtech-mindmapper',
- 'txd' => 'application/vnd.genomatix.tuxedo',
- 'txf' => 'application/vnd.mobius.txf',
- 'txt' => 'text/plain',
- 'u32' => 'application/x-authorware-bin',
- 'udeb' => 'application/x-debian-package',
- 'ufd' => 'application/vnd.ufdl',
- 'ufdl' => 'application/vnd.ufdl',
- 'umj' => 'application/vnd.umajin',
- 'unityweb' => 'application/vnd.unity',
- 'uoml' => 'application/vnd.uoml+xml',
- 'uri' => 'text/uri-list',
- 'uris' => 'text/uri-list',
- 'urls' => 'text/uri-list',
- 'ustar' => 'application/x-ustar',
- 'utz' => 'application/vnd.uiq.theme',
- 'uu' => 'text/x-uuencode',
- 'uva' => 'audio/vnd.dece.audio',
- 'uvd' => 'application/vnd.dece.data',
- 'uvf' => 'application/vnd.dece.data',
- 'uvg' => 'image/vnd.dece.graphic',
- 'uvh' => 'video/vnd.dece.hd',
- 'uvi' => 'image/vnd.dece.graphic',
- 'uvm' => 'video/vnd.dece.mobile',
- 'uvp' => 'video/vnd.dece.pd',
- 'uvs' => 'video/vnd.dece.sd',
- 'uvt' => 'application/vnd.dece.ttml+xml',
- 'uvu' => 'video/vnd.uvvu.mp4',
- 'uvv' => 'video/vnd.dece.video',
- 'uvva' => 'audio/vnd.dece.audio',
- 'uvvd' => 'application/vnd.dece.data',
- 'uvvf' => 'application/vnd.dece.data',
- 'uvvg' => 'image/vnd.dece.graphic',
- 'uvvh' => 'video/vnd.dece.hd',
- 'uvvi' => 'image/vnd.dece.graphic',
- 'uvvm' => 'video/vnd.dece.mobile',
- 'uvvp' => 'video/vnd.dece.pd',
- 'uvvs' => 'video/vnd.dece.sd',
- 'uvvt' => 'application/vnd.dece.ttml+xml',
- 'uvvu' => 'video/vnd.uvvu.mp4',
- 'uvvv' => 'video/vnd.dece.video',
- 'uvvx' => 'application/vnd.dece.unspecified',
- 'uvx' => 'application/vnd.dece.unspecified',
- 'vcd' => 'application/x-cdlink',
- 'vcf' => 'text/x-vcard',
- 'vcg' => 'application/vnd.groove-vcard',
- 'vcs' => 'text/x-vcalendar',
- 'vcx' => 'application/vnd.vcx',
- 'vis' => 'application/vnd.visionary',
- 'viv' => 'video/vnd.vivo',
- 'vor' => 'application/vnd.stardivision.writer',
- 'vox' => 'application/x-authorware-bin',
- 'vrml' => 'model/vrml',
- 'vsd' => 'application/vnd.visio',
- 'vsf' => 'application/vnd.vsf',
- 'vss' => 'application/vnd.visio',
- 'vst' => 'application/vnd.visio',
- 'vsw' => 'application/vnd.visio',
- 'vtu' => 'model/vnd.vtu',
- 'vxml' => 'application/voicexml+xml',
- 'w3d' => 'application/x-director',
- 'wad' => 'application/x-doom',
- 'wav' => 'audio/x-wav',
- 'wax' => 'audio/x-ms-wax',
- 'wbmp' => 'image/vnd.wap.wbmp',
- 'wbs' => 'application/vnd.criticaltools.wbs+xml',
- 'wbxml' => 'application/vnd.wap.wbxml',
- 'wcm' => 'application/vnd.ms-works',
- 'wdb' => 'application/vnd.ms-works',
- 'weba' => 'audio/webm',
- 'webm' => 'video/webm',
- 'webp' => 'image/webp',
- 'wg' => 'application/vnd.pmi.widget',
- 'wgt' => 'application/widget',
- 'wks' => 'application/vnd.ms-works',
- 'wm' => 'video/x-ms-wm',
- 'wma' => 'audio/x-ms-wma',
- 'wmd' => 'application/x-ms-wmd',
- 'wmf' => 'application/x-msmetafile',
- 'wml' => 'text/vnd.wap.wml',
- 'wmlc' => 'application/vnd.wap.wmlc',
- 'wmls' => 'text/vnd.wap.wmlscript',
- 'wmlsc' => 'application/vnd.wap.wmlscriptc',
- 'wmv' => 'video/x-ms-wmv',
- 'wmx' => 'video/x-ms-wmx',
- 'wmz' => 'application/x-ms-wmz',
- 'woff' => 'application/x-font-woff',
- 'wpd' => 'application/vnd.wordperfect',
- 'wpl' => 'application/vnd.ms-wpl',
- 'wps' => 'application/vnd.ms-works',
- 'wqd' => 'application/vnd.wqd',
- 'wri' => 'application/x-mswrite',
- 'wrl' => 'model/vrml',
- 'wsdl' => 'application/wsdl+xml',
- 'wspolicy' => 'application/wspolicy+xml',
- 'wtb' => 'application/vnd.webturbo',
- 'wvx' => 'video/x-ms-wvx',
- 'x32' => 'application/x-authorware-bin',
- 'x3d' => 'application/vnd.hzn-3d-crossword',
- 'xap' => 'application/x-silverlight-app',
- 'xar' => 'application/vnd.xara',
- 'xbap' => 'application/x-ms-xbap',
- 'xbd' => 'application/vnd.fujixerox.docuworks.binder',
- 'xbm' => 'image/x-xbitmap',
- 'xdf' => 'application/xcap-diff+xml',
- 'xdm' => 'application/vnd.syncml.dm+xml',
- 'xdp' => 'application/vnd.adobe.xdp+xml',
- 'xdssc' => 'application/dssc+xml',
- 'xdw' => 'application/vnd.fujixerox.docuworks',
- 'xenc' => 'application/xenc+xml',
- 'xer' => 'application/patch-ops-error+xml',
- 'xfdf' => 'application/vnd.adobe.xfdf',
- 'xfdl' => 'application/vnd.xfdl',
- 'xht' => 'application/xhtml+xml',
- 'xhtml' => 'application/xhtml+xml',
- 'xhvml' => 'application/xv+xml',
- 'xif' => 'image/vnd.xiff',
- 'xla' => 'application/vnd.ms-excel',
- 'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12',
- 'xlc' => 'application/vnd.ms-excel',
- 'xlm' => 'application/vnd.ms-excel',
- 'xls' => 'application/vnd.ms-excel',
- 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12',
- 'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12',
- 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
- 'xlt' => 'application/vnd.ms-excel',
- 'xltm' => 'application/vnd.ms-excel.template.macroenabled.12',
- 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
- 'xlw' => 'application/vnd.ms-excel',
- 'xml' => 'application/xml',
- 'xo' => 'application/vnd.olpc-sugar',
- 'xop' => 'application/xop+xml',
- 'xpi' => 'application/x-xpinstall',
- 'xpm' => 'image/x-xpixmap',
- 'xpr' => 'application/vnd.is-xpr',
- 'xps' => 'application/vnd.ms-xpsdocument',
- 'xpw' => 'application/vnd.intercon.formnet',
- 'xpx' => 'application/vnd.intercon.formnet',
- 'xsl' => 'application/xml',
- 'xslt' => 'application/xslt+xml',
- 'xsm' => 'application/vnd.syncml+xml',
- 'xspf' => 'application/xspf+xml',
- 'xul' => 'application/vnd.mozilla.xul+xml',
- 'xvm' => 'application/xv+xml',
- 'xvml' => 'application/xv+xml',
- 'xwd' => 'image/x-xwindowdump',
- 'xyz' => 'chemical/x-xyz',
- 'yaml' => 'text/yaml',
- 'yang' => 'application/yang',
- 'yin' => 'application/yin+xml',
- 'yml' => 'text/yaml',
- 'zaz' => 'application/vnd.zzazz.deck+xml',
- 'zip' => 'application/zip',
- 'zir' => 'application/vnd.zul',
- 'zirz' => 'application/vnd.zul',
- 'zmm' => 'application/vnd.handheld-entertainment+xml'
- );
-
- /**
- * Get a singleton instance of the class
- *
- * @return self
- * @codeCoverageIgnore
- */
- public static function getInstance()
- {
- if (!self::$instance) {
- self::$instance = new self();
- }
-
- return self::$instance;
- }
-
- /**
- * Get a mimetype value from a file extension
- *
- * @param string $extension File extension
- *
- * @return string|null
- *
- */
- public function fromExtension($extension)
- {
- $extension = strtolower($extension);
-
- return isset($this->mimetypes[$extension]) ? $this->mimetypes[$extension] : null;
- }
-
- /**
- * Get a mimetype from a filename
- *
- * @param string $filename Filename to generate a mimetype from
- *
- * @return string|null
- */
- public function fromFilename($filename)
- {
- return $this->fromExtension(pathinfo($filename, PATHINFO_EXTENSION));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/QueryAggregator/CommaAggregator.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/QueryAggregator/CommaAggregator.php
deleted file mode 100644
index 4b4e49d..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/QueryAggregator/CommaAggregator.php
+++ /dev/null
@@ -1,20 +0,0 @@
-isUrlEncoding()) {
- return array($query->encodeValue($key) => implode(',', array_map(array($query, 'encodeValue'), $value)));
- } else {
- return array($key => implode(',', $value));
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/QueryAggregator/DuplicateAggregator.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/QueryAggregator/DuplicateAggregator.php
deleted file mode 100644
index 1bf1730..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/QueryAggregator/DuplicateAggregator.php
+++ /dev/null
@@ -1,22 +0,0 @@
-isUrlEncoding()) {
- return array($query->encodeValue($key) => array_map(array($query, 'encodeValue'), $value));
- } else {
- return array($key => $value);
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/QueryAggregator/PhpAggregator.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/QueryAggregator/PhpAggregator.php
deleted file mode 100644
index 133ea2b..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/QueryAggregator/PhpAggregator.php
+++ /dev/null
@@ -1,27 +0,0 @@
- $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;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/QueryAggregator/QueryAggregatorInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/QueryAggregator/QueryAggregatorInterface.php
deleted file mode 100644
index 72bee62..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/QueryAggregator/QueryAggregatorInterface.php
+++ /dev/null
@@ -1,22 +0,0 @@
-add($key, $value);
- $foundDuplicates = true;
- } elseif ($paramIsPhpStyleArray) {
- $q[$key] = array($value);
- } else {
- $q[$key] = $value;
- }
- } else {
- // Uses false by default to represent keys with no trailing "=" sign.
- $q->add($key, false);
- }
- }
-
- // Use the duplicate aggregator if duplicates were found and not using PHP style arrays
- if ($foundDuplicates && !$foundPhpStyle) {
- $q->setAggregator(new DuplicateAggregator());
- }
-
- return $q;
- }
-
- /**
- * Convert the query string parameters to a query string string
- *
- * @return string
- * @throws RuntimeException
- */
- public function __toString()
- {
- if (!$this->data) {
- return '';
- }
-
- $queryList = array();
- foreach ($this->prepareData($this->data) as $name => $value) {
- $queryList[] = $this->convertKvp($name, $value);
- }
-
- return implode($this->fieldSeparator, $queryList);
- }
-
- /**
- * Get the query string field separator
- *
- * @return string
- */
- public function getFieldSeparator()
- {
- return $this->fieldSeparator;
- }
-
- /**
- * Get the query string value separator
- *
- * @return string
- */
- public function getValueSeparator()
- {
- return $this->valueSeparator;
- }
-
- /**
- * Returns the type of URL encoding used by the query string
- *
- * One of: false, "RFC 3986", or "application/x-www-form-urlencoded"
- *
- * @return bool|string
- */
- public function getUrlEncoding()
- {
- return $this->urlEncode;
- }
-
- /**
- * Returns true or false if using URL encoding
- *
- * @return bool
- */
- public function isUrlEncoding()
- {
- return $this->urlEncode !== false;
- }
-
- /**
- * Provide a function for combining multi-valued query string parameters into a single or multiple fields
- *
- * @param null|QueryAggregatorInterface $aggregator Pass in a QueryAggregatorInterface object to handle converting
- * deeply nested query string variables into a flattened array.
- * Pass null to use the default PHP style aggregator. For legacy
- * reasons, this function accepts a callable that must accepts a
- * $key, $value, and query object.
- * @return self
- * @see \Guzzle\Http\QueryString::aggregateUsingComma()
- */
- public function setAggregator(QueryAggregatorInterface $aggregator = null)
- {
- // Use the default aggregator if none was set
- if (!$aggregator) {
- if (!self::$defaultAggregator) {
- self::$defaultAggregator = new PhpAggregator();
- }
- $aggregator = self::$defaultAggregator;
- }
-
- $this->aggregator = $aggregator;
-
- return $this;
- }
-
- /**
- * Set whether or not field names and values should be rawurlencoded
- *
- * @param bool|string $encode Set to TRUE to use RFC 3986 encoding (rawurlencode), false to disable encoding, or
- * form_urlencoding to use application/x-www-form-urlencoded encoding (urlencode)
- * @return self
- */
- public function useUrlEncoding($encode)
- {
- $this->urlEncode = ($encode === true) ? self::RFC_3986 : $encode;
-
- return $this;
- }
-
- /**
- * Set the query string separator
- *
- * @param string $separator The query string separator that will separate fields
- *
- * @return self
- */
- public function setFieldSeparator($separator)
- {
- $this->fieldSeparator = $separator;
-
- return $this;
- }
-
- /**
- * Set the query string value separator
- *
- * @param string $separator The query string separator that will separate values from fields
- *
- * @return self
- */
- public function setValueSeparator($separator)
- {
- $this->valueSeparator = $separator;
-
- return $this;
- }
-
- /**
- * Returns an array of url encoded field names and values
- *
- * @return array
- */
- public function urlEncode()
- {
- return $this->prepareData($this->data);
- }
-
- /**
- * URL encodes a value based on the url encoding type of the query string object
- *
- * @param string $value Value to encode
- *
- * @return string
- */
- public function encodeValue($value)
- {
- if ($this->urlEncode == self::RFC_3986) {
- return rawurlencode($value);
- } elseif ($this->urlEncode == self::FORM_URLENCODED) {
- return urlencode($value);
- } else {
- return (string) $value;
- }
- }
-
- /**
- * Url encode parameter data and convert nested query strings into a flattened hash.
- *
- * @param array $data The data to encode
- *
- * @return array Returns an array of encoded values and keys
- */
- protected function prepareData(array $data)
- {
- // If no aggregator is present then set the default
- if (!$this->aggregator) {
- $this->setAggregator(null);
- }
-
- $temp = array();
- foreach ($data as $key => $value) {
- if ($value === false || $value === null) {
- // False and null will not include the "=". Use an empty string to include the "=".
- $temp[$this->encodeValue($key)] = $value;
- } elseif (is_array($value)) {
- $temp = array_merge($temp, $this->aggregator->aggregate($key, $value, $this));
- } else {
- $temp[$this->encodeValue($key)] = $this->encodeValue($value);
- }
- }
-
- return $temp;
- }
-
- /**
- * Converts a key value pair that can contain strings, nulls, false, or arrays
- * into a single string.
- *
- * @param string $name Name of the field
- * @param mixed $value Value of the field
- * @return string
- */
- private function convertKvp($name, $value)
- {
- if ($value === self::BLANK || $value === null || $value === false) {
- return $name;
- } elseif (!is_array($value)) {
- return $name . $this->valueSeparator . $value;
- }
-
- $result = '';
- foreach ($value as $v) {
- $result .= $this->convertKvp($name, $v) . $this->fieldSeparator;
- }
-
- return rtrim($result, $this->fieldSeparator);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/ReadLimitEntityBody.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/ReadLimitEntityBody.php
deleted file mode 100644
index ef28273..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/ReadLimitEntityBody.php
+++ /dev/null
@@ -1,122 +0,0 @@
-setLimit($limit)->setOffset($offset);
- }
-
- /**
- * Returns only a subset of the decorated entity body when cast as a string
- * {@inheritdoc}
- */
- public function __toString()
- {
- if (!$this->body->isReadable() ||
- (!$this->body->isSeekable() && $this->body->isConsumed())
- ) {
- return '';
- }
-
- $originalPos = $this->body->ftell();
- $this->body->seek($this->offset);
- $data = '';
- while (!$this->feof()) {
- $data .= $this->read(1048576);
- }
- $this->body->seek($originalPos);
-
- return (string) $data ?: '';
- }
-
- public function isConsumed()
- {
- return $this->body->isConsumed() ||
- ($this->body->ftell() >= $this->offset + $this->limit);
- }
-
- /**
- * Returns the Content-Length of the limited subset of data
- * {@inheritdoc}
- */
- public function getContentLength()
- {
- $length = $this->body->getContentLength();
-
- return $length === false
- ? $this->limit
- : min($this->limit, min($length, $this->offset + $this->limit) - $this->offset);
- }
-
- /**
- * Allow for a bounded seek on the read limited entity body
- * {@inheritdoc}
- */
- public function seek($offset, $whence = SEEK_SET)
- {
- return $whence === SEEK_SET
- ? $this->body->seek(max($this->offset, min($this->offset + $this->limit, $offset)))
- : false;
- }
-
- /**
- * Set the offset to start limiting from
- *
- * @param int $offset Offset to seek to and begin byte limiting from
- *
- * @return self
- */
- public function setOffset($offset)
- {
- $this->body->seek($offset);
- $this->offset = $offset;
-
- return $this;
- }
-
- /**
- * Set the limit of bytes that the decorator allows to be read from the stream
- *
- * @param int $limit Total number of bytes to allow to be read from the stream
- *
- * @return self
- */
- public function setLimit($limit)
- {
- $this->limit = $limit;
-
- return $this;
- }
-
- public function read($length)
- {
- // Check if the current position is less than the total allowed bytes + original offset
- $remaining = ($this->offset + $this->limit) - $this->body->ftell();
- if ($remaining > 0) {
- // Only return the amount of requested data, ensuring that the byte limit is not exceeded
- return $this->body->read(min($remaining, $length));
- } else {
- return false;
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/RedirectPlugin.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/RedirectPlugin.php
deleted file mode 100644
index 1a824b8..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/RedirectPlugin.php
+++ /dev/null
@@ -1,250 +0,0 @@
- array('onRequestSent', 100),
- 'request.clone' => 'cleanupRequest',
- 'request.before_send' => 'cleanupRequest'
- );
- }
-
- /**
- * Clean up the parameters of a request when it is cloned
- *
- * @param Event $event Event emitted
- */
- public function cleanupRequest(Event $event)
- {
- $params = $event['request']->getParams();
- unset($params[self::REDIRECT_COUNT]);
- unset($params[self::PARENT_REQUEST]);
- }
-
- /**
- * Called when a request receives a redirect response
- *
- * @param Event $event Event emitted
- */
- public function onRequestSent(Event $event)
- {
- $response = $event['response'];
- $request = $event['request'];
-
- // Only act on redirect requests with Location headers
- if (!$response || $request->getParams()->get(self::DISABLE)) {
- return;
- }
-
- // Trace the original request based on parameter history
- $original = $this->getOriginalRequest($request);
-
- // Terminating condition to set the effective response on the original request
- if (!$response->isRedirect() || !$response->hasHeader('Location')) {
- if ($request !== $original) {
- // This is a terminating redirect response, so set it on the original request
- $response->getParams()->set(self::REDIRECT_COUNT, $original->getParams()->get(self::REDIRECT_COUNT));
- $original->setResponse($response);
- $response->setEffectiveUrl($request->getUrl());
- }
- return;
- }
-
- $this->sendRedirectRequest($original, $request, $response);
- }
-
- /**
- * Get the original request that initiated a series of redirects
- *
- * @param RequestInterface $request Request to get the original request from
- *
- * @return RequestInterface
- */
- protected function getOriginalRequest(RequestInterface $request)
- {
- $original = $request;
- // The number of redirects is held on the original request, so determine which request that is
- while ($parent = $original->getParams()->get(self::PARENT_REQUEST)) {
- $original = $parent;
- }
-
- return $original;
- }
-
- /**
- * Create a redirect request for a specific request object
- *
- * Takes into account strict RFC compliant redirection (e.g. redirect POST with POST) vs doing what most clients do
- * (e.g. redirect POST with GET).
- *
- * @param RequestInterface $request Request being redirected
- * @param RequestInterface $original Original request
- * @param int $statusCode Status code of the redirect
- * @param string $location Location header of the redirect
- *
- * @return RequestInterface Returns a new redirect request
- * @throws CouldNotRewindStreamException If the body needs to be rewound but cannot
- */
- protected function createRedirectRequest(
- RequestInterface $request,
- $statusCode,
- $location,
- RequestInterface $original
- ) {
- $redirectRequest = null;
- $strict = $original->getParams()->get(self::STRICT_REDIRECTS);
-
- // Switch method to GET for 303 redirects. 301 and 302 redirects also switch to GET unless we are forcing RFC
- // compliance to emulate what most browsers do. NOTE: IE only switches methods on 301/302 when coming from a POST.
- if ($request instanceof EntityEnclosingRequestInterface && ($statusCode == 303 || (!$strict && $statusCode <= 302))) {
- $redirectRequest = RequestFactory::getInstance()->cloneRequestWithMethod($request, 'GET');
- } else {
- $redirectRequest = clone $request;
- }
-
- $redirectRequest->setIsRedirect(true);
- // Always use the same response body when redirecting
- $redirectRequest->setResponseBody($request->getResponseBody());
-
- $location = Url::factory($location);
- // If the location is not absolute, then combine it with the original URL
- if (!$location->isAbsolute()) {
- $originalUrl = $redirectRequest->getUrl(true);
- // Remove query string parameters and just take what is present on the redirect Location header
- $originalUrl->getQuery()->clear();
- $location = $originalUrl->combine((string) $location, true);
- }
-
- $redirectRequest->setUrl($location);
-
- // Add the parent request to the request before it sends (make sure it's before the onRequestClone event too)
- $redirectRequest->getEventDispatcher()->addListener(
- 'request.before_send',
- $func = function ($e) use (&$func, $request, $redirectRequest) {
- $redirectRequest->getEventDispatcher()->removeListener('request.before_send', $func);
- $e['request']->getParams()->set(RedirectPlugin::PARENT_REQUEST, $request);
- }
- );
-
- // Rewind the entity body of the request if needed
- if ($redirectRequest instanceof EntityEnclosingRequestInterface && $redirectRequest->getBody()) {
- $body = $redirectRequest->getBody();
- // Only rewind the body if some of it has been read already, and throw an exception if the rewind fails
- if ($body->ftell() && !$body->rewind()) {
- throw new CouldNotRewindStreamException(
- 'Unable to rewind the non-seekable entity body of the request after redirecting. cURL probably '
- . 'sent part of body before the redirect occurred. Try adding acustom rewind function using on the '
- . 'entity body of the request using setRewindFunction().'
- );
- }
- }
-
- return $redirectRequest;
- }
-
- /**
- * Prepare the request for redirection and enforce the maximum number of allowed redirects per client
- *
- * @param RequestInterface $original Original request
- * @param RequestInterface $request Request to prepare and validate
- * @param Response $response The current response
- *
- * @return RequestInterface
- */
- protected function prepareRedirection(RequestInterface $original, RequestInterface $request, Response $response)
- {
- $params = $original->getParams();
- // This is a new redirect, so increment the redirect counter
- $current = $params[self::REDIRECT_COUNT] + 1;
- $params[self::REDIRECT_COUNT] = $current;
- // Use a provided maximum value or default to a max redirect count of 5
- $max = isset($params[self::MAX_REDIRECTS]) ? $params[self::MAX_REDIRECTS] : $this->defaultMaxRedirects;
-
- // Throw an exception if the redirect count is exceeded
- if ($current > $max) {
- $this->throwTooManyRedirectsException($original, $max);
- return false;
- } else {
- // Create a redirect request based on the redirect rules set on the request
- return $this->createRedirectRequest(
- $request,
- $response->getStatusCode(),
- trim($response->getLocation()),
- $original
- );
- }
- }
-
- /**
- * Send a redirect request and handle any errors
- *
- * @param RequestInterface $original The originating request
- * @param RequestInterface $request The current request being redirected
- * @param Response $response The response of the current request
- *
- * @throws BadResponseException|\Exception
- */
- protected function sendRedirectRequest(RequestInterface $original, RequestInterface $request, Response $response)
- {
- // Validate and create a redirect request based on the original request and current response
- if ($redirectRequest = $this->prepareRedirection($original, $request, $response)) {
- try {
- $redirectRequest->send();
- } catch (BadResponseException $e) {
- $e->getResponse();
- if (!$e->getResponse()) {
- throw $e;
- }
- }
- }
- }
-
- /**
- * Throw a too many redirects exception for a request
- *
- * @param RequestInterface $original Request
- * @param int $max Max allowed redirects
- *
- * @throws TooManyRedirectsException when too many redirects have been issued
- */
- protected function throwTooManyRedirectsException(RequestInterface $original, $max)
- {
- $original->getEventDispatcher()->addListener(
- 'request.complete',
- $func = function ($e) use (&$func, $original, $max) {
- $original->getEventDispatcher()->removeListener('request.complete', $func);
- $str = "{$max} redirects were issued for this request:\n" . $e['request']->getRawHeaders();
- throw new TooManyRedirectsException($str);
- }
- );
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Resources/cacert.pem b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Resources/cacert.pem
deleted file mode 100644
index 18ce703..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Resources/cacert.pem
+++ /dev/null
@@ -1,3870 +0,0 @@
-##
-## Bundle of CA Root Certificates
-##
-## Certificate data from Mozilla downloaded on: Wed Aug 13 21:49:32 2014
-##
-## This is a bundle of X.509 certificates of public Certificate Authorities
-## (CA). These were automatically extracted from Mozilla's root certificates
-## file (certdata.txt). This file can be found in the mozilla source tree:
-## http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt
-##
-## It contains the certificates in PEM format and therefore
-## can be directly used with curl / libcurl / php_curl, or with
-## an Apache+mod_ssl webserver for SSL client authentication.
-## Just configure this file as the SSLCACertificateFile.
-##
-## Conversion done with mk-ca-bundle.pl verison 1.22.
-## SHA1: bf2c15b3019e696660321d2227d942936dc50aa7
-##
-
-
-GTE CyberTrust Global Root
-==========================
------BEGIN CERTIFICATE-----
-MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9HVEUg
-Q29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNvbHV0aW9ucywgSW5jLjEjMCEG
-A1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJvb3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEz
-MjM1OTAwWjB1MQswCQYDVQQGEwJVUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQL
-Ex5HVEUgQ3liZXJUcnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0
-IEdsb2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrHiM3dFw4u
-sJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTSr41tiGeA5u2ylc9yMcql
-HHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X404Wqk2kmhXBIgD8SFcd5tB8FLztimQID
-AQABMA0GCSqGSIb3DQEBBAUAA4GBAG3rGwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMW
-M4ETCJ57NE7fQMh017l93PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OF
-NMQkpw0PlZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/
------END CERTIFICATE-----
-
-Thawte Server CA
-================
------BEGIN CERTIFICATE-----
-MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT
-DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs
-dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UE
-AxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5j
-b20wHhcNOTYwODAxMDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNV
-BAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29u
-c3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcG
-A1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0
-ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl
-/Kj0R1HahbUgdJSGHg91yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg7
-1CcEJRCXL+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGjEzAR
-MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG7oWDTSEwjsrZqG9J
-GubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6eQNuozDJ0uW8NxuOzRAvZim+aKZuZ
-GCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZqdq5snUb9kLy78fyGPmJvKP/iiMucEc=
------END CERTIFICATE-----
-
-Thawte Premium Server CA
-========================
------BEGIN CERTIFICATE-----
-MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkExFTATBgNVBAgT
-DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs
-dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UE
-AxMYVGhhd3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZl
-ckB0aGF3dGUuY29tMB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYT
-AlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU
-VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2
-aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBDQTEoMCYGCSqGSIb3DQEJARYZ
-cHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2
-aovXwlue2oFBYo847kkEVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIh
-Udib0GfQug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMRuHM/
-qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAm
-SCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUIhfzJATj/Tb7yFkJD57taRvvBxhEf
-8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JMpAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7t
-UCemDaYj+bvLpgcUQg==
------END CERTIFICATE-----
-
-Equifax Secure CA
-=================
------BEGIN CERTIFICATE-----
-MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE
-ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5
-MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT
-B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB
-nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR
-fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW
-8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG
-A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE
-CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG
-A1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvS
-spXXR9gjIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQFMAMB
-Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAFjOKer89961
-zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y7qj/WsjTVbJmcVfewCHrPSqnI0kB
-BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95
-70+sB3c4
------END CERTIFICATE-----
-
-Verisign Class 3 Public Primary Certification Authority
-=======================================================
------BEGIN CERTIFICATE-----
-MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx
-FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5
-IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow
-XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz
-IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA
-A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94
-f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol
-hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA
-TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah
-WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf
-Tqj/ZA1k
------END CERTIFICATE-----
-
-Verisign Class 3 Public Primary Certification Authority - G2
-============================================================
------BEGIN CERTIFICATE-----
-MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT
-MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy
-eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln
-biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz
-dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT
-MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy
-eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln
-biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz
-dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCO
-FoUgRm1HP9SFIIThbbP4pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71
-lSk8UOg013gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwIDAQAB
-MA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSkU01UbSuvDV1Ai2TT
-1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7iF6YM40AIOw7n60RzKprxaZLvcRTD
-Oaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpYoJ2daZH9
------END CERTIFICATE-----
-
-GlobalSign Root CA
-==================
------BEGIN CERTIFICATE-----
-MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx
-GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds
-b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV
-BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD
-VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa
-DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc
-THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb
-Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP
-c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX
-gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV
-HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF
-AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj
-Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG
-j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH
-hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC
-X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
------END CERTIFICATE-----
-
-GlobalSign Root CA - R2
-=======================
------BEGIN CERTIFICATE-----
-MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv
-YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh
-bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT
-aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln
-bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6
-ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp
-s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN
-S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL
-TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C
-ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E
-FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i
-YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN
-BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp
-9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu
-01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7
-9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7
-TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==
------END CERTIFICATE-----
-
-ValiCert Class 1 VA
-===================
------BEGIN CERTIFICATE-----
-MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp
-b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs
-YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh
-bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIy
-MjM0OFoXDTE5MDYyNTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0
-d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEg
-UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0
-LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA
-A4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9YLqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIi
-GQj4/xEjm84H9b9pGib+TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCm
-DuJWBQ8YTfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0LBwG
-lN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLWI8sogTLDAHkY7FkX
-icnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPwnXS3qT6gpf+2SQMT2iLM7XGCK5nP
-Orf1LXLI
------END CERTIFICATE-----
-
-ValiCert Class 2 VA
-===================
------BEGIN CERTIFICATE-----
-MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp
-b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs
-YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh
-bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw
-MTk1NFoXDTE5MDYyNjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0
-d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIg
-UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0
-LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA
-A4GNADCBiQKBgQDOOnHK5avIWZJV16vYdA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVC
-CSRrCl6zfN1SLUzm1NZ9WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7Rf
-ZHM047QSv4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9vUJSZ
-SWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTuIYEZoDJJKPTEjlbV
-UjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwCW/POuZ6lcg5Ktz885hZo+L7tdEy8
-W9ViH0Pd
------END CERTIFICATE-----
-
-RSA Root Certificate 1
-======================
------BEGIN CERTIFICATE-----
-MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp
-b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs
-YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh
-bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw
-MjIzM1oXDTE5MDYyNjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0
-d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMg
-UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0
-LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA
-A4GNADCBiQKBgQDjmFGWHOjVsQaBalfDcnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td
-3zZxFJmP3MKS8edgkpfs2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89H
-BFx1cQqYJJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliEZwgs
-3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJn0WuPIqpsHEzXcjF
-V9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/APhmcGcwTTYJBtYze4D1gCCAPRX5r
-on+jjBXu
------END CERTIFICATE-----
-
-Verisign Class 3 Public Primary Certification Authority - G3
-============================================================
------BEGIN CERTIFICATE-----
-MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV
-UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
-cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
-IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh
-dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw
-CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy
-dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv
-cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg
-Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
-ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1
-EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc
-cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw
-EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj
-055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA
-ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f
-j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC
-/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0
-xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa
-t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==
------END CERTIFICATE-----
-
-Verisign Class 4 Public Primary Certification Authority - G3
-============================================================
------BEGIN CERTIFICATE-----
-MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV
-UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
-cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
-IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh
-dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw
-CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy
-dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv
-cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg
-Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
-ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS
-tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM
-8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW
-Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX
-Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA
-j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt
-mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm
-fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd
-RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG
-UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg==
------END CERTIFICATE-----
-
-Entrust.net Secure Server CA
-============================
------BEGIN CERTIFICATE-----
-MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMCVVMxFDASBgNV
-BAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5uZXQvQ1BTIGluY29ycC4gYnkg
-cmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRl
-ZDE6MDgGA1UEAxMxRW50cnVzdC5uZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhv
-cml0eTAeFw05OTA1MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIG
-A1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBi
-eSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1p
-dGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0
-aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQ
-aO2f55M28Qpku0f1BBc/I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5
-gXpa0zf3wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OCAdcw
-ggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHboIHYpIHVMIHSMQsw
-CQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5l
-dC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF
-bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENl
-cnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu
-dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0MFqBDzIwMTkw
-NTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8BdiE1U9s/8KAGv7UISX8+1i0Bow
-HQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAaMAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EA
-BAwwChsEVjQuMAMCBJAwDQYJKoZIhvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyN
-Ewr75Ji174z4xRAN95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9
-n9cd2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=
------END CERTIFICATE-----
-
-Entrust.net Premium 2048 Secure Server CA
-=========================================
------BEGIN CERTIFICATE-----
-MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u
-ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp
-bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV
-BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx
-NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3
-d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl
-MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u
-ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
-MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL
-Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr
-hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW
-nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi
-VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E
-BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ
-KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy
-T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf
-zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT
-J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e
-nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE=
------END CERTIFICATE-----
-
-Baltimore CyberTrust Root
-=========================
------BEGIN CERTIFICATE-----
-MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE
-ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li
-ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC
-SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs
-dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME
-uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB
-UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C
-G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9
-XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr
-l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI
-VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB
-BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh
-cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5
-hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa
-Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H
-RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp
------END CERTIFICATE-----
-
-Equifax Secure Global eBusiness CA
-==================================
------BEGIN CERTIFICATE-----
-MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT
-RXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBTZWN1cmUgR2xvYmFsIGVCdXNp
-bmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIwMDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMx
-HDAaBgNVBAoTE0VxdWlmYXggU2VjdXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEds
-b2JhbCBlQnVzaW5lc3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRV
-PEnCUdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc58O/gGzN
-qfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/o5brhTMhHD4ePmBudpxn
-hcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAHMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0j
-BBgwFoAUvqigdHJQa0S3ySPY+6j/s1draGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hs
-MA0GCSqGSIb3DQEBBAUAA4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okEN
-I7SS+RkAZ70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv8qIY
-NMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV
------END CERTIFICATE-----
-
-Equifax Secure eBusiness CA 1
-=============================
------BEGIN CERTIFICATE-----
-MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT
-RXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENB
-LTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQwMDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UE
-ChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNz
-IENBLTEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ
-1MRoRvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBuWqDZQu4a
-IZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKwEnv+j6YDAgMBAAGjZjBk
-MBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFEp4MlIR21kW
-Nl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRKeDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQF
-AAOBgQB1W6ibAxHm6VZMzfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5
-lSE/9dR+WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN/Bf+
-KpYrtWKmpj29f5JZzVoqgrI3eQ==
------END CERTIFICATE-----
-
-AddTrust Low-Value Services Root
-================================
------BEGIN CERTIFICATE-----
-MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
-QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRU
-cnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMwMTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQsw
-CQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBO
-ZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEB
-AQUAA4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ulCDtbKRY6
-54eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6ntGO0/7Gcrjyvd7ZWxbWr
-oulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyldI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1
-Zmne3yzxbrww2ywkEtvrNTVokMsAsJchPXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJui
-GMx1I4S+6+JNM3GOGvDC+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8w
-HQYDVR0OBBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8EBTAD
-AQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBlMQswCQYDVQQGEwJT
-RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEw
-HwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxt
-ZBsfzQ3duQH6lmM0MkhHma6X7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0Ph
-iVYrqW9yTkkz43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY
-eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJlpz/+0WatC7xr
-mYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOAWiFeIc9TVPC6b4nbqKqVz4vj
-ccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk=
------END CERTIFICATE-----
-
-AddTrust External Root
-======================
------BEGIN CERTIFICATE-----
-MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
-QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD
-VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw
-NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU
-cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg
-Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821
-+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw
-Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo
-aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy
-2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7
-7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P
-BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL
-VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk
-VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB
-IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl
-j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
-6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355
-e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u
-G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
------END CERTIFICATE-----
-
-AddTrust Public Services Root
-=============================
------BEGIN CERTIFICATE-----
-MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
-QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSAwHgYDVQQDExdBZGRU
-cnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAxMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJ
-BgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5l
-dHdvcmsxIDAeBgNVBAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEF
-AAOCAQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV6tsfSlbu
-nyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nXGCwwfQ56HmIexkvA/X1i
-d9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnPdzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSG
-Aa2Il+tmzV7R/9x98oTaunet3IAIx6eH1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAw
-HM+A+WD+eeSI8t0A65RF62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0G
-A1UdDgQWBBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB
-/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDELMAkGA1UEBhMCU0Ux
-FDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29yazEgMB4G
-A1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4
-JNojVhaTdt02KLmuG7jD8WS6IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL
-+YPoRNWyQSW/iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao
-GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh4SINhwBk/ox9
-Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQmXiLsks3/QppEIW1cxeMiHV9H
-EufOX1362KqxMy3ZdvJOOjMMK7MtkAY=
------END CERTIFICATE-----
-
-AddTrust Qualified Certificates Root
-====================================
------BEGIN CERTIFICATE-----
-MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
-QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSMwIQYDVQQDExpBZGRU
-cnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcx
-CzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQ
-IE5ldHdvcmsxIzAhBgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG
-9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwqxBb/4Oxx
-64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G87B4pfYOQnrjfxvM0PC3
-KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i2O+tCBGaKZnhqkRFmhJePp1tUvznoD1o
-L/BLcHwTOK28FSXx1s6rosAx1i+f4P8UWfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GR
-wVY18BTcZTYJbqukB8c10cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HU
-MIHRMB0GA1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/
-BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6FrpGkwZzELMAkGA1UE
-BhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29y
-azEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlmaWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQAD
-ggEBABmrder4i2VhlRO6aQTvhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxG
-GuoYQ992zPlmhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X
-dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3P6CxB9bpT9ze
-RXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9YiQBCYz95OdBEsIJuQRno3eDB
-iFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5noxqE=
------END CERTIFICATE-----
-
-Entrust Root Certification Authority
-====================================
------BEGIN CERTIFICATE-----
-MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV
-BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw
-b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG
-A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0
-MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu
-MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu
-Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v
-dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
-ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYsz
-A9u3g3s+IIRe7bJWKKf44LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOww
-Cj0Yzfv9KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGIrb68
-j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi94DkZfs0Nw4pgHBN
-rziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOBsDCBrTAOBgNVHQ8BAf8EBAMCAQYw
-DwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAigA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1
-MzQyWjAfBgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DH
-hmak8fdLQ/uEvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA
-A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM
-Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa
-v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS
-W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0
-tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8
------END CERTIFICATE-----
-
-RSA Security 2048 v3
-====================
------BEGIN CERTIFICATE-----
-MIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6MRkwFwYDVQQK
-ExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJpdHkgMjA0OCBWMzAeFw0wMTAy
-MjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAXBgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAb
-BgNVBAsTFFJTQSBTZWN1cml0eSAyMDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
-AQEAt49VcdKA3XtpeafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7
-Jylg/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGlwSMiuLgb
-WhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnhAMFRD0xS+ARaqn1y07iH
-KrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2PcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP
-+Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpuAWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/
-MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4E
-FgQUB8NRMKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYcHnmY
-v/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/Zb5gEydxiKRz44Rj
-0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+f00/FGj1EVDVwfSQpQgdMWD/YIwj
-VAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVOrSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395
-nzIlQnQFgCi/vcEkllgVsRch6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kA
-pKnXwiJPZ9d37CAFYd4=
------END CERTIFICATE-----
-
-GeoTrust Global CA
-==================
------BEGIN CERTIFICATE-----
-MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYDVQQK
-Ew1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIwNTIxMDQw
-MDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j
-LjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
-CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo
-BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet
-8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc
-T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU
-vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD
-AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk
-DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q
-zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4
-d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2
-mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p
-XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm
-Mw==
------END CERTIFICATE-----
-
-GeoTrust Global CA 2
-====================
------BEGIN CERTIFICATE-----
-MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN
-R2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwHhcNMDQwMzA0MDUw
-MDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j
-LjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
-ggEKAoIBAQDvPE1APRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/
-NTL8Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hLTytCOb1k
-LUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL5mkWRxHCJ1kDs6ZgwiFA
-Vvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7S4wMcoKK+xfNAGw6EzywhIdLFnopsk/b
-HdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQF
-MAMBAf8wHQYDVR0OBBYEFHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNH
-K266ZUapEBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6tdEPx7
-srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv/NgdRN3ggX+d6Yvh
-ZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywNA0ZF66D0f0hExghAzN4bcLUprbqL
-OzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkC
-x1YAzUm5s2x7UwQa4qjJqhIFI8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqF
-H4z1Ir+rzoPz4iIprn2DQKi6bA==
------END CERTIFICATE-----
-
-GeoTrust Universal CA
-=====================
------BEGIN CERTIFICATE-----
-MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN
-R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1
-MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu
-Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP
-ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t
-JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e
-RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs
-7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d
-8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V
-qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga
-Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB
-Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu
-KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08
-ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0
-XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB
-hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc
-aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2
-qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL
-oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK
-xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF
-KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2
-DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK
-xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU
-p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI
-P/rmMuGNG2+k5o7Y+SlIis5z/iw=
------END CERTIFICATE-----
-
-GeoTrust Universal CA 2
-=======================
------BEGIN CERTIFICATE-----
-MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN
-R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0
-MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg
-SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA
-A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0
-DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUGFF+3Qs17
-j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdqXbboW0W63MOhBW9Wjo8Q
-JqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxLse4YuU6W3Nx2/zu+z18DwPw76L5GG//a
-QMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2
-WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP
-20gaXT73y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRthAAn
-ZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgocQIgfksILAAX/8sgC
-SqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4Lt1ZrtmhN79UNdxzMk+MBB4zsslG
-8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2
-+/CfXGJx7Tz0RzgQKzAfBgNVHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E
-BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z
-dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ
-4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+
-mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq
-A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg
-Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP
-pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d
-FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp
-gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm
-X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS
------END CERTIFICATE-----
-
-America Online Root Certification Authority 1
-=============================================
------BEGIN CERTIFICATE-----
-MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT
-QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp
-Y2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkG
-A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg
-T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQAD
-ggEPADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lkhsmj76CG
-v2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym1BW32J/X3HGrfpq/m44z
-DyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsWOqMFf6Dch9Wc/HKpoH145LcxVR5lu9Rh
-sCFg7RAycsWSJR74kEoYeEfffjA3PlAb2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP
-8c9GsEsPPt2IYriMqQkoO3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0T
-AQH/BAUwAwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAUAK3Z
-o/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBBQUAA4IBAQB8itEf
-GDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkFZu90821fnZmv9ov761KyBZiibyrF
-VL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAbLjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft
-3OJvx8Fi8eNy1gTIdGcL+oiroQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43g
-Kd8hdIaC2y+CMMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds
-sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7
------END CERTIFICATE-----
-
-America Online Root Certification Authority 2
-=============================================
------BEGIN CERTIFICATE-----
-MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT
-QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp
-Y2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkG
-A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg
-T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQAD
-ggIPADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC206B89en
-fHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFciKtZHgVdEglZTvYYUAQv8
-f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2JxhP7JsowtS013wMPgwr38oE18aO6lhO
-qKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JN
-RvCAOVIyD+OEsnpD8l7eXz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0
-gBe4lL8BPeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67Xnfn
-6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEqZ8A9W6Wa6897Gqid
-FEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZo2C7HK2JNDJiuEMhBnIMoVxtRsX6
-Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3+L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnj
-B453cMor9H124HhnAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3Op
-aaEg5+31IqEjFNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE
-AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmnxPBUlgtk87FY
-T15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2LHo1YGwRgJfMqZJS5ivmae2p
-+DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzcccobGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXg
-JXUjhx5c3LqdsKyzadsXg8n33gy8CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//Zoy
-zH1kUQ7rVyZ2OuMeIjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgO
-ZtMADjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2FAjgQ5ANh
-1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUXOm/9riW99XJZZLF0Kjhf
-GEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPbAZO1XB4Y3WRayhgoPmMEEf0cjQAPuDff
-Z4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQlZvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuP
-cX/9XhmgD0uRuMRUvAawRY8mkaKO/qk=
------END CERTIFICATE-----
-
-Visa eCommerce Root
-===================
------BEGIN CERTIFICATE-----
-MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQG
-EwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2Ug
-QXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2
-WhcNMjIwNjI0MDAxNjEyWjBrMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMm
-VmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv
-bW1lcmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h2mCxlCfL
-F9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4ElpF7sDPwsRROEW+1QK8b
-RaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdVZqW1LS7YgFmypw23RuwhY/81q6UCzyr0
-TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI
-/k4+oKsGGelT84ATB+0tvz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzs
-GHxBvfaLdXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG
-MB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUFAAOCAQEAX/FBfXxc
-CLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcRzCSs00Rsca4BIGsDoo8Ytyk6feUW
-YFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pz
-zkWKsKZJ/0x9nXGIxHYdkFsd7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBu
-YQa7FkKMcPcw++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt
-398znM/jra6O1I7mT1GvFpLgXPYHDw==
------END CERTIFICATE-----
-
-Certum Root CA
-==============
------BEGIN CERTIFICATE-----
-MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQK
-ExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBDQTAeFw0wMjA2MTExMDQ2Mzla
-Fw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8u
-by4xEjAQBgNVBAMTCUNlcnR1bSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6x
-wS7TT3zNJc4YPk/EjG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdL
-kKWoePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GIULdtlkIJ
-89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapuOb7kky/ZR6By6/qmW6/K
-Uz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUgAKpoC6EahQGcxEZjgoi2IrHu/qpGWX7P
-NSzVttpd90gzFFS269lvzs2I1qsb2pY7HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkq
-hkiG9w0BAQUFAAOCAQEAuI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+
-GXYkHAQaTOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTgxSvg
-GrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1qCjqTE5s7FCMTY5w/
-0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5xO/fIR/RpbxXyEV6DHpx8Uq79AtoS
-qFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs6GAqm4VKQPNriiTsBhYscw==
------END CERTIFICATE-----
-
-Comodo AAA Services root
-========================
------BEGIN CERTIFICATE-----
-MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS
-R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg
-TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw
-MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl
-c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV
-BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
-ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG
-C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs
-i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW
-Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH
-Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK
-Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f
-BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl
-cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz
-LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm
-7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz
-Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z
-8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C
-12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==
------END CERTIFICATE-----
-
-Comodo Secure Services root
-===========================
------BEGIN CERTIFICATE-----
-MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS
-R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg
-TGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAw
-MDAwMFoXDTI4MTIzMTIzNTk1OVowfjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFu
-Y2hlc3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAi
-BgNVBAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP
-ADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPMcm3ye5drswfxdySRXyWP
-9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3SHpR7LZQdqnXXs5jLrLxkU0C8j6ysNstc
-rbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rC
-oznl2yY4rYsK7hljxxwk3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3V
-p6ea5EQz6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNVHQ4E
-FgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w
-gYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL1NlY3VyZUNlcnRpZmlj
-YXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRwOi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlm
-aWNhdGVTZXJ2aWNlcy5jcmwwDQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm
-4J4oqF7Tt/Q05qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj
-Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtIgKvcnDe4IRRL
-DXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJaD61JlfutuC23bkpgHl9j6Pw
-pCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDlizeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1H
-RR3B7Hzs/Sk=
------END CERTIFICATE-----
-
-Comodo Trusted Services root
-============================
------BEGIN CERTIFICATE-----
-MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS
-R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg
-TGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEw
-MDAwMDBaFw0yODEyMzEyMzU5NTlaMH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1h
-bmNoZXN0ZXIxEDAOBgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUw
-IwYDVQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0BAQEFAAOC
-AQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWWfnJSoBVC21ndZHoa0Lh7
-3TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMtTGo87IvDktJTdyR0nAducPy9C1t2ul/y
-/9c3S0pgePfw+spwtOpZqqPOSC+pw7ILfhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6
-juljatEPmsbS9Is6FARW1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsS
-ivnkBbA7kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0GA1Ud
-DgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB
-/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21vZG9jYS5jb20vVHJ1c3RlZENlcnRp
-ZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRodHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENl
-cnRpZmljYXRlU2VydmljZXMuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8Ntw
-uleGFTQQuS9/HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32
-pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxISjBc/lDb+XbDA
-BHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+xqFx7D+gIIxmOom0jtTYsU0l
-R+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/AtyjcndBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O
-9y5Xt5hwXsjEeLBi
------END CERTIFICATE-----
-
-QuoVadis Root CA
-================
------BEGIN CERTIFICATE-----
-MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE
-ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0
-eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz
-MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp
-cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD
-EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF
-AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk
-J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL
-F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL
-YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen
-AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w
-PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y
-ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7
-MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj
-YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs
-ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh
-Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW
-Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu
-BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw
-FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0
-aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6
-tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo
-fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul
-LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x
-gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi
-5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi
-5nrQNiOKSnQ2+Q==
------END CERTIFICATE-----
-
-QuoVadis Root CA 2
-==================
------BEGIN CERTIFICATE-----
-MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT
-EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx
-ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM
-aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC
-DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6
-XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk
-lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB
-lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy
-lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt
-66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn
-wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh
-D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy
-BNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuIyV77zGHcizN300QyNQliBJIWENie
-J0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1Ud
-DgQWBBQahGK8SEwzJQTU7tD2A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGU
-a6FJpEcwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT
-ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv
-Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3
-UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm
-VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK
-+JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW
-IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1
-WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X
-f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II
-4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8
-VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u
------END CERTIFICATE-----
-
-QuoVadis Root CA 3
-==================
------BEGIN CERTIFICATE-----
-MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT
-EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx
-OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM
-aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC
-DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg
-DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij
-KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K
-DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv
-BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp
-p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8
-nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX
-MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM
-Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A4iLItLRkT9a6fUg+qGkM17uGcclz
-uD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYDVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHT
-BgkrBgEEAb5YAAMwgcUwgZMGCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmlj
-YXRlIGNvbnN0aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0
-aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVudC4wLQYIKwYB
-BQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD
-VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4
-ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE
-AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV
-qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s
-hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z
-POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2
-Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp
-8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC
-bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu
-g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p
-vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr
-qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto=
------END CERTIFICATE-----
-
-Security Communication Root CA
-==============================
------BEGIN CERTIFICATE-----
-MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP
-U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw
-HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP
-U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw
-ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw
-8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM
-DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX
-5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd
-DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2
-JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw
-DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g
-0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a
-mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ
-s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ
-6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi
-FL39vmwLAw==
------END CERTIFICATE-----
-
-Sonera Class 2 Root CA
-======================
------BEGIN CERTIFICATE-----
-MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG
-U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw
-NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh
-IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3
-/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT
-dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG
-f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P
-tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH
-nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT
-XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt
-0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI
-cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph
-Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx
-EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH
-llpwrN9M
------END CERTIFICATE-----
-
-Staat der Nederlanden Root CA
-=============================
------BEGIN CERTIFICATE-----
-MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJOTDEeMBwGA1UE
-ChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFhdCBkZXIgTmVkZXJsYW5kZW4g
-Um9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEyMTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4w
-HAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxh
-bmRlbiBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFt
-vsznExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw719tV2U02P
-jLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MOhXeiD+EwR+4A5zN9RGca
-C1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+UtFE5A3+y3qcym7RHjm+0Sq7lr7HcsBth
-vJly3uSJt3omXdozSVtSnA71iq3DuD3oBmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn6
-22r+I/q85Ej0ZytqERAhSQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRV
-HSAAMDwwOgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMvcm9v
-dC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA7Jbg0zTBLL9s+DAN
-BgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k/rvuFbQvBgwp8qiSpGEN/KtcCFtR
-EytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzmeafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbw
-MVcoEoJz6TMvplW0C5GUR5z6u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3y
-nGQI0DvDKcWy7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR
-iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw==
------END CERTIFICATE-----
-
-TDC Internet Root CA
-====================
------BEGIN CERTIFICATE-----
-MIIEKzCCAxOgAwIBAgIEOsylTDANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJESzEVMBMGA1UE
-ChMMVERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTAeFw0wMTA0MDUx
-NjMzMTdaFw0yMTA0MDUxNzAzMTdaMEMxCzAJBgNVBAYTAkRLMRUwEwYDVQQKEwxUREMgSW50ZXJu
-ZXQxHTAbBgNVBAsTFFREQyBJbnRlcm5ldCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
-MIIBCgKCAQEAxLhAvJHVYx/XmaCLDEAedLdInUaMArLgJF/wGROnN4NrXceO+YQwzho7+vvOi20j
-xsNuZp+Jpd/gQlBn+h9sHvTQBda/ytZO5GhgbEaqHF1j4QeGDmUApy6mcca8uYGoOn0a0vnRrEvL
-znWv3Hv6gXPU/Lq9QYjUdLP5Xjg6PEOo0pVOd20TDJ2PeAG3WiAfAzc14izbSysseLlJ28TQx5yc
-5IogCSEWVmb/Bexb4/DPqyQkXsN/cHoSxNK1EKC2IeGNeGlVRGn1ypYcNIUXJXfi9i8nmHj9eQY6
-otZaQ8H/7AQ77hPv01ha/5Lr7K7a8jcDR0G2l8ktCkEiu7vmpwIDAQABo4IBJTCCASEwEQYJYIZI
-AYb4QgEBBAQDAgAHMGUGA1UdHwReMFwwWqBYoFakVDBSMQswCQYDVQQGEwJESzEVMBMGA1UEChMM
-VERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTENMAsGA1UEAxMEQ1JM
-MTArBgNVHRAEJDAigA8yMDAxMDQwNTE2MzMxN1qBDzIwMjEwNDA1MTcwMzE3WjALBgNVHQ8EBAMC
-AQYwHwYDVR0jBBgwFoAUbGQBx/2FbazI2p5QCIUItTxWqFAwHQYDVR0OBBYEFGxkAcf9hW2syNqe
-UAiFCLU8VqhQMAwGA1UdEwQFMAMBAf8wHQYJKoZIhvZ9B0EABBAwDhsIVjUuMDo0LjADAgSQMA0G
-CSqGSIb3DQEBBQUAA4IBAQBOQ8zR3R0QGwZ/t6T609lN+yOfI1Rb5osvBCiLtSdtiaHsmGnc540m
-gwV5dOy0uaOXwTUA/RXaOYE6lTGQ3pfphqiZdwzlWqCE/xIWrG64jcN7ksKsLtB9KOy282A4aW8+
-2ARVPp7MVdK6/rtHBNcK2RYKNCn1WBPVT8+PVkuzHu7TmHnaCB4Mb7j4Fifvwm899qNLPg7kbWzb
-O0ESm70NRyN/PErQr8Cv9u8btRXE64PECV90i9kR+8JWsTz4cMo0jUNAE4z9mQNUecYu6oah9jrU
-Cbz0vGbMPVjQV0kK7iXiQe4T+Zs4NNEA9X7nlB38aQNiuJkFBT1reBK9sG9l
------END CERTIFICATE-----
-
-UTN DATACorp SGC Root CA
-========================
------BEGIN CERTIFICATE-----
-MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCBkzELMAkGA1UE
-BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl
-IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZ
-BgNVBAMTElVUTiAtIERBVEFDb3JwIFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBa
-MIGTMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4w
-HAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRy
-dXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjANBgkqhkiG9w0BAQEFAAOC
-AQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ys
-raP6LnD43m77VkIVni5c7yPeIbkFdicZD0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlo
-wHDyUwDAXlCCpVZvNvlK4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA
-9P4yPykqlXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulWbfXv
-33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQABo4GrMIGoMAsGA1Ud
-DwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRTMtGzz3/64PGgXYVOktKeRR20TzA9
-BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dD
-LmNybDAqBgNVHSUEIzAhBggrBgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3
-DQEBBQUAA4IBAQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft
-Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyjj98C5OBxOvG0
-I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVHKWss5nbZqSl9Mt3JNjy9rjXx
-EZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwP
-DPafepE39peC4N1xaf92P2BNPM/3mfnGV/TJVTl4uix5yaaIK/QI
------END CERTIFICATE-----
-
-UTN USERFirst Hardware Root CA
-==============================
------BEGIN CERTIFICATE-----
-MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCBlzELMAkGA1UE
-BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl
-IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAd
-BgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgx
-OTIyWjCBlzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0
-eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVz
-ZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwggEiMA0GCSqGSIb3
-DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlI
-wrthdBKWHTxqctU8EGc6Oe0rE81m65UJM6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFd
-tqdt++BxF2uiiPsA3/4aMXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8
-i4fDidNdoI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqIDsjf
-Pe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9KsyoUhbAgMBAAGjgbkw
-gbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFKFyXyYbKJhDlV0HN9WF
-lp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNF
-UkZpcnN0LUhhcmR3YXJlLmNybDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUF
-BwMGBggrBgEFBQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM
-//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28GpgoiskliCE7/yMgUsogW
-XecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gECJChicsZUN/KHAG8HQQZexB2
-lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kn
-iCrVWFCVH/A7HFe7fRQ5YiuayZSSKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67
-nfhmqA==
------END CERTIFICATE-----
-
-Camerfirma Chambers of Commerce Root
-====================================
------BEGIN CERTIFICATE-----
-MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe
-QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i
-ZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAx
-NjEzNDNaFw0zNzA5MzAxNjEzNDRaMH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZp
-cm1hIFNBIENJRiBBODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3Jn
-MSIwIAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0BAQEFAAOC
-AQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtbunXF/KGIJPov7coISjlU
-xFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0dBmpAPrMMhe5cG3nCYsS4No41XQEMIwRH
-NaqbYE6gZj3LJgqcQKH0XZi/caulAGgq7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jW
-DA+wWFjbw2Y3npuRVDM30pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFV
-d9oKDMyXroDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIGA1Ud
-EwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5jaGFtYmVyc2lnbi5v
-cmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p26EpW1eLTXYGduHRooowDgYDVR0P
-AQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hh
-bWJlcnNpZ24ub3JnMCcGA1UdEgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYD
-VR0gBFEwTzBNBgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz
-aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEBAAxBl8IahsAi
-fJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZdp0AJPaxJRUXcLo0waLIJuvvD
-L8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wN
-UPf6s+xCX6ndbcj0dc97wXImsQEcXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/n
-ADydb47kMgkdTXg0eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1
-erfutGWaIZDgqtCYvDi1czyL+Nw=
------END CERTIFICATE-----
-
-Camerfirma Global Chambersign Root
-==================================
------BEGIN CERTIFICATE-----
-MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe
-QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i
-ZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYx
-NDE4WhcNMzcwOTMwMTYxNDE4WjB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJt
-YSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEg
-MB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAw
-ggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0Mi+ITaFgCPS3CU6gSS9J
-1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/sQJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8O
-by4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpVeAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl
-6DJWk0aJqCWKZQbua795B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c
-8lCrEqWhz0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0TAQH/
-BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1iZXJzaWduLm9yZy9j
-aGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4wTcbOX60Qq+UDpfqpFDAOBgNVHQ8B
-Af8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAHMCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBj
-aGFtYmVyc2lnbi5vcmcwKgYDVR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9y
-ZzBbBgNVHSAEVDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh
-bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0BAQUFAAOCAQEA
-PDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUMbKGKfKX0j//U2K0X1S0E0T9Y
-gOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXiryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJ
-PJ7oKXqJ1/6v/2j1pReQvayZzKWGVwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4
-IBHNfTIzSJRUTN3cecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREes
-t2d/AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A==
------END CERTIFICATE-----
-
-NetLock Notary (Class A) Root
-=============================
------BEGIN CERTIFICATE-----
-MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQI
-EwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6
-dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9j
-ayBLb3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oX
-DTE5MDIxOTIzMTQ0N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQH
-EwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYD
-VQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFz
-cyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSM
-D7tM9DceqQWC2ObhbHDqeLVu0ThEDaiDzl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZ
-z+qMkjvN9wfcZnSX9EUi3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC
-/tmwqcm8WgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+mm9dU7GrDPzr4PN6s6iz/0b2Y6LYOph7
-tqyF/7AlT3Rj5xMHpQqPBffAZG9+pyeAlt7ULoZgx2srXnN7F+eRP2QM2EsiNCubMvJIH5+hCoR6
-4sKtlz2O1cH5VqNQ6ca0+pii7pXmKgOM3wIDAQABo4ICnzCCApswDgYDVR0PAQH/BAQDAgAGMBIG
-A1UdEwEB/wQIMAYBAf8CAQQwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaC
-Ak1GSUdZRUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pv
-bGdhbHRhdGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQu
-IEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2Vn
-LWJpenRvc2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0
-ZXRlbGUgYXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFz
-IGxlaXJhc2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBh
-IGh0dHBzOi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVu
-b3J6ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBh
-bmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sg
-Q1BTIGF2YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFp
-bCBhdCBjcHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5
-ayZrU3/b39/zcT0mwBQOxmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjP
-ytoUMaFP0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQQeJB
-CWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxkf1qbFFgBJ34TUMdr
-KuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK8CtmdWOMovsEPoMOmzbwGOQmIMOM
-8CgHrTwXZoi1/baI
------END CERTIFICATE-----
-
-NetLock Business (Class B) Root
-===============================
------BEGIN CERTIFICATE-----
-MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUxETAPBgNVBAcT
-CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV
-BAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQDEylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikg
-VGFudXNpdHZhbnlraWFkbzAeFw05OTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYD
-VQQGEwJIVTERMA8GA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRv
-bnNhZ2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5ldExvY2sg
-VXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
-iQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xKgZjupNTKihe5In+DCnVMm8Bp2GQ5o+2S
-o/1bXHQawEfKOml2mrriRBf8TKPV/riXiK+IA4kfpPIEPsgHC+b5sy96YhQJRhTKZPWLgLViqNhr
-1nGTLbO/CVRY7QbrqHvcQ7GhaQIDAQABo4ICnzCCApswEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNV
-HQ8BAf8EBAMCAAYwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1GSUdZ
-RUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pvbGdhbHRh
-dGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQuIEEgaGl0
-ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2VnLWJpenRv
-c2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUg
-YXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJh
-c2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBhIGh0dHBz
-Oi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVub3J6ZXNA
-bmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBhbmQgdGhl
-IHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sgQ1BTIGF2
-YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBj
-cHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4GBAATbrowXr/gOkDFOzT4JwG06sPgzTEdM
-43WIEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXan3BukxowOR0w2y7jfLKR
-stE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKSNitjrFgBazMpUIaD8QFI
------END CERTIFICATE-----
-
-NetLock Express (Class C) Root
-==============================
------BEGIN CERTIFICATE-----
-MIIFTzCCBLigAwIBAgIBaDANBgkqhkiG9w0BAQQFADCBmzELMAkGA1UEBhMCSFUxETAPBgNVBAcT
-CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV
-BAsTEVRhbnVzaXR2YW55a2lhZG9rMTQwMgYDVQQDEytOZXRMb2NrIEV4cHJlc3N6IChDbGFzcyBD
-KSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNTE0MDgxMVoXDTE5MDIyMDE0MDgxMVowgZsxCzAJ
-BgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6
-dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE0MDIGA1UEAxMrTmV0TG9j
-ayBFeHByZXNzeiAoQ2xhc3MgQykgVGFudXNpdHZhbnlraWFkbzCBnzANBgkqhkiG9w0BAQEFAAOB
-jQAwgYkCgYEA6+ywbGGKIyWvYCDj2Z/8kwvbXY2wobNAOoLO/XXgeDIDhlqGlZHtU/qdQPzm6N3Z
-W3oDvV3zOwzDUXmbrVWg6dADEK8KuhRC2VImESLH0iDMgqSaqf64gXadarfSNnU+sYYJ9m5tfk63
-euyucYT2BDMIJTLrdKwWRMbkQJMdf60CAwEAAaOCAp8wggKbMBIGA1UdEwEB/wQIMAYBAf8CAQQw
-DgYDVR0PAQH/BAQDAgAGMBEGCWCGSAGG+EIBAQQEAwIABzCCAmAGCWCGSAGG+EIBDQSCAlEWggJN
-RklHWUVMRU0hIEV6ZW4gdGFudXNpdHZhbnkgYSBOZXRMb2NrIEtmdC4gQWx0YWxhbm9zIFN6b2xn
-YWx0YXRhc2kgRmVsdGV0ZWxlaWJlbiBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBB
-IGhpdGVsZXNpdGVzIGZvbHlhbWF0YXQgYSBOZXRMb2NrIEtmdC4gdGVybWVrZmVsZWxvc3NlZy1i
-aXp0b3NpdGFzYSB2ZWRpLiBBIGRpZ2l0YWxpcyBhbGFpcmFzIGVsZm9nYWRhc2FuYWsgZmVsdGV0
-ZWxlIGF6IGVsb2lydCBlbGxlbm9yemVzaSBlbGphcmFzIG1lZ3RldGVsZS4gQXogZWxqYXJhcyBs
-ZWlyYXNhIG1lZ3RhbGFsaGF0byBhIE5ldExvY2sgS2Z0LiBJbnRlcm5ldCBob25sYXBqYW4gYSBo
-dHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIGNpbWVuIHZhZ3kga2VyaGV0byBheiBlbGxlbm9y
-emVzQG5ldGxvY2submV0IGUtbWFpbCBjaW1lbi4gSU1QT1JUQU5UISBUaGUgaXNzdWFuY2UgYW5k
-IHRoZSB1c2Ugb2YgdGhpcyBjZXJ0aWZpY2F0ZSBpcyBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIENQ
-UyBhdmFpbGFibGUgYXQgaHR0cHM6Ly93d3cubmV0bG9jay5uZXQvZG9jcyBvciBieSBlLW1haWwg
-YXQgY3BzQG5ldGxvY2submV0LjANBgkqhkiG9w0BAQQFAAOBgQAQrX/XDDKACtiG8XmYta3UzbM2
-xJZIwVzNmtkFLp++UOv0JhQQLdRmF/iewSf98e3ke0ugbLWrmldwpu2gpO0u9f38vf5NNwgMvOOW
-gyL1SRt/Syu0VMGAfJlOHdCM7tCs5ZL6dVb+ZKATj7i4Fp1hBWeAyNDYpQcCNJgEjTME1A==
------END CERTIFICATE-----
-
-XRamp Global CA Root
-====================
------BEGIN CERTIFICATE-----
-MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE
-BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj
-dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB
-dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx
-HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg
-U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp
-dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu
-IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx
-foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE
-zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs
-AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry
-xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud
-EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap
-oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC
-AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc
-/Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt
-qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n
-nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz
-8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw=
------END CERTIFICATE-----
-
-Go Daddy Class 2 CA
-===================
------BEGIN CERTIFICATE-----
-MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY
-VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp
-ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG
-A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g
-RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD
-ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv
-2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32
-qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j
-YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY
-vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O
-BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o
-atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu
-MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG
-A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim
-PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt
-I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ
-HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI
-Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b
-vZ8=
------END CERTIFICATE-----
-
-Starfield Class 2 CA
-====================
------BEGIN CERTIFICATE-----
-MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc
-U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg
-Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo
-MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG
-A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG
-SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY
-bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ
-JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm
-epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN
-F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF
-MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f
-hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo
-bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g
-QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs
-afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM
-PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl
-xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD
-KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3
-QBFGmh95DmK/D5fs4C8fF5Q=
------END CERTIFICATE-----
-
-StartCom Certification Authority
-================================
------BEGIN CERTIFICATE-----
-MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN
-U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu
-ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0
-NjM2WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk
-LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg
-U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw
-ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y
-o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/
-Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d
-eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt
-2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z
-6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ
-osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/
-untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc
-UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT
-37uMdBNSSwIDAQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE
-FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9jZXJ0LnN0YXJ0
-Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3JsLnN0YXJ0Y29tLm9yZy9zZnNj
-YS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFMBgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUH
-AgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRw
-Oi8vY2VydC5zdGFydGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYg
-U3RhcnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlhYmlsaXR5
-LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2YgdGhlIFN0YXJ0Q29tIENl
-cnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFpbGFibGUgYXQgaHR0cDovL2NlcnQuc3Rh
-cnRjb20ub3JnL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilT
-dGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOC
-AgEAFmyZ9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8jhvh
-3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUWFjgKXlf2Ysd6AgXm
-vB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJzewT4F+irsfMuXGRuczE6Eri8sxHk
-fY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3
-fsNrarnDy0RLrHiQi+fHLB5LEUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZ
-EoalHmdkrQYuL6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq
-yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuCO3NJo2pXh5Tl
-1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6Vum0ABj6y6koQOdjQK/W/7HW/
-lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkyShNOsF/5oirpt9P/FlUQqmMGqz9IgcgA38coro
-g14=
------END CERTIFICATE-----
-
-Taiwan GRCA
-===========
------BEGIN CERTIFICATE-----
-MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG
-EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X
-DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv
-dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD
-ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN
-w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5
-BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O
-1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAtsF/tnyMKtsc2AtJfcdgEWFelq16TheEfO
-htX7MfP6Mb40qij7cEwdScevLJ1tZqa2jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wov
-J5pGfaENda1UhhXcSTvxls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7
-Q3hub/FCVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHKYS1t
-B6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoHEgKXTiCQ8P8NHuJB
-O9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThNXo+EHWbNxWCWtFJaBYmOlXqYwZE8
-lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1UdDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNV
-HRMEBTADAQH/MDkGBGcqBwAEMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg2
-09yewDL7MTqKUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ
-TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyfqzvS/3WXy6Tj
-Zwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaKZEk9GhiHkASfQlK3T8v+R0F2
-Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFEJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlU
-D7gsL0u8qV1bYH+Mh6XgUmMqvtg7hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6Qz
-DxARvBMB1uUO07+1EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+Hbk
-Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk
-7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ
-CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy
-+fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS
------END CERTIFICATE-----
-
-Swisscom Root CA 1
-==================
------BEGIN CERTIFICATE-----
-MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQG
-EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy
-dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4
-MTgyMjA2MjBaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln
-aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIIC
-IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9m2BtRsiM
-MW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdihFvkcxC7mlSpnzNApbjyF
-NDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/TilftKaNXXsLmREDA/7n29uj/x2lzZAe
-AR81sH8A25Bvxn570e56eqeqDFdvpG3FEzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkC
-b6dJtDZd0KTeByy2dbcokdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn
-7uHbHaBuHYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNFvJbN
-cA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo19AOeCMgkckkKmUp
-WyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjCL3UcPX7ape8eYIVpQtPM+GP+HkM5
-haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJWbjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNY
-MUJDLXT5xp6mig/p/r+D5kNXJLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw
-HQYDVR0hBBYwFDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j
-BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzcK6FptWfUjNP9
-MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzfky9NfEBWMXrrpA9gzXrzvsMn
-jgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7IkVh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQ
-MbFamIp1TpBcahQq4FJHgmDmHtqBsfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4H
-VtA4oJVwIHaM190e3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtl
-vrsRls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ipmXeascCl
-OS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HHb6D0jqTsNFFbjCYDcKF3
-1QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksfrK/7DZBaZmBwXarNeNQk7shBoJMBkpxq
-nvy5JMWzFYJ+vq6VK+uxwNrjAWALXmmshFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCy
-x/yP2FS1k2Kdzs9Z+z0YzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMW
-NY6E0F/6MBr1mmz0DlP5OlvRHA==
------END CERTIFICATE-----
-
-DigiCert Assured ID Root CA
-===========================
------BEGIN CERTIFICATE-----
-MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG
-EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw
-IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx
-MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL
-ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew
-ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO
-9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy
-UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW
-/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy
-oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf
-GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF
-66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq
-hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc
-EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn
-SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i
-8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe
-+o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g==
------END CERTIFICATE-----
-
-DigiCert Global Root CA
-=======================
------BEGIN CERTIFICATE-----
-MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG
-EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw
-HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw
-MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3
-dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq
-hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn
-TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5
-BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H
-4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y
-7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB
-o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm
-8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF
-BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr
-EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt
-tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886
-UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
-CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
------END CERTIFICATE-----
-
-DigiCert High Assurance EV Root CA
-==================================
------BEGIN CERTIFICATE-----
-MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG
-EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw
-KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw
-MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ
-MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu
-Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t
-Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS
-OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3
-MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ
-NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe
-h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB
-Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY
-JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ
-V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp
-myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK
-mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
-vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K
------END CERTIFICATE-----
-
-Certplus Class 2 Primary CA
-===========================
------BEGIN CERTIFICATE-----
-MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE
-BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN
-OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy
-dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP
-ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR
-5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ
-Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO
-YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e
-e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME
-CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ
-YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t
-L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD
-P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R
-TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+
-7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW
-//1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7
-l7+ijrRU
------END CERTIFICATE-----
-
-DST Root CA X3
-==============
------BEGIN CERTIFICATE-----
-MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK
-ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X
-DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1
-cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD
-ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT
-rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9
-UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy
-xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d
-utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T
-AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ
-MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug
-dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE
-GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw
-RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS
-fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ
------END CERTIFICATE-----
-
-DST ACES CA X6
-==============
------BEGIN CERTIFICATE-----
-MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQG
-EwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QxETAPBgNVBAsTCERTVCBBQ0VT
-MRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0wMzExMjAyMTE5NThaFw0xNzExMjAyMTE5NTha
-MFsxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UE
-CxMIRFNUIEFDRVMxFzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOC
-AQ8AMIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPuktKe1jzI
-DZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7gLFViYsx+tC3dr5BPTCa
-pCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZHfAjIgrrep4c9oW24MFbCswKBXy314pow
-GCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4aahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPy
-MjwmR/onJALJfh1biEITajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1Ud
-EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rkc3Qu
-Y29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjtodHRwOi8vd3d3LnRy
-dXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMtaW5kZXguaHRtbDAdBgNVHQ4EFgQU
-CXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZIhvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V2
-5FYrnJmQ6AgwbN99Pe7lv7UkQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6t
-Fr8hlxCBPeP/h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq
-nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpRrscL9yuwNwXs
-vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3
-oKfN5XozNmr6mis=
------END CERTIFICATE-----
-
-TURKTRUST Certificate Services Provider Root 1
-==============================================
------BEGIN CERTIFICATE-----
-MIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOcUktUUlVTVCBF
-bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGDAJUUjEP
-MA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykgMjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0
-acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMx
-MDI3MTdaFw0xNTAzMjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsg
-U2VydGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYDVQQHDAZB
-TktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBC
-aWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEuxZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOC
-AQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7XfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GX
-yGl8hMW0kWxsE2qkVa2kheiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8i
-Si9BB35JYbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5CurKZ
-8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1JuTm5Rh8i27fbMx4
-W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51b0dewQIDAQABoxAwDjAMBgNVHRME
-BTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46
-sWrv7/hg0Uw2ZkUd82YCdAR7kjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxE
-q8Sn5RTOPEFhfEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy
-B0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdAaLX/7KfS0zgY
-nNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKSRGQDJereW26fyfJOrN3H
------END CERTIFICATE-----
-
-TURKTRUST Certificate Services Provider Root 2
-==============================================
------BEGIN CERTIFICATE-----
-MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBF
-bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP
-MA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg
-QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcN
-MDUxMTA3MTAwNzU3WhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVr
-dHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEPMA0G
-A1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls
-acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwggEiMA0G
-CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqe
-LCDe2JAOCtFp0if7qnefJ1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKI
-x+XlZEdhR3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJQv2g
-QrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGXJHpsmxcPbe9TmJEr
-5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1pzpwACPI2/z7woQ8arBT9pmAPAgMB
-AAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58SFq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8G
-A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/ntt
-Rbj2hWyfIvwqECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4
-Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFzgw2lGh1uEpJ+
-hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotHuFEJjOp9zYhys2AzsfAKRO8P
-9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LSy3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5
-UrbnBEI=
------END CERTIFICATE-----
-
-SwissSign Gold CA - G2
-======================
------BEGIN CERTIFICATE-----
-MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw
-EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN
-MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp
-c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B
-AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq
-t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C
-jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg
-vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF
-ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR
-AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend
-jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69yFGkO
-peUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPiaG59je883WX0XaxR
-7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxMgI93e2CaHt+28kgeDrpOVG2Y4OGi
-GqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw
-AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64
-OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov
-L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm
-5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr
-44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf
-Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m
-Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp
-mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk
-vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf
-KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br
-NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj
-viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ
------END CERTIFICATE-----
-
-SwissSign Silver CA - G2
-========================
------BEGIN CERTIFICATE-----
-MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT
-BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X
-DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3
-aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG
-9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644
-N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm
-+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH
-6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu
-MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h
-qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5
-FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs
-ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3hB48IHpmc
-celM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb65i/4z3GcRm25xBWNOHkDRUjvxF3X
-CO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/
-BAUwAwEB/zAdBgNVHQ4EFgQUF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRB
-tjpbO8tFnb0cwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0
-cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P
-4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F
-kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L
-3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx
-/uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa
-DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP
-e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu
-WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ
-DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub
-DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u
------END CERTIFICATE-----
-
-GeoTrust Primary Certification Authority
-========================================
------BEGIN CERTIFICATE-----
-MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG
-EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD
-ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx
-CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ
-cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
-CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN
-b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9
-nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge
-RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt
-tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD
-AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI
-hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K
-Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN
-NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa
-Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG
-1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk=
------END CERTIFICATE-----
-
-thawte Primary Root CA
-======================
------BEGIN CERTIFICATE-----
-MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE
-BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2
-aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv
-cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3
-MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwg
-SW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMv
-KGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMT
-FnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs
-oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ
-1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc
-q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K
-aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p
-afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD
-VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF
-AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE
-uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX
-xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89
-jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH
-z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA==
------END CERTIFICATE-----
-
-VeriSign Class 3 Public Primary Certification Authority - G5
-============================================================
------BEGIN CERTIFICATE-----
-MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE
-BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO
-ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk
-IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp
-ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB
-yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
-biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh
-dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt
-YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
-ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz
-j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD
-Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/
-Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r
-fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/
-BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv
-Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy
-aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG
-SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+
-X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE
-KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC
-Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE
-ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq
------END CERTIFICATE-----
-
-SecureTrust CA
-==============
------BEGIN CERTIFICATE-----
-MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQG
-EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xFzAVBgNVBAMTDlNlY3VyZVRy
-dXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIzMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAe
-BgNVBAoTF1NlY3VyZVRydXN0IENvcnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCC
-ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQX
-OZEzZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO0gMdA+9t
-DWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIaowW8xQmxSPmjL8xk037uH
-GFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b
-01k/unK8RCSc43Oz969XL0Imnal0ugBS8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmH
-ursCAwEAAaOBnTCBmjATBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/
-BAUwAwEB/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCegJYYj
-aHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ
-KoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt36Z3q059c4EVlew3KW+JwULKUBRSu
-SceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHf
-mbx8IVQr5Fiiu1cprp6poxkmD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZ
-nMUFdAvnZyPSCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR
-3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE=
------END CERTIFICATE-----
-
-Secure Global CA
-================
------BEGIN CERTIFICATE-----
-MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQG
-EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBH
-bG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkxMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEg
-MB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg
-Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx
-YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ
-bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g
-8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV
-HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi
-0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud
-EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn
-oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA
-MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+
-OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn
-CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5
-3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc
-f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW
------END CERTIFICATE-----
-
-COMODO Certification Authority
-==============================
------BEGIN CERTIFICATE-----
-MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE
-BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG
-A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1
-dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb
-MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD
-T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH
-+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww
-xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV
-4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA
-1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI
-rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E
-BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k
-b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC
-AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP
-OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/
-RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc
-IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN
-+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ==
------END CERTIFICATE-----
-
-Network Solutions Certificate Authority
-=======================================
------BEGIN CERTIFICATE-----
-MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG
-EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr
-IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx
-MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu
-MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G
-CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx
-jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT
-aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT
-crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc
-/Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB
-AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP
-BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv
-bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA
-A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q
-4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/
-GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv
-wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD
-ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey
------END CERTIFICATE-----
-
-WellsSecure Public Root Certificate Authority
-=============================================
------BEGIN CERTIFICATE-----
-MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM
-F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYw
-NAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN
-MDcxMjEzMTcwNzU0WhcNMjIxMjE0MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dl
-bGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYD
-VQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G
-CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+rWxxTkqxtnt3CxC5FlAM1
-iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjUDk/41itMpBb570OYj7OeUt9tkTmPOL13
-i0Nj67eT/DBMHAGTthP796EfvyXhdDcsHqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8
-bJVhHlfXBIEyg1J55oNjz7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiB
-K0HmOFafSZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/SlwxlAgMB
-AAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqGKGh0dHA6Ly9jcmwu
-cGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0PAQH/BAQDAgHGMB0GA1UdDgQWBBQm
-lRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0jBIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGB
-i6SBiDCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRww
-GgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg
-Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEBALkVsUSRzCPI
-K0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0
-bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj
-qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es
-E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ
-tylv2G0xffX8oRAHh84vWdw+WNs=
------END CERTIFICATE-----
-
-COMODO ECC Certification Authority
-==================================
------BEGIN CERTIFICATE-----
-MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC
-R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE
-ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB
-dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix
-GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR
-Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo
-b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X
-4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni
-wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E
-BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG
-FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA
-U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY=
------END CERTIFICATE-----
-
-IGC/A
-=====
------BEGIN CERTIFICATE-----
-MIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYTAkZSMQ8wDQYD
-VQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVE
-Q1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZy
-MB4XDTAyMTIxMzE0MjkyM1oXDTIwMTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQI
-EwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NT
-STEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMIIB
-IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaIs9z4iPf930Pfeo2aSVz2
-TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCW
-So7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYy
-HF2fYPepraX/z9E0+X1bF8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNd
-frGoRpAxVs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGdPDPQ
-tQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNVHSAEDjAMMAoGCCqB
-egF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAxNjAfBgNVHSMEGDAWgBSjBS8YYFDC
-iQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUFAAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RK
-q89toB9RlPhJy3Q2FLwV3duJL92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3Q
-MZsyK10XZZOYYLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg
-Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2aNjSaTFR+FwNI
-lQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R0982gaEbeC9xs/FZTEYYKKuF
-0mBWWg==
------END CERTIFICATE-----
-
-Security Communication EV RootCA1
-=================================
------BEGIN CERTIFICATE-----
-MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDElMCMGA1UEChMc
-U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMhU2VjdXJpdHkgQ29tbXVuaWNh
-dGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIzMloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UE
-BhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNl
-Y3VyaXR5IENvbW11bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
-AQoCggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSERMqm4miO
-/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gOzXppFodEtZDkBp2uoQSX
-WHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4z
-ZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDFMxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4
-bepJz11sS6/vmsJWXMY1VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK
-9U2vP9eCOKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG
-SIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HWtWS3irO4G8za+6xm
-iEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZq51ihPZRwSzJIxXYKLerJRO1RuGG
-Av8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDbEJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnW
-mHyojf6GPgcWkuF75x3sM3Z+Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEW
-T1MKZPlO9L9OVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490
------END CERTIFICATE-----
-
-OISTE WISeKey Global Root GA CA
-===============================
------BEGIN CERTIFICATE-----
-MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE
-BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG
-A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH
-bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD
-VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw
-IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5
-IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9
-Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg
-Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD
-d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ
-/yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R
-LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw
-AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ
-KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm
-MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4
-+vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa
-hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY
-okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0=
------END CERTIFICATE-----
-
-Microsec e-Szigno Root CA
-=========================
------BEGIN CERTIFICATE-----
-MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE
-BhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNyb3NlYyBMdGQuMRQwEgYDVQQL
-EwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9zZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0
-MDYxMjI4NDRaFw0xNzA0MDYxMjI4NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVz
-dDEWMBQGA1UEChMNTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMT
-GU1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
-AQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2uuO/TEdyB5s87lozWbxXG
-d36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/N
-oqdNAoI/gqyFxuEPkEeZlApxcpMqyabAvjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjc
-QR/Ji3HWVBTji1R4P770Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJ
-PqW+jqpx62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcBAQRb
-MFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3AwLQYIKwYBBQUHMAKG
-IWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAPBgNVHRMBAf8EBTADAQH/MIIBcwYD
-VR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIBAQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3
-LmUtc3ppZ25vLmh1L1NaU1ovMIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0A
-dAB2AOEAbgB5ACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn
-AGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABTAHoAbwBsAGcA
-4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABhACAAcwB6AGUAcgBpAG4AdAAg
-AGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABoAHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMA
-egBpAGcAbgBvAC4AaAB1AC8AUwBaAFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6
-Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NO
-PU1pY3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxPPU1pY3Jv
-c2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZvY2F0aW9uTGlzdDtiaW5h
-cnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuBEGluZm9AZS1zemlnbm8uaHWkdzB1MSMw
-IQYDVQQDDBpNaWNyb3NlYyBlLVN6aWduw7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhT
-WjEWMBQGA1UEChMNTWljcm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhV
-MIGsBgNVHSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJIVTER
-MA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDASBgNVBAsTC2UtU3pp
-Z25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBSb290IENBghEAzLjnv04pGv2i3Gal
-HCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMT
-nGZjWS7KXHAM/IO8VbH0jgdsZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FE
-aGAHQzAxQmHl7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a
-86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfRhUZLphK3dehK
-yVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/MPMMNz7UwiiAc7EBt51alhQB
-S6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU=
------END CERTIFICATE-----
-
-Certigna
-========
------BEGIN CERTIFICATE-----
-MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw
-EAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMwNVoXDTI3
-MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwI
-Q2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7q
-XOEm7RFHYeGifBZ4QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyH
-GxnygQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbwzBfsV1/p
-ogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q130yGLMLLGq/jj8UEYkg
-DncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKf
-Irjxwo1p3Po6WAbfAgMBAAGjgbwwgbkwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQ
-tCRZvgHyUtVF9lo53BEwZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJ
-BgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzjAQ/J
-SP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAQEA
-hQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8hbV6lUmPOEvjvKtpv6zf+EwLHyzs+
-ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFncfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1klu
-PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY
-1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw
-WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg==
------END CERTIFICATE-----
-
-AC Ra\xC3\xADz Certic\xC3\xA1mara S.A.
-======================================
------BEGIN CERTIFICATE-----
-MIIGZjCCBE6gAwIBAgIPB35Sk3vgFeNX8GmMy+wMMA0GCSqGSIb3DQEBBQUAMHsxCzAJBgNVBAYT
-AkNPMUcwRQYDVQQKDD5Tb2NpZWRhZCBDYW1lcmFsIGRlIENlcnRpZmljYWNpw7NuIERpZ2l0YWwg
-LSBDZXJ0aWPDoW1hcmEgUy5BLjEjMCEGA1UEAwwaQUMgUmHDrXogQ2VydGljw6FtYXJhIFMuQS4w
-HhcNMDYxMTI3MjA0NjI5WhcNMzAwNDAyMjE0MjAyWjB7MQswCQYDVQQGEwJDTzFHMEUGA1UECgw+
-U29jaWVkYWQgQ2FtZXJhbCBkZSBDZXJ0aWZpY2FjacOzbiBEaWdpdGFsIC0gQ2VydGljw6FtYXJh
-IFMuQS4xIzAhBgNVBAMMGkFDIFJhw616IENlcnRpY8OhbWFyYSBTLkEuMIICIjANBgkqhkiG9w0B
-AQEFAAOCAg8AMIICCgKCAgEAq2uJo1PMSCMI+8PPUZYILrgIem08kBeGqentLhM0R7LQcNzJPNCN
-yu5LF6vQhbCnIwTLqKL85XXbQMpiiY9QngE9JlsYhBzLfDe3fezTf3MZsGqy2IiKLUV0qPezuMDU
-2s0iiXRNWhU5cxh0T7XrmafBHoi0wpOQY5fzp6cSsgkiBzPZkc0OnB8OIMfuuzONj8LSWKdf/WU3
-4ojC2I+GdV75LaeHM/J4Ny+LvB2GNzmxlPLYvEqcgxhaBvzz1NS6jBUJJfD5to0EfhcSM2tXSExP
-2yYe68yQ54v5aHxwD6Mq0Do43zeX4lvegGHTgNiRg0JaTASJaBE8rF9ogEHMYELODVoqDA+bMMCm
-8Ibbq0nXl21Ii/kDwFJnmxL3wvIumGVC2daa49AZMQyth9VXAnow6IYm+48jilSH5L887uvDdUhf
-HjlvgWJsxS3EF1QZtzeNnDeRyPYL1epjb4OsOMLzP96a++EjYfDIJss2yKHzMI+ko6Kh3VOz3vCa
-Mh+DkXkwwakfU5tTohVTP92dsxA7SH2JD/ztA/X7JWR1DhcZDY8AFmd5ekD8LVkH2ZD6mq093ICK
-5lw1omdMEWux+IBkAC1vImHFrEsm5VoQgpukg3s0956JkSCXjrdCx2bD0Omk1vUgjcTDlaxECp1b
-czwmPS9KvqfJpxAe+59QafMCAwEAAaOB5jCB4zAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE
-AwIBBjAdBgNVHQ4EFgQU0QnQ6dfOeXRU+Tows/RtLAMDG2gwgaAGA1UdIASBmDCBlTCBkgYEVR0g
-ADCBiTArBggrBgEFBQcCARYfaHR0cDovL3d3dy5jZXJ0aWNhbWFyYS5jb20vZHBjLzBaBggrBgEF
-BQcCAjBOGkxMaW1pdGFjaW9uZXMgZGUgZ2FyYW507WFzIGRlIGVzdGUgY2VydGlmaWNhZG8gc2Ug
-cHVlZGVuIGVuY29udHJhciBlbiBsYSBEUEMuMA0GCSqGSIb3DQEBBQUAA4ICAQBclLW4RZFNjmEf
-AygPU3zmpFmps4p6xbD/CHwso3EcIRNnoZUSQDWDg4902zNc8El2CoFS3UnUmjIz75uny3XlesuX
-EpBcunvFm9+7OSPI/5jOCk0iAUgHforA1SBClETvv3eiiWdIG0ADBaGJ7M9i4z0ldma/Jre7Ir5v
-/zlXdLp6yQGVwZVR6Kss+LGGIOk/yzVb0hfpKv6DExdA7ohiZVvVO2Dpezy4ydV/NgIlqmjCMRW3
-MGXrfx1IebHPOeJCgBbT9ZMj/EyXyVo3bHwi2ErN0o42gzmRkBDI8ck1fj+404HGIGQatlDCIaR4
-3NAvO2STdPCWkPHv+wlaNECW8DYSwaN0jJN+Qd53i+yG2dIPPy3RzECiiWZIHiCznCNZc6lEc7wk
-eZBWN7PGKX6jD/EpOe9+XCgycDWs2rjIdWb8m0w5R44bb5tNAlQiM+9hup4phO9OSzNHdpdqy35f
-/RWmnkJDW2ZaiogN9xa5P1FlK2Zqi9E4UqLWRhH6/JocdJ6PlwsCT2TG9WjTSy3/pDceiz+/RL5h
-RqGEPQgnTIEgd4kI6mdAXmwIUV80WoyWaM3X94nCHNMyAK9Sy9NgWyo6R35rMDOhYil/SrnhLecU
-Iw4OGEfhefwVVdCx/CVxY3UzHCMrr1zZ7Ud3YA47Dx7SwNxkBYn8eNZcLCZDqQ==
------END CERTIFICATE-----
-
-TC TrustCenter Class 2 CA II
-============================
------BEGIN CERTIFICATE-----
-MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC
-REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy
-IENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYw
-MTEyMTQzODQzWhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1
-c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UE
-AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
-AQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jftMjWQ+nEdVl//OEd+DFw
-IxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKguNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2
-xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2JXjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQ
-Xa7pIXSSTYtZgo+U4+lK8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7u
-SNQZu+995OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1UdEwEB
-/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3kUrL84J6E1wIqzCB
-7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90
-Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU
-cnVzdENlbnRlciUyMENsYXNzJTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i
-SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u
-TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iSGNn3Bzn1LL4G
-dXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprtZjluS5TmVfwLG4t3wVMTZonZ
-KNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8au0WOB9/WIFaGusyiC2y8zl3gK9etmF1Kdsj
-TYjKUCjLhdLTEKJZbtOTVAB6okaVhgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kP
-JOzHdiEoZa5X6AeIdUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfk
-vQ==
------END CERTIFICATE-----
-
-TC TrustCenter Class 3 CA II
-============================
------BEGIN CERTIFICATE-----
-MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC
-REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy
-IENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYw
-MTEyMTQ0MTU3WhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1
-c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UE
-AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
-AQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJWHt4bNwcwIi9v8Qbxq63W
-yKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+QVl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo
-6SI7dYnWRBpl8huXJh0obazovVkdKyT21oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZ
-uV3bOx4a+9P/FRQI2AlqukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk
-2ZyqBwi1Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1UdEwEB
-/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NXXAek0CSnwPIA1DCB
-7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90
-Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU
-cnVzdENlbnRlciUyMENsYXNzJTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i
-SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u
-TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlNirTzwppVMXzE
-O2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8TtXqluJucsG7Kv5sbviRmEb8
-yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9
-IJqDnxrcOfHFcqMRA/07QlIp2+gB95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal
-092Y+tTmBvTwtiBjS+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc
-5A==
------END CERTIFICATE-----
-
-TC TrustCenter Universal CA I
-=============================
------BEGIN CERTIFICATE-----
-MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTELMAkGA1UEBhMC
-REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy
-IFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcN
-MDYwMzIyMTU1NDI4WhcNMjUxMjMxMjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMg
-VHJ1c3RDZW50ZXIgR21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYw
-JAYDVQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcNAQEBBQAD
-ggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSRJJZ4Hgmgm5qVSkr1YnwC
-qMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3TfCZdzHd55yx4Oagmcw6iXSVphU9VDprv
-xrlE4Vc93x9UIuVvZaozhDrzznq+VZeujRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtw
-ag+1m7Z3W0hZneTvWq3zwZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9O
-gdwZu5GQfezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYDVR0j
-BBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
-AYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0GCSqGSIb3DQEBBQUAA4IBAQAo0uCG
-1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X17caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/Cy
-vwbZ71q+s2IhtNerNXxTPqYn8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3
-ghUJGooWMNjsydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT
-ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/2TYcuiUaUj0a
-7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY
------END CERTIFICATE-----
-
-Deutsche Telekom Root CA 2
-==========================
------BEGIN CERTIFICATE-----
-MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT
-RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG
-A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5
-MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G
-A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS
-b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5
-bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI
-KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY
-AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK
-Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV
-jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV
-HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr
-E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy
-zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8
-rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G
-dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU
-Cm26OWMohpLzGITY+9HPBVZkVw==
------END CERTIFICATE-----
-
-ComSign Secured CA
-==================
------BEGIN CERTIFICATE-----
-MIIDqzCCApOgAwIBAgIRAMcoRwmzuGxFjB36JPU2TukwDQYJKoZIhvcNAQEFBQAwPDEbMBkGA1UE
-AxMSQ29tU2lnbiBTZWN1cmVkIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQGEwJJTDAeFw0w
-NDAzMjQxMTM3MjBaFw0yOTAzMTYxNTA0NTZaMDwxGzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBD
-QTEQMA4GA1UEChMHQ29tU2lnbjELMAkGA1UEBhMCSUwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
-ggEKAoIBAQDGtWhfHZQVw6QIVS3joFd67+l0Kru5fFdJGhFeTymHDEjWaueP1H5XJLkGieQcPOqs
-49ohgHMhCu95mGwfCP+hUH3ymBvJVG8+pSjsIQQPRbsHPaHA+iqYHU4Gk/v1iDurX8sWv+bznkqH
-7Rnqwp9D5PGBpX8QTz7RSmKtUxvLg/8HZaWSLWapW7ha9B20IZFKF3ueMv5WJDmyVIRD9YTC2LxB
-kMyd1mja6YJQqTtoz7VdApRgFrFD2UNd3V2Hbuq7s8lr9gOUCXDeFhF6K+h2j0kQmHe5Y1yLM5d1
-9guMsqtb3nQgJT/j8xH5h2iGNXHDHYwt6+UarA9z1YJZQIDTAgMBAAGjgacwgaQwDAYDVR0TBAUw
-AwEB/zBEBgNVHR8EPTA7MDmgN6A1hjNodHRwOi8vZmVkaXIuY29tc2lnbi5jby5pbC9jcmwvQ29t
-U2lnblNlY3VyZWRDQS5jcmwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQYMBaAFMFL7XC29z58ADsA
-j8c+DkWfHl3sMB0GA1UdDgQWBBTBS+1wtvc+fAA7AI/HPg5Fnx5d7DANBgkqhkiG9w0BAQUFAAOC
-AQEAFs/ukhNQq3sUnjO2QiBq1BW9Cav8cujvR3qQrFHBZE7piL1DRYHjZiM/EoZNGeQFsOY3wo3a
-BijJD4mkU6l1P7CW+6tMM1X5eCZGbxs2mPtCdsGCuY7e+0X5YxtiOzkGynd6qDwJz2w2PQ8KRUtp
-FhpFfTMDZflScZAmlaxMDPWLkz/MdXSFmLr/YnpNH4n+rr2UAJm/EaXc4HnFFgt9AmEd6oX5AhVP
-51qJThRv4zdLhfXBPGHg/QVBspJ/wx2g0K5SZGBrGMYmnNj1ZOQ2GmKfig8+/21OGVZOIJFsnzQz
-OjRXUDpvgV4GxvU+fE6OK85lBi5d0ipTdF7Tbieejw==
------END CERTIFICATE-----
-
-Cybertrust Global Root
-======================
------BEGIN CERTIFICATE-----
-MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li
-ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4
-MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD
-ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
-+Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW
-0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL
-AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin
-89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT
-8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP
-BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2
-MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G
-A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO
-lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi
-5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2
-hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T
-X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW
-WL1WMRJOEcgh4LMRkWXbtKaIOM5V
------END CERTIFICATE-----
-
-ePKI Root Certification Authority
-=================================
------BEGIN CERTIFICATE-----
-MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG
-EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg
-Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx
-MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq
-MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B
-AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs
-IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi
-lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv
-qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX
-12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O
-WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+
-ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao
-lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/
-vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi
-Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi
-MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH
-ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0
-1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq
-KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV
-xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP
-NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r
-GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE
-xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx
-gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy
-sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD
-BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw=
------END CERTIFICATE-----
-
-T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3
-=============================================================================================================================
------BEGIN CERTIFICATE-----
-MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRSMRgwFgYDVQQH
-DA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJpbGltc2VsIHZlIFRla25vbG9q
-aWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSwVEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ry
-b25payB2ZSBLcmlwdG9sb2ppIEFyYcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNV
-BAsMGkthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUg
-S8O2ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAeFw0wNzA4
-MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIxGDAWBgNVBAcMD0dlYnpl
-IC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmlsaW1zZWwgdmUgVGVrbm9sb2ppayBBcmHF
-n3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBUQUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZl
-IEtyaXB0b2xvamkgQXJhxZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2Ft
-dSBTZXJ0aWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7ZrIFNl
-cnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIBIjANBgkqhkiG9w0B
-AQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4hgb46ezzb8R1Sf1n68yJMlaCQvEhO
-Eav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yKO7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1
-xnnRFDDtG1hba+818qEhTsXOfJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR
-6Oqeyjh1jmKwlZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL
-hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQIDAQABo0IwQDAd
-BgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF
-MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmPNOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4
-N5EY3ATIZJkrGG2AA1nJrvhY0D7twyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLT
-y9LQQfMmNkqblWwM7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYh
-LBOhgLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5noN+J1q2M
-dqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUsyZyQ2uypQjyttgI=
------END CERTIFICATE-----
-
-Buypass Class 2 CA 1
-====================
------BEGIN CERTIFICATE-----
-MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU
-QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMiBDQSAxMB4XDTA2
-MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh
-c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZI
-hvcNAQEBBQADggEPADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7M
-cXA0ojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLXl18xoS83
-0r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVBHfCuuCkslFJgNJQ72uA4
-0Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/R
-uFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3WNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNC
-MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0P
-AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLPgcIV
-1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+DKhQ7SLHrQVMdvvt
-7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKuBctN518fV4bVIJwo+28TOPX2EZL2
-fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHsh7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5w
-wDX3OaJdZtB7WZ+oRxKaJyOkLY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho
------END CERTIFICATE-----
-
-Buypass Class 3 CA 1
-====================
------BEGIN CERTIFICATE-----
-MIIDUzCCAjugAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU
-QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMyBDQSAxMB4XDTA1
-MDUwOTE0MTMwM1oXDTE1MDUwOTE0MTMwM1owSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh
-c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZI
-hvcNAQEBBQADggEPADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKx
-ifZgisRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//zNIqeKNc0
-n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI+MkcVyzwPX6UvCWThOia
-AJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2RhzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c
-1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNC
-MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0P
-AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFPBdy7
-pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27sEzNxZy5p+qksP2bA
-EllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2mSlf56oBzKwzqBwKu5HEA6BvtjT5
-htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yCe/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQj
-el/wroQk5PMr+4okoyeYZdowdXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915
------END CERTIFICATE-----
-
-EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1
-==========================================================================
------BEGIN CERTIFICATE-----
-MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNVBAMML0VCRyBF
-bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMTcwNQYDVQQKDC5FQkcg
-QmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXptZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAe
-Fw0wNjA4MTcwMDIxMDlaFw0xNjA4MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25p
-ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2lt
-IFRla25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIiMA0GCSqG
-SIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h4fuXd7hxlugTlkaDT7by
-X3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAktiHq6yOU/im/+4mRDGSaBUorzAzu8T2b
-gmmkTPiab+ci2hC6X5L8GCcKqKpE+i4stPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfr
-eYteIAbTdgtsApWjluTLdlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZ
-TqNGFav4c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8UmTDGy
-Y5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z+kI2sSXFCjEmN1Zn
-uqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0OLna9XvNRiYuoP1Vzv9s6xiQFlpJI
-qkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMWOeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vm
-ExH8nYQKE3vwO9D8owrXieqWfo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0
-Nokb+Clsi7n2l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB
-/wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgwFoAU587GT/wW
-Z5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+8ygjdsZs93/mQJ7ANtyVDR2t
-FcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgm
-zJNSroIBk5DKd8pNSe/iWtkqvTDOTLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64k
-XPBfrAowzIpAoHMEwfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqT
-bCmYIai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJnxk1Gj7sU
-RT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4QDgZxGhBM/nV+/x5XOULK
-1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9qKd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt
-2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11thie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQ
-Y9iJSrSq3RZj9W6+YKH47ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9
-AahH3eU7QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT
------END CERTIFICATE-----
-
-certSIGN ROOT CA
-================
------BEGIN CERTIFICATE-----
-MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD
-VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa
-Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE
-CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I
-JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH
-rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2
-ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD
-0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943
-AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B
-Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB
-AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8
-SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0
-x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt
-vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz
-TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD
------END CERTIFICATE-----
-
-CNNIC ROOT
-==========
------BEGIN CERTIFICATE-----
-MIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJDTjEOMAwGA1UE
-ChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2MDcwOTE0WhcNMjcwNDE2MDcw
-OTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1Qw
-ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzD
-o+/hn7E7SIX1mlwhIhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tiz
-VHa6dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZOV/kbZKKT
-VrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrCGHn2emU1z5DrvTOTn1Or
-czvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gNv7Sg2Ca+I19zN38m5pIEo3/PIKe38zrK
-y5nLAgMBAAGjczBxMBEGCWCGSAGG+EIBAQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscC
-wQ7vptU7ETAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991S
-lgrHAsEO76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnKOOK5
-Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvHugDnuL8BV8F3RTIM
-O/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7HgviyJA/qIYM/PmLXoXLT1tLYhFHxUV8
-BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fLbuXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2
-G8kS1sHNzYDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m
-mxE=
------END CERTIFICATE-----
-
-ApplicationCA - Japanese Government
-===================================
------BEGIN CERTIFICATE-----
-MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT
-SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw
-MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zl
-cm5tZW50MRYwFAYDVQQLEw1BcHBsaWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
-CgKCAQEAp23gdE6Hj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4
-fl+Kf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55IrmTwcrN
-wVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cwFO5cjFW6WY2H/CPek9AE
-jP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDihtQWEjdnjDuGWk81quzMKq2edY3rZ+nYVu
-nyoKb58DKTCXKB28t89UKU5RMfkntigm/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRU
-WssmP3HMlEYNllPqa0jQk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNV
-BAYTAkpQMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOCseOD
-vOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADlqRHZ3ODrs
-o2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJhyzjVOGjprIIC8CFqMjSnHH2HZ9g
-/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYD
-io+nEhEMy/0/ecGc/WLuo89UDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmW
-dupwX3kSa+SjB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL
-rosot4LKGAfmt1t06SAZf7IbiVQ=
------END CERTIFICATE-----
-
-GeoTrust Primary Certification Authority - G3
-=============================================
------BEGIN CERTIFICATE-----
-MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE
-BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0
-IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy
-eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz
-NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo
-YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT
-LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI
-hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j
-K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE
-c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C
-IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu
-dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC
-MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr
-2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9
-cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE
-Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD
-AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s
-t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt
------END CERTIFICATE-----
-
-thawte Primary Root CA - G2
-===========================
------BEGIN CERTIFICATE-----
-MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC
-VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu
-IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg
-Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV
-MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG
-b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt
-IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS
-LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5
-8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU
-mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN
-G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K
-rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg==
------END CERTIFICATE-----
-
-thawte Primary Root CA - G3
-===========================
------BEGIN CERTIFICATE-----
-MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE
-BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2
-aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv
-cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w
-ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh
-d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD
-VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG
-A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
-MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At
-P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC
-+BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY
-7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW
-vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E
-BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ
-KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK
-A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu
-t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC
-8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm
-er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A=
------END CERTIFICATE-----
-
-GeoTrust Primary Certification Authority - G2
-=============================================
------BEGIN CERTIFICATE-----
-MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC
-VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu
-Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD
-ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1
-OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg
-MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl
-b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG
-BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc
-KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD
-VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+
-EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m
-ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2
-npaqBA+K
------END CERTIFICATE-----
-
-VeriSign Universal Root Certification Authority
-===============================================
------BEGIN CERTIFICATE-----
-MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
-BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO
-ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk
-IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u
-IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV
-UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
-cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
-IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0
-aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj
-1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP
-MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72
-9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I
-AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR
-tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G
-CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O
-a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud
-DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3
-Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx
-Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx
-P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P
-wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4
-mJO37M2CYfE45k+XmCpajQ==
------END CERTIFICATE-----
-
-VeriSign Class 3 Public Primary Certification Authority - G4
-============================================================
------BEGIN CERTIFICATE-----
-MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC
-VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3
-b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz
-ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj
-YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL
-MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU
-cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo
-b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5
-IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8
-Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz
-rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB
-/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw
-HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u
-Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD
-A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx
-AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA==
------END CERTIFICATE-----
-
-NetLock Arany (Class Gold) Főtanúsítvány
-============================================
------BEGIN CERTIFICATE-----
-MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G
-A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610
-dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB
-cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx
-MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO
-ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv
-biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6
-c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu
-0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw
-/HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk
-H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw
-fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1
-neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB
-BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW
-qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta
-YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC
-bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna
-NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu
-dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E=
------END CERTIFICATE-----
-
-Staat der Nederlanden Root CA - G2
-==================================
------BEGIN CERTIFICATE-----
-MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE
-CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g
-Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC
-TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l
-ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ
-5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn
-vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPUZ5uW6M7XxgpT0GtJlvOj
-CwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvEpMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiil
-e7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCR
-OME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpI
-CT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy5V65
-48r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv6q012iDTiIJh8BIi
-trzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEKeN5KzlW/HdXZt1bv8Hb/C3m1r737
-qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMB
-AAGjgZcwgZQwDwYDVR0TAQH/BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcC
-ARYxaHR0cDovL3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV
-HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqGSIb3DQEBCwUA
-A4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLySCZa59sCrI2AGeYwRTlHSeYAz
-+51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwj
-f/ST7ZwaUb7dRUG/kSS0H4zpX897IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaN
-kqbG9AclVMwWVxJKgnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfk
-CpYL+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxLvJxxcypF
-URmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkmbEgeqmiSBeGCc1qb3Adb
-CG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvkN1trSt8sV4pAWja63XVECDdCcAz+3F4h
-oKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoV
-IPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm
-66+KAQ==
------END CERTIFICATE-----
-
-CA Disig
-========
------BEGIN CERTIFICATE-----
-MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMK
-QnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwHhcNMDYw
-MzIyMDEzOTM0WhcNMTYwMzIyMDEzOTM0WjBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMKQnJhdGlz
-bGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwggEiMA0GCSqGSIb3
-DQEBAQUAA4IBDwAwggEKAoIBAQCS9jHBfYj9mQGp2HvycXXxMcbzdWb6UShGhJd4NLxs/LxFWYgm
-GErENx+hSkS943EE9UQX4j/8SFhvXJ56CbpRNyIjZkMhsDxkovhqFQ4/61HhVKndBpnXmjxUizkD
-Pw/Fzsbrg3ICqB9x8y34dQjbYkzo+s7552oftms1grrijxaSfQUMbEYDXcDtab86wYqg6I7ZuUUo
-hwjstMoVvoLdtUSLLa2GDGhibYVW8qwUYzrG0ZmsNHhWS8+2rT+MitcE5eN4TPWGqvWP+j1scaMt
-ymfraHtuM6kMgiioTGohQBUgDCZbg8KpFhXAJIJdKxatymP2dACw30PEEGBWZ2NFAgMBAAGjgf8w
-gfwwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUjbJJaJ1yCCW5wCf1UJNWSEZx+Y8wDgYDVR0P
-AQH/BAQDAgEGMDYGA1UdEQQvMC2BE2Nhb3BlcmF0b3JAZGlzaWcuc2uGFmh0dHA6Ly93d3cuZGlz
-aWcuc2svY2EwZgYDVR0fBF8wXTAtoCugKYYnaHR0cDovL3d3dy5kaXNpZy5zay9jYS9jcmwvY2Ff
-ZGlzaWcuY3JsMCygKqAohiZodHRwOi8vY2EuZGlzaWcuc2svY2EvY3JsL2NhX2Rpc2lnLmNybDAa
-BgNVHSAEEzARMA8GDSuBHpGT5goAAAABAQEwDQYJKoZIhvcNAQEFBQADggEBAF00dGFMrzvY/59t
-WDYcPQuBDRIrRhCA/ec8J9B6yKm2fnQwM6M6int0wHl5QpNt/7EpFIKrIYwvF/k/Ji/1WcbvgAa3
-mkkp7M5+cTxqEEHA9tOasnxakZzArFvITV734VP/Q3f8nktnbNfzg9Gg4H8l37iYC5oyOGwwoPP/
-CBUz91BKez6jPiCp3C9WgArtQVCwyfTssuMmRAAOb54GvCKWU3BlxFAKRmukLyeBEicTXxChds6K
-ezfqwzlhA5WYOudsiCUI/HloDYd9Yvi0X/vF2Ey9WLw/Q1vUHgFNPGO+I++MzVpQuGhU+QqZMxEA
-4Z7CRneC9VkGjCFMhwnN5ag=
------END CERTIFICATE-----
-
-Juur-SK
-=======
------BEGIN CERTIFICATE-----
-MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcNAQkBFglwa2lA
-c2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMRAw
-DgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMwMVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqG
-SIb3DQEJARYJcGtpQHNrLmVlMQswCQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVy
-aW1pc2tlc2t1czEQMA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
-ggEBAIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOBSvZiF3tf
-TQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkzABpTpyHhOEvWgxutr2TC
-+Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvHLCu3GFH+4Hv2qEivbDtPL+/40UceJlfw
-UR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMPPbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDa
-Tpxt4brNj3pssAki14sL2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQF
-MAMBAf8wggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwICMIHD
-HoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDkAGwAagBhAHMAdABh
-AHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0AHMAZQBlAHIAaQBtAGkAcwBrAGUA
-cwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABzAGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABr
-AGkAbgBuAGkAdABhAG0AaQBzAGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nw
-cy8wKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE
-FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcYP2/v6X2+MA4G
-A1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOiCfP+JmeaUOTDBS8rNXiRTHyo
-ERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+gkcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyL
-abVAyJRld/JXIWY7zoVAtjNjGr95HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678
-IIbsSt4beDI3poHSna9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkh
-Mp6qqIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0ZTbvGRNs2
-yyqcjg==
------END CERTIFICATE-----
-
-Hongkong Post Root CA 1
-=======================
------BEGIN CERTIFICATE-----
-MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT
-DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx
-NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n
-IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF
-AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1
-ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr
-auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh
-qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY
-V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV
-HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i
-h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio
-l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei
-IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps
-T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT
-c4afU9hDDl3WY4JxHYB0yvbiAmvZWg==
------END CERTIFICATE-----
-
-SecureSign RootCA11
-===================
------BEGIN CERTIFICATE-----
-MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi
-SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS
-b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw
-KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1
-cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL
-TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO
-wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq
-g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP
-O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA
-bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX
-t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh
-OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r
-bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ
-Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01
-y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061
-lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I=
------END CERTIFICATE-----
-
-ACEDICOM Root
-=============
------BEGIN CERTIFICATE-----
-MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UEAwwNQUNFRElD
-T00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMB4XDTA4
-MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEWMBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoG
-A1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEF
-AAOCAg8AMIICCgKCAgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHk
-WLn709gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7XBZXehuD
-YAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5PGrjm6gSSrj0RuVFCPYew
-MYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAKt0SdE3QrwqXrIhWYENiLxQSfHY9g5QYb
-m8+5eaA9oiM/Qj9r+hwDezCNzmzAv+YbX79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbk
-HQl/Sog4P75n/TSW9R28MHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTT
-xKJxqvQUfecyuB+81fFOvW8XAjnXDpVCOscAPukmYxHqC9FK/xidstd7LzrZlvvoHpKuE1XI2Sf2
-3EgbsCTBheN3nZqk8wwRHQ3ItBTutYJXCb8gWH8vIiPYcMt5bMlL8qkqyPyHK9caUPgn6C9D4zq9
-2Fdx/c6mUlv53U3t5fZvie27k5x2IXXwkkwp9y+cAS7+UEaeZAwUswdbxcJzbPEHXEUkFDWug/Fq
-TYl6+rPYLWbwNof1K1MCAwEAAaOBqjCBpzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz
-4SsrSbbXc6GqlPUB53NlTKxQMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU
-9QHnc2VMrFAwRAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv
-bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWImfQwng4/F9tqg
-aHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3gvoFNTPhNahXwOf9jU8/kzJP
-eGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKeI6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1Pwk
-zQSulgUV1qzOMPPKC8W64iLgpq0i5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1
-ThCojz2GuHURwCRiipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oI
-KiMnMCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZo5NjEFIq
-nxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6zqylfDJKZ0DcMDQj3dcE
-I2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacNGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOp
-MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o
-tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA==
------END CERTIFICATE-----
-
-Verisign Class 3 Public Primary Certification Authority
-=======================================================
------BEGIN CERTIFICATE-----
-MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx
-FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5
-IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow
-XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz
-IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA
-A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94
-f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol
-hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky
-CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX
-bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/
-D/xwzoiQ
------END CERTIFICATE-----
-
-Microsec e-Szigno Root CA 2009
-==============================
------BEGIN CERTIFICATE-----
-MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER
-MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv
-c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o
-dTAeFw0wOTA2MTYxMTMwMThaFw0yOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UE
-BwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUt
-U3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTCCASIw
-DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvPkd6mJviZpWNwrZuuyjNA
-fW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tccbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG
-0IMZfcChEhyVbUr02MelTTMuhTlAdX4UfIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKA
-pxn1ntxVUwOXewdI/5n7N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm
-1HxdrtbCxkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1+rUC
-AwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTLD8bf
-QkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE
-FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o
-lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX
-I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775
-tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02
-yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi
-LXpUq3DDfSJlgnCW
------END CERTIFICATE-----
-
-E-Guven Kok Elektronik Sertifika Hizmet Saglayicisi
-===================================================
------BEGIN CERTIFICATE-----
-MIIDtjCCAp6gAwIBAgIQRJmNPMADJ72cdpW56tustTANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG
-EwJUUjEoMCYGA1UEChMfRWxla3Ryb25payBCaWxnaSBHdXZlbmxpZ2kgQS5TLjE8MDoGA1UEAxMz
-ZS1HdXZlbiBLb2sgRWxla3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhZ2xheWljaXNpMB4XDTA3
-MDEwNDExMzI0OFoXDTE3MDEwNDExMzI0OFowdTELMAkGA1UEBhMCVFIxKDAmBgNVBAoTH0VsZWt0
-cm9uaWsgQmlsZ2kgR3V2ZW5saWdpIEEuUy4xPDA6BgNVBAMTM2UtR3V2ZW4gS29rIEVsZWt0cm9u
-aWsgU2VydGlmaWthIEhpem1ldCBTYWdsYXlpY2lzaTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
-AQoCggEBAMMSIJ6wXgBljU5Gu4Bc6SwGl9XzcslwuedLZYDBS75+PNdUMZTe1RK6UxYC6lhj71vY
-8+0qGqpxSKPcEC1fX+tcS5yWCEIlKBHMilpiAVDV6wlTL/jDj/6z/P2douNffb7tC+Bg62nsM+3Y
-jfsSSYMAyYuXjDtzKjKzEve5TfL0TW3H5tYmNwjy2f1rXKPlSFxYvEK+A1qBuhw1DADT9SN+cTAI
-JjjcJRFHLfO6IxClv7wC90Nex/6wN1CZew+TzuZDLMN+DfIcQ2Zgy2ExR4ejT669VmxMvLz4Bcpk
-9Ok0oSy1c+HCPujIyTQlCFzz7abHlJ+tiEMl1+E5YP6sOVkCAwEAAaNCMEAwDgYDVR0PAQH/BAQD
-AgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ/uRLOU1fqRTy7ZVZoEVtstxNulMA0GCSqG
-SIb3DQEBBQUAA4IBAQB/X7lTW2M9dTLn+sR0GstG30ZpHFLPqk/CaOv/gKlR6D1id4k9CnU58W5d
-F4dvaAXBlGzZXd/aslnLpRCKysw5zZ/rTt5S/wzw9JKp8mxTq5vSR6AfdPebmvEvFZ96ZDAYBzwq
-D2fK/A+JYZ1lpTzlvBNbCNvj/+27BrtqBrF6T2XGgv0enIu1De5Iu7i9qgi0+6N8y5/NkHZchpZ4
-Vwpm+Vganf2XKWDeEaaQHBkc7gGWIjQ0LpH5t8Qn0Xvmv/uARFoW5evg1Ao4vOSR49XrXMGs3xtq
-fJ7lddK2l4fbzIcrQzqECK+rPNv3PGYxhrCdU3nt+CPeQuMtgvEP5fqX
------END CERTIFICATE-----
-
-GlobalSign Root CA - R3
-=======================
------BEGIN CERTIFICATE-----
-MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv
-YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh
-bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT
-aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln
-bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt
-iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ
-0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3
-rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl
-OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2
-xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE
-FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7
-lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8
-EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E
-bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18
-YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r
-kpeDMdmztcpHWD9f
------END CERTIFICATE-----
-
-Autoridad de Certificacion Firmaprofesional CIF A62634068
-=========================================================
------BEGIN CERTIFICATE-----
-MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA
-BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2
-MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw
-QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB
-NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD
-Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P
-B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY
-7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH
-ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI
-plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX
-MbScyJCyZ/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirjaEbsX
-LZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/TKI8xWVvTyQKmtFLK
-bpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF6NkBiDkal4ZkQdU7hwxu+g/GvUgU
-vzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVhOSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1Ud
-EwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNH
-DhpkLzCBpgYDVR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp
-cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBvACAAZABlACAA
-bABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBlAGwAbwBuAGEAIAAwADgAMAAx
-ADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx
-51tkljYyGOylMnfX40S2wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk
-R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP
-T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f
-Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl
-osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR
-crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR
-saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD
-KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi
-6Et8Vcad+qMUu2WFbm5PEn4KPJ2V
------END CERTIFICATE-----
-
-Izenpe.com
-==========
------BEGIN CERTIFICATE-----
-MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG
-EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz
-MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu
-QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ
-03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK
-ClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6HLmYRY2xU
-+zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFXuaOKmMPsOzTFlUFpfnXC
-PCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQDyCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxT
-OTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbK
-F7jJeodWLBoBHmy+E60QrLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK
-0GqfvEyNBjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8Lhij+
-0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIBQFqNeb+Lz0vPqhbB
-leStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+HMh3/1uaD7euBUbl8agW7EekFwID
-AQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2luZm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+
-SVpFTlBFIFMuQS4gLSBDSUYgQTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBG
-NjIgUzgxQzBBBgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx
-MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O
-BBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUAA4ICAQB4pgwWSp9MiDrAyw6l
-Fn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWblaQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbga
-kEyrkgPH7UIBzg/YsfqikuFgba56awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8q
-hT/AQKM6WfxZSzwoJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Cs
-g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5
-aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5
-nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC
-ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo
-Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z
-WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw==
------END CERTIFICATE-----
-
-Chambers of Commerce Root - 2008
-================================
------BEGIN CERTIFICATE-----
-MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD
-MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv
-bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu
-QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy
-Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl
-ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF
-EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl
-cnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC
-AQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW928sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKA
-XuFixrYp4YFs8r/lfTJqVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorj
-h40G072QDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR5gN/
-ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfLZEFHcpOrUMPrCXZk
-NNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05aSd+pZgvMPMZ4fKecHePOjlO+Bd5g
-D2vlGts/4+EhySnB8esHnFIbAURRPHsl18TlUlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331
-lubKgdaX8ZSD6e2wsWsSaR6s+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ
-0wlf2eOKNcx5Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj
-ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAxhduub+84Mxh2
-EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNVHQ4EFgQU+SSsD7K1+HnA+mCI
-G8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJ
-BgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNh
-bWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENh
-bWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDiC
-CQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUH
-AgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAJASryI1
-wqM58C7e6bXpeHxIvj99RZJe6dqxGfwWPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH
-3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU
-RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6
-M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1
-YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF
-9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK
-zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG
-nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg
-OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ
------END CERTIFICATE-----
-
-Global Chambersign Root - 2008
-==============================
------BEGIN CERTIFICATE-----
-MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD
-MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv
-bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu
-QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx
-NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUg
-Y3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJ
-QTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD
-aGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDf
-VtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXf
-XjaOcNFccUMd2drvXNL7G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0
-ZJJ0YPP2zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4ddPB
-/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyGHoiMvvKRhI9lNNgA
-TH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2Id3UwD2ln58fQ1DJu7xsepeY7s2M
-H/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3VyJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfe
-Ox2YItaswTXbo6Al/3K1dh3ebeksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSF
-HTynyQbehP9r6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh
-wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsogzCtLkykPAgMB
-AAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQWBBS5CcqcHtvTbDprru1U8VuT
-BjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDprru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UE
-BhMCRVUxQzBBBgNVBAcTOk1hZHJpZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJm
-aXJtYS5jb20vYWRkcmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJm
-aXJtYSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiCCQDJzdPp
-1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0
-dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAICIf3DekijZBZRG
-/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6
-ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/s
-dZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg
-9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHH
-foUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9Du
-qqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETr
-P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq
-c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z
-09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B
------END CERTIFICATE-----
-
-Go Daddy Root Certificate Authority - G2
-========================================
------BEGIN CERTIFICATE-----
-MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT
-B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu
-MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5
-MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6
-b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G
-A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI
-hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq
-9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD
-+qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd
-fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl
-NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC
-MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9
-BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac
-vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r
-5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV
-N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO
-LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1
------END CERTIFICATE-----
-
-Starfield Root Certificate Authority - G2
-=========================================
------BEGIN CERTIFICATE-----
-MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT
-B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s
-b2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0
-eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAw
-DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQg
-VGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZpY2F0ZSBB
-dXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3twQP89o/8ArFv
-W59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMgnLRJdzIpVv257IzdIvpy3Cdhl+72WoTs
-bhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNk
-N3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7Nf
-ZTD4p7dNdloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbU
-JtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
-AQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfol
-TwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx
-4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw
-F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K
-pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ
-c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0
------END CERTIFICATE-----
-
-Starfield Services Root Certificate Authority - G2
-==================================================
------BEGIN CERTIFICATE-----
-MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT
-B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s
-b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl
-IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV
-BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT
-dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg
-Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
-AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2
-h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa
-hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP
-LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB
-rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw
-AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG
-SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP
-E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy
-xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd
-iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza
-YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6
------END CERTIFICATE-----
-
-AffirmTrust Commercial
-======================
------BEGIN CERTIFICATE-----
-MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS
-BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw
-MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly
-bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF
-AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb
-DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV
-C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6
-BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww
-MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV
-HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
-AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG
-hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi
-qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv
-0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh
-sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8=
------END CERTIFICATE-----
-
-AffirmTrust Networking
-======================
------BEGIN CERTIFICATE-----
-MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS
-BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw
-MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly
-bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF
-AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE
-Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI
-dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24
-/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb
-h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV
-HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
-AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu
-UFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzuQY0x2+c06lkh1QF6
-12S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZLgo/bNjR9eUJtGxUAArgFU2HdW23
-WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4uolu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9
-/ZFvgrG+CJPbFEfxojfHRZ48x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s=
------END CERTIFICATE-----
-
-AffirmTrust Premium
-===================
------BEGIN CERTIFICATE-----
-MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UEBhMCVVMxFDAS
-BgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMB4XDTEwMDEy
-OTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRy
-dXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A
-MIICCgKCAgEAxBLfqV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtn
-BKAQJG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ+jjeRFcV
-5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrSs8PhaJyJ+HoAVt70VZVs
-+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmd
-GPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d770O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5R
-p9EixAqnOEhss/n/fauGV+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NI
-S+LI+H+SqHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S5u04
-6uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4IaC1nEWTJ3s7xgaVY5
-/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TXOwF0lkLgAOIua+rF7nKsu7/+6qqo
-+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYEFJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB
-/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByv
-MiPIs0laUZx2KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg
-Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC
-6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S
-L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK
-+4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV
-BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg
-IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60
-g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb
-zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw==
------END CERTIFICATE-----
-
-AffirmTrust Premium ECC
-=======================
------BEGIN CERTIFICATE-----
-MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV
-BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx
-MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U
-cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA
-IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ
-N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW
-BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK
-BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X
-57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM
-eQ==
------END CERTIFICATE-----
-
-Certum Trusted Network CA
-=========================
------BEGIN CERTIFICATE-----
-MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK
-ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv
-biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy
-MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU
-ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5
-MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC
-AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC
-l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J
-J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4
-fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0
-cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB
-Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw
-DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj
-jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1
-mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj
-Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI
-03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw=
------END CERTIFICATE-----
-
-Certinomis - Autorité Racine
-=============================
------BEGIN CERTIFICATE-----
-MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjETMBEGA1UEChMK
-Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAkBgNVBAMMHUNlcnRpbm9taXMg
-LSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkG
-A1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYw
-JAYDVQQDDB1DZXJ0aW5vbWlzIC0gQXV0b3JpdMOpIFJhY2luZTCCAiIwDQYJKoZIhvcNAQEBBQAD
-ggIPADCCAgoCggIBAJ2Fn4bT46/HsmtuM+Cet0I0VZ35gb5j2CN2DpdUzZlMGvE5x4jYF1AMnmHa
-wE5V3udauHpOd4cN5bjr+p5eex7Ezyh0x5P1FMYiKAT5kcOrJ3NqDi5N8y4oH3DfVS9O7cdxbwly
-Lu3VMpfQ8Vh30WC8Tl7bmoT2R2FFK/ZQpn9qcSdIhDWerP5pqZ56XjUl+rSnSTV3lqc2W+HN3yNw
-2F1MpQiD8aYkOBOo7C+ooWfHpi2GR+6K/OybDnT0K0kCe5B1jPyZOQE51kqJ5Z52qz6WKDgmi92N
-jMD2AR5vpTESOH2VwnHu7XSu5DaiQ3XV8QCb4uTXzEIDS3h65X27uK4uIJPT5GHfceF2Z5c/tt9q
-c1pkIuVC28+BA5PY9OMQ4HL2AHCs8MF6DwV/zzRpRbWT5BnbUhYjBYkOjUjkJW+zeL9i9Qf6lSTC
-lrLooyPCXQP8w9PlfMl1I9f09bze5N/NgL+RiH2nE7Q5uiy6vdFrzPOlKO1Enn1So2+WLhl+HPNb
-xxaOu2B9d2ZHVIIAEWBsMsGoOBvrbpgT1u449fCfDu/+MYHB0iSVL1N6aaLwD4ZFjliCK0wi1F6g
-530mJ0jfJUaNSih8hp75mxpZuWW/Bd22Ql095gBIgl4g9xGC3srYn+Y3RyYe63j3YcNBZFgCQfna
-4NH4+ej9Uji29YnfAgMBAAGjWzBZMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G
-A1UdDgQWBBQNjLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ
-KoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9sov3/4gbIOZ/x
-WqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZMOH8oMDX/nyNTt7buFHAAQCva
-R6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40
-nJ+U8/aGH88bc62UeYdocMMzpXDn2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1B
-CxMjidPJC+iKunqjo3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjv
-JL1vnxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG5ERQL1TE
-qkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWqpdEdnV1j6CTmNhTih60b
-WfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZbdsLLO7XSAPCjDuGtbkD326C00EauFddE
-wk01+dIL8hf2rGbVJLJP0RyZwG71fet0BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/
-vgt2Fl43N+bYdJeimUV5
------END CERTIFICATE-----
-
-Root CA Generalitat Valenciana
-==============================
------BEGIN CERTIFICATE-----
-MIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJFUzEfMB0GA1UE
-ChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290
-IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwHhcNMDEwNzA2MTYyMjQ3WhcNMjEwNzAxMTUyMjQ3
-WjBoMQswCQYDVQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UE
-CxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwggEiMA0G
-CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGKqtXETcvIorKA3Qdyu0togu8M1JAJke+WmmmO3I2
-F0zo37i7L3bhQEZ0ZQKQUgi0/6iMweDHiVYQOTPvaLRfX9ptI6GJXiKjSgbwJ/BXufjpTjJ3Cj9B
-ZPPrZe52/lSqfR0grvPXdMIKX/UIKFIIzFVd0g/bmoGlu6GzwZTNVOAydTGRGmKy3nXiz0+J2ZGQ
-D0EbtFpKd71ng+CT516nDOeB0/RSrFOyA8dEJvt55cs0YFAQexvba9dHq198aMpunUEDEO5rmXte
-JajCq+TA81yc477OMUxkHl6AovWDfgzWyoxVjr7gvkkHD6MkQXpYHYTqWBLI4bft75PelAgxAgMB
-AAGjggM7MIIDNzAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAGGFmh0dHA6Ly9vY3NwLnBraS5n
-dmEuZXMwEgYDVR0TAQH/BAgwBgEB/wIBAjCCAjQGA1UdIASCAiswggInMIICIwYKKwYBBAG/VQIB
-ADCCAhMwggHoBggrBgEFBQcCAjCCAdoeggHWAEEAdQB0AG8AcgBpAGQAYQBkACAAZABlACAAQwBl
-AHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAFIAYQDtAHoAIABkAGUAIABsAGEAIABHAGUAbgBlAHIA
-YQBsAGkAdABhAHQAIABWAGEAbABlAG4AYwBpAGEAbgBhAC4ADQAKAEwAYQAgAEQAZQBjAGwAYQBy
-AGEAYwBpAPMAbgAgAGQAZQAgAFAAcgDhAGMAdABpAGMAYQBzACAAZABlACAAQwBlAHIAdABpAGYA
-aQBjAGEAYwBpAPMAbgAgAHEAdQBlACAAcgBpAGcAZQAgAGUAbAAgAGYAdQBuAGMAaQBvAG4AYQBt
-AGkAZQBuAHQAbwAgAGQAZQAgAGwAYQAgAHAAcgBlAHMAZQBuAHQAZQAgAEEAdQB0AG8AcgBpAGQA
-YQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAHMAZQAgAGUAbgBjAHUAZQBu
-AHQAcgBhACAAZQBuACAAbABhACAAZABpAHIAZQBjAGMAaQDzAG4AIAB3AGUAYgAgAGgAdAB0AHAA
-OgAvAC8AdwB3AHcALgBwAGsAaQAuAGcAdgBhAC4AZQBzAC8AYwBwAHMwJQYIKwYBBQUHAgEWGWh0
-dHA6Ly93d3cucGtpLmd2YS5lcy9jcHMwHQYDVR0OBBYEFHs100DSHHgZZu90ECjcPk+yeAT8MIGV
-BgNVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQswCQYDVQQGEwJFUzEfMB0G
-A1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5S
-b290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRh
-TvW1yEICKrNcda3FbcrnlD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdz
-Ckj+IHLtb8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg9J63
-NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XFducTZnV+ZfsBn5OH
-iJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmCIoaZM3Fa6hlXPZHNqcCjbgcTpsnt
-+GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMM=
------END CERTIFICATE-----
-
-A-Trust-nQual-03
-================
------BEGIN CERTIFICATE-----
-MIIDzzCCAregAwIBAgIDAWweMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYDVQQGEwJBVDFIMEYGA1UE
-Cgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBpbSBlbGVrdHIuIERhdGVudmVy
-a2VociBHbWJIMRkwFwYDVQQLDBBBLVRydXN0LW5RdWFsLTAzMRkwFwYDVQQDDBBBLVRydXN0LW5R
-dWFsLTAzMB4XDTA1MDgxNzIyMDAwMFoXDTE1MDgxNzIyMDAwMFowgY0xCzAJBgNVBAYTAkFUMUgw
-RgYDVQQKDD9BLVRydXN0IEdlcy4gZi4gU2ljaGVyaGVpdHNzeXN0ZW1lIGltIGVsZWt0ci4gRGF0
-ZW52ZXJrZWhyIEdtYkgxGTAXBgNVBAsMEEEtVHJ1c3QtblF1YWwtMDMxGTAXBgNVBAMMEEEtVHJ1
-c3QtblF1YWwtMDMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtPWFuA/OQO8BBC4SA
-zewqo51ru27CQoT3URThoKgtUaNR8t4j8DRE/5TrzAUjlUC5B3ilJfYKvUWG6Nm9wASOhURh73+n
-yfrBJcyFLGM/BWBzSQXgYHiVEEvc+RFZznF/QJuKqiTfC0Li21a8StKlDJu3Qz7dg9MmEALP6iPE
-SU7l0+m0iKsMrmKS1GWH2WrX9IWf5DMiJaXlyDO6w8dB3F/GaswADm0yqLaHNgBid5seHzTLkDx4
-iHQF63n1k3Flyp3HaxgtPVxO59X4PzF9j4fsCiIvI+n+u33J4PTs63zEsMMtYrWacdaxaujs2e3V
-cuy+VwHOBVWf3tFgiBCzAgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0OBAoECERqlWdV
-eRFPMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAVdRU0VlIXLOThaq/Yy/kgM40
-ozRiPvbY7meIMQQDbwvUB/tOdQ/TLtPAF8fGKOwGDREkDg6lXb+MshOWcdzUzg4NCmgybLlBMRmr
-sQd7TZjTXLDR8KdCoLXEjq/+8T/0709GAHbrAvv5ndJAlseIOrifEXnzgGWovR/TeIGgUUw3tKZd
-JXDRZslo+S4RFGjxVJgIrCaSD96JntT6s3kr0qN51OyLrIdTaEJMUVF0HhsnLuP1Hyl0Te2v9+GS
-mYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmEDNuxUCAKGkq6
-ahq97BvIxYSazQ==
------END CERTIFICATE-----
-
-TWCA Root Certification Authority
-=================================
------BEGIN CERTIFICATE-----
-MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ
-VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh
-dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG
-EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB
-IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
-AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx
-QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC
-oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP
-4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r
-y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB
-BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG
-9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC
-mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW
-QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY
-T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny
-Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw==
------END CERTIFICATE-----
-
-Security Communication RootCA2
-==============================
------BEGIN CERTIFICATE-----
-MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc
-U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh
-dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC
-SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3Vy
-aXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
-ANAVOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGrzbl+dp++
-+T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVMVAX3NuRFg3sUZdbcDE3R
-3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQhNBqyjoGADdH5H5XTz+L62e4iKrFvlNV
-spHEfbmwhRkGeC7bYRr6hfVKkaHnFtWOojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1K
-EOtOghY6rCcMU/Gt1SSwawNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8
-QIH4D5csOPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB
-CwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpFcoJxDjrSzG+ntKEj
-u/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXcokgfGT+Ok+vx+hfuzU7jBBJV1uXk
-3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6q
-tnRGEmyR7jTV7JqR50S+kDFy1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29
-mvVXIwAHIRc/SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03
------END CERTIFICATE-----
-
-EC-ACC
-======
------BEGIN CERTIFICATE-----
-MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB8zELMAkGA1UE
-BhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2VydGlmaWNhY2lvIChOSUYgUS0w
-ODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYD
-VQQLEyxWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UE
-CxMsSmVyYXJxdWlhIEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMT
-BkVDLUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQGEwJFUzE7
-MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8gKE5JRiBRLTA4MDExNzYt
-SSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBDZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZl
-Z2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQubmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJh
-cnF1aWEgRW50aXRhdHMgZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUND
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R85iK
-w5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm4CgPukLjbo73FCeT
-ae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaVHMf5NLWUhdWZXqBIoH7nF2W4onW4
-HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNdQlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0a
-E9jD2z3Il3rucO2n5nzbcc8tlGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw
-0JDnJwIDAQABo4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E
-BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4opvpXY0wfwYD
-VR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBodHRwczovL3d3dy5jYXRjZXJ0
-Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5l
-dC92ZXJhcnJlbCAwDQYJKoZIhvcNAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJ
-lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa
-Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe
-l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2
-E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D
-5EI=
------END CERTIFICATE-----
-
-Hellenic Academic and Research Institutions RootCA 2011
-=======================================================
------BEGIN CERTIFICATE-----
-MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT
-O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y
-aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z
-IFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYT
-AkdSMUQwQgYDVQQKEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z
-IENlcnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNo
-IEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
-AKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPzdYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI
-1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJfel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa
-71HFK9+WXesyHgLacEnsbgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u
-8yBRQlqD75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSPFEDH
-3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNVHRMBAf8EBTADAQH/
-MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp5dgTBCPuQSUwRwYDVR0eBEAwPqA8
-MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQub3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQu
-b3JnMA0GCSqGSIb3DQEBBQUAA4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVt
-XdMiKahsog2p6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8
-TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7dIsXRSZMFpGD
-/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8AcysNnq/onN694/BtZqhFLKPM58N
-7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4
------END CERTIFICATE-----
-
-Actalis Authentication Root CA
-==============================
------BEGIN CERTIFICATE-----
-MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQxDjAM
-BgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UE
-AwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDky
-MjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlz
-IFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290
-IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNvUTufClrJ
-wkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX4ay8IMKx4INRimlNAJZa
-by/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9KK3giq0itFZljoZUj5NDKd45RnijMCO6
-zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1f
-YVEiVRvjRuPjPdA1YprbrxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2
-oxgkg4YQ51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2Fbe8l
-EfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxeKF+w6D9Fz8+vm2/7
-hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4Fv6MGn8i1zeQf1xcGDXqVdFUNaBr8
-EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbnfpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5
-jF66CyCU3nuDuP/jVo23Eek7jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLY
-iDrIn3hm7YnzezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt
-ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQALe3KHwGCmSUyI
-WOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70jsNjLiNmsGe+b7bAEzlgqqI0
-JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDzWochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKx
-K3JCaKygvU5a2hi/a5iB0P2avl4VSM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+
-Xlff1ANATIGk0k9jpwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC
-4yyXX04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+OkfcvHlXHo
-2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7RK4X9p2jIugErsWx0Hbhz
-lefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btUZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXem
-OR/qnuOf0GZvBeyqdn6/axag67XH/JJULysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9
-vwGYT7JZVEc+NHt4bVaTLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg==
------END CERTIFICATE-----
-
-Trustis FPS Root CA
-===================
------BEGIN CERTIFICATE-----
-MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQG
-EwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQLExNUcnVzdGlzIEZQUyBSb290
-IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTExMzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNV
-BAoTD1RydXN0aXMgTGltaXRlZDEcMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJ
-KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQ
-RUN+AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihHiTHcDnlk
-H5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjjvSkCqPoc4Vu5g6hBSLwa
-cY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zt
-o3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlBOrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEA
-AaNTMFEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAd
-BgNVHQ4EFgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01GX2c
-GE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmWzaD+vkAMXBJV+JOC
-yinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP41BIy+Q7DsdwyhEQsb8tGD+pmQQ9P
-8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZEf1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHV
-l/9D7S3B2l0pKoU/rGXuhg8FjZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYl
-iB6XzCGcKQENZetX2fNXlrtIzYE=
------END CERTIFICATE-----
-
-StartCom Certification Authority
-================================
------BEGIN CERTIFICATE-----
-MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN
-U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu
-ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0
-NjM3WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk
-LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg
-U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw
-ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y
-o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/
-Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d
-eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt
-2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z
-6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ
-osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/
-untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc
-UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT
-37uMdBNSSwIDAQABo4ICEDCCAgwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD
-VR0OBBYEFE4L7xqkQFulF2mHMMo0aEPQQa7yMB8GA1UdIwQYMBaAFE4L7xqkQFulF2mHMMo0aEPQ
-Qa7yMIIBWgYDVR0gBIIBUTCCAU0wggFJBgsrBgEEAYG1NwEBATCCATgwLgYIKwYBBQUHAgEWImh0
-dHA6Ly93d3cuc3RhcnRzc2wuY29tL3BvbGljeS5wZGYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cu
-c3RhcnRzc2wuY29tL2ludGVybWVkaWF0ZS5wZGYwgc8GCCsGAQUFBwICMIHCMCcWIFN0YXJ0IENv
-bW1lcmNpYWwgKFN0YXJ0Q29tKSBMdGQuMAMCAQEagZZMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0
-aGUgc2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0aWZpY2F0
-aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly93d3cuc3RhcnRzc2wuY29t
-L3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilTdGFydENvbSBG
-cmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQsFAAOCAgEAjo/n3JR5
-fPGFf59Jb2vKXfuM/gTFwWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWm
-N3PH/UvSTa0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst0OcN
-Org+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNcpRJvkrKTlMeIFw6T
-tn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKlCcWw0bdT82AUuoVpaiF8H3VhFyAX
-e2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVFP0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA
-2MFrLH9ZXF2RsXAiV+uKa0hK1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBs
-HvUwyKMQ5bLmKhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE
-JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ8dCAWZvLMdib
-D4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnmfyWl8kgAwKQB2j8=
------END CERTIFICATE-----
-
-StartCom Certification Authority G2
-===================================
------BEGIN CERTIFICATE-----
-MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMN
-U3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg
-RzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UE
-ChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3Jp
-dHkgRzIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8O
-o1XJJZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsDvfOpL9HG
-4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnooD/Uefyf3lLE3PbfHkffi
-Aez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumNK9LYP5/Q0kGi4xDuFby2X8hQxfqp0iVAXV16iul
-Q5XqFYSdCI0mblWbq9zSOdIxHWDirMxWRST1HFSr7obdljKF+ExP6JV2tgXdNiNnvP8V4so75qbs
-O+wmETRIjfaAKxojAuuKHDp2KntWFhxyKrOq42ClAJ8Em+JvHhRYW6Vsi1g8w7pOOlz34ZYrPu8H
-vKTlXcxNnw3h3Kq74W4a7I/htkxNeXJdFzULHdfBR9qWJODQcqhaX2YtENwvKhOuJv4KHBnM0D4L
-nMgJLvlblnpHnOl68wVQdJVznjAJ85eCXuaPOQgeWeU1FEIT/wCc976qUM/iUUjXuG+v+E5+M5iS
-FGI6dWPPe/regjupuznixL0sAA7IF6wT700ljtizkC+p2il9Ha90OrInwMEePnWjFqmveiJdnxMa
-z6eg6+OGCtP95paV1yPIN93EfKo2rJgaErHgTuixO/XWb/Ew1wIDAQABo0IwQDAPBgNVHRMBAf8E
-BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJ
-KoZIhvcNAQELBQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K
-2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfXUfEpY9Z1zRbk
-J4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl6/2o1PXWT6RbdejF0mCy2wl+
-JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG
-/+gyRr61M3Z3qAFdlsHB1b6uJcDJHgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTc
-nIhT76IxW1hPkWLIwpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/Xld
-blhYXzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5lIxKVCCIc
-l85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoohdVddLHRDiBYmxOlsGOm
-7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulrso8uBtjRkcfGEvRM/TAXw8HaOFvjqerm
-obp573PYtlNXLfbQ4ddI
------END CERTIFICATE-----
-
-Buypass Class 2 Root CA
-=======================
------BEGIN CERTIFICATE-----
-MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU
-QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMiBSb290IENBMB4X
-DTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1owTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1
-eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIw
-DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1
-g1Lr6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPVL4O2fuPn
-9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC911K2GScuVr1QGbNgGE41b
-/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHxMlAQTn/0hpPshNOOvEu/XAFOBz3cFIqU
-CqTqc/sLUegTBxj6DvEr0VQVfTzh97QZQmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeff
-awrbD02TTqigzXsu8lkBarcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgI
-zRFo1clrUs3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLiFRhn
-Bkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRSP/TizPJhk9H9Z2vX
-Uq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN9SG9dKpN6nIDSdvHXx1iY8f93ZHs
-M+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxPAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD
-VR0OBBYEFMmAd+BikoL1RpzzuvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF
-AAOCAgEAU18h9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s
-A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3tOluwlN5E40EI
-osHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo+fsicdl9sz1Gv7SEr5AcD48S
-aq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYd
-DnkM/crqJIByw5c/8nerQyIKx+u2DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWD
-LfJ6v9r9jv6ly0UsH8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0
-oyLQI+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK75t98biGC
-wWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h3PFaTWwyI0PurKju7koS
-CTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv4x3kqdbQCtCev9eBCfHJxyYN
-rJgWVqA=
------END CERTIFICATE-----
-
-Buypass Class 3 Root CA
-=======================
------BEGIN CERTIFICATE-----
-MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU
-QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290IENBMB4X
-DTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1
-eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIw
-DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRH
-sJ8YZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3EN3coTRiR
-5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9tznDDgFHmV0ST9tD+leh
-7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX0DJq1l1sDPGzbjniazEuOQAnFN44wOwZ
-ZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH
-2xc519woe2v1n/MuwU8XKhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV
-/afmiSTYzIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvSO1UQ
-RwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D34xFMFbG02SrZvPA
-Xpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgPK9Dx2hzLabjKSWJtyNBjYt1gD1iq
-j6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD
-VR0OBBYEFEe4zf/lb+74suwvTg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF
-AAOCAgEAACAjQTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV
-cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXSIGrs/CIBKM+G
-uIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2HJLw5QY33KbmkJs4j1xrG0aG
-Q0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsaO5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8
-ZORK15FTAaggiG6cX0S5y2CBNOxv033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2
-KSb12tjE8nVhz36udmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz
-6MkEkbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg413OEMXbug
-UZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvDu79leNKGef9JOxqDDPDe
-eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi
-Cp/HuZc=
------END CERTIFICATE-----
-
-T-TeleSec GlobalRoot Class 3
-============================
------BEGIN CERTIFICATE-----
-MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM
-IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU
-cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgx
-MDAxMTAyOTU2WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz
-dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD
-ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0GCSqGSIb3
-DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN8ELg63iIVl6bmlQdTQyK
-9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/RLyTPWGrTs0NvvAgJ1gORH8EGoel15YU
-NpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZF
-iP0Zf3WHHx+xGwpzJFu5ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W
-0eDrXltMEnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGjQjBA
-MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1A/d2O2GCahKqGFPr
-AyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOyWL6ukK2YJ5f+AbGwUgC4TeQbIXQb
-fsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzT
-ucpH9sry9uetuUg/vBa3wW306gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7h
-P0HHRwA11fXT91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml
-e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw==
------END CERTIFICATE-----
-
-EE Certification Centre Root CA
-===============================
------BEGIN CERTIFICATE-----
-MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG
-EwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEoMCYGA1UEAwwfRUUgQ2Vy
-dGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIw
-MTAxMDMwMTAxMDMwWhgPMjAzMDEyMTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlB
-UyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRy
-ZSBSb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEBAQUAA4IB
-DwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUyeuuOF0+W2Ap7kaJjbMeM
-TC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvObntl8jixwKIy72KyaOBhU8E2lf/slLo2
-rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIwWFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw
-93X2PaRka9ZP585ArQ/dMtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtN
-P2MbRMNE1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYDVR0T
-AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/zQas8fElyalL1BSZ
-MEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEF
-BQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEFBQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+Rj
-xY6hUFaTlrg4wCQiZrxTFGGVv9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqM
-lIpPnTX/dqQGE5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u
-uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIWiAYLtqZLICjU
-3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/vGVCJYMzpJJUPwssd8m92kMfM
-dcGWxZ0=
------END CERTIFICATE-----
-
-TURKTRUST Certificate Services Provider Root 2007
-=================================================
------BEGIN CERTIFICATE-----
-MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOcUktUUlVTVCBF
-bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP
-MA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg
-QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4X
-DTA3MTIyNTE4MzcxOVoXDTE3MTIyMjE4MzcxOVowgb8xPzA9BgNVBAMMNlTDnFJLVFJVU1QgRWxl
-a3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTELMAkGA1UEBhMCVFIxDzAN
-BgNVBAcMBkFua2FyYTFeMFwGA1UECgxVVMOcUktUUlVTVCBCaWxnaSDEsGxldGnFn2ltIHZlIEJp
-bGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7Fni4gKGMpIEFyYWzEsWsgMjAwNzCCASIw
-DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKu3PgqMyKVYFeaK7yc9SrToJdPNM8Ig3BnuiD9N
-YvDdE3ePYakqtdTyuTFYKTsvP2qcb3N2Je40IIDu6rfwxArNK4aUyeNgsURSsloptJGXg9i3phQv
-KUmi8wUG+7RP2qFsmmaf8EMJyupyj+sA1zU511YXRxcw9L6/P8JorzZAwan0qafoEGsIiveGHtya
-KhUG9qPw9ODHFNRRf8+0222vR5YXm3dx2KdxnSQM9pQ/hTEST7ruToK4uT6PIzdezKKqdfcYbwnT
-rqdUKDT74eA7YH2gvnmJhsifLfkKS8RQouf9eRbHegsYz85M733WB2+Y8a+xwXrXgTW4qhe04MsC
-AwEAAaNCMEAwHQYDVR0OBBYEFCnFkKslrxHkYb+j/4hhkeYO/pyBMA4GA1UdDwEB/wQEAwIBBjAP
-BgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAQDdr4Ouwo0RSVgrESLFF6QSU2TJ/s
-Px+EnWVUXKgWAkD6bho3hO9ynYYKVZ1WKKxmLNA6VpM0ByWtCLCPyA8JWcqdmBzlVPi5RX9ql2+I
-aE1KBiY3iAIOtsbWcpnOa3faYjGkVh+uX4132l32iPwa2Z61gfAyuOOI0JzzaqC5mxRZNTZPz/OO
-Xl0XrRWV2N2y1RVuAE6zS89mlOTgzbUF2mNXi+WzqtvALhyQRNsaXRik7r4EW5nVcV9VZWRi1aKb
-BFmGyGJ353yCRWo9F7/snXUMrqNvWtMvmDb08PUZqxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAK
-poRq0Tl9
------END CERTIFICATE-----
-
-D-TRUST Root Class 3 CA 2 2009
-==============================
------BEGIN CERTIFICATE-----
-MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQK
-DAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTAe
-Fw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NThaME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxE
-LVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIw
-DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOAD
-ER03UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42tSHKXzlA
-BF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9RySPocq60vFYJfxLLHLGv
-KZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsMlFqVlNpQmvH/pStmMaTJOKDfHR+4CS7z
-p+hnUquVH+BGPtikw8paxTGA6Eian5Rp/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUC
-AwEAAaOCARowggEWMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ
-4PGEMA4GA1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVjdG9y
-eS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUyMENBJTIwMiUyMDIw
-MDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRlcmV2b2NhdGlvbmxpc3QwQ6BBoD+G
-PWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3JsL2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAw
-OS5jcmwwDQYJKoZIhvcNAQELBQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm
-2H6NMLVwMeniacfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0
-o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4KzCUqNQT4YJEV
-dT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph
-X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I=
------END CERTIFICATE-----
-
-D-TRUST Root Class 3 CA 2 EV 2009
-=================================
------BEGIN CERTIFICATE-----
-MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK
-DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw
-OTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK
-DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw
-OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfS
-egpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM03TP1YtHh
-zRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6ZqQTMFexgaDbtCHu39b+T
-7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lRp75mpoo6Kr3HGrHhFPC+Oh25z1uxav60
-sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure35
-11H3a6UCAwEAAaOCASQwggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyv
-cop9NteaHNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFwOi8v
-ZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xhc3MlMjAzJTIwQ0El
-MjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1ERT9jZXJ0aWZpY2F0ZXJldm9jYXRp
-b25saXN0MEagRKBChkBodHRwOi8vd3d3LmQtdHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xh
-c3NfM19jYV8yX2V2XzIwMDkuY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+
-PPoeUSbrh/Yp3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05
-nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNFCSuGdXzfX2lX
-ANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7naxpeG0ILD5EJt/rDiZE4OJudA
-NCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqXKVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVv
-w9y4AyHqnxbxLFS1
------END CERTIFICATE-----
-
-PSCProcert
-==========
------BEGIN CERTIFICATE-----
-MIIJhjCCB26gAwIBAgIBCzANBgkqhkiG9w0BAQsFADCCAR4xPjA8BgNVBAMTNUF1dG9yaWRhZCBk
-ZSBDZXJ0aWZpY2FjaW9uIFJhaXogZGVsIEVzdGFkbyBWZW5lem9sYW5vMQswCQYDVQQGEwJWRTEQ
-MA4GA1UEBxMHQ2FyYWNhczEZMBcGA1UECBMQRGlzdHJpdG8gQ2FwaXRhbDE2MDQGA1UEChMtU2lz
-dGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMUMwQQYDVQQLEzpTdXBl
-cmludGVuZGVuY2lhIGRlIFNlcnZpY2lvcyBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMSUw
-IwYJKoZIhvcNAQkBFhZhY3JhaXpAc3VzY2VydGUuZ29iLnZlMB4XDTEwMTIyODE2NTEwMFoXDTIw
-MTIyNTIzNTk1OVowgdExJjAkBgkqhkiG9w0BCQEWF2NvbnRhY3RvQHByb2NlcnQubmV0LnZlMQ8w
-DQYDVQQHEwZDaGFjYW8xEDAOBgNVBAgTB01pcmFuZGExKjAoBgNVBAsTIVByb3ZlZWRvciBkZSBD
-ZXJ0aWZpY2Fkb3MgUFJPQ0VSVDE2MDQGA1UEChMtU2lzdGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZp
-Y2FjaW9uIEVsZWN0cm9uaWNhMQswCQYDVQQGEwJWRTETMBEGA1UEAxMKUFNDUHJvY2VydDCCAiIw
-DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANW39KOUM6FGqVVhSQ2oh3NekS1wwQYalNo97BVC
-wfWMrmoX8Yqt/ICV6oNEolt6Vc5Pp6XVurgfoCfAUFM+jbnADrgV3NZs+J74BCXfgI8Qhd19L3uA
-3VcAZCP4bsm+lU/hdezgfl6VzbHvvnpC2Mks0+saGiKLt38GieU89RLAu9MLmV+QfI4tL3czkkoh
-RqipCKzx9hEC2ZUWno0vluYC3XXCFCpa1sl9JcLB/KpnheLsvtF8PPqv1W7/U0HU9TI4seJfxPmO
-EO8GqQKJ/+MMbpfg353bIdD0PghpbNjU5Db4g7ayNo+c7zo3Fn2/omnXO1ty0K+qP1xmk6wKImG2
-0qCZyFSTXai20b1dCl53lKItwIKOvMoDKjSuc/HUtQy9vmebVOvh+qBa7Dh+PsHMosdEMXXqP+UH
-0quhJZb25uSgXTcYOWEAM11G1ADEtMo88aKjPvM6/2kwLkDd9p+cJsmWN63nOaK/6mnbVSKVUyqU
-td+tFjiBdWbjxywbk5yqjKPK2Ww8F22c3HxT4CAnQzb5EuE8XL1mv6JpIzi4mWCZDlZTOpx+FIyw
-Bm/xhnaQr/2v/pDGj59/i5IjnOcVdo/Vi5QTcmn7K2FjiO/mpF7moxdqWEfLcU8UC17IAggmosvp
-r2uKGcfLFFb14dq12fy/czja+eevbqQ34gcnAgMBAAGjggMXMIIDEzASBgNVHRMBAf8ECDAGAQH/
-AgEBMDcGA1UdEgQwMC6CD3N1c2NlcnRlLmdvYi52ZaAbBgVghl4CAqASDBBSSUYtRy0yMDAwNDAz
-Ni0wMB0GA1UdDgQWBBRBDxk4qpl/Qguk1yeYVKIXTC1RVDCCAVAGA1UdIwSCAUcwggFDgBStuyId
-xuDSAaj9dlBSk+2YwU2u06GCASakggEiMIIBHjE+MDwGA1UEAxM1QXV0b3JpZGFkIGRlIENlcnRp
-ZmljYWNpb24gUmFpeiBkZWwgRXN0YWRvIFZlbmV6b2xhbm8xCzAJBgNVBAYTAlZFMRAwDgYDVQQH
-EwdDYXJhY2FzMRkwFwYDVQQIExBEaXN0cml0byBDYXBpdGFsMTYwNAYDVQQKEy1TaXN0ZW1hIE5h
-Y2lvbmFsIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExQzBBBgNVBAsTOlN1cGVyaW50ZW5k
-ZW5jaWEgZGUgU2VydmljaW9zIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExJTAjBgkqhkiG
-9w0BCQEWFmFjcmFpekBzdXNjZXJ0ZS5nb2IudmWCAQowDgYDVR0PAQH/BAQDAgEGME0GA1UdEQRG
-MESCDnByb2NlcnQubmV0LnZloBUGBWCGXgIBoAwMClBTQy0wMDAwMDKgGwYFYIZeAgKgEgwQUklG
-LUotMzE2MzUzNzMtNzB2BgNVHR8EbzBtMEagRKBChkBodHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52
-ZS9sY3IvQ0VSVElGSUNBRE8tUkFJWi1TSEEzODRDUkxERVIuY3JsMCOgIaAfhh1sZGFwOi8vYWNy
-YWl6LnN1c2NlcnRlLmdvYi52ZTA3BggrBgEFBQcBAQQrMCkwJwYIKwYBBQUHMAGGG2h0dHA6Ly9v
-Y3NwLnN1c2NlcnRlLmdvYi52ZTBBBgNVHSAEOjA4MDYGBmCGXgMBAjAsMCoGCCsGAQUFBwIBFh5o
-dHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9kcGMwDQYJKoZIhvcNAQELBQADggIBACtZ6yKZu4Sq
-T96QxtGGcSOeSwORR3C7wJJg7ODU523G0+1ng3dS1fLld6c2suNUvtm7CpsR72H0xpkzmfWvADmN
-g7+mvTV+LFwxNG9s2/NkAZiqlCxB3RWGymspThbASfzXg0gTB1GEMVKIu4YXx2sviiCtxQuPcD4q
-uxtxj7mkoP3YldmvWb8lK5jpY5MvYB7Eqvh39YtsL+1+LrVPQA3uvFd359m21D+VJzog1eWuq2w1
-n8GhHVnchIHuTQfiSLaeS5UtQbHh6N5+LwUeaO6/u5BlOsju6rEYNxxik6SgMexxbJHmpHmJWhSn
-FFAFTKQAVzAswbVhltw+HoSvOULP5dAssSS830DD7X9jSr3hTxJkhpXzsOfIt+FTvZLm8wyWuevo
-5pLtp4EJFAv8lXrPj9Y0TzYS3F7RNHXGRoAvlQSMx4bEqCaJqD8Zm4G7UaRKhqsLEQ+xrmNTbSjq
-3TNWOByyrYDT13K9mmyZY+gAu0F2BbdbmRiKw7gSXFbPVgx96OLP7bx0R/vu0xdOIk9W/1DzLuY5
-poLWccret9W6aAjtmcz9opLLabid+Qqkpj5PkygqYWwHJgD/ll9ohri4zspV4KuxPX+Y1zMOWj3Y
-eMLEYC/HYvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km
------END CERTIFICATE-----
-
-China Internet Network Information Center EV Certificates Root
-==============================================================
------BEGIN CERTIFICATE-----
-MIID9zCCAt+gAwIBAgIESJ8AATANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCQ04xMjAwBgNV
-BAoMKUNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyMUcwRQYDVQQDDD5D
-aGluYSBJbnRlcm5ldCBOZXR3b3JrIEluZm9ybWF0aW9uIENlbnRlciBFViBDZXJ0aWZpY2F0ZXMg
-Um9vdDAeFw0xMDA4MzEwNzExMjVaFw0zMDA4MzEwNzExMjVaMIGKMQswCQYDVQQGEwJDTjEyMDAG
-A1UECgwpQ2hpbmEgSW50ZXJuZXQgTmV0d29yayBJbmZvcm1hdGlvbiBDZW50ZXIxRzBFBgNVBAMM
-PkNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyIEVWIENlcnRpZmljYXRl
-cyBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm35z7r07eKpkQ0H1UN+U8i6y
-jUqORlTSIRLIOTJCBumD1Z9S7eVnAztUwYyZmczpwA//DdmEEbK40ctb3B75aDFk4Zv6dOtouSCV
-98YPjUesWgbdYavi7NifFy2cyjw1l1VxzUOFsUcW9SxTgHbP0wBkvUCZ3czY28Sf1hNfQYOL+Q2H
-klY0bBoQCxfVWhyXWIQ8hBouXJE0bhlffxdpxWXvayHG1VA6v2G5BY3vbzQ6sm8UY78WO5upKv23
-KzhmBsUs4qpnHkWnjQRmQvaPK++IIGmPMowUc9orhpFjIpryp9vOiYurXccUwVswah+xt54ugQEC
-7c+WXmPbqOY4twIDAQABo2MwYTAfBgNVHSMEGDAWgBR8cks5x8DbYqVPm6oYNJKiyoOCWTAPBgNV
-HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUfHJLOcfA22KlT5uqGDSSosqD
-glkwDQYJKoZIhvcNAQEFBQADggEBACrDx0M3j92tpLIM7twUbY8opJhJywyA6vPtI2Z1fcXTIWd5
-0XPFtQO3WKwMVC/GVhMPMdoG52U7HW8228gd+f2ABsqjPWYWqJ1MFn3AlUa1UeTiH9fqBk1jjZaM
-7+czV0I664zBechNdn3e9rG3geCg+aF4RhcaVpjwTj2rHO3sOdwHSPdj/gauwqRcalsyiMXHM4Ws
-ZkJHwlgkmeHlPuV1LI5D1l08eB6olYIpUNHRFrrvwb562bTYzB5MRuF3sTGrvSrIzo9uoV1/A3U0
-5K2JRVRevq4opbs/eHnrc7MKDf2+yfdWrPa37S+bISnHOLaVxATywy39FCqQmbkHzJ8=
------END CERTIFICATE-----
-
-Swisscom Root CA 2
-==================
------BEGIN CERTIFICATE-----
-MIIF2TCCA8GgAwIBAgIQHp4o6Ejy5e/DfEoeWhhntjANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQG
-EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy
-dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMjAeFw0xMTA2MjQwODM4MTRaFw0zMTA2
-MjUwNzM4MTRaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln
-aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAyMIIC
-IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAlUJOhJ1R5tMJ6HJaI2nbeHCOFvErjw0DzpPM
-LgAIe6szjPTpQOYXTKueuEcUMncy3SgM3hhLX3af+Dk7/E6J2HzFZ++r0rk0X2s682Q2zsKwzxNo
-ysjL67XiPS4h3+os1OD5cJZM/2pYmLcX5BtS5X4HAB1f2uY+lQS3aYg5oUFgJWFLlTloYhyxCwWJ
-wDaCFCE/rtuh/bxvHGCGtlOUSbkrRsVPACu/obvLP+DHVxxX6NZp+MEkUp2IVd3Chy50I9AU/SpH
-Wrumnf2U5NGKpV+GY3aFy6//SSj8gO1MedK75MDvAe5QQQg1I3ArqRa0jG6F6bYRzzHdUyYb3y1a
-SgJA/MTAtukxGggo5WDDH8SQjhBiYEQN7Aq+VRhxLKX0srwVYv8c474d2h5Xszx+zYIdkeNL6yxS
-NLCK/RJOlrDrcH+eOfdmQrGrrFLadkBXeyq96G4DsguAhYidDMfCd7Camlf0uPoTXGiTOmekl9Ab
-mbeGMktg2M7v0Ax/lZ9vh0+Hio5fCHyqW/xavqGRn1V9TrALacywlKinh/LTSlDcX3KwFnUey7QY
-Ypqwpzmqm59m2I2mbJYV4+by+PGDYmy7Velhk6M99bFXi08jsJvllGov34zflVEpYKELKeRcVVi3
-qPyZ7iVNTA6z00yPhOgpD/0QVAKFyPnlw4vP5w8CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw
-HQYDVR0hBBYwFDASBgdghXQBUwIBBgdghXQBUwIBMBIGA1UdEwEB/wQIMAYBAf8CAQcwHQYDVR0O
-BBYEFE0mICKJS9PVpAqhb97iEoHF8TwuMB8GA1UdIwQYMBaAFE0mICKJS9PVpAqhb97iEoHF8Twu
-MA0GCSqGSIb3DQEBCwUAA4ICAQAyCrKkG8t9voJXiblqf/P0wS4RfbgZPnm3qKhyN2abGu2sEzsO
-v2LwnN+ee6FTSA5BesogpxcbtnjsQJHzQq0Qw1zv/2BZf82Fo4s9SBwlAjxnffUy6S8w5X2lejjQ
-82YqZh6NM4OKb3xuqFp1mrjX2lhIREeoTPpMSQpKwhI3qEAMw8jh0FcNlzKVxzqfl9NX+Ave5XLz
-o9v/tdhZsnPdTSpxsrpJ9csc1fV5yJmz/MFMdOO0vSk3FQQoHt5FRnDsr7p4DooqzgB53MBfGWcs
-a0vvaGgLQ+OswWIJ76bdZWGgr4RVSJFSHMYlkSrQwSIjYVmvRRGFHQEkNI/Ps/8XciATwoCqISxx
-OQ7Qj1zB09GOInJGTB2Wrk9xseEFKZZZ9LuedT3PDTcNYtsmjGOpI99nBjx8Oto0QuFmtEYE3saW
-mA9LSHokMnWRn6z3aOkquVVlzl1h0ydw2Df+n7mvoC5Wt6NlUe07qxS/TFED6F+KBZvuim6c779o
-+sjaC+NCydAXFJy3SuCvkychVSa1ZC+N8f+mQAWFBVzKBxlcCxMoTFh/wqXvRdpg065lYZ1Tg3TC
-rvJcwhbtkj6EPnNgiLx29CzP0H1907he0ZESEOnN3col49XtmS++dYFLJPlFRpTJKSFTnCZFqhMX
-5OfNeOI5wSsSnqaeG8XmDtkx2Q==
------END CERTIFICATE-----
-
-Swisscom Root EV CA 2
-=====================
------BEGIN CERTIFICATE-----
-MIIF4DCCA8igAwIBAgIRAPL6ZOJ0Y9ON/RAdBB92ylgwDQYJKoZIhvcNAQELBQAwZzELMAkGA1UE
-BhMCY2gxETAPBgNVBAoTCFN3aXNzY29tMSUwIwYDVQQLExxEaWdpdGFsIENlcnRpZmljYXRlIFNl
-cnZpY2VzMR4wHAYDVQQDExVTd2lzc2NvbSBSb290IEVWIENBIDIwHhcNMTEwNjI0MDk0NTA4WhcN
-MzEwNjI1MDg0NTA4WjBnMQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsT
-HERpZ2l0YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxHjAcBgNVBAMTFVN3aXNzY29tIFJvb3QgRVYg
-Q0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMT3HS9X6lds93BdY7BxUglgRCgz
-o3pOCvrY6myLURYaVa5UJsTMRQdBTxB5f3HSek4/OE6zAMaVylvNwSqD1ycfMQ4jFrclyxy0uYAy
-Xhqdk/HoPGAsp15XGVhRXrwsVgu42O+LgrQ8uMIkqBPHoCE2G3pXKSinLr9xJZDzRINpUKTk4Rti
-GZQJo/PDvO/0vezbE53PnUgJUmfANykRHvvSEaeFGHR55E+FFOtSN+KxRdjMDUN/rhPSays/p8Li
-qG12W0OfvrSdsyaGOx9/5fLoZigWJdBLlzin5M8J0TbDC77aO0RYjb7xnglrPvMyxyuHxuxenPaH
-Za0zKcQvidm5y8kDnftslFGXEBuGCxobP/YCfnvUxVFkKJ3106yDgYjTdLRZncHrYTNaRdHLOdAG
-alNgHa/2+2m8atwBz735j9m9W8E6X47aD0upm50qKGsaCnw8qyIL5XctcfaCNYGu+HuB5ur+rPQa
-m3Rc6I8k9l2dRsQs0h4rIWqDJ2dVSqTjyDKXZpBy2uPUZC5f46Fq9mDU5zXNysRojddxyNMkM3Ox
-bPlq4SjbX8Y96L5V5jcb7STZDxmPX2MYWFCBUWVv8p9+agTnNCRxunZLWB4ZvRVgRaoMEkABnRDi
-xzgHcgplwLa7JSnaFp6LNYth7eVxV4O1PHGf40+/fh6Bn0GXAgMBAAGjgYYwgYMwDgYDVR0PAQH/
-BAQDAgGGMB0GA1UdIQQWMBQwEgYHYIV0AVMCAgYHYIV0AVMCAjASBgNVHRMBAf8ECDAGAQH/AgED
-MB0GA1UdDgQWBBRF2aWBbj2ITY1x0kbBbkUe88SAnTAfBgNVHSMEGDAWgBRF2aWBbj2ITY1x0kbB
-bkUe88SAnTANBgkqhkiG9w0BAQsFAAOCAgEAlDpzBp9SSzBc1P6xXCX5145v9Ydkn+0UjrgEjihL
-j6p7jjm02Vj2e6E1CqGdivdj5eu9OYLU43otb98TPLr+flaYC/NUn81ETm484T4VvwYmneTwkLbU
-wp4wLh/vx3rEUMfqe9pQy3omywC0Wqu1kx+AiYQElY2NfwmTv9SoqORjbdlk5LgpWgi/UOGED1V7
-XwgiG/W9mR4U9s70WBCCswo9GcG/W6uqmdjyMb3lOGbcWAXH7WMaLgqXfIeTK7KK4/HsGOV1timH
-59yLGn602MnTihdsfSlEvoqq9X46Lmgxk7lq2prg2+kupYTNHAq4Sgj5nPFhJpiTt3tm7JFe3VE/
-23MPrQRYCd0EApUKPtN236YQHoA96M2kZNEzx5LH4k5E4wnJTsJdhw4Snr8PyQUQ3nqjsTzyP6Wq
-J3mtMX0f/fwZacXduT98zca0wjAefm6S139hdlqP65VNvBFuIXxZN5nQBrz5Bm0yFqXZaajh3DyA
-HmBR3NdUIR7KYndP+tiPsys6DXhyyWhBWkdKwqPrGtcKqzwyVcgKEZzfdNbwQBUdyLmPtTbFr/gi
-uMod89a2GQ+fYWVq6nTIfI/DT11lgh/ZDYnadXL77/FHZxOzyNEZiCcmmpl5fx7kLD977vHeTYuW
-l8PVP3wbI+2ksx0WckNLIOFZfsLorSa/ovc=
------END CERTIFICATE-----
-
-CA Disig Root R1
-================
------BEGIN CERTIFICATE-----
-MIIFaTCCA1GgAwIBAgIJAMMDmu5QkG4oMA0GCSqGSIb3DQEBBQUAMFIxCzAJBgNVBAYTAlNLMRMw
-EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp
-ZyBSb290IFIxMB4XDTEyMDcxOTA5MDY1NloXDTQyMDcxOTA5MDY1NlowUjELMAkGA1UEBhMCU0sx
-EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp
-c2lnIFJvb3QgUjEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCqw3j33Jijp1pedxiy
-3QRkD2P9m5YJgNXoqqXinCaUOuiZc4yd39ffg/N4T0Dhf9Kn0uXKE5Pn7cZ3Xza1lK/oOI7bm+V8
-u8yN63Vz4STN5qctGS7Y1oprFOsIYgrY3LMATcMjfF9DCCMyEtztDK3AfQ+lekLZWnDZv6fXARz2
-m6uOt0qGeKAeVjGu74IKgEH3G8muqzIm1Cxr7X1r5OJeIgpFy4QxTaz+29FHuvlglzmxZcfe+5nk
-CiKxLU3lSCZpq+Kq8/v8kiky6bM+TR8noc2OuRf7JT7JbvN32g0S9l3HuzYQ1VTW8+DiR0jm3hTa
-YVKvJrT1cU/J19IG32PK/yHoWQbgCNWEFVP3Q+V8xaCJmGtzxmjOZd69fwX3se72V6FglcXM6pM6
-vpmumwKjrckWtc7dXpl4fho5frLABaTAgqWjR56M6ly2vGfb5ipN0gTco65F97yLnByn1tUD3AjL
-LhbKXEAz6GfDLuemROoRRRw1ZS0eRWEkG4IupZ0zXWX4Qfkuy5Q/H6MMMSRE7cderVC6xkGbrPAX
-ZcD4XW9boAo0PO7X6oifmPmvTiT6l7Jkdtqr9O3jw2Dv1fkCyC2fg69naQanMVXVz0tv/wQFx1is
-XxYb5dKj6zHbHzMVTdDypVP1y+E9Tmgt2BLdqvLmTZtJ5cUoobqwWsagtQIDAQABo0IwQDAPBgNV
-HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUiQq0OJMa5qvum5EY+fU8PjXQ
-04IwDQYJKoZIhvcNAQEFBQADggIBADKL9p1Kyb4U5YysOMo6CdQbzoaz3evUuii+Eq5FLAR0rBNR
-xVgYZk2C2tXck8An4b58n1KeElb21Zyp9HWc+jcSjxyT7Ff+Bw+r1RL3D65hXlaASfX8MPWbTx9B
-LxyE04nH4toCdu0Jz2zBuByDHBb6lM19oMgY0sidbvW9adRtPTXoHqJPYNcHKfyyo6SdbhWSVhlM
-CrDpfNIZTUJG7L399ldb3Zh+pE3McgODWF3vkzpBemOqfDqo9ayk0d2iLbYq/J8BjuIQscTK5Gfb
-VSUZP/3oNn6z4eGBrxEWi1CXYBmCAMBrTXO40RMHPuq2MU/wQppt4hF05ZSsjYSVPCGvxdpHyN85
-YmLLW1AL14FABZyb7bq2ix4Eb5YgOe2kfSnbSM6C3NQCjR0EMVrHS/BsYVLXtFHCgWzN4funodKS
-ds+xDzdYpPJScWc/DIh4gInByLUfkmO+p3qKViwaqKactV2zY9ATIKHrkWzQjX2v3wvkF7mGnjix
-lAxYjOBVqjtjbZqJYLhkKpLGN/R+Q0O3c+gB53+XD9fyexn9GtePyfqFa3qdnom2piiZk4hA9z7N
-UaPK6u95RyG1/jLix8NRb76AdPCkwzryT+lf3xkK8jsTQ6wxpLPn6/wY1gGp8yqPNg7rtLG8t0zJ
-a7+h89n07eLw4+1knj0vllJPgFOL
------END CERTIFICATE-----
-
-CA Disig Root R2
-================
------BEGIN CERTIFICATE-----
-MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNVBAYTAlNLMRMw
-EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp
-ZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQyMDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sx
-EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp
-c2lnIFJvb3QgUjIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbC
-w3OeNcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNHPWSb6Wia
-xswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3Ix2ymrdMxp7zo5eFm1tL7
-A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbeQTg06ov80egEFGEtQX6sx3dOy1FU+16S
-GBsEWmjGycT6txOgmLcRK7fWV8x8nhfRyyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqV
-g8NTEQxzHQuyRpDRQjrOQG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa
-5Beny912H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJQfYE
-koopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUDi/ZnWejBBhG93c+A
-Ak9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORsnLMOPReisjQS1n6yqEm70XooQL6i
-Fh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNV
-HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5u
-Qu0wDQYJKoZIhvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM
-tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqfGopTpti72TVV
-sRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkblvdhuDvEK7Z4bLQjb/D907Je
-dR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka+elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W8
-1k/BfDxujRNt+3vrMNDcTa/F1balTFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjx
-mHHEt38OFdAlab0inSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01
-utI3gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18DrG5gPcFw0
-sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3OszMOl6W8KjptlwlCFtaOg
-UxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8xL4ysEr3vQCj8KWefshNPZiTEUxnpHikV
-7+ZtsH8tZ/3zbBt1RqPlShfppNcL
------END CERTIFICATE-----
-
-ACCVRAIZ1
-=========
------BEGIN CERTIFICATE-----
-MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UEAwwJQUNDVlJB
-SVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQswCQYDVQQGEwJFUzAeFw0xMTA1
-MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQBgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwH
-UEtJQUNDVjENMAsGA1UECgwEQUNDVjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4IC
-DwAwggIKAoICAQCbqau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gM
-jmoYHtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWoG2ioPej0
-RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpAlHPrzg5XPAOBOp0KoVdD
-aaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhrIA8wKFSVf+DuzgpmndFALW4ir50awQUZ
-0m/A8p/4e7MCQvtQqR0tkw8jq8bBD5L/0KIV9VMJcRz/RROE5iZe+OCIHAr8Fraocwa48GOEAqDG
-WuzndN9wrqODJerWx5eHk6fGioozl2A3ED6XPm4pFdahD9GILBKfb6qkxkLrQaLjlUPTAYVtjrs7
-8yM2x/474KElB0iryYl0/wiPgL/AlmXz7uxLaL2diMMxs0Dx6M/2OLuc5NF/1OVYm3z61PMOm3WR
-5LpSLhl+0fXNWhn8ugb2+1KoS5kE3fj5tItQo05iifCHJPqDQsGH+tUtKSpacXpkatcnYGMN285J
-9Y0fkIkyF/hzQ7jSWpOGYdbhdQrqeWZ2iE9x6wQl1gpaepPluUsXQA+xtrn13k/c4LOsOxFwYIRK
-Q26ZIMApcQrAZQIDAQABo4ICyzCCAscwfQYIKwYBBQUHAQEEcTBvMEwGCCsGAQUFBzAChkBodHRw
-Oi8vd3d3LmFjY3YuZXMvZmlsZWFkbWluL0FyY2hpdm9zL2NlcnRpZmljYWRvcy9yYWl6YWNjdjEu
-Y3J0MB8GCCsGAQUFBzABhhNodHRwOi8vb2NzcC5hY2N2LmVzMB0GA1UdDgQWBBTSh7Tj3zcnk1X2
-VuqB5TbMjB4/vTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNKHtOPfNyeTVfZW6oHlNsyM
-Hj+9MIIBcwYDVR0gBIIBajCCAWYwggFiBgRVHSAAMIIBWDCCASIGCCsGAQUFBwICMIIBFB6CARAA
-QQB1AHQAbwByAGkAZABhAGQAIABkAGUAIABDAGUAcgB0AGkAZgBpAGMAYQBjAGkA8wBuACAAUgBh
-AO0AegAgAGQAZQAgAGwAYQAgAEEAQwBDAFYAIAAoAEEAZwBlAG4AYwBpAGEAIABkAGUAIABUAGUA
-YwBuAG8AbABvAGcA7QBhACAAeQAgAEMAZQByAHQAaQBmAGkAYwBhAGMAaQDzAG4AIABFAGwAZQBj
-AHQAcgDzAG4AaQBjAGEALAAgAEMASQBGACAAUQA0ADYAMAAxADEANQA2AEUAKQAuACAAQwBQAFMA
-IABlAG4AIABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBjAGMAdgAuAGUAczAwBggrBgEFBQcCARYk
-aHR0cDovL3d3dy5hY2N2LmVzL2xlZ2lzbGFjaW9uX2MuaHRtMFUGA1UdHwROMEwwSqBIoEaGRGh0
-dHA6Ly93d3cuYWNjdi5lcy9maWxlYWRtaW4vQXJjaGl2b3MvY2VydGlmaWNhZG9zL3JhaXphY2N2
-MV9kZXIuY3JsMA4GA1UdDwEB/wQEAwIBBjAXBgNVHREEEDAOgQxhY2N2QGFjY3YuZXMwDQYJKoZI
-hvcNAQEFBQADggIBAJcxAp/n/UNnSEQU5CmH7UwoZtCPNdpNYbdKl02125DgBS4OxnnQ8pdpD70E
-R9m+27Up2pvZrqmZ1dM8MJP1jaGo/AaNRPTKFpV8M9xii6g3+CfYCS0b78gUJyCpZET/LtZ1qmxN
-YEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+mAM/EKXMRNt6GGT6d7hmKG9Ww7Y49
-nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepDvV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJ
-TS+xJlsndQAJxGJ3KQhfnlmstn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3
-sCPdK6jT2iWH7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h
-I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szAh1xA2syVP1Xg
-Nce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xFd3+YJ5oyXSrjhO7FmGYvliAd
-3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2HpPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3p
-EfbRD0tVNEYqi4Y7
------END CERTIFICATE-----
-
-TWCA Global Root CA
-===================
------BEGIN CERTIFICATE-----
-MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcxEjAQBgNVBAoT
-CVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMTVFdDQSBHbG9iYWwgUm9vdCBD
-QTAeFw0xMjA2MjcwNjI4MzNaFw0zMDEyMzExNTU5NTlaMFExCzAJBgNVBAYTAlRXMRIwEAYDVQQK
-EwlUQUlXQU4tQ0ExEDAOBgNVBAsTB1Jvb3QgQ0ExHDAaBgNVBAMTE1RXQ0EgR2xvYmFsIFJvb3Qg
-Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCwBdvI64zEbooh745NnHEKH1Jw7W2C
-nJfF10xORUnLQEK1EjRsGcJ0pDFfhQKX7EMzClPSnIyOt7h52yvVavKOZsTuKwEHktSz0ALfUPZV
-r2YOy+BHYC8rMjk1Ujoog/h7FsYYuGLWRyWRzvAZEk2tY/XTP3VfKfChMBwqoJimFb3u/Rk28OKR
-Q4/6ytYQJ0lM793B8YVwm8rqqFpD/G2Gb3PpN0Wp8DbHzIh1HrtsBv+baz4X7GGqcXzGHaL3SekV
-tTzWoWH1EfcFbx39Eb7QMAfCKbAJTibc46KokWofwpFFiFzlmLhxpRUZyXx1EcxwdE8tmx2RRP1W
-KKD+u4ZqyPpcC1jcxkt2yKsi2XMPpfRaAok/T54igu6idFMqPVMnaR1sjjIsZAAmY2E2TqNGtz99
-sy2sbZCilaLOz9qC5wc0GZbpuCGqKX6mOL6OKUohZnkfs8O1CWfe1tQHRvMq2uYiN2DLgbYPoA/p
-yJV/v1WRBXrPPRXAb94JlAGD1zQbzECl8LibZ9WYkTunhHiVJqRaCPgrdLQABDzfuBSO6N+pjWxn
-kjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcEqYSjMq+u7msXi7Kx/mzhkIyIqJdI
-zshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMC
-AQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6g
-cFGn90xHNcgL1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn
-LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WFH6vPNOw/KP4M
-8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNoRI2T9GRwoD2dKAXDOXC4Ynsg
-/eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlg
-lPx4mI88k1HtQJAH32RjJMtOcQWh15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryP
-A9gK8kxkRr05YuWW6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3m
-i4TWnsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5jwa19hAM8
-EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWzaGHQRiapIVJpLesux+t3
-zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmyKwbQBM0=
------END CERTIFICATE-----
-
-TeliaSonera Root CA v1
-======================
------BEGIN CERTIFICATE-----
-MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAwNzEUMBIGA1UE
-CgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJvb3QgQ0EgdjEwHhcNMDcxMDE4
-MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYDVQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwW
-VGVsaWFTb25lcmEgUm9vdCBDQSB2MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+
-6yfwIaPzaSZVfp3FVRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA
-3GV17CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+XZ75Ljo1k
-B1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+/jXh7VB7qTCNGdMJjmhn
-Xb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs81Mt8Bz17Ww5OXOAFshSsCPN4D7c3TxH
-oLs1iuKYaIu+5b9y7tL6pe0S7fyYGKkmdtwoSxAgHNN/Fnct7W+A90m7UwW7XWjH1Mh1Fj+JWov3
-F0fUTPHSiXk+TT2YqGHeOh7S+F4D4MHJHIzTjU3TlTazN19jY5szFPAtJmtTfImMMsJu7D0hADnJ
-oWjiUIMusDor8zagrC/kb2HCUQk5PotTubtn2txTuXZZNp1D5SDgPTJghSJRt8czu90VL6R4pgd7
-gUY2BIbdeTXHlSw7sKMXNeVzH7RcWe/a6hBle3rQf5+ztCo3O3CLm1u5K7fsslESl1MpWtTwEhDc
-TwK7EpIvYtQ/aUN8Ddb8WHUBiJ1YFkveupD/RwGJBmr2X7KQarMCpgKIv7NHfirZ1fpoeDVNAgMB
-AAGjPzA9MA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qW
-DNXr+nuqF+gTEjANBgkqhkiG9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNm
-zqjMDfz1mgbldxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx
-0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1TjTQpgcmLNkQfW
-pb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBedY2gea+zDTYa4EzAvXUYNR0PV
-G6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpc
-c41teyWRyu5FrgZLAMzTsVlQ2jqIOylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOT
-JsjrDNYmiLbAJM+7vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2
-qReWt88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcnHL/EVlP6
-Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems
-WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY=
------END CERTIFICATE-----
-
-E-Tugra Certification Authority
-===============================
------BEGIN CERTIFICATE-----
-MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w
-DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls
-ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN
-ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMw
-NTEyMDk0OFoXDTIzMDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmEx
-QDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxl
-cmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQD
-DB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A
-MIICCgKCAgEA4vU/kwVRHoViVF56C/UYB4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vd
-hQd2h8y/L5VMzH2nPbxHD5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5K
-CKpbknSFQ9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEoq1+g
-ElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3Dk14opz8n8Y4e0ypQ
-BaNV2cvnOVPAmJ6MVGKLJrD3fY185MaeZkJVgkfnsliNZvcHfC425lAcP9tDJMW/hkd5s3kc91r0
-E+xs+D/iWR+V7kI+ua2oMoVJl0b+SzGPWsutdEcf6ZG33ygEIqDUD13ieU/qbIWGvaimzuT6w+Gz
-rt48Ue7LE3wBf4QOXVGUnhMMti6lTPk5cDZvlsouDERVxcr6XQKj39ZkjFqzAQqptQpHF//vkUAq
-jqFGOjGY5RH8zLtJVor8udBhmm9lbObDyz51Sf6Pp+KJxWfXnUYTTjF2OySznhFlhqt/7x3U+Lzn
-rFpct1pHXFXOVbQicVtbC/DP3KBhZOqp12gKY6fgDT+gr9Oq0n7vUaDmUStVkhUXU8u3Zg5mTPj5
-dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6Jyr+zE7S6E5UMA8GA1UdEwEB
-/wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEG
-MA0GCSqGSIb3DQEBCwUAA4ICAQAFNzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAK
-kEh47U6YA5n+KGCRHTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jO
-XKqYGwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c77NCR807
-VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3+GbHeJAAFS6LrVE1Uweo
-a2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WKvJUawSg5TB9D0pH0clmKuVb8P7Sd2nCc
-dlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEV
-KV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gT
-Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0
-8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G
-C7TbO6Orb1wdtn7os4I07QZcJA==
------END CERTIFICATE-----
-
-T-TeleSec GlobalRoot Class 2
-============================
------BEGIN CERTIFICATE-----
-MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM
-IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU
-cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgx
-MDAxMTA0MDE0WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz
-dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD
-ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0GCSqGSIb3
-DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUdAqSzm1nzHoqvNK38DcLZ
-SBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiCFoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/F
-vudocP05l03Sx5iRUKrERLMjfTlH6VJi1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx970
-2cu+fjOlbpSD8DT6IavqjnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGV
-WOHAD3bZwI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGjQjBA
-MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/WSA2AHmgoCJrjNXy
-YdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhyNsZt+U2e+iKo4YFWz827n+qrkRk4
-r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPACuvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNf
-vNoBYimipidx5joifsFvHZVwIEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR
-3p1m0IvVVGb6g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN
-9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg==
------END CERTIFICATE-----
-
-Atos TrustedRoot 2011
-=====================
------BEGIN CERTIFICATE-----
-MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UEAwwVQXRvcyBU
-cnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQGEwJERTAeFw0xMTA3MDcxNDU4
-MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMMFUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsG
-A1UECgwEQXRvczELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCV
-hTuXbyo7LjvPpvMpNb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr
-54rMVD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+SZFhyBH+
-DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ4J7sVaE3IqKHBAUsR320
-HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0Lcp2AMBYHlT8oDv3FdU9T1nSatCQujgKR
-z3bFmx5VdJx4IbHwLfELn8LVlhgf8FQieowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7R
-l+lwrrw7GWzbITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZ
-bNshMBgGA1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB
-CwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8jvZfza1zv7v1Apt+h
-k6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kPDpFrdRbhIfzYJsdHt6bPWHJxfrrh
-TZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pcmaHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a9
-61qn8FYiqTxlVMYVqL2Gns2Dlmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G
-3mB/ufNPRJLvKrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed
------END CERTIFICATE-----
-
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/StaticClient.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/StaticClient.php
deleted file mode 100644
index dbd4c18..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/StaticClient.php
+++ /dev/null
@@ -1,157 +0,0 @@
-createRequest($method, $url, null, null, $options);
-
- if (isset($options['stream'])) {
- if ($options['stream'] instanceof StreamRequestFactoryInterface) {
- return $options['stream']->fromRequest($request);
- } elseif ($options['stream'] == true) {
- $streamFactory = new PhpStreamRequestFactory();
- return $streamFactory->fromRequest($request);
- }
- }
-
- return $request->send();
- }
-
- /**
- * Send a GET request
- *
- * @param string $url URL of the request
- * @param array $options Array of request options
- *
- * @return \Guzzle\Http\Message\Response
- * @see Guzzle::request for a list of available options
- */
- public static function get($url, $options = array())
- {
- return self::request('GET', $url, $options);
- }
-
- /**
- * Send a HEAD request
- *
- * @param string $url URL of the request
- * @param array $options Array of request options
- *
- * @return \Guzzle\Http\Message\Response
- * @see Guzzle::request for a list of available options
- */
- public static function head($url, $options = array())
- {
- return self::request('HEAD', $url, $options);
- }
-
- /**
- * Send a DELETE request
- *
- * @param string $url URL of the request
- * @param array $options Array of request options
- *
- * @return \Guzzle\Http\Message\Response
- * @see Guzzle::request for a list of available options
- */
- public static function delete($url, $options = array())
- {
- return self::request('DELETE', $url, $options);
- }
-
- /**
- * Send a POST request
- *
- * @param string $url URL of the request
- * @param array $options Array of request options
- *
- * @return \Guzzle\Http\Message\Response
- * @see Guzzle::request for a list of available options
- */
- public static function post($url, $options = array())
- {
- return self::request('POST', $url, $options);
- }
-
- /**
- * Send a PUT request
- *
- * @param string $url URL of the request
- * @param array $options Array of request options
- *
- * @return \Guzzle\Http\Message\Response
- * @see Guzzle::request for a list of available options
- */
- public static function put($url, $options = array())
- {
- return self::request('PUT', $url, $options);
- }
-
- /**
- * Send a PATCH request
- *
- * @param string $url URL of the request
- * @param array $options Array of request options
- *
- * @return \Guzzle\Http\Message\Response
- * @see Guzzle::request for a list of available options
- */
- public static function patch($url, $options = array())
- {
- return self::request('PATCH', $url, $options);
- }
-
- /**
- * Send an OPTIONS request
- *
- * @param string $url URL of the request
- * @param array $options Array of request options
- *
- * @return \Guzzle\Http\Message\Response
- * @see Guzzle::request for a list of available options
- */
- public static function options($url, $options = array())
- {
- return self::request('OPTIONS', $url, $options);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Url.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Url.php
deleted file mode 100644
index 6a4e772..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/Url.php
+++ /dev/null
@@ -1,554 +0,0 @@
- null, 'host' => null, 'path' => null, 'port' => null, 'query' => null,
- 'user' => null, 'pass' => null, 'fragment' => null);
-
- if (false === ($parts = parse_url($url))) {
- throw new InvalidArgumentException('Was unable to parse malformed url: ' . $url);
- }
-
- $parts += $defaults;
-
- // Convert the query string into a QueryString object
- if ($parts['query'] || 0 !== strlen($parts['query'])) {
- $parts['query'] = QueryString::fromString($parts['query']);
- }
-
- return new static($parts['scheme'], $parts['host'], $parts['user'],
- $parts['pass'], $parts['port'], $parts['path'], $parts['query'],
- $parts['fragment']);
- }
-
- /**
- * Build a URL from parse_url parts. The generated URL will be a relative URL if a scheme or host are not provided.
- *
- * @param array $parts Array of parse_url parts
- *
- * @return string
- */
- public static function buildUrl(array $parts)
- {
- $url = $scheme = '';
-
- if (isset($parts['scheme'])) {
- $scheme = $parts['scheme'];
- $url .= $scheme . ':';
- }
-
- if (isset($parts['host'])) {
- $url .= '//';
- if (isset($parts['user'])) {
- $url .= $parts['user'];
- if (isset($parts['pass'])) {
- $url .= ':' . $parts['pass'];
- }
- $url .= '@';
- }
-
- $url .= $parts['host'];
-
- // Only include the port if it is not the default port of the scheme
- if (isset($parts['port'])
- && !(($scheme == 'http' && $parts['port'] == 80) || ($scheme == 'https' && $parts['port'] == 443))
- ) {
- $url .= ':' . $parts['port'];
- }
- }
-
- // Add the path component if present
- if (isset($parts['path']) && 0 !== strlen($parts['path'])) {
- // Always ensure that the path begins with '/' if set and something is before the path
- if ($url && $parts['path'][0] != '/' && substr($url, -1) != '/') {
- $url .= '/';
- }
- $url .= $parts['path'];
- }
-
- // Add the query string if present
- if (isset($parts['query'])) {
- $url .= '?' . $parts['query'];
- }
-
- // Ensure that # is only added to the url if fragment contains anything.
- if (isset($parts['fragment'])) {
- $url .= '#' . $parts['fragment'];
- }
-
- return $url;
- }
-
- /**
- * Create a new URL from URL parts
- *
- * @param string $scheme Scheme of the URL
- * @param string $host Host of the URL
- * @param string $username Username of the URL
- * @param string $password Password of the URL
- * @param int $port Port of the URL
- * @param string $path Path of the URL
- * @param QueryString|array|string $query Query string of the URL
- * @param string $fragment Fragment of the URL
- */
- public function __construct($scheme, $host, $username = null, $password = null, $port = null, $path = null, QueryString $query = null, $fragment = null)
- {
- $this->scheme = $scheme;
- $this->host = $host;
- $this->port = $port;
- $this->username = $username;
- $this->password = $password;
- $this->fragment = $fragment;
- if (!$query) {
- $this->query = new QueryString();
- } else {
- $this->setQuery($query);
- }
- $this->setPath($path);
- }
-
- /**
- * Clone the URL
- */
- public function __clone()
- {
- $this->query = clone $this->query;
- }
-
- /**
- * Returns the URL as a URL string
- *
- * @return string
- */
- public function __toString()
- {
- return self::buildUrl($this->getParts());
- }
-
- /**
- * Get the parts of the URL as an array
- *
- * @return array
- */
- public function getParts()
- {
- $query = (string) $this->query;
-
- return array(
- 'scheme' => $this->scheme,
- 'user' => $this->username,
- 'pass' => $this->password,
- 'host' => $this->host,
- 'port' => $this->port,
- 'path' => $this->getPath(),
- 'query' => $query !== '' ? $query : null,
- 'fragment' => $this->fragment,
- );
- }
-
- /**
- * Set the host of the request.
- *
- * @param string $host Host to set (e.g. www.yahoo.com, yahoo.com)
- *
- * @return Url
- */
- public function setHost($host)
- {
- if (strpos($host, ':') === false) {
- $this->host = $host;
- } else {
- list($host, $port) = explode(':', $host);
- $this->host = $host;
- $this->setPort($port);
- }
-
- return $this;
- }
-
- /**
- * Get the host part of the URL
- *
- * @return string
- */
- public function getHost()
- {
- return $this->host;
- }
-
- /**
- * Set the scheme part of the URL (http, https, ftp, etc)
- *
- * @param string $scheme Scheme to set
- *
- * @return Url
- */
- public function setScheme($scheme)
- {
- if ($this->scheme == 'http' && $this->port == 80) {
- $this->port = null;
- } elseif ($this->scheme == 'https' && $this->port == 443) {
- $this->port = null;
- }
-
- $this->scheme = $scheme;
-
- return $this;
- }
-
- /**
- * Get the scheme part of the URL
- *
- * @return string
- */
- public function getScheme()
- {
- return $this->scheme;
- }
-
- /**
- * Set the port part of the URL
- *
- * @param int $port Port to set
- *
- * @return Url
- */
- public function setPort($port)
- {
- $this->port = $port;
-
- return $this;
- }
-
- /**
- * Get the port part of the URl. Will return the default port for a given scheme if no port has been set.
- *
- * @return int|null
- */
- public function getPort()
- {
- if ($this->port) {
- return $this->port;
- } elseif ($this->scheme == 'http') {
- return 80;
- } elseif ($this->scheme == 'https') {
- return 443;
- }
-
- return null;
- }
-
- /**
- * Set the path part of the URL
- *
- * @param array|string $path Path string or array of path segments
- *
- * @return Url
- */
- public function setPath($path)
- {
- static $pathReplace = array(' ' => '%20', '?' => '%3F');
- if (is_array($path)) {
- $path = '/' . implode('/', $path);
- }
-
- $this->path = strtr($path, $pathReplace);
-
- return $this;
- }
-
- /**
- * Normalize the URL so that double slashes and relative paths are removed
- *
- * @return Url
- */
- public function normalizePath()
- {
- if (!$this->path || $this->path == '/' || $this->path == '*') {
- return $this;
- }
-
- $results = array();
- $segments = $this->getPathSegments();
- foreach ($segments as $segment) {
- if ($segment == '..') {
- array_pop($results);
- } elseif ($segment != '.' && $segment != '') {
- $results[] = $segment;
- }
- }
-
- // Combine the normalized parts and add the leading slash if needed
- $this->path = ($this->path[0] == '/' ? '/' : '') . implode('/', $results);
-
- // Add the trailing slash if necessary
- if ($this->path != '/' && end($segments) == '') {
- $this->path .= '/';
- }
-
- return $this;
- }
-
- /**
- * Add a relative path to the currently set path.
- *
- * @param string $relativePath Relative path to add
- *
- * @return Url
- */
- public function addPath($relativePath)
- {
- if ($relativePath != '/' && is_string($relativePath) && strlen($relativePath) > 0) {
- // Add a leading slash if needed
- if ($relativePath[0] != '/') {
- $relativePath = '/' . $relativePath;
- }
- $this->setPath(str_replace('//', '/', $this->path . $relativePath));
- }
-
- return $this;
- }
-
- /**
- * Get the path part of the URL
- *
- * @return string
- */
- public function getPath()
- {
- return $this->path;
- }
-
- /**
- * Get the path segments of the URL as an array
- *
- * @return array
- */
- public function getPathSegments()
- {
- return array_slice(explode('/', $this->getPath()), 1);
- }
-
- /**
- * Set the password part of the URL
- *
- * @param string $password Password to set
- *
- * @return Url
- */
- public function setPassword($password)
- {
- $this->password = $password;
-
- return $this;
- }
-
- /**
- * Get the password part of the URL
- *
- * @return null|string
- */
- public function getPassword()
- {
- return $this->password;
- }
-
- /**
- * Set the username part of the URL
- *
- * @param string $username Username to set
- *
- * @return Url
- */
- public function setUsername($username)
- {
- $this->username = $username;
-
- return $this;
- }
-
- /**
- * Get the username part of the URl
- *
- * @return null|string
- */
- public function getUsername()
- {
- return $this->username;
- }
-
- /**
- * Get the query part of the URL as a QueryString object
- *
- * @return QueryString
- */
- public function getQuery()
- {
- return $this->query;
- }
-
- /**
- * Set the query part of the URL
- *
- * @param QueryString|string|array $query Query to set
- *
- * @return Url
- */
- public function setQuery($query)
- {
- if (is_string($query)) {
- $output = null;
- parse_str($query, $output);
- $this->query = new QueryString($output);
- } elseif (is_array($query)) {
- $this->query = new QueryString($query);
- } elseif ($query instanceof QueryString) {
- $this->query = $query;
- }
-
- return $this;
- }
-
- /**
- * Get the fragment part of the URL
- *
- * @return null|string
- */
- public function getFragment()
- {
- return $this->fragment;
- }
-
- /**
- * Set the fragment part of the URL
- *
- * @param string $fragment Fragment to set
- *
- * @return Url
- */
- public function setFragment($fragment)
- {
- $this->fragment = $fragment;
-
- return $this;
- }
-
- /**
- * Check if this is an absolute URL
- *
- * @return bool
- */
- public function isAbsolute()
- {
- return $this->scheme && $this->host;
- }
-
- /**
- * Combine the URL with another URL. Follows the rules specific in RFC 3986 section 5.4.
- *
- * @param string $url Relative URL to combine with
- * @param bool $strictRfc3986 Set to true to use strict RFC 3986 compliance when merging paths. When first
- * released, Guzzle used an incorrect algorithm for combining relative URL paths. In
- * order to not break users, we introduced this flag to allow the merging of URLs based
- * on strict RFC 3986 section 5.4.1. This means that "http://a.com/foo/baz" merged with
- * "bar" would become "http://a.com/foo/bar". When this value is set to false, it would
- * become "http://a.com/foo/baz/bar".
- * @return Url
- * @throws InvalidArgumentException
- * @link http://tools.ietf.org/html/rfc3986#section-5.4
- */
- public function combine($url, $strictRfc3986 = false)
- {
- $url = self::factory($url);
-
- // Use the more absolute URL as the base URL
- if (!$this->isAbsolute() && $url->isAbsolute()) {
- $url = $url->combine($this);
- }
-
- // Passing a URL with a scheme overrides everything
- if ($buffer = $url->getScheme()) {
- $this->scheme = $buffer;
- $this->host = $url->getHost();
- $this->port = $url->getPort();
- $this->username = $url->getUsername();
- $this->password = $url->getPassword();
- $this->path = $url->getPath();
- $this->query = $url->getQuery();
- $this->fragment = $url->getFragment();
- return $this;
- }
-
- // Setting a host overrides the entire rest of the URL
- if ($buffer = $url->getHost()) {
- $this->host = $buffer;
- $this->port = $url->getPort();
- $this->username = $url->getUsername();
- $this->password = $url->getPassword();
- $this->path = $url->getPath();
- $this->query = $url->getQuery();
- $this->fragment = $url->getFragment();
- return $this;
- }
-
- $path = $url->getPath();
- $query = $url->getQuery();
-
- if (!$path) {
- if (count($query)) {
- $this->addQuery($query, $strictRfc3986);
- }
- } else {
- if ($path[0] == '/') {
- $this->path = $path;
- } elseif ($strictRfc3986) {
- $this->path .= '/../' . $path;
- } else {
- $this->path .= '/' . $path;
- }
- $this->normalizePath();
- $this->addQuery($query, $strictRfc3986);
- }
-
- $this->fragment = $url->getFragment();
-
- return $this;
- }
-
- private function addQuery(QueryString $new, $strictRfc386)
- {
- if (!$strictRfc386) {
- $new->merge($this->query);
- }
-
- $this->query = $new;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/composer.json b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/composer.json
deleted file mode 100644
index 9384a5b..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Http/composer.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "name": "guzzle/http",
- "description": "HTTP libraries used by Guzzle",
- "homepage": "http://guzzlephp.org/",
- "keywords": ["http client", "http", "client", "Guzzle", "curl"],
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.3.2",
- "guzzle/common": "self.version",
- "guzzle/parser": "self.version",
- "guzzle/stream": "self.version"
- },
- "suggest": {
- "ext-curl": "*"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Http": "" }
- },
- "target-dir": "Guzzle/Http",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Inflection/Inflector.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Inflection/Inflector.php
deleted file mode 100644
index c699773..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Inflection/Inflector.php
+++ /dev/null
@@ -1,38 +0,0 @@
- array(),
- 'camel' => array()
- );
-
- /** @var int Max entries per cache */
- protected $maxCacheSize;
-
- /** @var InflectorInterface Decorated inflector */
- protected $decoratedInflector;
-
- /**
- * @param InflectorInterface $inflector Inflector being decorated
- * @param int $maxCacheSize Maximum number of cached items to hold per cache
- */
- public function __construct(InflectorInterface $inflector, $maxCacheSize = 500)
- {
- $this->decoratedInflector = $inflector;
- $this->maxCacheSize = $maxCacheSize;
- }
-
- public function snake($word)
- {
- if (!isset($this->cache['snake'][$word])) {
- $this->pruneCache('snake');
- $this->cache['snake'][$word] = $this->decoratedInflector->snake($word);
- }
-
- return $this->cache['snake'][$word];
- }
-
- /**
- * Converts strings from snake_case to upper CamelCase
- *
- * @param string $word Value to convert into upper CamelCase
- *
- * @return string
- */
- public function camel($word)
- {
- if (!isset($this->cache['camel'][$word])) {
- $this->pruneCache('camel');
- $this->cache['camel'][$word] = $this->decoratedInflector->camel($word);
- }
-
- return $this->cache['camel'][$word];
- }
-
- /**
- * Prune one of the named caches by removing 20% of the cache if it is full
- *
- * @param string $cache Type of cache to prune
- */
- protected function pruneCache($cache)
- {
- if (count($this->cache[$cache]) == $this->maxCacheSize) {
- $this->cache[$cache] = array_slice($this->cache[$cache], $this->maxCacheSize * 0.2);
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Inflection/PreComputedInflector.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Inflection/PreComputedInflector.php
deleted file mode 100644
index db37e4f..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Inflection/PreComputedInflector.php
+++ /dev/null
@@ -1,59 +0,0 @@
- array(),
- 'camel' => array()
- );
-
- /** @var InflectorInterface Decorated inflector */
- protected $decoratedInflector;
-
- /**
- * @param InflectorInterface $inflector Inflector being decorated
- * @param array $snake Hash of pre-computed camel to snake
- * @param array $camel Hash of pre-computed snake to camel
- * @param bool $mirror Mirror snake and camel reflections
- */
- public function __construct(InflectorInterface $inflector, array $snake = array(), array $camel = array(), $mirror = false)
- {
- if ($mirror) {
- $camel = array_merge(array_flip($snake), $camel);
- $snake = array_merge(array_flip($camel), $snake);
- }
-
- $this->decoratedInflector = $inflector;
- $this->mapping = array(
- 'snake' => $snake,
- 'camel' => $camel
- );
- }
-
- public function snake($word)
- {
- return isset($this->mapping['snake'][$word])
- ? $this->mapping['snake'][$word]
- : $this->decoratedInflector->snake($word);
- }
-
- /**
- * Converts strings from snake_case to upper CamelCase
- *
- * @param string $word Value to convert into upper CamelCase
- *
- * @return string
- */
- public function camel($word)
- {
- return isset($this->mapping['camel'][$word])
- ? $this->mapping['camel'][$word]
- : $this->decoratedInflector->camel($word);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Inflection/composer.json b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Inflection/composer.json
deleted file mode 100644
index 93f9e7b..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Inflection/composer.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "name": "guzzle/inflection",
- "description": "Guzzle inflection component",
- "homepage": "http://guzzlephp.org/",
- "keywords": ["inflection", "guzzle"],
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.3.2"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Inflection": "" }
- },
- "target-dir": "Guzzle/Inflection",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/AppendIterator.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/AppendIterator.php
deleted file mode 100644
index 1b6bd7e..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/AppendIterator.php
+++ /dev/null
@@ -1,19 +0,0 @@
-getArrayIterator()->append($iterator);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/ChunkedIterator.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/ChunkedIterator.php
deleted file mode 100644
index d76cdd4..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/ChunkedIterator.php
+++ /dev/null
@@ -1,56 +0,0 @@
-chunkSize = $chunkSize;
- }
-
- public function rewind()
- {
- parent::rewind();
- $this->next();
- }
-
- public function next()
- {
- $this->chunk = array();
- for ($i = 0; $i < $this->chunkSize && parent::valid(); $i++) {
- $this->chunk[] = parent::current();
- parent::next();
- }
- }
-
- public function current()
- {
- return $this->chunk;
- }
-
- public function valid()
- {
- return (bool) $this->chunk;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/FilterIterator.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/FilterIterator.php
deleted file mode 100644
index b103367..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/FilterIterator.php
+++ /dev/null
@@ -1,36 +0,0 @@
-callback = $callback;
- }
-
- public function accept()
- {
- return call_user_func($this->callback, $this->current());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/MapIterator.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/MapIterator.php
deleted file mode 100644
index 7e586bd..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/MapIterator.php
+++ /dev/null
@@ -1,34 +0,0 @@
-callback = $callback;
- }
-
- public function current()
- {
- return call_user_func($this->callback, parent::current());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/MethodProxyIterator.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/MethodProxyIterator.php
deleted file mode 100644
index de4ab03..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/MethodProxyIterator.php
+++ /dev/null
@@ -1,27 +0,0 @@
-getInnerIterator();
- while ($i instanceof \OuterIterator) {
- $i = $i->getInnerIterator();
- }
-
- return call_user_func_array(array($i, $name), $args);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/README.md b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/README.md
deleted file mode 100644
index 8bb7e08..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-Guzzle Iterator
-===============
-
-Provides useful Iterators and Iterator decorators
-
-- ChunkedIterator: Pulls out chunks from an inner iterator and yields the chunks as arrays
-- FilterIterator: Used when PHP 5.4's CallbackFilterIterator is not available
-- MapIterator: Maps values before yielding
-- MethodProxyIterator: Proxies missing method calls to the innermost iterator
-
-### Installing via Composer
-
-```bash
-# Install Composer
-curl -sS https://getcomposer.org/installer | php
-
-# Add Guzzle as a dependency
-php composer.phar require guzzle/iterator:~3.0
-```
-
-After installing, you need to require Composer's autoloader:
-
-```php
-require 'vendor/autoload.php';
-```
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/composer.json b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/composer.json
deleted file mode 100644
index ee17379..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Iterator/composer.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "guzzle/iterator",
- "description": "Provides helpful iterators and iterator decorators",
- "keywords": ["iterator", "guzzle"],
- "homepage": "http://guzzlephp.org/",
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.3.2",
- "guzzle/common": ">=2.8.0"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Iterator": "/" }
- },
- "target-dir": "Guzzle/Iterator",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/AbstractLogAdapter.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/AbstractLogAdapter.php
deleted file mode 100644
index 7f6271b..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/AbstractLogAdapter.php
+++ /dev/null
@@ -1,16 +0,0 @@
-log;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/ArrayLogAdapter.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/ArrayLogAdapter.php
deleted file mode 100644
index a70fc8d..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/ArrayLogAdapter.php
+++ /dev/null
@@ -1,34 +0,0 @@
-logs[] = array('message' => $message, 'priority' => $priority, 'extras' => $extras);
- }
-
- /**
- * Get logged entries
- *
- * @return array
- */
- public function getLogs()
- {
- return $this->logs;
- }
-
- /**
- * Clears logged entries
- */
- public function clearLogs()
- {
- $this->logs = array();
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/ClosureLogAdapter.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/ClosureLogAdapter.php
deleted file mode 100644
index d4bb73f..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/ClosureLogAdapter.php
+++ /dev/null
@@ -1,23 +0,0 @@
-log = $logObject;
- }
-
- public function log($message, $priority = LOG_INFO, $extras = array())
- {
- call_user_func($this->log, $message, $priority, $extras);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/LogAdapterInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/LogAdapterInterface.php
deleted file mode 100644
index d7ac4ea..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/LogAdapterInterface.php
+++ /dev/null
@@ -1,18 +0,0 @@
->>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{curl_stderr}";
- const SHORT_FORMAT = '[{ts}] "{method} {resource} {protocol}/{version}" {code}';
-
- /**
- * @var string Template used to format log messages
- */
- protected $template;
-
- /**
- * @param string $template Log message template
- */
- public function __construct($template = self::DEFAULT_FORMAT)
- {
- $this->template = $template ?: self::DEFAULT_FORMAT;
- }
-
- /**
- * Set the template to use for logging
- *
- * @param string $template Log message template
- *
- * @return self
- */
- public function setTemplate($template)
- {
- $this->template = $template;
-
- return $this;
- }
-
- /**
- * Returns a formatted message
- *
- * @param RequestInterface $request Request that was sent
- * @param Response $response Response that was received
- * @param CurlHandle $handle Curl handle associated with the message
- * @param array $customData Associative array of custom template data
- *
- * @return string
- */
- public function format(
- RequestInterface $request,
- Response $response = null,
- CurlHandle $handle = null,
- array $customData = array()
- ) {
- $cache = $customData;
-
- return preg_replace_callback(
- '/{\s*([A-Za-z_\-\.0-9]+)\s*}/',
- function (array $matches) use ($request, $response, $handle, &$cache) {
-
- if (array_key_exists($matches[1], $cache)) {
- return $cache[$matches[1]];
- }
-
- $result = '';
- switch ($matches[1]) {
- case 'request':
- $result = (string) $request;
- break;
- case 'response':
- $result = (string) $response;
- break;
- case 'req_body':
- $result = $request instanceof EntityEnclosingRequestInterface
- ? (string) $request->getBody() : '';
- break;
- case 'res_body':
- $result = $response ? $response->getBody(true) : '';
- break;
- case 'ts':
- $result = gmdate('c');
- break;
- case 'method':
- $result = $request->getMethod();
- break;
- case 'url':
- $result = (string) $request->getUrl();
- break;
- case 'resource':
- $result = $request->getResource();
- break;
- case 'protocol':
- $result = 'HTTP';
- break;
- case 'version':
- $result = $request->getProtocolVersion();
- break;
- case 'host':
- $result = $request->getHost();
- break;
- case 'hostname':
- $result = gethostname();
- break;
- case 'port':
- $result = $request->getPort();
- break;
- case 'code':
- $result = $response ? $response->getStatusCode() : '';
- break;
- case 'phrase':
- $result = $response ? $response->getReasonPhrase() : '';
- break;
- case 'connect_time':
- $result = $handle && $handle->getInfo(CURLINFO_CONNECT_TIME)
- ? $handle->getInfo(CURLINFO_CONNECT_TIME)
- : ($response ? $response->getInfo('connect_time') : '');
- break;
- case 'total_time':
- $result = $handle && $handle->getInfo(CURLINFO_TOTAL_TIME)
- ? $handle->getInfo(CURLINFO_TOTAL_TIME)
- : ($response ? $response->getInfo('total_time') : '');
- break;
- case 'curl_error':
- $result = $handle ? $handle->getError() : '';
- break;
- case 'curl_code':
- $result = $handle ? $handle->getErrorNo() : '';
- break;
- case 'curl_stderr':
- $result = $handle ? $handle->getStderr() : '';
- break;
- default:
- if (strpos($matches[1], 'req_header_') === 0) {
- $result = $request->getHeader(substr($matches[1], 11));
- } elseif ($response && strpos($matches[1], 'res_header_') === 0) {
- $result = $response->getHeader(substr($matches[1], 11));
- }
- }
-
- $cache[$matches[1]] = $result;
- return $result;
- },
- $this->template
- );
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/MonologLogAdapter.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/MonologLogAdapter.php
deleted file mode 100644
index 6afe7b6..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/MonologLogAdapter.php
+++ /dev/null
@@ -1,34 +0,0 @@
- Logger::DEBUG,
- LOG_INFO => Logger::INFO,
- LOG_WARNING => Logger::WARNING,
- LOG_ERR => Logger::ERROR,
- LOG_CRIT => Logger::CRITICAL,
- LOG_ALERT => Logger::ALERT
- );
-
- public function __construct(Logger $logObject)
- {
- $this->log = $logObject;
- }
-
- public function log($message, $priority = LOG_INFO, $extras = array())
- {
- $this->log->addRecord(self::$mapping[$priority], $message, $extras);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/PsrLogAdapter.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/PsrLogAdapter.php
deleted file mode 100644
index 38a2b60..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/PsrLogAdapter.php
+++ /dev/null
@@ -1,36 +0,0 @@
- LogLevel::DEBUG,
- LOG_INFO => LogLevel::INFO,
- LOG_WARNING => LogLevel::WARNING,
- LOG_ERR => LogLevel::ERROR,
- LOG_CRIT => LogLevel::CRITICAL,
- LOG_ALERT => LogLevel::ALERT
- );
-
- public function __construct(LoggerInterface $logObject)
- {
- $this->log = $logObject;
- }
-
- public function log($message, $priority = LOG_INFO, $extras = array())
- {
- $this->log->log(self::$mapping[$priority], $message, $extras);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/Zf1LogAdapter.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/Zf1LogAdapter.php
deleted file mode 100644
index 0ea8e3b..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/Zf1LogAdapter.php
+++ /dev/null
@@ -1,24 +0,0 @@
-log = $logObject;
- Version::warn(__CLASS__ . ' is deprecated');
- }
-
- public function log($message, $priority = LOG_INFO, $extras = array())
- {
- $this->log->log($message, $priority, $extras);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/Zf2LogAdapter.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/Zf2LogAdapter.php
deleted file mode 100644
index 863f6a1..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/Zf2LogAdapter.php
+++ /dev/null
@@ -1,21 +0,0 @@
-log = $logObject;
- }
-
- public function log($message, $priority = LOG_INFO, $extras = array())
- {
- $this->log->log($priority, $message, $extras);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/composer.json b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/composer.json
deleted file mode 100644
index a8213e8..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Log/composer.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "name": "guzzle/log",
- "description": "Guzzle log adapter component",
- "homepage": "http://guzzlephp.org/",
- "keywords": ["log", "adapter", "guzzle"],
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.3.2"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Log": "" }
- },
- "suggest": {
- "guzzle/http": "self.version"
- },
- "target-dir": "Guzzle/Log",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/Cookie/CookieParser.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/Cookie/CookieParser.php
deleted file mode 100644
index 4349eeb..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/Cookie/CookieParser.php
+++ /dev/null
@@ -1,131 +0,0 @@
- 'Domain',
- 'path' => 'Path',
- 'max_age' => 'Max-Age',
- 'expires' => 'Expires',
- 'version' => 'Version',
- 'secure' => 'Secure',
- 'port' => 'Port',
- 'discard' => 'Discard',
- 'comment' => 'Comment',
- 'comment_url' => 'Comment-Url',
- 'http_only' => 'HttpOnly'
- );
-
- public function parseCookie($cookie, $host = null, $path = null, $decode = false)
- {
- // Explode the cookie string using a series of semicolons
- $pieces = array_filter(array_map('trim', explode(';', $cookie)));
-
- // The name of the cookie (first kvp) must include an equal sign.
- if (empty($pieces) || !strpos($pieces[0], '=')) {
- return false;
- }
-
- // Create the default return array
- $data = array_merge(array_fill_keys(array_keys(self::$cookieParts), null), array(
- 'cookies' => array(),
- 'data' => array(),
- 'path' => null,
- 'http_only' => false,
- 'discard' => false,
- 'domain' => $host
- ));
- $foundNonCookies = 0;
-
- // Add the cookie pieces into the parsed data array
- foreach ($pieces as $part) {
-
- $cookieParts = explode('=', $part, 2);
- $key = trim($cookieParts[0]);
-
- if (count($cookieParts) == 1) {
- // Can be a single value (e.g. secure, httpOnly)
- $value = true;
- } else {
- // Be sure to strip wrapping quotes
- $value = trim($cookieParts[1], " \n\r\t\0\x0B\"");
- if ($decode) {
- $value = urldecode($value);
- }
- }
-
- // Only check for non-cookies when cookies have been found
- if (!empty($data['cookies'])) {
- foreach (self::$cookieParts as $mapValue => $search) {
- if (!strcasecmp($search, $key)) {
- $data[$mapValue] = $mapValue == 'port' ? array_map('trim', explode(',', $value)) : $value;
- $foundNonCookies++;
- continue 2;
- }
- }
- }
-
- // If cookies have not yet been retrieved, or this value was not found in the pieces array, treat it as a
- // cookie. IF non-cookies have been parsed, then this isn't a cookie, it's cookie data. Cookies then data.
- $data[$foundNonCookies ? 'data' : 'cookies'][$key] = $value;
- }
-
- // Calculate the expires date
- if (!$data['expires'] && $data['max_age']) {
- $data['expires'] = time() + (int) $data['max_age'];
- }
-
- // Check path attribute according RFC6265 http://tools.ietf.org/search/rfc6265#section-5.2.4
- // "If the attribute-value is empty or if the first character of the
- // attribute-value is not %x2F ("/"):
- // Let cookie-path be the default-path.
- // Otherwise:
- // Let cookie-path be the attribute-value."
- if (!$data['path'] || substr($data['path'], 0, 1) !== '/') {
- $data['path'] = $this->getDefaultPath($path);
- }
-
- return $data;
- }
-
- /**
- * Get default cookie path according to RFC 6265
- * http://tools.ietf.org/search/rfc6265#section-5.1.4 Paths and Path-Match
- *
- * @param string $path Request uri-path
- *
- * @return string
- */
- protected function getDefaultPath($path) {
- // "The user agent MUST use an algorithm equivalent to the following algorithm
- // to compute the default-path of a cookie:"
-
- // "2. If the uri-path is empty or if the first character of the uri-path is not
- // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps.
- if (empty($path) || substr($path, 0, 1) !== '/') {
- return '/';
- }
-
- // "3. If the uri-path contains no more than one %x2F ("/") character, output
- // %x2F ("/") and skip the remaining step."
- if ($path === "/") {
- return $path;
- }
-
- $rightSlashPos = strrpos($path, '/');
- if ($rightSlashPos === 0) {
- return "/";
- }
-
- // "4. Output the characters of the uri-path from the first character up to,
- // but not including, the right-most %x2F ("/")."
- return substr($path, 0, $rightSlashPos);
-
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/Cookie/CookieParserInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/Cookie/CookieParserInterface.php
deleted file mode 100644
index d21ffe2..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/Cookie/CookieParserInterface.php
+++ /dev/null
@@ -1,33 +0,0 @@
- $requestUrl,
- 'scheme' => 'http'
- );
-
- // Check for the Host header
- if (isset($parts['headers']['Host'])) {
- $urlParts['host'] = $parts['headers']['Host'];
- } elseif (isset($parts['headers']['host'])) {
- $urlParts['host'] = $parts['headers']['host'];
- } else {
- $urlParts['host'] = null;
- }
-
- if (false === strpos($urlParts['host'], ':')) {
- $urlParts['port'] = '';
- } else {
- $hostParts = explode(':', $urlParts['host']);
- $urlParts['host'] = trim($hostParts[0]);
- $urlParts['port'] = (int) trim($hostParts[1]);
- if ($urlParts['port'] == 443) {
- $urlParts['scheme'] = 'https';
- }
- }
-
- // Check if a query is present
- $path = $urlParts['path'];
- $qpos = strpos($path, '?');
- if ($qpos) {
- $urlParts['query'] = substr($path, $qpos + 1);
- $urlParts['path'] = substr($path, 0, $qpos);
- } else {
- $urlParts['query'] = '';
- }
-
- return $urlParts;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/Message/MessageParser.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/Message/MessageParser.php
deleted file mode 100644
index efc1aa3..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/Message/MessageParser.php
+++ /dev/null
@@ -1,110 +0,0 @@
-parseMessage($message);
-
- // Parse the protocol and protocol version
- if (isset($parts['start_line'][2])) {
- $startParts = explode('/', $parts['start_line'][2]);
- $protocol = strtoupper($startParts[0]);
- $version = isset($startParts[1]) ? $startParts[1] : '1.1';
- } else {
- $protocol = 'HTTP';
- $version = '1.1';
- }
-
- $parsed = array(
- 'method' => strtoupper($parts['start_line'][0]),
- 'protocol' => $protocol,
- 'version' => $version,
- 'headers' => $parts['headers'],
- 'body' => $parts['body']
- );
-
- $parsed['request_url'] = $this->getUrlPartsFromMessage(isset($parts['start_line'][1]) ? $parts['start_line'][1] : '' , $parsed);
-
- return $parsed;
- }
-
- public function parseResponse($message)
- {
- if (!$message) {
- return false;
- }
-
- $parts = $this->parseMessage($message);
- list($protocol, $version) = explode('/', trim($parts['start_line'][0]));
-
- return array(
- 'protocol' => $protocol,
- 'version' => $version,
- 'code' => $parts['start_line'][1],
- 'reason_phrase' => isset($parts['start_line'][2]) ? $parts['start_line'][2] : '',
- 'headers' => $parts['headers'],
- 'body' => $parts['body']
- );
- }
-
- /**
- * Parse a message into parts
- *
- * @param string $message Message to parse
- *
- * @return array
- */
- protected function parseMessage($message)
- {
- $startLine = null;
- $headers = array();
- $body = '';
-
- // Iterate over each line in the message, accounting for line endings
- $lines = preg_split('/(\\r?\\n)/', $message, -1, PREG_SPLIT_DELIM_CAPTURE);
- for ($i = 0, $totalLines = count($lines); $i < $totalLines; $i += 2) {
-
- $line = $lines[$i];
-
- // If two line breaks were encountered, then this is the end of body
- if (empty($line)) {
- if ($i < $totalLines - 1) {
- $body = implode('', array_slice($lines, $i + 2));
- }
- break;
- }
-
- // Parse message headers
- if (!$startLine) {
- $startLine = explode(' ', $line, 3);
- } elseif (strpos($line, ':')) {
- $parts = explode(':', $line, 2);
- $key = trim($parts[0]);
- $value = isset($parts[1]) ? trim($parts[1]) : '';
- if (!isset($headers[$key])) {
- $headers[$key] = $value;
- } elseif (!is_array($headers[$key])) {
- $headers[$key] = array($headers[$key], $value);
- } else {
- $headers[$key][] = $value;
- }
- }
- }
-
- return array(
- 'start_line' => $startLine,
- 'headers' => $headers,
- 'body' => $body
- );
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/Message/MessageParserInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/Message/MessageParserInterface.php
deleted file mode 100644
index cc44808..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/Message/MessageParserInterface.php
+++ /dev/null
@@ -1,27 +0,0 @@
- $parts->requestMethod,
- 'protocol' => 'HTTP',
- 'version' => number_format($parts->httpVersion, 1),
- 'headers' => $parts->headers,
- 'body' => $parts->body
- );
-
- $parsed['request_url'] = $this->getUrlPartsFromMessage($parts->requestUrl, $parsed);
-
- return $parsed;
- }
-
- public function parseResponse($message)
- {
- if (!$message) {
- return false;
- }
-
- $parts = http_parse_message($message);
-
- return array(
- 'protocol' => 'HTTP',
- 'version' => number_format($parts->httpVersion, 1),
- 'code' => $parts->responseCode,
- 'reason_phrase' => $parts->responseStatus,
- 'headers' => $parts->headers,
- 'body' => $parts->body
- );
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/ParserRegistry.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/ParserRegistry.php
deleted file mode 100644
index f838683..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/ParserRegistry.php
+++ /dev/null
@@ -1,75 +0,0 @@
- 'Guzzle\\Parser\\Message\\MessageParser',
- 'cookie' => 'Guzzle\\Parser\\Cookie\\CookieParser',
- 'url' => 'Guzzle\\Parser\\Url\\UrlParser',
- 'uri_template' => 'Guzzle\\Parser\\UriTemplate\\UriTemplate',
- );
-
- /**
- * @return self
- * @codeCoverageIgnore
- */
- public static function getInstance()
- {
- if (!self::$instance) {
- self::$instance = new static;
- }
-
- return self::$instance;
- }
-
- public function __construct()
- {
- // Use the PECL URI template parser if available
- if (extension_loaded('uri_template')) {
- $this->mapping['uri_template'] = 'Guzzle\\Parser\\UriTemplate\\PeclUriTemplate';
- }
- }
-
- /**
- * Get a parser by name from an instance
- *
- * @param string $name Name of the parser to retrieve
- *
- * @return mixed|null
- */
- public function getParser($name)
- {
- if (!isset($this->instances[$name])) {
- if (!isset($this->mapping[$name])) {
- return null;
- }
- $class = $this->mapping[$name];
- $this->instances[$name] = new $class();
- }
-
- return $this->instances[$name];
- }
-
- /**
- * Register a custom parser by name with the register
- *
- * @param string $name Name or handle of the parser to register
- * @param mixed $parser Instantiated parser to register
- */
- public function registerParser($name, $parser)
- {
- $this->instances[$name] = $parser;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/UriTemplate/PeclUriTemplate.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/UriTemplate/PeclUriTemplate.php
deleted file mode 100644
index b0764e8..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/UriTemplate/PeclUriTemplate.php
+++ /dev/null
@@ -1,26 +0,0 @@
- true, '#' => true, '.' => true, '/' => true, ';' => true, '?' => true, '&' => true
- );
-
- /** @var array Delimiters */
- private static $delims = array(
- ':', '/', '?', '#', '[', ']', '@', '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '='
- );
-
- /** @var array Percent encoded delimiters */
- private static $delimsPct = array(
- '%3A', '%2F', '%3F', '%23', '%5B', '%5D', '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C',
- '%3B', '%3D'
- );
-
- public function expand($template, array $variables)
- {
- if ($this->regex == self::DEFAULT_PATTERN && false === strpos($template, '{')) {
- return $template;
- }
-
- $this->template = $template;
- $this->variables = $variables;
-
- return preg_replace_callback($this->regex, array($this, 'expandMatch'), $this->template);
- }
-
- /**
- * Set the regex patten used to expand URI templates
- *
- * @param string $regexPattern
- */
- public function setRegex($regexPattern)
- {
- $this->regex = $regexPattern;
- }
-
- /**
- * Parse an expression into parts
- *
- * @param string $expression Expression to parse
- *
- * @return array Returns an associative array of parts
- */
- private function parseExpression($expression)
- {
- // Check for URI operators
- $operator = '';
-
- if (isset(self::$operatorHash[$expression[0]])) {
- $operator = $expression[0];
- $expression = substr($expression, 1);
- }
-
- $values = explode(',', $expression);
- foreach ($values as &$value) {
- $value = trim($value);
- $varspec = array();
- $substrPos = strpos($value, ':');
- if ($substrPos) {
- $varspec['value'] = substr($value, 0, $substrPos);
- $varspec['modifier'] = ':';
- $varspec['position'] = (int) substr($value, $substrPos + 1);
- } elseif (substr($value, -1) == '*') {
- $varspec['modifier'] = '*';
- $varspec['value'] = substr($value, 0, -1);
- } else {
- $varspec['value'] = (string) $value;
- $varspec['modifier'] = '';
- }
- $value = $varspec;
- }
-
- return array(
- 'operator' => $operator,
- 'values' => $values
- );
- }
-
- /**
- * Process an expansion
- *
- * @param array $matches Matches met in the preg_replace_callback
- *
- * @return string Returns the replacement string
- */
- private function expandMatch(array $matches)
- {
- static $rfc1738to3986 = array(
- '+' => '%20',
- '%7e' => '~'
- );
-
- $parsed = self::parseExpression($matches[1]);
- $replacements = array();
-
- $prefix = $parsed['operator'];
- $joiner = $parsed['operator'];
- $useQueryString = false;
- if ($parsed['operator'] == '?') {
- $joiner = '&';
- $useQueryString = true;
- } elseif ($parsed['operator'] == '&') {
- $useQueryString = true;
- } elseif ($parsed['operator'] == '#') {
- $joiner = ',';
- } elseif ($parsed['operator'] == ';') {
- $useQueryString = true;
- } elseif ($parsed['operator'] == '' || $parsed['operator'] == '+') {
- $joiner = ',';
- $prefix = '';
- }
-
- foreach ($parsed['values'] as $value) {
-
- if (!array_key_exists($value['value'], $this->variables) || $this->variables[$value['value']] === null) {
- continue;
- }
-
- $variable = $this->variables[$value['value']];
- $actuallyUseQueryString = $useQueryString;
- $expanded = '';
-
- if (is_array($variable)) {
-
- $isAssoc = $this->isAssoc($variable);
- $kvp = array();
- foreach ($variable as $key => $var) {
-
- if ($isAssoc) {
- $key = rawurlencode($key);
- $isNestedArray = is_array($var);
- } else {
- $isNestedArray = false;
- }
-
- if (!$isNestedArray) {
- $var = rawurlencode($var);
- if ($parsed['operator'] == '+' || $parsed['operator'] == '#') {
- $var = $this->decodeReserved($var);
- }
- }
-
- if ($value['modifier'] == '*') {
- if ($isAssoc) {
- if ($isNestedArray) {
- // Nested arrays must allow for deeply nested structures
- $var = strtr(http_build_query(array($key => $var)), $rfc1738to3986);
- } else {
- $var = $key . '=' . $var;
- }
- } elseif ($key > 0 && $actuallyUseQueryString) {
- $var = $value['value'] . '=' . $var;
- }
- }
-
- $kvp[$key] = $var;
- }
-
- if (empty($variable)) {
- $actuallyUseQueryString = false;
- } elseif ($value['modifier'] == '*') {
- $expanded = implode($joiner, $kvp);
- if ($isAssoc) {
- // Don't prepend the value name when using the explode modifier with an associative array
- $actuallyUseQueryString = false;
- }
- } else {
- if ($isAssoc) {
- // When an associative array is encountered and the explode modifier is not set, then the
- // result must be a comma separated list of keys followed by their respective values.
- foreach ($kvp as $k => &$v) {
- $v = $k . ',' . $v;
- }
- }
- $expanded = implode(',', $kvp);
- }
-
- } else {
- if ($value['modifier'] == ':') {
- $variable = substr($variable, 0, $value['position']);
- }
- $expanded = rawurlencode($variable);
- if ($parsed['operator'] == '+' || $parsed['operator'] == '#') {
- $expanded = $this->decodeReserved($expanded);
- }
- }
-
- if ($actuallyUseQueryString) {
- if (!$expanded && $joiner != '&') {
- $expanded = $value['value'];
- } else {
- $expanded = $value['value'] . '=' . $expanded;
- }
- }
-
- $replacements[] = $expanded;
- }
-
- $ret = implode($joiner, $replacements);
- if ($ret && $prefix) {
- return $prefix . $ret;
- }
-
- return $ret;
- }
-
- /**
- * Determines if an array is associative
- *
- * @param array $array Array to check
- *
- * @return bool
- */
- private function isAssoc(array $array)
- {
- return (bool) count(array_filter(array_keys($array), 'is_string'));
- }
-
- /**
- * Removes percent encoding on reserved characters (used with + and # modifiers)
- *
- * @param string $string String to fix
- *
- * @return string
- */
- private function decodeReserved($string)
- {
- return str_replace(self::$delimsPct, self::$delims, $string);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/UriTemplate/UriTemplateInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/UriTemplate/UriTemplateInterface.php
deleted file mode 100644
index c81d515..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/UriTemplate/UriTemplateInterface.php
+++ /dev/null
@@ -1,21 +0,0 @@
-utf8 = $utf8;
- }
-
- public function parseUrl($url)
- {
- Version::warn(__CLASS__ . ' is deprecated. Just use parse_url()');
-
- static $defaults = array('scheme' => null, 'host' => null, 'path' => null, 'port' => null, 'query' => null,
- 'user' => null, 'pass' => null, 'fragment' => null);
-
- $parts = parse_url($url);
-
- // Need to handle query parsing specially for UTF-8 requirements
- if ($this->utf8 && isset($parts['query'])) {
- $queryPos = strpos($url, '?');
- if (isset($parts['fragment'])) {
- $parts['query'] = substr($url, $queryPos + 1, strpos($url, '#') - $queryPos - 1);
- } else {
- $parts['query'] = substr($url, $queryPos + 1);
- }
- }
-
- return $parts + $defaults;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/Url/UrlParserInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/Url/UrlParserInterface.php
deleted file mode 100644
index 89ac4b3..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Parser/Url/UrlParserInterface.php
+++ /dev/null
@@ -1,19 +0,0 @@
-=5.3.2"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Parser": "" }
- },
- "target-dir": "Guzzle/Parser",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Async/AsyncPlugin.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Async/AsyncPlugin.php
deleted file mode 100644
index ae59418..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Async/AsyncPlugin.php
+++ /dev/null
@@ -1,84 +0,0 @@
- 'onBeforeSend',
- 'request.exception' => 'onRequestTimeout',
- 'request.sent' => 'onRequestSent',
- 'curl.callback.progress' => 'onCurlProgress'
- );
- }
-
- /**
- * Event used to ensure that progress callback are emitted from the curl handle's request mediator.
- *
- * @param Event $event
- */
- public function onBeforeSend(Event $event)
- {
- // Ensure that progress callbacks are dispatched
- $event['request']->getCurlOptions()->set('progress', true);
- }
-
- /**
- * Event emitted when a curl progress function is called. When the amount of data uploaded == the amount of data to
- * upload OR any bytes have been downloaded, then time the request out after 1ms because we're done with
- * transmitting the request, and tell curl not download a body.
- *
- * @param Event $event
- */
- public function onCurlProgress(Event $event)
- {
- if ($event['handle'] &&
- ($event['downloaded'] || (isset($event['uploaded']) && $event['upload_size'] === $event['uploaded']))
- ) {
- // Timeout after 1ms
- curl_setopt($event['handle'], CURLOPT_TIMEOUT_MS, 1);
- // Even if the response is quick, tell curl not to download the body.
- // - Note that we can only perform this shortcut if the request transmitted a body so as to ensure that the
- // request method is not converted to a HEAD request before the request was sent via curl.
- if ($event['uploaded']) {
- curl_setopt($event['handle'], CURLOPT_NOBODY, true);
- }
- }
- }
-
- /**
- * Event emitted when a curl exception occurs. Ignore the exception and set a mock response.
- *
- * @param Event $event
- */
- public function onRequestTimeout(Event $event)
- {
- if ($event['exception'] instanceof CurlException) {
- $event['request']->setResponse(new Response(200, array(
- 'X-Guzzle-Async' => 'Did not wait for the response'
- )));
- }
- }
-
- /**
- * Event emitted when a request completes because it took less than 1ms. Add an X-Guzzle-Async header to notify the
- * caller that there is no body in the message.
- *
- * @param Event $event
- */
- public function onRequestSent(Event $event)
- {
- // Let the caller know this was meant to be async
- $event['request']->getResponse()->setHeader('X-Guzzle-Async', 'Did not wait for the response');
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Async/composer.json b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Async/composer.json
deleted file mode 100644
index dc3fc5b..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Async/composer.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "guzzle/plugin-async",
- "description": "Guzzle async request plugin",
- "homepage": "http://guzzlephp.org/",
- "keywords": ["plugin", "guzzle"],
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.3.2",
- "guzzle/http": "self.version"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Plugin\\Async": "" }
- },
- "target-dir": "Guzzle/Plugin/Async",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/AbstractBackoffStrategy.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/AbstractBackoffStrategy.php
deleted file mode 100644
index 0a85983..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/AbstractBackoffStrategy.php
+++ /dev/null
@@ -1,91 +0,0 @@
-next = $next;
- }
-
- /**
- * Get the next backoff strategy in the chain
- *
- * @return AbstractBackoffStrategy|null
- */
- public function getNext()
- {
- return $this->next;
- }
-
- public function getBackoffPeriod(
- $retries,
- RequestInterface $request,
- Response $response = null,
- HttpException $e = null
- ) {
- $delay = $this->getDelay($retries, $request, $response, $e);
- if ($delay === false) {
- // The strategy knows that this must not be retried
- return false;
- } elseif ($delay === null) {
- // If the strategy is deferring a decision and the next strategy will not make a decision then return false
- return !$this->next || !$this->next->makesDecision()
- ? false
- : $this->next->getBackoffPeriod($retries, $request, $response, $e);
- } elseif ($delay === true) {
- // if the strategy knows that it must retry but is deferring to the next to determine the delay
- if (!$this->next) {
- return 0;
- } else {
- $next = $this->next;
- while ($next->makesDecision() && $next->getNext()) {
- $next = $next->getNext();
- }
- return !$next->makesDecision() ? $next->getBackoffPeriod($retries, $request, $response, $e) : 0;
- }
- } else {
- return $delay;
- }
- }
-
- /**
- * Check if the strategy does filtering and makes decisions on whether or not to retry.
- *
- * Strategies that return false will never retry if all of the previous strategies in a chain defer on a backoff
- * decision.
- *
- * @return bool
- */
- abstract public function makesDecision();
-
- /**
- * Implement the concrete strategy
- *
- * @param int $retries Number of retries of the request
- * @param RequestInterface $request Request that was sent
- * @param Response $response Response that was received. Note that there may not be a response
- * @param HttpException $e Exception that was encountered if any
- *
- * @return bool|int|null Returns false to not retry or the number of seconds to delay between retries. Return true
- * or null to defer to the next strategy if available, and if not, return 0.
- */
- abstract protected function getDelay(
- $retries,
- RequestInterface $request,
- Response $response = null,
- HttpException $e = null
- );
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/AbstractErrorCodeBackoffStrategy.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/AbstractErrorCodeBackoffStrategy.php
deleted file mode 100644
index 6ebee6c..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/AbstractErrorCodeBackoffStrategy.php
+++ /dev/null
@@ -1,40 +0,0 @@
-errorCodes = array_fill_keys($codes ?: static::$defaultErrorCodes, 1);
- $this->next = $next;
- }
-
- /**
- * Get the default failure codes to retry
- *
- * @return array
- */
- public static function getDefaultFailureCodes()
- {
- return static::$defaultErrorCodes;
- }
-
- public function makesDecision()
- {
- return true;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/BackoffLogger.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/BackoffLogger.php
deleted file mode 100644
index ec54c28..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/BackoffLogger.php
+++ /dev/null
@@ -1,76 +0,0 @@
-logger = $logger;
- $this->formatter = $formatter ?: new MessageFormatter(self::DEFAULT_FORMAT);
- }
-
- public static function getSubscribedEvents()
- {
- return array(BackoffPlugin::RETRY_EVENT => 'onRequestRetry');
- }
-
- /**
- * Set the template to use for logging
- *
- * @param string $template Log message template
- *
- * @return self
- */
- public function setTemplate($template)
- {
- $this->formatter->setTemplate($template);
-
- return $this;
- }
-
- /**
- * Called when a request is being retried
- *
- * @param Event $event Event emitted
- */
- public function onRequestRetry(Event $event)
- {
- $this->logger->log($this->formatter->format(
- $event['request'],
- $event['response'],
- $event['handle'],
- array(
- 'retries' => $event['retries'],
- 'delay' => $event['delay']
- )
- ));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/BackoffPlugin.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/BackoffPlugin.php
deleted file mode 100644
index 99ace05..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/BackoffPlugin.php
+++ /dev/null
@@ -1,126 +0,0 @@
-strategy = $strategy;
- }
-
- /**
- * Retrieve a basic truncated exponential backoff plugin that will retry HTTP errors and cURL errors
- *
- * @param int $maxRetries Maximum number of retries
- * @param array $httpCodes HTTP response codes to retry
- * @param array $curlCodes cURL error codes to retry
- *
- * @return self
- */
- public static function getExponentialBackoff(
- $maxRetries = 3,
- array $httpCodes = null,
- array $curlCodes = null
- ) {
- return new self(new TruncatedBackoffStrategy($maxRetries,
- new HttpBackoffStrategy($httpCodes,
- new CurlBackoffStrategy($curlCodes,
- new ExponentialBackoffStrategy()
- )
- )
- ));
- }
-
- public static function getAllEvents()
- {
- return array(self::RETRY_EVENT);
- }
-
- public static function getSubscribedEvents()
- {
- return array(
- 'request.sent' => 'onRequestSent',
- 'request.exception' => 'onRequestSent',
- CurlMultiInterface::POLLING_REQUEST => 'onRequestPoll'
- );
- }
-
- /**
- * Called when a request has been sent and isn't finished processing
- *
- * @param Event $event
- */
- public function onRequestSent(Event $event)
- {
- $request = $event['request'];
- $response = $event['response'];
- $exception = $event['exception'];
-
- $params = $request->getParams();
- $retries = (int) $params->get(self::RETRY_PARAM);
- $delay = $this->strategy->getBackoffPeriod($retries, $request, $response, $exception);
-
- if ($delay !== false) {
- // Calculate how long to wait until the request should be retried
- $params->set(self::RETRY_PARAM, ++$retries)
- ->set(self::DELAY_PARAM, microtime(true) + $delay);
- // Send the request again
- $request->setState(RequestInterface::STATE_TRANSFER);
- $this->dispatch(self::RETRY_EVENT, array(
- 'request' => $request,
- 'response' => $response,
- 'handle' => ($exception && $exception instanceof CurlException) ? $exception->getCurlHandle() : null,
- 'retries' => $retries,
- 'delay' => $delay
- ));
- }
- }
-
- /**
- * Called when a request is polling in the curl multi object
- *
- * @param Event $event
- */
- public function onRequestPoll(Event $event)
- {
- $request = $event['request'];
- $delay = $request->getParams()->get(self::DELAY_PARAM);
-
- // If the duration of the delay has passed, retry the request using the pool
- if (null !== $delay && microtime(true) >= $delay) {
- // Remove the request from the pool and then add it back again. This is required for cURL to know that we
- // want to retry sending the easy handle.
- $request->getParams()->remove(self::DELAY_PARAM);
- // Rewind the request body if possible
- if ($request instanceof EntityEnclosingRequestInterface && $request->getBody()) {
- $request->getBody()->seek(0);
- }
- $multi = $event['curl_multi'];
- $multi->remove($request);
- $multi->add($request);
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/BackoffStrategyInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/BackoffStrategyInterface.php
deleted file mode 100644
index 4e590db..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/BackoffStrategyInterface.php
+++ /dev/null
@@ -1,30 +0,0 @@
-callback = $callback;
- $this->decision = (bool) $decision;
- $this->next = $next;
- }
-
- public function makesDecision()
- {
- return $this->decision;
- }
-
- protected function getDelay($retries, RequestInterface $request, Response $response = null, HttpException $e = null)
- {
- return call_user_func($this->callback, $retries, $request, $response, $e);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/ConstantBackoffStrategy.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/ConstantBackoffStrategy.php
deleted file mode 100644
index 061d2a4..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/ConstantBackoffStrategy.php
+++ /dev/null
@@ -1,34 +0,0 @@
-delay = $delay;
- }
-
- public function makesDecision()
- {
- return false;
- }
-
- protected function getDelay($retries, RequestInterface $request, Response $response = null, HttpException $e = null)
- {
- return $this->delay;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/CurlBackoffStrategy.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/CurlBackoffStrategy.php
deleted file mode 100644
index a584ed4..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/CurlBackoffStrategy.php
+++ /dev/null
@@ -1,28 +0,0 @@
-errorCodes[$e->getErrorNo()]) ? true : null;
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/ExponentialBackoffStrategy.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/ExponentialBackoffStrategy.php
deleted file mode 100644
index fb2912d..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/ExponentialBackoffStrategy.php
+++ /dev/null
@@ -1,25 +0,0 @@
-isSuccessful()) {
- return false;
- } else {
- return isset($this->errorCodes[$response->getStatusCode()]) ? true : null;
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/LinearBackoffStrategy.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/LinearBackoffStrategy.php
deleted file mode 100644
index b35e8a4..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/LinearBackoffStrategy.php
+++ /dev/null
@@ -1,36 +0,0 @@
-step = $step;
- }
-
- public function makesDecision()
- {
- return false;
- }
-
- protected function getDelay($retries, RequestInterface $request, Response $response = null, HttpException $e = null)
- {
- return $retries * $this->step;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/ReasonPhraseBackoffStrategy.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/ReasonPhraseBackoffStrategy.php
deleted file mode 100644
index 4fd73fe..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/ReasonPhraseBackoffStrategy.php
+++ /dev/null
@@ -1,25 +0,0 @@
-errorCodes[$response->getReasonPhrase()]) ? true : null;
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/TruncatedBackoffStrategy.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/TruncatedBackoffStrategy.php
deleted file mode 100644
index 3608f35..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/TruncatedBackoffStrategy.php
+++ /dev/null
@@ -1,36 +0,0 @@
-max = $maxRetries;
- $this->next = $next;
- }
-
- public function makesDecision()
- {
- return true;
- }
-
- protected function getDelay($retries, RequestInterface $request, Response $response = null, HttpException $e = null)
- {
- return $retries < $this->max ? null : false;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/composer.json b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/composer.json
deleted file mode 100644
index 91c122c..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Backoff/composer.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "name": "guzzle/plugin-backoff",
- "description": "Guzzle backoff retry plugins",
- "homepage": "http://guzzlephp.org/",
- "keywords": ["plugin", "guzzle"],
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.3.2",
- "guzzle/http": "self.version",
- "guzzle/log": "self.version"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Plugin\\Backoff": "" }
- },
- "target-dir": "Guzzle/Plugin/Backoff",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/CacheKeyProviderInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/CacheKeyProviderInterface.php
deleted file mode 100644
index 7790f88..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/CacheKeyProviderInterface.php
+++ /dev/null
@@ -1,11 +0,0 @@
- new DefaultCacheStorage($options));
- } elseif ($options instanceof CacheStorageInterface) {
- $options = array('storage' => $options);
- } elseif ($options) {
- $options = array('storage' => new DefaultCacheStorage(CacheAdapterFactory::fromCache($options)));
- } elseif (!class_exists('Doctrine\Common\Cache\ArrayCache')) {
- // @codeCoverageIgnoreStart
- throw new InvalidArgumentException('No cache was provided and Doctrine is not installed');
- // @codeCoverageIgnoreEnd
- }
- }
-
- $this->autoPurge = isset($options['auto_purge']) ? $options['auto_purge'] : false;
-
- // Add a cache storage if a cache adapter was provided
- $this->storage = isset($options['storage'])
- ? $options['storage']
- : new DefaultCacheStorage(new DoctrineCacheAdapter(new ArrayCache()));
-
- if (!isset($options['can_cache'])) {
- $this->canCache = new DefaultCanCacheStrategy();
- } else {
- $this->canCache = is_callable($options['can_cache'])
- ? new CallbackCanCacheStrategy($options['can_cache'])
- : $options['can_cache'];
- }
-
- // Use the provided revalidation strategy or the default
- $this->revalidation = isset($options['revalidation'])
- ? $options['revalidation']
- : new DefaultRevalidation($this->storage, $this->canCache);
- }
-
- public static function getSubscribedEvents()
- {
- return array(
- 'request.before_send' => array('onRequestBeforeSend', -255),
- 'request.sent' => array('onRequestSent', 255),
- 'request.error' => array('onRequestError', 0),
- 'request.exception' => array('onRequestException', 0),
- );
- }
-
- /**
- * Check if a response in cache will satisfy the request before sending
- *
- * @param Event $event
- */
- public function onRequestBeforeSend(Event $event)
- {
- $request = $event['request'];
- $request->addHeader('Via', sprintf('%s GuzzleCache/%s', $request->getProtocolVersion(), Version::VERSION));
-
- if (!$this->canCache->canCacheRequest($request)) {
- switch ($request->getMethod()) {
- case 'PURGE':
- $this->purge($request);
- $request->setResponse(new Response(200, array(), 'purged'));
- break;
- case 'PUT':
- case 'POST':
- case 'DELETE':
- case 'PATCH':
- if ($this->autoPurge) {
- $this->purge($request);
- }
- }
- return;
- }
-
- if ($response = $this->storage->fetch($request)) {
- $params = $request->getParams();
- $params['cache.lookup'] = true;
- $response->setHeader(
- 'Age',
- time() - strtotime($response->getDate() ? : $response->getLastModified() ?: 'now')
- );
- // Validate that the response satisfies the request
- if ($this->canResponseSatisfyRequest($request, $response)) {
- if (!isset($params['cache.hit'])) {
- $params['cache.hit'] = true;
- }
- $request->setResponse($response);
- }
- }
- }
-
- /**
- * If possible, store a response in cache after sending
- *
- * @param Event $event
- */
- public function onRequestSent(Event $event)
- {
- $request = $event['request'];
- $response = $event['response'];
-
- if ($request->getParams()->get('cache.hit') === null &&
- $this->canCache->canCacheRequest($request) &&
- $this->canCache->canCacheResponse($response)
- ) {
- $this->storage->cache($request, $response);
- }
-
- $this->addResponseHeaders($request, $response);
- }
-
- /**
- * If possible, return a cache response on an error
- *
- * @param Event $event
- */
- public function onRequestError(Event $event)
- {
- $request = $event['request'];
-
- if (!$this->canCache->canCacheRequest($request)) {
- return;
- }
-
- if ($response = $this->storage->fetch($request)) {
- $response->setHeader(
- 'Age',
- time() - strtotime($response->getLastModified() ? : $response->getDate() ?: 'now')
- );
-
- if ($this->canResponseSatisfyFailedRequest($request, $response)) {
- $request->getParams()->set('cache.hit', 'error');
- $this->addResponseHeaders($request, $response);
- $event['response'] = $response;
- $event->stopPropagation();
- }
- }
- }
-
- /**
- * If possible, set a cache response on a cURL exception
- *
- * @param Event $event
- *
- * @return null
- */
- public function onRequestException(Event $event)
- {
- if (!$event['exception'] instanceof CurlException) {
- return;
- }
-
- $request = $event['request'];
- if (!$this->canCache->canCacheRequest($request)) {
- return;
- }
-
- if ($response = $this->storage->fetch($request)) {
- $response->setHeader('Age', time() - strtotime($response->getDate() ? : 'now'));
- if (!$this->canResponseSatisfyFailedRequest($request, $response)) {
- return;
- }
- $request->getParams()->set('cache.hit', 'error');
- $request->setResponse($response);
- $this->addResponseHeaders($request, $response);
- $event->stopPropagation();
- }
- }
-
- /**
- * Check if a cache response satisfies a request's caching constraints
- *
- * @param RequestInterface $request Request to validate
- * @param Response $response Response to validate
- *
- * @return bool
- */
- public function canResponseSatisfyRequest(RequestInterface $request, Response $response)
- {
- $responseAge = $response->calculateAge();
- $reqc = $request->getHeader('Cache-Control');
- $resc = $response->getHeader('Cache-Control');
-
- // Check the request's max-age header against the age of the response
- if ($reqc && $reqc->hasDirective('max-age') &&
- $responseAge > $reqc->getDirective('max-age')) {
- return false;
- }
-
- // Check the response's max-age header
- if ($response->isFresh() === false) {
- $maxStale = $reqc ? $reqc->getDirective('max-stale') : null;
- if (null !== $maxStale) {
- if ($maxStale !== true && $response->getFreshness() < (-1 * $maxStale)) {
- return false;
- }
- } elseif ($resc && $resc->hasDirective('max-age')
- && $responseAge > $resc->getDirective('max-age')
- ) {
- return false;
- }
- }
-
- if ($this->revalidation->shouldRevalidate($request, $response)) {
- try {
- return $this->revalidation->revalidate($request, $response);
- } catch (CurlException $e) {
- $request->getParams()->set('cache.hit', 'error');
- return $this->canResponseSatisfyFailedRequest($request, $response);
- }
- }
-
- return true;
- }
-
- /**
- * Check if a cache response satisfies a failed request's caching constraints
- *
- * @param RequestInterface $request Request to validate
- * @param Response $response Response to validate
- *
- * @return bool
- */
- public function canResponseSatisfyFailedRequest(RequestInterface $request, Response $response)
- {
- $reqc = $request->getHeader('Cache-Control');
- $resc = $response->getHeader('Cache-Control');
- $requestStaleIfError = $reqc ? $reqc->getDirective('stale-if-error') : null;
- $responseStaleIfError = $resc ? $resc->getDirective('stale-if-error') : null;
-
- if (!$requestStaleIfError && !$responseStaleIfError) {
- return false;
- }
-
- if (is_numeric($requestStaleIfError) && $response->getAge() - $response->getMaxAge() > $requestStaleIfError) {
- return false;
- }
-
- if (is_numeric($responseStaleIfError) && $response->getAge() - $response->getMaxAge() > $responseStaleIfError) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Purge all cache entries for a given URL
- *
- * @param string $url URL to purge
- */
- public function purge($url)
- {
- // BC compatibility with previous version that accepted a Request object
- $url = $url instanceof RequestInterface ? $url->getUrl() : $url;
- $this->storage->purge($url);
- }
-
- /**
- * Add the plugin's headers to a response
- *
- * @param RequestInterface $request Request
- * @param Response $response Response to add headers to
- */
- protected function addResponseHeaders(RequestInterface $request, Response $response)
- {
- $params = $request->getParams();
- $response->setHeader('Via', sprintf('%s GuzzleCache/%s', $request->getProtocolVersion(), Version::VERSION));
-
- $lookup = ($params['cache.lookup'] === true ? 'HIT' : 'MISS') . ' from GuzzleCache';
- if ($header = $response->getHeader('X-Cache-Lookup')) {
- // Don't add duplicates
- $values = $header->toArray();
- $values[] = $lookup;
- $response->setHeader('X-Cache-Lookup', array_unique($values));
- } else {
- $response->setHeader('X-Cache-Lookup', $lookup);
- }
-
- if ($params['cache.hit'] === true) {
- $xcache = 'HIT from GuzzleCache';
- } elseif ($params['cache.hit'] == 'error') {
- $xcache = 'HIT_ERROR from GuzzleCache';
- } else {
- $xcache = 'MISS from GuzzleCache';
- }
-
- if ($header = $response->getHeader('X-Cache')) {
- // Don't add duplicates
- $values = $header->toArray();
- $values[] = $xcache;
- $response->setHeader('X-Cache', array_unique($values));
- } else {
- $response->setHeader('X-Cache', $xcache);
- }
-
- if ($response->isFresh() === false) {
- $response->addHeader('Warning', sprintf('110 GuzzleCache/%s "Response is stale"', Version::VERSION));
- if ($params['cache.hit'] === 'error') {
- $response->addHeader('Warning', sprintf('111 GuzzleCache/%s "Revalidation failed"', Version::VERSION));
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/CacheStorageInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/CacheStorageInterface.php
deleted file mode 100644
index f3d9154..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/CacheStorageInterface.php
+++ /dev/null
@@ -1,43 +0,0 @@
-requestCallback = $requestCallback;
- $this->responseCallback = $responseCallback;
- }
-
- public function canCacheRequest(RequestInterface $request)
- {
- return $this->requestCallback
- ? call_user_func($this->requestCallback, $request)
- : parent::canCacheRequest($request);
- }
-
- public function canCacheResponse(Response $response)
- {
- return $this->responseCallback
- ? call_user_func($this->responseCallback, $response)
- : parent::canCacheResponse($response);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/CanCacheStrategyInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/CanCacheStrategyInterface.php
deleted file mode 100644
index 6e01a8e..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/CanCacheStrategyInterface.php
+++ /dev/null
@@ -1,30 +0,0 @@
-getParams()->get(self::CACHE_KEY);
-
- if (!$key) {
-
- $cloned = clone $request;
- $cloned->removeHeader('Cache-Control');
-
- // Check to see how and if the key should be filtered
- foreach (explode(';', $request->getParams()->get(self::CACHE_KEY_FILTER)) as $part) {
- $pieces = array_map('trim', explode('=', $part));
- if (isset($pieces[1])) {
- foreach (array_map('trim', explode(',', $pieces[1])) as $remove) {
- if ($pieces[0] == 'header') {
- $cloned->removeHeader($remove);
- } elseif ($pieces[0] == 'query') {
- $cloned->getQuery()->remove($remove);
- }
- }
- }
- }
-
- $raw = (string) $cloned;
- $key = 'GZ' . md5($raw);
- $request->getParams()->set(self::CACHE_KEY, $key)->set(self::CACHE_KEY_RAW, $raw);
- }
-
- return $key;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/DefaultCacheStorage.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/DefaultCacheStorage.php
deleted file mode 100644
index 26d7a8b..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/DefaultCacheStorage.php
+++ /dev/null
@@ -1,266 +0,0 @@
-cache = CacheAdapterFactory::fromCache($cache);
- $this->defaultTtl = $defaultTtl;
- $this->keyPrefix = $keyPrefix;
- }
-
- public function cache(RequestInterface $request, Response $response)
- {
- $currentTime = time();
-
- $overrideTtl = $request->getParams()->get('cache.override_ttl');
- if ($overrideTtl) {
- $ttl = $overrideTtl;
- } else {
- $maxAge = $response->getMaxAge();
- if ($maxAge !== null) {
- $ttl = $maxAge;
- } else {
- $ttl = $this->defaultTtl;
- }
- }
-
- if ($cacheControl = $response->getHeader('Cache-Control')) {
- $stale = $cacheControl->getDirective('stale-if-error');
- if ($stale === true) {
- $ttl += $ttl;
- } else if (is_numeric($stale)) {
- $ttl += $stale;
- }
- }
-
- // Determine which manifest key should be used
- $key = $this->getCacheKey($request);
- $persistedRequest = $this->persistHeaders($request);
- $entries = array();
-
- if ($manifest = $this->cache->fetch($key)) {
- // Determine which cache entries should still be in the cache
- $vary = $response->getVary();
- foreach (unserialize($manifest) as $entry) {
- // Check if the entry is expired
- if ($entry[4] < $currentTime) {
- continue;
- }
- $entry[1]['vary'] = isset($entry[1]['vary']) ? $entry[1]['vary'] : '';
- if ($vary != $entry[1]['vary'] || !$this->requestsMatch($vary, $entry[0], $persistedRequest)) {
- $entries[] = $entry;
- }
- }
- }
-
- // Persist the response body if needed
- $bodyDigest = null;
- if ($response->getBody() && $response->getBody()->getContentLength() > 0) {
- $bodyDigest = $this->getBodyKey($request->getUrl(), $response->getBody());
- $this->cache->save($bodyDigest, (string) $response->getBody(), $ttl);
- }
-
- array_unshift($entries, array(
- $persistedRequest,
- $this->persistHeaders($response),
- $response->getStatusCode(),
- $bodyDigest,
- $currentTime + $ttl
- ));
-
- $this->cache->save($key, serialize($entries));
- }
-
- public function delete(RequestInterface $request)
- {
- $key = $this->getCacheKey($request);
- if ($entries = $this->cache->fetch($key)) {
- // Delete each cached body
- foreach (unserialize($entries) as $entry) {
- if ($entry[3]) {
- $this->cache->delete($entry[3]);
- }
- }
- $this->cache->delete($key);
- }
- }
-
- public function purge($url)
- {
- foreach (array('GET', 'HEAD', 'POST', 'PUT', 'DELETE') as $method) {
- $this->delete(new Request($method, $url));
- }
- }
-
- public function fetch(RequestInterface $request)
- {
- $key = $this->getCacheKey($request);
- if (!($entries = $this->cache->fetch($key))) {
- return null;
- }
-
- $match = null;
- $headers = $this->persistHeaders($request);
- $entries = unserialize($entries);
- foreach ($entries as $index => $entry) {
- if ($this->requestsMatch(isset($entry[1]['vary']) ? $entry[1]['vary'] : '', $headers, $entry[0])) {
- $match = $entry;
- break;
- }
- }
-
- if (!$match) {
- return null;
- }
-
- // Ensure that the response is not expired
- $response = null;
- if ($match[4] < time()) {
- $response = -1;
- } else {
- $response = new Response($match[2], $match[1]);
- if ($match[3]) {
- if ($body = $this->cache->fetch($match[3])) {
- $response->setBody($body);
- } else {
- // The response is not valid because the body was somehow deleted
- $response = -1;
- }
- }
- }
-
- if ($response === -1) {
- // Remove the entry from the metadata and update the cache
- unset($entries[$index]);
- if ($entries) {
- $this->cache->save($key, serialize($entries));
- } else {
- $this->cache->delete($key);
- }
- return null;
- }
-
- return $response;
- }
-
- /**
- * Hash a request URL into a string that returns cache metadata
- *
- * @param RequestInterface $request
- *
- * @return string
- */
- protected function getCacheKey(RequestInterface $request)
- {
- // Allow cache.key_filter to trim down the URL cache key by removing generate query string values (e.g. auth)
- if ($filter = $request->getParams()->get('cache.key_filter')) {
- $url = $request->getUrl(true);
- foreach (explode(',', $filter) as $remove) {
- $url->getQuery()->remove(trim($remove));
- }
- } else {
- $url = $request->getUrl();
- }
-
- return $this->keyPrefix . md5($request->getMethod() . ' ' . $url);
- }
-
- /**
- * Create a cache key for a response's body
- *
- * @param string $url URL of the entry
- * @param EntityBodyInterface $body Response body
- *
- * @return string
- */
- protected function getBodyKey($url, EntityBodyInterface $body)
- {
- return $this->keyPrefix . md5($url) . $body->getContentMd5();
- }
-
- /**
- * Determines whether two Request HTTP header sets are non-varying
- *
- * @param string $vary Response vary header
- * @param array $r1 HTTP header array
- * @param array $r2 HTTP header array
- *
- * @return bool
- */
- private function requestsMatch($vary, $r1, $r2)
- {
- if ($vary) {
- foreach (explode(',', $vary) as $header) {
- $key = trim(strtolower($header));
- $v1 = isset($r1[$key]) ? $r1[$key] : null;
- $v2 = isset($r2[$key]) ? $r2[$key] : null;
- if ($v1 !== $v2) {
- return false;
- }
- }
- }
-
- return true;
- }
-
- /**
- * Creates an array of cacheable and normalized message headers
- *
- * @param MessageInterface $message
- *
- * @return array
- */
- private function persistHeaders(MessageInterface $message)
- {
- // Headers are excluded from the caching (see RFC 2616:13.5.1)
- static $noCache = array(
- 'age' => true,
- 'connection' => true,
- 'keep-alive' => true,
- 'proxy-authenticate' => true,
- 'proxy-authorization' => true,
- 'te' => true,
- 'trailers' => true,
- 'transfer-encoding' => true,
- 'upgrade' => true,
- 'set-cookie' => true,
- 'set-cookie2' => true
- );
-
- // Clone the response to not destroy any necessary headers when caching
- $headers = $message->getHeaders()->getAll();
- $headers = array_diff_key($headers, $noCache);
- // Cast the headers to a string
- $headers = array_map(function ($h) { return (string) $h; }, $headers);
-
- return $headers;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/DefaultCanCacheStrategy.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/DefaultCanCacheStrategy.php
deleted file mode 100644
index 3ca1fbf..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/DefaultCanCacheStrategy.php
+++ /dev/null
@@ -1,32 +0,0 @@
-getMethod() != RequestInterface::GET && $request->getMethod() != RequestInterface::HEAD) {
- return false;
- }
-
- // Never cache requests when using no-store
- if ($request->hasHeader('Cache-Control') && $request->getHeader('Cache-Control')->hasDirective('no-store')) {
- return false;
- }
-
- return true;
- }
-
- public function canCacheResponse(Response $response)
- {
- return $response->isSuccessful() && $response->canCache();
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/DefaultRevalidation.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/DefaultRevalidation.php
deleted file mode 100644
index af33234..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/DefaultRevalidation.php
+++ /dev/null
@@ -1,174 +0,0 @@
-storage = $cache;
- $this->canCache = $canCache ?: new DefaultCanCacheStrategy();
- }
-
- public function revalidate(RequestInterface $request, Response $response)
- {
- try {
- $revalidate = $this->createRevalidationRequest($request, $response);
- $validateResponse = $revalidate->send();
- if ($validateResponse->getStatusCode() == 200) {
- return $this->handle200Response($request, $validateResponse);
- } elseif ($validateResponse->getStatusCode() == 304) {
- return $this->handle304Response($request, $validateResponse, $response);
- }
- } catch (BadResponseException $e) {
- $this->handleBadResponse($e);
- }
-
- // Other exceptions encountered in the revalidation request are ignored
- // in hopes that sending a request to the origin server will fix it
- return false;
- }
-
- public function shouldRevalidate(RequestInterface $request, Response $response)
- {
- if ($request->getMethod() != RequestInterface::GET) {
- return false;
- }
-
- $reqCache = $request->getHeader('Cache-Control');
- $resCache = $response->getHeader('Cache-Control');
-
- $revalidate = $request->getHeader('Pragma') == 'no-cache' ||
- ($reqCache && ($reqCache->hasDirective('no-cache') || $reqCache->hasDirective('must-revalidate'))) ||
- ($resCache && ($resCache->hasDirective('no-cache') || $resCache->hasDirective('must-revalidate')));
-
- // Use the strong ETag validator if available and the response contains no Cache-Control directive
- if (!$revalidate && !$resCache && $response->hasHeader('ETag')) {
- $revalidate = true;
- }
-
- return $revalidate;
- }
-
- /**
- * Handles a bad response when attempting to revalidate
- *
- * @param BadResponseException $e Exception encountered
- *
- * @throws BadResponseException
- */
- protected function handleBadResponse(BadResponseException $e)
- {
- // 404 errors mean the resource no longer exists, so remove from
- // cache, and prevent an additional request by throwing the exception
- if ($e->getResponse()->getStatusCode() == 404) {
- $this->storage->delete($e->getRequest());
- throw $e;
- }
- }
-
- /**
- * Creates a request to use for revalidation
- *
- * @param RequestInterface $request Request
- * @param Response $response Response to revalidate
- *
- * @return RequestInterface returns a revalidation request
- */
- protected function createRevalidationRequest(RequestInterface $request, Response $response)
- {
- $revalidate = clone $request;
- $revalidate->removeHeader('Pragma')->removeHeader('Cache-Control');
-
- if ($response->getLastModified()) {
- $revalidate->setHeader('If-Modified-Since', $response->getLastModified());
- }
-
- if ($response->getEtag()) {
- $revalidate->setHeader('If-None-Match', $response->getEtag());
- }
-
- // Remove any cache plugins that might be on the request to prevent infinite recursive revalidations
- $dispatcher = $revalidate->getEventDispatcher();
- foreach ($dispatcher->getListeners() as $eventName => $listeners) {
- foreach ($listeners as $listener) {
- if (is_array($listener) && $listener[0] instanceof CachePlugin) {
- $dispatcher->removeListener($eventName, $listener);
- }
- }
- }
-
- return $revalidate;
- }
-
- /**
- * Handles a 200 response response from revalidating. The server does not support validation, so use this response.
- *
- * @param RequestInterface $request Request that was sent
- * @param Response $validateResponse Response received
- *
- * @return bool Returns true if valid, false if invalid
- */
- protected function handle200Response(RequestInterface $request, Response $validateResponse)
- {
- $request->setResponse($validateResponse);
- if ($this->canCache->canCacheResponse($validateResponse)) {
- $this->storage->cache($request, $validateResponse);
- }
-
- return false;
- }
-
- /**
- * Handle a 304 response and ensure that it is still valid
- *
- * @param RequestInterface $request Request that was sent
- * @param Response $validateResponse Response received
- * @param Response $response Original cached response
- *
- * @return bool Returns true if valid, false if invalid
- */
- protected function handle304Response(RequestInterface $request, Response $validateResponse, Response $response)
- {
- static $replaceHeaders = array('Date', 'Expires', 'Cache-Control', 'ETag', 'Last-Modified');
-
- // Make sure that this response has the same ETag
- if ($validateResponse->getEtag() != $response->getEtag()) {
- return false;
- }
-
- // Replace cached headers with any of these headers from the
- // origin server that might be more up to date
- $modified = false;
- foreach ($replaceHeaders as $name) {
- if ($validateResponse->hasHeader($name)) {
- $modified = true;
- $response->setHeader($name, $validateResponse->getHeader($name));
- }
- }
-
- // Store the updated response in cache
- if ($modified && $this->canCache->canCacheResponse($response)) {
- $this->storage->cache($request, $response);
- }
-
- return true;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/DenyRevalidation.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/DenyRevalidation.php
deleted file mode 100644
index 88b86f3..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cache/DenyRevalidation.php
+++ /dev/null
@@ -1,19 +0,0 @@
-=5.3.2",
- "guzzle/http": "self.version",
- "guzzle/cache": "self.version"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Plugin\\Cache": "" }
- },
- "target-dir": "Guzzle/Plugin/Cache",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cookie/Cookie.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cookie/Cookie.php
deleted file mode 100644
index 5218e5f..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cookie/Cookie.php
+++ /dev/null
@@ -1,538 +0,0 @@
- '',
- 'value' => '',
- 'domain' => '',
- 'path' => '/',
- 'expires' => null,
- 'max_age' => 0,
- 'comment' => null,
- 'comment_url' => null,
- 'port' => array(),
- 'version' => null,
- 'secure' => false,
- 'discard' => false,
- 'http_only' => false
- );
-
- $this->data = array_merge($defaults, $data);
- // Extract the expires value and turn it into a UNIX timestamp if needed
- if (!$this->getExpires() && $this->getMaxAge()) {
- // Calculate the expires date
- $this->setExpires(time() + (int) $this->getMaxAge());
- } elseif ($this->getExpires() && !is_numeric($this->getExpires())) {
- $this->setExpires(strtotime($this->getExpires()));
- }
- }
-
- /**
- * Get the cookie as an array
- *
- * @return array
- */
- public function toArray()
- {
- return $this->data;
- }
-
- /**
- * Get the cookie name
- *
- * @return string
- */
- public function getName()
- {
- return $this->data['name'];
- }
-
- /**
- * Set the cookie name
- *
- * @param string $name Cookie name
- *
- * @return Cookie
- */
- public function setName($name)
- {
- return $this->setData('name', $name);
- }
-
- /**
- * Get the cookie value
- *
- * @return string
- */
- public function getValue()
- {
- return $this->data['value'];
- }
-
- /**
- * Set the cookie value
- *
- * @param string $value Cookie value
- *
- * @return Cookie
- */
- public function setValue($value)
- {
- return $this->setData('value', $value);
- }
-
- /**
- * Get the domain
- *
- * @return string|null
- */
- public function getDomain()
- {
- return $this->data['domain'];
- }
-
- /**
- * Set the domain of the cookie
- *
- * @param string $domain
- *
- * @return Cookie
- */
- public function setDomain($domain)
- {
- return $this->setData('domain', $domain);
- }
-
- /**
- * Get the path
- *
- * @return string
- */
- public function getPath()
- {
- return $this->data['path'];
- }
-
- /**
- * Set the path of the cookie
- *
- * @param string $path Path of the cookie
- *
- * @return Cookie
- */
- public function setPath($path)
- {
- return $this->setData('path', $path);
- }
-
- /**
- * Maximum lifetime of the cookie in seconds
- *
- * @return int|null
- */
- public function getMaxAge()
- {
- return $this->data['max_age'];
- }
-
- /**
- * Set the max-age of the cookie
- *
- * @param int $maxAge Max age of the cookie in seconds
- *
- * @return Cookie
- */
- public function setMaxAge($maxAge)
- {
- return $this->setData('max_age', $maxAge);
- }
-
- /**
- * The UNIX timestamp when the cookie expires
- *
- * @return mixed
- */
- public function getExpires()
- {
- return $this->data['expires'];
- }
-
- /**
- * Set the unix timestamp for which the cookie will expire
- *
- * @param int $timestamp Unix timestamp
- *
- * @return Cookie
- */
- public function setExpires($timestamp)
- {
- return $this->setData('expires', $timestamp);
- }
-
- /**
- * Version of the cookie specification. RFC 2965 is 1
- *
- * @return mixed
- */
- public function getVersion()
- {
- return $this->data['version'];
- }
-
- /**
- * Set the cookie version
- *
- * @param string|int $version Version to set
- *
- * @return Cookie
- */
- public function setVersion($version)
- {
- return $this->setData('version', $version);
- }
-
- /**
- * Get whether or not this is a secure cookie
- *
- * @return null|bool
- */
- public function getSecure()
- {
- return $this->data['secure'];
- }
-
- /**
- * Set whether or not the cookie is secure
- *
- * @param bool $secure Set to true or false if secure
- *
- * @return Cookie
- */
- public function setSecure($secure)
- {
- return $this->setData('secure', (bool) $secure);
- }
-
- /**
- * Get whether or not this is a session cookie
- *
- * @return null|bool
- */
- public function getDiscard()
- {
- return $this->data['discard'];
- }
-
- /**
- * Set whether or not this is a session cookie
- *
- * @param bool $discard Set to true or false if this is a session cookie
- *
- * @return Cookie
- */
- public function setDiscard($discard)
- {
- return $this->setData('discard', $discard);
- }
-
- /**
- * Get the comment
- *
- * @return string|null
- */
- public function getComment()
- {
- return $this->data['comment'];
- }
-
- /**
- * Set the comment of the cookie
- *
- * @param string $comment Cookie comment
- *
- * @return Cookie
- */
- public function setComment($comment)
- {
- return $this->setData('comment', $comment);
- }
-
- /**
- * Get the comment URL of the cookie
- *
- * @return string|null
- */
- public function getCommentUrl()
- {
- return $this->data['comment_url'];
- }
-
- /**
- * Set the comment URL of the cookie
- *
- * @param string $commentUrl Cookie comment URL for more information
- *
- * @return Cookie
- */
- public function setCommentUrl($commentUrl)
- {
- return $this->setData('comment_url', $commentUrl);
- }
-
- /**
- * Get an array of acceptable ports this cookie can be used with
- *
- * @return array
- */
- public function getPorts()
- {
- return $this->data['port'];
- }
-
- /**
- * Set a list of acceptable ports this cookie can be used with
- *
- * @param array $ports Array of acceptable ports
- *
- * @return Cookie
- */
- public function setPorts(array $ports)
- {
- return $this->setData('port', $ports);
- }
-
- /**
- * Get whether or not this is an HTTP only cookie
- *
- * @return bool
- */
- public function getHttpOnly()
- {
- return $this->data['http_only'];
- }
-
- /**
- * Set whether or not this is an HTTP only cookie
- *
- * @param bool $httpOnly Set to true or false if this is HTTP only
- *
- * @return Cookie
- */
- public function setHttpOnly($httpOnly)
- {
- return $this->setData('http_only', $httpOnly);
- }
-
- /**
- * Get an array of extra cookie data
- *
- * @return array
- */
- public function getAttributes()
- {
- return $this->data['data'];
- }
-
- /**
- * Get a specific data point from the extra cookie data
- *
- * @param string $name Name of the data point to retrieve
- *
- * @return null|string
- */
- public function getAttribute($name)
- {
- return array_key_exists($name, $this->data['data']) ? $this->data['data'][$name] : null;
- }
-
- /**
- * Set a cookie data attribute
- *
- * @param string $name Name of the attribute to set
- * @param string $value Value to set
- *
- * @return Cookie
- */
- public function setAttribute($name, $value)
- {
- $this->data['data'][$name] = $value;
-
- return $this;
- }
-
- /**
- * Check if the cookie matches a path value
- *
- * @param string $path Path to check against
- *
- * @return bool
- */
- public function matchesPath($path)
- {
- // RFC6265 http://tools.ietf.org/search/rfc6265#section-5.1.4
- // A request-path path-matches a given cookie-path if at least one of
- // the following conditions holds:
-
- // o The cookie-path and the request-path are identical.
- if ($path == $this->getPath()) {
- return true;
- }
-
- $pos = stripos($path, $this->getPath());
- if ($pos === 0) {
- // o The cookie-path is a prefix of the request-path, and the last
- // character of the cookie-path is %x2F ("/").
- if (substr($this->getPath(), -1, 1) === "/") {
- return true;
- }
-
- // o The cookie-path is a prefix of the request-path, and the first
- // character of the request-path that is not included in the cookie-
- // path is a %x2F ("/") character.
- if (substr($path, strlen($this->getPath()), 1) === "/") {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Check if the cookie matches a domain value
- *
- * @param string $domain Domain to check against
- *
- * @return bool
- */
- public function matchesDomain($domain)
- {
- // Remove the leading '.' as per spec in RFC 6265: http://tools.ietf.org/html/rfc6265#section-5.2.3
- $cookieDomain = ltrim($this->getDomain(), '.');
-
- // Domain not set or exact match.
- if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) {
- return true;
- }
-
- // Matching the subdomain according to RFC 6265: http://tools.ietf.org/html/rfc6265#section-5.1.3
- if (filter_var($domain, FILTER_VALIDATE_IP)) {
- return false;
- }
-
- return (bool) preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/i', $domain);
- }
-
- /**
- * Check if the cookie is compatible with a specific port
- *
- * @param int $port Port to check
- *
- * @return bool
- */
- public function matchesPort($port)
- {
- return count($this->getPorts()) == 0 || in_array($port, $this->getPorts());
- }
-
- /**
- * Check if the cookie is expired
- *
- * @return bool
- */
- public function isExpired()
- {
- return $this->getExpires() && time() > $this->getExpires();
- }
-
- /**
- * Check if the cookie is valid according to RFC 6265
- *
- * @return bool|string Returns true if valid or an error message if invalid
- */
- public function validate()
- {
- // Names must not be empty, but can be 0
- $name = $this->getName();
- if (empty($name) && !is_numeric($name)) {
- return 'The cookie name must not be empty';
- }
-
- // Check if any of the invalid characters are present in the cookie name
- if (strpbrk($name, self::getInvalidCharacters()) !== false) {
- return 'The cookie name must not contain invalid characters: ' . $name;
- }
-
- // Value must not be empty, but can be 0
- $value = $this->getValue();
- if (empty($value) && !is_numeric($value)) {
- return 'The cookie value must not be empty';
- }
-
- // Domains must not be empty, but can be 0
- // A "0" is not a valid internet domain, but may be used as server name in a private network
- $domain = $this->getDomain();
- if (empty($domain) && !is_numeric($domain)) {
- return 'The cookie domain must not be empty';
- }
-
- return true;
- }
-
- /**
- * Set a value and return the cookie object
- *
- * @param string $key Key to set
- * @param string $value Value to set
- *
- * @return Cookie
- */
- private function setData($key, $value)
- {
- $this->data[$key] = $value;
-
- return $this;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cookie/CookieJar/ArrayCookieJar.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cookie/CookieJar/ArrayCookieJar.php
deleted file mode 100644
index 6b67503..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cookie/CookieJar/ArrayCookieJar.php
+++ /dev/null
@@ -1,237 +0,0 @@
-strictMode = $strictMode;
- }
-
- /**
- * Enable or disable strict mode on the cookie jar
- *
- * @param bool $strictMode Set to true to throw exceptions when invalid cookies are added. False to ignore them.
- *
- * @return self
- */
- public function setStrictMode($strictMode)
- {
- $this->strictMode = $strictMode;
- }
-
- public function remove($domain = null, $path = null, $name = null)
- {
- $cookies = $this->all($domain, $path, $name, false, false);
- $this->cookies = array_filter($this->cookies, function (Cookie $cookie) use ($cookies) {
- return !in_array($cookie, $cookies, true);
- });
-
- return $this;
- }
-
- public function removeTemporary()
- {
- $this->cookies = array_filter($this->cookies, function (Cookie $cookie) {
- return !$cookie->getDiscard() && $cookie->getExpires();
- });
-
- return $this;
- }
-
- public function removeExpired()
- {
- $currentTime = time();
- $this->cookies = array_filter($this->cookies, function (Cookie $cookie) use ($currentTime) {
- return !$cookie->getExpires() || $currentTime < $cookie->getExpires();
- });
-
- return $this;
- }
-
- public function all($domain = null, $path = null, $name = null, $skipDiscardable = false, $skipExpired = true)
- {
- return array_values(array_filter($this->cookies, function (Cookie $cookie) use (
- $domain,
- $path,
- $name,
- $skipDiscardable,
- $skipExpired
- ) {
- return false === (($name && $cookie->getName() != $name) ||
- ($skipExpired && $cookie->isExpired()) ||
- ($skipDiscardable && ($cookie->getDiscard() || !$cookie->getExpires())) ||
- ($path && !$cookie->matchesPath($path)) ||
- ($domain && !$cookie->matchesDomain($domain)));
- }));
- }
-
- public function add(Cookie $cookie)
- {
- // Only allow cookies with set and valid domain, name, value
- $result = $cookie->validate();
- if ($result !== true) {
- if ($this->strictMode) {
- throw new InvalidCookieException($result);
- } else {
- $this->removeCookieIfEmpty($cookie);
- return false;
- }
- }
-
- // Resolve conflicts with previously set cookies
- foreach ($this->cookies as $i => $c) {
-
- // Two cookies are identical, when their path, domain, port and name are identical
- if ($c->getPath() != $cookie->getPath() ||
- $c->getDomain() != $cookie->getDomain() ||
- $c->getPorts() != $cookie->getPorts() ||
- $c->getName() != $cookie->getName()
- ) {
- continue;
- }
-
- // The previously set cookie is a discard cookie and this one is not so allow the new cookie to be set
- if (!$cookie->getDiscard() && $c->getDiscard()) {
- unset($this->cookies[$i]);
- continue;
- }
-
- // If the new cookie's expiration is further into the future, then replace the old cookie
- if ($cookie->getExpires() > $c->getExpires()) {
- unset($this->cookies[$i]);
- continue;
- }
-
- // If the value has changed, we better change it
- if ($cookie->getValue() !== $c->getValue()) {
- unset($this->cookies[$i]);
- continue;
- }
-
- // The cookie exists, so no need to continue
- return false;
- }
-
- $this->cookies[] = $cookie;
-
- return true;
- }
-
- /**
- * Serializes the cookie cookieJar
- *
- * @return string
- */
- public function serialize()
- {
- // Only serialize long term cookies and unexpired cookies
- return json_encode(array_map(function (Cookie $cookie) {
- return $cookie->toArray();
- }, $this->all(null, null, null, true, true)));
- }
-
- /**
- * Unserializes the cookie cookieJar
- */
- public function unserialize($data)
- {
- $data = json_decode($data, true);
- if (empty($data)) {
- $this->cookies = array();
- } else {
- $this->cookies = array_map(function (array $cookie) {
- return new Cookie($cookie);
- }, $data);
- }
- }
-
- /**
- * Returns the total number of stored cookies
- *
- * @return int
- */
- public function count()
- {
- return count($this->cookies);
- }
-
- /**
- * Returns an iterator
- *
- * @return \ArrayIterator
- */
- public function getIterator()
- {
- return new \ArrayIterator($this->cookies);
- }
-
- public function addCookiesFromResponse(Response $response, RequestInterface $request = null)
- {
- if ($cookieHeader = $response->getHeader('Set-Cookie')) {
- $parser = ParserRegistry::getInstance()->getParser('cookie');
- foreach ($cookieHeader as $cookie) {
- if ($parsed = $request
- ? $parser->parseCookie($cookie, $request->getHost(), $request->getPath())
- : $parser->parseCookie($cookie)
- ) {
- // Break up cookie v2 into multiple cookies
- foreach ($parsed['cookies'] as $key => $value) {
- $row = $parsed;
- $row['name'] = $key;
- $row['value'] = $value;
- unset($row['cookies']);
- $this->add(new Cookie($row));
- }
- }
- }
- }
- }
-
- public function getMatchingCookies(RequestInterface $request)
- {
- // Find cookies that match this request
- $cookies = $this->all($request->getHost(), $request->getPath());
- // Remove ineligible cookies
- foreach ($cookies as $index => $cookie) {
- if (!$cookie->matchesPort($request->getPort()) || ($cookie->getSecure() && $request->getScheme() != 'https')) {
- unset($cookies[$index]);
- }
- };
-
- return $cookies;
- }
-
- /**
- * If a cookie already exists and the server asks to set it again with a null value, the
- * cookie must be deleted.
- *
- * @param \Guzzle\Plugin\Cookie\Cookie $cookie
- */
- private function removeCookieIfEmpty(Cookie $cookie)
- {
- $cookieValue = $cookie->getValue();
- if ($cookieValue === null || $cookieValue === '') {
- $this->remove($cookie->getDomain(), $cookie->getPath(), $cookie->getName());
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cookie/CookieJar/CookieJarInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cookie/CookieJar/CookieJarInterface.php
deleted file mode 100644
index 7faa7d2..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cookie/CookieJar/CookieJarInterface.php
+++ /dev/null
@@ -1,85 +0,0 @@
-filename = $cookieFile;
- $this->load();
- }
-
- /**
- * Saves the file when shutting down
- */
- public function __destruct()
- {
- $this->persist();
- }
-
- /**
- * Save the contents of the data array to the file
- *
- * @throws RuntimeException if the file cannot be found or created
- */
- protected function persist()
- {
- if (false === file_put_contents($this->filename, $this->serialize())) {
- // @codeCoverageIgnoreStart
- throw new RuntimeException('Unable to open file ' . $this->filename);
- // @codeCoverageIgnoreEnd
- }
- }
-
- /**
- * Load the contents of the json formatted file into the data array and discard any unsaved state
- */
- protected function load()
- {
- $json = file_get_contents($this->filename);
- if (false === $json) {
- // @codeCoverageIgnoreStart
- throw new RuntimeException('Unable to open file ' . $this->filename);
- // @codeCoverageIgnoreEnd
- }
-
- $this->unserialize($json);
- $this->cookies = $this->cookies ?: array();
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cookie/CookiePlugin.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cookie/CookiePlugin.php
deleted file mode 100644
index df3210e..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cookie/CookiePlugin.php
+++ /dev/null
@@ -1,70 +0,0 @@
-cookieJar = $cookieJar ?: new ArrayCookieJar();
- }
-
- public static function getSubscribedEvents()
- {
- return array(
- 'request.before_send' => array('onRequestBeforeSend', 125),
- 'request.sent' => array('onRequestSent', 125)
- );
- }
-
- /**
- * Get the cookie cookieJar
- *
- * @return CookieJarInterface
- */
- public function getCookieJar()
- {
- return $this->cookieJar;
- }
-
- /**
- * Add cookies before a request is sent
- *
- * @param Event $event
- */
- public function onRequestBeforeSend(Event $event)
- {
- $request = $event['request'];
- if (!$request->getParams()->get('cookies.disable')) {
- $request->removeHeader('Cookie');
- // Find cookies that match this request
- foreach ($this->cookieJar->getMatchingCookies($request) as $cookie) {
- $request->addCookie($cookie->getName(), $cookie->getValue());
- }
- }
- }
-
- /**
- * Extract cookies from a sent request
- *
- * @param Event $event
- */
- public function onRequestSent(Event $event)
- {
- $this->cookieJar->addCookiesFromResponse($event['response'], $event['request']);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cookie/Exception/InvalidCookieException.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cookie/Exception/InvalidCookieException.php
deleted file mode 100644
index b1fa6fd..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Cookie/Exception/InvalidCookieException.php
+++ /dev/null
@@ -1,7 +0,0 @@
-=5.3.2",
- "guzzle/http": "self.version"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Plugin\\Cookie": "" }
- },
- "target-dir": "Guzzle/Plugin/Cookie",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/CurlAuth/CurlAuthPlugin.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/CurlAuth/CurlAuthPlugin.php
deleted file mode 100644
index 610e60c..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/CurlAuth/CurlAuthPlugin.php
+++ /dev/null
@@ -1,46 +0,0 @@
-getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');
- */
-class CurlAuthPlugin implements EventSubscriberInterface
-{
- private $username;
- private $password;
- private $scheme;
-
- /**
- * @param string $username HTTP basic auth username
- * @param string $password Password
- * @param int $scheme Curl auth scheme
- */
- public function __construct($username, $password, $scheme=CURLAUTH_BASIC)
- {
- Version::warn(__CLASS__ . " is deprecated. Use \$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');");
- $this->username = $username;
- $this->password = $password;
- $this->scheme = $scheme;
- }
-
- public static function getSubscribedEvents()
- {
- return array('client.create_request' => array('onRequestCreate', 255));
- }
-
- /**
- * Add basic auth
- *
- * @param Event $event
- */
- public function onRequestCreate(Event $event)
- {
- $event['request']->setAuth($this->username, $this->password, $this->scheme);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/CurlAuth/composer.json b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/CurlAuth/composer.json
deleted file mode 100644
index edc8b24..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/CurlAuth/composer.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "guzzle/plugin-curlauth",
- "description": "Guzzle cURL authorization plugin",
- "homepage": "http://guzzlephp.org/",
- "keywords": ["plugin", "curl", "guzzle"],
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.3.2",
- "guzzle/http": "self.version"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Plugin\\CurlAuth": "" }
- },
- "target-dir": "Guzzle/Plugin/CurlAuth",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/ErrorResponse/ErrorResponseExceptionInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/ErrorResponse/ErrorResponseExceptionInterface.php
deleted file mode 100644
index 5dce8bd..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/ErrorResponse/ErrorResponseExceptionInterface.php
+++ /dev/null
@@ -1,22 +0,0 @@
- array('onCommandBeforeSend', -1));
- }
-
- /**
- * Adds a listener to requests before they sent from a command
- *
- * @param Event $event Event emitted
- */
- public function onCommandBeforeSend(Event $event)
- {
- $command = $event['command'];
- if ($operation = $command->getOperation()) {
- if ($operation->getErrorResponses()) {
- $request = $command->getRequest();
- $request->getEventDispatcher()
- ->addListener('request.complete', $this->getErrorClosure($request, $command, $operation));
- }
- }
- }
-
- /**
- * @param RequestInterface $request Request that received an error
- * @param CommandInterface $command Command that created the request
- * @param Operation $operation Operation that defines the request and errors
- *
- * @return \Closure Returns a closure
- * @throws ErrorResponseException
- */
- protected function getErrorClosure(RequestInterface $request, CommandInterface $command, Operation $operation)
- {
- return function (Event $event) use ($request, $command, $operation) {
- $response = $event['response'];
- foreach ($operation->getErrorResponses() as $error) {
- if (!isset($error['class'])) {
- continue;
- }
- if (isset($error['code']) && $response->getStatusCode() != $error['code']) {
- continue;
- }
- if (isset($error['reason']) && $response->getReasonPhrase() != $error['reason']) {
- continue;
- }
- $className = $error['class'];
- $errorClassInterface = __NAMESPACE__ . '\\ErrorResponseExceptionInterface';
- if (!class_exists($className)) {
- throw new ErrorResponseException("{$className} does not exist");
- } elseif (!(in_array($errorClassInterface, class_implements($className)))) {
- throw new ErrorResponseException("{$className} must implement {$errorClassInterface}");
- }
- throw $className::fromCommand($command, $response);
- }
- };
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/ErrorResponse/Exception/ErrorResponseException.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/ErrorResponse/Exception/ErrorResponseException.php
deleted file mode 100644
index 1d89e40..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/ErrorResponse/Exception/ErrorResponseException.php
+++ /dev/null
@@ -1,7 +0,0 @@
-=5.3.2",
- "guzzle/service": "self.version"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Plugin\\ErrorResponse": "" }
- },
- "target-dir": "Guzzle/Plugin/ErrorResponse",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/History/HistoryPlugin.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/History/HistoryPlugin.php
deleted file mode 100644
index 7375e89..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/History/HistoryPlugin.php
+++ /dev/null
@@ -1,163 +0,0 @@
- array('onRequestSent', 9999));
- }
-
- /**
- * Convert to a string that contains all request and response headers
- *
- * @return string
- */
- public function __toString()
- {
- $lines = array();
- foreach ($this->transactions as $entry) {
- $response = isset($entry['response']) ? $entry['response'] : '';
- $lines[] = '> ' . trim($entry['request']) . "\n\n< " . trim($response) . "\n";
- }
-
- return implode("\n", $lines);
- }
-
- /**
- * Add a request to the history
- *
- * @param RequestInterface $request Request to add
- * @param Response $response Response of the request
- *
- * @return HistoryPlugin
- */
- public function add(RequestInterface $request, Response $response = null)
- {
- if (!$response && $request->getResponse()) {
- $response = $request->getResponse();
- }
-
- $this->transactions[] = array('request' => $request, 'response' => $response);
- if (count($this->transactions) > $this->getlimit()) {
- array_shift($this->transactions);
- }
-
- return $this;
- }
-
- /**
- * Set the max number of requests to store
- *
- * @param int $limit Limit
- *
- * @return HistoryPlugin
- */
- public function setLimit($limit)
- {
- $this->limit = (int) $limit;
-
- return $this;
- }
-
- /**
- * Get the request limit
- *
- * @return int
- */
- public function getLimit()
- {
- return $this->limit;
- }
-
- /**
- * Get all of the raw transactions in the form of an array of associative arrays containing
- * 'request' and 'response' keys.
- *
- * @return array
- */
- public function getAll()
- {
- return $this->transactions;
- }
-
- /**
- * Get the requests in the history
- *
- * @return \ArrayIterator
- */
- public function getIterator()
- {
- // Return an iterator just like the old iteration of the HistoryPlugin for BC compatibility (use getAll())
- return new \ArrayIterator(array_map(function ($entry) {
- $entry['request']->getParams()->set('actual_response', $entry['response']);
- return $entry['request'];
- }, $this->transactions));
- }
-
- /**
- * Get the number of requests in the history
- *
- * @return int
- */
- public function count()
- {
- return count($this->transactions);
- }
-
- /**
- * Get the last request sent
- *
- * @return RequestInterface
- */
- public function getLastRequest()
- {
- $last = end($this->transactions);
-
- return $last['request'];
- }
-
- /**
- * Get the last response in the history
- *
- * @return Response|null
- */
- public function getLastResponse()
- {
- $last = end($this->transactions);
-
- return isset($last['response']) ? $last['response'] : null;
- }
-
- /**
- * Clears the history
- *
- * @return HistoryPlugin
- */
- public function clear()
- {
- $this->transactions = array();
-
- return $this;
- }
-
- public function onRequestSent(Event $event)
- {
- $this->add($event['request'], $event['response']);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/History/composer.json b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/History/composer.json
deleted file mode 100644
index ba0bf2c..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/History/composer.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "guzzle/plugin-history",
- "description": "Guzzle history plugin",
- "homepage": "http://guzzlephp.org/",
- "keywords": ["plugin", "guzzle"],
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.3.2",
- "guzzle/http": "self.version"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Plugin\\History": "" }
- },
- "target-dir": "Guzzle/Plugin/History",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Log/LogPlugin.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Log/LogPlugin.php
deleted file mode 100644
index cabdea8..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Log/LogPlugin.php
+++ /dev/null
@@ -1,161 +0,0 @@
-logAdapter = $logAdapter;
- $this->formatter = $formatter instanceof MessageFormatter ? $formatter : new MessageFormatter($formatter);
- $this->wireBodies = $wireBodies;
- }
-
- /**
- * Get a log plugin that outputs full request, response, and curl error information to stderr
- *
- * @param bool $wireBodies Set to false to disable request/response body output when they use are not repeatable
- * @param resource $stream Stream to write to when logging. Defaults to STDERR when it is available
- *
- * @return self
- */
- public static function getDebugPlugin($wireBodies = true, $stream = null)
- {
- if ($stream === null) {
- if (defined('STDERR')) {
- $stream = STDERR;
- } else {
- $stream = fopen('php://output', 'w');
- }
- }
-
- return new self(new ClosureLogAdapter(function ($m) use ($stream) {
- fwrite($stream, $m . PHP_EOL);
- }), "# Request:\n{request}\n\n# Response:\n{response}\n\n# Errors: {curl_code} {curl_error}", $wireBodies);
- }
-
- public static function getSubscribedEvents()
- {
- return array(
- 'curl.callback.write' => array('onCurlWrite', 255),
- 'curl.callback.read' => array('onCurlRead', 255),
- 'request.before_send' => array('onRequestBeforeSend', 255),
- 'request.sent' => array('onRequestSent', 255)
- );
- }
-
- /**
- * Event triggered when curl data is read from a request
- *
- * @param Event $event
- */
- public function onCurlRead(Event $event)
- {
- // Stream the request body to the log if the body is not repeatable
- if ($wire = $event['request']->getParams()->get('request_wire')) {
- $wire->write($event['read']);
- }
- }
-
- /**
- * Event triggered when curl data is written to a response
- *
- * @param Event $event
- */
- public function onCurlWrite(Event $event)
- {
- // Stream the response body to the log if the body is not repeatable
- if ($wire = $event['request']->getParams()->get('response_wire')) {
- $wire->write($event['write']);
- }
- }
-
- /**
- * Called before a request is sent
- *
- * @param Event $event
- */
- public function onRequestBeforeSend(Event $event)
- {
- if ($this->wireBodies) {
- $request = $event['request'];
- // Ensure that curl IO events are emitted
- $request->getCurlOptions()->set('emit_io', true);
- // We need to make special handling for content wiring and non-repeatable streams.
- if ($request instanceof EntityEnclosingRequestInterface && $request->getBody()
- && (!$request->getBody()->isSeekable() || !$request->getBody()->isReadable())
- ) {
- // The body of the request cannot be recalled so logging the body will require us to buffer it
- $request->getParams()->set('request_wire', EntityBody::factory());
- }
- if (!$request->getResponseBody()->isRepeatable()) {
- // The body of the response cannot be recalled so logging the body will require us to buffer it
- $request->getParams()->set('response_wire', EntityBody::factory());
- }
- }
- }
-
- /**
- * Triggers the actual log write when a request completes
- *
- * @param Event $event
- */
- public function onRequestSent(Event $event)
- {
- $request = $event['request'];
- $response = $event['response'];
- $handle = $event['handle'];
-
- if ($wire = $request->getParams()->get('request_wire')) {
- $request = clone $request;
- $request->setBody($wire);
- }
-
- if ($wire = $request->getParams()->get('response_wire')) {
- $response = clone $response;
- $response->setBody($wire);
- }
-
- // Send the log message to the adapter, adding a category and host
- $priority = $response && $response->isError() ? LOG_ERR : LOG_DEBUG;
- $message = $this->formatter->format($request, $response, $handle);
- $this->logAdapter->log($message, $priority, array(
- 'request' => $request,
- 'response' => $response,
- 'handle' => $handle
- ));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Log/composer.json b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Log/composer.json
deleted file mode 100644
index 130e6da..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Log/composer.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "name": "guzzle/plugin-log",
- "description": "Guzzle log plugin for over the wire logging",
- "homepage": "http://guzzlephp.org/",
- "keywords": ["plugin", "log", "guzzle"],
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.3.2",
- "guzzle/http": "self.version",
- "guzzle/log": "self.version"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Plugin\\Log": "" }
- },
- "target-dir": "Guzzle/Plugin/Log",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Md5/CommandContentMd5Plugin.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Md5/CommandContentMd5Plugin.php
deleted file mode 100644
index 8512424..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Md5/CommandContentMd5Plugin.php
+++ /dev/null
@@ -1,57 +0,0 @@
-contentMd5Param = $contentMd5Param;
- $this->validateMd5Param = $validateMd5Param;
- }
-
- public static function getSubscribedEvents()
- {
- return array('command.before_send' => array('onCommandBeforeSend', -255));
- }
-
- public function onCommandBeforeSend(Event $event)
- {
- $command = $event['command'];
- $request = $command->getRequest();
-
- // Only add an MD5 is there is a MD5 option on the operation and it has a payload
- if ($request instanceof EntityEnclosingRequestInterface && $request->getBody()
- && $command->getOperation()->hasParam($this->contentMd5Param)) {
- // Check if an MD5 checksum value should be passed along to the request
- if ($command[$this->contentMd5Param] === true) {
- if (false !== ($md5 = $request->getBody()->getContentMd5(true, true))) {
- $request->setHeader('Content-MD5', $md5);
- }
- }
- }
-
- // Check if MD5 validation should be used with the response
- if ($command[$this->validateMd5Param] === true) {
- $request->addSubscriber(new Md5ValidatorPlugin(true, false));
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Md5/Md5ValidatorPlugin.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Md5/Md5ValidatorPlugin.php
deleted file mode 100644
index 5d7a378..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Md5/Md5ValidatorPlugin.php
+++ /dev/null
@@ -1,88 +0,0 @@
-contentLengthCutoff = $contentLengthCutoff;
- $this->contentEncoded = $contentEncoded;
- }
-
- public static function getSubscribedEvents()
- {
- return array('request.complete' => array('onRequestComplete', 255));
- }
-
- /**
- * {@inheritdoc}
- * @throws UnexpectedValueException
- */
- public function onRequestComplete(Event $event)
- {
- $response = $event['response'];
-
- if (!$contentMd5 = $response->getContentMd5()) {
- return;
- }
-
- $contentEncoding = $response->getContentEncoding();
- if ($contentEncoding && !$this->contentEncoded) {
- return false;
- }
-
- // Make sure that the size of the request is under the cutoff size
- if ($this->contentLengthCutoff) {
- $size = $response->getContentLength() ?: $response->getBody()->getSize();
- if (!$size || $size > $this->contentLengthCutoff) {
- return;
- }
- }
-
- if (!$contentEncoding) {
- $hash = $response->getBody()->getContentMd5();
- } elseif ($contentEncoding == 'gzip') {
- $response->getBody()->compress('zlib.deflate');
- $hash = $response->getBody()->getContentMd5();
- $response->getBody()->uncompress();
- } elseif ($contentEncoding == 'compress') {
- $response->getBody()->compress('bzip2.compress');
- $hash = $response->getBody()->getContentMd5();
- $response->getBody()->uncompress();
- } else {
- return;
- }
-
- if ($contentMd5 !== $hash) {
- throw new UnexpectedValueException(
- "The response entity body may have been modified over the wire. The Content-MD5 "
- . "received ({$contentMd5}) did not match the calculated MD5 hash ({$hash})."
- );
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Md5/composer.json b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Md5/composer.json
deleted file mode 100644
index 0602d06..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Md5/composer.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "guzzle/plugin-md5",
- "description": "Guzzle MD5 plugins",
- "homepage": "http://guzzlephp.org/",
- "keywords": ["plugin", "guzzle"],
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.3.2",
- "guzzle/http": "self.version"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Plugin\\Md5": "" }
- },
- "target-dir": "Guzzle/Plugin/Md5",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Mock/MockPlugin.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Mock/MockPlugin.php
deleted file mode 100644
index 2440578..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Mock/MockPlugin.php
+++ /dev/null
@@ -1,245 +0,0 @@
-readBodies = $readBodies;
- $this->temporary = $temporary;
- if ($items) {
- foreach ($items as $item) {
- if ($item instanceof \Exception) {
- $this->addException($item);
- } else {
- $this->addResponse($item);
- }
- }
- }
- }
-
- public static function getSubscribedEvents()
- {
- // Use a number lower than the CachePlugin
- return array('request.before_send' => array('onRequestBeforeSend', -999));
- }
-
- public static function getAllEvents()
- {
- return array('mock.request');
- }
-
- /**
- * Get a mock response from a file
- *
- * @param string $path File to retrieve a mock response from
- *
- * @return Response
- * @throws InvalidArgumentException if the file is not found
- */
- public static function getMockFile($path)
- {
- if (!file_exists($path)) {
- throw new InvalidArgumentException('Unable to open mock file: ' . $path);
- }
-
- return Response::fromMessage(file_get_contents($path));
- }
-
- /**
- * Set whether or not to consume the entity body of a request when a mock
- * response is used
- *
- * @param bool $readBodies Set to true to read and consume entity bodies
- *
- * @return self
- */
- public function readBodies($readBodies)
- {
- $this->readBodies = $readBodies;
-
- return $this;
- }
-
- /**
- * Returns the number of remaining mock responses
- *
- * @return int
- */
- public function count()
- {
- return count($this->queue);
- }
-
- /**
- * Add a response to the end of the queue
- *
- * @param string|Response $response Response object or path to response file
- *
- * @return MockPlugin
- * @throws InvalidArgumentException if a string or Response is not passed
- */
- public function addResponse($response)
- {
- if (!($response instanceof Response)) {
- if (!is_string($response)) {
- throw new InvalidArgumentException('Invalid response');
- }
- $response = self::getMockFile($response);
- }
-
- $this->queue[] = $response;
-
- return $this;
- }
-
- /**
- * Add an exception to the end of the queue
- *
- * @param CurlException $e Exception to throw when the request is executed
- *
- * @return MockPlugin
- */
- public function addException(CurlException $e)
- {
- $this->queue[] = $e;
-
- return $this;
- }
-
- /**
- * Clear the queue
- *
- * @return MockPlugin
- */
- public function clearQueue()
- {
- $this->queue = array();
-
- return $this;
- }
-
- /**
- * Returns an array of mock responses remaining in the queue
- *
- * @return array
- */
- public function getQueue()
- {
- return $this->queue;
- }
-
- /**
- * Check if this is a temporary plugin
- *
- * @return bool
- */
- public function isTemporary()
- {
- return $this->temporary;
- }
-
- /**
- * Get a response from the front of the list and add it to a request
- *
- * @param RequestInterface $request Request to mock
- *
- * @return self
- * @throws CurlException When request.send is called and an exception is queued
- */
- public function dequeue(RequestInterface $request)
- {
- $this->dispatch('mock.request', array('plugin' => $this, 'request' => $request));
-
- $item = array_shift($this->queue);
- if ($item instanceof Response) {
- if ($this->readBodies && $request instanceof EntityEnclosingRequestInterface) {
- $request->getEventDispatcher()->addListener('request.sent', $f = function (Event $event) use (&$f) {
- while ($data = $event['request']->getBody()->read(8096));
- // Remove the listener after one-time use
- $event['request']->getEventDispatcher()->removeListener('request.sent', $f);
- });
- }
- $request->setResponse($item);
- } elseif ($item instanceof CurlException) {
- // Emulates exceptions encountered while transferring requests
- $item->setRequest($request);
- $state = $request->setState(RequestInterface::STATE_ERROR, array('exception' => $item));
- // Only throw if the exception wasn't handled
- if ($state == RequestInterface::STATE_ERROR) {
- throw $item;
- }
- }
-
- return $this;
- }
-
- /**
- * Clear the array of received requests
- */
- public function flush()
- {
- $this->received = array();
- }
-
- /**
- * Get an array of requests that were mocked by this plugin
- *
- * @return array
- */
- public function getReceivedRequests()
- {
- return $this->received;
- }
-
- /**
- * Called when a request is about to be sent
- *
- * @param Event $event
- * @throws \OutOfBoundsException When queue is empty
- */
- public function onRequestBeforeSend(Event $event)
- {
- if (!$this->queue) {
- throw new \OutOfBoundsException('Mock queue is empty');
- }
-
- $request = $event['request'];
- $this->received[] = $request;
- // Detach the filter from the client so it's a one-time use
- if ($this->temporary && count($this->queue) == 1 && $request->getClient()) {
- $request->getClient()->getEventDispatcher()->removeSubscriber($this);
- }
- $this->dequeue($request);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Mock/composer.json b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Mock/composer.json
deleted file mode 100644
index f8201e3..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Mock/composer.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "guzzle/plugin-mock",
- "description": "Guzzle Mock plugin",
- "homepage": "http://guzzlephp.org/",
- "keywords": ["mock", "plugin", "guzzle"],
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.3.2",
- "guzzle/http": "self.version"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Plugin\\Mock": "" }
- },
- "target-dir": "Guzzle/Plugin/Mock",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Oauth/OauthPlugin.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Oauth/OauthPlugin.php
deleted file mode 100644
index 95e0c3e..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Oauth/OauthPlugin.php
+++ /dev/null
@@ -1,306 +0,0 @@
-config = Collection::fromConfig($config, array(
- 'version' => '1.0',
- 'request_method' => self::REQUEST_METHOD_HEADER,
- 'consumer_key' => 'anonymous',
- 'consumer_secret' => 'anonymous',
- 'signature_method' => 'HMAC-SHA1',
- 'signature_callback' => function($stringToSign, $key) {
- return hash_hmac('sha1', $stringToSign, $key, true);
- }
- ), array(
- 'signature_method', 'signature_callback', 'version',
- 'consumer_key', 'consumer_secret'
- ));
- }
-
- public static function getSubscribedEvents()
- {
- return array(
- 'request.before_send' => array('onRequestBeforeSend', -1000)
- );
- }
-
- /**
- * Request before-send event handler
- *
- * @param Event $event Event received
- * @return array
- * @throws \InvalidArgumentException
- */
- public function onRequestBeforeSend(Event $event)
- {
- $timestamp = $this->getTimestamp($event);
- $request = $event['request'];
- $nonce = $this->generateNonce($request);
- $authorizationParams = $this->getOauthParams($timestamp, $nonce);
- $authorizationParams['oauth_signature'] = $this->getSignature($request, $timestamp, $nonce);
-
- switch ($this->config['request_method']) {
- case self::REQUEST_METHOD_HEADER:
- $request->setHeader(
- 'Authorization',
- $this->buildAuthorizationHeader($authorizationParams)
- );
- break;
- case self::REQUEST_METHOD_QUERY:
- foreach ($authorizationParams as $key => $value) {
- $request->getQuery()->set($key, $value);
- }
- break;
- default:
- throw new \InvalidArgumentException(sprintf(
- 'Invalid consumer method "%s"',
- $this->config['request_method']
- ));
- }
-
- return $authorizationParams;
- }
-
- /**
- * Builds the Authorization header for a request
- *
- * @param array $authorizationParams Associative array of authorization parameters
- *
- * @return string
- */
- private function buildAuthorizationHeader($authorizationParams)
- {
- $authorizationString = 'OAuth ';
- foreach ($authorizationParams as $key => $val) {
- if ($val) {
- $authorizationString .= $key . '="' . urlencode($val) . '", ';
- }
- }
-
- return substr($authorizationString, 0, -2);
- }
-
- /**
- * Calculate signature for request
- *
- * @param RequestInterface $request Request to generate a signature for
- * @param integer $timestamp Timestamp to use for nonce
- * @param string $nonce
- *
- * @return string
- */
- public function getSignature(RequestInterface $request, $timestamp, $nonce)
- {
- $string = $this->getStringToSign($request, $timestamp, $nonce);
- $key = urlencode($this->config['consumer_secret']) . '&' . urlencode($this->config['token_secret']);
-
- return base64_encode(call_user_func($this->config['signature_callback'], $string, $key));
- }
-
- /**
- * Calculate string to sign
- *
- * @param RequestInterface $request Request to generate a signature for
- * @param int $timestamp Timestamp to use for nonce
- * @param string $nonce
- *
- * @return string
- */
- public function getStringToSign(RequestInterface $request, $timestamp, $nonce)
- {
- $params = $this->getParamsToSign($request, $timestamp, $nonce);
-
- // Convert booleans to strings.
- $params = $this->prepareParameters($params);
-
- // Build signing string from combined params
- $parameterString = clone $request->getQuery();
- $parameterString->replace($params);
-
- $url = Url::factory($request->getUrl())->setQuery('')->setFragment(null);
-
- return strtoupper($request->getMethod()) . '&'
- . rawurlencode($url) . '&'
- . rawurlencode((string) $parameterString);
- }
-
- /**
- * Get the oauth parameters as named by the oauth spec
- *
- * @param $timestamp
- * @param $nonce
- * @return Collection
- */
- protected function getOauthParams($timestamp, $nonce)
- {
- $params = new Collection(array(
- 'oauth_consumer_key' => $this->config['consumer_key'],
- 'oauth_nonce' => $nonce,
- 'oauth_signature_method' => $this->config['signature_method'],
- 'oauth_timestamp' => $timestamp,
- ));
-
- // Optional parameters should not be set if they have not been set in the config as
- // the parameter may be considered invalid by the Oauth service.
- $optionalParams = array(
- 'callback' => 'oauth_callback',
- 'token' => 'oauth_token',
- 'verifier' => 'oauth_verifier',
- 'version' => 'oauth_version'
- );
-
- foreach ($optionalParams as $optionName => $oauthName) {
- if (isset($this->config[$optionName]) == true) {
- $params[$oauthName] = $this->config[$optionName];
- }
- }
-
- return $params;
- }
-
- /**
- * Get all of the parameters required to sign a request including:
- * * The oauth params
- * * The request GET params
- * * The params passed in the POST body (with a content-type of application/x-www-form-urlencoded)
- *
- * @param RequestInterface $request Request to generate a signature for
- * @param integer $timestamp Timestamp to use for nonce
- * @param string $nonce
- *
- * @return array
- */
- public function getParamsToSign(RequestInterface $request, $timestamp, $nonce)
- {
- $params = $this->getOauthParams($timestamp, $nonce);
-
- // Add query string parameters
- $params->merge($request->getQuery());
-
- // Add POST fields to signing string if required
- if ($this->shouldPostFieldsBeSigned($request))
- {
- $params->merge($request->getPostFields());
- }
-
- // Sort params
- $params = $params->toArray();
- uksort($params, 'strcmp');
-
- return $params;
- }
-
- /**
- * Decide whether the post fields should be added to the base string that Oauth signs.
- * This implementation is correct. Non-conformant APIs may require that this method be
- * overwritten e.g. the Flickr API incorrectly adds the post fields when the Content-Type
- * is 'application/x-www-form-urlencoded'
- *
- * @param $request
- * @return bool Whether the post fields should be signed or not
- */
- public function shouldPostFieldsBeSigned($request)
- {
- if (!$this->config->get('disable_post_params') &&
- $request instanceof EntityEnclosingRequestInterface &&
- false !== strpos($request->getHeader('Content-Type'), 'application/x-www-form-urlencoded'))
- {
- return true;
- }
-
- return false;
- }
-
- /**
- * Returns a Nonce Based on the unique id and URL. This will allow for multiple requests in parallel with the same
- * exact timestamp to use separate nonce's.
- *
- * @param RequestInterface $request Request to generate a nonce for
- *
- * @return string
- */
- public function generateNonce(RequestInterface $request)
- {
- return sha1(uniqid('', true) . $request->getUrl());
- }
-
- /**
- * Gets timestamp from event or create new timestamp
- *
- * @param Event $event Event containing contextual information
- *
- * @return int
- */
- public function getTimestamp(Event $event)
- {
- return $event['timestamp'] ?: time();
- }
-
- /**
- * Convert booleans to strings, removed unset parameters, and sorts the array
- *
- * @param array $data Data array
- *
- * @return array
- */
- protected function prepareParameters($data)
- {
- ksort($data);
- foreach ($data as $key => &$value) {
- switch (gettype($value)) {
- case 'NULL':
- unset($data[$key]);
- break;
- case 'array':
- $data[$key] = self::prepareParameters($value);
- break;
- case 'boolean':
- $data[$key] = $value ? 'true' : 'false';
- break;
- }
- }
-
- return $data;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Oauth/composer.json b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Oauth/composer.json
deleted file mode 100644
index c9766ba..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/Oauth/composer.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "guzzle/plugin-oauth",
- "description": "Guzzle OAuth plugin",
- "homepage": "http://guzzlephp.org/",
- "keywords": ["oauth", "plugin", "guzzle"],
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.3.2",
- "guzzle/http": "self.version"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Plugin\\Oauth": "" }
- },
- "target-dir": "Guzzle/Plugin/Oauth",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/composer.json b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/composer.json
deleted file mode 100644
index 2bbe64c..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Plugin/composer.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "name": "guzzle/plugin",
- "description": "Guzzle plugin component containing all Guzzle HTTP plugins",
- "homepage": "http://guzzlephp.org/",
- "keywords": ["http", "client", "plugin", "extension", "guzzle"],
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.3.2",
- "guzzle/http": "self.version"
- },
- "suggest": {
- "guzzle/cache": "self.version",
- "guzzle/log": "self.version"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Plugin": "" }
- },
- "target-dir": "Guzzle/Plugin",
- "replace": {
- "guzzle/plugin-async": "self.version",
- "guzzle/plugin-backoff": "self.version",
- "guzzle/plugin-cache": "self.version",
- "guzzle/plugin-cookie": "self.version",
- "guzzle/plugin-curlauth": "self.version",
- "guzzle/plugin-error-response": "self.version",
- "guzzle/plugin-history": "self.version",
- "guzzle/plugin-log": "self.version",
- "guzzle/plugin-md5": "self.version",
- "guzzle/plugin-mock": "self.version",
- "guzzle/plugin-oauth": "self.version"
- },
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/AbstractConfigLoader.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/AbstractConfigLoader.php
deleted file mode 100644
index cd06f57..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/AbstractConfigLoader.php
+++ /dev/null
@@ -1,177 +0,0 @@
- 'JSON_ERROR_NONE - No errors',
- JSON_ERROR_DEPTH => 'JSON_ERROR_DEPTH - Maximum stack depth exceeded',
- JSON_ERROR_STATE_MISMATCH => 'JSON_ERROR_STATE_MISMATCH - Underflow or the modes mismatch',
- JSON_ERROR_CTRL_CHAR => 'JSON_ERROR_CTRL_CHAR - Unexpected control character found',
- JSON_ERROR_SYNTAX => 'JSON_ERROR_SYNTAX - Syntax error, malformed JSON',
- JSON_ERROR_UTF8 => 'JSON_ERROR_UTF8 - Malformed UTF-8 characters, possibly incorrectly encoded'
- );
-
- public function load($config, array $options = array())
- {
- // Reset the array of loaded files because this is a new config
- $this->loadedFiles = array();
-
- if (is_string($config)) {
- $config = $this->loadFile($config);
- } elseif (!is_array($config)) {
- throw new InvalidArgumentException('Unknown type passed to configuration loader: ' . gettype($config));
- } else {
- $this->mergeIncludes($config);
- }
-
- return $this->build($config, $options);
- }
-
- /**
- * Add an include alias to the loader
- *
- * @param string $filename Filename to alias (e.g. _foo)
- * @param string $alias Actual file to use (e.g. /path/to/foo.json)
- *
- * @return self
- */
- public function addAlias($filename, $alias)
- {
- $this->aliases[$filename] = $alias;
-
- return $this;
- }
-
- /**
- * Remove an alias from the loader
- *
- * @param string $alias Alias to remove
- *
- * @return self
- */
- public function removeAlias($alias)
- {
- unset($this->aliases[$alias]);
-
- return $this;
- }
-
- /**
- * Perform the parsing of a config file and create the end result
- *
- * @param array $config Configuration data
- * @param array $options Options to use when building
- *
- * @return mixed
- */
- protected abstract function build($config, array $options);
-
- /**
- * Load a configuration file (can load JSON or PHP files that return an array when included)
- *
- * @param string $filename File to load
- *
- * @return array
- * @throws InvalidArgumentException
- * @throws RuntimeException when the JSON cannot be parsed
- */
- protected function loadFile($filename)
- {
- if (isset($this->aliases[$filename])) {
- $filename = $this->aliases[$filename];
- }
-
- switch (pathinfo($filename, PATHINFO_EXTENSION)) {
- case 'js':
- case 'json':
- $level = error_reporting(0);
- $json = file_get_contents($filename);
- error_reporting($level);
-
- if ($json === false) {
- $err = error_get_last();
- throw new InvalidArgumentException("Unable to open {$filename}: " . $err['message']);
- }
-
- $config = json_decode($json, true);
- // Throw an exception if there was an error loading the file
- if ($error = json_last_error()) {
- $message = isset(self::$jsonErrors[$error]) ? self::$jsonErrors[$error] : 'Unknown error';
- throw new RuntimeException("Error loading JSON data from {$filename}: ({$error}) - {$message}");
- }
- break;
- case 'php':
- if (!is_readable($filename)) {
- throw new InvalidArgumentException("Unable to open {$filename} for reading");
- }
- $config = require $filename;
- if (!is_array($config)) {
- throw new InvalidArgumentException('PHP files must return an array of configuration data');
- }
- break;
- default:
- throw new InvalidArgumentException('Unknown file extension: ' . $filename);
- }
-
- // Keep track of this file being loaded to prevent infinite recursion
- $this->loadedFiles[$filename] = true;
-
- // Merge include files into the configuration array
- $this->mergeIncludes($config, dirname($filename));
-
- return $config;
- }
-
- /**
- * Merges in all include files
- *
- * @param array $config Config data that contains includes
- * @param string $basePath Base path to use when a relative path is encountered
- *
- * @return array Returns the merged and included data
- */
- protected function mergeIncludes(&$config, $basePath = null)
- {
- if (!empty($config['includes'])) {
- foreach ($config['includes'] as &$path) {
- // Account for relative paths
- if ($path[0] != DIRECTORY_SEPARATOR && !isset($this->aliases[$path]) && $basePath) {
- $path = "{$basePath}/{$path}";
- }
- // Don't load the same files more than once
- if (!isset($this->loadedFiles[$path])) {
- $this->loadedFiles[$path] = true;
- $config = $this->mergeData($this->loadFile($path), $config);
- }
- }
- }
- }
-
- /**
- * Default implementation for merging two arrays of data (uses array_merge_recursive)
- *
- * @param array $a Original data
- * @param array $b Data to merge into the original and overwrite existing values
- *
- * @return array
- */
- protected function mergeData(array $a, array $b)
- {
- return array_merge_recursive($a, $b);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Builder/ServiceBuilder.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Builder/ServiceBuilder.php
deleted file mode 100644
index 38150db..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Builder/ServiceBuilder.php
+++ /dev/null
@@ -1,189 +0,0 @@
-load($config, $globalParameters);
- }
-
- /**
- * @param array $serviceBuilderConfig Service configuration settings:
- * - name: Name of the service
- * - class: Client class to instantiate using a factory method
- * - params: array of key value pair configuration settings for the builder
- */
- public function __construct(array $serviceBuilderConfig = array())
- {
- $this->builderConfig = $serviceBuilderConfig;
- }
-
- public static function getAllEvents()
- {
- return array('service_builder.create_client');
- }
-
- public function unserialize($serialized)
- {
- $this->builderConfig = json_decode($serialized, true);
- }
-
- public function serialize()
- {
- return json_encode($this->builderConfig);
- }
-
- /**
- * Attach a plugin to every client created by the builder
- *
- * @param EventSubscriberInterface $plugin Plugin to attach to each client
- *
- * @return self
- */
- public function addGlobalPlugin(EventSubscriberInterface $plugin)
- {
- $this->plugins[] = $plugin;
-
- return $this;
- }
-
- /**
- * Get data from the service builder without triggering the building of a service
- *
- * @param string $name Name of the service to retrieve
- *
- * @return array|null
- */
- public function getData($name)
- {
- return isset($this->builderConfig[$name]) ? $this->builderConfig[$name] : null;
- }
-
- public function get($name, $throwAway = false)
- {
- if (!isset($this->builderConfig[$name])) {
-
- // Check to see if arbitrary data is being referenced
- if (isset($this->clients[$name])) {
- return $this->clients[$name];
- }
-
- // Check aliases and return a match if found
- foreach ($this->builderConfig as $actualName => $config) {
- if (isset($config['alias']) && $config['alias'] == $name) {
- return $this->get($actualName, $throwAway);
- }
- }
- throw new ServiceNotFoundException('No service is registered as ' . $name);
- }
-
- if (!$throwAway && isset($this->clients[$name])) {
- return $this->clients[$name];
- }
-
- $builder =& $this->builderConfig[$name];
-
- // Convert references to the actual client
- foreach ($builder['params'] as &$v) {
- if (is_string($v) && substr($v, 0, 1) == '{' && substr($v, -1) == '}') {
- $v = $this->get(trim($v, '{} '));
- }
- }
-
- // Get the configured parameters and merge in any parameters provided for throw-away clients
- $config = $builder['params'];
- if (is_array($throwAway)) {
- $config = $throwAway + $config;
- }
-
- $client = $builder['class']::factory($config);
-
- if (!$throwAway) {
- $this->clients[$name] = $client;
- }
-
- if ($client instanceof ClientInterface) {
- foreach ($this->plugins as $plugin) {
- $client->addSubscriber($plugin);
- }
- // Dispatch an event letting listeners know a client was created
- $this->dispatch('service_builder.create_client', array('client' => $client));
- }
-
- return $client;
- }
-
- public function set($key, $service)
- {
- if (is_array($service) && isset($service['class']) && isset($service['params'])) {
- $this->builderConfig[$key] = $service;
- } else {
- $this->clients[$key] = $service;
- }
-
- return $this;
- }
-
- public function offsetSet($offset, $value)
- {
- $this->set($offset, $value);
- }
-
- public function offsetUnset($offset)
- {
- unset($this->builderConfig[$offset]);
- unset($this->clients[$offset]);
- }
-
- public function offsetExists($offset)
- {
- return isset($this->builderConfig[$offset]) || isset($this->clients[$offset]);
- }
-
- public function offsetGet($offset)
- {
- return $this->get($offset);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Builder/ServiceBuilderInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Builder/ServiceBuilderInterface.php
deleted file mode 100644
index 4fc310a..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Builder/ServiceBuilderInterface.php
+++ /dev/null
@@ -1,40 +0,0 @@
- &$service) {
-
- $service['params'] = isset($service['params']) ? $service['params'] : array();
-
- // Check if this client builder extends another client
- if (!empty($service['extends'])) {
-
- // Make sure that the service it's extending has been defined
- if (!isset($services[$service['extends']])) {
- throw new ServiceNotFoundException(
- "{$name} is trying to extend a non-existent service: {$service['extends']}"
- );
- }
-
- $extended = &$services[$service['extends']];
-
- // Use the correct class attribute
- if (empty($service['class'])) {
- $service['class'] = isset($extended['class']) ? $extended['class'] : '';
- }
- if ($extendsParams = isset($extended['params']) ? $extended['params'] : false) {
- $service['params'] = $service['params'] + $extendsParams;
- }
- }
-
- // Overwrite default values with global parameter values
- if (!empty($options)) {
- $service['params'] = $options + $service['params'];
- }
-
- $service['class'] = isset($service['class']) ? $service['class'] : '';
- }
-
- return new $class($services);
- }
-
- protected function mergeData(array $a, array $b)
- {
- $result = $b + $a;
-
- // Merge services using a recursive union of arrays
- if (isset($a['services']) && $b['services']) {
-
- // Get a union of the services of the two arrays
- $result['services'] = $b['services'] + $a['services'];
-
- // Merge each service in using a union of the two arrays
- foreach ($result['services'] as $name => &$service) {
-
- // By default, services completely override a previously defined service unless it extends itself
- if (isset($a['services'][$name]['extends'])
- && isset($b['services'][$name]['extends'])
- && $b['services'][$name]['extends'] == $name
- ) {
- $service += $a['services'][$name];
- // Use the `extends` attribute of the parent
- $service['extends'] = $a['services'][$name]['extends'];
- // Merge parameters using a union if both have parameters
- if (isset($a['services'][$name]['params'])) {
- $service['params'] += $a['services'][$name]['params'];
- }
- }
- }
- }
-
- return $result;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/CachingConfigLoader.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/CachingConfigLoader.php
deleted file mode 100644
index 26f8360..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/CachingConfigLoader.php
+++ /dev/null
@@ -1,46 +0,0 @@
-loader = $loader;
- $this->cache = $cache;
- }
-
- public function load($config, array $options = array())
- {
- if (!is_string($config)) {
- $key = false;
- } else {
- $key = 'loader_' . crc32($config);
- if ($result = $this->cache->fetch($key)) {
- return $result;
- }
- }
-
- $result = $this->loader->load($config, $options);
- if ($key) {
- $this->cache->save($key, $result);
- }
-
- return $result;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Client.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Client.php
deleted file mode 100644
index 3e5f8e5..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Client.php
+++ /dev/null
@@ -1,297 +0,0 @@
-getCommand($method, isset($args[0]) ? $args[0] : array())->getResult();
- }
-
- public function getCommand($name, array $args = array())
- {
- // Add global client options to the command
- if ($options = $this->getConfig(self::COMMAND_PARAMS)) {
- $args += $options;
- }
-
- if (!($command = $this->getCommandFactory()->factory($name, $args))) {
- throw new InvalidArgumentException("Command was not found matching {$name}");
- }
-
- $command->setClient($this);
- $this->dispatch('client.command.create', array('client' => $this, 'command' => $command));
-
- return $command;
- }
-
- /**
- * Set the command factory used to create commands by name
- *
- * @param CommandFactoryInterface $factory Command factory
- *
- * @return self
- */
- public function setCommandFactory(CommandFactoryInterface $factory)
- {
- $this->commandFactory = $factory;
-
- return $this;
- }
-
- /**
- * Set the resource iterator factory associated with the client
- *
- * @param ResourceIteratorFactoryInterface $factory Resource iterator factory
- *
- * @return self
- */
- public function setResourceIteratorFactory(ResourceIteratorFactoryInterface $factory)
- {
- $this->resourceIteratorFactory = $factory;
-
- return $this;
- }
-
- public function getIterator($command, array $commandOptions = null, array $iteratorOptions = array())
- {
- if (!($command instanceof CommandInterface)) {
- $command = $this->getCommand($command, $commandOptions ?: array());
- }
-
- return $this->getResourceIteratorFactory()->build($command, $iteratorOptions);
- }
-
- public function execute($command)
- {
- if ($command instanceof CommandInterface) {
- $this->send($this->prepareCommand($command));
- $this->dispatch('command.after_send', array('command' => $command));
- return $command->getResult();
- } elseif (is_array($command) || $command instanceof \Traversable) {
- return $this->executeMultiple($command);
- } else {
- throw new InvalidArgumentException('Command must be a command or array of commands');
- }
- }
-
- public function setDescription(ServiceDescriptionInterface $service)
- {
- $this->serviceDescription = $service;
-
- if ($this->getCommandFactory() && $this->getCommandFactory() instanceof CompositeFactory) {
- $this->commandFactory->add(new Command\Factory\ServiceDescriptionFactory($service));
- }
-
- // If a baseUrl was set on the description, then update the client
- if ($baseUrl = $service->getBaseUrl()) {
- $this->setBaseUrl($baseUrl);
- }
-
- return $this;
- }
-
- public function getDescription()
- {
- return $this->serviceDescription;
- }
-
- /**
- * Set the inflector used with the client
- *
- * @param InflectorInterface $inflector Inflection object
- *
- * @return self
- */
- public function setInflector(InflectorInterface $inflector)
- {
- $this->inflector = $inflector;
-
- return $this;
- }
-
- /**
- * Get the inflector used with the client
- *
- * @return self
- */
- public function getInflector()
- {
- if (!$this->inflector) {
- $this->inflector = Inflector::getDefault();
- }
-
- return $this->inflector;
- }
-
- /**
- * Prepare a command for sending and get the RequestInterface object created by the command
- *
- * @param CommandInterface $command Command to prepare
- *
- * @return RequestInterface
- */
- protected function prepareCommand(CommandInterface $command)
- {
- // Set the client and prepare the command
- $request = $command->setClient($this)->prepare();
- // Set the state to new if the command was previously executed
- $request->setState(RequestInterface::STATE_NEW);
- $this->dispatch('command.before_send', array('command' => $command));
-
- return $request;
- }
-
- /**
- * Execute multiple commands in parallel
- *
- * @param array|Traversable $commands Array of CommandInterface objects to execute
- *
- * @return array Returns an array of the executed commands
- * @throws Exception\CommandTransferException
- */
- protected function executeMultiple($commands)
- {
- $requests = array();
- $commandRequests = new \SplObjectStorage();
-
- foreach ($commands as $command) {
- $request = $this->prepareCommand($command);
- $commandRequests[$request] = $command;
- $requests[] = $request;
- }
-
- try {
- $this->send($requests);
- foreach ($commands as $command) {
- $this->dispatch('command.after_send', array('command' => $command));
- }
- return $commands;
- } catch (MultiTransferException $failureException) {
- // Throw a CommandTransferException using the successful and failed commands
- $e = CommandTransferException::fromMultiTransferException($failureException);
-
- // Remove failed requests from the successful requests array and add to the failures array
- foreach ($failureException->getFailedRequests() as $request) {
- if (isset($commandRequests[$request])) {
- $e->addFailedCommand($commandRequests[$request]);
- unset($commandRequests[$request]);
- }
- }
-
- // Always emit the command after_send events for successful commands
- foreach ($commandRequests as $success) {
- $e->addSuccessfulCommand($commandRequests[$success]);
- $this->dispatch('command.after_send', array('command' => $commandRequests[$success]));
- }
-
- throw $e;
- }
- }
-
- protected function getResourceIteratorFactory()
- {
- if (!$this->resourceIteratorFactory) {
- // Build the default resource iterator factory if one is not set
- $clientClass = get_class($this);
- $prefix = substr($clientClass, 0, strrpos($clientClass, '\\'));
- $this->resourceIteratorFactory = new ResourceIteratorClassFactory(array(
- "{$prefix}\\Iterator",
- "{$prefix}\\Model"
- ));
- }
-
- return $this->resourceIteratorFactory;
- }
-
- /**
- * Get the command factory associated with the client
- *
- * @return CommandFactoryInterface
- */
- protected function getCommandFactory()
- {
- if (!$this->commandFactory) {
- $this->commandFactory = CompositeFactory::getDefaultChain($this);
- }
-
- return $this->commandFactory;
- }
-
- /**
- * @deprecated
- * @codeCoverageIgnore
- */
- public function enableMagicMethods($isEnabled)
- {
- Version::warn(__METHOD__ . ' is deprecated');
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/ClientInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/ClientInterface.php
deleted file mode 100644
index 814154f..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/ClientInterface.php
+++ /dev/null
@@ -1,68 +0,0 @@
-operation = $operation ?: $this->createOperation();
- foreach ($this->operation->getParams() as $name => $arg) {
- $currentValue = $this[$name];
- $configValue = $arg->getValue($currentValue);
- // If default or static values are set, then this should always be updated on the config object
- if ($currentValue !== $configValue) {
- $this[$name] = $configValue;
- }
- }
-
- $headers = $this[self::HEADERS_OPTION];
- if (!$headers instanceof Collection) {
- $this[self::HEADERS_OPTION] = new Collection((array) $headers);
- }
-
- // You can set a command.on_complete option in your parameters to set an onComplete callback
- if ($onComplete = $this['command.on_complete']) {
- unset($this['command.on_complete']);
- $this->setOnComplete($onComplete);
- }
-
- // Set the hidden additional parameters
- if (!$this[self::HIDDEN_PARAMS]) {
- $this[self::HIDDEN_PARAMS] = array(
- self::HEADERS_OPTION,
- self::RESPONSE_PROCESSING,
- self::HIDDEN_PARAMS,
- self::REQUEST_OPTIONS
- );
- }
-
- $this->init();
- }
-
- /**
- * Custom clone behavior
- */
- public function __clone()
- {
- $this->request = null;
- $this->result = null;
- }
-
- /**
- * Execute the command in the same manner as calling a function
- *
- * @return mixed Returns the result of {@see AbstractCommand::execute}
- */
- public function __invoke()
- {
- return $this->execute();
- }
-
- public function getName()
- {
- return $this->operation->getName();
- }
-
- /**
- * Get the API command information about the command
- *
- * @return OperationInterface
- */
- public function getOperation()
- {
- return $this->operation;
- }
-
- public function setOnComplete($callable)
- {
- if (!is_callable($callable)) {
- throw new InvalidArgumentException('The onComplete function must be callable');
- }
-
- $this->onComplete = $callable;
-
- return $this;
- }
-
- public function execute()
- {
- if (!$this->client) {
- throw new CommandException('A client must be associated with the command before it can be executed.');
- }
-
- return $this->client->execute($this);
- }
-
- public function getClient()
- {
- return $this->client;
- }
-
- public function setClient(ClientInterface $client)
- {
- $this->client = $client;
-
- return $this;
- }
-
- public function getRequest()
- {
- if (!$this->request) {
- throw new CommandException('The command must be prepared before retrieving the request');
- }
-
- return $this->request;
- }
-
- public function getResponse()
- {
- if (!$this->isExecuted()) {
- $this->execute();
- }
-
- return $this->request->getResponse();
- }
-
- public function getResult()
- {
- if (!$this->isExecuted()) {
- $this->execute();
- }
-
- if (null === $this->result) {
- $this->process();
- // Call the onComplete method if one is set
- if ($this->onComplete) {
- call_user_func($this->onComplete, $this);
- }
- }
-
- return $this->result;
- }
-
- public function setResult($result)
- {
- $this->result = $result;
-
- return $this;
- }
-
- public function isPrepared()
- {
- return $this->request !== null;
- }
-
- public function isExecuted()
- {
- return $this->request !== null && $this->request->getState() == 'complete';
- }
-
- public function prepare()
- {
- if (!$this->isPrepared()) {
- if (!$this->client) {
- throw new CommandException('A client must be associated with the command before it can be prepared.');
- }
-
- // If no response processing value was specified, then attempt to use the highest level of processing
- if (!isset($this[self::RESPONSE_PROCESSING])) {
- $this[self::RESPONSE_PROCESSING] = self::TYPE_MODEL;
- }
-
- // Notify subscribers of the client that the command is being prepared
- $this->client->dispatch('command.before_prepare', array('command' => $this));
-
- // Fail on missing required arguments, and change parameters via filters
- $this->validate();
- // Delegate to the subclass that implements the build method
- $this->build();
-
- // Add custom request headers set on the command
- if ($headers = $this[self::HEADERS_OPTION]) {
- foreach ($headers as $key => $value) {
- $this->request->setHeader($key, $value);
- }
- }
-
- // Add any curl options to the request
- if ($options = $this[Client::CURL_OPTIONS]) {
- $this->request->getCurlOptions()->overwriteWith(CurlHandle::parseCurlConfig($options));
- }
-
- // Set a custom response body
- if ($responseBody = $this[self::RESPONSE_BODY]) {
- $this->request->setResponseBody($responseBody);
- }
-
- $this->client->dispatch('command.after_prepare', array('command' => $this));
- }
-
- return $this->request;
- }
-
- /**
- * Set the validator used to validate and prepare command parameters and nested JSON schemas. If no validator is
- * set, then the command will validate using the default {@see SchemaValidator}.
- *
- * @param ValidatorInterface $validator Validator used to prepare and validate properties against a JSON schema
- *
- * @return self
- */
- public function setValidator(ValidatorInterface $validator)
- {
- $this->validator = $validator;
-
- return $this;
- }
-
- public function getRequestHeaders()
- {
- return $this[self::HEADERS_OPTION];
- }
-
- /**
- * Initialize the command (hook that can be implemented in subclasses)
- */
- protected function init() {}
-
- /**
- * Create the request object that will carry out the command
- */
- abstract protected function build();
-
- /**
- * Hook used to create an operation for concrete commands that are not associated with a service description
- *
- * @return OperationInterface
- */
- protected function createOperation()
- {
- return new Operation(array('name' => get_class($this)));
- }
-
- /**
- * Create the result of the command after the request has been completed.
- * Override this method in subclasses to customize this behavior
- */
- protected function process()
- {
- $this->result = $this[self::RESPONSE_PROCESSING] != self::TYPE_RAW
- ? DefaultResponseParser::getInstance()->parse($this)
- : $this->request->getResponse();
- }
-
- /**
- * Validate and prepare the command based on the schema and rules defined by the command's Operation object
- *
- * @throws ValidationException when validation errors occur
- */
- protected function validate()
- {
- // Do not perform request validation/transformation if it is disable
- if ($this[self::DISABLE_VALIDATION]) {
- return;
- }
-
- $errors = array();
- $validator = $this->getValidator();
- foreach ($this->operation->getParams() as $name => $schema) {
- $value = $this[$name];
- if (!$validator->validate($schema, $value)) {
- $errors = array_merge($errors, $validator->getErrors());
- } elseif ($value !== $this[$name]) {
- // Update the config value if it changed and no validation errors were encountered
- $this->data[$name] = $value;
- }
- }
-
- // Validate additional parameters
- $hidden = $this[self::HIDDEN_PARAMS];
-
- if ($properties = $this->operation->getAdditionalParameters()) {
- foreach ($this->toArray() as $name => $value) {
- // It's only additional if it isn't defined in the schema
- if (!$this->operation->hasParam($name) && !in_array($name, $hidden)) {
- // Always set the name so that error messages are useful
- $properties->setName($name);
- if (!$validator->validate($properties, $value)) {
- $errors = array_merge($errors, $validator->getErrors());
- } elseif ($value !== $this[$name]) {
- $this->data[$name] = $value;
- }
- }
- }
- }
-
- if (!empty($errors)) {
- $e = new ValidationException('Validation errors: ' . implode("\n", $errors));
- $e->setErrors($errors);
- throw $e;
- }
- }
-
- /**
- * Get the validator used to prepare and validate properties. If no validator has been set on the command, then
- * the default {@see SchemaValidator} will be used.
- *
- * @return ValidatorInterface
- */
- protected function getValidator()
- {
- if (!$this->validator) {
- $this->validator = SchemaValidator::getInstance();
- }
-
- return $this->validator;
- }
-
- /**
- * Get array of any validation errors
- * If no validator has been set then return false
- */
- public function getValidationErrors()
- {
- if (!$this->validator) {
- return false;
- }
-
- return $this->validator->getErrors();
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/ClosureCommand.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/ClosureCommand.php
deleted file mode 100644
index cb6ac40..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/ClosureCommand.php
+++ /dev/null
@@ -1,41 +0,0 @@
-request = $closure($this, $this->operation);
-
- if (!$this->request || !$this->request instanceof RequestInterface) {
- throw new UnexpectedValueException('Closure command did not return a RequestInterface object');
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/CommandInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/CommandInterface.php
deleted file mode 100644
index fbb61d2..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/CommandInterface.php
+++ /dev/null
@@ -1,128 +0,0 @@
-stopPropagation();
- }
-
- /**
- * Get the created object
- *
- * @return mixed
- */
- public function getResult()
- {
- return $this['result'];
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/DefaultRequestSerializer.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/DefaultRequestSerializer.php
deleted file mode 100644
index 2dc4acd..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/DefaultRequestSerializer.php
+++ /dev/null
@@ -1,169 +0,0 @@
-factory = $factory;
- }
-
- /**
- * Add a location visitor to the serializer
- *
- * @param string $location Location to associate with the visitor
- * @param RequestVisitorInterface $visitor Visitor to attach
- *
- * @return self
- */
- public function addVisitor($location, RequestVisitorInterface $visitor)
- {
- $this->factory->addRequestVisitor($location, $visitor);
-
- return $this;
- }
-
- public function prepare(CommandInterface $command)
- {
- $request = $this->createRequest($command);
- // Keep an array of visitors found in the operation
- $foundVisitors = array();
- $operation = $command->getOperation();
-
- // Add arguments to the request using the location attribute
- foreach ($operation->getParams() as $name => $arg) {
- /** @var $arg \Guzzle\Service\Description\Parameter */
- $location = $arg->getLocation();
- // Skip 'uri' locations because they've already been processed
- if ($location && $location != 'uri') {
- // Instantiate visitors as they are detected in the properties
- if (!isset($foundVisitors[$location])) {
- $foundVisitors[$location] = $this->factory->getRequestVisitor($location);
- }
- // Ensure that a value has been set for this parameter
- $value = $command[$name];
- if ($value !== null) {
- // Apply the parameter value with the location visitor
- $foundVisitors[$location]->visit($command, $request, $arg, $value);
- }
- }
- }
-
- // Serialize additional parameters
- if ($additional = $operation->getAdditionalParameters()) {
- if ($visitor = $this->prepareAdditionalParameters($operation, $command, $request, $additional)) {
- $foundVisitors[$additional->getLocation()] = $visitor;
- }
- }
-
- // Call the after method on each visitor found in the operation
- foreach ($foundVisitors as $visitor) {
- $visitor->after($command, $request);
- }
-
- return $request;
- }
-
- /**
- * Serialize additional parameters
- *
- * @param OperationInterface $operation Operation that owns the command
- * @param CommandInterface $command Command to prepare
- * @param RequestInterface $request Request to serialize
- * @param Parameter $additional Additional parameters
- *
- * @return null|RequestVisitorInterface
- */
- protected function prepareAdditionalParameters(
- OperationInterface $operation,
- CommandInterface $command,
- RequestInterface $request,
- Parameter $additional
- ) {
- if (!($location = $additional->getLocation())) {
- return;
- }
-
- $visitor = $this->factory->getRequestVisitor($location);
- $hidden = $command[$command::HIDDEN_PARAMS];
-
- foreach ($command->toArray() as $key => $value) {
- // Ignore values that are null or built-in command options
- if ($value !== null
- && !in_array($key, $hidden)
- && !$operation->hasParam($key)
- ) {
- $additional->setName($key);
- $visitor->visit($command, $request, $additional, $value);
- }
- }
-
- return $visitor;
- }
-
- /**
- * Create a request for the command and operation
- *
- * @param CommandInterface $command Command to create a request for
- *
- * @return RequestInterface
- */
- protected function createRequest(CommandInterface $command)
- {
- $operation = $command->getOperation();
- $client = $command->getClient();
- $options = $command[AbstractCommand::REQUEST_OPTIONS] ?: array();
-
- // If the command does not specify a template, then assume the base URL of the client
- if (!($uri = $operation->getUri())) {
- return $client->createRequest($operation->getHttpMethod(), $client->getBaseUrl(), null, null, $options);
- }
-
- // Get the path values and use the client config settings
- $variables = array();
- foreach ($operation->getParams() as $name => $arg) {
- if ($arg->getLocation() == 'uri') {
- if (isset($command[$name])) {
- $variables[$name] = $arg->filter($command[$name]);
- if (!is_array($variables[$name])) {
- $variables[$name] = (string) $variables[$name];
- }
- }
- }
- }
-
- return $client->createRequest($operation->getHttpMethod(), array($uri, $variables), null, null, $options);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/DefaultResponseParser.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/DefaultResponseParser.php
deleted file mode 100644
index 4fe3803..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/DefaultResponseParser.php
+++ /dev/null
@@ -1,55 +0,0 @@
-getRequest()->getResponse();
-
- // Account for hard coded content-type values specified in service descriptions
- if ($contentType = $command['command.expects']) {
- $response->setHeader('Content-Type', $contentType);
- } else {
- $contentType = (string) $response->getHeader('Content-Type');
- }
-
- return $this->handleParsing($command, $response, $contentType);
- }
-
- protected function handleParsing(CommandInterface $command, Response $response, $contentType)
- {
- $result = $response;
- if ($result->getBody()) {
- if (stripos($contentType, 'json') !== false) {
- $result = $result->json();
- } elseif (stripos($contentType, 'xml') !== false) {
- $result = $result->xml();
- }
- }
-
- return $result;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/Factory/AliasFactory.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/Factory/AliasFactory.php
deleted file mode 100644
index 1c5ce07..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/Factory/AliasFactory.php
+++ /dev/null
@@ -1,39 +0,0 @@
-client = $client;
- $this->aliases = $aliases;
- }
-
- public function factory($name, array $args = array())
- {
- if (isset($this->aliases[$name])) {
- try {
- return $this->client->getCommand($this->aliases[$name], $args);
- } catch (InvalidArgumentException $e) {
- return null;
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/Factory/CompositeFactory.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/Factory/CompositeFactory.php
deleted file mode 100644
index 8c46983..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/Factory/CompositeFactory.php
+++ /dev/null
@@ -1,154 +0,0 @@
-getDescription()) {
- $factories[] = new ServiceDescriptionFactory($description);
- }
- $factories[] = new ConcreteClassFactory($client);
-
- return new self($factories);
- }
-
- /**
- * @param array $factories Array of command factories
- */
- public function __construct(array $factories = array())
- {
- $this->factories = $factories;
- }
-
- /**
- * Add a command factory to the chain
- *
- * @param FactoryInterface $factory Factory to add
- * @param string|FactoryInterface $before Insert the new command factory before a command factory class or object
- * matching a class name.
- * @return CompositeFactory
- */
- public function add(FactoryInterface $factory, $before = null)
- {
- $pos = null;
-
- if ($before) {
- foreach ($this->factories as $i => $f) {
- if ($before instanceof FactoryInterface) {
- if ($f === $before) {
- $pos = $i;
- break;
- }
- } elseif (is_string($before)) {
- if ($f instanceof $before) {
- $pos = $i;
- break;
- }
- }
- }
- }
-
- if ($pos === null) {
- $this->factories[] = $factory;
- } else {
- array_splice($this->factories, $i, 0, array($factory));
- }
-
- return $this;
- }
-
- /**
- * Check if the chain contains a specific command factory
- *
- * @param FactoryInterface|string $factory Factory to check
- *
- * @return bool
- */
- public function has($factory)
- {
- return (bool) $this->find($factory);
- }
-
- /**
- * Remove a specific command factory from the chain
- *
- * @param string|FactoryInterface $factory Factory to remove by name or instance
- *
- * @return CompositeFactory
- */
- public function remove($factory = null)
- {
- if (!($factory instanceof FactoryInterface)) {
- $factory = $this->find($factory);
- }
-
- $this->factories = array_values(array_filter($this->factories, function($f) use ($factory) {
- return $f !== $factory;
- }));
-
- return $this;
- }
-
- /**
- * Get a command factory by class name
- *
- * @param string|FactoryInterface $factory Command factory class or instance
- *
- * @return null|FactoryInterface
- */
- public function find($factory)
- {
- foreach ($this->factories as $f) {
- if ($factory === $f || (is_string($factory) && $f instanceof $factory)) {
- return $f;
- }
- }
- }
-
- /**
- * Create a command using the associated command factories
- *
- * @param string $name Name of the command
- * @param array $args Command arguments
- *
- * @return CommandInterface
- */
- public function factory($name, array $args = array())
- {
- foreach ($this->factories as $factory) {
- $command = $factory->factory($name, $args);
- if ($command) {
- return $command;
- }
- }
- }
-
- public function count()
- {
- return count($this->factories);
- }
-
- public function getIterator()
- {
- return new \ArrayIterator($this->factories);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/Factory/ConcreteClassFactory.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/Factory/ConcreteClassFactory.php
deleted file mode 100644
index 0e93dea..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/Factory/ConcreteClassFactory.php
+++ /dev/null
@@ -1,47 +0,0 @@
-client = $client;
- $this->inflector = $inflector ?: Inflector::getDefault();
- }
-
- public function factory($name, array $args = array())
- {
- // Determine the class to instantiate based on the namespace of the current client and the default directory
- $prefix = $this->client->getConfig('command.prefix');
- if (!$prefix) {
- // The prefix can be specified in a factory method and is cached
- $prefix = implode('\\', array_slice(explode('\\', get_class($this->client)), 0, -1)) . '\\Command\\';
- $this->client->getConfig()->set('command.prefix', $prefix);
- }
-
- $class = $prefix . str_replace(' ', '\\', ucwords(str_replace('.', ' ', $this->inflector->camel($name))));
-
- // Create the concrete command if it exists
- if (class_exists($class)) {
- return new $class($args);
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/Factory/FactoryInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/Factory/FactoryInterface.php
deleted file mode 100644
index 35c299d..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/Factory/FactoryInterface.php
+++ /dev/null
@@ -1,21 +0,0 @@
-map = $map;
- }
-
- public function factory($name, array $args = array())
- {
- if (isset($this->map[$name])) {
- $class = $this->map[$name];
-
- return new $class($args);
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/Factory/ServiceDescriptionFactory.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/Factory/ServiceDescriptionFactory.php
deleted file mode 100644
index b943a5b..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/Factory/ServiceDescriptionFactory.php
+++ /dev/null
@@ -1,71 +0,0 @@
-setServiceDescription($description);
- $this->inflector = $inflector;
- }
-
- /**
- * Change the service description used with the factory
- *
- * @param ServiceDescriptionInterface $description Service description to use
- *
- * @return FactoryInterface
- */
- public function setServiceDescription(ServiceDescriptionInterface $description)
- {
- $this->description = $description;
-
- return $this;
- }
-
- /**
- * Returns the service description
- *
- * @return ServiceDescriptionInterface
- */
- public function getServiceDescription()
- {
- return $this->description;
- }
-
- public function factory($name, array $args = array())
- {
- $command = $this->description->getOperation($name);
-
- // If a command wasn't found, then try to uppercase the first letter and try again
- if (!$command) {
- $command = $this->description->getOperation(ucfirst($name));
- // If an inflector was passed, then attempt to get the command using snake_case inflection
- if (!$command && $this->inflector) {
- $command = $this->description->getOperation($this->inflector->snake($name));
- }
- }
-
- if ($command) {
- $class = $command->getClass();
- return new $class($args, $command, $this->description);
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/AbstractRequestVisitor.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/AbstractRequestVisitor.php
deleted file mode 100644
index adcfca1..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/AbstractRequestVisitor.php
+++ /dev/null
@@ -1,69 +0,0 @@
-resolveRecursively($value, $param)
- : $param->filter($value);
- }
-
- /**
- * Map nested parameters into the location_key based parameters
- *
- * @param array $value Value to map
- * @param Parameter $param Parameter that holds information about the current key
- *
- * @return array Returns the mapped array
- */
- protected function resolveRecursively(array $value, Parameter $param)
- {
- foreach ($value as $name => &$v) {
- switch ($param->getType()) {
- case 'object':
- if ($subParam = $param->getProperty($name)) {
- $key = $subParam->getWireName();
- $value[$key] = $this->prepareValue($v, $subParam);
- if ($name != $key) {
- unset($value[$name]);
- }
- } elseif ($param->getAdditionalProperties() instanceof Parameter) {
- $v = $this->prepareValue($v, $param->getAdditionalProperties());
- }
- break;
- case 'array':
- if ($items = $param->getItems()) {
- $v = $this->prepareValue($v, $items);
- }
- break;
- }
- }
-
- return $param->filter($value);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/BodyVisitor.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/BodyVisitor.php
deleted file mode 100644
index 168d780..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/BodyVisitor.php
+++ /dev/null
@@ -1,58 +0,0 @@
-filter($value);
- $entityBody = EntityBody::factory($value);
- $request->setBody($entityBody);
- $this->addExpectHeader($request, $entityBody, $param->getData('expect_header'));
- // Add the Content-Encoding header if one is set on the EntityBody
- if ($encoding = $entityBody->getContentEncoding()) {
- $request->setHeader('Content-Encoding', $encoding);
- }
- }
-
- /**
- * Add the appropriate expect header to a request
- *
- * @param EntityEnclosingRequestInterface $request Request to update
- * @param EntityBodyInterface $body Entity body of the request
- * @param string|int $expect Expect header setting
- */
- protected function addExpectHeader(EntityEnclosingRequestInterface $request, EntityBodyInterface $body, $expect)
- {
- // Allow the `expect` data parameter to be set to remove the Expect header from the request
- if ($expect === false) {
- $request->removeHeader('Expect');
- } elseif ($expect !== true) {
- // Default to using a MB as the point in which to start using the expect header
- $expect = $expect ?: 1048576;
- // If the expect_header value is numeric then only add if the size is greater than the cutoff
- if (is_numeric($expect) && $body->getSize()) {
- if ($body->getSize() < $expect) {
- $request->removeHeader('Expect');
- } else {
- $request->setHeader('Expect', '100-Continue');
- }
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/HeaderVisitor.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/HeaderVisitor.php
deleted file mode 100644
index 2a53754..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/HeaderVisitor.php
+++ /dev/null
@@ -1,44 +0,0 @@
-filter($value);
- if ($param->getType() == 'object' && $param->getAdditionalProperties() instanceof Parameter) {
- $this->addPrefixedHeaders($request, $param, $value);
- } else {
- $request->setHeader($param->getWireName(), $value);
- }
- }
-
- /**
- * Add a prefixed array of headers to the request
- *
- * @param RequestInterface $request Request to update
- * @param Parameter $param Parameter object
- * @param array $value Header array to add
- *
- * @throws InvalidArgumentException
- */
- protected function addPrefixedHeaders(RequestInterface $request, Parameter $param, $value)
- {
- if (!is_array($value)) {
- throw new InvalidArgumentException('An array of mapped headers expected, but received a single value');
- }
- $prefix = $param->getSentAs();
- foreach ($value as $headerName => $headerValue) {
- $request->setHeader($prefix . $headerName, $headerValue);
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/JsonVisitor.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/JsonVisitor.php
deleted file mode 100644
index 757e1c5..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/JsonVisitor.php
+++ /dev/null
@@ -1,63 +0,0 @@
-data = new \SplObjectStorage();
- }
-
- /**
- * Set the Content-Type header to add to the request if JSON is added to the body. This visitor does not add a
- * Content-Type header unless you specify one here.
- *
- * @param string $header Header to set when JSON is added (e.g. application/json)
- *
- * @return self
- */
- public function setContentTypeHeader($header = 'application/json')
- {
- $this->jsonContentType = $header;
-
- return $this;
- }
-
- public function visit(CommandInterface $command, RequestInterface $request, Parameter $param, $value)
- {
- if (isset($this->data[$command])) {
- $json = $this->data[$command];
- } else {
- $json = array();
- }
- $json[$param->getWireName()] = $this->prepareValue($value, $param);
- $this->data[$command] = $json;
- }
-
- public function after(CommandInterface $command, RequestInterface $request)
- {
- if (isset($this->data[$command])) {
- // Don't overwrite the Content-Type if one is set
- if ($this->jsonContentType && !$request->hasHeader('Content-Type')) {
- $request->setHeader('Content-Type', $this->jsonContentType);
- }
-
- $request->setBody(json_encode($this->data[$command]));
- unset($this->data[$command]);
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/PostFieldVisitor.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/PostFieldVisitor.php
deleted file mode 100644
index 975850b..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/PostFieldVisitor.php
+++ /dev/null
@@ -1,18 +0,0 @@
-setPostField($param->getWireName(), $this->prepareValue($value, $param));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/PostFileVisitor.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/PostFileVisitor.php
deleted file mode 100644
index 0853ebe..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/PostFileVisitor.php
+++ /dev/null
@@ -1,24 +0,0 @@
-filter($value);
- if ($value instanceof PostFileInterface) {
- $request->addPostFile($value);
- } else {
- $request->addPostFile($param->getWireName(), $value);
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/QueryVisitor.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/QueryVisitor.php
deleted file mode 100644
index 315877a..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/QueryVisitor.php
+++ /dev/null
@@ -1,18 +0,0 @@
-getQuery()->set($param->getWireName(), $this->prepareValue($value, $param));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/RequestVisitorInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/RequestVisitorInterface.php
deleted file mode 100644
index 14e0b2d..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/RequestVisitorInterface.php
+++ /dev/null
@@ -1,31 +0,0 @@
-setResponseBody($value);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/XmlVisitor.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/XmlVisitor.php
deleted file mode 100644
index 5b71487..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/XmlVisitor.php
+++ /dev/null
@@ -1,252 +0,0 @@
-data = new \SplObjectStorage();
- }
-
- /**
- * Change the content-type header that is added when XML is found
- *
- * @param string $header Header to set when XML is found
- *
- * @return self
- */
- public function setContentTypeHeader($header)
- {
- $this->contentType = $header;
-
- return $this;
- }
-
- public function visit(CommandInterface $command, RequestInterface $request, Parameter $param, $value)
- {
- $xml = isset($this->data[$command])
- ? $this->data[$command]
- : $this->createRootElement($param->getParent());
- $this->addXml($xml, $param, $value);
-
- $this->data[$command] = $xml;
- }
-
- public function after(CommandInterface $command, RequestInterface $request)
- {
- $xml = null;
-
- // If data was found that needs to be serialized, then do so
- if (isset($this->data[$command])) {
- $xml = $this->finishDocument($this->data[$command]);
- unset($this->data[$command]);
- } else {
- // Check if XML should always be sent for the command
- $operation = $command->getOperation();
- if ($operation->getData('xmlAllowEmpty')) {
- $xmlWriter = $this->createRootElement($operation);
- $xml = $this->finishDocument($xmlWriter);
- }
- }
-
- if ($xml) {
- // Don't overwrite the Content-Type if one is set
- if ($this->contentType && !$request->hasHeader('Content-Type')) {
- $request->setHeader('Content-Type', $this->contentType);
- }
- $request->setBody($xml);
- }
- }
-
- /**
- * Create the root XML element to use with a request
- *
- * @param Operation $operation Operation object
- *
- * @return \XMLWriter
- */
- protected function createRootElement(Operation $operation)
- {
- static $defaultRoot = array('name' => 'Request');
- // If no root element was specified, then just wrap the XML in 'Request'
- $root = $operation->getData('xmlRoot') ?: $defaultRoot;
- // Allow the XML declaration to be customized with xmlEncoding
- $encoding = $operation->getData('xmlEncoding');
-
- $xmlWriter = $this->startDocument($encoding);
-
- $xmlWriter->startElement($root['name']);
- // Create the wrapping element with no namespaces if no namespaces were present
- if (!empty($root['namespaces'])) {
- // Create the wrapping element with an array of one or more namespaces
- foreach ((array) $root['namespaces'] as $prefix => $uri) {
- $nsLabel = 'xmlns';
- if (!is_numeric($prefix)) {
- $nsLabel .= ':'.$prefix;
- }
- $xmlWriter->writeAttribute($nsLabel, $uri);
- }
- }
- return $xmlWriter;
- }
-
- /**
- * Recursively build the XML body
- *
- * @param \XMLWriter $xmlWriter XML to modify
- * @param Parameter $param API Parameter
- * @param mixed $value Value to add
- */
- protected function addXml(\XMLWriter $xmlWriter, Parameter $param, $value)
- {
- if ($value === null) {
- return;
- }
-
- $value = $param->filter($value);
- $type = $param->getType();
- $name = $param->getWireName();
- $prefix = null;
- $namespace = $param->getData('xmlNamespace');
- if (false !== strpos($name, ':')) {
- list($prefix, $name) = explode(':', $name, 2);
- }
-
- if ($type == 'object' || $type == 'array') {
- if (!$param->getData('xmlFlattened')) {
- $xmlWriter->startElementNS(null, $name, $namespace);
- }
- if ($param->getType() == 'array') {
- $this->addXmlArray($xmlWriter, $param, $value);
- } elseif ($param->getType() == 'object') {
- $this->addXmlObject($xmlWriter, $param, $value);
- }
- if (!$param->getData('xmlFlattened')) {
- $xmlWriter->endElement();
- }
- return;
- }
- if ($param->getData('xmlAttribute')) {
- $this->writeAttribute($xmlWriter, $prefix, $name, $namespace, $value);
- } else {
- $this->writeElement($xmlWriter, $prefix, $name, $namespace, $value);
- }
- }
-
- /**
- * Write an attribute with namespace if used
- *
- * @param \XMLWriter $xmlWriter XMLWriter instance
- * @param string $prefix Namespace prefix if any
- * @param string $name Attribute name
- * @param string $namespace The uri of the namespace
- * @param string $value The attribute content
- */
- protected function writeAttribute($xmlWriter, $prefix, $name, $namespace, $value)
- {
- if (empty($namespace)) {
- $xmlWriter->writeAttribute($name, $value);
- } else {
- $xmlWriter->writeAttributeNS($prefix, $name, $namespace, $value);
- }
- }
-
- /**
- * Write an element with namespace if used
- *
- * @param \XMLWriter $xmlWriter XML writer resource
- * @param string $prefix Namespace prefix if any
- * @param string $name Element name
- * @param string $namespace The uri of the namespace
- * @param string $value The element content
- */
- protected function writeElement(\XMLWriter $xmlWriter, $prefix, $name, $namespace, $value)
- {
- $xmlWriter->startElementNS($prefix, $name, $namespace);
- if (strpbrk($value, '<>&')) {
- $xmlWriter->writeCData($value);
- } else {
- $xmlWriter->writeRaw($value);
- }
- $xmlWriter->endElement();
- }
-
- /**
- * Create a new xml writer and start a document
- *
- * @param string $encoding document encoding
- *
- * @return \XMLWriter the writer resource
- */
- protected function startDocument($encoding)
- {
- $xmlWriter = new \XMLWriter();
- $xmlWriter->openMemory();
- $xmlWriter->startDocument('1.0', $encoding);
-
- return $xmlWriter;
- }
-
- /**
- * End the document and return the output
- *
- * @param \XMLWriter $xmlWriter
- *
- * @return \string the writer resource
- */
- protected function finishDocument($xmlWriter)
- {
- $xmlWriter->endDocument();
-
- return $xmlWriter->outputMemory();
- }
-
- /**
- * Add an array to the XML
- */
- protected function addXmlArray(\XMLWriter $xmlWriter, Parameter $param, &$value)
- {
- if ($items = $param->getItems()) {
- foreach ($value as $v) {
- $this->addXml($xmlWriter, $items, $v);
- }
- }
- }
-
- /**
- * Add an object to the XML
- */
- protected function addXmlObject(\XMLWriter $xmlWriter, Parameter $param, &$value)
- {
- $noAttributes = array();
- // add values which have attributes
- foreach ($value as $name => $v) {
- if ($property = $param->getProperty($name)) {
- if ($property->getData('xmlAttribute')) {
- $this->addXml($xmlWriter, $property, $v);
- } else {
- $noAttributes[] = array('value' => $v, 'property' => $property);
- }
- }
- }
- // now add values with no attributes
- foreach ($noAttributes as $element) {
- $this->addXml($xmlWriter, $element['property'], $element['value']);
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/AbstractResponseVisitor.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/AbstractResponseVisitor.php
deleted file mode 100644
index d87eeb9..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/AbstractResponseVisitor.php
+++ /dev/null
@@ -1,26 +0,0 @@
-getName()] = $param->filter($response->getBody());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/HeaderVisitor.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/HeaderVisitor.php
deleted file mode 100644
index 0f8737c..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/HeaderVisitor.php
+++ /dev/null
@@ -1,50 +0,0 @@
-getType() == 'object' && $param->getAdditionalProperties() instanceof Parameter) {
- $this->processPrefixedHeaders($response, $param, $value);
- } else {
- $value[$param->getName()] = $param->filter((string) $response->getHeader($param->getWireName()));
- }
- }
-
- /**
- * Process a prefixed header array
- *
- * @param Response $response Response that contains the headers
- * @param Parameter $param Parameter object
- * @param array $value Value response array to modify
- */
- protected function processPrefixedHeaders(Response $response, Parameter $param, &$value)
- {
- // Grab prefixed headers that should be placed into an array with the prefix stripped
- if ($prefix = $param->getSentAs()) {
- $container = $param->getName();
- $len = strlen($prefix);
- // Find all matching headers and place them into the containing element
- foreach ($response->getHeaders()->toArray() as $key => $header) {
- if (stripos($key, $prefix) === 0) {
- // Account for multi-value headers
- $value[$container][substr($key, $len)] = count($header) == 1 ? end($header) : $header;
- }
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/JsonVisitor.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/JsonVisitor.php
deleted file mode 100644
index a609ebd..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/JsonVisitor.php
+++ /dev/null
@@ -1,93 +0,0 @@
-getResponse()->json();
- }
-
- public function visit(
- CommandInterface $command,
- Response $response,
- Parameter $param,
- &$value,
- $context = null
- ) {
- $name = $param->getName();
- $key = $param->getWireName();
- if (isset($value[$key])) {
- $this->recursiveProcess($param, $value[$key]);
- if ($key != $name) {
- $value[$name] = $value[$key];
- unset($value[$key]);
- }
- }
- }
-
- /**
- * Recursively process a parameter while applying filters
- *
- * @param Parameter $param API parameter being validated
- * @param mixed $value Value to validate and process. The value may change during this process.
- */
- protected function recursiveProcess(Parameter $param, &$value)
- {
- if ($value === null) {
- return;
- }
-
- if (is_array($value)) {
- $type = $param->getType();
- if ($type == 'array') {
- foreach ($value as &$item) {
- $this->recursiveProcess($param->getItems(), $item);
- }
- } elseif ($type == 'object' && !isset($value[0])) {
- // On the above line, we ensure that the array is associative and not numerically indexed
- $knownProperties = array();
- if ($properties = $param->getProperties()) {
- foreach ($properties as $property) {
- $name = $property->getName();
- $key = $property->getWireName();
- $knownProperties[$name] = 1;
- if (isset($value[$key])) {
- $this->recursiveProcess($property, $value[$key]);
- if ($key != $name) {
- $value[$name] = $value[$key];
- unset($value[$key]);
- }
- }
- }
- }
-
- // Remove any unknown and potentially unsafe properties
- if ($param->getAdditionalProperties() === false) {
- $value = array_intersect_key($value, $knownProperties);
- } elseif (($additional = $param->getAdditionalProperties()) !== true) {
- // Validate and filter additional properties
- foreach ($value as &$v) {
- $this->recursiveProcess($additional, $v);
- }
- }
- }
- }
-
- $value = $param->filter($value);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/ReasonPhraseVisitor.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/ReasonPhraseVisitor.php
deleted file mode 100644
index 1b10ebc..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/ReasonPhraseVisitor.php
+++ /dev/null
@@ -1,23 +0,0 @@
-getName()] = $response->getReasonPhrase();
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/ResponseVisitorInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/ResponseVisitorInterface.php
deleted file mode 100644
index 033f40c..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/ResponseVisitorInterface.php
+++ /dev/null
@@ -1,46 +0,0 @@
-getName()] = $response->getStatusCode();
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/XmlVisitor.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/XmlVisitor.php
deleted file mode 100644
index bb7124b..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Response/XmlVisitor.php
+++ /dev/null
@@ -1,151 +0,0 @@
-getResponse()->xml()), true);
- }
-
- public function visit(
- CommandInterface $command,
- Response $response,
- Parameter $param,
- &$value,
- $context = null
- ) {
- $sentAs = $param->getWireName();
- $name = $param->getName();
- if (isset($value[$sentAs])) {
- $this->recursiveProcess($param, $value[$sentAs]);
- if ($name != $sentAs) {
- $value[$name] = $value[$sentAs];
- unset($value[$sentAs]);
- }
- }
- }
-
- /**
- * Recursively process a parameter while applying filters
- *
- * @param Parameter $param API parameter being processed
- * @param mixed $value Value to validate and process. The value may change during this process.
- */
- protected function recursiveProcess(Parameter $param, &$value)
- {
- $type = $param->getType();
-
- if (!is_array($value)) {
- if ($type == 'array') {
- // Cast to an array if the value was a string, but should be an array
- $this->recursiveProcess($param->getItems(), $value);
- $value = array($value);
- }
- } elseif ($type == 'object') {
- $this->processObject($param, $value);
- } elseif ($type == 'array') {
- $this->processArray($param, $value);
- } elseif ($type == 'string' && gettype($value) == 'array') {
- $value = '';
- }
-
- if ($value !== null) {
- $value = $param->filter($value);
- }
- }
-
- /**
- * Process an array
- *
- * @param Parameter $param API parameter being parsed
- * @param mixed $value Value to process
- */
- protected function processArray(Parameter $param, &$value)
- {
- // Convert the node if it was meant to be an array
- if (!isset($value[0])) {
- // Collections fo nodes are sometimes wrapped in an additional array. For example:
- // 1 2 should become:
- // array('Items' => array(array('a' => 1), array('a' => 2))
- // Some nodes are not wrapped. For example: 1 2
- // should become array('Foo' => array(array('a' => 1), array('a' => 2))
- if ($param->getItems() && isset($value[$param->getItems()->getWireName()])) {
- // Account for the case of a collection wrapping wrapped nodes: Items => Item[]
- $value = $value[$param->getItems()->getWireName()];
- // If the wrapped node only had one value, then make it an array of nodes
- if (!isset($value[0]) || !is_array($value)) {
- $value = array($value);
- }
- } elseif (!empty($value)) {
- // Account for repeated nodes that must be an array: Foo => Baz, Foo => Baz, but only if the
- // value is set and not empty
- $value = array($value);
- }
- }
-
- foreach ($value as &$item) {
- $this->recursiveProcess($param->getItems(), $item);
- }
- }
-
- /**
- * Process an object
- *
- * @param Parameter $param API parameter being parsed
- * @param mixed $value Value to process
- */
- protected function processObject(Parameter $param, &$value)
- {
- // Ensure that the array is associative and not numerically indexed
- if (!isset($value[0]) && ($properties = $param->getProperties())) {
- $knownProperties = array();
- foreach ($properties as $property) {
- $name = $property->getName();
- $sentAs = $property->getWireName();
- $knownProperties[$name] = 1;
- if ($property->getData('xmlAttribute')) {
- $this->processXmlAttribute($property, $value);
- } elseif (isset($value[$sentAs])) {
- $this->recursiveProcess($property, $value[$sentAs]);
- if ($name != $sentAs) {
- $value[$name] = $value[$sentAs];
- unset($value[$sentAs]);
- }
- }
- }
-
- // Remove any unknown and potentially unsafe properties
- if ($param->getAdditionalProperties() === false) {
- $value = array_intersect_key($value, $knownProperties);
- }
- }
- }
-
- /**
- * Process an XML attribute property
- *
- * @param Parameter $property Property to process
- * @param array $value Value to process and update
- */
- protected function processXmlAttribute(Parameter $property, array &$value)
- {
- $sentAs = $property->getWireName();
- if (isset($value['@attributes'][$sentAs])) {
- $value[$property->getName()] = $value['@attributes'][$sentAs];
- unset($value['@attributes'][$sentAs]);
- if (empty($value['@attributes'])) {
- unset($value['@attributes']);
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/VisitorFlyweight.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/VisitorFlyweight.php
deleted file mode 100644
index 74cb628..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/VisitorFlyweight.php
+++ /dev/null
@@ -1,138 +0,0 @@
- 'Guzzle\Service\Command\LocationVisitor\Request\BodyVisitor',
- 'request.header' => 'Guzzle\Service\Command\LocationVisitor\Request\HeaderVisitor',
- 'request.json' => 'Guzzle\Service\Command\LocationVisitor\Request\JsonVisitor',
- 'request.postField' => 'Guzzle\Service\Command\LocationVisitor\Request\PostFieldVisitor',
- 'request.postFile' => 'Guzzle\Service\Command\LocationVisitor\Request\PostFileVisitor',
- 'request.query' => 'Guzzle\Service\Command\LocationVisitor\Request\QueryVisitor',
- 'request.response_body' => 'Guzzle\Service\Command\LocationVisitor\Request\ResponseBodyVisitor',
- 'request.responseBody' => 'Guzzle\Service\Command\LocationVisitor\Request\ResponseBodyVisitor',
- 'request.xml' => 'Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor',
- 'response.body' => 'Guzzle\Service\Command\LocationVisitor\Response\BodyVisitor',
- 'response.header' => 'Guzzle\Service\Command\LocationVisitor\Response\HeaderVisitor',
- 'response.json' => 'Guzzle\Service\Command\LocationVisitor\Response\JsonVisitor',
- 'response.reasonPhrase' => 'Guzzle\Service\Command\LocationVisitor\Response\ReasonPhraseVisitor',
- 'response.statusCode' => 'Guzzle\Service\Command\LocationVisitor\Response\StatusCodeVisitor',
- 'response.xml' => 'Guzzle\Service\Command\LocationVisitor\Response\XmlVisitor'
- );
-
- /** @var array Array of mappings of location names to classes */
- protected $mappings;
-
- /** @var array Cache of instantiated visitors */
- protected $cache = array();
-
- /**
- * @return self
- * @codeCoverageIgnore
- */
- public static function getInstance()
- {
- if (!self::$instance) {
- self::$instance = new self();
- }
-
- return self::$instance;
- }
-
- /**
- * @param array $mappings Array mapping request.name and response.name to location visitor classes. Leave null to
- * use the default values.
- */
- public function __construct(array $mappings = null)
- {
- $this->mappings = $mappings === null ? self::$defaultMappings : $mappings;
- }
-
- /**
- * Get an instance of a request visitor by location name
- *
- * @param string $visitor Visitor name
- *
- * @return RequestVisitorInterface
- */
- public function getRequestVisitor($visitor)
- {
- return $this->getKey('request.' . $visitor);
- }
-
- /**
- * Get an instance of a response visitor by location name
- *
- * @param string $visitor Visitor name
- *
- * @return ResponseVisitorInterface
- */
- public function getResponseVisitor($visitor)
- {
- return $this->getKey('response.' . $visitor);
- }
-
- /**
- * Add a response visitor to the factory by name
- *
- * @param string $name Name of the visitor
- * @param RequestVisitorInterface $visitor Visitor to add
- *
- * @return self
- */
- public function addRequestVisitor($name, RequestVisitorInterface $visitor)
- {
- $this->cache['request.' . $name] = $visitor;
-
- return $this;
- }
-
- /**
- * Add a response visitor to the factory by name
- *
- * @param string $name Name of the visitor
- * @param ResponseVisitorInterface $visitor Visitor to add
- *
- * @return self
- */
- public function addResponseVisitor($name, ResponseVisitorInterface $visitor)
- {
- $this->cache['response.' . $name] = $visitor;
-
- return $this;
- }
-
- /**
- * Get a visitor by key value name
- *
- * @param string $key Key name to retrieve
- *
- * @return mixed
- * @throws InvalidArgumentException
- */
- private function getKey($key)
- {
- if (!isset($this->cache[$key])) {
- if (!isset($this->mappings[$key])) {
- list($type, $name) = explode('.', $key);
- throw new InvalidArgumentException("No {$type} visitor has been mapped for {$name}");
- }
- $this->cache[$key] = new $this->mappings[$key];
- }
-
- return $this->cache[$key];
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/OperationCommand.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/OperationCommand.php
deleted file mode 100644
index 0748b5a..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/OperationCommand.php
+++ /dev/null
@@ -1,89 +0,0 @@
-responseParser = $parser;
-
- return $this;
- }
-
- /**
- * Set the request serializer used with the command
- *
- * @param RequestSerializerInterface $serializer Request serializer
- *
- * @return self
- */
- public function setRequestSerializer(RequestSerializerInterface $serializer)
- {
- $this->requestSerializer = $serializer;
-
- return $this;
- }
-
- /**
- * Get the request serializer used with the command
- *
- * @return RequestSerializerInterface
- */
- public function getRequestSerializer()
- {
- if (!$this->requestSerializer) {
- // Use the default request serializer if none was found
- $this->requestSerializer = DefaultRequestSerializer::getInstance();
- }
-
- return $this->requestSerializer;
- }
-
- /**
- * Get the response parser used for the operation
- *
- * @return ResponseParserInterface
- */
- public function getResponseParser()
- {
- if (!$this->responseParser) {
- // Use the default response parser if none was found
- $this->responseParser = OperationResponseParser::getInstance();
- }
-
- return $this->responseParser;
- }
-
- protected function build()
- {
- // Prepare and serialize the request
- $this->request = $this->getRequestSerializer()->prepare($this);
- }
-
- protected function process()
- {
- // Do not process the response if 'command.response_processing' is set to 'raw'
- $this->result = $this[self::RESPONSE_PROCESSING] == self::TYPE_RAW
- ? $this->request->getResponse()
- : $this->getResponseParser()->parse($this);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/OperationResponseParser.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/OperationResponseParser.php
deleted file mode 100644
index ca00bc0..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/OperationResponseParser.php
+++ /dev/null
@@ -1,195 +0,0 @@
-factory = $factory;
- $this->schemaInModels = $schemaInModels;
- }
-
- /**
- * Add a location visitor to the command
- *
- * @param string $location Location to associate with the visitor
- * @param ResponseVisitorInterface $visitor Visitor to attach
- *
- * @return self
- */
- public function addVisitor($location, ResponseVisitorInterface $visitor)
- {
- $this->factory->addResponseVisitor($location, $visitor);
-
- return $this;
- }
-
- protected function handleParsing(CommandInterface $command, Response $response, $contentType)
- {
- $operation = $command->getOperation();
- $type = $operation->getResponseType();
- $model = null;
-
- if ($type == OperationInterface::TYPE_MODEL) {
- $model = $operation->getServiceDescription()->getModel($operation->getResponseClass());
- } elseif ($type == OperationInterface::TYPE_CLASS) {
- return $this->parseClass($command);
- }
-
- if (!$model) {
- // Return basic processing if the responseType is not model or the model cannot be found
- return parent::handleParsing($command, $response, $contentType);
- } elseif ($command[AbstractCommand::RESPONSE_PROCESSING] != AbstractCommand::TYPE_MODEL) {
- // Returns a model with no visiting if the command response processing is not model
- return new Model(parent::handleParsing($command, $response, $contentType));
- } else {
- // Only inject the schema into the model if "schemaInModel" is true
- return new Model($this->visitResult($model, $command, $response), $this->schemaInModels ? $model : null);
- }
- }
-
- /**
- * Parse a class object
- *
- * @param CommandInterface $command Command to parse into an object
- *
- * @return mixed
- * @throws ResponseClassException
- */
- protected function parseClass(CommandInterface $command)
- {
- // Emit the operation.parse_class event. If a listener injects a 'result' property, then that will be the result
- $event = new CreateResponseClassEvent(array('command' => $command));
- $command->getClient()->getEventDispatcher()->dispatch('command.parse_response', $event);
- if ($result = $event->getResult()) {
- return $result;
- }
-
- $className = $command->getOperation()->getResponseClass();
- if (!method_exists($className, 'fromCommand')) {
- throw new ResponseClassException("{$className} must exist and implement a static fromCommand() method");
- }
-
- return $className::fromCommand($command);
- }
-
- /**
- * Perform transformations on the result array
- *
- * @param Parameter $model Model that defines the structure
- * @param CommandInterface $command Command that performed the operation
- * @param Response $response Response received
- *
- * @return array Returns the array of result data
- */
- protected function visitResult(Parameter $model, CommandInterface $command, Response $response)
- {
- $foundVisitors = $result = $knownProps = array();
- $props = $model->getProperties();
-
- foreach ($props as $schema) {
- if ($location = $schema->getLocation()) {
- // Trigger the before method on the first found visitor of this type
- if (!isset($foundVisitors[$location])) {
- $foundVisitors[$location] = $this->factory->getResponseVisitor($location);
- $foundVisitors[$location]->before($command, $result);
- }
- }
- }
-
- // Visit additional properties when it is an actual schema
- if (($additional = $model->getAdditionalProperties()) instanceof Parameter) {
- $this->visitAdditionalProperties($model, $command, $response, $additional, $result, $foundVisitors);
- }
-
- // Apply the parameter value with the location visitor
- foreach ($props as $schema) {
- $knownProps[$schema->getName()] = 1;
- if ($location = $schema->getLocation()) {
- $foundVisitors[$location]->visit($command, $response, $schema, $result);
- }
- }
-
- // Remove any unknown and potentially unsafe top-level properties
- if ($additional === false) {
- $result = array_intersect_key($result, $knownProps);
- }
-
- // Call the after() method of each found visitor
- foreach ($foundVisitors as $visitor) {
- $visitor->after($command);
- }
-
- return $result;
- }
-
- protected function visitAdditionalProperties(
- Parameter $model,
- CommandInterface $command,
- Response $response,
- Parameter $additional,
- &$result,
- array &$foundVisitors
- ) {
- // Only visit when a location is specified
- if ($location = $additional->getLocation()) {
- if (!isset($foundVisitors[$location])) {
- $foundVisitors[$location] = $this->factory->getResponseVisitor($location);
- $foundVisitors[$location]->before($command, $result);
- }
- // Only traverse if an array was parsed from the before() visitors
- if (is_array($result)) {
- // Find each additional property
- foreach (array_keys($result) as $key) {
- // Check if the model actually knows this property. If so, then it is not additional
- if (!$model->getProperty($key)) {
- // Set the name to the key so that we can parse it with each visitor
- $additional->setName($key);
- $foundVisitors[$location]->visit($command, $response, $additional, $result);
- }
- }
- // Reset the additionalProperties name to null
- $additional->setName(null);
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/RequestSerializerInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/RequestSerializerInterface.php
deleted file mode 100644
index 60b9334..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Command/RequestSerializerInterface.php
+++ /dev/null
@@ -1,21 +0,0 @@
- true, 'httpMethod' => true, 'uri' => true, 'class' => true, 'responseClass' => true,
- 'responseType' => true, 'responseNotes' => true, 'notes' => true, 'summary' => true, 'documentationUrl' => true,
- 'deprecated' => true, 'data' => true, 'parameters' => true, 'additionalParameters' => true,
- 'errorResponses' => true
- );
-
- /** @var array Parameters */
- protected $parameters = array();
-
- /** @var Parameter Additional parameters schema */
- protected $additionalParameters;
-
- /** @var string Name of the command */
- protected $name;
-
- /** @var string HTTP method */
- protected $httpMethod;
-
- /** @var string This is a short summary of what the operation does */
- protected $summary;
-
- /** @var string A longer text field to explain the behavior of the operation. */
- protected $notes;
-
- /** @var string Reference URL providing more information about the operation */
- protected $documentationUrl;
-
- /** @var string HTTP URI of the command */
- protected $uri;
-
- /** @var string Class of the command object */
- protected $class;
-
- /** @var string This is what is returned from the method */
- protected $responseClass;
-
- /** @var string Type information about the response */
- protected $responseType;
-
- /** @var string Information about the response returned by the operation */
- protected $responseNotes;
-
- /** @var bool Whether or not the command is deprecated */
- protected $deprecated;
-
- /** @var array Array of errors that could occur when running the command */
- protected $errorResponses;
-
- /** @var ServiceDescriptionInterface */
- protected $description;
-
- /** @var array Extra operation information */
- protected $data;
-
- /**
- * Builds an Operation object using an array of configuration data:
- * - name: (string) Name of the command
- * - httpMethod: (string) HTTP method of the operation
- * - uri: (string) URI template that can create a relative or absolute URL
- * - class: (string) Concrete class that implements this command
- * - parameters: (array) Associative array of parameters for the command. {@see Parameter} for information.
- * - summary: (string) This is a short summary of what the operation does
- * - notes: (string) A longer text field to explain the behavior of the operation.
- * - documentationUrl: (string) Reference URL providing more information about the operation
- * - responseClass: (string) This is what is returned from the method. Can be a primitive, PSR-0 compliant
- * class name, or model.
- * - responseNotes: (string) Information about the response returned by the operation
- * - responseType: (string) One of 'primitive', 'class', 'model', or 'documentation'. If not specified, this
- * value will be automatically inferred based on whether or not there is a model matching the
- * name, if a matching PSR-0 compliant class name is found, or set to 'primitive' by default.
- * - deprecated: (bool) Set to true if this is a deprecated command
- * - errorResponses: (array) Errors that could occur when executing the command. Array of hashes, each with a
- * 'code' (the HTTP response code), 'reason' (response reason phrase or description of the
- * error), and 'class' (a custom exception class that would be thrown if the error is
- * encountered).
- * - data: (array) Any extra data that might be used to help build or serialize the operation
- * - additionalParameters: (null|array) Parameter schema to use when an option is passed to the operation that is
- * not in the schema
- *
- * @param array $config Array of configuration data
- * @param ServiceDescriptionInterface $description Service description used to resolve models if $ref tags are found
- */
- public function __construct(array $config = array(), ServiceDescriptionInterface $description = null)
- {
- $this->description = $description;
-
- // Get the intersection of the available properties and properties set on the operation
- foreach (array_intersect_key($config, self::$properties) as $key => $value) {
- $this->{$key} = $value;
- }
-
- $this->class = $this->class ?: self::DEFAULT_COMMAND_CLASS;
- $this->deprecated = (bool) $this->deprecated;
- $this->errorResponses = $this->errorResponses ?: array();
- $this->data = $this->data ?: array();
-
- if (!$this->responseClass) {
- $this->responseClass = 'array';
- $this->responseType = 'primitive';
- } elseif ($this->responseType) {
- // Set the response type to perform validation
- $this->setResponseType($this->responseType);
- } else {
- // A response class was set and no response type was set, so guess what the type is
- $this->inferResponseType();
- }
-
- // Parameters need special handling when adding
- if ($this->parameters) {
- foreach ($this->parameters as $name => $param) {
- if ($param instanceof Parameter) {
- $param->setName($name)->setParent($this);
- } elseif (is_array($param)) {
- $param['name'] = $name;
- $this->addParam(new Parameter($param, $this->description));
- }
- }
- }
-
- if ($this->additionalParameters) {
- if ($this->additionalParameters instanceof Parameter) {
- $this->additionalParameters->setParent($this);
- } elseif (is_array($this->additionalParameters)) {
- $this->setadditionalParameters(new Parameter($this->additionalParameters, $this->description));
- }
- }
- }
-
- public function toArray()
- {
- $result = array();
- // Grab valid properties and filter out values that weren't set
- foreach (array_keys(self::$properties) as $check) {
- if ($value = $this->{$check}) {
- $result[$check] = $value;
- }
- }
- // Remove the name property
- unset($result['name']);
- // Parameters need to be converted to arrays
- $result['parameters'] = array();
- foreach ($this->parameters as $key => $param) {
- $result['parameters'][$key] = $param->toArray();
- }
- // Additional parameters need to be cast to an array
- if ($this->additionalParameters instanceof Parameter) {
- $result['additionalParameters'] = $this->additionalParameters->toArray();
- }
-
- return $result;
- }
-
- public function getServiceDescription()
- {
- return $this->description;
- }
-
- public function setServiceDescription(ServiceDescriptionInterface $description)
- {
- $this->description = $description;
-
- return $this;
- }
-
- public function getParams()
- {
- return $this->parameters;
- }
-
- public function getParamNames()
- {
- return array_keys($this->parameters);
- }
-
- public function hasParam($name)
- {
- return isset($this->parameters[$name]);
- }
-
- public function getParam($param)
- {
- return isset($this->parameters[$param]) ? $this->parameters[$param] : null;
- }
-
- /**
- * Add a parameter to the command
- *
- * @param Parameter $param Parameter to add
- *
- * @return self
- */
- public function addParam(Parameter $param)
- {
- $this->parameters[$param->getName()] = $param;
- $param->setParent($this);
-
- return $this;
- }
-
- /**
- * Remove a parameter from the command
- *
- * @param string $name Name of the parameter to remove
- *
- * @return self
- */
- public function removeParam($name)
- {
- unset($this->parameters[$name]);
-
- return $this;
- }
-
- public function getHttpMethod()
- {
- return $this->httpMethod;
- }
-
- /**
- * Set the HTTP method of the command
- *
- * @param string $httpMethod Method to set
- *
- * @return self
- */
- public function setHttpMethod($httpMethod)
- {
- $this->httpMethod = $httpMethod;
-
- return $this;
- }
-
- public function getClass()
- {
- return $this->class;
- }
-
- /**
- * Set the concrete class of the command
- *
- * @param string $className Concrete class name
- *
- * @return self
- */
- public function setClass($className)
- {
- $this->class = $className;
-
- return $this;
- }
-
- public function getName()
- {
- return $this->name;
- }
-
- /**
- * Set the name of the command
- *
- * @param string $name Name of the command
- *
- * @return self
- */
- public function setName($name)
- {
- $this->name = $name;
-
- return $this;
- }
-
- public function getSummary()
- {
- return $this->summary;
- }
-
- /**
- * Set a short summary of what the operation does
- *
- * @param string $summary Short summary of the operation
- *
- * @return self
- */
- public function setSummary($summary)
- {
- $this->summary = $summary;
-
- return $this;
- }
-
- public function getNotes()
- {
- return $this->notes;
- }
-
- /**
- * Set a longer text field to explain the behavior of the operation.
- *
- * @param string $notes Notes on the operation
- *
- * @return self
- */
- public function setNotes($notes)
- {
- $this->notes = $notes;
-
- return $this;
- }
-
- public function getDocumentationUrl()
- {
- return $this->documentationUrl;
- }
-
- /**
- * Set the URL pointing to additional documentation on the command
- *
- * @param string $docUrl Documentation URL
- *
- * @return self
- */
- public function setDocumentationUrl($docUrl)
- {
- $this->documentationUrl = $docUrl;
-
- return $this;
- }
-
- public function getResponseClass()
- {
- return $this->responseClass;
- }
-
- /**
- * Set what is returned from the method. Can be a primitive, class name, or model. For example: 'array',
- * 'Guzzle\\Foo\\Baz', or 'MyModelName' (to reference a model by ID).
- *
- * @param string $responseClass Type of response
- *
- * @return self
- */
- public function setResponseClass($responseClass)
- {
- $this->responseClass = $responseClass;
- $this->inferResponseType();
-
- return $this;
- }
-
- public function getResponseType()
- {
- return $this->responseType;
- }
-
- /**
- * Set qualifying information about the responseClass. One of 'primitive', 'class', 'model', or 'documentation'
- *
- * @param string $responseType Response type information
- *
- * @return self
- * @throws InvalidArgumentException
- */
- public function setResponseType($responseType)
- {
- static $types = array(
- self::TYPE_PRIMITIVE => true,
- self::TYPE_CLASS => true,
- self::TYPE_MODEL => true,
- self::TYPE_DOCUMENTATION => true
- );
- if (!isset($types[$responseType])) {
- throw new InvalidArgumentException('responseType must be one of ' . implode(', ', array_keys($types)));
- }
-
- $this->responseType = $responseType;
-
- return $this;
- }
-
- public function getResponseNotes()
- {
- return $this->responseNotes;
- }
-
- /**
- * Set notes about the response of the operation
- *
- * @param string $notes Response notes
- *
- * @return self
- */
- public function setResponseNotes($notes)
- {
- $this->responseNotes = $notes;
-
- return $this;
- }
-
- public function getDeprecated()
- {
- return $this->deprecated;
- }
-
- /**
- * Set whether or not the command is deprecated
- *
- * @param bool $isDeprecated Set to true to mark as deprecated
- *
- * @return self
- */
- public function setDeprecated($isDeprecated)
- {
- $this->deprecated = $isDeprecated;
-
- return $this;
- }
-
- public function getUri()
- {
- return $this->uri;
- }
-
- /**
- * Set the URI template of the command
- *
- * @param string $uri URI template to set
- *
- * @return self
- */
- public function setUri($uri)
- {
- $this->uri = $uri;
-
- return $this;
- }
-
- public function getErrorResponses()
- {
- return $this->errorResponses;
- }
-
- /**
- * Add an error to the command
- *
- * @param string $code HTTP response code
- * @param string $reason HTTP response reason phrase or information about the error
- * @param string $class Exception class associated with the error
- *
- * @return self
- */
- public function addErrorResponse($code, $reason, $class)
- {
- $this->errorResponses[] = array('code' => $code, 'reason' => $reason, 'class' => $class);
-
- return $this;
- }
-
- /**
- * Set all of the error responses of the operation
- *
- * @param array $errorResponses Hash of error name to a hash containing a code, reason, class
- *
- * @return self
- */
- public function setErrorResponses(array $errorResponses)
- {
- $this->errorResponses = $errorResponses;
-
- return $this;
- }
-
- public function getData($name)
- {
- return isset($this->data[$name]) ? $this->data[$name] : null;
- }
-
- /**
- * Set a particular data point on the operation
- *
- * @param string $name Name of the data value
- * @param mixed $value Value to set
- *
- * @return self
- */
- public function setData($name, $value)
- {
- $this->data[$name] = $value;
-
- return $this;
- }
-
- /**
- * Get the additionalParameters of the operation
- *
- * @return Parameter|null
- */
- public function getAdditionalParameters()
- {
- return $this->additionalParameters;
- }
-
- /**
- * Set the additionalParameters of the operation
- *
- * @param Parameter|null $parameter Parameter to set
- *
- * @return self
- */
- public function setAdditionalParameters($parameter)
- {
- if ($this->additionalParameters = $parameter) {
- $this->additionalParameters->setParent($this);
- }
-
- return $this;
- }
-
- /**
- * Infer the response type from the responseClass value
- */
- protected function inferResponseType()
- {
- static $primitives = array('array' => 1, 'boolean' => 1, 'string' => 1, 'integer' => 1, '' => 1);
- if (isset($primitives[$this->responseClass])) {
- $this->responseType = self::TYPE_PRIMITIVE;
- } elseif ($this->description && $this->description->hasModel($this->responseClass)) {
- $this->responseType = self::TYPE_MODEL;
- } else {
- $this->responseType = self::TYPE_CLASS;
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/OperationInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/OperationInterface.php
deleted file mode 100644
index 4de41bd..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/OperationInterface.php
+++ /dev/null
@@ -1,159 +0,0 @@
-getModel($data['$ref'])) {
- $data = $model->toArray() + $data;
- }
- } elseif (isset($data['extends'])) {
- // If this parameter extends from another parameter then start with the actual data
- // union in the parent's data (e.g. actual supersedes parent)
- if ($extends = $description->getModel($data['extends'])) {
- $data += $extends->toArray();
- }
- }
- }
-
- // Pull configuration data into the parameter
- foreach ($data as $key => $value) {
- $this->{$key} = $value;
- }
-
- $this->serviceDescription = $description;
- $this->required = (bool) $this->required;
- $this->data = (array) $this->data;
-
- if ($this->filters) {
- $this->setFilters((array) $this->filters);
- }
-
- if ($this->type == 'object' && $this->additionalProperties === null) {
- $this->additionalProperties = true;
- }
- }
-
- /**
- * Convert the object to an array
- *
- * @return array
- */
- public function toArray()
- {
- static $checks = array('required', 'description', 'static', 'type', 'format', 'instanceOf', 'location', 'sentAs',
- 'pattern', 'minimum', 'maximum', 'minItems', 'maxItems', 'minLength', 'maxLength', 'data', 'enum',
- 'filters');
-
- $result = array();
-
- // Anything that is in the `Items` attribute of an array *must* include it's name if available
- if ($this->parent instanceof self && $this->parent->getType() == 'array' && isset($this->name)) {
- $result['name'] = $this->name;
- }
-
- foreach ($checks as $c) {
- if ($value = $this->{$c}) {
- $result[$c] = $value;
- }
- }
-
- if ($this->default !== null) {
- $result['default'] = $this->default;
- }
-
- if ($this->items !== null) {
- $result['items'] = $this->getItems()->toArray();
- }
-
- if ($this->additionalProperties !== null) {
- $result['additionalProperties'] = $this->getAdditionalProperties();
- if ($result['additionalProperties'] instanceof self) {
- $result['additionalProperties'] = $result['additionalProperties']->toArray();
- }
- }
-
- if ($this->type == 'object' && $this->properties) {
- $result['properties'] = array();
- foreach ($this->getProperties() as $name => $property) {
- $result['properties'][$name] = $property->toArray();
- }
- }
-
- return $result;
- }
-
- /**
- * Get the default or static value of the command based on a value
- *
- * @param string $value Value that is currently set
- *
- * @return mixed Returns the value, a static value if one is present, or a default value
- */
- public function getValue($value)
- {
- if ($this->static || ($this->default !== null && $value === null)) {
- return $this->default;
- }
-
- return $value;
- }
-
- /**
- * Run a value through the filters OR format attribute associated with the parameter
- *
- * @param mixed $value Value to filter
- *
- * @return mixed Returns the filtered value
- */
- public function filter($value)
- {
- // Formats are applied exclusively and supersed filters
- if ($this->format) {
- return SchemaFormatter::format($this->format, $value);
- }
-
- // Convert Boolean values
- if ($this->type == 'boolean' && !is_bool($value)) {
- $value = filter_var($value, FILTER_VALIDATE_BOOLEAN);
- }
-
- // Apply filters to the value
- if ($this->filters) {
- foreach ($this->filters as $filter) {
- if (is_array($filter)) {
- // Convert complex filters that hold value place holders
- foreach ($filter['args'] as &$data) {
- if ($data == '@value') {
- $data = $value;
- } elseif ($data == '@api') {
- $data = $this;
- }
- }
- $value = call_user_func_array($filter['method'], $filter['args']);
- } else {
- $value = call_user_func($filter, $value);
- }
- }
- }
-
- return $value;
- }
-
- /**
- * Get the name of the parameter
- *
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
-
- /**
- * Get the key of the parameter, where sentAs will supersede name if it is set
- *
- * @return string
- */
- public function getWireName()
- {
- return $this->sentAs ?: $this->name;
- }
-
- /**
- * Set the name of the parameter
- *
- * @param string $name Name to set
- *
- * @return self
- */
- public function setName($name)
- {
- $this->name = $name;
-
- return $this;
- }
-
- /**
- * Get the type(s) of the parameter
- *
- * @return string|array
- */
- public function getType()
- {
- return $this->type;
- }
-
- /**
- * Set the type(s) of the parameter
- *
- * @param string|array $type Type of parameter or array of simple types used in a union
- *
- * @return self
- */
- public function setType($type)
- {
- $this->type = $type;
-
- return $this;
- }
-
- /**
- * Get if the parameter is required
- *
- * @return bool
- */
- public function getRequired()
- {
- return $this->required;
- }
-
- /**
- * Set if the parameter is required
- *
- * @param bool $isRequired Whether or not the parameter is required
- *
- * @return self
- */
- public function setRequired($isRequired)
- {
- $this->required = (bool) $isRequired;
-
- return $this;
- }
-
- /**
- * Get the default value of the parameter
- *
- * @return string|null
- */
- public function getDefault()
- {
- return $this->default;
- }
-
- /**
- * Set the default value of the parameter
- *
- * @param string|null $default Default value to set
- *
- * @return self
- */
- public function setDefault($default)
- {
- $this->default = $default;
-
- return $this;
- }
-
- /**
- * Get the description of the parameter
- *
- * @return string|null
- */
- public function getDescription()
- {
- return $this->description;
- }
-
- /**
- * Set the description of the parameter
- *
- * @param string $description Description
- *
- * @return self
- */
- public function setDescription($description)
- {
- $this->description = $description;
-
- return $this;
- }
-
- /**
- * Get the minimum acceptable value for an integer
- *
- * @return int|null
- */
- public function getMinimum()
- {
- return $this->minimum;
- }
-
- /**
- * Set the minimum acceptable value for an integer
- *
- * @param int|null $min Minimum
- *
- * @return self
- */
- public function setMinimum($min)
- {
- $this->minimum = $min;
-
- return $this;
- }
-
- /**
- * Get the maximum acceptable value for an integer
- *
- * @return int|null
- */
- public function getMaximum()
- {
- return $this->maximum;
- }
-
- /**
- * Set the maximum acceptable value for an integer
- *
- * @param int $max Maximum
- *
- * @return self
- */
- public function setMaximum($max)
- {
- $this->maximum = $max;
-
- return $this;
- }
-
- /**
- * Get the minimum allowed length of a string value
- *
- * @return int
- */
- public function getMinLength()
- {
- return $this->minLength;
- }
-
- /**
- * Set the minimum allowed length of a string value
- *
- * @param int|null $min Minimum
- *
- * @return self
- */
- public function setMinLength($min)
- {
- $this->minLength = $min;
-
- return $this;
- }
-
- /**
- * Get the maximum allowed length of a string value
- *
- * @return int|null
- */
- public function getMaxLength()
- {
- return $this->maxLength;
- }
-
- /**
- * Set the maximum allowed length of a string value
- *
- * @param int $max Maximum length
- *
- * @return self
- */
- public function setMaxLength($max)
- {
- $this->maxLength = $max;
-
- return $this;
- }
-
- /**
- * Get the maximum allowed number of items in an array value
- *
- * @return int|null
- */
- public function getMaxItems()
- {
- return $this->maxItems;
- }
-
- /**
- * Set the maximum allowed number of items in an array value
- *
- * @param int $max Maximum
- *
- * @return self
- */
- public function setMaxItems($max)
- {
- $this->maxItems = $max;
-
- return $this;
- }
-
- /**
- * Get the minimum allowed number of items in an array value
- *
- * @return int
- */
- public function getMinItems()
- {
- return $this->minItems;
- }
-
- /**
- * Set the minimum allowed number of items in an array value
- *
- * @param int|null $min Minimum
- *
- * @return self
- */
- public function setMinItems($min)
- {
- $this->minItems = $min;
-
- return $this;
- }
-
- /**
- * Get the location of the parameter
- *
- * @return string|null
- */
- public function getLocation()
- {
- return $this->location;
- }
-
- /**
- * Set the location of the parameter
- *
- * @param string|null $location Location of the parameter
- *
- * @return self
- */
- public function setLocation($location)
- {
- $this->location = $location;
-
- return $this;
- }
-
- /**
- * Get the sentAs attribute of the parameter that used with locations to sentAs an attribute when it is being
- * applied to a location.
- *
- * @return string|null
- */
- public function getSentAs()
- {
- return $this->sentAs;
- }
-
- /**
- * Set the sentAs attribute
- *
- * @param string|null $name Name of the value as it is sent over the wire
- *
- * @return self
- */
- public function setSentAs($name)
- {
- $this->sentAs = $name;
-
- return $this;
- }
-
- /**
- * Retrieve a known property from the parameter by name or a data property by name. When not specific name value
- * is specified, all data properties will be returned.
- *
- * @param string|null $name Specify a particular property name to retrieve
- *
- * @return array|mixed|null
- */
- public function getData($name = null)
- {
- if (!$name) {
- return $this->data;
- }
-
- if (isset($this->data[$name])) {
- return $this->data[$name];
- } elseif (isset($this->{$name})) {
- return $this->{$name};
- }
-
- return null;
- }
-
- /**
- * Set the extra data properties of the parameter or set a specific extra property
- *
- * @param string|array|null $nameOrData The name of a specific extra to set or an array of extras to set
- * @param mixed|null $data When setting a specific extra property, specify the data to set for it
- *
- * @return self
- */
- public function setData($nameOrData, $data = null)
- {
- if (is_array($nameOrData)) {
- $this->data = $nameOrData;
- } else {
- $this->data[$nameOrData] = $data;
- }
-
- return $this;
- }
-
- /**
- * Get whether or not the default value can be changed
- *
- * @return mixed|null
- */
- public function getStatic()
- {
- return $this->static;
- }
-
- /**
- * Set to true if the default value cannot be changed
- *
- * @param bool $static True or false
- *
- * @return self
- */
- public function setStatic($static)
- {
- $this->static = (bool) $static;
-
- return $this;
- }
-
- /**
- * Get an array of filters used by the parameter
- *
- * @return array
- */
- public function getFilters()
- {
- return $this->filters ?: array();
- }
-
- /**
- * Set the array of filters used by the parameter
- *
- * @param array $filters Array of functions to use as filters
- *
- * @return self
- */
- public function setFilters(array $filters)
- {
- $this->filters = array();
- foreach ($filters as $filter) {
- $this->addFilter($filter);
- }
-
- return $this;
- }
-
- /**
- * Add a filter to the parameter
- *
- * @param string|array $filter Method to filter the value through
- *
- * @return self
- * @throws InvalidArgumentException
- */
- public function addFilter($filter)
- {
- if (is_array($filter)) {
- if (!isset($filter['method'])) {
- throw new InvalidArgumentException('A [method] value must be specified for each complex filter');
- }
- }
-
- if (!$this->filters) {
- $this->filters = array($filter);
- } else {
- $this->filters[] = $filter;
- }
-
- return $this;
- }
-
- /**
- * Get the parent object (an {@see OperationInterface} or {@see Parameter}
- *
- * @return OperationInterface|Parameter|null
- */
- public function getParent()
- {
- return $this->parent;
- }
-
- /**
- * Set the parent object of the parameter
- *
- * @param OperationInterface|Parameter|null $parent Parent container of the parameter
- *
- * @return self
- */
- public function setParent($parent)
- {
- $this->parent = $parent;
-
- return $this;
- }
-
- /**
- * Get the properties of the parameter
- *
- * @return array
- */
- public function getProperties()
- {
- if (!$this->propertiesCache) {
- $this->propertiesCache = array();
- foreach (array_keys($this->properties) as $name) {
- $this->propertiesCache[$name] = $this->getProperty($name);
- }
- }
-
- return $this->propertiesCache;
- }
-
- /**
- * Get a specific property from the parameter
- *
- * @param string $name Name of the property to retrieve
- *
- * @return null|Parameter
- */
- public function getProperty($name)
- {
- if (!isset($this->properties[$name])) {
- return null;
- }
-
- if (!($this->properties[$name] instanceof self)) {
- $this->properties[$name]['name'] = $name;
- $this->properties[$name] = new static($this->properties[$name], $this->serviceDescription);
- $this->properties[$name]->setParent($this);
- }
-
- return $this->properties[$name];
- }
-
- /**
- * Remove a property from the parameter
- *
- * @param string $name Name of the property to remove
- *
- * @return self
- */
- public function removeProperty($name)
- {
- unset($this->properties[$name]);
- $this->propertiesCache = null;
-
- return $this;
- }
-
- /**
- * Add a property to the parameter
- *
- * @param Parameter $property Properties to set
- *
- * @return self
- */
- public function addProperty(Parameter $property)
- {
- $this->properties[$property->getName()] = $property;
- $property->setParent($this);
- $this->propertiesCache = null;
-
- return $this;
- }
-
- /**
- * Get the additionalProperties value of the parameter
- *
- * @return bool|Parameter|null
- */
- public function getAdditionalProperties()
- {
- if (is_array($this->additionalProperties)) {
- $this->additionalProperties = new static($this->additionalProperties, $this->serviceDescription);
- $this->additionalProperties->setParent($this);
- }
-
- return $this->additionalProperties;
- }
-
- /**
- * Set the additionalProperties value of the parameter
- *
- * @param bool|Parameter|null $additional Boolean to allow any, an Parameter to specify a schema, or false to disallow
- *
- * @return self
- */
- public function setAdditionalProperties($additional)
- {
- $this->additionalProperties = $additional;
-
- return $this;
- }
-
- /**
- * Set the items data of the parameter
- *
- * @param Parameter|null $items Items to set
- *
- * @return self
- */
- public function setItems(Parameter $items = null)
- {
- if ($this->items = $items) {
- $this->items->setParent($this);
- }
-
- return $this;
- }
-
- /**
- * Get the item data of the parameter
- *
- * @return Parameter|null
- */
- public function getItems()
- {
- if (is_array($this->items)) {
- $this->items = new static($this->items, $this->serviceDescription);
- $this->items->setParent($this);
- }
-
- return $this->items;
- }
-
- /**
- * Get the class that the parameter must implement
- *
- * @return null|string
- */
- public function getInstanceOf()
- {
- return $this->instanceOf;
- }
-
- /**
- * Set the class that the parameter must be an instance of
- *
- * @param string|null $instanceOf Class or interface name
- *
- * @return self
- */
- public function setInstanceOf($instanceOf)
- {
- $this->instanceOf = $instanceOf;
-
- return $this;
- }
-
- /**
- * Get the enum of strings that are valid for the parameter
- *
- * @return array|null
- */
- public function getEnum()
- {
- return $this->enum;
- }
-
- /**
- * Set the enum of strings that are valid for the parameter
- *
- * @param array|null $enum Array of strings or null
- *
- * @return self
- */
- public function setEnum(array $enum = null)
- {
- $this->enum = $enum;
-
- return $this;
- }
-
- /**
- * Get the regex pattern that must match a value when the value is a string
- *
- * @return string
- */
- public function getPattern()
- {
- return $this->pattern;
- }
-
- /**
- * Set the regex pattern that must match a value when the value is a string
- *
- * @param string $pattern Regex pattern
- *
- * @return self
- */
- public function setPattern($pattern)
- {
- $this->pattern = $pattern;
-
- return $this;
- }
-
- /**
- * Get the format attribute of the schema
- *
- * @return string
- */
- public function getFormat()
- {
- return $this->format;
- }
-
- /**
- * Set the format attribute of the schema
- *
- * @param string $format Format to set (e.g. date, date-time, timestamp, time, date-time-http)
- *
- * @return self
- */
- public function setFormat($format)
- {
- $this->format = $format;
-
- return $this;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/SchemaFormatter.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/SchemaFormatter.php
deleted file mode 100644
index 7f47fc9..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/SchemaFormatter.php
+++ /dev/null
@@ -1,156 +0,0 @@
-setTimezone(self::getUtcTimeZone())->format($format);
- }
-
- throw new InvalidArgumentException('Date/Time values must be either a string, integer, or DateTime object');
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/SchemaValidator.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/SchemaValidator.php
deleted file mode 100644
index b045422..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/SchemaValidator.php
+++ /dev/null
@@ -1,291 +0,0 @@
-castIntegerToStringType = $castIntegerToStringType;
- }
-
- public function validate(Parameter $param, &$value)
- {
- $this->errors = array();
- $this->recursiveProcess($param, $value);
-
- if (empty($this->errors)) {
- return true;
- } else {
- sort($this->errors);
- return false;
- }
- }
-
- /**
- * Get the errors encountered while validating
- *
- * @return array
- */
- public function getErrors()
- {
- return $this->errors ?: array();
- }
-
- /**
- * Recursively validate a parameter
- *
- * @param Parameter $param API parameter being validated
- * @param mixed $value Value to validate and validate. The value may change during this validate.
- * @param string $path Current validation path (used for error reporting)
- * @param int $depth Current depth in the validation validate
- *
- * @return bool Returns true if valid, or false if invalid
- */
- protected function recursiveProcess(Parameter $param, &$value, $path = '', $depth = 0)
- {
- // Update the value by adding default or static values
- $value = $param->getValue($value);
-
- $required = $param->getRequired();
- // if the value is null and the parameter is not required or is static, then skip any further recursion
- if ((null === $value && !$required) || $param->getStatic()) {
- return true;
- }
-
- $type = $param->getType();
- // Attempt to limit the number of times is_array is called by tracking if the value is an array
- $valueIsArray = is_array($value);
- // If a name is set then update the path so that validation messages are more helpful
- if ($name = $param->getName()) {
- $path .= "[{$name}]";
- }
-
- if ($type == 'object') {
-
- // Objects are either associative arrays, ToArrayInterface, or some other object
- if ($param->getInstanceOf()) {
- $instance = $param->getInstanceOf();
- if (!($value instanceof $instance)) {
- $this->errors[] = "{$path} must be an instance of {$instance}";
- return false;
- }
- }
-
- // Determine whether or not this "value" has properties and should be traversed
- $traverse = $temporaryValue = false;
-
- // Convert the value to an array
- if (!$valueIsArray && $value instanceof ToArrayInterface) {
- $value = $value->toArray();
- }
-
- if ($valueIsArray) {
- // Ensure that the array is associative and not numerically indexed
- if (isset($value[0])) {
- $this->errors[] = "{$path} must be an array of properties. Got a numerically indexed array.";
- return false;
- }
- $traverse = true;
- } elseif ($value === null) {
- // Attempt to let the contents be built up by default values if possible
- $value = array();
- $temporaryValue = $valueIsArray = $traverse = true;
- }
-
- if ($traverse) {
-
- if ($properties = $param->getProperties()) {
- // if properties were found, the validate each property of the value
- foreach ($properties as $property) {
- $name = $property->getName();
- if (isset($value[$name])) {
- $this->recursiveProcess($property, $value[$name], $path, $depth + 1);
- } else {
- $current = null;
- $this->recursiveProcess($property, $current, $path, $depth + 1);
- // Only set the value if it was populated with something
- if (null !== $current) {
- $value[$name] = $current;
- }
- }
- }
- }
-
- $additional = $param->getAdditionalProperties();
- if ($additional !== true) {
- // If additional properties were found, then validate each against the additionalProperties attr.
- $keys = array_keys($value);
- // Determine the keys that were specified that were not listed in the properties of the schema
- $diff = array_diff($keys, array_keys($properties));
- if (!empty($diff)) {
- // Determine which keys are not in the properties
- if ($additional instanceOf Parameter) {
- foreach ($diff as $key) {
- $this->recursiveProcess($additional, $value[$key], "{$path}[{$key}]", $depth);
- }
- } else {
- // if additionalProperties is set to false and there are additionalProperties in the values, then fail
- foreach ($diff as $prop) {
- $this->errors[] = sprintf('%s[%s] is not an allowed property', $path, $prop);
- }
- }
- }
- }
-
- // A temporary value will be used to traverse elements that have no corresponding input value.
- // This allows nested required parameters with default values to bubble up into the input.
- // Here we check if we used a temp value and nothing bubbled up, then we need to remote the value.
- if ($temporaryValue && empty($value)) {
- $value = null;
- $valueIsArray = false;
- }
- }
-
- } elseif ($type == 'array' && $valueIsArray && $param->getItems()) {
- foreach ($value as $i => &$item) {
- // Validate each item in an array against the items attribute of the schema
- $this->recursiveProcess($param->getItems(), $item, $path . "[{$i}]", $depth + 1);
- }
- }
-
- // If the value is required and the type is not null, then there is an error if the value is not set
- if ($required && $value === null && $type != 'null') {
- $message = "{$path} is " . ($param->getType() ? ('a required ' . implode(' or ', (array) $param->getType())) : 'required');
- if ($param->getDescription()) {
- $message .= ': ' . $param->getDescription();
- }
- $this->errors[] = $message;
- return false;
- }
-
- // Validate that the type is correct. If the type is string but an integer was passed, the class can be
- // instructed to cast the integer to a string to pass validation. This is the default behavior.
- if ($type && (!$type = $this->determineType($type, $value))) {
- if ($this->castIntegerToStringType && $param->getType() == 'string' && is_integer($value)) {
- $value = (string) $value;
- } else {
- $this->errors[] = "{$path} must be of type " . implode(' or ', (array) $param->getType());
- }
- }
-
- // Perform type specific validation for strings, arrays, and integers
- if ($type == 'string') {
-
- // Strings can have enums which are a list of predefined values
- if (($enum = $param->getEnum()) && !in_array($value, $enum)) {
- $this->errors[] = "{$path} must be one of " . implode(' or ', array_map(function ($s) {
- return '"' . addslashes($s) . '"';
- }, $enum));
- }
- // Strings can have a regex pattern that the value must match
- if (($pattern = $param->getPattern()) && !preg_match($pattern, $value)) {
- $this->errors[] = "{$path} must match the following regular expression: {$pattern}";
- }
-
- $strLen = null;
- if ($min = $param->getMinLength()) {
- $strLen = strlen($value);
- if ($strLen < $min) {
- $this->errors[] = "{$path} length must be greater than or equal to {$min}";
- }
- }
- if ($max = $param->getMaxLength()) {
- if (($strLen ?: strlen($value)) > $max) {
- $this->errors[] = "{$path} length must be less than or equal to {$max}";
- }
- }
-
- } elseif ($type == 'array') {
-
- $size = null;
- if ($min = $param->getMinItems()) {
- $size = count($value);
- if ($size < $min) {
- $this->errors[] = "{$path} must contain {$min} or more elements";
- }
- }
- if ($max = $param->getMaxItems()) {
- if (($size ?: count($value)) > $max) {
- $this->errors[] = "{$path} must contain {$max} or fewer elements";
- }
- }
-
- } elseif ($type == 'integer' || $type == 'number' || $type == 'numeric') {
- if (($min = $param->getMinimum()) && $value < $min) {
- $this->errors[] = "{$path} must be greater than or equal to {$min}";
- }
- if (($max = $param->getMaximum()) && $value > $max) {
- $this->errors[] = "{$path} must be less than or equal to {$max}";
- }
- }
-
- return empty($this->errors);
- }
-
- /**
- * From the allowable types, determine the type that the variable matches
- *
- * @param string $type Parameter type
- * @param mixed $value Value to determine the type
- *
- * @return string|bool Returns the matching type on
- */
- protected function determineType($type, $value)
- {
- foreach ((array) $type as $t) {
- if ($t == 'string' && (is_string($value) || (is_object($value) && method_exists($value, '__toString')))) {
- return 'string';
- } elseif ($t == 'object' && (is_array($value) || is_object($value))) {
- return 'object';
- } elseif ($t == 'array' && is_array($value)) {
- return 'array';
- } elseif ($t == 'integer' && is_integer($value)) {
- return 'integer';
- } elseif ($t == 'boolean' && is_bool($value)) {
- return 'boolean';
- } elseif ($t == 'number' && is_numeric($value)) {
- return 'number';
- } elseif ($t == 'numeric' && is_numeric($value)) {
- return 'numeric';
- } elseif ($t == 'null' && !$value) {
- return 'null';
- } elseif ($t == 'any') {
- return 'any';
- }
- }
-
- return false;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/ServiceDescription.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/ServiceDescription.php
deleted file mode 100644
index 286e65e..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/ServiceDescription.php
+++ /dev/null
@@ -1,271 +0,0 @@
-load($config, $options);
- }
-
- /**
- * @param array $config Array of configuration data
- */
- public function __construct(array $config = array())
- {
- $this->fromArray($config);
- }
-
- public function serialize()
- {
- return json_encode($this->toArray());
- }
-
- public function unserialize($json)
- {
- $this->operations = array();
- $this->fromArray(json_decode($json, true));
- }
-
- public function toArray()
- {
- $result = array(
- 'name' => $this->name,
- 'apiVersion' => $this->apiVersion,
- 'baseUrl' => $this->baseUrl,
- 'description' => $this->description
- ) + $this->extraData;
- $result['operations'] = array();
- foreach ($this->getOperations() as $name => $operation) {
- $result['operations'][$operation->getName() ?: $name] = $operation->toArray();
- }
- if (!empty($this->models)) {
- $result['models'] = array();
- foreach ($this->models as $id => $model) {
- $result['models'][$id] = $model instanceof Parameter ? $model->toArray(): $model;
- }
- }
-
- return array_filter($result);
- }
-
- public function getBaseUrl()
- {
- return $this->baseUrl;
- }
-
- /**
- * Set the baseUrl of the description
- *
- * @param string $baseUrl Base URL of each operation
- *
- * @return self
- */
- public function setBaseUrl($baseUrl)
- {
- $this->baseUrl = $baseUrl;
-
- return $this;
- }
-
- public function getOperations()
- {
- foreach (array_keys($this->operations) as $name) {
- $this->getOperation($name);
- }
-
- return $this->operations;
- }
-
- public function hasOperation($name)
- {
- return isset($this->operations[$name]);
- }
-
- public function getOperation($name)
- {
- // Lazily retrieve and build operations
- if (!isset($this->operations[$name])) {
- return null;
- }
-
- if (!($this->operations[$name] instanceof Operation)) {
- $this->operations[$name] = new Operation($this->operations[$name], $this);
- }
-
- return $this->operations[$name];
- }
-
- /**
- * Add a operation to the service description
- *
- * @param OperationInterface $operation Operation to add
- *
- * @return self
- */
- public function addOperation(OperationInterface $operation)
- {
- $this->operations[$operation->getName()] = $operation->setServiceDescription($this);
-
- return $this;
- }
-
- public function getModel($id)
- {
- if (!isset($this->models[$id])) {
- return null;
- }
-
- if (!($this->models[$id] instanceof Parameter)) {
- $this->models[$id] = new Parameter($this->models[$id] + array('name' => $id), $this);
- }
-
- return $this->models[$id];
- }
-
- public function getModels()
- {
- // Ensure all models are converted into parameter objects
- foreach (array_keys($this->models) as $id) {
- $this->getModel($id);
- }
-
- return $this->models;
- }
-
- public function hasModel($id)
- {
- return isset($this->models[$id]);
- }
-
- /**
- * Add a model to the service description
- *
- * @param Parameter $model Model to add
- *
- * @return self
- */
- public function addModel(Parameter $model)
- {
- $this->models[$model->getName()] = $model;
-
- return $this;
- }
-
- public function getApiVersion()
- {
- return $this->apiVersion;
- }
-
- public function getName()
- {
- return $this->name;
- }
-
- public function getDescription()
- {
- return $this->description;
- }
-
- public function getData($key)
- {
- return isset($this->extraData[$key]) ? $this->extraData[$key] : null;
- }
-
- public function setData($key, $value)
- {
- $this->extraData[$key] = $value;
-
- return $this;
- }
-
- /**
- * Initialize the state from an array
- *
- * @param array $config Configuration data
- * @throws InvalidArgumentException
- */
- protected function fromArray(array $config)
- {
- // Keep a list of default keys used in service descriptions that is later used to determine extra data keys
- static $defaultKeys = array('name', 'models', 'apiVersion', 'baseUrl', 'description');
- // Pull in the default configuration values
- foreach ($defaultKeys as $key) {
- if (isset($config[$key])) {
- $this->{$key} = $config[$key];
- }
- }
-
- // Account for the Swagger name for Guzzle's baseUrl
- if (isset($config['basePath'])) {
- $this->baseUrl = $config['basePath'];
- }
-
- // Ensure that the models and operations properties are always arrays
- $this->models = (array) $this->models;
- $this->operations = (array) $this->operations;
-
- // We want to add operations differently than adding the other properties
- $defaultKeys[] = 'operations';
-
- // Create operations for each operation
- if (isset($config['operations'])) {
- foreach ($config['operations'] as $name => $operation) {
- if (!($operation instanceof Operation) && !is_array($operation)) {
- throw new InvalidArgumentException('Invalid operation in service description: '
- . gettype($operation));
- }
- $this->operations[$name] = $operation;
- }
- }
-
- // Get all of the additional properties of the service description and store them in a data array
- foreach (array_diff(array_keys($config), $defaultKeys) as $key) {
- $this->extraData[$key] = $config[$key];
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/ServiceDescriptionInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/ServiceDescriptionInterface.php
deleted file mode 100644
index 5983e58..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/ServiceDescriptionInterface.php
+++ /dev/null
@@ -1,106 +0,0 @@
- $op) {
- $name = $op['name'] = isset($op['name']) ? $op['name'] : $name;
- // Extend other operations
- if (!empty($op['extends'])) {
- $this->resolveExtension($name, $op, $operations);
- }
- $op['parameters'] = isset($op['parameters']) ? $op['parameters'] : array();
- $operations[$name] = $op;
- }
- }
-
- return new ServiceDescription(array(
- 'apiVersion' => isset($config['apiVersion']) ? $config['apiVersion'] : null,
- 'baseUrl' => isset($config['baseUrl']) ? $config['baseUrl'] : null,
- 'description' => isset($config['description']) ? $config['description'] : null,
- 'operations' => $operations,
- 'models' => isset($config['models']) ? $config['models'] : null
- ) + $config);
- }
-
- /**
- * @param string $name Name of the operation
- * @param array $op Operation value array
- * @param array $operations Currently loaded operations
- * @throws DescriptionBuilderException when extending a non-existent operation
- */
- protected function resolveExtension($name, array &$op, array &$operations)
- {
- $resolved = array();
- $original = empty($op['parameters']) ? false: $op['parameters'];
- $hasClass = !empty($op['class']);
- foreach ((array) $op['extends'] as $extendedCommand) {
- if (empty($operations[$extendedCommand])) {
- throw new DescriptionBuilderException("{$name} extends missing operation {$extendedCommand}");
- }
- $toArray = $operations[$extendedCommand];
- $resolved = empty($resolved)
- ? $toArray['parameters']
- : array_merge($resolved, $toArray['parameters']);
-
- $op = $op + $toArray;
- if (!$hasClass && isset($toArray['class'])) {
- $op['class'] = $toArray['class'];
- }
- }
- $op['parameters'] = $original ? array_merge($resolved, $original) : $resolved;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/ValidatorInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/ValidatorInterface.php
deleted file mode 100644
index 94ca77d..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Description/ValidatorInterface.php
+++ /dev/null
@@ -1,28 +0,0 @@
-getMessage(), $e->getCode(), $e->getPrevious());
- $ce->setSuccessfulRequests($e->getSuccessfulRequests());
-
- $alreadyAddedExceptions = array();
- foreach ($e->getFailedRequests() as $request) {
- if ($re = $e->getExceptionForFailedRequest($request)) {
- $alreadyAddedExceptions[] = $re;
- $ce->addFailedRequestWithException($request, $re);
- } else {
- $ce->addFailedRequest($request);
- }
- }
-
- // Add any exceptions that did not map to a request
- if (count($alreadyAddedExceptions) < count($e)) {
- foreach ($e as $ex) {
- if (!in_array($ex, $alreadyAddedExceptions)) {
- $ce->add($ex);
- }
- }
- }
-
- return $ce;
- }
-
- /**
- * Get all of the commands in the transfer
- *
- * @return array
- */
- public function getAllCommands()
- {
- return array_merge($this->successfulCommands, $this->failedCommands);
- }
-
- /**
- * Add to the array of successful commands
- *
- * @param CommandInterface $command Successful command
- *
- * @return self
- */
- public function addSuccessfulCommand(CommandInterface $command)
- {
- $this->successfulCommands[] = $command;
-
- return $this;
- }
-
- /**
- * Add to the array of failed commands
- *
- * @param CommandInterface $command Failed command
- *
- * @return self
- */
- public function addFailedCommand(CommandInterface $command)
- {
- $this->failedCommands[] = $command;
-
- return $this;
- }
-
- /**
- * Get an array of successful commands
- *
- * @return array
- */
- public function getSuccessfulCommands()
- {
- return $this->successfulCommands;
- }
-
- /**
- * Get an array of failed commands
- *
- * @return array
- */
- public function getFailedCommands()
- {
- return $this->failedCommands;
- }
-
- /**
- * Get the Exception that caused the given $command to fail
- *
- * @param CommandInterface $command Failed command
- *
- * @return \Exception|null
- */
- public function getExceptionForFailedCommand(CommandInterface $command)
- {
- return $this->getExceptionForFailedRequest($command->getRequest());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Exception/DescriptionBuilderException.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Exception/DescriptionBuilderException.php
deleted file mode 100644
index 1407e56..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Exception/DescriptionBuilderException.php
+++ /dev/null
@@ -1,7 +0,0 @@
-invalidCommands = $commands;
- parent::__construct(
- 'Encountered commands in a batch transfer that use inconsistent clients. The batching ' .
- 'strategy you use with a command transfer must divide command batches by client.'
- );
- }
-
- /**
- * Get the invalid commands
- *
- * @return array
- */
- public function getCommands()
- {
- return $this->invalidCommands;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Exception/ResponseClassException.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Exception/ResponseClassException.php
deleted file mode 100644
index d59ff21..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Exception/ResponseClassException.php
+++ /dev/null
@@ -1,9 +0,0 @@
-errors = $errors;
- }
-
- /**
- * Get any validation errors
- *
- * @return array
- */
- public function getErrors()
- {
- return $this->errors;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/AbstractResourceIteratorFactory.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/AbstractResourceIteratorFactory.php
deleted file mode 100644
index 21140e7..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/AbstractResourceIteratorFactory.php
+++ /dev/null
@@ -1,37 +0,0 @@
-canBuild($command)) {
- throw new InvalidArgumentException('Iterator was not found for ' . $command->getName());
- }
-
- $className = $this->getClassName($command);
-
- return new $className($command, $options);
- }
-
- public function canBuild(CommandInterface $command)
- {
- return (bool) $this->getClassName($command);
- }
-
- /**
- * Get the name of the class to instantiate for the command
- *
- * @param CommandInterface $command Command that is associated with the iterator
- *
- * @return string
- */
- abstract protected function getClassName(CommandInterface $command);
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/CompositeResourceIteratorFactory.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/CompositeResourceIteratorFactory.php
deleted file mode 100644
index 2efc133..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/CompositeResourceIteratorFactory.php
+++ /dev/null
@@ -1,67 +0,0 @@
-factories = $factories;
- }
-
- public function build(CommandInterface $command, array $options = array())
- {
- if (!($factory = $this->getFactory($command))) {
- throw new InvalidArgumentException('Iterator was not found for ' . $command->getName());
- }
-
- return $factory->build($command, $options);
- }
-
- public function canBuild(CommandInterface $command)
- {
- return $this->getFactory($command) !== false;
- }
-
- /**
- * Add a factory to the composite factory
- *
- * @param ResourceIteratorFactoryInterface $factory Factory to add
- *
- * @return self
- */
- public function addFactory(ResourceIteratorFactoryInterface $factory)
- {
- $this->factories[] = $factory;
-
- return $this;
- }
-
- /**
- * Get the factory that matches the command object
- *
- * @param CommandInterface $command Command retrieving the iterator for
- *
- * @return ResourceIteratorFactoryInterface|bool
- */
- protected function getFactory(CommandInterface $command)
- {
- foreach ($this->factories as $factory) {
- if ($factory->canBuild($command)) {
- return $factory;
- }
- }
-
- return false;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/MapResourceIteratorFactory.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/MapResourceIteratorFactory.php
deleted file mode 100644
index c71ca9d..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/MapResourceIteratorFactory.php
+++ /dev/null
@@ -1,34 +0,0 @@
-map = $map;
- }
-
- public function getClassName(CommandInterface $command)
- {
- $className = $command->getName();
-
- if (isset($this->map[$className])) {
- return $this->map[$className];
- } elseif (isset($this->map['*'])) {
- // If a wildcard was added, then always use that
- return $this->map['*'];
- }
-
- return null;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/Model.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/Model.php
deleted file mode 100644
index 2322434..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/Model.php
+++ /dev/null
@@ -1,64 +0,0 @@
-data = $data;
- $this->structure = $structure;
- }
-
- /**
- * Get the structure of the model
- *
- * @return Parameter
- */
- public function getStructure()
- {
- return $this->structure ?: new Parameter();
- }
-
- /**
- * Provides debug information about the model object
- *
- * @return string
- */
- public function __toString()
- {
- $output = 'Debug output of ';
- if ($this->structure) {
- $output .= $this->structure->getName() . ' ';
- }
- $output .= 'model';
- $output = str_repeat('=', strlen($output)) . "\n" . $output . "\n" . str_repeat('=', strlen($output)) . "\n\n";
- $output .= "Model data\n-----------\n\n";
- $output .= "This data can be retrieved from the model object using the get() method of the model "
- . "(e.g. \$model->get(\$key)) or accessing the model like an associative array (e.g. \$model['key']).\n\n";
- $lines = array_slice(explode("\n", trim(print_r($this->toArray(), true))), 2, -1);
- $output .= implode("\n", $lines);
-
- if ($this->structure) {
- $output .= "\n\nModel structure\n---------------\n\n";
- $output .= "The following JSON document defines how the model was parsed from an HTTP response into the "
- . "associative array structure you see above.\n\n";
- $output .= ' ' . json_encode($this->structure->toArray()) . "\n\n";
- }
-
- return $output . "\n";
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIterator.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIterator.php
deleted file mode 100644
index e141524..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIterator.php
+++ /dev/null
@@ -1,254 +0,0 @@
-originalCommand = $command;
-
- // Parse options from the array of options
- $this->data = $data;
- $this->limit = array_key_exists('limit', $data) ? $data['limit'] : 0;
- $this->pageSize = array_key_exists('page_size', $data) ? $data['page_size'] : false;
- }
-
- /**
- * Get all of the resources as an array (Warning: this could issue a large number of requests)
- *
- * @return array
- */
- public function toArray()
- {
- return iterator_to_array($this, false);
- }
-
- public function setLimit($limit)
- {
- $this->limit = $limit;
- $this->resetState();
-
- return $this;
- }
-
- public function setPageSize($pageSize)
- {
- $this->pageSize = $pageSize;
- $this->resetState();
-
- return $this;
- }
-
- /**
- * Get an option from the iterator
- *
- * @param string $key Key of the option to retrieve
- *
- * @return mixed|null Returns NULL if not set or the value if set
- */
- public function get($key)
- {
- return array_key_exists($key, $this->data) ? $this->data[$key] : null;
- }
-
- /**
- * Set an option on the iterator
- *
- * @param string $key Key of the option to set
- * @param mixed $value Value to set for the option
- *
- * @return ResourceIterator
- */
- public function set($key, $value)
- {
- $this->data[$key] = $value;
-
- return $this;
- }
-
- public function current()
- {
- return $this->resources ? current($this->resources) : false;
- }
-
- public function key()
- {
- return max(0, $this->iteratedCount - 1);
- }
-
- public function count()
- {
- return $this->retrievedCount;
- }
-
- /**
- * Get the total number of requests sent
- *
- * @return int
- */
- public function getRequestCount()
- {
- return $this->requestCount;
- }
-
- /**
- * Rewind the Iterator to the first element and send the original command
- */
- public function rewind()
- {
- // Use the original command
- $this->command = clone $this->originalCommand;
- $this->resetState();
- $this->next();
- }
-
- public function valid()
- {
- return !$this->invalid && (!$this->resources || $this->current() || $this->nextToken)
- && (!$this->limit || $this->iteratedCount < $this->limit + 1);
- }
-
- public function next()
- {
- $this->iteratedCount++;
-
- // Check if a new set of resources needs to be retrieved
- $sendRequest = false;
- if (!$this->resources) {
- $sendRequest = true;
- } else {
- // iterate over the internal array
- $current = next($this->resources);
- $sendRequest = $current === false && $this->nextToken && (!$this->limit || $this->iteratedCount < $this->limit + 1);
- }
-
- if ($sendRequest) {
-
- $this->dispatch('resource_iterator.before_send', array(
- 'iterator' => $this,
- 'resources' => $this->resources
- ));
-
- // Get a new command object from the original command
- $this->command = clone $this->originalCommand;
- // Send a request and retrieve the newly loaded resources
- $this->resources = $this->sendRequest();
- $this->requestCount++;
-
- // If no resources were found, then the last request was not needed
- // and iteration must stop
- if (empty($this->resources)) {
- $this->invalid = true;
- } else {
- // Add to the number of retrieved resources
- $this->retrievedCount += count($this->resources);
- // Ensure that we rewind to the beginning of the array
- reset($this->resources);
- }
-
- $this->dispatch('resource_iterator.after_send', array(
- 'iterator' => $this,
- 'resources' => $this->resources
- ));
- }
- }
-
- /**
- * Retrieve the NextToken that can be used in other iterators.
- *
- * @return string Returns a NextToken
- */
- public function getNextToken()
- {
- return $this->nextToken;
- }
-
- /**
- * Returns the value that should be specified for the page size for a request that will maintain any hard limits,
- * but still honor the specified pageSize if the number of items retrieved + pageSize < hard limit
- *
- * @return int Returns the page size of the next request.
- */
- protected function calculatePageSize()
- {
- if ($this->limit && $this->iteratedCount + $this->pageSize > $this->limit) {
- return 1 + ($this->limit - $this->iteratedCount);
- }
-
- return (int) $this->pageSize;
- }
-
- /**
- * Reset the internal state of the iterator without triggering a rewind()
- */
- protected function resetState()
- {
- $this->iteratedCount = 0;
- $this->retrievedCount = 0;
- $this->nextToken = false;
- $this->resources = null;
- $this->invalid = false;
- }
-
- /**
- * Send a request to retrieve the next page of results. Hook for subclasses to implement.
- *
- * @return array Returns the newly loaded resources
- */
- abstract protected function sendRequest();
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIteratorApplyBatched.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIteratorApplyBatched.php
deleted file mode 100644
index 6aa3615..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIteratorApplyBatched.php
+++ /dev/null
@@ -1,111 +0,0 @@
-iterator = $iterator;
- $this->callback = $callback;
- Version::warn(__CLASS__ . ' is deprecated');
- }
-
- /**
- * Apply the callback to the contents of the resource iterator
- *
- * @param int $perBatch The number of records to group per batch transfer
- *
- * @return int Returns the number of iterated resources
- */
- public function apply($perBatch = 50)
- {
- $this->iterated = $this->batches = $batches = 0;
- $that = $this;
- $it = $this->iterator;
- $callback = $this->callback;
-
- $batch = BatchBuilder::factory()
- ->createBatchesWith(new BatchSizeDivisor($perBatch))
- ->transferWith(new BatchClosureTransfer(function (array $batch) use ($that, $callback, &$batches, $it) {
- $batches++;
- $that->dispatch('iterator_batch.before_batch', array('iterator' => $it, 'batch' => $batch));
- call_user_func_array($callback, array($it, $batch));
- $that->dispatch('iterator_batch.after_batch', array('iterator' => $it, 'batch' => $batch));
- }))
- ->autoFlushAt($perBatch)
- ->build();
-
- $this->dispatch('iterator_batch.created_batch', array('batch' => $batch));
-
- foreach ($this->iterator as $resource) {
- $this->iterated++;
- $batch->add($resource);
- }
-
- $batch->flush();
- $this->batches = $batches;
-
- return $this->iterated;
- }
-
- /**
- * Get the total number of batches sent
- *
- * @return int
- */
- public function getBatchCount()
- {
- return $this->batches;
- }
-
- /**
- * Get the total number of iterated resources
- *
- * @return int
- */
- public function getIteratedCount()
- {
- return $this->iterated;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIteratorClassFactory.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIteratorClassFactory.php
deleted file mode 100644
index 2fd9980..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIteratorClassFactory.php
+++ /dev/null
@@ -1,60 +0,0 @@
- AbcFoo).
- */
-class ResourceIteratorClassFactory extends AbstractResourceIteratorFactory
-{
- /** @var array List of namespaces used to look for classes */
- protected $namespaces;
-
- /** @var InflectorInterface Inflector used to determine class names */
- protected $inflector;
-
- /**
- * @param string|array $namespaces List of namespaces for iterator objects
- * @param InflectorInterface $inflector Inflector used to resolve class names
- */
- public function __construct($namespaces = array(), InflectorInterface $inflector = null)
- {
- $this->namespaces = (array) $namespaces;
- $this->inflector = $inflector ?: Inflector::getDefault();
- }
-
- /**
- * Registers a namespace to check for Iterators
- *
- * @param string $namespace Namespace which contains Iterator classes
- *
- * @return self
- */
- public function registerNamespace($namespace)
- {
- array_unshift($this->namespaces, $namespace);
-
- return $this;
- }
-
- protected function getClassName(CommandInterface $command)
- {
- $iteratorName = $this->inflector->camel($command->getName()) . 'Iterator';
-
- // Determine the name of the class to load
- foreach ($this->namespaces as $namespace) {
- $potentialClassName = $namespace . '\\' . $iteratorName;
- if (class_exists($potentialClassName)) {
- return $potentialClassName;
- }
- }
-
- return false;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIteratorFactoryInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIteratorFactoryInterface.php
deleted file mode 100644
index 8b4e8db..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Service/Resource/ResourceIteratorFactoryInterface.php
+++ /dev/null
@@ -1,30 +0,0 @@
-=5.3.2",
- "guzzle/cache": "self.version",
- "guzzle/http": "self.version",
- "guzzle/inflection": "self.version"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Service": "" }
- },
- "target-dir": "Guzzle/Service",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Stream/PhpStreamRequestFactory.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Stream/PhpStreamRequestFactory.php
deleted file mode 100644
index d115fd8..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Stream/PhpStreamRequestFactory.php
+++ /dev/null
@@ -1,284 +0,0 @@
-contextOptions = stream_context_get_options($context);
- $this->context = $context;
- } elseif (is_array($context) || !$context) {
- $this->contextOptions = $context;
- $this->createContext($params);
- } elseif ($context) {
- throw new InvalidArgumentException('$context must be an array or resource');
- }
-
- // Dispatch the before send event
- $request->dispatch('request.before_send', array(
- 'request' => $request,
- 'context' => $this->context,
- 'context_options' => $this->contextOptions
- ));
-
- $this->setUrl($request);
- $this->addDefaultContextOptions($request);
- $this->addSslOptions($request);
- $this->addBodyOptions($request);
- $this->addProxyOptions($request);
-
- // Create the file handle but silence errors
- return $this->createStream($params)
- ->setCustomData('request', $request)
- ->setCustomData('response_headers', $this->getLastResponseHeaders());
- }
-
- /**
- * Set an option on the context and the internal options array
- *
- * @param string $wrapper Stream wrapper name of http
- * @param string $name Context name
- * @param mixed $value Context value
- * @param bool $overwrite Set to true to overwrite an existing value
- */
- protected function setContextValue($wrapper, $name, $value, $overwrite = false)
- {
- if (!isset($this->contextOptions[$wrapper])) {
- $this->contextOptions[$wrapper] = array($name => $value);
- } elseif (!$overwrite && isset($this->contextOptions[$wrapper][$name])) {
- return;
- }
- $this->contextOptions[$wrapper][$name] = $value;
- stream_context_set_option($this->context, $wrapper, $name, $value);
- }
-
- /**
- * Create a stream context
- *
- * @param array $params Parameter array
- */
- protected function createContext(array $params)
- {
- $options = $this->contextOptions;
- $this->context = $this->createResource(function () use ($params, $options) {
- return stream_context_create($options, $params);
- });
- }
-
- /**
- * Get the last response headers received by the HTTP request
- *
- * @return array
- */
- public function getLastResponseHeaders()
- {
- return $this->lastResponseHeaders;
- }
-
- /**
- * Adds the default context options to the stream context options
- *
- * @param RequestInterface $request Request
- */
- protected function addDefaultContextOptions(RequestInterface $request)
- {
- $this->setContextValue('http', 'method', $request->getMethod());
- $headers = $request->getHeaderLines();
-
- // "Connection: close" is required to get streams to work in HTTP 1.1
- if (!$request->hasHeader('Connection')) {
- $headers[] = 'Connection: close';
- }
-
- $this->setContextValue('http', 'header', $headers);
- $this->setContextValue('http', 'protocol_version', $request->getProtocolVersion());
- $this->setContextValue('http', 'ignore_errors', true);
- }
-
- /**
- * Set the URL to use with the factory
- *
- * @param RequestInterface $request Request that owns the URL
- */
- protected function setUrl(RequestInterface $request)
- {
- $this->url = $request->getUrl(true);
-
- // Check for basic Auth username
- if ($request->getUsername()) {
- $this->url->setUsername($request->getUsername());
- }
-
- // Check for basic Auth password
- if ($request->getPassword()) {
- $this->url->setPassword($request->getPassword());
- }
- }
-
- /**
- * Add SSL options to the stream context
- *
- * @param RequestInterface $request Request
- */
- protected function addSslOptions(RequestInterface $request)
- {
- if ($request->getCurlOptions()->get(CURLOPT_SSL_VERIFYPEER)) {
- $this->setContextValue('ssl', 'verify_peer', true, true);
- if ($cafile = $request->getCurlOptions()->get(CURLOPT_CAINFO)) {
- $this->setContextValue('ssl', 'cafile', $cafile, true);
- }
- } else {
- $this->setContextValue('ssl', 'verify_peer', false, true);
- }
- }
-
- /**
- * Add body (content) specific options to the context options
- *
- * @param RequestInterface $request
- */
- protected function addBodyOptions(RequestInterface $request)
- {
- // Add the content for the request if needed
- if (!($request instanceof EntityEnclosingRequestInterface)) {
- return;
- }
-
- if (count($request->getPostFields())) {
- $this->setContextValue('http', 'content', (string) $request->getPostFields(), true);
- } elseif ($request->getBody()) {
- $this->setContextValue('http', 'content', (string) $request->getBody(), true);
- }
-
- // Always ensure a content-length header is sent
- if (isset($this->contextOptions['http']['content'])) {
- $headers = isset($this->contextOptions['http']['header']) ? $this->contextOptions['http']['header'] : array();
- $headers[] = 'Content-Length: ' . strlen($this->contextOptions['http']['content']);
- $this->setContextValue('http', 'header', $headers, true);
- }
- }
-
- /**
- * Add proxy parameters to the context if needed
- *
- * @param RequestInterface $request Request
- */
- protected function addProxyOptions(RequestInterface $request)
- {
- if ($proxy = $request->getCurlOptions()->get(CURLOPT_PROXY)) {
- $this->setContextValue('http', 'proxy', $proxy);
- }
- }
-
- /**
- * Create the stream for the request with the context options
- *
- * @param array $params Parameters of the stream
- *
- * @return StreamInterface
- */
- protected function createStream(array $params)
- {
- $http_response_header = null;
- $url = $this->url;
- $context = $this->context;
- $fp = $this->createResource(function () use ($context, $url, &$http_response_header) {
- return fopen((string) $url, 'r', false, $context);
- });
-
- // Determine the class to instantiate
- $className = isset($params['stream_class']) ? $params['stream_class'] : __NAMESPACE__ . '\\Stream';
-
- /** @var $stream StreamInterface */
- $stream = new $className($fp);
-
- // Track the response headers of the request
- if (isset($http_response_header)) {
- $this->lastResponseHeaders = $http_response_header;
- $this->processResponseHeaders($stream);
- }
-
- return $stream;
- }
-
- /**
- * Process response headers
- *
- * @param StreamInterface $stream
- */
- protected function processResponseHeaders(StreamInterface $stream)
- {
- // Set the size on the stream if it was returned in the response
- foreach ($this->lastResponseHeaders as $header) {
- if ((stripos($header, 'Content-Length:')) === 0) {
- $stream->setSize(trim(substr($header, 15)));
- }
- }
- }
-
- /**
- * Create a resource and check to ensure it was created successfully
- *
- * @param callable $callback Closure to invoke that must return a valid resource
- *
- * @return resource
- * @throws RuntimeException on error
- */
- protected function createResource($callback)
- {
- $errors = null;
- set_error_handler(function ($_, $msg, $file, $line) use (&$errors) {
- $errors[] = array(
- 'message' => $msg,
- 'file' => $file,
- 'line' => $line
- );
- return true;
- });
- $resource = call_user_func($callback);
- restore_error_handler();
-
- if (!$resource) {
- $message = 'Error creating resource. ';
- foreach ($errors as $err) {
- foreach ($err as $key => $value) {
- $message .= "[$key] $value" . PHP_EOL;
- }
- }
- throw new RuntimeException(trim($message));
- }
-
- return $resource;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Stream/Stream.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Stream/Stream.php
deleted file mode 100644
index 12bed26..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Stream/Stream.php
+++ /dev/null
@@ -1,289 +0,0 @@
- array(
- 'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true,
- 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, 'c+b' => true,
- 'rt' => true, 'w+t' => true, 'r+t' => true, 'x+t' => true, 'c+t' => true, 'a+' => true
- ),
- 'write' => array(
- 'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true, 'c+' => true,
- 'wb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, 'c+b' => true,
- 'w+t' => true, 'r+t' => true, 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true
- )
- );
-
- /**
- * @param resource $stream Stream resource to wrap
- * @param int $size Size of the stream in bytes. Only pass if the size cannot be obtained from the stream.
- *
- * @throws InvalidArgumentException if the stream is not a stream resource
- */
- public function __construct($stream, $size = null)
- {
- $this->setStream($stream, $size);
- }
-
- /**
- * Closes the stream when the helper is destructed
- */
- public function __destruct()
- {
- $this->close();
- }
-
- public function __toString()
- {
- if (!$this->isReadable() || (!$this->isSeekable() && $this->isConsumed())) {
- return '';
- }
-
- $originalPos = $this->ftell();
- $body = stream_get_contents($this->stream, -1, 0);
- $this->seek($originalPos);
-
- return $body;
- }
-
- public function close()
- {
- if (is_resource($this->stream)) {
- fclose($this->stream);
- }
- $this->cache[self::IS_READABLE] = false;
- $this->cache[self::IS_WRITABLE] = false;
- }
-
- /**
- * Calculate a hash of a Stream
- *
- * @param StreamInterface $stream Stream to calculate the hash for
- * @param string $algo Hash algorithm (e.g. md5, crc32, etc)
- * @param bool $rawOutput Whether or not to use raw output
- *
- * @return bool|string Returns false on failure or a hash string on success
- */
- public static function getHash(StreamInterface $stream, $algo, $rawOutput = false)
- {
- $pos = $stream->ftell();
- if (!$stream->seek(0)) {
- return false;
- }
-
- $ctx = hash_init($algo);
- while (!$stream->feof()) {
- hash_update($ctx, $stream->read(8192));
- }
-
- $out = hash_final($ctx, (bool) $rawOutput);
- $stream->seek($pos);
-
- return $out;
- }
-
- public function getMetaData($key = null)
- {
- $meta = stream_get_meta_data($this->stream);
-
- return !$key ? $meta : (array_key_exists($key, $meta) ? $meta[$key] : null);
- }
-
- public function getStream()
- {
- return $this->stream;
- }
-
- public function setStream($stream, $size = null)
- {
- if (!is_resource($stream)) {
- throw new InvalidArgumentException('Stream must be a resource');
- }
-
- $this->size = $size;
- $this->stream = $stream;
- $this->rebuildCache();
-
- return $this;
- }
-
- public function detachStream()
- {
- $this->stream = null;
-
- return $this;
- }
-
- public function getWrapper()
- {
- return $this->cache[self::WRAPPER_TYPE];
- }
-
- public function getWrapperData()
- {
- return $this->getMetaData('wrapper_data') ?: array();
- }
-
- public function getStreamType()
- {
- return $this->cache[self::STREAM_TYPE];
- }
-
- public function getUri()
- {
- return $this->cache['uri'];
- }
-
- public function getSize()
- {
- if ($this->size !== null) {
- return $this->size;
- }
-
- // If the stream is a file based stream and local, then use fstat
- clearstatcache(true, $this->cache['uri']);
- $stats = fstat($this->stream);
- if (isset($stats['size'])) {
- $this->size = $stats['size'];
- return $this->size;
- } elseif ($this->cache[self::IS_READABLE] && $this->cache[self::SEEKABLE]) {
- // Only get the size based on the content if the the stream is readable and seekable
- $pos = $this->ftell();
- $this->size = strlen((string) $this);
- $this->seek($pos);
- return $this->size;
- }
-
- return false;
- }
-
- public function isReadable()
- {
- return $this->cache[self::IS_READABLE];
- }
-
- public function isRepeatable()
- {
- return $this->cache[self::IS_READABLE] && $this->cache[self::SEEKABLE];
- }
-
- public function isWritable()
- {
- return $this->cache[self::IS_WRITABLE];
- }
-
- public function isConsumed()
- {
- return feof($this->stream);
- }
-
- public function feof()
- {
- return $this->isConsumed();
- }
-
- public function isLocal()
- {
- return $this->cache[self::IS_LOCAL];
- }
-
- public function isSeekable()
- {
- return $this->cache[self::SEEKABLE];
- }
-
- public function setSize($size)
- {
- $this->size = $size;
-
- return $this;
- }
-
- public function seek($offset, $whence = SEEK_SET)
- {
- return $this->cache[self::SEEKABLE] ? fseek($this->stream, $offset, $whence) === 0 : false;
- }
-
- public function read($length)
- {
- return fread($this->stream, $length);
- }
-
- public function write($string)
- {
- // We can't know the size after writing anything
- $this->size = null;
-
- return fwrite($this->stream, $string);
- }
-
- public function ftell()
- {
- return ftell($this->stream);
- }
-
- public function rewind()
- {
- return $this->seek(0);
- }
-
- public function readLine($maxLength = null)
- {
- if (!$this->cache[self::IS_READABLE]) {
- return false;
- } else {
- return $maxLength ? fgets($this->getStream(), $maxLength) : fgets($this->getStream());
- }
- }
-
- public function setCustomData($key, $value)
- {
- $this->customData[$key] = $value;
-
- return $this;
- }
-
- public function getCustomData($key)
- {
- return isset($this->customData[$key]) ? $this->customData[$key] : null;
- }
-
- /**
- * Reprocess stream metadata
- */
- protected function rebuildCache()
- {
- $this->cache = stream_get_meta_data($this->stream);
- $this->cache[self::IS_LOCAL] = stream_is_local($this->stream);
- $this->cache[self::IS_READABLE] = isset(self::$readWriteHash['read'][$this->cache['mode']]);
- $this->cache[self::IS_WRITABLE] = isset(self::$readWriteHash['write'][$this->cache['mode']]);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Stream/StreamInterface.php b/lib/gerencianet/guzzle/guzzle/src/Guzzle/Stream/StreamInterface.php
deleted file mode 100644
index 6d7dc37..0000000
--- a/lib/gerencianet/guzzle/guzzle/src/Guzzle/Stream/StreamInterface.php
+++ /dev/null
@@ -1,218 +0,0 @@
-=5.3.2",
- "guzzle/common": "self.version"
- },
- "suggest": {
- "guzzle/http": "To convert Guzzle request objects to PHP streams"
- },
- "autoload": {
- "psr-0": { "Guzzle\\Stream": "" }
- },
- "target-dir": "Guzzle/Stream",
- "extra": {
- "branch-alias": {
- "dev-master": "3.7-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/AbstractBatchDecoratorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/AbstractBatchDecoratorTest.php
deleted file mode 100644
index 951738d..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/AbstractBatchDecoratorTest.php
+++ /dev/null
@@ -1,33 +0,0 @@
-getMock('Guzzle\Batch\BatchTransferInterface'),
- $this->getMock('Guzzle\Batch\BatchDivisorInterface')
- );
-
- $decoratorA = $this->getMockBuilder('Guzzle\Batch\AbstractBatchDecorator')
- ->setConstructorArgs(array($batch))
- ->getMockForAbstractClass();
-
- $decoratorB = $this->getMockBuilder('Guzzle\Batch\AbstractBatchDecorator')
- ->setConstructorArgs(array($decoratorA))
- ->getMockForAbstractClass();
-
- $decoratorA->add('foo');
- $this->assertFalse($decoratorB->isEmpty());
- $this->assertFalse($batch->isEmpty());
- $this->assertEquals(array($decoratorB, $decoratorA), $decoratorB->getDecorators());
- $this->assertEquals(array(), $decoratorB->flush());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchBuilderTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchBuilderTest.php
deleted file mode 100644
index 4da09d3..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchBuilderTest.php
+++ /dev/null
@@ -1,86 +0,0 @@
-getMock('Guzzle\Batch\BatchTransferInterface');
- }
-
- private function getMockDivisor()
- {
- return $this->getMock('Guzzle\Batch\BatchDivisorInterface');
- }
-
- private function getMockBatchBuilder()
- {
- return BatchBuilder::factory()
- ->transferWith($this->getMockTransfer())
- ->createBatchesWith($this->getMockDivisor());
- }
-
- public function testFactoryCreatesInstance()
- {
- $builder = BatchBuilder::factory();
- $this->assertInstanceOf('Guzzle\Batch\BatchBuilder', $builder);
- }
-
- public function testAddsAutoFlush()
- {
- $batch = $this->getMockBatchBuilder()->autoFlushAt(10)->build();
- $this->assertInstanceOf('Guzzle\Batch\FlushingBatch', $batch);
- }
-
- public function testAddsExceptionBuffering()
- {
- $batch = $this->getMockBatchBuilder()->bufferExceptions()->build();
- $this->assertInstanceOf('Guzzle\Batch\ExceptionBufferingBatch', $batch);
- }
-
- public function testAddHistory()
- {
- $batch = $this->getMockBatchBuilder()->keepHistory()->build();
- $this->assertInstanceOf('Guzzle\Batch\HistoryBatch', $batch);
- }
-
- public function testAddsNotify()
- {
- $batch = $this->getMockBatchBuilder()->notify(function() {})->build();
- $this->assertInstanceOf('Guzzle\Batch\NotifyingBatch', $batch);
- }
-
- /**
- * @expectedException Guzzle\Common\Exception\RuntimeException
- */
- public function testTransferStrategyMustBeSet()
- {
- $batch = BatchBuilder::factory()->createBatchesWith($this->getMockDivisor())->build();
- }
-
- /**
- * @expectedException Guzzle\Common\Exception\RuntimeException
- */
- public function testDivisorStrategyMustBeSet()
- {
- $batch = BatchBuilder::factory()->transferWith($this->getMockTransfer())->build();
- }
-
- public function testTransfersRequests()
- {
- $batch = BatchBuilder::factory()->transferRequests(10)->build();
- $this->assertInstanceOf('Guzzle\Batch\BatchRequestTransfer', $this->readAttribute($batch, 'transferStrategy'));
- }
-
- public function testTransfersCommands()
- {
- $batch = BatchBuilder::factory()->transferCommands(10)->build();
- $this->assertInstanceOf('Guzzle\Batch\BatchCommandTransfer', $this->readAttribute($batch, 'transferStrategy'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchClosureDivisorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchClosureDivisorTest.php
deleted file mode 100644
index 753db7d..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchClosureDivisorTest.php
+++ /dev/null
@@ -1,36 +0,0 @@
-createBatches($queue);
- $this->assertEquals(array(array('foo'), array('baz')), $batches);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchClosureTransferTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchClosureTransferTest.php
deleted file mode 100644
index 6ba7ae0..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchClosureTransferTest.php
+++ /dev/null
@@ -1,52 +0,0 @@
-itemsTransferred = null;
- $itemsTransferred =& $this->itemsTransferred;
-
- $this->transferStrategy = new BatchClosureTransfer(function (array $batch) use (&$itemsTransferred) {
- $itemsTransferred = $batch;
- return;
- });
- }
-
- public function testTransfersBatch()
- {
- $batchedItems = array('foo', 'bar', 'baz');
- $this->transferStrategy->transfer($batchedItems);
-
- $this->assertEquals($batchedItems, $this->itemsTransferred);
- }
-
- public function testTransferBailsOnEmptyBatch()
- {
- $batchedItems = array();
- $this->transferStrategy->transfer($batchedItems);
-
- $this->assertNull($this->itemsTransferred);
- }
-
- /**
- * @expectedException Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testEnsuresCallableIsCallable()
- {
- $foo = new BatchClosureTransfer('uh oh!');
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchCommandTransferTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchCommandTransferTest.php
deleted file mode 100644
index a04efab..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchCommandTransferTest.php
+++ /dev/null
@@ -1,83 +0,0 @@
- $command) {
- if ($i % 2) {
- $command->setClient($client1);
- } else {
- $command->setClient($client2);
- }
- $queue[] = $command;
- }
-
- $batch = new BatchCommandTransfer(2);
- $this->assertEquals(array(
- array($commands[0], $commands[2]),
- array($commands[4]),
- array($commands[1], $commands[3])
- ), $batch->createBatches($queue));
- }
-
- /**
- * @expectedException Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testEnsuresAllItemsAreCommands()
- {
- $queue = new \SplQueue();
- $queue[] = 'foo';
- $batch = new BatchCommandTransfer(2);
- $batch->createBatches($queue);
- }
-
- public function testTransfersBatches()
- {
- $client = $this->getMockBuilder('Guzzle\Service\Client')
- ->setMethods(array('send'))
- ->getMock();
- $client->expects($this->once())
- ->method('send');
- $command = new Mc();
- $command->setClient($client);
- $batch = new BatchCommandTransfer(2);
- $batch->transfer(array($command));
- }
-
- public function testDoesNotTransfersEmptyBatches()
- {
- $batch = new BatchCommandTransfer(2);
- $batch->transfer(array());
- }
-
- /**
- * @expectedException Guzzle\Service\Exception\InconsistentClientTransferException
- */
- public function testEnsuresAllCommandsUseTheSameClient()
- {
- $batch = new BatchCommandTransfer(2);
- $client1 = new Client('http://www.example.com');
- $client2 = new Client('http://www.example.com');
- $command1 = new Mc();
- $command1->setClient($client1);
- $command2 = new Mc();
- $command2->setClient($client2);
- $batch->transfer(array($command1, $command2));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchRequestTransferTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchRequestTransferTest.php
deleted file mode 100644
index dec7bd5..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchRequestTransferTest.php
+++ /dev/null
@@ -1,80 +0,0 @@
-setCurlMulti(new CurlMulti());
-
- $client2 = new Client('http://www.example.com');
- $client2->setCurlMulti(new CurlMulti());
-
- $request1 = $client1->get();
- $request2 = $client2->get();
- $request3 = $client1->get();
- $request4 = $client2->get();
- $request5 = $client1->get();
-
- $queue = new \SplQueue();
- $queue[] = $request1;
- $queue[] = $request2;
- $queue[] = $request3;
- $queue[] = $request4;
- $queue[] = $request5;
-
- $batch = new BatchRequestTransfer(2);
- $this->assertEquals(array(
- array($request1, $request3),
- array($request3),
- array($request2, $request4)
- ), $batch->createBatches($queue));
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testEnsuresAllItemsAreRequests()
- {
- $queue = new \SplQueue();
- $queue[] = 'foo';
- $batch = new BatchRequestTransfer(2);
- $batch->createBatches($queue);
- }
-
- public function testTransfersBatches()
- {
- $client = new Client('http://127.0.0.1:123');
- $request = $client->get();
- // For some reason... PHP unit clones the request, which emits a request.clone event. This causes the
- // 'sorted' property of the event dispatcher to contain an array in the cloned request that is not present in
- // the original.
- $request->dispatch('request.clone');
-
- $multi = $this->getMock('Guzzle\Http\Curl\CurlMultiInterface');
- $client->setCurlMulti($multi);
- $multi->expects($this->once())
- ->method('add')
- ->with($request);
- $multi->expects($this->once())
- ->method('send');
-
- $batch = new BatchRequestTransfer(2);
- $batch->transfer(array($request));
- }
-
- public function testDoesNotTransfersEmptyBatches()
- {
- $batch = new BatchRequestTransfer(2);
- $batch->transfer(array());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchSizeDivisorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchSizeDivisorTest.php
deleted file mode 100644
index 5542228..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchSizeDivisorTest.php
+++ /dev/null
@@ -1,24 +0,0 @@
-assertEquals(3, $d->getSize());
- $d->setSize(2);
- $batches = $d->createBatches($queue);
- $this->assertEquals(array(array('foo', 'baz'), array('bar')), $batches);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchTest.php
deleted file mode 100644
index 296f57a..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/BatchTest.php
+++ /dev/null
@@ -1,91 +0,0 @@
-getMock('Guzzle\Batch\BatchTransferInterface');
- }
-
- private function getMockDivisor()
- {
- return $this->getMock('Guzzle\Batch\BatchDivisorInterface');
- }
-
- public function testAddsItemsToQueue()
- {
- $batch = new Batch($this->getMockTransfer(), $this->getMockDivisor());
- $this->assertSame($batch, $batch->add('foo'));
- $this->assertEquals(1, count($batch));
- }
-
- public function testFlushReturnsItems()
- {
- $transfer = $this->getMockTransfer();
- $transfer->expects($this->exactly(2))
- ->method('transfer');
-
- $divisor = $this->getMockDivisor();
- $divisor->expects($this->once())
- ->method('createBatches')
- ->will($this->returnValue(array(array('foo', 'baz'), array('bar'))));
-
- $batch = new Batch($transfer, $divisor);
-
- $batch->add('foo')->add('baz')->add('bar');
- $items = $batch->flush();
-
- $this->assertEquals(array('foo', 'baz', 'bar'), $items);
- }
-
- public function testThrowsExceptionContainingTheFailedBatch()
- {
- $called = 0;
- $originalException = new \Exception('Foo!');
-
- $transfer = $this->getMockTransfer();
- $transfer->expects($this->exactly(2))
- ->method('transfer')
- ->will($this->returnCallback(function () use (&$called, $originalException) {
- if (++$called == 2) {
- throw $originalException;
- }
- }));
-
- $divisor = $this->getMockDivisor();
- $batch = new Batch($transfer, $divisor);
-
- // PHPunit clones objects before passing them to a callback.
- // Horrible hack to get around this!
- $queue = $this->readAttribute($batch, 'queue');
-
- $divisor->expects($this->once())
- ->method('createBatches')
- ->will($this->returnCallback(function ($batch) use ($queue) {
- foreach ($queue as $item) {
- $items[] = $item;
- }
- return array_chunk($items, 2);
- }));
-
- $batch->add('foo')->add('baz')->add('bar')->add('bee')->add('boo');
- $this->assertFalse($batch->isEmpty());
-
- try {
- $items = $batch->flush();
- $this->fail('Expected exception');
- } catch (BatchTransferException $e) {
- $this->assertEquals($originalException, $e->getPrevious());
- $this->assertEquals(array('bar', 'bee'), array_values($e->getBatch()));
- $this->assertEquals(1, count($batch));
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/ExceptionBufferingBatchTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/ExceptionBufferingBatchTest.php
deleted file mode 100644
index fd810b1..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/ExceptionBufferingBatchTest.php
+++ /dev/null
@@ -1,45 +0,0 @@
-getMockBuilder('Guzzle\Batch\BatchTransferInterface')
- ->setMethods(array('transfer'))
- ->getMock();
-
- $d = new BatchSizeDivisor(1);
- $batch = new Batch($t, $d);
-
- $called = 0;
- $t->expects($this->exactly(3))
- ->method('transfer')
- ->will($this->returnCallback(function ($batch) use (&$called) {
- if (++$called === 2) {
- throw new \Exception('Foo');
- }
- }));
-
- $decorator = new ExceptionBufferingBatch($batch);
- $decorator->add('foo')->add('baz')->add('bar');
- $result = $decorator->flush();
-
- $e = $decorator->getExceptions();
- $this->assertEquals(1, count($e));
- $this->assertEquals(array('baz'), $e[0]->getBatch());
-
- $decorator->clearExceptions();
- $this->assertEquals(0, count($decorator->getExceptions()));
-
- $this->assertEquals(array('foo', 'bar'), $result);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/FlushingBatchTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/FlushingBatchTest.php
deleted file mode 100644
index 9b37a48..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/FlushingBatchTest.php
+++ /dev/null
@@ -1,40 +0,0 @@
-getMock('Guzzle\Batch\BatchTransferInterface', array('transfer'));
- $d = $this->getMock('Guzzle\Batch\BatchDivisorInterface', array('createBatches'));
-
- $batch = new Batch($t, $d);
- $queue = $this->readAttribute($batch, 'queue');
-
- $d->expects($this->exactly(2))
- ->method('createBatches')
- ->will($this->returnCallback(function () use ($queue) {
- $items = array();
- foreach ($queue as $item) {
- $items[] = $item;
- }
- return array($items);
- }));
-
- $t->expects($this->exactly(2))
- ->method('transfer');
-
- $flush = new FlushingBatch($batch, 3);
- $this->assertEquals(3, $flush->getThreshold());
- $flush->setThreshold(2);
- $flush->add('foo')->add('baz')->add('bar')->add('bee')->add('boo');
- $this->assertEquals(1, count($flush));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/HistoryBatchTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/HistoryBatchTest.php
deleted file mode 100644
index 60d6f95..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/HistoryBatchTest.php
+++ /dev/null
@@ -1,26 +0,0 @@
-getMock('Guzzle\Batch\BatchTransferInterface'),
- $this->getMock('Guzzle\Batch\BatchDivisorInterface')
- );
-
- $history = new HistoryBatch($batch);
- $history->add('foo')->add('baz');
- $this->assertEquals(array('foo', 'baz'), $history->getHistory());
- $history->clearHistory();
- $this->assertEquals(array(), $history->getHistory());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/NotifyingBatchTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/NotifyingBatchTest.php
deleted file mode 100644
index 69a8900..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Batch/NotifyingBatchTest.php
+++ /dev/null
@@ -1,45 +0,0 @@
-getMock('Guzzle\Batch\Batch', array('flush'), array(
- $this->getMock('Guzzle\Batch\BatchTransferInterface'),
- $this->getMock('Guzzle\Batch\BatchDivisorInterface')
- ));
-
- $batch->expects($this->once())
- ->method('flush')
- ->will($this->returnValue(array('foo', 'baz')));
-
- $data = array();
- $decorator = new NotifyingBatch($batch, function ($batch) use (&$data) {
- $data[] = $batch;
- });
-
- $decorator->add('foo')->add('baz');
- $decorator->flush();
- $this->assertEquals(array(array('foo', 'baz')), $data);
- }
-
- /**
- * @expectedException Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testEnsuresCallableIsValid()
- {
- $batch = new Batch(
- $this->getMock('Guzzle\Batch\BatchTransferInterface'),
- $this->getMock('Guzzle\Batch\BatchDivisorInterface')
- );
- $decorator = new NotifyingBatch($batch, 'foo');
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Cache/CacheAdapterFactoryTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Cache/CacheAdapterFactoryTest.php
deleted file mode 100644
index c4140a9..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Cache/CacheAdapterFactoryTest.php
+++ /dev/null
@@ -1,64 +0,0 @@
-cache = new ArrayCache();
- $this->adapter = new DoctrineCacheAdapter($this->cache);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testEnsuresConfigIsObject()
- {
- CacheAdapterFactory::fromCache(array());
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testEnsuresKnownType()
- {
- CacheAdapterFactory::fromCache(new \stdClass());
- }
-
- public function cacheProvider()
- {
- return array(
- array(new DoctrineCacheAdapter(new ArrayCache()), 'Guzzle\Cache\DoctrineCacheAdapter'),
- array(new ArrayCache(), 'Guzzle\Cache\DoctrineCacheAdapter'),
- array(StorageFactory::factory(array('adapter' => 'memory')), 'Guzzle\Cache\Zf2CacheAdapter'),
- );
- }
-
- /**
- * @dataProvider cacheProvider
- */
- public function testCreatesNullCacheAdapterByDefault($cache, $type)
- {
- $adapter = CacheAdapterFactory::fromCache($cache);
- $this->assertInstanceOf($type, $adapter);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Cache/CacheAdapterTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Cache/CacheAdapterTest.php
deleted file mode 100644
index 3e30ddd..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Cache/CacheAdapterTest.php
+++ /dev/null
@@ -1,68 +0,0 @@
-cache = new ArrayCache();
- $this->adapter = new DoctrineCacheAdapter($this->cache);
- }
-
- /**
- * Cleans up the environment after running a test.
- */
- protected function tearDown()
- {
- $this->adapter = null;
- $this->cache = null;
- parent::tearDown();
- }
-
- public function testGetCacheObject()
- {
- $this->assertEquals($this->cache, $this->adapter->getCacheObject());
- }
-
- public function testSave()
- {
- $this->assertTrue($this->adapter->save('test', 'data', 1000));
- }
-
- public function testFetch()
- {
- $this->assertTrue($this->adapter->save('test', 'data', 1000));
- $this->assertEquals('data', $this->adapter->fetch('test'));
- }
-
- public function testContains()
- {
- $this->assertTrue($this->adapter->save('test', 'data', 1000));
- $this->assertTrue($this->adapter->contains('test'));
- }
-
- public function testDelete()
- {
- $this->assertTrue($this->adapter->save('test', 'data', 1000));
- $this->assertTrue($this->adapter->delete('test'));
- $this->assertFalse($this->adapter->contains('test'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Cache/ClosureCacheAdapterTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Cache/ClosureCacheAdapterTest.php
deleted file mode 100644
index 12de65b..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Cache/ClosureCacheAdapterTest.php
+++ /dev/null
@@ -1,94 +0,0 @@
-callables = array(
- 'contains' => function($id, $options = array()) use ($that) {
- return array_key_exists($id, $that->data);
- },
- 'delete' => function($id, $options = array()) use ($that) {
- unset($that->data[$id]);
- return true;
- },
- 'fetch' => function($id, $options = array()) use ($that) {
- return array_key_exists($id, $that->data) ? $that->data[$id] : null;
- },
- 'save' => function($id, $data, $lifeTime, $options = array()) use ($that) {
- $that->data[$id] = $data;
- return true;
- }
- );
-
- $this->adapter = new ClosureCacheAdapter($this->callables);
- }
-
- /**
- * Cleans up the environment after running a test.
- */
- protected function tearDown()
- {
- $this->cache = null;
- $this->callables = null;
- parent::tearDown();
- }
-
- /**
- * @expectedException InvalidArgumentException
- */
- public function testEnsuresCallablesArePresent()
- {
- $callables = $this->callables;
- unset($callables['delete']);
- $cache = new ClosureCacheAdapter($callables);
- }
-
- public function testAllCallablesMustBePresent()
- {
- $cache = new ClosureCacheAdapter($this->callables);
- }
-
- public function testCachesDataUsingCallables()
- {
- $this->assertTrue($this->adapter->save('test', 'data', 1000));
- $this->assertEquals('data', $this->adapter->fetch('test'));
- }
-
- public function testChecksIfCacheContainsKeys()
- {
- $this->adapter->save('test', 'data', 1000);
- $this->assertTrue($this->adapter->contains('test'));
- $this->assertFalse($this->adapter->contains('foo'));
- }
-
- public function testDeletesFromCacheByKey()
- {
- $this->adapter->save('test', 'data', 1000);
- $this->assertTrue($this->adapter->contains('test'));
- $this->adapter->delete('test');
- $this->assertFalse($this->adapter->contains('test'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Cache/NullCacheAdapterTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Cache/NullCacheAdapterTest.php
deleted file mode 100644
index e05df3f..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Cache/NullCacheAdapterTest.php
+++ /dev/null
@@ -1,20 +0,0 @@
-assertEquals(false, $c->contains('foo'));
- $this->assertEquals(true, $c->delete('foo'));
- $this->assertEquals(false, $c->fetch('foo'));
- $this->assertEquals(true, $c->save('foo', 'bar'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Cache/Zf2CacheAdapterTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Cache/Zf2CacheAdapterTest.php
deleted file mode 100644
index 9077c12..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Cache/Zf2CacheAdapterTest.php
+++ /dev/null
@@ -1,58 +0,0 @@
-cache = StorageFactory::factory(array(
- 'adapter' => 'memory'
- ));
- $this->adapter = new Zf2CacheAdapter($this->cache);
- }
-
- /**
- * Cleans up the environment after running a test.
- */
- protected function tearDown()
- {
- $this->adapter = null;
- $this->cache = null;
- parent::tearDown();
- }
-
- public function testCachesDataUsingCallables()
- {
- $this->assertTrue($this->adapter->save('test', 'data', 1000));
- $this->assertEquals('data', $this->adapter->fetch('test'));
- }
-
- public function testChecksIfCacheContainsKeys()
- {
- $this->adapter->save('test', 'data', 1000);
- $this->assertTrue($this->adapter->contains('test'));
- $this->assertFalse($this->adapter->contains('foo'));
- }
-
- public function testDeletesFromCacheByKey()
- {
- $this->adapter->save('test', 'data', 1000);
- $this->assertTrue($this->adapter->contains('test'));
- $this->adapter->delete('test');
- $this->assertFalse($this->adapter->contains('test'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/AbstractHasDispatcherTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/AbstractHasDispatcherTest.php
deleted file mode 100644
index 19d12e6..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/AbstractHasDispatcherTest.php
+++ /dev/null
@@ -1,63 +0,0 @@
-assertEquals(array(), AbstractHasDispatcher::getAllEvents());
- }
-
- public function testAllowsDispatcherToBeInjected()
- {
- $d = new EventDispatcher();
- $mock = $this->getMockForAbstractClass('Guzzle\Common\AbstractHasDispatcher');
- $this->assertSame($mock, $mock->setEventDispatcher($d));
- $this->assertSame($d, $mock->getEventDispatcher());
- }
-
- public function testCreatesDefaultEventDispatcherIfNeeded()
- {
- $mock = $this->getMockForAbstractClass('Guzzle\Common\AbstractHasDispatcher');
- $this->assertInstanceOf('Symfony\Component\EventDispatcher\EventDispatcher', $mock->getEventDispatcher());
- }
-
- public function testHelperDispatchesEvents()
- {
- $data = array();
- $mock = $this->getMockForAbstractClass('Guzzle\Common\AbstractHasDispatcher');
- $mock->getEventDispatcher()->addListener('test', function(Event $e) use (&$data) {
- $data = $e->getIterator()->getArrayCopy();
- });
- $mock->dispatch('test', array(
- 'param' => 'abc'
- ));
- $this->assertEquals(array(
- 'param' => 'abc',
- ), $data);
- }
-
- public function testHelperAttachesSubscribers()
- {
- $mock = $this->getMockForAbstractClass('Guzzle\Common\AbstractHasDispatcher');
- $subscriber = $this->getMockForAbstractClass('Symfony\Component\EventDispatcher\EventSubscriberInterface');
-
- $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher')
- ->setMethods(array('addSubscriber'))
- ->getMock();
-
- $dispatcher->expects($this->once())
- ->method('addSubscriber');
-
- $mock->setEventDispatcher($dispatcher);
- $mock->addSubscriber($subscriber);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/CollectionTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/CollectionTest.php
deleted file mode 100644
index 0648a02..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/CollectionTest.php
+++ /dev/null
@@ -1,529 +0,0 @@
-coll = new Collection();
- }
-
- public function testConstructorCanBeCalledWithNoParams()
- {
- $this->coll = new Collection();
- $p = $this->coll->getAll();
- $this->assertEmpty($p, '-> Collection must be empty when no data is passed');
- }
-
- public function testConstructorCanBeCalledWithParams()
- {
- $testData = array(
- 'test' => 'value',
- 'test_2' => 'value2'
- );
- $this->coll = new Collection($testData);
- $this->assertEquals($this->coll->getAll(), $testData, '-> getAll() must return the data passed in the constructor');
- $this->assertEquals($this->coll->getAll(), $this->coll->toArray());
- }
-
- public function testImplementsIteratorAggregate()
- {
- $this->coll->set('key', 'value');
- $this->assertInstanceOf('ArrayIterator', $this->coll->getIterator());
- $this->assertEquals(1, count($this->coll));
- $total = 0;
- foreach ($this->coll as $key => $value) {
- $this->assertEquals('key', $key);
- $this->assertEquals('value', $value);
- $total++;
- }
- $this->assertEquals(1, $total);
- }
-
- public function testCanAddValuesToExistingKeysByUsingArray()
- {
- $this->coll->add('test', 'value1');
- $this->assertEquals($this->coll->getAll(), array('test' => 'value1'));
- $this->coll->add('test', 'value2');
- $this->assertEquals($this->coll->getAll(), array('test' => array('value1', 'value2')));
- $this->coll->add('test', 'value3');
- $this->assertEquals($this->coll->getAll(), array('test' => array('value1', 'value2', 'value3')));
- }
-
- public function testHandlesMergingInDisparateDataSources()
- {
- $params = array(
- 'test' => 'value1',
- 'test2' => 'value2',
- 'test3' => array('value3', 'value4')
- );
- $this->coll->merge($params);
- $this->assertEquals($this->coll->getAll(), $params);
-
- // Pass the same object to itself
- $this->assertEquals($this->coll->merge($this->coll), $this->coll);
- }
-
- public function testCanClearAllDataOrSpecificKeys()
- {
- $this->coll->merge(array(
- 'test' => 'value1',
- 'test2' => 'value2'
- ));
-
- // Clear a specific parameter by name
- $this->coll->remove('test');
-
- $this->assertEquals($this->coll->getAll(), array(
- 'test2' => 'value2'
- ));
-
- // Clear all parameters
- $this->coll->clear();
-
- $this->assertEquals($this->coll->getAll(), array());
- }
-
- public function testGetsValuesByKey()
- {
- $this->assertNull($this->coll->get('test'));
- $this->coll->add('test', 'value');
- $this->assertEquals('value', $this->coll->get('test'));
- $this->coll->set('test2', 'v2');
- $this->coll->set('test3', 'v3');
- $this->assertEquals(array(
- 'test' => 'value',
- 'test2' => 'v2'
- ), $this->coll->getAll(array('test', 'test2')));
- }
-
- public function testProvidesKeys()
- {
- $this->assertEquals(array(), $this->coll->getKeys());
- $this->coll->merge(array(
- 'test1' => 'value1',
- 'test2' => 'value2'
- ));
- $this->assertEquals(array('test1', 'test2'), $this->coll->getKeys());
- // Returns the cached array previously returned
- $this->assertEquals(array('test1', 'test2'), $this->coll->getKeys());
- $this->coll->remove('test1');
- $this->assertEquals(array('test2'), $this->coll->getKeys());
- $this->coll->add('test3', 'value3');
- $this->assertEquals(array('test2', 'test3'), $this->coll->getKeys());
- }
-
- public function testChecksIfHasKey()
- {
- $this->assertFalse($this->coll->hasKey('test'));
- $this->coll->add('test', 'value');
- $this->assertEquals(true, $this->coll->hasKey('test'));
- $this->coll->add('test2', 'value2');
- $this->assertEquals(true, $this->coll->hasKey('test'));
- $this->assertEquals(true, $this->coll->hasKey('test2'));
- $this->assertFalse($this->coll->hasKey('testing'));
- $this->assertEquals(false, $this->coll->hasKey('AB-C', 'junk'));
- }
-
- public function testChecksIfHasValue()
- {
- $this->assertFalse($this->coll->hasValue('value'));
- $this->coll->add('test', 'value');
- $this->assertEquals('test', $this->coll->hasValue('value'));
- $this->coll->add('test2', 'value2');
- $this->assertEquals('test', $this->coll->hasValue('value'));
- $this->assertEquals('test2', $this->coll->hasValue('value2'));
- $this->assertFalse($this->coll->hasValue('val'));
- }
-
- public function testCanGetAllValuesByArray()
- {
- $this->coll->add('foo', 'bar');
- $this->coll->add('tEsT', 'value');
- $this->coll->add('tesTing', 'v2');
- $this->coll->add('key', 'v3');
- $this->assertNull($this->coll->get('test'));
- $this->assertEquals(array(
- 'foo' => 'bar',
- 'tEsT' => 'value',
- 'tesTing' => 'v2'
- ), $this->coll->getAll(array(
- 'foo', 'tesTing', 'tEsT'
- )));
- }
-
- public function testImplementsCount()
- {
- $data = new Collection();
- $this->assertEquals(0, $data->count());
- $data->add('key', 'value');
- $this->assertEquals(1, count($data));
- $data->add('key', 'value2');
- $this->assertEquals(1, count($data));
- $data->add('key_2', 'value3');
- $this->assertEquals(2, count($data));
- }
-
- public function testAddParamsByMerging()
- {
- $params = array(
- 'test' => 'value1',
- 'test2' => 'value2',
- 'test3' => array('value3', 'value4')
- );
-
- // Add some parameters
- $this->coll->merge($params);
-
- // Add more parameters by merging them in
- $this->coll->merge(array(
- 'test' => 'another',
- 'different_key' => 'new value'
- ));
-
- $this->assertEquals(array(
- 'test' => array('value1', 'another'),
- 'test2' => 'value2',
- 'test3' => array('value3', 'value4'),
- 'different_key' => 'new value'
- ), $this->coll->getAll());
- }
-
- public function testAllowsFunctionalFilter()
- {
- $this->coll->merge(array(
- 'fruit' => 'apple',
- 'number' => 'ten',
- 'prepositions' => array('about', 'above', 'across', 'after'),
- 'same_number' => 'ten'
- ));
-
- $filtered = $this->coll->filter(function($key, $value) {
- return $value == 'ten';
- });
-
- $this->assertNotEquals($filtered, $this->coll);
-
- $this->assertEquals(array(
- 'number' => 'ten',
- 'same_number' => 'ten'
- ), $filtered->getAll());
- }
-
- public function testAllowsFunctionalMapping()
- {
- $this->coll->merge(array(
- 'number_1' => 1,
- 'number_2' => 2,
- 'number_3' => 3
- ));
-
- $mapped = $this->coll->map(function($key, $value) {
- return $value * $value;
- });
-
- $this->assertNotEquals($mapped, $this->coll);
-
- $this->assertEquals(array(
- 'number_1' => 1,
- 'number_2' => 4,
- 'number_3' => 9
- ), $mapped->getAll());
- }
-
- public function testImplementsArrayAccess()
- {
- $this->coll->merge(array(
- 'k1' => 'v1',
- 'k2' => 'v2'
- ));
-
- $this->assertTrue($this->coll->offsetExists('k1'));
- $this->assertFalse($this->coll->offsetExists('Krull'));
-
- $this->coll->offsetSet('k3', 'v3');
- $this->assertEquals('v3', $this->coll->offsetGet('k3'));
- $this->assertEquals('v3', $this->coll->get('k3'));
-
- $this->coll->offsetUnset('k1');
- $this->assertFalse($this->coll->offsetExists('k1'));
- }
-
- public function testUsesStaticWhenCreatingNew()
- {
- $qs = new QueryString(array(
- 'a' => 'b',
- 'c' => 'd'
- ));
-
- $this->assertInstanceOf('Guzzle\\Http\\QueryString', $qs->map(function($a, $b) {}));
- $this->assertInstanceOf('Guzzle\\Common\\Collection', $qs->map(function($a, $b) {}, array(), false));
-
- $this->assertInstanceOf('Guzzle\\Http\\QueryString', $qs->filter(function($a, $b) {}));
- $this->assertInstanceOf('Guzzle\\Common\\Collection', $qs->filter(function($a, $b) {}, false));
- }
-
- public function testCanReplaceAllData()
- {
- $this->assertSame($this->coll, $this->coll->replace(array(
- 'a' => '123'
- )));
-
- $this->assertEquals(array(
- 'a' => '123'
- ), $this->coll->getAll());
- }
-
- public function dataProvider()
- {
- return array(
- array('this_is_a_test', '{a}_is_a_{b}', array(
- 'a' => 'this',
- 'b' => 'test'
- )),
- array('this_is_a_test', '{abc}_is_a_{0}', array(
- 'abc' => 'this',
- 0 => 'test'
- )),
- array('this_is_a_test', '{abc}_is_a_{0}', array(
- 'abc' => 'this',
- 0 => 'test'
- )),
- array('this_is_a_test', 'this_is_a_test', array(
- 'abc' => 'this'
- )),
- array('{abc}_is_{not_found}a_{0}', '{abc}_is_{not_found}a_{0}', array())
- );
- }
-
- /**
- * @dataProvider dataProvider
- */
- public function testInjectsConfigData($output, $input, $config)
- {
- $collection = new Collection($config);
- $this->assertEquals($output, $collection->inject($input));
- }
-
- public function testCanSearchByKey()
- {
- $collection = new Collection(array(
- 'foo' => 'bar',
- 'BaZ' => 'pho'
- ));
-
- $this->assertEquals('foo', $collection->keySearch('FOO'));
- $this->assertEquals('BaZ', $collection->keySearch('baz'));
- $this->assertEquals(false, $collection->keySearch('Bar'));
- }
-
- public function testPreparesFromConfig()
- {
- $c = Collection::fromConfig(array(
- 'a' => '123',
- 'base_url' => 'http://www.test.com/'
- ), array(
- 'a' => 'xyz',
- 'b' => 'lol'
- ), array('a'));
-
- $this->assertInstanceOf('Guzzle\Common\Collection', $c);
- $this->assertEquals(array(
- 'a' => '123',
- 'b' => 'lol',
- 'base_url' => 'http://www.test.com/'
- ), $c->getAll());
-
- try {
- $c = Collection::fromConfig(array(), array(), array('a'));
- $this->fail('Exception not throw when missing config');
- } catch (InvalidArgumentException $e) {
- }
- }
-
- function falseyDataProvider()
- {
- return array(
- array(false, false),
- array(null, null),
- array('', ''),
- array(array(), array()),
- array(0, 0),
- );
- }
-
- /**
- * @dataProvider falseyDataProvider
- */
- public function testReturnsCorrectData($a, $b)
- {
- $c = new Collection(array('value' => $a));
- $this->assertSame($b, $c->get('value'));
- }
-
- public function testRetrievesNestedKeysUsingPath()
- {
- $data = array(
- 'foo' => 'bar',
- 'baz' => array(
- 'mesa' => array(
- 'jar' => 'jar'
- )
- )
- );
- $collection = new Collection($data);
- $this->assertEquals('bar', $collection->getPath('foo'));
- $this->assertEquals('jar', $collection->getPath('baz/mesa/jar'));
- $this->assertNull($collection->getPath('wewewf'));
- $this->assertNull($collection->getPath('baz/mesa/jar/jar'));
- }
-
- public function testFalseyKeysStillDescend()
- {
- $collection = new Collection(array(
- '0' => array(
- 'a' => 'jar'
- ),
- 1 => 'other'
- ));
- $this->assertEquals('jar', $collection->getPath('0/a'));
- $this->assertEquals('other', $collection->getPath('1'));
- }
-
- public function getPathProvider()
- {
- $data = array(
- 'foo' => 'bar',
- 'baz' => array(
- 'mesa' => array(
- 'jar' => 'jar',
- 'array' => array('a', 'b', 'c')
- ),
- 'bar' => array(
- 'baz' => 'bam',
- 'array' => array('d', 'e', 'f')
- )
- ),
- 'bam' => array(
- array('foo' => 1),
- array('foo' => 2),
- array('array' => array('h', 'i'))
- )
- );
- $c = new Collection($data);
-
- return array(
- // Simple path selectors
- array($c, 'foo', 'bar'),
- array($c, 'baz', $data['baz']),
- array($c, 'bam', $data['bam']),
- array($c, 'baz/mesa', $data['baz']['mesa']),
- array($c, 'baz/mesa/jar', 'jar'),
- // Merge everything two levels under baz
- array($c, 'baz/*', array(
- 'jar' => 'jar',
- 'array' => array_merge($data['baz']['mesa']['array'], $data['baz']['bar']['array']),
- 'baz' => 'bam'
- )),
- // Does not barf on missing keys
- array($c, 'fefwfw', null),
- // Does not barf when a wildcard does not resolve correctly
- array($c, '*/*/*/*/*/wefwfe', array()),
- // Allows custom separator
- array($c, '*|mesa', $data['baz']['mesa'], '|'),
- // Merge all 'array' keys two levels under baz (the trailing * does not hurt the results)
- array($c, 'baz/*/array/*', array_merge($data['baz']['mesa']['array'], $data['baz']['bar']['array'])),
- // Merge all 'array' keys two levels under baz
- array($c, 'baz/*/array', array_merge($data['baz']['mesa']['array'], $data['baz']['bar']['array'])),
- array($c, 'baz/mesa/array', $data['baz']['mesa']['array']),
- // Having a trailing * does not hurt the results
- array($c, 'baz/mesa/array/*', $data['baz']['mesa']['array']),
- // Merge of anything one level deep
- array($c, '*', array_merge(array('bar'), $data['baz'], $data['bam'])),
- // Funky merge of anything two levels deep
- array($c, '*/*', array(
- 'jar' => 'jar',
- 'array' => array('a', 'b', 'c', 'd', 'e', 'f', 'h', 'i'),
- 'baz' => 'bam',
- 'foo' => array(1, 2)
- )),
- // Funky merge of all 'array' keys that are two levels deep
- array($c, '*/*/array', array('a', 'b', 'c', 'd', 'e', 'f', 'h', 'i'))
- );
- }
-
- /**
- * @dataProvider getPathProvider
- */
- public function testGetPath(Collection $c, $path, $expected, $separator = '/')
- {
- $this->assertEquals($expected, $c->getPath($path, $separator));
- }
-
- public function testOverridesSettings()
- {
- $c = new Collection(array('foo' => 1, 'baz' => 2, 'bar' => 3));
- $c->overwriteWith(array('foo' => 10, 'bar' => 300));
- $this->assertEquals(array('foo' => 10, 'baz' => 2, 'bar' => 300), $c->getAll());
- }
-
- public function testOverwriteWithCollection()
- {
- $c = new Collection(array('foo' => 1, 'baz' => 2, 'bar' => 3));
- $b = new Collection(array('foo' => 10, 'bar' => 300));
- $c->overwriteWith($b);
- $this->assertEquals(array('foo' => 10, 'baz' => 2, 'bar' => 300), $c->getAll());
- }
-
- public function testOverwriteWithTraversable()
- {
- $c = new Collection(array('foo' => 1, 'baz' => 2, 'bar' => 3));
- $b = new Collection(array('foo' => 10, 'bar' => 300));
- $c->overwriteWith($b->getIterator());
- $this->assertEquals(array('foo' => 10, 'baz' => 2, 'bar' => 300), $c->getAll());
- }
-
- public function testCanSetNestedPathValueThatDoesNotExist()
- {
- $c = new Collection(array());
- $c->setPath('foo/bar/baz/123', 'hi');
- $this->assertEquals('hi', $c['foo']['bar']['baz']['123']);
- }
-
- public function testCanSetNestedPathValueThatExists()
- {
- $c = new Collection(array('foo' => array('bar' => 'test')));
- $c->setPath('foo/bar', 'hi');
- $this->assertEquals('hi', $c['foo']['bar']);
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\RuntimeException
- */
- public function testVerifiesNestedPathIsValidAtExactLevel()
- {
- $c = new Collection(array('foo' => 'bar'));
- $c->setPath('foo/bar', 'hi');
- $this->assertEquals('hi', $c['foo']['bar']);
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\RuntimeException
- */
- public function testVerifiesThatNestedPathIsValidAtAnyLevel()
- {
- $c = new Collection(array('foo' => 'bar'));
- $c->setPath('foo/bar/baz', 'test');
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/EventTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/EventTest.php
deleted file mode 100644
index 5484e14..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/EventTest.php
+++ /dev/null
@@ -1,62 +0,0 @@
- '123',
- 'other' => '456',
- 'event' => 'test.notify'
- ));
- }
-
- public function testAllowsParameterInjection()
- {
- $event = new Event(array(
- 'test' => '123'
- ));
- $this->assertEquals('123', $event['test']);
- }
-
- public function testImplementsArrayAccess()
- {
- $event = $this->getEvent();
- $this->assertEquals('123', $event['test']);
- $this->assertNull($event['foobar']);
-
- $this->assertTrue($event->offsetExists('test'));
- $this->assertFalse($event->offsetExists('foobar'));
-
- unset($event['test']);
- $this->assertFalse($event->offsetExists('test'));
-
- $event['test'] = 'new';
- $this->assertEquals('new', $event['test']);
- }
-
- public function testImplementsIteratorAggregate()
- {
- $event = $this->getEvent();
- $this->assertInstanceOf('ArrayIterator', $event->getIterator());
- }
-
- public function testConvertsToArray()
- {
- $this->assertEquals(array(
- 'test' => '123',
- 'other' => '456',
- 'event' => 'test.notify'
- ), $this->getEvent()->toArray());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/Exception/BatchTransferExceptionTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/Exception/BatchTransferExceptionTest.php
deleted file mode 100644
index c72a2a6..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/Exception/BatchTransferExceptionTest.php
+++ /dev/null
@@ -1,21 +0,0 @@
-getMock('Guzzle\Batch\BatchTransferInterface');
- $d = $this->getMock('Guzzle\Batch\BatchDivisorInterface');
- $transferException = new BatchTransferException(array('foo'), array(1, 2), $e, $t, $d);
- $this->assertEquals(array('foo'), $transferException->getBatch());
- $this->assertSame($t, $transferException->getTransferStrategy());
- $this->assertSame($d, $transferException->getDivisorStrategy());
- $this->assertSame($e, $transferException->getPrevious());
- $this->assertEquals(array(1, 2), $transferException->getTransferredItems());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/Exception/ExceptionCollectionTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/Exception/ExceptionCollectionTest.php
deleted file mode 100644
index 2aecf2a..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/Exception/ExceptionCollectionTest.php
+++ /dev/null
@@ -1,66 +0,0 @@
-getExceptions();
- $e->add($exceptions[0]);
- $e->add($exceptions[1]);
- $this->assertContains("(Exception) ./tests/Guzzle/Tests/Common/Exception/ExceptionCollectionTest.php line ", $e->getMessage());
- $this->assertContains(" Test\n\n #0 ./", $e->getMessage());
- $this->assertSame($exceptions[0], $e->getFirst());
- }
-
- public function testCanSetExceptions()
- {
- $ex = new \Exception('foo');
- $e = new ExceptionCollection();
- $e->setExceptions(array($ex));
- $this->assertSame($ex, $e->getFirst());
- }
-
- public function testActsAsArray()
- {
- $e = new ExceptionCollection();
- $exceptions = $this->getExceptions();
- $e->add($exceptions[0]);
- $e->add($exceptions[1]);
- $this->assertEquals(2, count($e));
- $this->assertEquals($exceptions, $e->getIterator()->getArrayCopy());
- }
-
- public function testCanAddSelf()
- {
- $e1 = new ExceptionCollection();
- $e1->add(new \Exception("Test"));
- $e2 = new ExceptionCollection('Meta description!');
- $e2->add(new \Exception("Test 2"));
- $e3 = new ExceptionCollection();
- $e3->add(new \Exception('Baz'));
- $e2->add($e3);
- $e1->add($e2);
- $message = $e1->getMessage();
- $this->assertContains("(Exception) ./tests/Guzzle/Tests/Common/Exception/ExceptionCollectionTest.php line ", $message);
- $this->assertContains("\n Test\n\n #0 ", $message);
- $this->assertContains("\n\n(Guzzle\\Common\\Exception\\ExceptionCollection) ./tests/Guzzle/Tests/Common/Exception/ExceptionCollectionTest.php line ", $message);
- $this->assertContains("\n\n Meta description!\n\n", $message);
- $this->assertContains(" (Exception) ./tests/Guzzle/Tests/Common/Exception/ExceptionCollectionTest.php line ", $message);
- $this->assertContains("\n Test 2\n\n #0 ", $message);
- $this->assertContains(" (Exception) ./tests/Guzzle/Tests/Common/Exception/ExceptionCollectionTest.php line ", $message);
- $this->assertContains(" Baz\n\n #0", $message);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/VersionTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/VersionTest.php
deleted file mode 100644
index c3a81d1..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Common/VersionTest.php
+++ /dev/null
@@ -1,27 +0,0 @@
-isRunning()) {
- self::$server->flush();
- } else {
- self::$server->start();
- }
- }
-
- return self::$server;
- }
-
- /**
- * Set the service builder to use for tests
- *
- * @param ServiceBuilderInterface $builder Service builder
- */
- public static function setServiceBuilder(ServiceBuilderInterface $builder)
- {
- self::$serviceBuilder = $builder;
- }
-
- /**
- * Get a service builder object that can be used throughout the service tests
- *
- * @return ServiceBuilder
- */
- public static function getServiceBuilder()
- {
- if (!self::$serviceBuilder) {
- throw new RuntimeException('No service builder has been set via setServiceBuilder()');
- }
-
- return self::$serviceBuilder;
- }
-
- /**
- * Check if an event dispatcher has a subscriber
- *
- * @param HasDispatcherInterface $dispatcher
- * @param EventSubscriberInterface $subscriber
- *
- * @return bool
- */
- protected function hasSubscriber(HasDispatcherInterface $dispatcher, EventSubscriberInterface $subscriber)
- {
- $class = get_class($subscriber);
- $all = array_keys(call_user_func(array($class, 'getSubscribedEvents')));
-
- foreach ($all as $i => $event) {
- foreach ($dispatcher->getEventDispatcher()->getListeners($event) as $e) {
- if ($e[0] === $subscriber) {
- unset($all[$i]);
- break;
- }
- }
- }
-
- return count($all) == 0;
- }
-
- /**
- * Get a wildcard observer for an event dispatcher
- *
- * @param HasDispatcherInterface $hasDispatcher
- *
- * @return MockObserver
- */
- public function getWildcardObserver(HasDispatcherInterface $hasDispatcher)
- {
- $class = get_class($hasDispatcher);
- $o = new MockObserver();
- $events = call_user_func(array($class, 'getAllEvents'));
- foreach ($events as $event) {
- $hasDispatcher->getEventDispatcher()->addListener($event, array($o, 'update'));
- }
-
- return $o;
- }
-
- /**
- * Set the mock response base path
- *
- * @param string $path Path to mock response folder
- *
- * @return GuzzleTestCase
- */
- public static function setMockBasePath($path)
- {
- self::$mockBasePath = $path;
- }
-
- /**
- * Mark a request as being mocked
- *
- * @param RequestInterface $request
- *
- * @return self
- */
- public function addMockedRequest(RequestInterface $request)
- {
- $this->requests[] = $request;
-
- return $this;
- }
-
- /**
- * Get all of the mocked requests
- *
- * @return array
- */
- public function getMockedRequests()
- {
- return $this->requests;
- }
-
- /**
- * Get a mock response for a client by mock file name
- *
- * @param string $path Relative path to the mock response file
- *
- * @return Response
- */
- public function getMockResponse($path)
- {
- return $path instanceof Response
- ? $path
- : MockPlugin::getMockFile(self::$mockBasePath . DIRECTORY_SEPARATOR . $path);
- }
-
- /**
- * Set a mock response from a mock file on the next client request.
- *
- * This method assumes that mock response files are located under the
- * Command/Mock/ directory of the Service being tested
- * (e.g. Unfuddle/Command/Mock/). A mock response is added to the next
- * request sent by the client.
- *
- * @param Client $client Client object to modify
- * @param string $paths Path to files within the Mock folder of the service
- *
- * @return MockPlugin returns the created mock plugin
- */
- public function setMockResponse(Client $client, $paths)
- {
- $this->requests = array();
- $that = $this;
- $mock = new MockPlugin(null, true);
- $client->getEventDispatcher()->removeSubscriber($mock);
- $mock->getEventDispatcher()->addListener('mock.request', function(Event $event) use ($that) {
- $that->addMockedRequest($event['request']);
- });
-
- if ($paths instanceof Response) {
- // A single response instance has been specified, create an array with that instance
- // as the only element for the following loop to work as expected
- $paths = array($paths);
- }
-
- foreach ((array) $paths as $path) {
- $mock->addResponse($this->getMockResponse($path));
- }
-
- $client->getEventDispatcher()->addSubscriber($mock);
-
- return $mock;
- }
-
- /**
- * Compare HTTP headers and use special markup to filter values
- * A header prefixed with '!' means it must not exist
- * A header prefixed with '_' means it must be ignored
- * A header value of '*' means anything after the * will be ignored
- *
- * @param array $filteredHeaders Array of special headers
- * @param array $actualHeaders Array of headers to check against
- *
- * @return array|bool Returns an array of the differences or FALSE if none
- */
- public function compareHeaders($filteredHeaders, $actualHeaders)
- {
- $comparison = new HeaderComparison();
-
- return $comparison->compare($filteredHeaders, $actualHeaders);
- }
-
- /**
- * Case insensitive assertContains
- *
- * @param string $needle Search string
- * @param string $haystack Search this
- * @param string $message Optional failure message
- */
- public function assertContainsIns($needle, $haystack, $message = null)
- {
- $this->assertContains(strtolower($needle), strtolower($haystack), $message);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/AbstractEntityBodyDecoratorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/AbstractEntityBodyDecoratorTest.php
deleted file mode 100644
index 20feaa8..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/AbstractEntityBodyDecoratorTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-getMockForAbstractClass('Guzzle\Http\AbstractEntityBodyDecorator', array($e));
-
- $this->assertSame($e->getStream(), $mock->getStream());
- $this->assertSame($e->getContentLength(), $mock->getContentLength());
- $this->assertSame($e->getSize(), $mock->getSize());
- $this->assertSame($e->getContentMd5(), $mock->getContentMd5());
- $this->assertSame($e->getContentType(), $mock->getContentType());
- $this->assertSame($e->__toString(), $mock->__toString());
- $this->assertSame($e->getUri(), $mock->getUri());
- $this->assertSame($e->getStreamType(), $mock->getStreamType());
- $this->assertSame($e->getWrapper(), $mock->getWrapper());
- $this->assertSame($e->getWrapperData(), $mock->getWrapperData());
- $this->assertSame($e->isReadable(), $mock->isReadable());
- $this->assertSame($e->isWritable(), $mock->isWritable());
- $this->assertSame($e->isConsumed(), $mock->isConsumed());
- $this->assertSame($e->isLocal(), $mock->isLocal());
- $this->assertSame($e->isSeekable(), $mock->isSeekable());
- $this->assertSame($e->getContentEncoding(), $mock->getContentEncoding());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/CachingEntityBodyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/CachingEntityBodyTest.php
deleted file mode 100644
index e6e6cdb..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/CachingEntityBodyTest.php
+++ /dev/null
@@ -1,249 +0,0 @@
-decorated = EntityBody::factory('testing');
- $this->body = new CachingEntityBody($this->decorated);
- }
-
- public function testUsesRemoteSizeIfPossible()
- {
- $body = EntityBody::factory('test');
- $caching = new CachingEntityBody($body);
- $this->assertEquals(4, $caching->getSize());
- $this->assertEquals(4, $caching->getContentLength());
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\RuntimeException
- * @expectedExceptionMessage does not support custom stream rewind
- */
- public function testDoesNotAllowRewindFunction()
- {
- $this->body->setRewindFunction(true);
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\RuntimeException
- * @expectedExceptionMessage Cannot seek to byte 10
- */
- public function testCannotSeekPastWhatHasBeenRead()
- {
- $this->body->seek(10);
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\RuntimeException
- * @expectedExceptionMessage supports only SEEK_SET and SEEK_CUR
- */
- public function testCannotUseSeekEnd()
- {
- $this->body->seek(2, SEEK_END);
- }
-
- public function testChangingUnderlyingStreamUpdatesSizeAndStream()
- {
- $size = filesize(__FILE__);
- $s = fopen(__FILE__, 'r');
- $this->body->setStream($s, $size);
- $this->assertEquals($size, $this->body->getSize());
- $this->assertEquals($size, $this->decorated->getSize());
- $this->assertSame($s, $this->body->getStream());
- $this->assertSame($s, $this->decorated->getStream());
- }
-
- public function testRewindUsesSeek()
- {
- $a = EntityBody::factory('foo');
- $d = $this->getMockBuilder('Guzzle\Http\CachingEntityBody')
- ->setMethods(array('seek'))
- ->setConstructorArgs(array($a))
- ->getMock();
- $d->expects($this->once())
- ->method('seek')
- ->with(0)
- ->will($this->returnValue(true));
- $d->rewind();
- }
-
- public function testCanSeekToReadBytes()
- {
- $this->assertEquals('te', $this->body->read(2));
- $this->body->seek(0);
- $this->assertEquals('test', $this->body->read(4));
- $this->assertEquals(4, $this->body->ftell());
- $this->body->seek(2);
- $this->assertEquals(2, $this->body->ftell());
- $this->body->seek(2, SEEK_CUR);
- $this->assertEquals(4, $this->body->ftell());
- $this->assertEquals('ing', $this->body->read(3));
- }
-
- public function testWritesToBufferStream()
- {
- $this->body->read(2);
- $this->body->write('hi');
- $this->body->rewind();
- $this->assertEquals('tehiing', (string) $this->body);
- }
-
- public function testReadLinesFromBothStreams()
- {
- $this->body->seek($this->body->ftell());
- $this->body->write("test\n123\nhello\n1234567890\n");
- $this->body->rewind();
- $this->assertEquals("test\n", $this->body->readLine(7));
- $this->assertEquals("123\n", $this->body->readLine(7));
- $this->assertEquals("hello\n", $this->body->readLine(7));
- $this->assertEquals("123456", $this->body->readLine(7));
- $this->assertEquals("7890\n", $this->body->readLine(7));
- // We overwrote the decorated stream, so no more data
- $this->assertEquals('', $this->body->readLine(7));
- }
-
- public function testSkipsOverwrittenBytes()
- {
- $decorated = EntityBody::factory(
- implode("\n", array_map(function ($n) {
- return str_pad($n, 4, '0', STR_PAD_LEFT);
- }, range(0, 25)))
- );
-
- $body = new CachingEntityBody($decorated);
-
- $this->assertEquals("0000\n", $body->readLine());
- $this->assertEquals("0001\n", $body->readLine());
- // Write over part of the body yet to be read, so skip some bytes
- $this->assertEquals(5, $body->write("TEST\n"));
- $this->assertEquals(5, $this->readAttribute($body, 'skipReadBytes'));
- // Read, which skips bytes, then reads
- $this->assertEquals("0003\n", $body->readLine());
- $this->assertEquals(0, $this->readAttribute($body, 'skipReadBytes'));
- $this->assertEquals("0004\n", $body->readLine());
- $this->assertEquals("0005\n", $body->readLine());
-
- // Overwrite part of the cached body (so don't skip any bytes)
- $body->seek(5);
- $this->assertEquals(5, $body->write("ABCD\n"));
- $this->assertEquals(0, $this->readAttribute($body, 'skipReadBytes'));
- $this->assertEquals("TEST\n", $body->readLine());
- $this->assertEquals("0003\n", $body->readLine());
- $this->assertEquals("0004\n", $body->readLine());
- $this->assertEquals("0005\n", $body->readLine());
- $this->assertEquals("0006\n", $body->readLine());
- $this->assertEquals(5, $body->write("1234\n"));
- $this->assertEquals(5, $this->readAttribute($body, 'skipReadBytes'));
-
- // Seek to 0 and ensure the overwritten bit is replaced
- $body->rewind();
- $this->assertEquals("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", $body->read(50));
-
- // Ensure that casting it to a string does not include the bit that was overwritten
- $this->assertContains("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", (string) $body);
- }
-
- public function testWrapsContentType()
- {
- $a = $this->getMockBuilder('Guzzle\Http\EntityBody')
- ->setMethods(array('getContentType'))
- ->setConstructorArgs(array(fopen(__FILE__, 'r')))
- ->getMock();
- $a->expects($this->once())
- ->method('getContentType')
- ->will($this->returnValue('foo'));
- $d = new CachingEntityBody($a);
- $this->assertEquals('foo', $d->getContentType());
- }
-
- public function testWrapsContentEncoding()
- {
- $a = $this->getMockBuilder('Guzzle\Http\EntityBody')
- ->setMethods(array('getContentEncoding'))
- ->setConstructorArgs(array(fopen(__FILE__, 'r')))
- ->getMock();
- $a->expects($this->once())
- ->method('getContentEncoding')
- ->will($this->returnValue('foo'));
- $d = new CachingEntityBody($a);
- $this->assertEquals('foo', $d->getContentEncoding());
- }
-
- public function testWrapsMetadata()
- {
- $a = $this->getMockBuilder('Guzzle\Http\EntityBody')
- ->setMethods(array('getMetadata', 'getWrapper', 'getWrapperData', 'getStreamType', 'getUri'))
- ->setConstructorArgs(array(fopen(__FILE__, 'r')))
- ->getMock();
-
- $a->expects($this->once())
- ->method('getMetadata')
- ->will($this->returnValue(array()));
- // Called twice for getWrapper and getWrapperData
- $a->expects($this->exactly(1))
- ->method('getWrapper')
- ->will($this->returnValue('wrapper'));
- $a->expects($this->once())
- ->method('getWrapperData')
- ->will($this->returnValue(array()));
- $a->expects($this->once())
- ->method('getStreamType')
- ->will($this->returnValue('baz'));
- $a->expects($this->once())
- ->method('getUri')
- ->will($this->returnValue('path/to/foo'));
-
- $d = new CachingEntityBody($a);
- $this->assertEquals(array(), $d->getMetaData());
- $this->assertEquals('wrapper', $d->getWrapper());
- $this->assertEquals(array(), $d->getWrapperData());
- $this->assertEquals('baz', $d->getStreamType());
- $this->assertEquals('path/to/foo', $d->getUri());
- }
-
- public function testWrapsCustomData()
- {
- $a = $this->getMockBuilder('Guzzle\Http\EntityBody')
- ->setMethods(array('getCustomData', 'setCustomData'))
- ->setConstructorArgs(array(fopen(__FILE__, 'r')))
- ->getMock();
-
- $a->expects($this->exactly(1))
- ->method('getCustomData')
- ->with('foo')
- ->will($this->returnValue('bar'));
-
- $a->expects($this->exactly(1))
- ->method('setCustomData')
- ->with('foo', 'bar')
- ->will($this->returnSelf());
-
- $d = new CachingEntityBody($a);
- $this->assertSame($d, $d->setCustomData('foo', 'bar'));
- $this->assertEquals('bar', $d->getCustomData('foo'));
- }
-
- public function testClosesBothStreams()
- {
- $s = fopen('php://temp', 'r');
- $a = EntityBody::factory($s);
- $d = new CachingEntityBody($a);
- $d->close();
- $this->assertFalse(is_resource($s));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/ClientTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/ClientTest.php
deleted file mode 100644
index 4a91a18..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/ClientTest.php
+++ /dev/null
@@ -1,601 +0,0 @@
-assertEquals('http://www.google.com/', $client->getBaseUrl());
- $this->assertSame($client, $client->setConfig(array(
- 'test' => '123'
- )));
- $this->assertEquals(array('test' => '123'), $client->getConfig()->getAll());
- $this->assertEquals('123', $client->getConfig('test'));
- $this->assertSame($client, $client->setBaseUrl('http://www.test.com/{test}'));
- $this->assertEquals('http://www.test.com/123', $client->getBaseUrl());
- $this->assertEquals('http://www.test.com/{test}', $client->getBaseUrl(false));
-
- try {
- $client->setConfig(false);
- } catch (\InvalidArgumentException $e) {
- }
- }
-
- public function testDescribesEvents()
- {
- $this->assertEquals(array('client.create_request'), Client::getAllEvents());
- }
-
- public function testConstructorCanAcceptConfig()
- {
- $client = new Client('http://www.test.com/', array(
- 'data' => '123'
- ));
- $this->assertEquals('123', $client->getConfig('data'));
- }
-
- public function testCanUseCollectionAsConfig()
- {
- $client = new Client('http://www.google.com/');
- $client->setConfig(new Collection(array(
- 'api' => 'v1',
- 'key' => 'value',
- 'base_url' => 'http://www.google.com/'
- )));
- $this->assertEquals('v1', $client->getConfig('api'));
- }
-
- public function testExpandsUriTemplatesUsingConfig()
- {
- $client = new Client('http://www.google.com/');
- $client->setConfig(array('api' => 'v1', 'key' => 'value', 'foo' => 'bar'));
- $ref = new \ReflectionMethod($client, 'expandTemplate');
- $ref->setAccessible(true);
- $this->assertEquals('Testing...api/v1/key/value', $ref->invoke($client, 'Testing...api/{api}/key/{key}'));
- }
-
- public function testClientAttachersObserversToRequests()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
-
- $client = new Client($this->getServer()->getUrl());
- $logPlugin = $this->getLogPlugin();
- $client->getEventDispatcher()->addSubscriber($logPlugin);
-
- // Get a request from the client and ensure the the observer was
- // attached to the new request
- $request = $client->createRequest();
- $this->assertTrue($this->hasSubscriber($request, $logPlugin));
- }
-
- public function testClientReturnsValidBaseUrls()
- {
- $client = new Client('http://www.{foo}.{data}/', array(
- 'data' => '123',
- 'foo' => 'bar'
- ));
- $this->assertEquals('http://www.bar.123/', $client->getBaseUrl());
- $client->setBaseUrl('http://www.google.com/');
- $this->assertEquals('http://www.google.com/', $client->getBaseUrl());
- }
-
- public function testClientAddsCurlOptionsToRequests()
- {
- $client = new Client('http://www.test.com/', array(
- 'api' => 'v1',
- // Adds the option using the curl values
- 'curl.options' => array(
- 'CURLOPT_HTTPAUTH' => 'CURLAUTH_DIGEST',
- 'abc' => 'foo',
- 'blacklist' => 'abc',
- 'debug' => true
- )
- ));
-
- $request = $client->createRequest();
- $options = $request->getCurlOptions();
- $this->assertEquals(CURLAUTH_DIGEST, $options->get(CURLOPT_HTTPAUTH));
- $this->assertEquals('foo', $options->get('abc'));
- $this->assertEquals('abc', $options->get('blacklist'));
- }
-
- public function testClientAllowsFineGrainedSslControlButIsSecureByDefault()
- {
- $client = new Client('https://www.secure.com/');
-
- // secure by default
- $request = $client->createRequest();
- $options = $request->getCurlOptions();
- $this->assertTrue($options->get(CURLOPT_SSL_VERIFYPEER));
-
- // set a capath if you prefer
- $client = new Client('https://www.secure.com/');
- $client->setSslVerification(__DIR__);
- $request = $client->createRequest();
- $options = $request->getCurlOptions();
- $this->assertSame(__DIR__, $options->get(CURLOPT_CAPATH));
- }
-
- public function testConfigSettingsControlSslConfiguration()
- {
- // Use the default ca certs on the system
- $client = new Client('https://www.secure.com/', array('ssl.certificate_authority' => 'system'));
- $this->assertNull($client->getConfig('curl.options'));
- // Can set the cacert value as well
- $client = new Client('https://www.secure.com/', array('ssl.certificate_authority' => false));
- $options = $client->getConfig('curl.options');
- $this->assertArrayNotHasKey(CURLOPT_CAINFO, $options);
- $this->assertSame(false, $options[CURLOPT_SSL_VERIFYPEER]);
- $this->assertSame(0, $options[CURLOPT_SSL_VERIFYHOST]);
- }
-
- public function testClientAllowsUnsafeOperationIfRequested()
- {
- // be really unsafe if you insist
- $client = new Client('https://www.secure.com/', array(
- 'api' => 'v1'
- ));
-
- $client->setSslVerification(false);
- $request = $client->createRequest();
- $options = $request->getCurlOptions();
- $this->assertFalse($options->get(CURLOPT_SSL_VERIFYPEER));
- $this->assertNull($options->get(CURLOPT_CAINFO));
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\RuntimeException
- */
- public function testThrowsExceptionForInvalidCertificate()
- {
- $client = new Client('https://www.secure.com/');
- $client->setSslVerification('/path/to/missing/file');
- }
-
- public function testClientAllowsSettingSpecificSslCaInfo()
- {
- // set a file other than the provided cacert.pem
- $client = new Client('https://www.secure.com/', array(
- 'api' => 'v1'
- ));
-
- $client->setSslVerification(__FILE__);
- $request = $client->createRequest();
- $options = $request->getCurlOptions();
- $this->assertSame(__FILE__, $options->get(CURLOPT_CAINFO));
- }
-
- /**
- * @expectedException Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testClientPreventsInadvertentInsecureVerifyHostSetting()
- {
- // set a file other than the provided cacert.pem
- $client = new Client('https://www.secure.com/', array(
- 'api' => 'v1'
- ));
- $client->setSslVerification(__FILE__, true, true);
- }
-
- /**
- * @expectedException Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testClientPreventsInvalidVerifyPeerSetting()
- {
- // set a file other than the provided cacert.pem
- $client = new Client('https://www.secure.com/', array(
- 'api' => 'v1'
- ));
- $client->setSslVerification(__FILE__, 'yes');
- }
-
- public function testClientAddsParamsToRequests()
- {
- Version::$emitWarnings = false;
- $client = new Client('http://www.example.com', array(
- 'api' => 'v1',
- 'request.params' => array(
- 'foo' => 'bar',
- 'baz' => 'jar'
- )
- ));
- $request = $client->createRequest();
- $this->assertEquals('bar', $request->getParams()->get('foo'));
- $this->assertEquals('jar', $request->getParams()->get('baz'));
- Version::$emitWarnings = true;
- }
-
- public function urlProvider()
- {
- $u = $this->getServer()->getUrl() . 'base/';
- $u2 = $this->getServer()->getUrl() . 'base?z=1';
- return array(
- array($u, '', $u),
- array($u, 'relative/path/to/resource', $u . 'relative/path/to/resource'),
- array($u, 'relative/path/to/resource?a=b&c=d', $u . 'relative/path/to/resource?a=b&c=d'),
- array($u, '/absolute/path/to/resource', $this->getServer()->getUrl() . 'absolute/path/to/resource'),
- array($u, '/absolute/path/to/resource?a=b&c=d', $this->getServer()->getUrl() . 'absolute/path/to/resource?a=b&c=d'),
- array($u2, '/absolute/path/to/resource?a=b&c=d', $this->getServer()->getUrl() . 'absolute/path/to/resource?a=b&c=d&z=1'),
- array($u2, 'relative/path/to/resource', $this->getServer()->getUrl() . 'base/relative/path/to/resource?z=1'),
- array($u2, 'relative/path/to/resource?another=query', $this->getServer()->getUrl() . 'base/relative/path/to/resource?another=query&z=1')
- );
- }
-
- /**
- * @dataProvider urlProvider
- */
- public function testBuildsRelativeUrls($baseUrl, $url, $result)
- {
- $client = new Client($baseUrl);
- $this->assertEquals($result, $client->get($url)->getUrl());
- }
-
- public function testAllowsConfigsToBeChangedAndInjectedInBaseUrl()
- {
- $client = new Client('http://{a}/{b}');
- $this->assertEquals('http:///', $client->getBaseUrl());
- $this->assertEquals('http://{a}/{b}', $client->getBaseUrl(false));
- $client->setConfig(array(
- 'a' => 'test.com',
- 'b' => 'index.html'
- ));
- $this->assertEquals('http://test.com/index.html', $client->getBaseUrl());
- }
-
- public function testCreatesRequestsWithDefaultValues()
- {
- $client = new Client($this->getServer()->getUrl() . 'base');
-
- // Create a GET request
- $request = $client->createRequest();
- $this->assertEquals('GET', $request->getMethod());
- $this->assertEquals($client->getBaseUrl(), $request->getUrl());
-
- // Create a DELETE request
- $request = $client->createRequest('DELETE');
- $this->assertEquals('DELETE', $request->getMethod());
- $this->assertEquals($client->getBaseUrl(), $request->getUrl());
-
- // Create a HEAD request with custom headers
- $request = $client->createRequest('HEAD', 'http://www.test.com/');
- $this->assertEquals('HEAD', $request->getMethod());
- $this->assertEquals('http://www.test.com/', $request->getUrl());
-
- // Create a PUT request
- $request = $client->createRequest('PUT');
- $this->assertEquals('PUT', $request->getMethod());
-
- // Create a PUT request with injected config
- $client->getConfig()->set('a', 1)->set('b', 2);
- $request = $client->createRequest('PUT', '/path/{a}?q={b}');
- $this->assertEquals($request->getUrl(), $this->getServer()->getUrl() . 'path/1?q=2');
- }
-
- public function testClientHasHelperMethodsForCreatingRequests()
- {
- $url = $this->getServer()->getUrl();
- $client = new Client($url . 'base');
- $this->assertEquals('GET', $client->get()->getMethod());
- $this->assertEquals('PUT', $client->put()->getMethod());
- $this->assertEquals('POST', $client->post()->getMethod());
- $this->assertEquals('HEAD', $client->head()->getMethod());
- $this->assertEquals('DELETE', $client->delete()->getMethod());
- $this->assertEquals('OPTIONS', $client->options()->getMethod());
- $this->assertEquals('PATCH', $client->patch()->getMethod());
- $this->assertEquals($url . 'base/abc', $client->get('abc')->getUrl());
- $this->assertEquals($url . 'zxy', $client->put('/zxy')->getUrl());
- $this->assertEquals($url . 'zxy?a=b', $client->post('/zxy?a=b')->getUrl());
- $this->assertEquals($url . 'base?a=b', $client->head('?a=b')->getUrl());
- $this->assertEquals($url . 'base?a=b', $client->delete('/base?a=b')->getUrl());
- }
-
- public function testClientInjectsConfigsIntoUrls()
- {
- $client = new Client('http://www.test.com/api/v1', array(
- 'test' => '123'
- ));
- $request = $client->get('relative/{test}');
- $this->assertEquals('http://www.test.com/api/v1/relative/123', $request->getUrl());
- }
-
- public function testAllowsEmptyBaseUrl()
- {
- $client = new Client();
- $request = $client->get('http://www.google.com/');
- $this->assertEquals('http://www.google.com/', $request->getUrl());
- $request->setResponse(new Response(200), true);
- $request->send();
- }
-
- public function testAllowsCustomCurlMultiObjects()
- {
- $mock = $this->getMock('Guzzle\\Http\\Curl\\CurlMulti', array('add', 'send'));
- $mock->expects($this->once())
- ->method('add')
- ->will($this->returnSelf());
- $mock->expects($this->once())
- ->method('send')
- ->will($this->returnSelf());
-
- $client = new Client();
- $client->setCurlMulti($mock);
-
- $request = $client->get();
- $request->setResponse(new Response(200), true);
- $client->send($request);
- }
-
- public function testClientSendsMultipleRequests()
- {
- $client = new Client($this->getServer()->getUrl());
- $mock = new MockPlugin();
-
- $responses = array(
- new Response(200),
- new Response(201),
- new Response(202)
- );
-
- $mock->addResponse($responses[0]);
- $mock->addResponse($responses[1]);
- $mock->addResponse($responses[2]);
-
- $client->getEventDispatcher()->addSubscriber($mock);
-
- $requests = array(
- $client->get(),
- $client->head(),
- $client->put('/', null, 'test')
- );
-
- $this->assertEquals(array(
- $responses[0],
- $responses[1],
- $responses[2]
- ), $client->send($requests));
- }
-
- public function testClientSendsSingleRequest()
- {
- $client = new Client($this->getServer()->getUrl());
- $mock = new MockPlugin();
- $response = new Response(200);
- $mock->addResponse($response);
- $client->getEventDispatcher()->addSubscriber($mock);
- $this->assertEquals($response, $client->send($client->get()));
- }
-
- /**
- * @expectedException \Guzzle\Http\Exception\BadResponseException
- */
- public function testClientThrowsExceptionForSingleRequest()
- {
- $client = new Client($this->getServer()->getUrl());
- $mock = new MockPlugin();
- $response = new Response(404);
- $mock->addResponse($response);
- $client->getEventDispatcher()->addSubscriber($mock);
- $client->send($client->get());
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\ExceptionCollection
- */
- public function testClientThrowsExceptionForMultipleRequests()
- {
- $client = new Client($this->getServer()->getUrl());
- $mock = new MockPlugin();
- $mock->addResponse(new Response(200));
- $mock->addResponse(new Response(404));
- $client->getEventDispatcher()->addSubscriber($mock);
- $client->send(array($client->get(), $client->head()));
- }
-
- public function testQueryStringsAreNotDoubleEncoded()
- {
- $client = new Client('http://test.com', array(
- 'path' => array('foo', 'bar'),
- 'query' => 'hi there',
- 'data' => array(
- 'test' => 'a&b'
- )
- ));
-
- $request = $client->get('{/path*}{?query,data*}');
- $this->assertEquals('http://test.com/foo/bar?query=hi%20there&test=a%26b', $request->getUrl());
- $this->assertEquals('hi there', $request->getQuery()->get('query'));
- $this->assertEquals('a&b', $request->getQuery()->get('test'));
- }
-
- public function testQueryStringsAreNotDoubleEncodedUsingAbsolutePaths()
- {
- $client = new Client('http://test.com', array(
- 'path' => array('foo', 'bar'),
- 'query' => 'hi there',
- ));
- $request = $client->get('http://test.com{?query}');
- $this->assertEquals('http://test.com?query=hi%20there', $request->getUrl());
- $this->assertEquals('hi there', $request->getQuery()->get('query'));
- }
-
- public function testAllowsUriTemplateInjection()
- {
- $client = new Client('http://test.com');
- $ref = new \ReflectionMethod($client, 'getUriTemplate');
- $ref->setAccessible(true);
- $a = $ref->invoke($client);
- $this->assertSame($a, $ref->invoke($client));
- $client->setUriTemplate(new UriTemplate());
- $this->assertNotSame($a, $ref->invoke($client));
- }
-
- public function testAllowsCustomVariablesWhenExpandingTemplates()
- {
- $client = new Client('http://test.com', array('test' => 'hi'));
- $ref = new \ReflectionMethod($client, 'expandTemplate');
- $ref->setAccessible(true);
- $uri = $ref->invoke($client, 'http://{test}{?query*}', array('query' => array('han' => 'solo')));
- $this->assertEquals('http://hi?han=solo', $uri);
- }
-
- public function testUriArrayAllowsCustomTemplateVariables()
- {
- $client = new Client();
- $vars = array(
- 'var' => 'hi'
- );
- $this->assertEquals('/hi', (string) $client->createRequest('GET', array('/{var}', $vars))->getUrl());
- $this->assertEquals('/hi', (string) $client->get(array('/{var}', $vars))->getUrl());
- $this->assertEquals('/hi', (string) $client->put(array('/{var}', $vars))->getUrl());
- $this->assertEquals('/hi', (string) $client->post(array('/{var}', $vars))->getUrl());
- $this->assertEquals('/hi', (string) $client->head(array('/{var}', $vars))->getUrl());
- $this->assertEquals('/hi', (string) $client->options(array('/{var}', $vars))->getUrl());
- }
-
- public function testAllowsDefaultHeaders()
- {
- Version::$emitWarnings = false;
- $default = array('X-Test' => 'Hi!');
- $other = array('X-Other' => 'Foo');
-
- $client = new Client();
- $client->setDefaultHeaders($default);
- $this->assertEquals($default, $client->getDefaultHeaders()->getAll());
- $client->setDefaultHeaders(new Collection($default));
- $this->assertEquals($default, $client->getDefaultHeaders()->getAll());
-
- $request = $client->createRequest('GET', null, $other);
- $this->assertEquals('Hi!', $request->getHeader('X-Test'));
- $this->assertEquals('Foo', $request->getHeader('X-Other'));
-
- $request = $client->createRequest('GET', null, new Collection($other));
- $this->assertEquals('Hi!', $request->getHeader('X-Test'));
- $this->assertEquals('Foo', $request->getHeader('X-Other'));
-
- $request = $client->createRequest('GET');
- $this->assertEquals('Hi!', $request->getHeader('X-Test'));
- Version::$emitWarnings = true;
- }
-
- public function testDontReuseCurlMulti()
- {
- $client1 = new Client();
- $client2 = new Client();
- $this->assertNotSame($client1->getCurlMulti(), $client2->getCurlMulti());
- }
-
- public function testGetDefaultUserAgent()
- {
- $client = new Client();
- $agent = $this->readAttribute($client, 'userAgent');
- $version = curl_version();
- $testAgent = sprintf('Guzzle/%s curl/%s PHP/%s', Version::VERSION, $version['version'], PHP_VERSION);
- $this->assertEquals($agent, $testAgent);
-
- $client->setUserAgent('foo');
- $this->assertEquals('foo', $this->readAttribute($client, 'userAgent'));
- }
-
- public function testOverwritesUserAgent()
- {
- $client = new Client();
- $request = $client->createRequest('GET', 'http://www.foo.com', array('User-agent' => 'foo'));
- $this->assertEquals('foo', (string) $request->getHeader('User-Agent'));
- }
-
- public function testUsesDefaultUserAgent()
- {
- $client = new Client();
- $request = $client->createRequest('GET', 'http://www.foo.com');
- $this->assertContains('Guzzle/', (string) $request->getHeader('User-Agent'));
- }
-
- public function testCanSetDefaultRequestOptions()
- {
- $client = new Client();
- $client->getConfig()->set('request.options', array(
- 'query' => array('test' => '123', 'other' => 'abc'),
- 'headers' => array('Foo' => 'Bar', 'Baz' => 'Bam')
- ));
- $request = $client->createRequest('GET', 'http://www.foo.com?test=hello', array('Foo' => 'Test'));
- // Explicit options on a request should overrule default options
- $this->assertEquals('Test', (string) $request->getHeader('Foo'));
- $this->assertEquals('hello', $request->getQuery()->get('test'));
- // Default options should still be set
- $this->assertEquals('abc', $request->getQuery()->get('other'));
- $this->assertEquals('Bam', (string) $request->getHeader('Baz'));
- }
-
- public function testCanSetSetOptionsOnRequests()
- {
- $client = new Client();
- $request = $client->createRequest('GET', 'http://www.foo.com?test=hello', array('Foo' => 'Test'), null, array(
- 'cookies' => array('michael' => 'test')
- ));
- $this->assertEquals('test', $request->getCookie('michael'));
- }
-
- public function testHasDefaultOptionsHelperMethods()
- {
- $client = new Client();
- // With path
- $client->setDefaultOption('headers/foo', 'bar');
- $this->assertEquals('bar', $client->getDefaultOption('headers/foo'));
- // With simple key
- $client->setDefaultOption('allow_redirects', false);
- $this->assertFalse($client->getDefaultOption('allow_redirects'));
-
- $this->assertEquals(array(
- 'headers' => array('foo' => 'bar'),
- 'allow_redirects' => false
- ), $client->getConfig('request.options'));
-
- $request = $client->get('/');
- $this->assertEquals('bar', $request->getHeader('foo'));
- }
-
- public function testHeadCanUseOptions()
- {
- $client = new Client();
- $head = $client->head('http://www.foo.com', array(), array('query' => array('foo' => 'bar')));
- $this->assertEquals('bar', $head->getQuery()->get('foo'));
- }
-
- public function testCanSetRelativeUrlStartingWithHttp()
- {
- $client = new Client('http://www.foo.com');
- $this->assertEquals(
- 'http://www.foo.com/httpfoo',
- $client->createRequest('GET', 'httpfoo')->getUrl()
- );
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/CurlHandleTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/CurlHandleTest.php
deleted file mode 100644
index 5bf28de..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/CurlHandleTest.php
+++ /dev/null
@@ -1,947 +0,0 @@
-getEventDispatcher()->addListener('request.sent', function (Event $e) use ($that) {
- $that->requestHandle = $e['handle'];
- });
-
- return $request;
- }
-
- public function setUp()
- {
- $this->requestHandle = null;
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testConstructorExpectsCurlResource()
- {
- $h = new CurlHandle(false, array());
- }
-
- public function testConstructorExpectsProperOptions()
- {
- $h = curl_init($this->getServer()->getUrl());
- try {
- $ha = new CurlHandle($h, false);
- $this->fail('Expected InvalidArgumentException');
- } catch (\InvalidArgumentException $e) {
- }
-
- $ha = new CurlHandle($h, array(
- CURLOPT_URL => $this->getServer()->getUrl()
- ));
- $this->assertEquals($this->getServer()->getUrl(), $ha->getOptions()->get(CURLOPT_URL));
-
- $ha = new CurlHandle($h, new Collection(array(
- CURLOPT_URL => $this->getServer()->getUrl()
- )));
- $this->assertEquals($this->getServer()->getUrl(), $ha->getOptions()->get(CURLOPT_URL));
- }
-
- public function testConstructorInitializesObject()
- {
- $handle = curl_init($this->getServer()->getUrl());
- $h = new CurlHandle($handle, array(
- CURLOPT_URL => $this->getServer()->getUrl()
- ));
- $this->assertSame($handle, $h->getHandle());
- $this->assertInstanceOf('Guzzle\\Http\\Url', $h->getUrl());
- $this->assertEquals($this->getServer()->getUrl(), (string) $h->getUrl());
- $this->assertEquals($this->getServer()->getUrl(), $h->getOptions()->get(CURLOPT_URL));
- }
-
- public function testStoresStdErr()
- {
- $request = RequestFactory::getInstance()->create('GET', 'http://test.com');
- $request->getCurlOptions()->set('debug', true);
- $h = CurlHandle::factory($request);
- $this->assertEquals($h->getStderr(true), $h->getOptions()->get(CURLOPT_STDERR));
- $this->assertInternalType('resource', $h->getStderr(true));
- $this->assertInternalType('string', $h->getStderr(false));
- $r = $h->getStderr(true);
- fwrite($r, 'test');
- $this->assertEquals('test', $h->getStderr(false));
- }
-
- public function testStoresCurlErrorNumber()
- {
- $h = new CurlHandle(curl_init('http://test.com'), array(CURLOPT_URL => 'http://test.com'));
- $this->assertEquals(CURLE_OK, $h->getErrorNo());
- $h->setErrorNo(CURLE_OPERATION_TIMEOUTED);
- $this->assertEquals(CURLE_OPERATION_TIMEOUTED, $h->getErrorNo());
- }
-
- public function testAccountsForMissingStdErr()
- {
- $handle = curl_init('http://www.test.com/');
- $h = new CurlHandle($handle, array(
- CURLOPT_URL => 'http://www.test.com/'
- ));
- $this->assertNull($h->getStderr(false));
- }
-
- public function testDeterminesIfResourceIsAvailable()
- {
- $handle = curl_init($this->getServer()->getUrl());
- $h = new CurlHandle($handle, array());
- $this->assertTrue($h->isAvailable());
-
- // Mess it up by closing the handle
- curl_close($handle);
- $this->assertFalse($h->isAvailable());
-
- // Mess it up by unsetting the handle
- $handle = null;
- $this->assertFalse($h->isAvailable());
- }
-
- public function testWrapsErrorsAndInfo()
- {
- if (!defined('CURLOPT_TIMEOUT_MS')) {
- $this->markTestSkipped('Update curl');
- }
-
- $settings = array(
- CURLOPT_PORT => 123,
- CURLOPT_CONNECTTIMEOUT_MS => 1,
- CURLOPT_TIMEOUT_MS => 1
- );
-
- $handle = curl_init($this->getServer()->getUrl());
- curl_setopt_array($handle, $settings);
- $h = new CurlHandle($handle, $settings);
- @curl_exec($handle);
-
- $errors = array(
- "couldn't connect to host",
- 'timeout was reached',
- 'connection time-out',
- 'connect() timed out!',
- 'failed connect to 127.0.0.1:123; connection refused',
- 'failed to connect to 127.0.0.1 port 123: connection refused'
- );
- $this->assertTrue(in_array(strtolower($h->getError()), $errors), $h->getError() . ' was not the error');
-
- $this->assertTrue($h->getErrorNo() > 0);
-
- $this->assertEquals($this->getServer()->getUrl(), $h->getInfo(CURLINFO_EFFECTIVE_URL));
- $this->assertInternalType('array', $h->getInfo());
-
- curl_close($handle);
- $this->assertEquals(null, $h->getInfo('url'));
- }
-
- public function testGetInfoWithoutDebugMode()
- {
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $client = new Client($this->getServer()->getUrl());
- $request = $client->get($this->getServer()->getUrl());
- $response = $request->send();
-
- $info = $response->getInfo();
- $this->assertFalse(empty($info));
- $this->assertEquals($this->getServer()->getUrl(), $info['url']);
- }
-
- public function testWrapsCurlOptions()
- {
- $handle = curl_init($this->getServer()->getUrl());
- $h = new CurlHandle($handle, array(
- CURLOPT_AUTOREFERER => true,
- CURLOPT_BUFFERSIZE => 1024
- ));
-
- $this->assertEquals(true, $h->getOptions()->get(CURLOPT_AUTOREFERER));
- $this->assertEquals(1024, $h->getOptions()->get(CURLOPT_BUFFERSIZE));
- }
-
- /**
- * Data provider for factory tests
- *
- * @return array
- */
- public function dataProvider()
- {
- $testFile = __DIR__ . '/../../../../../phpunit.xml.dist';
-
- $postBody = new QueryString(array('file' => '@' . $testFile));
- $qs = new QueryString(array(
- 'x' => 'y',
- 'z' => 'a'
- ));
-
- $client = new Client();
- $userAgent = $client->getDefaultUserAgent();
- $auth = base64_encode('michael:123');
- $testFileSize = filesize($testFile);
-
- $tests = array(
- // Send a regular GET
- array('GET', 'http://www.google.com/', null, null, array(
- CURLOPT_RETURNTRANSFER => 0,
- CURLOPT_HEADER => 0,
- CURLOPT_CONNECTTIMEOUT => 150,
- CURLOPT_WRITEFUNCTION => 'callback',
- CURLOPT_HEADERFUNCTION => 'callback',
- CURLOPT_HTTPHEADER => array('Accept:', 'Host: www.google.com', 'User-Agent: ' . $userAgent),
- )),
- // Test that custom request methods can be used
- array('TRACE', 'http://www.google.com/', null, null, array(
- CURLOPT_CUSTOMREQUEST => 'TRACE'
- )),
- // Send a GET using a port
- array('GET', 'http://127.0.0.1:8080', null, null, array(
- CURLOPT_RETURNTRANSFER => 0,
- CURLOPT_HEADER => 0,
- CURLOPT_CONNECTTIMEOUT => 150,
- CURLOPT_WRITEFUNCTION => 'callback',
- CURLOPT_HEADERFUNCTION => 'callback',
- CURLOPT_PORT => 8080,
- CURLOPT_HTTPHEADER => array('Accept:', 'Host: 127.0.0.1:8080', 'User-Agent: ' . $userAgent),
- )),
- // Send a HEAD request
- array('HEAD', 'http://www.google.com/', null, null, array(
- CURLOPT_RETURNTRANSFER => 0,
- CURLOPT_HEADER => 0,
- CURLOPT_CONNECTTIMEOUT => 150,
- CURLOPT_HEADERFUNCTION => 'callback',
- CURLOPT_HTTPHEADER => array('Accept:', 'Host: www.google.com', 'User-Agent: ' . $userAgent),
- CURLOPT_NOBODY => 1
- )),
- // Send a GET using basic auth
- array('GET', 'https://michael:123@127.0.0.1/index.html?q=2', null, null, array(
- CURLOPT_RETURNTRANSFER => 0,
- CURLOPT_HEADER => 0,
- CURLOPT_CONNECTTIMEOUT => 150,
- CURLOPT_WRITEFUNCTION => 'callback',
- CURLOPT_HEADERFUNCTION => 'callback',
- CURLOPT_HTTPHEADER => array(
- 'Accept:',
- 'Host: 127.0.0.1',
- 'Authorization: Basic ' . $auth,
- 'User-Agent: ' . $userAgent
- ),
- CURLOPT_PORT => 443
- )),
- // Send a GET request with custom headers
- array('GET', 'http://127.0.0.1:8124/', array(
- 'x-test-data' => 'Guzzle'
- ), null, array(
- CURLOPT_PORT => 8124,
- CURLOPT_HTTPHEADER => array(
- 'Accept:',
- 'Host: 127.0.0.1:8124',
- 'x-test-data: Guzzle',
- 'User-Agent: ' . $userAgent
- )
- ), array(
- 'Host' => '*',
- 'User-Agent' => '*',
- 'x-test-data' => 'Guzzle'
- )),
- // Send a POST using a query string
- array('POST', 'http://127.0.0.1:8124/post.php', null, $qs, array(
- CURLOPT_RETURNTRANSFER => 0,
- CURLOPT_HEADER => 0,
- CURLOPT_CONNECTTIMEOUT => 150,
- CURLOPT_WRITEFUNCTION => 'callback',
- CURLOPT_HEADERFUNCTION => 'callback',
- CURLOPT_POSTFIELDS => 'x=y&z=a',
- CURLOPT_HTTPHEADER => array (
- 'Expect:',
- 'Accept:',
- 'Host: 127.0.0.1:8124',
- 'Content-Type: application/x-www-form-urlencoded; charset=utf-8',
- 'User-Agent: ' . $userAgent
- )
- ), array(
- 'Host' => '*',
- 'User-Agent' => '*',
- 'Content-Length' => '7',
- '!Expect' => null,
- 'Content-Type' => 'application/x-www-form-urlencoded; charset=utf-8',
- '!Transfer-Encoding' => null
- )),
- // Send a PUT using raw data
- array('PUT', 'http://127.0.0.1:8124/put.php', null, EntityBody::factory(fopen($testFile, 'r+')), array(
- CURLOPT_RETURNTRANSFER => 0,
- CURLOPT_HEADER => 0,
- CURLOPT_CONNECTTIMEOUT => 150,
- CURLOPT_WRITEFUNCTION => 'callback',
- CURLOPT_HEADERFUNCTION => 'callback',
- CURLOPT_READFUNCTION => 'callback',
- CURLOPT_INFILESIZE => filesize($testFile),
- CURLOPT_HTTPHEADER => array (
- 'Expect:',
- 'Accept:',
- 'Host: 127.0.0.1:8124',
- 'User-Agent: ' . $userAgent
- )
- ), array(
- 'Host' => '*',
- 'User-Agent' => '*',
- '!Expect' => null,
- 'Content-Length' => $testFileSize,
- '!Transfer-Encoding' => null
- )),
- // Send a POST request using an array of fields
- array('POST', 'http://127.0.0.1:8124/post.php', null, array(
- 'x' => 'y',
- 'a' => 'b'
- ), array(
- CURLOPT_RETURNTRANSFER => 0,
- CURLOPT_HEADER => 0,
- CURLOPT_CONNECTTIMEOUT => 150,
- CURLOPT_WRITEFUNCTION => 'callback',
- CURLOPT_HEADERFUNCTION => 'callback',
- CURLOPT_POST => 1,
- CURLOPT_POSTFIELDS => 'x=y&a=b',
- CURLOPT_HTTPHEADER => array (
- 'Expect:',
- 'Accept:',
- 'Host: 127.0.0.1:8124',
- 'Content-Type: application/x-www-form-urlencoded; charset=utf-8',
- 'User-Agent: ' . $userAgent
- )
- ), array(
- 'Host' => '*',
- 'User-Agent' => '*',
- 'Content-Length' => '7',
- '!Expect' => null,
- 'Content-Type' => 'application/x-www-form-urlencoded; charset=utf-8',
- '!Transfer-Encoding' => null
- )),
- // Send a POST request with raw POST data and a custom content-type
- array('POST', 'http://127.0.0.1:8124/post.php', array(
- 'Content-Type' => 'application/json'
- ), '{"hi":"there"}', array(
- CURLOPT_RETURNTRANSFER => 0,
- CURLOPT_HEADER => 0,
- CURLOPT_CONNECTTIMEOUT => 150,
- CURLOPT_WRITEFUNCTION => 'callback',
- CURLOPT_HEADERFUNCTION => 'callback',
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_UPLOAD => true,
- CURLOPT_INFILESIZE => 14,
- CURLOPT_HTTPHEADER => array (
- 'Expect:',
- 'Accept:',
- 'Host: 127.0.0.1:8124',
- 'Content-Type: application/json',
- 'User-Agent: ' . $userAgent
- ),
- ), array(
- 'Host' => '*',
- 'User-Agent' => '*',
- 'Content-Type' => 'application/json',
- '!Expect' => null,
- 'Content-Length' => '14',
- '!Transfer-Encoding' => null
- )),
- // Send a POST request with raw POST data, a custom content-type, and use chunked encoding
- array('POST', 'http://127.0.0.1:8124/post.php', array(
- 'Content-Type' => 'application/json',
- 'Transfer-Encoding' => 'chunked'
- ), '{"hi":"there"}', array(
- CURLOPT_RETURNTRANSFER => 0,
- CURLOPT_HEADER => 0,
- CURLOPT_CONNECTTIMEOUT => 150,
- CURLOPT_WRITEFUNCTION => 'callback',
- CURLOPT_HEADERFUNCTION => 'callback',
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_UPLOAD => true,
- CURLOPT_HTTPHEADER => array (
- 'Expect:',
- 'Accept:',
- 'Host: 127.0.0.1:8124',
- 'Transfer-Encoding: chunked',
- 'Content-Type: application/json',
- 'User-Agent: ' . $userAgent
- ),
- ), array(
- 'Host' => '*',
- 'User-Agent' => '*',
- 'Content-Type' => 'application/json',
- '!Expect' => null,
- 'Transfer-Encoding' => 'chunked',
- '!Content-Length' => ''
- )),
- // Send a POST request with no body
- array('POST', 'http://127.0.0.1:8124/post.php', null, '', array(
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_HTTPHEADER => array (
- 'Expect:',
- 'Accept:',
- 'Host: 127.0.0.1:8124',
- 'User-Agent: ' . $userAgent
- )
- ), array(
- 'Host' => '*',
- 'User-Agent' => '*',
- 'Content-Length' => '0',
- '!Transfer-Encoding' => null
- )),
- // Send a POST request with empty post fields
- array('POST', 'http://127.0.0.1:8124/post.php', null, array(), array(
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_HTTPHEADER => array (
- 'Expect:',
- 'Accept:',
- 'Host: 127.0.0.1:8124',
- 'User-Agent: ' . $userAgent
- )
- ), array(
- 'Host' => '*',
- 'User-Agent' => '*',
- 'Content-Length' => '0',
- '!Transfer-Encoding' => null
- )),
- // Send a PATCH request
- array('PATCH', 'http://127.0.0.1:8124/patch.php', null, 'body', array(
- CURLOPT_INFILESIZE => 4,
- CURLOPT_HTTPHEADER => array (
- 'Expect:',
- 'Accept:',
- 'Host: 127.0.0.1:8124',
- 'User-Agent: ' . $userAgent
- )
- )),
- // Send a DELETE request with a body
- array('DELETE', 'http://127.0.0.1:8124/delete.php', null, 'body', array(
- CURLOPT_CUSTOMREQUEST => 'DELETE',
- CURLOPT_INFILESIZE => 4,
- CURLOPT_HTTPHEADER => array (
- 'Expect:',
- 'Accept:',
- 'Host: 127.0.0.1:8124',
- 'User-Agent: ' . $userAgent
- )
- ), array(
- 'Host' => '*',
- 'User-Agent' => '*',
- 'Content-Length' => '4',
- '!Expect' => null,
- '!Transfer-Encoding' => null
- )),
-
- /**
- * Send a request with empty path and a fragment - the fragment must be
- * stripped out before sending it to curl
- *
- * @issue 453
- * @link https://github.com/guzzle/guzzle/issues/453
- */
- array('GET', 'http://www.google.com#head', null, null, array(
- CURLOPT_RETURNTRANSFER => 0,
- CURLOPT_HEADER => 0,
- CURLOPT_CONNECTTIMEOUT => 150,
- CURLOPT_WRITEFUNCTION => 'callback',
- CURLOPT_HEADERFUNCTION => 'callback',
- CURLOPT_HTTPHEADER => array('Accept:', 'Host: www.google.com', 'User-Agent: ' . $userAgent),
- )),
- );
-
- $postTest = array('POST', 'http://127.0.0.1:8124/post.php', null, $postBody, array(
- CURLOPT_RETURNTRANSFER => 0,
- CURLOPT_HEADER => 0,
- CURLOPT_CONNECTTIMEOUT => 150,
- CURLOPT_WRITEFUNCTION => 'callback',
- CURLOPT_HEADERFUNCTION => 'callback',
- CURLOPT_POST => 1,
- CURLOPT_POSTFIELDS => array(
- 'file' => '@' . $testFile . ';filename=phpunit.xml.dist;type=application/octet-stream'
- ),
- CURLOPT_HTTPHEADER => array (
- 'Accept:',
- 'Host: 127.0.0.1:8124',
- 'Content-Type: multipart/form-data',
- 'Expect: 100-Continue',
- 'User-Agent: ' . $userAgent
- )
- ), array(
- 'Host' => '*',
- 'User-Agent' => '*',
- 'Content-Length' => '*',
- 'Expect' => '100-Continue',
- 'Content-Type' => 'multipart/form-data; boundary=*',
- '!Transfer-Encoding' => null
- ));
-
- if (version_compare(phpversion(), '5.5.0', '>=')) {
- $postTest[4][CURLOPT_POSTFIELDS] = array(
- 'file' => new \CurlFile($testFile, 'application/octet-stream', 'phpunit.xml.dist')
- );
- }
-
- $tests[] = $postTest;
-
- return $tests;
- }
-
- /**
- * @dataProvider dataProvider
- */
- public function testFactoryCreatesCurlBasedOnRequest($method, $url, $headers, $body, $options, $expectedHeaders = null)
- {
- $client = new Client();
- $request = $client->createRequest($method, $url, $headers, $body);
- $request->getCurlOptions()->set('debug', true);
-
- $originalRequest = clone $request;
- $curlTest = clone $request;
- $handle = CurlHandle::factory($curlTest);
-
- $this->assertInstanceOf('Guzzle\\Http\\Curl\\CurlHandle', $handle);
- $o = $handle->getOptions()->getAll();
-
- // Headers are case-insensitive
- if (isset($o[CURLOPT_HTTPHEADER])) {
- $o[CURLOPT_HTTPHEADER] = array_map('strtolower', $o[CURLOPT_HTTPHEADER]);
- }
- if (isset($options[CURLOPT_HTTPHEADER])) {
- $options[CURLOPT_HTTPHEADER] = array_map('strtolower', $options[CURLOPT_HTTPHEADER]);
- }
-
- $check = 0;
- foreach ($options as $key => $value) {
- $check++;
- $this->assertArrayHasKey($key, $o, '-> Check number ' . $check);
- if ($key != CURLOPT_HTTPHEADER && $key != CURLOPT_POSTFIELDS && (is_array($o[$key])) || $o[$key] instanceof \Closure) {
- $this->assertEquals('callback', $value, '-> Check number ' . $check);
- } else {
- $this->assertTrue($value == $o[$key], '-> Check number ' . $check . ' - ' . var_export($value, true) . ' != ' . var_export($o[$key], true));
- }
- }
-
- // If we are testing the actual sent headers
- if ($expectedHeaders) {
-
- // Send the request to the test server
- $client = new Client($this->getServer()->getUrl());
- $request->setClient($client);
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $request->send();
-
- // Get the request that was sent and create a request that we expected
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals($method, $requests[0]->getMethod());
-
- $test = $this->compareHeaders($expectedHeaders, $requests[0]->getHeaders());
- $this->assertFalse($test, $test . "\nSent: \n" . $request . "\n\n" . $requests[0]);
-
- // Ensure only one Content-Length header is sent
- if ($request->getHeader('Content-Length')) {
- $this->assertEquals((string) $request->getHeader('Content-Length'), (string) $requests[0]->getHeader('Content-Length'));
- }
- }
- }
-
- public function testFactoryUsesSpecifiedProtocol()
- {
- $request = RequestFactory::getInstance()->create('GET', 'http://127.0.0.1:8124/');
- $request->setProtocolVersion('1.1');
- $handle = CurlHandle::factory($request);
- $options = $handle->getOptions();
- $this->assertEquals(CURL_HTTP_VERSION_1_1, $options[CURLOPT_HTTP_VERSION]);
- }
-
- public function testUploadsPutData()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi");
-
- $client = new Client($this->getServer()->getUrl());
- $request = $client->put('/');
- $request->getCurlOptions()->set('debug', true);
- $request->setBody(EntityBody::factory('test'), 'text/plain', false);
- $request->getCurlOptions()->set('progress', true);
-
- $o = $this->getWildcardObserver($request);
- $request->send();
-
- // Make sure that the events were dispatched
- $this->assertTrue($o->has('curl.callback.progress'));
-
- // Ensure that the request was received exactly as intended
- $r = $this->getServer()->getReceivedRequests(true);
- $this->assertFalse($r[0]->hasHeader('Transfer-Encoding'));
- $this->assertEquals(4, (string) $r[0]->getHeader('Content-Length'));
- $sent = strtolower($r[0]);
- $this->assertContains('put / http/1.1', $sent);
- $this->assertContains('host: 127.0.0.1', $sent);
- $this->assertContains('user-agent:', $sent);
- $this->assertContains('content-type: text/plain', $sent);
- }
-
- public function testUploadsPutDataUsingChunkedEncodingWhenLengthCannotBeDetermined()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi"
- ));
- $client = new Client($this->getServer()->getUrl());
- $request = $client->put('/');
- $request->setBody(EntityBody::factory(fopen($this->getServer()->getUrl(), 'r')), 'text/plain');
- $request->send();
-
- $r = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals('chunked', $r[1]->getHeader('Transfer-Encoding'));
- $this->assertFalse($r[1]->hasHeader('Content-Length'));
- }
-
- public function testUploadsPutDataUsingChunkedEncodingWhenForced()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi");
-
- $client = new Client($this->getServer()->getUrl());
- $request = $client->put('/', array('Transfer-Encoding' => 'chunked'), 'hi!');
- $request->send();
-
- $r = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals('chunked', $r[0]->getHeader('Transfer-Encoding'));
- $this->assertFalse($r[0]->hasHeader('Content-Length'));
- $this->assertEquals('hi!', $r[0]->getBody(true));
- }
-
- public function testSendsPostRequestsWithFields()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi");
-
- $request = RequestFactory::getInstance()->create('POST', $this->getServer()->getUrl());
- $request->getCurlOptions()->set('debug', true);
- $request->setClient(new Client());
- $request->addPostFields(array(
- 'a' => 'b',
- 'c' => 'ay! ~This is a test, isn\'t it?'
- ));
- $request->send();
-
- // Make sure that the request was sent correctly
- $r = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals('a=b&c=ay%21%20~This%20is%20a%20test%2C%20isn%27t%20it%3F', (string) $r[0]->getBody());
- $this->assertFalse($r[0]->hasHeader('Transfer-Encoding'));
- $this->assertEquals(56, (string) $r[0]->getHeader('Content-Length'));
- $sent = strtolower($r[0]);
- $this->assertContains('post / http/1.1', $sent);
- $this->assertContains('content-type: application/x-www-form-urlencoded; charset=utf-8', $sent);
- }
-
- public function testSendsPostRequestsWithFiles()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi");
-
- $request = RequestFactory::getInstance()->create('POST', $this->getServer()->getUrl());
- $request->getCurlOptions()->set('debug', true);
- $request->setClient(new Client());
- $request->addPostFiles(array(
- 'foo' => __FILE__,
- ));
- $request->addPostFields(array(
- 'bar' => 'baz',
- 'arr' => array('a' => 1, 'b' => 2),
- ));
- $this->updateForHandle($request);
- $request->send();
-
- // Ensure the CURLOPT_POSTFIELDS option was set properly
- $options = $this->requestHandle->getOptions()->getAll();
- if (version_compare(phpversion(), '5.5.0', '<')) {
- $this->assertContains('@' . __FILE__ . ';filename=CurlHandleTest.php;type=text/x-', $options[CURLOPT_POSTFIELDS]['foo']);
- } else{
- $this->assertInstanceOf('CURLFile', $options[CURLOPT_POSTFIELDS]['foo']);
- }
- $this->assertEquals('baz', $options[CURLOPT_POSTFIELDS]['bar']);
- $this->assertEquals('1', $options[CURLOPT_POSTFIELDS]['arr[a]']);
- $this->assertEquals('2', $options[CURLOPT_POSTFIELDS]['arr[b]']);
- // Ensure that a Content-Length header was sent by cURL
- $this->assertTrue($request->hasHeader('Content-Length'));
- }
-
- public function testCurlConfigurationOptionsAreSet()
- {
- $request = RequestFactory::getInstance()->create('PUT', $this->getServer()->getUrl());
- $request->setClient(new Client('http://www.example.com'));
- $request->getCurlOptions()->set(CURLOPT_CONNECTTIMEOUT, 99);
- $request->getCurlOptions()->set('curl.fake_opt', 99);
- $request->getCurlOptions()->set(CURLOPT_PORT, 8181);
- $handle = CurlHandle::factory($request);
- $this->assertEquals(99, $handle->getOptions()->get(CURLOPT_CONNECTTIMEOUT));
- $this->assertEquals(8181, $handle->getOptions()->get(CURLOPT_PORT));
- $this->assertNull($handle->getOptions()->get('curl.fake_opt'));
- $this->assertNull($handle->getOptions()->get('fake_opt'));
- }
-
- public function testEnsuresRequestsHaveResponsesWhenUpdatingFromTransfer()
- {
- $request = RequestFactory::getInstance()->create('PUT', $this->getServer()->getUrl());
- $handle = CurlHandle::factory($request);
- $handle->updateRequestFromTransfer($request);
- }
-
- public function testCanSendBodyAsString()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $client = new Client($this->getServer()->getUrl());
- $request = $client->put('/', null, 'foo');
- $request->getCurlOptions()->set('body_as_string', true);
- $request->send();
- $requests = $this->getServer()->getReceivedRequests(false);
- $this->assertContains('PUT /', $requests[0]);
- $this->assertContains("\nfoo", $requests[0]);
- $this->assertContains('content-length: 3', $requests[0]);
- $this->assertNotContains('content-type', $requests[0]);
- }
-
- public function testCanSendPostBodyAsString()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $client = new Client($this->getServer()->getUrl());
- $request = $client->post('/', null, 'foo');
- $request->getCurlOptions()->set('body_as_string', true);
- $request->send();
- $requests = $this->getServer()->getReceivedRequests(false);
- $this->assertContains('POST /', $requests[0]);
- $this->assertContains("\nfoo", $requests[0]);
- $this->assertContains('content-length: 3', $requests[0]);
- $this->assertNotContains('content-type', $requests[0]);
- }
-
- public function testAllowsWireTransferInfoToBeEnabled()
- {
- $request = RequestFactory::getInstance()->create('PUT', $this->getServer()->getUrl());
- $request->getCurlOptions()->set('debug', true);
- $handle = CurlHandle::factory($request);
- $this->assertNotNull($handle->getOptions()->get(CURLOPT_STDERR));
- $this->assertNotNull($handle->getOptions()->get(CURLOPT_VERBOSE));
- }
-
- public function testAddsCustomCurlOptions()
- {
- $request = RequestFactory::getInstance()->create('PUT', $this->getServer()->getUrl());
- $request->getCurlOptions()->set(CURLOPT_TIMEOUT, 200);
- $handle = CurlHandle::factory($request);
- $this->assertEquals(200, $handle->getOptions()->get(CURLOPT_TIMEOUT));
- }
-
- public function testSendsPostUploadsWithContentDispositionHeaders()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\n\r\nContent-Length: 0\r\n\r\n");
-
- $fileToUpload = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'TestData' . DIRECTORY_SEPARATOR . 'test_service.json';
-
- $client = new Client($this->getServer()->getUrl());
- $request = $client->post();
- $request->addPostFile('foo', $fileToUpload, 'application/json');
- $request->addPostFile('foo', __FILE__);
-
- $request->send();
- $requests = $this->getServer()->getReceivedRequests(true);
- $body = (string) $requests[0]->getBody();
-
- $this->assertContains('Content-Disposition: form-data; name="foo[0]"; filename="', $body);
- $this->assertContains('Content-Type: application/json', $body);
- $this->assertContains('Content-Type: text/x-', $body);
- $this->assertContains('Content-Disposition: form-data; name="foo[1]"; filename="', $body);
- }
-
- public function requestMethodProvider()
- {
- return array(array('POST'), array('PUT'), array('PATCH'));
- }
-
- /**
- * @dataProvider requestMethodProvider
- */
- public function testSendsRequestsWithNoBodyUsingContentLengthZero($method)
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $client = new Client($this->getServer()->getUrl());
- $client->createRequest($method)->send();
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertFalse($requests[0]->hasHeader('Transfer-Encoding'));
- $this->assertTrue($requests[0]->hasHeader('Content-Length'));
- $this->assertEquals('0', (string) $requests[0]->getHeader('Content-Length'));
- }
-
- /**
- * @dataProvider provideCurlConfig
- */
- public function testParseCurlConfigConvertsStringKeysToConstantKeys($options, $expected)
- {
- $actual = CurlHandle::parseCurlConfig($options);
- $this->assertEquals($expected, $actual);
- }
-
- /**
- * Data provider for curl configurations
- *
- * @return array
- */
- public function provideCurlConfig()
- {
- return array(
- // Conversion of option name to constant value
- array(
- array(
- 'CURLOPT_PORT' => 10,
- 'CURLOPT_TIMEOUT' => 99
- ),
- array(
- CURLOPT_PORT => 10,
- CURLOPT_TIMEOUT => 99
- )
- ),
- // Keeps non constant options
- array(
- array('debug' => true),
- array('debug' => true)
- ),
- // Conversion of constant names to constant values
- array(
- array('debug' => 'CURLPROXY_HTTP'),
- array('debug' => CURLPROXY_HTTP)
- )
- );
- }
-
- public function testSeeksToBeginningOfStreamWhenSending()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"
- ));
-
- $client = new Client($this->getServer()->getUrl());
- $request = $client->put('/', null, 'test');
- $request->send();
- $request->send();
-
- $received = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals(2, count($received));
- $this->assertEquals('test', (string) $received[0]->getBody());
- $this->assertEquals('test', (string) $received[1]->getBody());
- }
-
- public function testAllowsCurloptEncodingToBeSet()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
-
- $client = new Client($this->getServer()->getUrl());
- $request = $client->get('/', null);
- $request->getCurlOptions()->set(CURLOPT_ENCODING, '');
- $this->updateForHandle($request);
- $request->send();
- $options = $this->requestHandle->getOptions()->getAll();
- $this->assertSame('', $options[CURLOPT_ENCODING]);
- $received = $this->getServer()->getReceivedRequests(false);
- $this->assertContainsIns('accept: */*', $received[0]);
- $this->assertContainsIns('accept-encoding: ', $received[0]);
- }
-
- public function testSendsExpectHeaderWhenSizeIsGreaterThanCutoff()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $client = new Client($this->getServer()->getUrl());
- $request = $client->put('/', null, 'test');
- // Start sending the expect header to 2 bytes
- $this->updateForHandle($request);
- $request->setExpectHeaderCutoff(2)->send();
- $options = $this->requestHandle->getOptions()->getAll();
- $this->assertContains('Expect: 100-Continue', $options[CURLOPT_HTTPHEADER]);
- $received = $this->getServer()->getReceivedRequests(false);
- $this->assertContainsIns('expect: 100-continue', $received[0]);
- }
-
- public function testSetsCurloptEncodingWhenAcceptEncodingHeaderIsSet()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata");
- $client = new Client($this->getServer()->getUrl());
- $request = $client->get('/', array(
- 'Accept' => 'application/json',
- 'Accept-Encoding' => 'gzip, deflate',
- ));
- $this->updateForHandle($request);
- $request->send();
- $options = $this->requestHandle->getOptions()->getAll();
- $this->assertSame('gzip, deflate', $options[CURLOPT_ENCODING]);
- $received = $this->getServer()->getReceivedRequests(false);
- $this->assertContainsIns('accept: application/json', $received[0]);
- $this->assertContainsIns('accept-encoding: gzip, deflate', $received[0]);
- }
-
- public function testSendsPostFieldsForNonPostRequests()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\n\r\nContent-Length: 0\r\n\r\n");
-
- $client = new Client();
- $request = $client->put($this->getServer()->getUrl(), null, array(
- 'foo' => 'baz',
- 'baz' => 'bar'
- ));
-
- $request->send();
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals('PUT', $requests[0]->getMethod());
- $this->assertEquals(
- 'application/x-www-form-urlencoded; charset=utf-8',
- (string) $requests[0]->getHeader('Content-Type')
- );
- $this->assertEquals(15, (string) $requests[0]->getHeader('Content-Length'));
- $this->assertEquals('foo=baz&baz=bar', (string) $requests[0]->getBody());
- }
-
- public function testSendsPostFilesForNonPostRequests()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\n\r\nContent-Length: 0\r\n\r\n");
-
- $client = new Client();
- $request = $client->put($this->getServer()->getUrl(), null, array(
- 'foo' => '@' . __FILE__
- ));
-
- $request->send();
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals('PUT', $requests[0]->getMethod());
- $this->assertContains('multipart/form-data', (string) $requests[0]->getHeader('Content-Type'));
- $this->assertContains('testSendsPostFilesForNonPostRequests', (string) $requests[0]->getBody());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/CurlMultiProxyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/CurlMultiProxyTest.php
deleted file mode 100644
index e04141c..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/CurlMultiProxyTest.php
+++ /dev/null
@@ -1,110 +0,0 @@
-multi = new CurlMultiProxy(self::MAX_HANDLES, self::SELECT_TIMEOUT);
- }
-
- public function tearDown()
- {
- unset($this->multi);
- }
-
- public function testConstructorSetsMaxHandles()
- {
- $m = new CurlMultiProxy(self::MAX_HANDLES, self::SELECT_TIMEOUT);
- $this->assertEquals(self::MAX_HANDLES, $this->readAttribute($m, 'maxHandles'));
- }
-
- public function testConstructorSetsSelectTimeout()
- {
- $m = new CurlMultiProxy(self::MAX_HANDLES, self::SELECT_TIMEOUT);
- $this->assertEquals(self::SELECT_TIMEOUT, $this->readAttribute($m, 'selectTimeout'));
- }
-
- public function testAddingRequestsAddsToQueue()
- {
- $r = new Request('GET', 'http://www.foo.com');
- $this->assertSame($this->multi, $this->multi->add($r));
- $this->assertEquals(1, count($this->multi));
- $this->assertEquals(array($r), $this->multi->all());
-
- $this->assertTrue($this->multi->remove($r));
- $this->assertFalse($this->multi->remove($r));
- $this->assertEquals(0, count($this->multi));
- }
-
- public function testResetClearsState()
- {
- $r = new Request('GET', 'http://www.foo.com');
- $this->multi->add($r);
- $this->multi->reset();
- $this->assertEquals(0, count($this->multi));
- }
-
- public function testSendWillSendQueuedRequestsFirst()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"
- ));
- $client = new Client($this->getServer()->getUrl());
- $events = array();
- $client->getCurlMulti()->getEventDispatcher()->addListener(
- CurlMultiProxy::ADD_REQUEST,
- function ($e) use (&$events) {
- $events[] = $e;
- }
- );
- $request = $client->get();
- $request->getEventDispatcher()->addListener('request.complete', function () use ($client) {
- $client->get('/foo')->send();
- });
- $request->send();
- $received = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals(2, count($received));
- $this->assertEquals($this->getServer()->getUrl(), $received[0]->getUrl());
- $this->assertEquals($this->getServer()->getUrl() . 'foo', $received[1]->getUrl());
- $this->assertEquals(2, count($events));
- }
-
- public function testTrimsDownMaxHandleCount()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 307 OK\r\nLocation: /foo\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 307 OK\r\nLocation: /foo\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 307 OK\r\nLocation: /foo\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 307 OK\r\nLocation: /foo\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"
- ));
- $client = new Client($this->getServer()->getUrl());
- $client->setCurlMulti(new CurlMultiProxy(self::MAX_HANDLES, self::SELECT_TIMEOUT));
- $request = $client->get();
- $request->send();
- $this->assertEquals(200, $request->getResponse()->getStatusCode());
- $handles = $this->readAttribute($client->getCurlMulti(), 'handles');
- $this->assertEquals(2, count($handles));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/CurlMultiTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/CurlMultiTest.php
deleted file mode 100644
index 1272281..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/CurlMultiTest.php
+++ /dev/null
@@ -1,455 +0,0 @@
-multi = new MockMulti();
- }
-
- public function tearDown()
- {
- unset($this->multi);
- }
-
- public function testConstructorCreateMultiHandle()
- {
- $this->assertInternalType('resource', $this->multi->getHandle());
- $this->assertEquals('curl_multi', get_resource_type($this->multi->getHandle()));
- }
-
- public function testDestructorClosesMultiHandle()
- {
- $handle = $this->multi->getHandle();
- $this->multi->__destruct();
- $this->assertFalse(is_resource($handle));
- }
-
- public function testRequestsCanBeAddedAndCounted()
- {
- $multi = new CurlMulti();
- $request1 = new Request('GET', 'http://www.google.com/');
- $multi->add($request1);
- $this->assertEquals(array($request1), $multi->all());
- $request2 = new Request('POST', 'http://www.google.com/');
- $multi->add($request2);
- $this->assertEquals(array($request1, $request2), $multi->all());
- $this->assertEquals(2, count($multi));
- }
-
- public function testRequestsCanBeRemoved()
- {
- $request1 = new Request('GET', 'http://www.google.com/');
- $this->multi->add($request1);
- $request2 = new Request('PUT', 'http://www.google.com/');
- $this->multi->add($request2);
- $this->assertEquals(array($request1, $request2), $this->multi->all());
- $this->assertTrue($this->multi->remove($request1));
- $this->assertFalse($this->multi->remove($request1));
- $this->assertEquals(array($request2), $this->multi->all());
- }
-
- public function testsResetRemovesRequestsAndResetsState()
- {
- $this->multi->add(new Request('GET', 'http://www.google.com/'));
- $this->multi->reset();
- $this->assertEquals(array(), $this->multi->all());
- }
-
- public function testSendsRequestsThroughCurl()
- {
- $this->getServer()->enqueue(array(
- "HTTP/1.1 204 No content\r\n" .
- "Content-Length: 0\r\n" .
- "Server: Jetty(6.1.3)\r\n\r\n",
- "HTTP/1.1 200 OK\r\n" .
- "Content-Type: text/html; charset=utf-8\r\n" .
- "Content-Length: 4\r\n" .
- "Server: Jetty(6.1.3)\r\n\r\n" .
- "data"
- ));
-
- $request1 = new Request('GET', $this->getServer()->getUrl());
- $request2 = new Request('GET', $this->getServer()->getUrl());
- $this->multi->add($request1);
- $this->multi->add($request2);
- $this->multi->send();
-
- $response1 = $request1->getResponse();
- $response2 = $request2->getResponse();
- $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $response1);
- $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $response2);
-
- $this->assertTrue($response1->getBody(true) == 'data' || $response2->getBody(true) == 'data');
- $this->assertTrue($response1->getBody(true) == '' || $response2->getBody(true) == '');
- $this->assertTrue($response1->getStatusCode() == '204' || $response2->getStatusCode() == '204');
- $this->assertNotEquals((string) $response1, (string) $response2);
- }
-
- public function testSendsThroughCurlAndAggregatesRequestExceptions()
- {
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\n" .
- "Content-Type: text/html; charset=utf-8\r\n" .
- "Content-Length: 4\r\n" .
- "Server: Jetty(6.1.3)\r\n" .
- "\r\n" .
- "data",
- "HTTP/1.1 204 No content\r\n" .
- "Content-Length: 0\r\n" .
- "Server: Jetty(6.1.3)\r\n" .
- "\r\n",
- "HTTP/1.1 404 Not Found\r\n" .
- "Content-Length: 0\r\n" .
- "\r\n"
- ));
-
- $request1 = new Request('GET', $this->getServer()->getUrl());
- $request2 = new Request('HEAD', $this->getServer()->getUrl());
- $request3 = new Request('GET', $this->getServer()->getUrl());
- $this->multi->add($request1);
- $this->multi->add($request2);
- $this->multi->add($request3);
-
- try {
- $this->multi->send();
- $this->fail('MultiTransferException not thrown when aggregating request exceptions');
- } catch (MultiTransferException $e) {
-
- $this->assertTrue($e->containsRequest($request1));
- $this->assertTrue($e->containsRequest($request2));
- $this->assertTrue($e->containsRequest($request3));
- $this->assertInstanceOf('ArrayIterator', $e->getIterator());
- $this->assertEquals(1, count($e));
- $exceptions = $e->getIterator();
-
- $response1 = $request1->getResponse();
- $response2 = $request2->getResponse();
- $response3 = $request3->getResponse();
-
- $this->assertNotEquals((string) $response1, (string) $response2);
- $this->assertNotEquals((string) $response3, (string) $response1);
- $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $response1);
- $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $response2);
- $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $response3);
-
- $failed = $exceptions[0]->getResponse();
- $this->assertEquals(404, $failed->getStatusCode());
- $this->assertEquals(1, count($e));
-
- // Test the IteratorAggregate functionality
- foreach ($e as $except) {
- $this->assertEquals($failed, $except->getResponse());
- }
-
- $this->assertEquals(1, count($e->getFailedRequests()));
- $this->assertEquals(2, count($e->getSuccessfulRequests()));
- $this->assertEquals(3, count($e->getAllRequests()));
- }
- }
-
- public function testCurlErrorsAreCaught()
- {
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- try {
- $request = RequestFactory::getInstance()->create('GET', 'http://127.0.0.1:9876/');
- $request->setClient(new Client());
- $request->getCurlOptions()->set(CURLOPT_FRESH_CONNECT, true);
- $request->getCurlOptions()->set(CURLOPT_FORBID_REUSE, true);
- $request->getCurlOptions()->set(CURLOPT_CONNECTTIMEOUT_MS, 5);
- $request->send();
- $this->fail('CurlException not thrown');
- } catch (CurlException $e) {
- $m = $e->getMessage();
- $this->assertContains('[curl] ', $m);
- $this->assertContains('[url] http://127.0.0.1:9876/', $m);
- $this->assertInternalType('array', $e->getCurlInfo());
- }
- }
-
- public function testRemovesQueuedRequests()
- {
- $request = RequestFactory::getInstance()->create('GET', 'http://127.0.0.1:9876/');
- $r = new Response(200);
- $request->setClient(new Client());
- $request->setResponse($r, true);
- $this->multi->add($request);
- $this->multi->send();
- $this->assertSame($r, $request->getResponse());
- }
-
- public function testRemovesQueuedRequestsAddedInTransit()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"));
- $client = new Client($this->getServer()->getUrl());
- $r = $client->get();
- $r->getEventDispatcher()->addListener('request.receive.status_line', function (Event $event) use ($client) {
- // Create a request using a queued response
- $request = $client->get()->setResponse(new Response(200), true);
- $request->send();
- });
- $r->send();
- $this->assertEquals(1, count($this->getServer()->getReceivedRequests(false)));
- }
-
- public function testCatchesExceptionsBeforeSendingSingleRequest()
- {
- $client = new Client($this->getServer()->getUrl());
- $multi = new CurlMulti();
- $client->setCurlMulti($multi);
- $request = $client->get();
- $request->getEventDispatcher()->addListener('request.before_send', function() {
- throw new \RuntimeException('Testing!');
- });
- try {
- $request->send();
- $this->fail('Did not throw');
- } catch (\RuntimeException $e) {
- // Ensure it was removed
- $this->assertEquals(0, count($multi));
- }
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\ExceptionCollection
- * @expectedExceptionMessage Thrown before sending!
- */
- public function testCatchesExceptionsBeforeSendingMultipleRequests()
- {
- $client = new Client($this->getServer()->getUrl());
- $request = $client->get();
- $request->getEventDispatcher()->addListener('request.before_send', function() {
- throw new \RuntimeException('Thrown before sending!');
- });
- $client->send(array($request));
- }
-
- public function testCatchesExceptionsWhenRemovingQueuedRequests()
- {
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $client = new Client($this->getServer()->getUrl());
- $r = $client->get();
- $r->getEventDispatcher()->addListener('request.sent', function() use ($client) {
- // Create a request using a queued response
- $client->get()->setResponse(new Response(404), true)->send();
- });
- try {
- $r->send();
- $this->fail('Did not throw');
- } catch (BadResponseException $e) {
- $this->assertCount(0, $client->getCurlMulti());
- }
- }
-
- public function testCatchesExceptionsWhenRemovingQueuedRequestsBeforeSending()
- {
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $client = new Client($this->getServer()->getUrl());
- $r = $client->get();
- $r->getEventDispatcher()->addListener('request.before_send', function() use ($client) {
- // Create a request using a queued response
- $client->get()->setResponse(new Response(404), true)->send();
- });
- try {
- $r->send();
- $this->fail('Did not throw');
- } catch (BadResponseException $e) {
- $this->assertCount(0, $client->getCurlMulti());
- }
- }
-
- /**
- * @expectedException \RuntimeException
- * @expectedExceptionMessage test
- */
- public function testDoesNotCatchRandomExceptionsThrownDuringPerform()
- {
- $client = new Client($this->getServer()->getUrl());
- $multi = $this->getMock('Guzzle\\Http\\Curl\\CurlMulti', array('perform'));
- $multi->expects($this->once())
- ->method('perform')
- ->will($this->throwException(new \RuntimeException('test')));
- $multi->add($client->get());
- $multi->send();
- }
-
- public function testDoesNotSendRequestsDecliningToBeSent()
- {
- if (!defined('CURLOPT_TIMEOUT_MS')) {
- $this->markTestSkipped('Update curl');
- }
-
- // Create a client that is bound to fail connecting
- $client = new Client('http://127.0.0.1:123', array(
- 'curl.CURLOPT_PORT' => 123,
- 'curl.CURLOPT_CONNECTTIMEOUT_MS' => 1,
- ));
-
- $request = $client->get();
- $multi = new CurlMulti();
- $multi->add($request);
-
- // Listen for request exceptions, and when they occur, first change the
- // state of the request back to transferring, and then just allow it to
- // exception out
- $request->getEventDispatcher()->addListener('request.exception', function(Event $event) use ($multi) {
- $retries = $event['request']->getParams()->get('retries');
- // Allow the first failure to retry
- if ($retries == 0) {
- $event['request']->setState('transfer');
- $event['request']->getParams()->set('retries', 1);
- // Remove the request to try again
- $multi->remove($event['request']);
- $multi->add($event['request']);
- }
- });
-
- try {
- $multi->send();
- $this->fail('Did not throw an exception at all!?!');
- } catch (\Exception $e) {
- $this->assertEquals(1, $request->getParams()->get('retries'));
- }
- }
-
- public function testDoesNotThrowExceptionsWhenRequestsRecoverWithRetry()
- {
- $this->getServer()->flush();
- $client = new Client($this->getServer()->getUrl());
- $request = $client->get();
- $request->getEventDispatcher()->addListener('request.before_send', function(Event $event) {
- $event['request']->setResponse(new Response(200));
- });
-
- $multi = new CurlMulti();
- $multi->add($request);
- $multi->send();
- $this->assertEquals(0, count($this->getServer()->getReceivedRequests(false)));
- }
-
- public function testDoesNotThrowExceptionsWhenRequestsRecoverWithSuccess()
- {
- // Attempt a port that 99.9% is not listening
- $client = new Client('http://127.0.0.1:123');
- $request = $client->get();
- // Ensure it times out quickly if needed
- $request->getCurlOptions()->set(CURLOPT_TIMEOUT_MS, 1)->set(CURLOPT_CONNECTTIMEOUT_MS, 1);
-
- $request->getEventDispatcher()->addListener('request.exception', function(Event $event) use (&$count) {
- $event['request']->setResponse(new Response(200));
- });
-
- $multi = new CurlMulti();
- $multi->add($request);
- $multi->send();
-
- // Ensure that the exception was caught, and the response was set manually
- $this->assertEquals(200, $request->getResponse()->getStatusCode());
- }
-
- public function testHardResetReopensMultiHandle()
- {
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"
- ));
-
- $stream = fopen('php://temp', 'w+');
- $client = new Client($this->getServer()->getUrl());
- $client->getConfig()->set('curl.CURLOPT_VERBOSE', true)->set('curl.CURLOPT_STDERR', $stream);
-
- $request = $client->get();
- $multi = new CurlMulti();
- $multi->add($request);
- $multi->send();
- $multi->reset(true);
- $multi->add($request);
- $multi->send();
-
- rewind($stream);
- $this->assertNotContains('Re-using existing connection', stream_get_contents($stream));
- }
-
- public function testThrowsMeaningfulExceptionsForCurlMultiErrors()
- {
- $multi = new CurlMulti();
-
- // Set the state of the multi object to sending to trigger the exception
- $reflector = new \ReflectionMethod('Guzzle\Http\Curl\CurlMulti', 'checkCurlResult');
- $reflector->setAccessible(true);
-
- // Successful
- $reflector->invoke($multi, 0);
-
- // Known error
- try {
- $reflector->invoke($multi, CURLM_BAD_HANDLE);
- $this->fail('Expected an exception here');
- } catch (CurlException $e) {
- $this->assertContains('The passed-in handle is not a valid CURLM handle.', $e->getMessage());
- $this->assertContains('CURLM_BAD_HANDLE', $e->getMessage());
- $this->assertContains(strval(CURLM_BAD_HANDLE), $e->getMessage());
- }
-
- // Unknown error
- try {
- $reflector->invoke($multi, 255);
- $this->fail('Expected an exception here');
- } catch (CurlException $e) {
- $this->assertEquals('Unexpected cURL error: 255', $e->getMessage());
- }
- }
-
- public function testRequestBeforeSendIncludesContentLengthHeaderIfEmptyBody()
- {
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $request = new Request('PUT', $this->getServer()->getUrl());
- $that = $this;
- $request->getEventDispatcher()->addListener('request.before_send', function ($event) use ($that) {
- $that->assertEquals(0, $event['request']->getHeader('Content-Length'));
- });
- $this->multi->add($request);
- $this->multi->send();
- }
-
- public function testRemovesConflictingTransferEncodingHeader()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"
- ));
- $client = new Client($this->getServer()->getUrl());
- $request = $client->put('/', null, fopen($this->getServer()->getUrl(), 'r'));
- $request->setHeader('Content-Length', 4);
- $request->send();
- $received = $this->getServer()->getReceivedRequests(true);
- $this->assertFalse($received[1]->hasHeader('Transfer-Encoding'));
- $this->assertEquals(4, (string) $received[1]->getHeader('Content-Length'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/CurlVersionTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/CurlVersionTest.php
deleted file mode 100644
index c7b5ee6..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/CurlVersionTest.php
+++ /dev/null
@@ -1,39 +0,0 @@
-getProperty('version');
- $refProperty->setAccessible(true);
- $refProperty->setValue($instance, array());
-
- $this->assertEquals($info, $instance->getAll());
- $this->assertEquals($info, $instance->getAll());
-
- $this->assertEquals($info['version'], $instance->get('version'));
- $this->assertFalse($instance->get('foo'));
- }
-
- public function testIsSingleton()
- {
- $refObject = new \ReflectionClass('Guzzle\Http\Curl\CurlVersion');
- $refProperty = $refObject->getProperty('instance');
- $refProperty->setAccessible(true);
- $refProperty->setValue(null, null);
-
- $this->assertInstanceOf('Guzzle\Http\Curl\CurlVersion', CurlVersion::getInstance());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/RequestMediatorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/RequestMediatorTest.php
deleted file mode 100644
index c69e0c9..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/RequestMediatorTest.php
+++ /dev/null
@@ -1,67 +0,0 @@
-events[] = $event;
- }
-
- public function testEmitsEvents()
- {
- $request = new EntityEnclosingRequest('PUT', 'http://www.example.com');
- $request->setBody('foo');
- $request->setResponse(new Response(200));
-
- // Ensure that IO events are emitted
- $request->getCurlOptions()->set('emit_io', true);
-
- // Attach listeners for each event type
- $request->getEventDispatcher()->addListener('curl.callback.progress', array($this, 'event'));
- $request->getEventDispatcher()->addListener('curl.callback.read', array($this, 'event'));
- $request->getEventDispatcher()->addListener('curl.callback.write', array($this, 'event'));
-
- $mediator = new RequestMediator($request, true);
-
- $mediator->progress('a', 'b', 'c', 'd');
- $this->assertEquals(1, count($this->events));
- $this->assertEquals('curl.callback.progress', $this->events[0]->getName());
-
- $this->assertEquals(3, $mediator->writeResponseBody('foo', 'bar'));
- $this->assertEquals(2, count($this->events));
- $this->assertEquals('curl.callback.write', $this->events[1]->getName());
- $this->assertEquals('bar', $this->events[1]['write']);
- $this->assertSame($request, $this->events[1]['request']);
-
- $this->assertEquals('foo', $mediator->readRequestBody('a', 'b', 3));
- $this->assertEquals(3, count($this->events));
- $this->assertEquals('curl.callback.read', $this->events[2]->getName());
- $this->assertEquals('foo', $this->events[2]['read']);
- $this->assertSame($request, $this->events[2]['request']);
- }
-
- public function testDoesNotUseRequestResponseBodyWhenNotCustom()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 307 Foo\r\nLocation: /foo\r\nContent-Length: 2\r\n\r\nHI",
- "HTTP/1.1 301 Foo\r\nLocation: /foo\r\nContent-Length: 2\r\n\r\nFI",
- "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest",
- ));
- $client = new Client($this->getServer()->getUrl());
- $response = $client->get()->send();
- $this->assertEquals('test', $response->getBody(true));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/EntityBodyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/EntityBodyTest.php
deleted file mode 100644
index 124a44d..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/EntityBodyTest.php
+++ /dev/null
@@ -1,182 +0,0 @@
-assertEquals('data', (string) $body);
- $this->assertEquals(4, $body->getContentLength());
- $this->assertEquals('PHP', $body->getWrapper());
- $this->assertEquals('TEMP', $body->getStreamType());
-
- $handle = fopen(__DIR__ . '/../../../../phpunit.xml.dist', 'r');
- if (!$handle) {
- $this->fail('Could not open test file');
- }
- $body = EntityBody::factory($handle);
- $this->assertEquals(__DIR__ . '/../../../../phpunit.xml.dist', $body->getUri());
- $this->assertTrue($body->isLocal());
- $this->assertEquals(__DIR__ . '/../../../../phpunit.xml.dist', $body->getUri());
- $this->assertEquals(filesize(__DIR__ . '/../../../../phpunit.xml.dist'), $body->getContentLength());
-
- // make sure that a body will return as the same object
- $this->assertTrue($body === EntityBody::factory($body));
- }
-
- public function testFactoryCreatesTempStreamByDefault()
- {
- $body = EntityBody::factory('');
- $this->assertEquals('PHP', $body->getWrapper());
- $this->assertEquals('TEMP', $body->getStreamType());
- $body = EntityBody::factory();
- $this->assertEquals('PHP', $body->getWrapper());
- $this->assertEquals('TEMP', $body->getStreamType());
- }
-
- public function testFactoryCanCreateFromObject()
- {
- $body = EntityBody::factory(new QueryString(array('foo' => 'bar')));
- $this->assertEquals('foo=bar', (string) $body);
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testFactoryEnsuresObjectsHaveToStringMethod()
- {
- EntityBody::factory(new \stdClass('a'));
- }
-
- public function testHandlesCompression()
- {
- $body = EntityBody::factory('testing 123...testing 123');
- $this->assertFalse($body->getContentEncoding(), '-> getContentEncoding() must initially return FALSE');
- $size = $body->getContentLength();
- $body->compress();
- $this->assertEquals('gzip', $body->getContentEncoding(), '-> getContentEncoding() must return the correct encoding after compressing');
- $this->assertEquals(gzdeflate('testing 123...testing 123'), (string) $body);
- $this->assertTrue($body->getContentLength() < $size);
- $this->assertTrue($body->uncompress());
- $this->assertEquals('testing 123...testing 123', (string) $body);
- $this->assertFalse($body->getContentEncoding(), '-> getContentEncoding() must reset to FALSE');
-
- if (in_array('bzip2.*', stream_get_filters())) {
- $this->assertTrue($body->compress('bzip2.compress'));
- $this->assertEquals('compress', $body->getContentEncoding(), '-> compress() must set \'compress\' as the Content-Encoding');
- }
-
- $this->assertFalse($body->compress('non-existent'), '-> compress() must return false when a non-existent stream filter is used');
-
- // Release the body
- unset($body);
-
- // Use gzip compression on the initial content. This will include a
- // gzip header which will need to be stripped when deflating the stream
- $body = EntityBody::factory(gzencode('test'));
- $this->assertSame($body, $body->setStreamFilterContentEncoding('zlib.deflate'));
- $this->assertTrue($body->uncompress('zlib.inflate'));
- $this->assertEquals('test', (string) $body);
- unset($body);
-
- // Test using a very long string
- $largeString = '';
- for ($i = 0; $i < 25000; $i++) {
- $largeString .= chr(rand(33, 126));
- }
- $body = EntityBody::factory($largeString);
- $this->assertEquals($largeString, (string) $body);
- $this->assertTrue($body->compress());
- $this->assertNotEquals($largeString, (string) $body);
- $compressed = (string) $body;
- $this->assertTrue($body->uncompress());
- $this->assertEquals($largeString, (string) $body);
- $this->assertEquals($compressed, gzdeflate($largeString));
-
- $body = EntityBody::factory(fopen(__DIR__ . '/../TestData/compress_test', 'w'));
- $this->assertFalse($body->compress());
- unset($body);
-
- unlink(__DIR__ . '/../TestData/compress_test');
- }
-
- public function testDeterminesContentType()
- {
- // Test using a string/temp stream
- $body = EntityBody::factory('testing 123...testing 123');
- $this->assertNull($body->getContentType());
-
- // Use a local file
- $body = EntityBody::factory(fopen(__FILE__, 'r'));
- $this->assertContains('text/x-', $body->getContentType());
- }
-
- public function testCreatesMd5Checksum()
- {
- $body = EntityBody::factory('testing 123...testing 123');
- $this->assertEquals(md5('testing 123...testing 123'), $body->getContentMd5());
-
- $server = $this->getServer()->enqueue(
- "HTTP/1.1 200 OK" . "\r\n" .
- "Content-Length: 3" . "\r\n\r\n" .
- "abc"
- );
-
- $body = EntityBody::factory(fopen($this->getServer()->getUrl(), 'r'));
- $this->assertFalse($body->getContentMd5());
- }
-
- public function testSeeksToOriginalPosAfterMd5()
- {
- $body = EntityBody::factory('testing 123');
- $body->seek(4);
- $this->assertEquals(md5('testing 123'), $body->getContentMd5());
- $this->assertEquals(4, $body->ftell());
- $this->assertEquals('ing 123', $body->read(1000));
- }
-
- public function testGetTypeFormBodyFactoring()
- {
- $body = EntityBody::factory(array('key1' => 'val1', 'key2' => 'val2'));
- $this->assertEquals('key1=val1&key2=val2', (string) $body);
- }
-
- public function testAllowsCustomRewind()
- {
- $body = EntityBody::factory('foo');
- $rewound = false;
- $body->setRewindFunction(function ($body) use (&$rewound) {
- $rewound = true;
- return $body->seek(0);
- });
- $body->seek(2);
- $this->assertTrue($body->rewind());
- $this->assertTrue($rewound);
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testCustomRewindFunctionMustBeCallable()
- {
- $body = EntityBody::factory();
- $body->setRewindFunction('foo');
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Exception/CurlExceptionTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Exception/CurlExceptionTest.php
deleted file mode 100644
index df3e4b7..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Exception/CurlExceptionTest.php
+++ /dev/null
@@ -1,27 +0,0 @@
-assertNull($e->getError());
- $this->assertNull($e->getErrorNo());
- $this->assertSame($e, $e->setError('test', 12));
- $this->assertEquals('test', $e->getError());
- $this->assertEquals(12, $e->getErrorNo());
-
- $handle = new CurlHandle(curl_init(), array());
- $e->setCurlHandle($handle);
- $this->assertSame($handle, $e->getCurlHandle());
- $handle->close();
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Exception/ExceptionTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Exception/ExceptionTest.php
deleted file mode 100644
index 12cfd36..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Exception/ExceptionTest.php
+++ /dev/null
@@ -1,66 +0,0 @@
-setRequest($request);
- $this->assertEquals($request, $e->getRequest());
- }
-
- /**
- * @covers Guzzle\Http\Exception\BadResponseException
- */
- public function testBadResponseException()
- {
- $e = new BadResponseException('Message');
- $response = new Response(200);
- $e->setResponse($response);
- $this->assertEquals($response, $e->getResponse());
- }
-
- /**
- * @covers Guzzle\Http\Exception\BadResponseException::factory
- */
- public function testCreatesGenericErrorExceptionOnError()
- {
- $request = new Request('GET', 'http://www.example.com');
- $response = new Response(307);
- $e = BadResponseException::factory($request, $response);
- $this->assertInstanceOf('Guzzle\Http\Exception\BadResponseException', $e);
- }
-
- /**
- * @covers Guzzle\Http\Exception\BadResponseException::factory
- */
- public function testCreatesClientErrorExceptionOnClientError()
- {
- $request = new Request('GET', 'http://www.example.com');
- $response = new Response(404);
- $e = BadResponseException::factory($request, $response);
- $this->assertInstanceOf('Guzzle\Http\Exception\ClientErrorResponseException', $e);
- }
-
- /**
- * @covers Guzzle\Http\Exception\BadResponseException::factory
- */
- public function testCreatesServerErrorExceptionOnServerError()
- {
- $request = new Request('GET', 'http://www.example.com');
- $response = new Response(503);
- $e = BadResponseException::factory($request, $response);
- $this->assertInstanceOf('Guzzle\Http\Exception\ServerErrorResponseException', $e);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Exception/MultiTransferExceptionTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Exception/MultiTransferExceptionTest.php
deleted file mode 100644
index fa4ec26..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Exception/MultiTransferExceptionTest.php
+++ /dev/null
@@ -1,51 +0,0 @@
-addSuccessfulRequest($r1);
- $e->addFailedRequest($r2);
- $this->assertEquals(array($r1), $e->getSuccessfulRequests());
- $this->assertEquals(array($r2), $e->getSuccessfulRequests());
- $this->assertEquals(array($r1, $r2), $e->getAllRequests());
- $this->assertTrue($e->containsRequest($r1));
- $this->assertTrue($e->containsRequest($r2));
- $this->assertFalse($e->containsRequest(new Request('POST', '/foo')));
- }
-
- public function testCanSetRequests()
- {
- $s = array($r1 = new Request('GET', 'http://www.foo.com'));
- $f = array($r2 = new Request('GET', 'http://www.foo.com'));
- $e = new MultiTransferException();
- $e->setSuccessfulRequests($s);
- $e->setFailedRequests($f);
- $this->assertEquals(array($r1), $e->getSuccessfulRequests());
- $this->assertEquals(array($r2), $e->getSuccessfulRequests());
- }
-
- public function testAssociatesExceptionsWithRequests()
- {
- $r1 = new Request('GET', 'http://www.foo.com');
- $re1 = new \Exception('foo');
- $re2 = new \Exception('bar');
- $e = new MultiTransferException();
- $e->add($re2);
- $e->addFailedRequestWithException($r1, $re1);
- $this->assertSame($re1, $e->getExceptionForFailedRequest($r1));
- $this->assertNull($e->getExceptionForFailedRequest(new Request('POST', '/foo')));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/IoEmittingEntityBodyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/IoEmittingEntityBodyTest.php
deleted file mode 100644
index cd6355f..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/IoEmittingEntityBodyTest.php
+++ /dev/null
@@ -1,47 +0,0 @@
-decorated = EntityBody::factory('hello');
- $this->body = new IoEmittingEntityBody($this->decorated);
- }
-
- public function testEmitsReadEvents()
- {
- $e = null;
- $this->body->getEventDispatcher()->addListener('body.read', function ($event) use (&$e) {
- $e = $event;
- });
- $this->assertEquals('hel', $this->body->read(3));
- $this->assertEquals('hel', $e['read']);
- $this->assertEquals(3, $e['length']);
- $this->assertSame($this->body, $e['body']);
- }
-
- public function testEmitsWriteEvents()
- {
- $e = null;
- $this->body->getEventDispatcher()->addListener('body.write', function ($event) use (&$e) {
- $e = $event;
- });
- $this->body->seek(0, SEEK_END);
- $this->assertEquals(5, $this->body->write('there'));
- $this->assertEquals('there', $e['write']);
- $this->assertEquals(5, $e['result']);
- $this->assertSame($this->body, $e['body']);
- $this->assertEquals('hellothere', (string) $this->body);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/AbstractMessageTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/AbstractMessageTest.php
deleted file mode 100644
index 9447d8c..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/AbstractMessageTest.php
+++ /dev/null
@@ -1,136 +0,0 @@
-mock = $this->getMockForAbstractClass('Guzzle\Http\Message\AbstractMessage');
- }
-
- public function tearDown()
- {
- $this->mock = $this->request = null;
- }
-
- public function testGetParams()
- {
- $request = new Request('GET', 'http://example.com');
- $this->assertInstanceOf('Guzzle\\Common\\Collection', $request->getParams());
- }
-
- public function testAddHeaders()
- {
- $this->mock->setHeader('A', 'B');
-
- $this->assertEquals($this->mock, $this->mock->addHeaders(array(
- 'X-Data' => '123'
- )));
-
- $this->assertTrue($this->mock->hasHeader('X-Data') !== false);
- $this->assertTrue($this->mock->hasHeader('A') !== false);
- }
-
- public function testAllowsHeaderToSetAsHeader()
- {
- $h = new Header('A', 'B');
- $this->mock->setHeader('A', $h);
- $this->assertSame($h, $this->mock->getHeader('A'));
- }
-
- public function testGetHeader()
- {
- $this->mock->setHeader('Test', '123');
- $this->assertEquals('123', $this->mock->getHeader('Test'));
- }
-
- public function testGetHeaders()
- {
- $this->assertSame($this->mock, $this->mock->setHeaders(array('a' => 'b', 'c' => 'd')));
- $h = $this->mock->getHeaders();
- $this->assertArrayHasKey('a', $h->toArray());
- $this->assertArrayHasKey('c', $h->toArray());
- $this->assertInstanceOf('Guzzle\Http\Message\Header\HeaderInterface', $h->get('a'));
- $this->assertInstanceOf('Guzzle\Http\Message\Header\HeaderInterface', $h->get('c'));
- }
-
- public function testGetHeaderLinesUsesGlue()
- {
- $this->mock->setHeaders(array('a' => 'b', 'c' => 'd'));
- $this->mock->addHeader('a', 'e');
- $this->mock->getHeader('a')->setGlue('!');
- $this->assertEquals(array(
- 'a: b! e',
- 'c: d'
- ), $this->mock->getHeaderLines());
- }
-
- public function testHasHeader()
- {
- $this->assertFalse($this->mock->hasHeader('Foo'));
- $this->mock->setHeader('Foo', 'Bar');
- $this->assertEquals(true, $this->mock->hasHeader('Foo'));
- $this->mock->setHeader('foo', 'yoo');
- $this->assertEquals(true, $this->mock->hasHeader('Foo'));
- $this->assertEquals(true, $this->mock->hasHeader('foo'));
- $this->assertEquals(false, $this->mock->hasHeader('bar'));
- }
-
- public function testRemoveHeader()
- {
- $this->mock->setHeader('Foo', 'Bar');
- $this->assertEquals(true, $this->mock->hasHeader('Foo'));
- $this->mock->removeHeader('Foo');
- $this->assertFalse($this->mock->hasHeader('Foo'));
- }
-
- public function testReturnsNullWhenHeaderIsNotFound()
- {
- $this->assertNull($this->mock->getHeader('foo'));
- }
-
- public function testAddingHeadersPreservesOriginalHeaderCase()
- {
- $this->mock->addHeaders(array(
- 'test' => '123',
- 'Test' => 'abc'
- ));
- $this->mock->addHeader('test', '456');
- $this->mock->addHeader('test', '789');
-
- $header = $this->mock->getHeader('test');
- $this->assertContains('123', $header->toArray());
- $this->assertContains('456', $header->toArray());
- $this->assertContains('789', $header->toArray());
- $this->assertContains('abc', $header->toArray());
- }
-
- public function testCanStoreEmptyHeaders()
- {
- $this->mock->setHeader('Content-Length', 0);
- $this->assertTrue($this->mock->hasHeader('Content-Length'));
- $this->assertEquals(0, (string) $this->mock->getHeader('Content-Length'));
- }
-
- public function testCanSetCustomHeaderFactory()
- {
- $f = new Header\HeaderFactory();
- $this->mock->setHeaderFactory($f);
- $this->assertSame($f, $this->readAttribute($this->mock, 'headerFactory'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/EntityEnclosingRequestTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/EntityEnclosingRequestTest.php
deleted file mode 100644
index 191b022..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/EntityEnclosingRequestTest.php
+++ /dev/null
@@ -1,434 +0,0 @@
-client = new Client();
- }
-
- public function tearDown()
- {
- $this->client = null;
- }
-
- public function testConstructorConfiguresRequest()
- {
- $request = new EntityEnclosingRequest('PUT', 'http://test.com', array(
- 'X-Test' => '123'
- ));
- $request->setBody('Test');
- $this->assertEquals('123', $request->getHeader('X-Test'));
- $this->assertNull($request->getHeader('Expect'));
- }
-
- public function testCanSetBodyWithoutOverridingContentType()
- {
- $request = new EntityEnclosingRequest('PUT', 'http://test.com', array('Content-Type' => 'foooooo'));
- $request->setBody('{"a":"b"}');
- $this->assertEquals('foooooo', $request->getHeader('Content-Type'));
- }
-
- public function testRequestIncludesBodyInMessage()
- {
-
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.guzzle-project.com/', null, 'data');
- $this->assertEquals("PUT / HTTP/1.1\r\n"
- . "Host: www.guzzle-project.com\r\n"
- . "Content-Length: 4\r\n\r\n"
- . "data", (string) $request);
- }
-
- public function testRequestIncludesPostBodyInMessageOnlyWhenNoPostFiles()
- {
- $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/', null, array(
- 'foo' => 'bar'
- ));
- $this->assertEquals("POST / HTTP/1.1\r\n"
- . "Host: www.guzzle-project.com\r\n"
- . "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n\r\n"
- . "foo=bar", (string) $request);
-
- $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/', null, array(
- 'foo' => '@' . __FILE__
- ));
- $this->assertEquals("POST / HTTP/1.1\r\n"
- . "Host: www.guzzle-project.com\r\n"
- . "Content-Type: multipart/form-data\r\n"
- . "Expect: 100-Continue\r\n\r\n", (string) $request);
- }
-
- public function testAddsPostFieldsAndSetsContentLength()
- {
- $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/', null, array(
- 'data' => '123'
- ));
- $this->assertEquals("POST / HTTP/1.1\r\n"
- . "Host: www.guzzle-project.com\r\n"
- . "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n\r\n"
- . "data=123", (string) $request);
- }
-
- public function testAddsPostFilesAndSetsContentType()
- {
- $request = RequestFactory::getInstance()->create('POST', 'http://www.test.com/')
- ->addPostFiles(array(
- 'file' => __FILE__
- ))->addPostFields(array(
- 'a' => 'b'
- ));
- $message = (string) $request;
- $this->assertEquals('multipart/form-data', $request->getHeader('Content-Type'));
- $this->assertEquals('100-Continue', $request->getHeader('Expect'));
- }
-
- public function testRequestBodyContainsPostFiles()
- {
- $request = RequestFactory::getInstance()->create('POST', 'http://www.test.com/');
- $request->addPostFields(array(
- 'test' => '123'
- ));
- $this->assertContains("\r\n\r\ntest=123", (string) $request);
- }
-
- public function testRequestBodyAddsContentLength()
- {
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.test.com/');
- $request->setBody(EntityBody::factory('test'));
- $this->assertEquals(4, (string) $request->getHeader('Content-Length'));
- $this->assertFalse($request->hasHeader('Transfer-Encoding'));
- }
-
- public function testRequestBodyDoesNotUseContentLengthWhenChunked()
- {
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.test.com/', array(
- 'Transfer-Encoding' => 'chunked'
- ), 'test');
- $this->assertNull($request->getHeader('Content-Length'));
- $this->assertTrue($request->hasHeader('Transfer-Encoding'));
- }
-
- public function testRequestHasMutableBody()
- {
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.guzzle-project.com/', null, 'data');
- $body = $request->getBody();
- $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $body);
- $this->assertSame($body, $request->getBody());
-
- $newBody = EntityBody::factory('foobar');
- $request->setBody($newBody);
- $this->assertEquals('foobar', (string) $request->getBody());
- $this->assertSame($newBody, $request->getBody());
- }
-
- public function testSetPostFields()
- {
- $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/');
- $this->assertInstanceOf('Guzzle\\Http\\QueryString', $request->getPostFields());
-
- $fields = new QueryString(array(
- 'a' => 'b'
- ));
- $request->addPostFields($fields);
- $this->assertEquals($fields->getAll(), $request->getPostFields()->getAll());
- $this->assertEquals(array(), $request->getPostFiles());
- }
-
- public function testSetPostFiles()
- {
- $request = RequestFactory::getInstance()->create('POST', $this->getServer()->getUrl())
- ->setClient(new Client())
- ->addPostFiles(array(__FILE__))
- ->addPostFields(array(
- 'test' => 'abc'
- ));
-
- $request->getCurlOptions()->set('debug', true);
-
- $this->assertEquals(array(
- 'test' => 'abc'
- ), $request->getPostFields()->getAll());
-
- $files = $request->getPostFiles();
- $post = $files['file'][0];
- $this->assertEquals('file', $post->getFieldName());
- $this->assertContains('text/x-', $post->getContentType());
- $this->assertEquals(__FILE__, $post->getFilename());
-
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $request->send();
-
- $this->assertNotNull($request->getHeader('Content-Length'));
- $this->assertContains('multipart/form-data; boundary=', (string) $request->getHeader('Content-Type'), '-> cURL must add the boundary');
- }
-
- /**
- * @expectedException Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testSetPostFilesThrowsExceptionWhenFileIsNotFound()
- {
- $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/')
- ->addPostFiles(array(
- 'file' => 'filenotfound.ini'
- ));
- }
-
- /**
- * @expectedException Guzzle\Http\Exception\RequestException
- */
- public function testThrowsExceptionWhenNonStringsAreAddedToPost()
- {
- $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/')
- ->addPostFile('foo', new \stdClass());
- }
-
- public function testAllowsContentTypeInPostUploads()
- {
- $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/')
- ->addPostFile('foo', __FILE__, 'text/plain');
-
- $this->assertEquals(array(
- new PostFile('foo', __FILE__, 'text/plain')
- ), $request->getPostFile('foo'));
- }
-
- public function testGuessesContentTypeOfPostUpload()
- {
- $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/')
- ->addPostFile('foo', __FILE__);
- $file = $request->getPostFile('foo');
- $this->assertContains('text/x-', $file[0]->getContentType());
- }
-
- public function testAllowsContentDispositionFieldsInPostUploadsWhenSettingInBulk()
- {
- $postFile = new PostFile('foo', __FILE__, 'text/x-php');
- $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/')
- ->addPostFiles(array('foo' => $postFile));
-
- $this->assertEquals(array($postFile), $request->getPostFile('foo'));
- }
-
- public function testPostRequestsUseApplicationXwwwForUrlEncodedForArrays()
- {
- $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/');
- $request->setPostField('a', 'b');
- $this->assertContains("\r\n\r\na=b", (string) $request);
- $this->assertEquals('application/x-www-form-urlencoded; charset=utf-8', $request->getHeader('Content-Type'));
- }
-
- public function testProcessMethodAddsContentType()
- {
- $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/');
- $request->setPostField('a', 'b');
- $this->assertEquals('application/x-www-form-urlencoded; charset=utf-8', $request->getHeader('Content-Type'));
- }
-
- public function testPostRequestsUseMultipartFormDataWithFiles()
- {
- $request = RequestFactory::getInstance()->create('POST', 'http://www.guzzle-project.com/');
- $request->addPostFiles(array('file' => __FILE__));
- $this->assertEquals('multipart/form-data', $request->getHeader('Content-Type'));
- }
-
- public function testCanSendMultipleRequestsUsingASingleRequestObject()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 201 Created\r\nContent-Length: 0\r\n\r\n",
- ));
-
- // Send the first request
- $request = RequestFactory::getInstance()->create('PUT', $this->getServer()->getUrl())
- ->setBody('test')
- ->setClient(new Client());
- $request->send();
- $this->assertEquals(200, $request->getResponse()->getStatusCode());
-
- // Send the second request
- $request->setBody('abcdefg', 'application/json', false);
- $request->send();
- $this->assertEquals(201, $request->getResponse()->getStatusCode());
-
- // Ensure that the same request was sent twice with different bodies
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals(2, count($requests));
- $this->assertEquals(4, (string) $requests[0]->getHeader('Content-Length'));
- $this->assertEquals(7, (string) $requests[1]->getHeader('Content-Length'));
- }
-
- public function testRemovingPostFieldRebuildsPostFields()
- {
- $request = new EntityEnclosingRequest('POST', 'http://test.com');
- $request->setPostField('test', 'value');
- $request->removePostField('test');
- $this->assertNull($request->getPostField('test'));
- }
-
- public function testUsesChunkedTransferWhenBodyLengthCannotBeDetermined()
- {
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $request = new EntityEnclosingRequest('PUT', 'http://test.com/');
- $request->setBody(fopen($this->getServer()->getUrl(), 'r'));
- $this->assertEquals('chunked', $request->getHeader('Transfer-Encoding'));
- $this->assertFalse($request->hasHeader('Content-Length'));
- }
-
- /**
- * @expectedException \Guzzle\Http\Exception\RequestException
- */
- public function testThrowsExceptionWhenContentLengthCannotBeDeterminedAndUsingHttp1()
- {
- $request = new EntityEnclosingRequest('PUT', 'http://test.com/');
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $request->setProtocolVersion('1.0');
- $request->setBody(fopen($this->getServer()->getUrl(), 'r'));
- }
-
- public function testAllowsNestedPostData()
- {
- $request = new EntityEnclosingRequest('POST', 'http://test.com/');
- $request->addPostFields(array(
- 'a' => array('b', 'c')
- ));
- $this->assertEquals(array(
- 'a' => array('b', 'c')
- ), $request->getPostFields()->getAll());
- }
-
- public function testAllowsEmptyFields()
- {
- $request = new EntityEnclosingRequest('POST', 'http://test.com/');
- $request->addPostFields(array(
- 'a' => ''
- ));
- $this->assertEquals(array(
- 'a' => ''
- ), $request->getPostFields()->getAll());
- }
-
- /**
- * @expectedException \Guzzle\Http\Exception\RequestException
- */
- public function testFailsOnInvalidFiles()
- {
- $request = new EntityEnclosingRequest('POST', 'http://test.com/');
- $request->addPostFiles(array(
- 'a' => new \stdClass()
- ));
- }
-
- public function testHandlesEmptyStrings()
- {
- $request = new EntityEnclosingRequest('POST', 'http://test.com/');
- $request->addPostFields(array(
- 'a' => '',
- 'b' => null,
- 'c' => 'Foo'
- ));
- $this->assertEquals(array(
- 'a' => '',
- 'b' => null,
- 'c' => 'Foo'
- ), $request->getPostFields()->getAll());
- }
-
- public function testHoldsPostFiles()
- {
- $request = new EntityEnclosingRequest('POST', 'http://test.com/');
- $request->addPostFile('foo', __FILE__);
- $request->addPostFile(new PostFile('foo', __FILE__));
-
- $this->assertArrayHasKey('foo', $request->getPostFiles());
- $foo = $request->getPostFile('foo');
- $this->assertEquals(2, count($foo));
- $this->assertEquals(__FILE__, $foo[0]->getFilename());
- $this->assertEquals(__FILE__, $foo[1]->getFilename());
-
- $request->removePostFile('foo');
- $this->assertEquals(array(), $request->getPostFiles());
- }
-
- public function testAllowsAtPrefixWhenAddingPostFiles()
- {
- $request = new EntityEnclosingRequest('POST', 'http://test.com/');
- $request->addPostFiles(array(
- 'foo' => '@' . __FILE__
- ));
- $foo = $request->getPostFile('foo');
- $this->assertEquals(__FILE__, $foo[0]->getFilename());
- }
-
- public function testSetStateToTransferWithEmptyBodySetsContentLengthToZero()
- {
- $request = new EntityEnclosingRequest('POST', 'http://test.com/');
- $request->setState($request::STATE_TRANSFER);
- $this->assertEquals('0', (string) $request->getHeader('Content-Length'));
- }
-
- public function testSettingExpectHeaderCutoffChangesRequest()
- {
- $request = new EntityEnclosingRequest('PUT', 'http://test.com/');
- $request->setHeader('Expect', '100-Continue');
- $request->setExpectHeaderCutoff(false);
- $this->assertNull($request->getHeader('Expect'));
- // There is not body, so remove the expect header
- $request->setHeader('Expect', '100-Continue');
- $request->setExpectHeaderCutoff(10);
- $this->assertNull($request->getHeader('Expect'));
- // The size is less than the cutoff
- $request->setBody('foo');
- $this->assertNull($request->getHeader('Expect'));
- // The size is greater than the cutoff
- $request->setBody('foobazbarbamboo');
- $this->assertNotNull($request->getHeader('Expect'));
- }
-
- public function testStrictRedirectsCanBeSpecifiedOnEntityEnclosingRequests()
- {
- $request = new EntityEnclosingRequest('PUT', 'http://test.com/');
- $request->configureRedirects(true);
- $this->assertTrue($request->getParams()->get(RedirectPlugin::STRICT_REDIRECTS));
- }
-
- public function testCanDisableRedirects()
- {
- $request = new EntityEnclosingRequest('PUT', 'http://test.com/');
- $request->configureRedirects(false, false);
- $this->assertTrue($request->getParams()->get(RedirectPlugin::DISABLE));
- }
-
- public function testSetsContentTypeWhenSettingBodyByGuessingFromEntityBody()
- {
- $request = new EntityEnclosingRequest('PUT', 'http://test.com/foo');
- $request->setBody(EntityBody::factory(fopen(__FILE__, 'r')));
- $this->assertEquals('text/x-php', (string) $request->getHeader('Content-Type'));
- }
-
- public function testDoesNotCloneBody()
- {
- $request = new EntityEnclosingRequest('PUT', 'http://test.com/foo');
- $request->setBody('test');
- $newRequest = clone $request;
- $newRequest->setBody('foo');
- $this->assertInternalType('string', (string) $request->getBody());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/Header/HeaderFactoryTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/Header/HeaderFactoryTest.php
deleted file mode 100644
index 62ca555..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/Header/HeaderFactoryTest.php
+++ /dev/null
@@ -1,29 +0,0 @@
-createHeader('Foo', 'Bar');
- $this->assertInstanceOf('Guzzle\Http\Message\Header', $h);
- $this->assertEquals('Foo', $h->getName());
- $this->assertEquals('Bar', (string) $h);
- }
-
- public function testCreatesSpecificHeaders()
- {
- $f = new HeaderFactory();
- $h = $f->createHeader('Link', '; rel="test"');
- $this->assertInstanceOf('Guzzle\Http\Message\Header\Link', $h);
- $this->assertEquals('Link', $h->getName());
- $this->assertEquals('; rel="test"', (string) $h);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/Header/LinkTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/Header/LinkTest.php
deleted file mode 100644
index c834d10..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/Header/LinkTest.php
+++ /dev/null
@@ -1,63 +0,0 @@
-; rel=front; type="image/jpeg", ; rel=back; type="image/jpeg", ; rel=side; type="image/jpeg"');
- $links = $link->getLinks();
- $this->assertEquals(array(
- array(
- 'rel' => 'front',
- 'type' => 'image/jpeg',
- 'url' => 'http:/.../front.jpeg',
- ),
- array(
- 'rel' => 'back',
- 'type' => 'image/jpeg',
- 'url' => 'http://.../back.jpeg',
- ),
- array(
- 'rel' => 'side',
- 'type' => 'image/jpeg',
- 'url' => 'http://.../side.jpeg?test=1'
- )
- ), $links);
-
- $this->assertEquals(array(
- 'rel' => 'back',
- 'type' => 'image/jpeg',
- 'url' => 'http://.../back.jpeg',
- ), $link->getLink('back'));
-
- $this->assertTrue($link->hasLink('front'));
- $this->assertFalse($link->hasLink('foo'));
- }
-
- public function testCanAddLink()
- {
- $link = new Link('Link', '; rel=a; type="image/jpeg"');
- $link->addLink('http://test.com', 'test', array('foo' => 'bar'));
- $this->assertEquals(
- '; rel=a; type="image/jpeg", ; rel="test"; foo="bar"',
- (string) $link
- );
- }
-
- public function testCanParseLinksWithCommas()
- {
- $link = new Link('Link', '; rel="previous"; title="start, index"');
- $this->assertEquals(array(
- array(
- 'rel' => 'previous',
- 'title' => 'start, index',
- 'url' => 'http://example.com/TheBook/chapter1',
- )
- ), $link->getLinks());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/HeaderComparison.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/HeaderComparison.php
deleted file mode 100644
index a3f511b..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/HeaderComparison.php
+++ /dev/null
@@ -1,135 +0,0 @@
-toArray();
- }
-
- foreach ($filteredHeaders as $k => $v) {
- if ($k[0] == '_') {
- // This header should be ignored
- $ignore[] = str_replace('_', '', $k);
- } elseif ($k[0] == '!') {
- // This header must not be present
- $absent[] = str_replace('!', '', $k);
- } else {
- $expected[$k] = $v;
- }
- }
-
- return $this->compareArray($expected, $actualHeaders, $ignore, $absent);
- }
-
- /**
- * Check if an array of HTTP headers matches another array of HTTP headers while taking * into account as a wildcard
- *
- * @param array $expected Expected HTTP headers (allows wildcard values)
- * @param array|Collection $actual Actual HTTP header array
- * @param array $ignore Headers to ignore from the comparison
- * @param array $absent Array of headers that must not be present
- *
- * @return array|bool Returns an array of the differences or FALSE if none
- */
- public function compareArray(array $expected, $actual, array $ignore = array(), array $absent = array())
- {
- $differences = array();
-
- // Add information about headers that were present but weren't supposed to be
- foreach ($absent as $header) {
- if ($this->hasKey($header, $actual)) {
- $differences["++ {$header}"] = $actual[$header];
- unset($actual[$header]);
- }
- }
-
- // Check if expected headers are missing
- foreach ($expected as $header => $value) {
- if (!$this->hasKey($header, $actual)) {
- $differences["- {$header}"] = $value;
- }
- }
-
- // Flip the ignore array so it works with the case insensitive helper
- $ignore = array_flip($ignore);
- // Allow case-insensitive comparisons in wildcards
- $expected = array_change_key_case($expected);
-
- // Compare the expected and actual HTTP headers in no particular order
- foreach ($actual as $key => $value) {
-
- // If this is to be ignored, the skip it
- if ($this->hasKey($key, $ignore)) {
- continue;
- }
-
- // If the header was not expected
- if (!$this->hasKey($key, $expected)) {
- $differences["+ {$key}"] = $value;
- continue;
- }
-
- // Check values and take wildcards into account
- $lkey = strtolower($key);
- $pos = is_string($expected[$lkey]) ? strpos($expected[$lkey], '*') : false;
-
- foreach ((array) $actual[$key] as $v) {
- if (($pos === false && $v != $expected[$lkey]) || $pos > 0 && substr($v, 0, $pos) != substr($expected[$lkey], 0, $pos)) {
- $differences[$key] = "{$value} != {$expected[$lkey]}";
- }
- }
- }
-
- return empty($differences) ? false : $differences;
- }
-
- /**
- * Case insensitive check if an array have a key
- *
- * @param string $key Key to check
- * @param array $array Array to check
- *
- * @return bool
- */
- protected function hasKey($key, $array)
- {
- if ($array instanceof Collection) {
- $keys = $array->getKeys();
- } else {
- $keys = array_keys($array);
- }
-
- foreach ($keys as $k) {
- if (!strcasecmp($k, $key)) {
- return true;
- }
- }
-
- return false;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/HeaderComparisonTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/HeaderComparisonTest.php
deleted file mode 100644
index 86c4fe8..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/HeaderComparisonTest.php
+++ /dev/null
@@ -1,115 +0,0 @@
- 'Foo'
- ), array(
- 'Content-Length' => 'Foo'
- ), false),
-
- // Missing header
- array(array(
- 'X-Foo' => 'Bar'
- ), array(), array(
- '- X-Foo' => 'Bar'
- )),
-
- // Extra headers is present
- array(array(
- 'X-Foo' => 'Bar'
- ), array(
- 'X-Foo' => 'Bar',
- 'X-Baz' => 'Jar'
- ), array(
- '+ X-Baz' => 'Jar'
- )),
-
- // Header is present but must be absent
- array(array(
- '!X-Foo' => '*'
- ), array(
- 'X-Foo' => 'Bar'
- ), array(
- '++ X-Foo' => 'Bar'
- )),
-
- // Different values
- array(array(
- 'X-Foo' => 'Bar'
- ), array(
- 'X-Foo' => 'Baz'
- ), array(
- 'X-Foo' => 'Baz != Bar'
- )),
-
- // Wildcard search passes
- array(array(
- 'X-Foo' => '*'
- ), array(
- 'X-Foo' => 'Bar'
- ), false),
-
- // Wildcard search fails
- array(array(
- 'X-Foo' => '*'
- ), array(), array(
- '- X-Foo' => '*'
- )),
-
- // Ignore extra header if present
- array(array(
- 'X-Foo' => '*',
- '_X-Bar' => '*',
- ), array(
- 'X-Foo' => 'Baz',
- 'X-Bar' => 'Jar'
- ), false),
-
- // Ignore extra header if present and is not
- array(array(
- 'X-Foo' => '*',
- '_X-Bar' => '*',
- ), array(
- 'X-Foo' => 'Baz'
- ), false),
-
- // Case insensitive
- array(array(
- 'X-Foo' => '*',
- '_X-Bar' => '*',
- ), array(
- 'x-foo' => 'Baz',
- 'x-BAR' => 'baz'
- ), false),
-
- // Case insensitive with collection
- array(array(
- 'X-Foo' => '*',
- '_X-Bar' => '*',
- ), new Collection(array(
- 'x-foo' => 'Baz',
- 'x-BAR' => 'baz'
- )), false),
- );
- }
-
- /**
- * @dataProvider filterProvider
- */
- public function testComparesHeaders($filters, $headers, $result)
- {
- $compare = new HeaderComparison();
- $this->assertEquals($result, $compare->compare($filters, $headers));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/HeaderTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/HeaderTest.php
deleted file mode 100644
index c750234..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/HeaderTest.php
+++ /dev/null
@@ -1,162 +0,0 @@
- array('foo', 'Foo'),
- 'Zoo' => 'bar',
- );
-
- public function testStoresHeaderName()
- {
- $i = new Header('Zoo', $this->test);
- $this->assertEquals('Zoo', $i->getName());
- }
-
- public function testConvertsToString()
- {
- $i = new Header('Zoo', $this->test);
- $this->assertEquals('foo, Foo, bar', (string) $i);
- $i->setGlue(';');
- $this->assertEquals('foo; Foo; bar', (string) $i);
- }
-
- public function testNormalizesGluedHeaders()
- {
- $h = new Header('Zoo', array('foo, Faz', 'bar'));
- $result = $h->normalize(true)->toArray();
- natsort($result);
- $this->assertEquals(array('bar', 'foo', 'Faz'), $result);
- }
-
- public function testCanSearchForValues()
- {
- $h = new Header('Zoo', $this->test);
- $this->assertTrue($h->hasValue('foo'));
- $this->assertTrue($h->hasValue('Foo'));
- $this->assertTrue($h->hasValue('bar'));
- $this->assertFalse($h->hasValue('moo'));
- $this->assertFalse($h->hasValue('FoO'));
- }
-
- public function testIsCountable()
- {
- $h = new Header('Zoo', $this->test);
- $this->assertEquals(3, count($h));
- }
-
- public function testCanBeIterated()
- {
- $h = new Header('Zoo', $this->test);
- $results = array();
- foreach ($h as $key => $value) {
- $results[$key] = $value;
- }
- $this->assertEquals(array(
- 'foo', 'Foo', 'bar'
- ), $results);
- }
-
- public function testAllowsFalseyValues()
- {
- // Allows 0
- $h = new Header('Foo', 0, ';');
- $this->assertEquals('0', (string) $h);
- $this->assertEquals(1, count($h));
- $this->assertEquals(';', $h->getGlue());
-
- // Does not add a null header by default
- $h = new Header('Foo');
- $this->assertEquals('', (string) $h);
- $this->assertEquals(0, count($h));
-
- // Allows null array for a single null header
- $h = new Header('Foo', array(null));
- $this->assertEquals('', (string) $h);
-
- // Allows empty string
- $h = new Header('Foo', '');
- $this->assertEquals('', (string) $h);
- $this->assertEquals(1, count($h));
- $this->assertEquals(1, count($h->normalize()->toArray()));
- }
-
- public function testCanRemoveValues()
- {
- $h = new Header('Foo', array('Foo', 'baz', 'bar'));
- $h->removeValue('bar');
- $this->assertTrue($h->hasValue('Foo'));
- $this->assertFalse($h->hasValue('bar'));
- $this->assertTrue($h->hasValue('baz'));
- }
-
- public function testAllowsArrayInConstructor()
- {
- $h = new Header('Foo', array('Testing', '123', 'Foo=baz'));
- $this->assertEquals(array('Testing', '123', 'Foo=baz'), $h->toArray());
- }
-
- public function parseParamsProvider()
- {
- $res1 = array(
- array(
- '' => '',
- 'rel' => 'front',
- 'type' => 'image/jpeg',
- ),
- array(
- '' => '',
- 'rel' => 'back',
- 'type' => 'image/jpeg',
- ),
- );
-
- return array(
- array(
- '; rel="front"; type="image/jpeg", ; rel=back; type="image/jpeg"',
- $res1
- ),
- array(
- '; rel="front"; type="image/jpeg",; rel=back; type="image/jpeg"',
- $res1
- ),
- array(
- 'foo="baz"; bar=123, boo, test="123", foobar="foo;bar"',
- array(
- array('foo' => 'baz', 'bar' => '123'),
- array('boo' => ''),
- array('test' => '123'),
- array('foobar' => 'foo;bar')
- )
- ),
- array(
- '; rel="side"; type="image/jpeg",; rel=side; type="image/jpeg"',
- array(
- array('' => '', 'rel' => 'side', 'type' => 'image/jpeg'),
- array('' => '', 'rel' => 'side', 'type' => 'image/jpeg')
- )
- ),
- array(
- '',
- array()
- )
- );
- }
-
- /**
- * @dataProvider parseParamsProvider
- */
- public function testParseParams($header, $result)
- {
- $response = new Response(200, array('Link' => $header));
- $this->assertEquals($result, $response->getHeader('Link')->parseParams());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/PostFileTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/PostFileTest.php
deleted file mode 100644
index be048cb..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/PostFileTest.php
+++ /dev/null
@@ -1,88 +0,0 @@
-assertEquals('foo', $file->getFieldName());
- $this->assertEquals(__FILE__, $file->getFilename());
- $this->assertEquals('boo', $file->getPostName());
- $this->assertEquals('x-foo', $file->getContentType());
- }
-
- public function testRemovesLeadingAtSymbolFromPath()
- {
- $file = new PostFile('foo', '@' . __FILE__);
- $this->assertEquals(__FILE__, $file->getFilename());
- }
-
- /**
- * @expectedException Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testEnsuresFileIsReadable()
- {
- $file = new PostFile('foo', '/foo/baz/bar');
- }
-
- public function testCanChangeContentType()
- {
- $file = new PostFile('foo', '@' . __FILE__);
- $file->setContentType('Boo');
- $this->assertEquals('Boo', $file->getContentType());
- }
-
- public function testCanChangeFieldName()
- {
- $file = new PostFile('foo', '@' . __FILE__);
- $file->setFieldName('Boo');
- $this->assertEquals('Boo', $file->getFieldName());
- }
-
- public function testReturnsCurlValueString()
- {
- $file = new PostFile('foo', __FILE__);
- if (version_compare(phpversion(), '5.5.0', '<')) {
- $this->assertContains('@' . __FILE__ . ';filename=PostFileTest.php;type=text/x-', $file->getCurlValue());
- } else {
- $c = $file->getCurlValue();
- $this->assertEquals(__FILE__, $c->getFilename());
- $this->assertEquals('PostFileTest.php', $c->getPostFilename());
- $this->assertContains('text/x-', $c->getMimeType());
- }
- }
-
- public function testReturnsCurlValueStringAndPostname()
- {
- $file = new PostFile('foo', __FILE__, null, 'NewPostFileTest.php');
- if (version_compare(phpversion(), '5.5.0', '<')) {
- $this->assertContains('@' . __FILE__ . ';filename=NewPostFileTest.php;type=text/x-', $file->getCurlValue());
- } else {
- $c = $file->getCurlValue();
- $this->assertEquals(__FILE__, $c->getFilename());
- $this->assertEquals('NewPostFileTest.php', $c->getPostFilename());
- $this->assertContains('text/x-', $c->getMimeType());
- }
- }
-
- public function testContentDispositionFilePathIsStripped()
- {
- $this->getServer()->flush();
- $client = new Client($this->getServer()->getUrl());
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $request = $client->post()->addPostFile('file', __FILE__);
- $request->send();
- $requests = $this->getServer()->getReceivedRequests(false);
- $this->assertContains('POST / HTTP/1.1', $requests[0]);
- $this->assertContains('Content-Disposition: form-data; name="file"; filename="PostFileTest.php"', $requests[0]);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/RequestFactoryTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/RequestFactoryTest.php
deleted file mode 100644
index 80b8d54..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/RequestFactoryTest.php
+++ /dev/null
@@ -1,616 +0,0 @@
-assertSame($factory, RequestFactory::getInstance());
- }
-
- public function testCreatesNewGetRequests()
- {
- $request = RequestFactory::getInstance()->create('GET', 'http://www.google.com/');
- $this->assertInstanceOf('Guzzle\\Http\\Message\\MessageInterface', $request);
- $this->assertInstanceOf('Guzzle\\Http\\Message\\RequestInterface', $request);
- $this->assertInstanceOf('Guzzle\\Http\\Message\\Request', $request);
- $this->assertEquals('GET', $request->getMethod());
- $this->assertEquals('http', $request->getScheme());
- $this->assertEquals('http://www.google.com/', $request->getUrl());
- $this->assertEquals('www.google.com', $request->getHost());
- $this->assertEquals('/', $request->getPath());
- $this->assertEquals('/', $request->getResource());
-
- // Create a GET request with a custom receiving body
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $b = EntityBody::factory();
- $request = RequestFactory::getInstance()->create('GET', $this->getServer()->getUrl(), null, $b);
- $request->setClient(new Client());
- $response = $request->send();
- $this->assertSame($b, $response->getBody());
- }
-
- public function testCreatesPutRequests()
- {
- // Test using a string
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.google.com/path?q=1&v=2', null, 'Data');
- $this->assertInstanceOf('Guzzle\\Http\\Message\\EntityEnclosingRequest', $request);
- $this->assertEquals('PUT', $request->getMethod());
- $this->assertEquals('http', $request->getScheme());
- $this->assertEquals('http://www.google.com/path?q=1&v=2', $request->getUrl());
- $this->assertEquals('www.google.com', $request->getHost());
- $this->assertEquals('/path', $request->getPath());
- $this->assertEquals('/path?q=1&v=2', $request->getResource());
- $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $request->getBody());
- $this->assertEquals('Data', (string) $request->getBody());
- unset($request);
-
- // Test using an EntityBody
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.google.com/path?q=1&v=2', null, EntityBody::factory('Data'));
- $this->assertInstanceOf('Guzzle\\Http\\Message\\EntityEnclosingRequest', $request);
- $this->assertEquals('Data', (string) $request->getBody());
-
- // Test using a resource
- $resource = fopen('php://temp', 'w+');
- fwrite($resource, 'Data');
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.google.com/path?q=1&v=2', null, $resource);
- $this->assertInstanceOf('Guzzle\\Http\\Message\\EntityEnclosingRequest', $request);
- $this->assertEquals('Data', (string) $request->getBody());
-
- // Test using an object that can be cast as a string
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.google.com/path?q=1&v=2', null, Url::factory('http://www.example.com/'));
- $this->assertInstanceOf('Guzzle\\Http\\Message\\EntityEnclosingRequest', $request);
- $this->assertEquals('http://www.example.com/', (string) $request->getBody());
- }
-
- public function testCreatesHeadAndDeleteRequests()
- {
- $request = RequestFactory::getInstance()->create('DELETE', 'http://www.test.com/');
- $this->assertEquals('DELETE', $request->getMethod());
- $request = RequestFactory::getInstance()->create('HEAD', 'http://www.test.com/');
- $this->assertEquals('HEAD', $request->getMethod());
- }
-
- public function testCreatesOptionsRequests()
- {
- $request = RequestFactory::getInstance()->create('OPTIONS', 'http://www.example.com/');
- $this->assertEquals('OPTIONS', $request->getMethod());
- $this->assertInstanceOf('Guzzle\\Http\\Message\\EntityEnclosingRequest', $request);
- }
-
- public function testCreatesNewPutRequestWithBody()
- {
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.google.com/path?q=1&v=2', null, 'Data');
- $this->assertEquals('Data', (string) $request->getBody());
- }
-
- public function testCreatesNewPostRequestWithFields()
- {
- // Use an array
- $request = RequestFactory::getInstance()->create('POST', 'http://www.google.com/path?q=1&v=2', null, array(
- 'a' => 'b'
- ));
- $this->assertEquals(array('a' => 'b'), $request->getPostFields()->getAll());
- unset($request);
-
- // Use a collection
- $request = RequestFactory::getInstance()->create('POST', 'http://www.google.com/path?q=1&v=2', null, new Collection(array(
- 'a' => 'b'
- )));
- $this->assertEquals(array('a' => 'b'), $request->getPostFields()->getAll());
-
- // Use a QueryString
- $request = RequestFactory::getInstance()->create('POST', 'http://www.google.com/path?q=1&v=2', null, new QueryString(array(
- 'a' => 'b'
- )));
- $this->assertEquals(array('a' => 'b'), $request->getPostFields()->getAll());
-
- $request = RequestFactory::getInstance()->create('POST', 'http://www.test.com/', null, array(
- 'a' => 'b',
- 'file' => '@' . __FILE__
- ));
-
- $this->assertEquals(array(
- 'a' => 'b'
- ), $request->getPostFields()->getAll());
-
- $files = $request->getPostFiles();
- $this->assertInstanceOf('Guzzle\Http\Message\PostFile', $files['file'][0]);
- }
-
- public function testCreatesFromParts()
- {
- $parts = parse_url('http://michael:123@www.google.com:8080/path?q=1&v=2');
-
- $request = RequestFactory::getInstance()->fromParts('PUT', $parts, null, 'Data');
- $this->assertInstanceOf('Guzzle\\Http\\Message\\EntityEnclosingRequest', $request);
- $this->assertEquals('PUT', $request->getMethod());
- $this->assertEquals('http', $request->getScheme());
- $this->assertEquals('http://www.google.com:8080/path?q=1&v=2', $request->getUrl());
- $this->assertEquals('www.google.com', $request->getHost());
- $this->assertEquals('www.google.com:8080', $request->getHeader('Host'));
- $this->assertEquals('/path', $request->getPath());
- $this->assertEquals('/path?q=1&v=2', $request->getResource());
- $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $request->getBody());
- $this->assertEquals('Data', (string) $request->getBody());
- $this->assertEquals('michael', $request->getUsername());
- $this->assertEquals('123', $request->getPassword());
- $this->assertEquals('8080', $request->getPort());
- $this->assertEquals(array(
- 'scheme' => 'http',
- 'host' => 'www.google.com',
- 'port' => 8080,
- 'path' => '/path',
- 'query' => 'q=1&v=2',
- ), parse_url($request->getUrl()));
- }
-
- public function testCreatesFromMessage()
- {
- $auth = base64_encode('michael:123');
- $message = "PUT /path?q=1&v=2 HTTP/1.1\r\nHost: www.google.com:8080\r\nContent-Length: 4\r\nAuthorization: Basic {$auth}\r\n\r\nData";
- $request = RequestFactory::getInstance()->fromMessage($message);
- $this->assertInstanceOf('Guzzle\\Http\\Message\\EntityEnclosingRequest', $request);
- $this->assertEquals('PUT', $request->getMethod());
- $this->assertEquals('http', $request->getScheme());
- $this->assertEquals('http://www.google.com:8080/path?q=1&v=2', $request->getUrl());
- $this->assertEquals('www.google.com', $request->getHost());
- $this->assertEquals('www.google.com:8080', $request->getHeader('Host'));
- $this->assertEquals('/path', $request->getPath());
- $this->assertEquals('/path?q=1&v=2', $request->getResource());
- $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $request->getBody());
- $this->assertEquals('Data', (string) $request->getBody());
- $this->assertEquals("Basic {$auth}", (string) $request->getHeader('Authorization'));
- $this->assertEquals('8080', $request->getPort());
-
- // Test passing a blank message returns false
- $this->assertFalse($request = RequestFactory::getInstance()->fromMessage(''));
-
- // Test passing a url with no port
- $message = "PUT /path?q=1&v=2 HTTP/1.1\r\nHost: www.google.com\r\nContent-Length: 4\r\nAuthorization: Basic {$auth}\r\n\r\nData";
- $request = RequestFactory::getInstance()->fromMessage($message);
- $this->assertInstanceOf('Guzzle\\Http\\Message\\EntityEnclosingRequest', $request);
- $this->assertEquals('PUT', $request->getMethod());
- $this->assertEquals('http', $request->getScheme());
- $this->assertEquals('http://www.google.com/path?q=1&v=2', $request->getUrl());
- $this->assertEquals('www.google.com', $request->getHost());
- $this->assertEquals('/path', $request->getPath());
- $this->assertEquals('/path?q=1&v=2', $request->getResource());
- $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $request->getBody());
- $this->assertEquals('Data', (string) $request->getBody());
- $this->assertEquals("Basic {$auth}", (string) $request->getHeader('Authorization'));
- $this->assertEquals(80, $request->getPort());
- }
-
- public function testCreatesNewTraceRequest()
- {
- $request = RequestFactory::getInstance()->create('TRACE', 'http://www.google.com/');
- $this->assertFalse($request instanceof \Guzzle\Http\Message\EntityEnclosingRequest);
- $this->assertEquals('TRACE', $request->getMethod());
- }
-
- public function testCreatesProperTransferEncodingRequests()
- {
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.google.com/', array(
- 'Transfer-Encoding' => 'chunked'
- ), 'hello');
- $this->assertEquals('chunked', $request->getHeader('Transfer-Encoding'));
- $this->assertFalse($request->hasHeader('Content-Length'));
- }
-
- public function testProperlyDealsWithDuplicateHeaders()
- {
- $parser = new MessageParser();
-
- $message = "POST / http/1.1\r\n"
- . "DATE:Mon, 09 Sep 2011 23:36:00 GMT\r\n"
- . "host:host.foo.com\r\n"
- . "ZOO:abc\r\n"
- . "ZOO:123\r\n"
- . "ZOO:HI\r\n"
- . "zoo:456\r\n\r\n";
-
- $parts = $parser->parseRequest($message);
- $this->assertEquals(array (
- 'DATE' => 'Mon, 09 Sep 2011 23:36:00 GMT',
- 'host' => 'host.foo.com',
- 'ZOO' => array('abc', '123', 'HI'),
- 'zoo' => '456',
- ), $parts['headers']);
-
- $request = RequestFactory::getInstance()->fromMessage($message);
-
- $this->assertEquals(array(
- 'abc', '123', 'HI', '456'
- ), $request->getHeader('zoo')->toArray());
- }
-
- public function testCreatesHttpMessagesWithBodiesAndNormalizesLineEndings()
- {
- $message = "POST / http/1.1\r\n"
- . "Content-Type:application/x-www-form-urlencoded; charset=utf8\r\n"
- . "Date:Mon, 09 Sep 2011 23:36:00 GMT\r\n"
- . "Host:host.foo.com\r\n\r\n"
- . "foo=bar";
-
- $request = RequestFactory::getInstance()->fromMessage($message);
- $this->assertEquals('application/x-www-form-urlencoded; charset=utf8', (string) $request->getHeader('Content-Type'));
- $this->assertEquals('foo=bar', (string) $request->getBody());
-
- $message = "POST / http/1.1\n"
- . "Content-Type:application/x-www-form-urlencoded; charset=utf8\n"
- . "Date:Mon, 09 Sep 2011 23:36:00 GMT\n"
- . "Host:host.foo.com\n\n"
- . "foo=bar";
- $request = RequestFactory::getInstance()->fromMessage($message);
- $this->assertEquals('foo=bar', (string) $request->getBody());
-
- $message = "PUT / HTTP/1.1\r\nContent-Length: 0\r\n\r\n";
- $request = RequestFactory::getInstance()->fromMessage($message);
- $this->assertTrue($request->hasHeader('Content-Length'));
- $this->assertEquals(0, (string) $request->getHeader('Content-Length'));
- }
-
- public function testBugPathIncorrectlyHandled()
- {
- $message = "POST /foo\r\n\r\nBODY";
- $request = RequestFactory::getInstance()->fromMessage($message);
- $this->assertSame('POST', $request->getMethod());
- $this->assertSame('/foo', $request->getPath());
- $this->assertSame('BODY', (string) $request->getBody());
- }
-
- public function testHandlesChunkedTransferEncoding()
- {
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.foo.com/', array(
- 'Transfer-Encoding' => 'chunked'
- ), 'Test');
- $this->assertFalse($request->hasHeader('Content-Length'));
- $this->assertEquals('chunked', $request->getHeader('Transfer-Encoding'));
-
- $request = RequestFactory::getInstance()->create('POST', 'http://www.foo.com/', array(
- 'transfer-encoding' => 'chunked'
- ), array(
- 'foo' => 'bar'
- ));
-
- $this->assertFalse($request->hasHeader('Content-Length'));
- $this->assertEquals('chunked', $request->getHeader('Transfer-Encoding'));
- }
-
- public function testClonesRequestsWithMethodWithoutClient()
- {
- $f = RequestFactory::getInstance();
- $request = $f->create('GET', 'http://www.test.com', array('X-Foo' => 'Bar'));
- $request->getParams()->replace(array('test' => '123'));
- $request->getCurlOptions()->set('foo', 'bar');
- $cloned = $f->cloneRequestWithMethod($request, 'PUT');
- $this->assertEquals('PUT', $cloned->getMethod());
- $this->assertEquals('Bar', (string) $cloned->getHeader('X-Foo'));
- $this->assertEquals('http://www.test.com', $cloned->getUrl());
- // Ensure params are cloned and cleaned up
- $this->assertEquals(1, count($cloned->getParams()->getAll()));
- $this->assertEquals('123', $cloned->getParams()->get('test'));
- // Ensure curl options are cloned
- $this->assertEquals('bar', $cloned->getCurlOptions()->get('foo'));
- // Ensure event dispatcher is cloned
- $this->assertNotSame($request->getEventDispatcher(), $cloned->getEventDispatcher());
- }
-
- public function testClonesRequestsWithMethodWithClient()
- {
- $f = RequestFactory::getInstance();
- $client = new Client();
- $request = $client->put('http://www.test.com', array('Content-Length' => 4), 'test');
- $cloned = $f->cloneRequestWithMethod($request, 'GET');
- $this->assertEquals('GET', $cloned->getMethod());
- $this->assertNull($cloned->getHeader('Content-Length'));
- $this->assertEquals('http://www.test.com', $cloned->getUrl());
- $this->assertSame($request->getClient(), $cloned->getClient());
- }
-
- public function testClonesRequestsWithMethodWithClientWithEntityEnclosingChange()
- {
- $f = RequestFactory::getInstance();
- $client = new Client();
- $request = $client->put('http://www.test.com', array('Content-Length' => 4), 'test');
- $cloned = $f->cloneRequestWithMethod($request, 'POST');
- $this->assertEquals('POST', $cloned->getMethod());
- $this->assertEquals('test', (string) $cloned->getBody());
- }
-
- public function testCanDisableRedirects()
- {
- $this->getServer()->enqueue(array(
- "HTTP/1.1 307\r\nLocation: " . $this->getServer()->getUrl() . "\r\nContent-Length: 0\r\n\r\n"
- ));
- $client = new Client($this->getServer()->getUrl());
- $response = $client->get('/', array(), array('allow_redirects' => false))->send();
- $this->assertEquals(307, $response->getStatusCode());
- }
-
- public function testCanAddCookies()
- {
- $client = new Client($this->getServer()->getUrl());
- $request = $client->get('/', array(), array('cookies' => array('Foo' => 'Bar')));
- $this->assertEquals('Bar', $request->getCookie('Foo'));
- }
-
- public function testCanAddQueryString()
- {
- $request = RequestFactory::getInstance()->create('GET', 'http://foo.com', array(), null, array(
- 'query' => array('Foo' => 'Bar')
- ));
- $this->assertEquals('Bar', $request->getQuery()->get('Foo'));
- }
-
- public function testCanSetDefaultQueryString()
- {
- $request = new Request('GET', 'http://www.foo.com?test=abc');
- RequestFactory::getInstance()->applyOptions($request, array(
- 'query' => array('test' => '123', 'other' => 't123')
- ), RequestFactory::OPTIONS_AS_DEFAULTS);
- $this->assertEquals('abc', $request->getQuery()->get('test'));
- $this->assertEquals('t123', $request->getQuery()->get('other'));
- }
-
- public function testCanAddBasicAuth()
- {
- $request = RequestFactory::getInstance()->create('GET', 'http://foo.com', array(), null, array(
- 'auth' => array('michael', 'test')
- ));
- $this->assertEquals('michael', $request->getUsername());
- $this->assertEquals('test', $request->getPassword());
- }
-
- public function testCanAddDigestAuth()
- {
- $request = RequestFactory::getInstance()->create('GET', 'http://foo.com', array(), null, array(
- 'auth' => array('michael', 'test', 'digest')
- ));
- $this->assertEquals(CURLAUTH_DIGEST, $request->getCurlOptions()->get(CURLOPT_HTTPAUTH));
- $this->assertEquals('michael', $request->getUsername());
- $this->assertEquals('test', $request->getPassword());
- }
-
- public function testCanAddEvents()
- {
- $foo = null;
- $client = new Client();
- $client->addSubscriber(new MockPlugin(array(new Response(200))));
- $request = $client->get($this->getServer()->getUrl(), array(), array(
- 'events' => array(
- 'request.before_send' => function () use (&$foo) { $foo = true; }
- )
- ));
- $request->send();
- $this->assertTrue($foo);
- }
-
- public function testCanAddEventsWithPriority()
- {
- $foo = null;
- $client = new Client();
- $client->addSubscriber(new MockPlugin(array(new Response(200))));
- $request = $client->get($this->getServer()->getUrl(), array(), array(
- 'events' => array(
- 'request.before_send' => array(function () use (&$foo) { $foo = true; }, 100)
- )
- ));
- $request->send();
- $this->assertTrue($foo);
- }
-
- public function testCanAddPlugins()
- {
- $mock = new MockPlugin(array(
- new Response(200),
- new Response(200)
- ));
- $client = new Client();
- $client->addSubscriber($mock);
- $request = $client->get('/', array(), array(
- 'plugins' => array($mock)
- ));
- $request->send();
- }
-
- public function testCanDisableExceptions()
- {
- $client = new Client();
- $request = $client->get('/', array(), array(
- 'plugins' => array(new MockPlugin(array(new Response(500)))),
- 'exceptions' => false
- ));
- $this->assertEquals(500, $request->send()->getStatusCode());
- }
-
- public function testCanDisableExceptionsWithErrorListener()
- {
- $client = new Client();
- $client->getEventDispatcher()->addListener('request.error', function () {});
- $request = $client->get('/', array(), array(
- 'plugins' => array(new MockPlugin(array(new Response(500)))),
- 'exceptions' => false
- ));
- $this->assertEquals(500, $request->send()->getStatusCode());
- }
-
- public function testCanChangeSaveToLocation()
- {
- $r = EntityBody::factory();
- $client = new Client();
- $request = $client->get('/', array(), array(
- 'plugins' => array(new MockPlugin(array(new Response(200, array(), 'testing')))),
- 'save_to' => $r
- ));
- $request->send();
- $this->assertEquals('testing', (string) $r);
- }
-
- public function testCanSetProxy()
- {
- $client = new Client();
- $request = $client->get('/', array(), array('proxy' => '192.168.16.121'));
- $this->assertEquals('192.168.16.121', $request->getCurlOptions()->get(CURLOPT_PROXY));
- }
-
- public function testCanSetHeadersOption()
- {
- $client = new Client();
- $request = $client->get('/', array(), array('headers' => array('Foo' => 'Bar')));
- $this->assertEquals('Bar', (string) $request->getHeader('Foo'));
- }
-
- public function testCanSetDefaultHeadersOptions()
- {
- $request = new Request('GET', 'http://www.foo.com', array('Foo' => 'Bar'));
- RequestFactory::getInstance()->applyOptions($request, array(
- 'headers' => array('Foo' => 'Baz', 'Bam' => 't123')
- ), RequestFactory::OPTIONS_AS_DEFAULTS);
- $this->assertEquals('Bar', (string) $request->getHeader('Foo'));
- $this->assertEquals('t123', (string) $request->getHeader('Bam'));
- }
-
- public function testCanSetBodyOption()
- {
- $client = new Client();
- $request = $client->put('/', array(), null, array('body' => 'test'));
- $this->assertEquals('test', (string) $request->getBody());
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesBodyOption()
- {
- $client = new Client();
- $client->get('/', array(), array('body' => 'test'));
- }
-
- public function testCanSetTimeoutOption()
- {
- $client = new Client();
- $request = $client->get('/', array(), array('timeout' => 1.5));
- $this->assertEquals(1500, $request->getCurlOptions()->get(CURLOPT_TIMEOUT_MS));
- }
-
- public function testCanSetConnectTimeoutOption()
- {
- $client = new Client();
- $request = $client->get('/', array(), array('connect_timeout' => 1.5));
- $this->assertEquals(1500, $request->getCurlOptions()->get(CURLOPT_CONNECTTIMEOUT_MS));
- }
-
- public function testCanSetDebug()
- {
- $client = new Client();
- $request = $client->get('/', array(), array('debug' => true));
- $this->assertTrue($request->getCurlOptions()->get(CURLOPT_VERBOSE));
- }
-
- public function testCanSetVerifyToOff()
- {
- $client = new Client();
- $request = $client->get('/', array(), array('verify' => false));
- $this->assertNull($request->getCurlOptions()->get(CURLOPT_CAINFO));
- $this->assertSame(0, $request->getCurlOptions()->get(CURLOPT_SSL_VERIFYHOST));
- $this->assertFalse($request->getCurlOptions()->get(CURLOPT_SSL_VERIFYPEER));
- }
-
- public function testCanSetVerifyToOn()
- {
- $client = new Client();
- $request = $client->get('/', array(), array('verify' => true));
- $this->assertNotNull($request->getCurlOptions()->get(CURLOPT_CAINFO));
- $this->assertSame(2, $request->getCurlOptions()->get(CURLOPT_SSL_VERIFYHOST));
- $this->assertTrue($request->getCurlOptions()->get(CURLOPT_SSL_VERIFYPEER));
- }
-
- public function testCanSetVerifyToPath()
- {
- $client = new Client();
- $request = $client->get('/', array(), array('verify' => '/foo.pem'));
- $this->assertEquals('/foo.pem', $request->getCurlOptions()->get(CURLOPT_CAINFO));
- $this->assertSame(2, $request->getCurlOptions()->get(CURLOPT_SSL_VERIFYHOST));
- $this->assertTrue($request->getCurlOptions()->get(CURLOPT_SSL_VERIFYPEER));
- }
-
- public function inputValidation()
- {
- return array_map(function ($option) { return array($option); }, array(
- 'headers', 'query', 'cookies', 'auth', 'events', 'plugins', 'params'
- ));
- }
-
- /**
- * @dataProvider inputValidation
- * @expectedException \Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testValidatesInput($option)
- {
- $client = new Client();
- $client->get('/', array(), array($option => 'foo'));
- }
-
- public function testCanAddRequestParams()
- {
- $client = new Client();
- $request = $client->put('/', array(), null, array('params' => array('foo' => 'test')));
- $this->assertEquals('test', $request->getParams()->get('foo'));
- }
-
- public function testCanAddSslKey()
- {
- $client = new Client();
- $request = $client->get('/', array(), array('ssl_key' => '/foo.pem'));
- $this->assertEquals('/foo.pem', $request->getCurlOptions()->get(CURLOPT_SSLKEY));
- }
-
- public function testCanAddSslKeyPassword()
- {
- $client = new Client();
- $request = $client->get('/', array(), array('ssl_key' => array('/foo.pem', 'bar')));
- $this->assertEquals('/foo.pem', $request->getCurlOptions()->get(CURLOPT_SSLKEY));
- $this->assertEquals('bar', $request->getCurlOptions()->get(CURLOPT_SSLKEYPASSWD));
- }
-
- public function testCanAddSslCert()
- {
- $client = new Client();
- $request = $client->get('/', array(), array('cert' => '/foo.pem'));
- $this->assertEquals('/foo.pem', $request->getCurlOptions()->get(CURLOPT_SSLCERT));
- }
-
- public function testCanAddSslCertPassword()
- {
- $client = new Client();
- $request = $client->get('/', array(), array('cert' => array('/foo.pem', 'bar')));
- $this->assertEquals('/foo.pem', $request->getCurlOptions()->get(CURLOPT_SSLCERT));
- $this->assertEquals('bar', $request->getCurlOptions()->get(CURLOPT_SSLCERTPASSWD));
- }
-
- public function testCreatesBodyWithoutZeroString()
- {
- $request = RequestFactory::getInstance()->create('PUT', 'http://test.com', array(), '0');
- $this->assertSame('0', (string) $request->getBody());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/RequestTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/RequestTest.php
deleted file mode 100644
index 5bf6248..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/RequestTest.php
+++ /dev/null
@@ -1,639 +0,0 @@
-client = new Client($this->getServer()->getUrl());
- $this->request = $this->client->get();
- }
-
- public function tearDown()
- {
- unset($this->request);
- unset($this->client);
- }
-
- public function testConstructorBuildsRequestWithArrayHeaders()
- {
- // Test passing an array of headers
- $request = new Request('GET', 'http://www.guzzle-project.com/', array(
- 'foo' => 'bar'
- ));
-
- $this->assertEquals('GET', $request->getMethod());
- $this->assertEquals('http://www.guzzle-project.com/', $request->getUrl());
- $this->assertEquals('bar', $request->getHeader('foo'));
- }
-
- public function testDescribesEvents()
- {
- $this->assertInternalType('array', Request::getAllEvents());
- }
-
- public function testConstructorBuildsRequestWithCollectionHeaders()
- {
- $request = new Request('GET', 'http://www.guzzle-project.com/', new Collection(array(
- 'foo' => 'bar'
- )));
- $this->assertEquals('bar', $request->getHeader('foo'));
- }
-
- public function testConstructorBuildsRequestWithNoHeaders()
- {
- $request = new Request('GET', 'http://www.guzzle-project.com/', null);
- $this->assertFalse($request->hasHeader('foo'));
- }
-
- public function testConstructorHandlesNonBasicAuth()
- {
- $request = new Request('GET', 'http://www.guzzle-project.com/', array(
- 'Authorization' => 'Foo bar'
- ));
- $this->assertNull($request->getUserName());
- $this->assertNull($request->getPassword());
- $this->assertEquals('Foo bar', (string) $request->getHeader('Authorization'));
- }
-
- public function testRequestsCanBeConvertedToRawMessageStrings()
- {
- $auth = base64_encode('michael:123');
- $message = "PUT /path?q=1&v=2 HTTP/1.1\r\n"
- . "Host: www.google.com\r\n"
- . "Authorization: Basic {$auth}\r\n"
- . "Content-Length: 4\r\n\r\nData";
-
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.google.com/path?q=1&v=2', array(
- 'Authorization' => 'Basic ' . $auth
- ), 'Data');
-
- $this->assertEquals($message, $request->__toString());
- }
-
- /**
- * Add authorization after the fact and see that it was put in the message
- */
- public function testRequestStringsIncludeAuth()
- {
- $auth = base64_encode('michael:123');
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $request = RequestFactory::getInstance()->create('PUT', $this->getServer()->getUrl(), null, 'Data')
- ->setClient($this->client)
- ->setAuth('michael', '123', CURLAUTH_BASIC);
- $request->send();
-
- $this->assertContains('Authorization: Basic ' . $auth, (string) $request);
- }
-
- public function testGetEventDispatcher()
- {
- $d = $this->request->getEventDispatcher();
- $this->assertInstanceOf('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface', $d);
- $this->assertEquals($d, $this->request->getEventDispatcher());
- }
-
- public function testRequestsManageClients()
- {
- $request = new Request('GET', 'http://test.com');
- $this->assertNull($request->getClient());
- $request->setClient($this->client);
- $this->assertSame($this->client, $request->getClient());
- }
-
- /**
- * @expectedException \RuntimeException
- * @expectedExceptionMessage A client must be set on the request
- */
- public function testRequestsRequireClients()
- {
- $request = new Request('GET', 'http://test.com');
- $request->send();
- }
-
- public function testSend()
- {
- $response = new Response(200, array(
- 'Content-Length' => 3
- ), 'abc');
- $this->request->setResponse($response, true);
- $r = $this->request->send();
-
- $this->assertSame($response, $r);
- $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $this->request->getResponse());
- $this->assertSame($r, $this->request->getResponse());
- $this->assertEquals('complete', $this->request->getState());
- }
-
- public function testGetResponse()
- {
- $this->assertNull($this->request->getResponse());
- $response = new Response(200, array('Content-Length' => 3), 'abc');
-
- $this->request->setResponse($response);
- $this->assertEquals($response, $this->request->getResponse());
-
- $client = new Client('http://www.google.com');
- $request = $client->get('http://www.google.com/');
- $request->setResponse($response, true);
- $request->send();
- $requestResponse = $request->getResponse();
- $this->assertSame($response, $requestResponse);
-
- // Try again, making sure it's still the same response
- $this->assertSame($requestResponse, $request->getResponse());
-
- $response = new Response(204);
- $request = $client->get();
- $request->setResponse($response, true);
- $request->send();
- $requestResponse = $request->getResponse();
- $this->assertSame($response, $requestResponse);
- $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $response->getBody());
- }
-
- public function testRequestThrowsExceptionOnBadResponse()
- {
- try {
- $this->request->setResponse(new Response(404, array('Content-Length' => 3), 'abc'), true);
- $this->request->send();
- $this->fail('Expected exception not thrown');
- } catch (BadResponseException $e) {
- $this->assertInstanceOf('Guzzle\\Http\\Message\\RequestInterface', $e->getRequest());
- $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $e->getResponse());
- $this->assertContains('Client error response', $e->getMessage());
- }
- }
-
- public function testManagesQuery()
- {
- $this->assertInstanceOf('Guzzle\\Http\\QueryString', $this->request->getQuery());
- $this->request->getQuery()->set('test', '123');
- $this->assertEquals('test=123', $this->request->getQuery(true));
- }
-
- public function testRequestHasMethod()
- {
- $this->assertEquals('GET', $this->request->getMethod());
- }
-
- public function testRequestHasScheme()
- {
- $this->assertEquals('http', $this->request->getScheme());
- $this->assertEquals($this->request, $this->request->setScheme('https'));
- $this->assertEquals('https', $this->request->getScheme());
- }
-
- public function testRequestHasHost()
- {
- $this->assertEquals('127.0.0.1', $this->request->getHost());
- $this->assertEquals('127.0.0.1:8124', (string) $this->request->getHeader('Host'));
-
- $this->assertSame($this->request, $this->request->setHost('www2.google.com'));
- $this->assertEquals('www2.google.com', $this->request->getHost());
- $this->assertEquals('www2.google.com:8124', (string) $this->request->getHeader('Host'));
-
- $this->assertSame($this->request, $this->request->setHost('www.test.com:8081'));
- $this->assertEquals('www.test.com', $this->request->getHost());
- $this->assertEquals(8081, $this->request->getPort());
- }
-
- public function testRequestHasProtocol()
- {
- $this->assertEquals('1.1', $this->request->getProtocolVersion());
- $this->assertEquals($this->request, $this->request->setProtocolVersion('1.1'));
- $this->assertEquals('1.1', $this->request->getProtocolVersion());
- $this->assertEquals($this->request, $this->request->setProtocolVersion('1.0'));
- $this->assertEquals('1.0', $this->request->getProtocolVersion());
- }
-
- public function testRequestHasPath()
- {
- $this->assertEquals('/', $this->request->getPath());
- $this->assertEquals($this->request, $this->request->setPath('/index.html'));
- $this->assertEquals('/index.html', $this->request->getPath());
- $this->assertEquals($this->request, $this->request->setPath('index.html'));
- $this->assertEquals('/index.html', $this->request->getPath());
- }
-
- public function testPermitsFalsyComponents()
- {
- $request = new Request('GET', 'http://0/0?0');
- $this->assertSame('0', $request->getHost());
- $this->assertSame('/0', $request->getPath());
- $this->assertSame('0', $request->getQuery(true));
-
- $request = new Request('GET', '0');
- $this->assertEquals('/0', $request->getPath());
- }
-
- public function testRequestHasPort()
- {
- $this->assertEquals(8124, $this->request->getPort());
- $this->assertEquals('127.0.0.1:8124', $this->request->getHeader('Host'));
-
- $this->assertEquals($this->request, $this->request->setPort('8080'));
- $this->assertEquals('8080', $this->request->getPort());
- $this->assertEquals('127.0.0.1:8080', $this->request->getHeader('Host'));
-
- $this->request->setPort(80);
- $this->assertEquals('127.0.0.1', $this->request->getHeader('Host'));
- }
-
- public function testRequestHandlesAuthorization()
- {
- // Uninitialized auth
- $this->assertEquals(null, $this->request->getUsername());
- $this->assertEquals(null, $this->request->getPassword());
-
- // Set an auth
- $this->assertSame($this->request, $this->request->setAuth('michael', '123'));
- $this->assertEquals('michael', $this->request->getUsername());
- $this->assertEquals('123', $this->request->getPassword());
-
- // Set an auth with blank password
- $this->assertSame($this->request, $this->request->setAuth('michael', ''));
- $this->assertEquals('michael', $this->request->getUsername());
- $this->assertEquals('', $this->request->getPassword());
-
- // Remove the auth
- $this->request->setAuth(false);
- $this->assertEquals(null, $this->request->getUsername());
- $this->assertEquals(null, $this->request->getPassword());
-
- // Make sure that the cURL based auth works too
- $request = new Request('GET', $this->getServer()->getUrl());
- $request->setAuth('michael', 'password', CURLAUTH_DIGEST);
- $this->assertEquals('michael:password', $request->getCurlOptions()->get(CURLOPT_USERPWD));
- $this->assertEquals(CURLAUTH_DIGEST, $request->getCurlOptions()->get(CURLOPT_HTTPAUTH));
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testValidatesAuth()
- {
- $this->request->setAuth('foo', 'bar', 'bam');
- }
-
- public function testGetResourceUri()
- {
- $this->assertEquals('/', $this->request->getResource());
- $this->request->setPath('/index.html');
- $this->assertEquals('/index.html', $this->request->getResource());
- $this->request->getQuery()->add('v', '1');
- $this->assertEquals('/index.html?v=1', $this->request->getResource());
- }
-
- public function testRequestHasMutableUrl()
- {
- $url = 'http://www.test.com:8081/path?q=123#fragment';
- $u = Url::factory($url);
- $this->assertSame($this->request, $this->request->setUrl($url));
- $this->assertEquals($url, $this->request->getUrl());
-
- $this->assertSame($this->request, $this->request->setUrl($u));
- $this->assertEquals($url, $this->request->getUrl());
- }
-
- public function testRequestHasState()
- {
- $this->assertEquals(RequestInterface::STATE_NEW, $this->request->getState());
- $this->request->setState(RequestInterface::STATE_TRANSFER);
- $this->assertEquals(RequestInterface::STATE_TRANSFER, $this->request->getState());
- }
-
- public function testSetManualResponse()
- {
- $response = new Response(200, array(
- 'Date' => 'Sat, 16 Oct 2010 17:27:14 GMT',
- 'Expires' => '-1',
- 'Cache-Control' => 'private, max-age=0',
- 'Content-Type' => 'text/html; charset=ISO-8859-1',
- ), 'response body');
-
- $this->assertSame($this->request, $this->request->setResponse($response), '-> setResponse() must use a fluent interface');
- $this->assertEquals('complete', $this->request->getState(), '-> setResponse() must change the state of the request to complete');
- $this->assertSame($response, $this->request->getResponse(), '-> setResponse() must set the exact same response that was passed in to it');
- }
-
- public function testRequestCanHaveManuallySetResponseBody()
- {
- $file = __DIR__ . '/../../TestData/temp.out';
- if (file_exists($file)) {
- unlink($file);
- }
-
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata");
- $request = RequestFactory::getInstance()->create('GET', $this->getServer()->getUrl());
- $request->setClient($this->client);
- $entityBody = EntityBody::factory(fopen($file, 'w+'));
- $request->setResponseBody($entityBody);
- $response = $request->send();
- $this->assertSame($entityBody, $response->getBody());
-
- $this->assertTrue(file_exists($file));
- $this->assertEquals('data', file_get_contents($file));
- unlink($file);
-
- $this->assertEquals('data', $response->getBody(true));
- }
-
- public function testHoldsCookies()
- {
- $this->assertNull($this->request->getCookie('test'));
-
- // Set a cookie
- $this->assertSame($this->request, $this->request->addCookie('test', 'abc'));
- $this->assertEquals('abc', $this->request->getCookie('test'));
-
- // Multiple cookies by setting the Cookie header
- $this->request->setHeader('Cookie', '__utma=1.638370270.1344367610.1374365610.1944450276.2; __utmz=1.1346368610.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); hl=de; PHPSESSID=ak93pqashi5uubuoq8fjv60897');
- $this->assertEquals('1.638370270.1344367610.1374365610.1944450276.2', $this->request->getCookie('__utma'));
- $this->assertEquals('1.1346368610.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)', $this->request->getCookie('__utmz'));
- $this->assertEquals('de', $this->request->getCookie('hl'));
- $this->assertEquals('ak93pqashi5uubuoq8fjv60897', $this->request->getCookie('PHPSESSID'));
-
- // Unset the cookies by setting the Cookie header to null
- $this->request->setHeader('Cookie', null);
- $this->assertNull($this->request->getCookie('test'));
- $this->request->removeHeader('Cookie');
-
- // Set and remove a cookie
- $this->assertSame($this->request, $this->request->addCookie('test', 'abc'));
- $this->assertEquals('abc', $this->request->getCookie('test'));
- $this->assertSame($this->request, $this->request->removeCookie('test'));
- $this->assertNull($this->request->getCookie('test'));
-
- // Remove the cookie header
- $this->assertSame($this->request, $this->request->addCookie('test', 'abc'));
- $this->request->removeHeader('Cookie');
- $this->assertEquals('', (string) $this->request->getHeader('Cookie'));
-
- // Remove a cookie value
- $this->request->addCookie('foo', 'bar')->addCookie('baz', 'boo');
- $this->request->removeCookie('foo');
- $this->assertEquals(array(
- 'baz' => 'boo'
- ), $this->request->getCookies());
-
- $this->request->addCookie('foo', 'bar');
- $this->assertEquals('baz=boo; foo=bar', (string) $this->request->getHeader('Cookie'));
- }
-
- /**
- * @expectedException \Guzzle\Http\Exception\RequestException
- * @expectedExceptionMessage Error completing request
- */
- public function testRequestThrowsExceptionWhenSetToCompleteWithNoResponse()
- {
- $this->request->setState(RequestInterface::STATE_COMPLETE);
- }
-
- public function testClonedRequestsUseNewInternalState()
- {
- $p = new AsyncPlugin();
- $this->request->getEventDispatcher()->addSubscriber($p);
- $h = $this->request->getHeader('Host');
-
- $r = clone $this->request;
- $this->assertEquals(RequestInterface::STATE_NEW, $r->getState());
- $this->assertNotSame($r->getQuery(), $this->request->getQuery());
- $this->assertNotSame($r->getCurlOptions(), $this->request->getCurlOptions());
- $this->assertNotSame($r->getEventDispatcher(), $this->request->getEventDispatcher());
- $this->assertEquals($r->getHeaders(), $this->request->getHeaders());
- $this->assertNotSame($h, $r->getHeader('Host'));
- $this->assertNotSame($r->getParams(), $this->request->getParams());
- $this->assertTrue($this->request->getEventDispatcher()->hasListeners('request.sent'));
- }
-
- public function testRecognizesBasicAuthCredentialsInUrls()
- {
- $this->request->setUrl('http://michael:test@test.com/');
- $this->assertEquals('michael', $this->request->getUsername());
- $this->assertEquals('test', $this->request->getPassword());
- }
-
- public function testRequestCanBeSentUsingCurl()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\nContent-Length: 4\r\nExpires: Thu, 01 Dec 1994 16:00:00 GMT\r\nConnection: close\r\n\r\ndata",
- "HTTP/1.1 200 OK\r\nContent-Length: 4\r\nExpires: Thu, 01 Dec 1994 16:00:00 GMT\r\nConnection: close\r\n\r\ndata",
- "HTTP/1.1 404 Not Found\r\nContent-Encoding: application/xml\r\nContent-Length: 48\r\n\r\nFile not found "
- ));
-
- $request = RequestFactory::getInstance()->create('GET', $this->getServer()->getUrl());
- $request->setClient($this->client);
- $response = $request->send();
-
- $this->assertEquals('data', $response->getBody(true));
- $this->assertEquals(200, (int) $response->getStatusCode());
- $this->assertEquals('OK', $response->getReasonPhrase());
- $this->assertEquals(4, $response->getContentLength());
- $this->assertEquals('Thu, 01 Dec 1994 16:00:00 GMT', $response->getExpires());
-
- // Test that the same handle can be sent twice without setting state to new
- $response2 = $request->send();
- $this->assertNotSame($response, $response2);
-
- try {
- $request = RequestFactory::getInstance()->create('GET', $this->getServer()->getUrl() . 'index.html');
- $request->setClient($this->client);
- $response = $request->send();
- $this->fail('Request did not receive a 404 response');
- } catch (BadResponseException $e) {
- }
-
- $requests = $this->getServer()->getReceivedRequests(true);
- $messages = $this->getServer()->getReceivedRequests(false);
- $port = $this->getServer()->getPort();
-
- $userAgent = $this->client->getDefaultUserAgent();
-
- $this->assertEquals('127.0.0.1:' . $port, $requests[0]->getHeader('Host'));
- $this->assertEquals('127.0.0.1:' . $port, $requests[1]->getHeader('Host'));
- $this->assertEquals('127.0.0.1:' . $port, $requests[2]->getHeader('Host'));
-
- $this->assertEquals('/', $requests[0]->getPath());
- $this->assertEquals('/', $requests[1]->getPath());
- $this->assertEquals('/index.html', $requests[2]->getPath());
-
- $parts = explode("\r\n", $messages[0]);
- $this->assertEquals('GET / HTTP/1.1', $parts[0]);
-
- $parts = explode("\r\n", $messages[1]);
- $this->assertEquals('GET / HTTP/1.1', $parts[0]);
-
- $parts = explode("\r\n", $messages[2]);
- $this->assertEquals('GET /index.html HTTP/1.1', $parts[0]);
- }
-
- public function testThrowsExceptionsWhenUnsuccessfulResponseIsReceivedByDefault()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 404 Not found\r\nContent-Length: 0\r\n\r\n");
-
- try {
- $request = $this->client->get('/index.html');
- $response = $request->send();
- $this->fail('Request did not receive a 404 response');
- } catch (BadResponseException $e) {
- $this->assertContains('Client error response', $e->getMessage());
- $this->assertContains('[status code] 404', $e->getMessage());
- $this->assertContains('[reason phrase] Not found', $e->getMessage());
- }
- }
-
- public function testCanShortCircuitErrorHandling()
- {
- $request = $this->request;
- $response = new Response(404);
- $request->setResponse($response, true);
- $out = '';
- $that = $this;
- $request->getEventDispatcher()->addListener('request.error', function($event) use (&$out, $that) {
- $out .= $event['request'] . "\n" . $event['response'] . "\n";
- $event->stopPropagation();
- });
- $request->send();
- $this->assertContains((string) $request, $out);
- $this->assertContains((string) $request->getResponse(), $out);
- $this->assertSame($response, $request->getResponse());
- }
-
- public function testCanOverrideUnsuccessfulResponses()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 404 NOT FOUND\r\n" .
- "Content-Length: 0\r\n" .
- "\r\n",
- "HTTP/1.1 200 OK\r\n" .
- "Content-Length: 0\r\n" .
- "\r\n"
- ));
-
- $newResponse = null;
-
- $request = $this->request;
- $request->getEventDispatcher()->addListener('request.error', function($event) use (&$newResponse) {
- if ($event['response']->getStatusCode() == 404) {
- $newRequest = clone $event['request'];
- $newResponse = $newRequest->send();
- // Override the original response and bypass additional response processing
- $event['response'] = $newResponse;
- // Call $event['request']->setResponse($newResponse); to re-apply events
- $event->stopPropagation();
- }
- });
-
- $request->send();
-
- $this->assertEquals(200, $request->getResponse()->getStatusCode());
- $this->assertSame($newResponse, $request->getResponse());
- $this->assertEquals(2, count($this->getServer()->getReceivedRequests()));
- }
-
- public function testCanRetrieveUrlObject()
- {
- $request = new Request('GET', 'http://www.example.com/foo?abc=d');
- $this->assertInstanceOf('Guzzle\Http\Url', $request->getUrl(true));
- $this->assertEquals('http://www.example.com/foo?abc=d', $request->getUrl());
- $this->assertEquals('http://www.example.com/foo?abc=d', (string) $request->getUrl(true));
- }
-
- public function testUnresolvedRedirectsReturnResponse()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 303 SEE OTHER\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Foo\r\nLocation: /foo\r\nContent-Length: 0\r\n\r\n"
- ));
- $request = $this->request;
- $this->assertEquals(303, $request->send()->getStatusCode());
- $request->getParams()->set(RedirectPlugin::DISABLE, true);
- $this->assertEquals(301, $request->send()->getStatusCode());
- }
-
- public function testCanSendCustomRequests()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $request = $this->client->createRequest('PROPFIND', $this->getServer()->getUrl(), array(
- 'Content-Type' => 'text/plain'
- ), 'foo');
- $response = $request->send();
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals('PROPFIND', $requests[0]->getMethod());
- $this->assertEquals(3, (string) $requests[0]->getHeader('Content-Length'));
- $this->assertEquals('foo', (string) $requests[0]->getBody());
- }
-
- /**
- * @expectedException \PHPUnit_Framework_Error_Warning
- */
- public function testEnsuresFileCanBeCreated()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest");
- $this->client->get('/')->setResponseBody('/wefwefefefefwewefwe/wefwefwefefwe/wefwefewfw.txt')->send();
- }
-
- public function testAllowsFilenameForDownloadingContent()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest");
- $name = sys_get_temp_dir() . '/foo.txt';
- $this->client->get('/')->setResponseBody($name)->send();
- $this->assertEquals('test', file_get_contents($name));
- unlink($name);
- }
-
- public function testUsesCustomResponseBodyWhenItIsCustom()
- {
- $en = EntityBody::factory();
- $request = $this->client->get();
- $request->setResponseBody($en);
- $request->setResponse(new Response(200, array(), 'foo'));
- $this->assertEquals('foo', (string) $en);
- }
-
- public function testCanChangePortThroughScheme()
- {
- $request = new Request('GET', 'http://foo.com');
- $request->setScheme('https');
- $this->assertEquals('https://foo.com', (string) $request->getUrl());
- $this->assertEquals('foo.com', $request->getHost());
- $request->setScheme('http');
- $this->assertEquals('http://foo.com', (string) $request->getUrl());
- $this->assertEquals('foo.com', $request->getHost());
- $request->setPort(null);
- $this->assertEquals('http://foo.com', (string) $request->getUrl());
- $this->assertEquals('foo.com', $request->getHost());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/ResponseTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/ResponseTest.php
deleted file mode 100644
index 08b4df8..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Message/ResponseTest.php
+++ /dev/null
@@ -1,677 +0,0 @@
-response = new Response(200, new Collection(array(
- 'Accept-Ranges' => 'bytes',
- 'Age' => '12',
- 'Allow' => 'GET, HEAD',
- 'Cache-Control' => 'no-cache',
- 'Content-Encoding' => 'gzip',
- 'Content-Language' => 'da',
- 'Content-Length' => '348',
- 'Content-Location' => '/index.htm',
- 'Content-Disposition' => 'attachment; filename=fname.ext',
- 'Content-MD5' => 'Q2hlY2sgSW50ZWdyaXR5IQ==',
- 'Content-Range' => 'bytes 21010-47021/47022',
- 'Content-Type' => 'text/html; charset=utf-8',
- 'Date' => 'Tue, 15 Nov 1994 08:12:31 GMT',
- 'ETag' => '737060cd8c284d8af7ad3082f209582d',
- 'Expires' => 'Thu, 01 Dec 1994 16:00:00 GMT',
- 'Last-Modified' => 'Tue, 15 Nov 1994 12:45:26 GMT',
- 'Location' => 'http://www.w3.org/pub/WWW/People.html',
- 'Pragma' => 'no-cache',
- 'Proxy-Authenticate' => 'Basic',
- 'Retry-After' => '120',
- 'Server' => 'Apache/1.3.27 (Unix) (Red-Hat/Linux)',
- 'Set-Cookie' => 'UserID=JohnDoe; Max-Age=3600; Version=1',
- 'Trailer' => 'Max-Forwards',
- 'Transfer-Encoding' => 'chunked',
- 'Vary' => '*',
- 'Via' => '1.0 fred, 1.1 nowhere.com (Apache/1.1)',
- 'Warning' => '199 Miscellaneous warning',
- 'WWW-Authenticate' => 'Basic'
- )), 'body');
- }
-
- public function tearDown()
- {
- unset($this->response);
- }
-
- public function testConstructor()
- {
- $params = new Collection();
- $body = EntityBody::factory('');
- $response = new Response(200, $params, $body);
- $this->assertEquals(200, $response->getStatusCode());
- $this->assertEquals($body, $response->getBody());
- $this->assertEquals('OK', $response->getReasonPhrase());
- $this->assertEquals("HTTP/1.1 200 OK\r\n\r\n", $response->getRawHeaders());
-
- // Make sure Content-Length is set automatically
- $response = new Response(200, $params);
- $this->assertEquals("HTTP/1.1 200 OK\r\n\r\n", $response->getRawHeaders());
-
- // Pass bodies to the response
- $response = new Response(200, null, 'data');
- $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $response->getBody());
- $response = new Response(200, null, EntityBody::factory('data'));
- $this->assertInstanceOf('Guzzle\\Http\\EntityBody', $response->getBody());
- $this->assertEquals('data', $response->getBody(true));
- $response = new Response(200, null, '0');
- $this->assertSame('0', $response->getBody(true), 'getBody(true) should return "0" if response body is "0".');
-
- // Make sure the proper exception is thrown
- try {
- //$response = new Response(200, null, array('foo' => 'bar'));
- //$this->fail('Response did not throw exception when passing invalid body');
- } catch (HttpException $e) {
- }
-
- // Ensure custom codes can be set
- $response = new Response(2);
- $this->assertEquals(2, $response->getStatusCode());
- $this->assertEquals('', $response->getReasonPhrase());
-
- // Make sure the proper exception is thrown when sending invalid headers
- try {
- $response = new Response(200, 'adidas');
- $this->fail('Response did not throw exception when passing invalid $headers');
- } catch (BadResponseException $e) {
- }
- }
-
- public function test__toString()
- {
- $response = new Response(200);
- $this->assertEquals("HTTP/1.1 200 OK\r\n\r\n", (string) $response);
-
- // Add another header
- $response = new Response(200, array(
- 'X-Test' => 'Guzzle'
- ));
- $this->assertEquals("HTTP/1.1 200 OK\r\nX-Test: Guzzle\r\n\r\n", (string) $response);
-
- $response = new Response(200, array(
- 'Content-Length' => 4
- ), 'test');
- $this->assertEquals("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest", (string) $response);
- }
-
- public function testFactory()
- {
- $response = Response::fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest");
- $this->assertEquals(200, $response->getStatusCode());
- $this->assertEquals('OK', $response->getReasonPhrase());
- $this->assertEquals(4, (string) $response->getContentLength());
- $this->assertEquals('test', $response->getBody(true));
-
- // Make sure that automatic Content-Length works
- $response = Response::fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest");
- $this->assertEquals(4, (string) $response->getContentLength());
- $this->assertEquals('test', $response->getBody(true));
- }
-
- public function testFactoryCanCreateHeadResponses()
- {
- $response = Response::fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\n");
- $this->assertEquals(200, $response->getStatusCode());
- $this->assertEquals('OK', $response->getReasonPhrase());
- $this->assertEquals(4, (string) $response->getContentLength());
- $this->assertEquals('', $response->getBody(true));
- }
-
- public function testFactoryRequiresMessage()
- {
- $this->assertFalse(Response::fromMessage(''));
- }
-
- public function testGetBody()
- {
- $body = EntityBody::factory('');
- $response = new Response(403, new Collection(), $body);
- $this->assertEquals($body, $response->getBody());
- $response->setBody('foo');
- $this->assertEquals('foo', $response->getBody(true));
- }
-
- public function testManagesStatusCode()
- {
- $response = new Response(403);
- $this->assertEquals(403, $response->getStatusCode());
- }
-
- public function testGetMessage()
- {
- $response = new Response(200, new Collection(array(
- 'Content-Length' => 4
- )), 'body');
-
- $this->assertEquals("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\nbody", $response->getMessage());
- }
-
- public function testGetRawHeaders()
- {
- $response = new Response(200, new Collection(array(
- 'Keep-Alive' => 155,
- 'User-Agent' => 'Guzzle',
- 'Content-Length' => 4
- )), 'body');
-
- $this->assertEquals("HTTP/1.1 200 OK\r\nKeep-Alive: 155\r\nUser-Agent: Guzzle\r\nContent-Length: 4\r\n\r\n", $response->getRawHeaders());
- }
-
- public function testHandlesStatusAndStatusCodes()
- {
- $response = new Response(200, new Collection(), 'body');
- $this->assertEquals('OK', $response->getReasonPhrase());
-
- $this->assertSame($response, $response->setStatus(204));
- $this->assertEquals('No Content', $response->getReasonPhrase());
- $this->assertEquals(204, $response->getStatusCode());
-
- $this->assertSame($response, $response->setStatus(204, 'Testing!'));
- $this->assertEquals('Testing!', $response->getReasonPhrase());
- $this->assertEquals(204, $response->getStatusCode());
-
- $response->setStatus(2000);
- $this->assertEquals(2000, $response->getStatusCode());
- $this->assertEquals('', $response->getReasonPhrase());
-
- $response->setStatus(200, 'Foo');
- $this->assertEquals(200, $response->getStatusCode());
- $this->assertEquals('Foo', $response->getReasonPhrase());
- }
-
- public function testIsClientError()
- {
- $response = new Response(403);
- $this->assertTrue($response->isClientError());
- $response = new Response(200);
- $this->assertFalse($response->isClientError());
- }
-
- public function testIsError()
- {
- $response = new Response(403);
- $this->assertTrue($response->isError());
- $response = new Response(200);
- $this->assertFalse($response->isError());
- $response = new Response(500);
- $this->assertTrue($response->isError());
- }
-
- public function testIsInformational()
- {
- $response = new Response(100);
- $this->assertTrue($response->isInformational());
- $response = new Response(200);
- $this->assertFalse($response->isInformational());
- }
-
- public function testIsRedirect()
- {
- $response = new Response(301);
- $this->assertTrue($response->isRedirect());
- $response = new Response(200);
- $this->assertFalse($response->isRedirect());
- }
-
- public function testIsServerError()
- {
- $response = new Response(500);
- $this->assertTrue($response->isServerError());
- $response = new Response(400);
- $this->assertFalse($response->isServerError());
- }
-
- public function testIsSuccessful()
- {
- $response = new Response(200);
- $this->assertTrue($response->isSuccessful());
- $response = new Response(403);
- $this->assertFalse($response->isSuccessful());
- }
-
- public function testGetAcceptRanges()
- {
- $this->assertEquals('bytes', $this->response->getAcceptRanges());
- }
-
- public function testCalculatesAge()
- {
- $this->assertEquals(12, $this->response->calculateAge());
-
- $this->response->removeHeader('Age');
- $this->response->removeHeader('Date');
- $this->assertNull($this->response->calculateAge());
-
- $this->response->setHeader('Date', gmdate(ClientInterface::HTTP_DATE, strtotime('-1 minute')));
- // If the test runs slowly, still pass with a +5 second allowance
- $this->assertTrue($this->response->getAge() - 60 <= 5);
- }
-
- public function testGetAllow()
- {
- $this->assertEquals('GET, HEAD', $this->response->getAllow());
- }
-
- public function testGetCacheControl()
- {
- $this->assertEquals('no-cache', $this->response->getCacheControl());
- }
-
- public function testGetContentEncoding()
- {
- $this->assertEquals('gzip', $this->response->getContentEncoding());
- }
-
- public function testGetContentLanguage()
- {
- $this->assertEquals('da', $this->response->getContentLanguage());
- }
-
- public function testGetContentLength()
- {
- $this->assertEquals('348', $this->response->getContentLength());
- }
-
- public function testGetContentLocation()
- {
- $this->assertEquals('/index.htm', $this->response->getContentLocation());
- }
-
- public function testGetContentDisposition()
- {
- $this->assertEquals('attachment; filename=fname.ext', $this->response->getContentDisposition());
- }
-
- public function testGetContentMd5()
- {
- $this->assertEquals('Q2hlY2sgSW50ZWdyaXR5IQ==', $this->response->getContentMd5());
- }
-
- public function testGetContentRange()
- {
- $this->assertEquals('bytes 21010-47021/47022', $this->response->getContentRange());
- }
-
- public function testGetContentType()
- {
- $this->assertEquals('text/html; charset=utf-8', $this->response->getContentType());
- }
-
- public function testGetDate()
- {
- $this->assertEquals('Tue, 15 Nov 1994 08:12:31 GMT', $this->response->getDate());
- }
-
- public function testGetEtag()
- {
- $this->assertEquals('737060cd8c284d8af7ad3082f209582d', $this->response->getEtag());
- }
-
- public function testGetExpires()
- {
- $this->assertEquals('Thu, 01 Dec 1994 16:00:00 GMT', $this->response->getExpires());
- }
-
- public function testGetLastModified()
- {
- $this->assertEquals('Tue, 15 Nov 1994 12:45:26 GMT', $this->response->getLastModified());
- }
-
- public function testGetLocation()
- {
- $this->assertEquals('http://www.w3.org/pub/WWW/People.html', $this->response->getLocation());
- }
-
- public function testGetPragma()
- {
- $this->assertEquals('no-cache', $this->response->getPragma());
- }
-
- public function testGetProxyAuthenticate()
- {
- $this->assertEquals('Basic', $this->response->getProxyAuthenticate());
- }
-
- public function testGetServer()
- {
- $this->assertEquals('Apache/1.3.27 (Unix) (Red-Hat/Linux)', $this->response->getServer());
- }
-
- public function testGetSetCookie()
- {
- $this->assertEquals('UserID=JohnDoe; Max-Age=3600; Version=1', $this->response->getSetCookie());
- }
-
- public function testGetMultipleSetCookie()
- {
- $this->response->addHeader('Set-Cookie', 'UserID=Mike; Max-Age=200');
- $this->assertEquals(array(
- 'UserID=JohnDoe; Max-Age=3600; Version=1',
- 'UserID=Mike; Max-Age=200',
- ), $this->response->getHeader('Set-Cookie')->toArray());
- }
-
- public function testGetSetCookieNormalizesHeaders()
- {
- $this->response->addHeaders(array(
- 'Set-Cooke' => 'boo',
- 'set-cookie' => 'foo'
- ));
-
- $this->assertEquals(array(
- 'UserID=JohnDoe; Max-Age=3600; Version=1',
- 'foo'
- ), $this->response->getHeader('Set-Cookie')->toArray());
-
- $this->response->addHeaders(array(
- 'set-cookie' => 'fubu'
- ));
- $this->assertEquals(
- array('UserID=JohnDoe; Max-Age=3600; Version=1', 'foo', 'fubu'),
- $this->response->getHeader('Set-Cookie')->toArray()
- );
- }
-
- public function testGetTrailer()
- {
- $this->assertEquals('Max-Forwards', $this->response->getTrailer());
- }
-
- public function testGetTransferEncoding()
- {
- $this->assertEquals('chunked', $this->response->getTransferEncoding());
- }
-
- public function testGetVary()
- {
- $this->assertEquals('*', $this->response->getVary());
- }
-
- public function testReturnsViaHeader()
- {
- $this->assertEquals('1.0 fred, 1.1 nowhere.com (Apache/1.1)', $this->response->getVia());
- }
- public function testGetWarning()
- {
- $this->assertEquals('199 Miscellaneous warning', $this->response->getWarning());
- }
-
- public function testReturnsWwwAuthenticateHeader()
- {
- $this->assertEquals('Basic', $this->response->getWwwAuthenticate());
- }
-
- public function testReturnsConnectionHeader()
- {
- $this->assertEquals(null, $this->response->getConnection());
- $this->response->setHeader('Connection', 'close');
- $this->assertEquals('close', $this->response->getConnection());
- }
-
- public function testReturnsHeaders()
- {
- $this->assertEquals('Basic', $this->response->getHeader('WWW-Authenticate', null, true));
- $this->assertEquals('chunked', $this->response->getHeader('Transfer-Encoding', null, false));
- }
-
- public function testHasTransferInfo()
- {
- $stats = array (
- 'url' => 'http://www.google.com/',
- 'content_type' => 'text/html; charset=ISO-8859-1',
- 'http_code' => 200,
- 'header_size' => 606,
- 'request_size' => 53,
- 'filetime' => -1,
- 'ssl_verify_result' => 0,
- 'redirect_count' => 0,
- 'total_time' => 0.093284,
- 'namelookup_time' => 0.001349,
- 'connect_time' => 0.01635,
- 'pretransfer_time' => 0.016358,
- 'size_upload' => 0,
- 'size_download' => 10330,
- 'speed_download' => 110737,
- 'speed_upload' => 0,
- 'download_content_length' => -1,
- 'upload_content_length' => 0,
- 'starttransfer_time' => 0.07066,
- 'redirect_time' => 0,
- );
-
- // Uninitialized state
- $this->assertNull($this->response->getInfo('url'));
- $this->assertEquals(array(), $this->response->getInfo());
-
- // Set the stats
- $this->response->setInfo($stats);
- $this->assertEquals($stats, $this->response->getInfo());
- $this->assertEquals(606, $this->response->getInfo('header_size'));
- $this->assertNull($this->response->getInfo('does_not_exist'));
- }
-
- /**
- * @return Response
- */
- private function getResponse($code, array $headers = null, EntityBody $body = null)
- {
- return new Response($code, $headers, $body);
- }
-
- public function testDeterminesIfItCanBeCached()
- {
- $this->assertTrue($this->getResponse(200)->canCache());
- $this->assertTrue($this->getResponse(410)->canCache());
- $this->assertFalse($this->getResponse(404)->canCache());
- $this->assertTrue($this->getResponse(200, array(
- 'Cache-Control' => 'public'
- ))->canCache());
-
- // This has the no-store directive
- $this->assertFalse($this->getResponse(200, array(
- 'Cache-Control' => 'private, no-store'
- ))->canCache());
-
- // The body cannot be read, so it cannot be cached
- $tmp = tempnam('/tmp', 'not-readable');
- $resource = fopen($tmp, 'w');
- $this->assertFalse($this->getResponse(200, array(
- 'Transfer-Encoding' => 'chunked'
- ), EntityBody::factory($resource, 10))->canCache());
- unlink($tmp);
-
- // The body is 0 length, cannot be read, so it can be cached
- $tmp = tempnam('/tmp', 'not-readable');
- $resource = fopen($tmp, 'w');
- $this->assertTrue($this->getResponse(200, array(array(
- 'Content-Length' => 0
- )), EntityBody::factory($resource, 0))->canCache());
- unlink($tmp);
- }
-
- public function testDeterminesResponseMaxAge()
- {
- $this->assertEquals(null, $this->getResponse(200)->getMaxAge());
-
- // Uses the response's s-maxage
- $this->assertEquals(140, $this->getResponse(200, array(
- 'Cache-Control' => 's-maxage=140'
- ))->getMaxAge());
-
- // Uses the response's max-age
- $this->assertEquals(120, $this->getResponse(200, array(
- 'Cache-Control' => 'max-age=120'
- ))->getMaxAge());
-
- // Uses the response's max-age
- $this->assertEquals(120, $this->getResponse(200, array(
- 'Cache-Control' => 'max-age=120',
- 'Expires' => gmdate(ClientInterface::HTTP_DATE, strtotime('+1 day'))
- ))->getMaxAge());
-
- // Uses the Expires date
- $this->assertGreaterThanOrEqual(82400, $this->getResponse(200, array(
- 'Expires' => gmdate(ClientInterface::HTTP_DATE, strtotime('+1 day'))
- ))->getMaxAge());
-
- // Uses the Expires date
- $this->assertGreaterThanOrEqual(82400, $this->getResponse(200, array(
- 'Expires' => gmdate(ClientInterface::HTTP_DATE, strtotime('+1 day'))
- ))->getMaxAge());
- }
-
- public function testDeterminesIfItCanValidate()
- {
- $response = new Response(200);
- $this->assertFalse($response->canValidate());
- $response->setHeader('ETag', '123');
- $this->assertTrue($response->canValidate());
- $response->removeHeader('ETag');
- $this->assertFalse($response->canValidate());
- $response->setHeader('Last-Modified', '123');
- $this->assertTrue($response->canValidate());
- }
-
- public function testCalculatesFreshness()
- {
- $response = new Response(200);
- $this->assertNull($response->isFresh());
- $this->assertNull($response->getFreshness());
-
- $response->setHeader('Cache-Control', 'max-age=120');
- $response->setHeader('Age', 100);
- $this->assertEquals(20, $response->getFreshness());
- $this->assertTrue($response->isFresh());
-
- $response->setHeader('Age', 120);
- $this->assertEquals(0, $response->getFreshness());
- $this->assertTrue($response->isFresh());
-
- $response->setHeader('Age', 150);
- $this->assertEquals(-30, $response->getFreshness());
- $this->assertFalse($response->isFresh());
- }
-
- public function testHandlesProtocols()
- {
- $this->assertSame($this->response, $this->response->setProtocol('HTTP', '1.0'));
- $this->assertEquals('HTTP', $this->response->getProtocol());
- $this->assertEquals('1.0', $this->response->getProtocolVersion());
- }
-
- public function testComparesContentType()
- {
- $response = new Response(200, array(
- 'Content-Type' => 'text/html; charset=ISO-8859-4'
- ));
-
- $this->assertTrue($response->isContentType('text/html'));
- $this->assertTrue($response->isContentType('TExT/html'));
- $this->assertTrue($response->isContentType('charset=ISO-8859-4'));
- $this->assertFalse($response->isContentType('application/xml'));
- }
-
- public function testResponseDeterminesIfMethodIsAllowedBaseOnAllowHeader()
- {
- $response = new Response(200, array(
- 'Allow' => 'OPTIONS, POST, deletE,GET'
- ));
-
- $this->assertTrue($response->isMethodAllowed('get'));
- $this->assertTrue($response->isMethodAllowed('GET'));
- $this->assertTrue($response->isMethodAllowed('options'));
- $this->assertTrue($response->isMethodAllowed('post'));
- $this->assertTrue($response->isMethodAllowed('Delete'));
- $this->assertFalse($response->isMethodAllowed('put'));
- $this->assertFalse($response->isMethodAllowed('PUT'));
-
- $response = new Response(200);
- $this->assertFalse($response->isMethodAllowed('get'));
- }
-
- public function testParsesJsonResponses()
- {
- $response = new Response(200, array(), '{"foo": "bar"}');
- $this->assertEquals(array('foo' => 'bar'), $response->json());
- // Return array when null is a service response
- $response = new Response(200);
- $this->assertEquals(array(), $response->json());
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\RuntimeException
- * @expectedExceptionMessage Unable to parse response body into JSON: 4
- */
- public function testThrowsExceptionWhenFailsToParseJsonResponse()
- {
- $response = new Response(200, array(), '{"foo": "');
- $response->json();
- }
-
- public function testParsesXmlResponses()
- {
- $response = new Response(200, array(), 'bar ');
- $this->assertEquals('bar', (string) $response->xml()->foo);
- // Always return a SimpleXMLElement from the xml method
- $response = new Response(200);
- $this->assertEmpty((string) $response->xml()->foo);
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\RuntimeException
- * @expectedExceptionMessage Unable to parse response body into XML: String could not be parsed as XML
- */
- public function testThrowsExceptionWhenFailsToParseXmlResponse()
- {
- $response = new Response(200, array(), 'xml();
- }
-
- public function testResponseIsSerializable()
- {
- $response = new Response(200, array('Foo' => 'bar'), 'test');
- $r = unserialize(serialize($response));
- $this->assertEquals(200, $r->getStatusCode());
- $this->assertEquals('bar', (string) $r->getHeader('Foo'));
- $this->assertEquals('test', (string) $r->getBody());
- }
-
- public function testPreventsComplexExternalEntities()
- {
- $xml = ']>&test; ';
- $response = new Response(200, array(), $xml);
-
- $oldCwd = getcwd();
- chdir(__DIR__);
- try {
- $xml = $response->xml();
- chdir($oldCwd);
- $this->markTestIncomplete('Did not throw the expected exception! XML resolved as: ' . $xml->asXML());
- } catch (\Exception $e) {
- chdir($oldCwd);
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/MimetypesTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/MimetypesTest.php
deleted file mode 100644
index 7228453..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/MimetypesTest.php
+++ /dev/null
@@ -1,31 +0,0 @@
-assertEquals('text/x-php', Mimetypes::getInstance()->fromExtension('php'));
- }
-
- public function testGetsFromFilename()
- {
- $this->assertEquals('text/x-php', Mimetypes::getInstance()->fromFilename(__FILE__));
- }
-
- public function testGetsFromCaseInsensitiveFilename()
- {
- $this->assertEquals('text/x-php', Mimetypes::getInstance()->fromFilename(strtoupper(__FILE__)));
- }
-
- public function testReturnsNullWhenNoMatchFound()
- {
- $this->assertNull(Mimetypes::getInstance()->fromExtension('foobar'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/QueryAggregator/CommaAggregatorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/QueryAggregator/CommaAggregatorTest.php
deleted file mode 100644
index 549d3ed..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/QueryAggregator/CommaAggregatorTest.php
+++ /dev/null
@@ -1,30 +0,0 @@
-aggregate($key, $value, $query);
- $this->assertEquals(array('test%20123' => 'foo%20123,baz,bar'), $result);
- }
-
- public function testEncodes()
- {
- $query = new QueryString();
- $query->useUrlEncoding(false);
- $a = new Ag();
- $key = 'test 123';
- $value = array('foo 123', 'baz', 'bar');
- $result = $a->aggregate($key, $value, $query);
- $this->assertEquals(array('test 123' => 'foo 123,baz,bar'), $result);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/QueryAggregator/DuplicateAggregatorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/QueryAggregator/DuplicateAggregatorTest.php
deleted file mode 100644
index 6a4d9d9..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/QueryAggregator/DuplicateAggregatorTest.php
+++ /dev/null
@@ -1,30 +0,0 @@
-aggregate($key, $value, $query);
- $this->assertEquals(array('facet%201' => array('size%20a', 'width%20b')), $result);
- }
-
- public function testEncodes()
- {
- $query = new QueryString();
- $query->useUrlEncoding(false);
- $a = new Ag();
- $key = 'facet 1';
- $value = array('size a', 'width b');
- $result = $a->aggregate($key, $value, $query);
- $this->assertEquals(array('facet 1' => array('size a', 'width b')), $result);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/QueryAggregator/PhpAggregatorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/QueryAggregator/PhpAggregatorTest.php
deleted file mode 100644
index 1e7f0c2..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/QueryAggregator/PhpAggregatorTest.php
+++ /dev/null
@@ -1,32 +0,0 @@
-useUrlEncoding(false);
- $a = new Ag();
- $key = 't';
- $value = array(
- 'v1' => 'a',
- 'v2' => 'b',
- 'v3' => array(
- 'v4' => 'c',
- 'v5' => 'd',
- )
- );
- $result = $a->aggregate($key, $value, $query);
- $this->assertEquals(array(
- 't[v1]' => 'a',
- 't[v2]' => 'b',
- 't[v3][v4]' => 'c',
- 't[v3][v5]' => 'd',
- ), $result);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/QueryStringTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/QueryStringTest.php
deleted file mode 100644
index 948db44..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/QueryStringTest.php
+++ /dev/null
@@ -1,233 +0,0 @@
-q = new QueryString();
- }
-
- public function testGetFieldSeparator()
- {
- $this->assertEquals('&', $this->q->getFieldSeparator());
- }
-
- public function testGetValueSeparator()
- {
- $this->assertEquals('=', $this->q->getValueSeparator());
- }
-
- public function testIsUrlEncoding()
- {
- $this->assertEquals('RFC 3986', $this->q->getUrlEncoding());
- $this->assertTrue($this->q->isUrlEncoding());
- $this->assertEquals('foo%20bar', $this->q->encodeValue('foo bar'));
-
- $this->q->useUrlEncoding(QueryString::FORM_URLENCODED);
- $this->assertTrue($this->q->isUrlEncoding());
- $this->assertEquals(QueryString::FORM_URLENCODED, $this->q->getUrlEncoding());
- $this->assertEquals('foo+bar', $this->q->encodeValue('foo bar'));
-
- $this->assertSame($this->q, $this->q->useUrlEncoding(false));
- $this->assertFalse($this->q->isUrlEncoding());
- $this->assertFalse($this->q->isUrlEncoding());
- }
-
- public function testSetFieldSeparator()
- {
- $this->assertEquals($this->q, $this->q->setFieldSeparator('/'));
- $this->assertEquals('/', $this->q->getFieldSeparator());
- }
-
- public function testSetValueSeparator()
- {
- $this->assertEquals($this->q, $this->q->setValueSeparator('/'));
- $this->assertEquals('/', $this->q->getValueSeparator());
- }
-
- public function testUrlEncode()
- {
- $params = array(
- 'test' => 'value',
- 'test 2' => 'this is a test?',
- 'test3' => array('v1', 'v2', 'v3'),
- 'ሴ' => 'bar'
- );
- $encoded = array(
- 'test' => 'value',
- 'test%202' => rawurlencode('this is a test?'),
- 'test3%5B0%5D' => 'v1',
- 'test3%5B1%5D' => 'v2',
- 'test3%5B2%5D' => 'v3',
- '%E1%88%B4' => 'bar'
- );
- $this->q->replace($params);
- $this->assertEquals($encoded, $this->q->urlEncode());
-
- // Disable encoding
- $testData = array('test 2' => 'this is a test');
- $this->q->replace($testData);
- $this->q->useUrlEncoding(false);
- $this->assertEquals($testData, $this->q->urlEncode());
- }
-
- public function testToString()
- {
- // Check with no parameters
- $this->assertEquals('', $this->q->__toString());
-
- $params = array(
- 'test' => 'value',
- 'test 2' => 'this is a test?',
- 'test3' => array('v1', 'v2', 'v3'),
- 'test4' => null,
- );
- $this->q->replace($params);
- $this->assertEquals('test=value&test%202=this%20is%20a%20test%3F&test3%5B0%5D=v1&test3%5B1%5D=v2&test3%5B2%5D=v3&test4', $this->q->__toString());
- $this->q->useUrlEncoding(false);
- $this->assertEquals('test=value&test 2=this is a test?&test3[0]=v1&test3[1]=v2&test3[2]=v3&test4', $this->q->__toString());
-
- // Use an alternative aggregator
- $this->q->setAggregator(new CommaAggregator());
- $this->assertEquals('test=value&test 2=this is a test?&test3=v1,v2,v3&test4', $this->q->__toString());
- }
-
- public function testAllowsMultipleValuesPerKey()
- {
- $q = new QueryString();
- $q->add('facet', 'size');
- $q->add('facet', 'width');
- $q->add('facet.field', 'foo');
- // Use the duplicate aggregator
- $q->setAggregator(new DuplicateAggregator());
- $this->assertEquals('facet=size&facet=width&facet.field=foo', $q->__toString());
- }
-
- public function testAllowsNestedQueryData()
- {
- $this->q->replace(array(
- 'test' => 'value',
- 't' => array(
- 'v1' => 'a',
- 'v2' => 'b',
- 'v3' => array(
- 'v4' => 'c',
- 'v5' => 'd',
- )
- )
- ));
-
- $this->q->useUrlEncoding(false);
- $this->assertEquals('test=value&t[v1]=a&t[v2]=b&t[v3][v4]=c&t[v3][v5]=d', $this->q->__toString());
- }
-
- public function parseQueryProvider()
- {
- return array(
- // Ensure that multiple query string values are allowed per value
- array('q=a&q=b', array('q' => array('a', 'b'))),
- // Ensure that PHP array style query string values are parsed
- array('q[]=a&q[]=b', array('q' => array('a', 'b'))),
- // Ensure that a single PHP array style query string value is parsed into an array
- array('q[]=a', array('q' => array('a'))),
- // Ensure that decimals are allowed in query strings
- array('q.a=a&q.b=b', array(
- 'q.a' => 'a',
- 'q.b' => 'b'
- )),
- // Ensure that query string values are percent decoded
- array('q%20a=a%20b', array('q a' => 'a b')),
- // Ensure null values can be added
- array('q&a', array('q' => false, 'a' => false)),
- );
- }
-
- /**
- * @dataProvider parseQueryProvider
- */
- public function testParsesQueryStrings($query, $data)
- {
- $query = QueryString::fromString($query);
- $this->assertEquals($data, $query->getAll());
- }
-
- public function testProperlyDealsWithDuplicateQueryStringValues()
- {
- $query = QueryString::fromString('foo=a&foo=b&?µ=c');
- $this->assertEquals(array('a', 'b'), $query->get('foo'));
- $this->assertEquals('c', $query->get('?µ'));
- }
-
- public function testAllowsBlankQueryStringValues()
- {
- $query = QueryString::fromString('foo');
- $this->assertEquals('foo', (string) $query);
- $query->set('foo', QueryString::BLANK);
- $this->assertEquals('foo', (string) $query);
- }
-
- public function testAllowsFalsyQueryStringValues()
- {
- $query = QueryString::fromString('0');
- $this->assertEquals('0', (string) $query);
- $query->set('0', QueryString::BLANK);
- $this->assertSame('0', (string) $query);
- }
-
- public function testFromStringIgnoresQuestionMark()
- {
- $query = QueryString::fromString('foo=baz&bar=boo');
- $this->assertEquals('foo=baz&bar=boo', (string) $query);
- }
-
- public function testConvertsPlusSymbolsToSpaces()
- {
- $query = QueryString::fromString('var=foo+bar');
- $this->assertEquals('foo bar', $query->get('var'));
- }
-
- public function testFromStringDoesntMangleZeroes()
- {
- $query = QueryString::fromString('var=0');
- $this->assertSame('0', $query->get('var'));
- }
-
- public function testAllowsZeroValues()
- {
- $query = new QueryString(array(
- 'foo' => 0,
- 'baz' => '0',
- 'bar' => null,
- 'boo' => false,
- 'bam' => ''
- ));
- $this->assertEquals('foo=0&baz=0&bar&boo&bam=', (string) $query);
- }
-
- public function testFromStringDoesntStripTrailingEquals()
- {
- $query = QueryString::fromString('data=mF0b3IiLCJUZWFtIERldiJdfX0=');
- $this->assertEquals('mF0b3IiLCJUZWFtIERldiJdfX0=', $query->get('data'));
- }
-
- public function testGuessesIfDuplicateAggregatorShouldBeUsed()
- {
- $query = QueryString::fromString('test=a&test=b');
- $this->assertEquals('test=a&test=b', (string) $query);
- }
-
- public function testGuessesIfDuplicateAggregatorShouldBeUsedAndChecksForPhpStyle()
- {
- $query = QueryString::fromString('test[]=a&test[]=b');
- $this->assertEquals('test%5B0%5D=a&test%5B1%5D=b', (string) $query);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/ReadLimitEntityBodyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/ReadLimitEntityBodyTest.php
deleted file mode 100644
index 6bb3fed..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/ReadLimitEntityBodyTest.php
+++ /dev/null
@@ -1,81 +0,0 @@
-decorated = EntityBody::factory(fopen(__FILE__, 'r'));
- $this->body = new ReadLimitEntityBody($this->decorated, 10, 3);
- }
-
- public function testReturnsSubsetWhenCastToString()
- {
- $body = EntityBody::factory('foo_baz_bar');
- $limited = new ReadLimitEntityBody($body, 3, 4);
- $this->assertEquals('baz', (string) $limited);
- }
-
- public function testReturnsSubsetOfEmptyBodyWhenCastToString()
- {
- $body = EntityBody::factory('');
- $limited = new ReadLimitEntityBody($body, 0, 10);
- $this->assertEquals('', (string) $limited);
- }
-
- public function testSeeksWhenConstructed()
- {
- $this->assertEquals(3, $this->body->ftell());
- }
-
- public function testAllowsBoundedSeek()
- {
- $this->body->seek(100);
- $this->assertEquals(13, $this->body->ftell());
- $this->body->seek(0);
- $this->assertEquals(3, $this->body->ftell());
- $this->assertEquals(false, $this->body->seek(1000, SEEK_END));
- }
-
- public function testReadsOnlySubsetOfData()
- {
- $data = $this->body->read(100);
- $this->assertEquals(10, strlen($data));
- $this->assertFalse($this->body->read(1000));
-
- $this->body->setOffset(10);
- $newData = $this->body->read(100);
- $this->assertEquals(10, strlen($newData));
- $this->assertNotSame($data, $newData);
- }
-
- public function testClaimsConsumedWhenReadLimitIsReached()
- {
- $this->assertFalse($this->body->isConsumed());
- $this->body->read(1000);
- $this->assertTrue($this->body->isConsumed());
- }
-
- public function testContentLengthIsBounded()
- {
- $this->assertEquals(10, $this->body->getContentLength());
- }
-
- public function testContentMd5IsBasedOnSubsection()
- {
- $this->assertNotSame($this->body->getContentMd5(), $this->decorated->getContentMd5());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/RedirectPluginTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/RedirectPluginTest.php
deleted file mode 100755
index 886236d..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/RedirectPluginTest.php
+++ /dev/null
@@ -1,277 +0,0 @@
-getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect1\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect2\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- ));
-
- // Create a client that uses the default redirect behavior
- $client = new Client($this->getServer()->getUrl());
- $history = new HistoryPlugin();
- $client->addSubscriber($history);
-
- $request = $client->get('/foo');
- $response = $request->send();
- $this->assertEquals(200, $response->getStatusCode());
- $this->assertContains('/redirect2', $response->getEffectiveUrl());
-
- // Ensure that two requests were sent
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals('/foo', $requests[0]->getResource());
- $this->assertEquals('GET', $requests[0]->getMethod());
- $this->assertEquals('/redirect1', $requests[1]->getResource());
- $this->assertEquals('GET', $requests[1]->getMethod());
- $this->assertEquals('/redirect2', $requests[2]->getResource());
- $this->assertEquals('GET', $requests[2]->getMethod());
-
- // Ensure that the redirect count was incremented
- $this->assertEquals(2, $request->getParams()->get(RedirectPlugin::REDIRECT_COUNT));
- $this->assertCount(3, $history);
- $requestHistory = $history->getAll();
-
- $this->assertEquals(301, $requestHistory[0]['response']->getStatusCode());
- $this->assertEquals('/redirect1', (string) $requestHistory[0]['response']->getHeader('Location'));
- $this->assertEquals(301, $requestHistory[1]['response']->getStatusCode());
- $this->assertEquals('/redirect2', (string) $requestHistory[1]['response']->getHeader('Location'));
- $this->assertEquals(200, $requestHistory[2]['response']->getStatusCode());
- }
-
- public function testCanLimitNumberOfRedirects()
- {
- // Flush the server and queue up a redirect followed by a successful response
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect1\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect2\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect3\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect4\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect5\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect6\r\nContent-Length: 0\r\n\r\n"
- ));
-
- try {
- $client = new Client($this->getServer()->getUrl());
- $client->get('/foo')->send();
- $this->fail('Did not throw expected exception');
- } catch (TooManyRedirectsException $e) {
- $this->assertContains(
- "5 redirects were issued for this request:\nGET /foo HTTP/1.1\r\n",
- $e->getMessage()
- );
- }
- }
-
- public function testDefaultBehaviorIsToRedirectWithGetForEntityEnclosingRequests()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- ));
-
- $client = new Client($this->getServer()->getUrl());
- $client->post('/foo', array('X-Baz' => 'bar'), 'testing')->send();
-
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals('POST', $requests[0]->getMethod());
- $this->assertEquals('GET', $requests[1]->getMethod());
- $this->assertEquals('bar', (string) $requests[1]->getHeader('X-Baz'));
- $this->assertEquals('GET', $requests[2]->getMethod());
- }
-
- public function testCanRedirectWithStrictRfcCompliance()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- ));
-
- $client = new Client($this->getServer()->getUrl());
- $request = $client->post('/foo', array('X-Baz' => 'bar'), 'testing');
- $request->getParams()->set(RedirectPlugin::STRICT_REDIRECTS, true);
- $request->send();
-
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals('POST', $requests[0]->getMethod());
- $this->assertEquals('POST', $requests[1]->getMethod());
- $this->assertEquals('bar', (string) $requests[1]->getHeader('X-Baz'));
- $this->assertEquals('POST', $requests[2]->getMethod());
- }
-
- public function testRedirect303WithGet()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 303 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- ));
-
- $client = new Client($this->getServer()->getUrl());
- $request = $client->post('/foo');
- $request->send();
-
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals('POST', $requests[0]->getMethod());
- $this->assertEquals('GET', $requests[1]->getMethod());
- }
-
- public function testRedirect303WithGetWithStrictRfcCompliance()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 303 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- ));
-
- $client = new Client($this->getServer()->getUrl());
- $request = $client->post('/foo');
- $request->getParams()->set(RedirectPlugin::STRICT_REDIRECTS, true);
- $request->send();
-
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals('POST', $requests[0]->getMethod());
- $this->assertEquals('GET', $requests[1]->getMethod());
- }
-
- public function testRewindsStreamWhenRedirectingIfNeeded()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- ));
-
- $client = new Client($this->getServer()->getUrl());
- $request = $client->put();
- $request->configureRedirects(true);
- $body = EntityBody::factory('foo');
- $body->read(1);
- $request->setBody($body);
- $request->send();
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals('foo', (string) $requests[0]->getBody());
- }
-
- /**
- * @expectedException \Guzzle\Http\Exception\CouldNotRewindStreamException
- */
- public function testThrowsExceptionWhenStreamCannotBeRewound()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n"
- ));
-
- $client = new Client($this->getServer()->getUrl());
- $request = $client->put();
- $request->configureRedirects(true);
- $body = EntityBody::factory(fopen($this->getServer()->getUrl(), 'r'));
- $body->read(1);
- $request->setBody($body)->send();
- }
-
- public function testRedirectsCanBeDisabledPerRequest()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array("HTTP/1.1 301 Foo\r\nLocation: /foo\r\nContent-Length: 0\r\n\r\n"));
- $client = new Client($this->getServer()->getUrl());
- $request = $client->put();
- $request->configureRedirects(false, 0);
- $this->assertEquals(301, $request->send()->getStatusCode());
- }
-
- public function testCanRedirectWithNoLeadingSlashAndQuery()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 301 Moved Permanently\r\nLocation: redirect?foo=bar\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- ));
- $client = new Client($this->getServer()->getUrl());
- $request = $client->get('?foo=bar');
- $request->send();
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals($this->getServer()->getUrl() . '?foo=bar', $requests[0]->getUrl());
- $this->assertEquals($this->getServer()->getUrl() . 'redirect?foo=bar', $requests[1]->getUrl());
- // Ensure that the history on the actual request is correct
- $this->assertEquals($this->getServer()->getUrl() . '?foo=bar', $request->getUrl());
- }
-
- public function testRedirectWithStrictRfc386Compliance()
- {
- // Flush the server and queue up a redirect followed by a successful response
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 301 Moved Permanently\r\nLocation: redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"
- ));
- $client = new Client($this->getServer()->getUrl());
- $request = $client->get('/foo');
- $request->send();
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals('/redirect', $requests[1]->getResource());
- }
-
- public function testResetsHistoryEachSend()
- {
- // Flush the server and queue up a redirect followed by a successful response
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect1\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect2\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"
- ));
-
- // Create a client that uses the default redirect behavior
- $client = new Client($this->getServer()->getUrl());
- $history = new HistoryPlugin();
- $client->addSubscriber($history);
-
- $request = $client->get('/foo');
- $response = $request->send();
- $this->assertEquals(3, count($history));
- $this->assertTrue($request->getParams()->hasKey('redirect.count'));
- $this->assertContains('/redirect2', $response->getEffectiveUrl());
-
- $request->send();
- $this->assertFalse($request->getParams()->hasKey('redirect.count'));
- }
-
- public function testHandlesRedirectsWithSpacesProperly()
- {
- // Flush the server and queue up a redirect followed by a successful response
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect 1\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"
- ));
- $client = new Client($this->getServer()->getUrl());
- $request = $client->get('/foo');
- $request->send();
- $reqs = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals('/redirect%201', $reqs[1]->getResource());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Server.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Server.php
deleted file mode 100644
index 94eb59a..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/Server.php
+++ /dev/null
@@ -1,191 +0,0 @@
-port = $port ?: self::DEFAULT_PORT;
- $this->client = new Client($this->getUrl());
- register_shutdown_function(array($this, 'stop'));
- }
-
- /**
- * Flush the received requests from the server
- * @throws RuntimeException
- */
- public function flush()
- {
- $this->client->delete('guzzle-server/requests')->send();
- }
-
- /**
- * Queue an array of responses or a single response on the server.
- *
- * Any currently queued responses will be overwritten. Subsequent requests
- * on the server will return queued responses in FIFO order.
- *
- * @param array|Response $responses A single or array of Responses to queue
- * @throws BadResponseException
- */
- public function enqueue($responses)
- {
- $data = array();
- foreach ((array) $responses as $response) {
-
- // Create the response object from a string
- if (is_string($response)) {
- $response = Response::fromMessage($response);
- } elseif (!($response instanceof Response)) {
- throw new BadResponseException('Responses must be strings or implement Response');
- }
-
- $data[] = array(
- 'statusCode' => $response->getStatusCode(),
- 'reasonPhrase' => $response->getReasonPhrase(),
- 'headers' => $response->getHeaders()->toArray(),
- 'body' => $response->getBody(true)
- );
- }
-
- $request = $this->client->put('guzzle-server/responses', null, json_encode($data));
- $request->send();
- }
-
- /**
- * Check if the server is running
- *
- * @return bool
- */
- public function isRunning()
- {
- if ($this->running) {
- return true;
- }
-
- try {
- $this->client->get('guzzle-server/perf', array(), array('timeout' => 5))->send();
- $this->running = true;
- return true;
- } catch (\Exception $e) {
- return false;
- }
- }
-
- /**
- * Get the URL to the server
- *
- * @return string
- */
- public function getUrl()
- {
- return 'http://127.0.0.1:' . $this->getPort() . '/';
- }
-
- /**
- * Get the port that the server is listening on
- *
- * @return int
- */
- public function getPort()
- {
- return $this->port;
- }
-
- /**
- * Get all of the received requests
- *
- * @param bool $hydrate Set to TRUE to turn the messages into
- * actual {@see RequestInterface} objects. If $hydrate is FALSE,
- * requests will be returned as strings.
- *
- * @return array
- * @throws RuntimeException
- */
- public function getReceivedRequests($hydrate = false)
- {
- $response = $this->client->get('guzzle-server/requests')->send();
- $data = array_filter(explode(self::REQUEST_DELIMITER, $response->getBody(true)));
- if ($hydrate) {
- $data = array_map(function($message) {
- return RequestFactory::getInstance()->fromMessage($message);
- }, $data);
- }
-
- return $data;
- }
-
- /**
- * Start running the node.js server in the background
- */
- public function start()
- {
- if (!$this->isRunning()) {
- exec('node ' . __DIR__ . \DIRECTORY_SEPARATOR
- . 'server.js ' . $this->port
- . ' >> /tmp/server.log 2>&1 &');
- // Wait at most 5 seconds for the server the setup before
- // proceeding.
- $start = time();
- while (!$this->isRunning() && time() - $start < 5);
- if (!$this->running) {
- throw new RuntimeException(
- 'Unable to contact server.js. Have you installed node.js v0.5.0+? node must be in your path.'
- );
- }
- }
- }
-
- /**
- * Stop running the node.js server
- */
- public function stop()
- {
- if (!$this->isRunning()) {
- return false;
- }
-
- $this->running = false;
- $this->client->delete('guzzle-server')->send();
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/StaticClientTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/StaticClientTest.php
deleted file mode 100644
index 091314b..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/StaticClientTest.php
+++ /dev/null
@@ -1,67 +0,0 @@
-assertTrue(class_exists('FooBazBar'));
- $this->assertSame($client, $this->readAttribute('Guzzle\Http\StaticClient', 'client'));
- }
-
- public function requestProvider()
- {
- return array_map(
- function ($m) { return array($m); },
- array('GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS')
- );
- }
-
- /**
- * @dataProvider requestProvider
- */
- public function testSendsRequests($method)
- {
- $mock = new MockPlugin(array(new Response(200)));
- call_user_func('Guzzle\Http\StaticClient::' . $method, 'http://foo.com', array(
- 'plugins' => array($mock)
- ));
- $requests = $mock->getReceivedRequests();
- $this->assertCount(1, $requests);
- $this->assertEquals($method, $requests[0]->getMethod());
- }
-
- public function testCanCreateStreamsUsingDefaultFactory()
- {
- $this->getServer()->enqueue(array("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest"));
- $stream = StaticClient::get($this->getServer()->getUrl(), array('stream' => true));
- $this->assertInstanceOf('Guzzle\Stream\StreamInterface', $stream);
- $this->assertEquals('test', (string) $stream);
- }
-
- public function testCanCreateStreamsUsingCustomFactory()
- {
- $stream = $this->getMockBuilder('Guzzle\Stream\StreamRequestFactoryInterface')
- ->setMethods(array('fromRequest'))
- ->getMockForAbstractClass();
- $resource = new Stream(fopen('php://temp', 'r+'));
- $stream->expects($this->once())
- ->method('fromRequest')
- ->will($this->returnValue($resource));
- $this->getServer()->enqueue(array("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest"));
- $result = StaticClient::get($this->getServer()->getUrl(), array('stream' => $stream));
- $this->assertSame($resource, $result);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/UrlTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/UrlTest.php
deleted file mode 100644
index 28f2671..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/UrlTest.php
+++ /dev/null
@@ -1,303 +0,0 @@
-assertEquals('', (string) $url);
- }
-
- public function testPortIsDeterminedFromScheme()
- {
- $this->assertEquals(80, Url::factory('http://www.test.com/')->getPort());
- $this->assertEquals(443, Url::factory('https://www.test.com/')->getPort());
- $this->assertEquals(null, Url::factory('ftp://www.test.com/')->getPort());
- $this->assertEquals(8192, Url::factory('http://www.test.com:8192/')->getPort());
- }
-
- public function testCloneCreatesNewInternalObjects()
- {
- $u1 = Url::factory('http://www.test.com/');
- $u2 = clone $u1;
- $this->assertNotSame($u1->getQuery(), $u2->getQuery());
- }
-
- public function testValidatesUrlPartsInFactory()
- {
- $url = Url::factory('/index.php');
- $this->assertEquals('/index.php', (string) $url);
- $this->assertFalse($url->isAbsolute());
-
- $url = 'http://michael:test@test.com:80/path/123?q=abc#test';
- $u = Url::factory($url);
- $this->assertEquals('http://michael:test@test.com/path/123?q=abc#test', (string) $u);
- $this->assertTrue($u->isAbsolute());
- }
-
- public function testAllowsFalsyUrlParts()
- {
- $url = Url::factory('http://0:50/0?0#0');
- $this->assertSame('0', $url->getHost());
- $this->assertEquals(50, $url->getPort());
- $this->assertSame('/0', $url->getPath());
- $this->assertEquals('0', (string) $url->getQuery());
- $this->assertSame('0', $url->getFragment());
- $this->assertEquals('http://0:50/0?0#0', (string) $url);
-
- $url = Url::factory('');
- $this->assertSame('', (string) $url);
-
- $url = Url::factory('0');
- $this->assertSame('0', (string) $url);
- }
-
- public function testBuildsRelativeUrlsWithFalsyParts()
- {
- $url = Url::buildUrl(array(
- 'host' => '0',
- 'path' => '0',
- ));
-
- $this->assertSame('//0/0', $url);
-
- $url = Url::buildUrl(array(
- 'path' => '0',
- ));
- $this->assertSame('0', $url);
- }
-
- public function testUrlStoresParts()
- {
- $url = Url::factory('http://test:pass@www.test.com:8081/path/path2/?a=1&b=2#fragment');
- $this->assertEquals('http', $url->getScheme());
- $this->assertEquals('test', $url->getUsername());
- $this->assertEquals('pass', $url->getPassword());
- $this->assertEquals('www.test.com', $url->getHost());
- $this->assertEquals(8081, $url->getPort());
- $this->assertEquals('/path/path2/', $url->getPath());
- $this->assertEquals('fragment', $url->getFragment());
- $this->assertEquals('a=1&b=2', (string) $url->getQuery());
-
- $this->assertEquals(array(
- 'fragment' => 'fragment',
- 'host' => 'www.test.com',
- 'pass' => 'pass',
- 'path' => '/path/path2/',
- 'port' => 8081,
- 'query' => 'a=1&b=2',
- 'scheme' => 'http',
- 'user' => 'test'
- ), $url->getParts());
- }
-
- public function testHandlesPathsCorrectly()
- {
- $url = Url::factory('http://www.test.com');
- $this->assertEquals('', $url->getPath());
- $url->setPath('test');
- $this->assertEquals('test', $url->getPath());
-
- $url->setPath('/test/123/abc');
- $this->assertEquals(array('test', '123', 'abc'), $url->getPathSegments());
-
- $parts = parse_url('http://www.test.com/test');
- $parts['path'] = '';
- $this->assertEquals('http://www.test.com', Url::buildUrl($parts));
- $parts['path'] = 'test';
- $this->assertEquals('http://www.test.com/test', Url::buildUrl($parts));
- }
-
- public function testAddsQueryStringIfPresent()
- {
- $this->assertEquals('?foo=bar', Url::buildUrl(array(
- 'query' => 'foo=bar'
- )));
- }
-
- public function testAddsToPath()
- {
- // Does nothing here
- $this->assertEquals('http://e.com/base?a=1', (string) Url::factory('http://e.com/base?a=1')->addPath(false));
- $this->assertEquals('http://e.com/base?a=1', (string) Url::factory('http://e.com/base?a=1')->addPath(null));
- $this->assertEquals('http://e.com/base?a=1', (string) Url::factory('http://e.com/base?a=1')->addPath(array()));
- $this->assertEquals('http://e.com/base?a=1', (string) Url::factory('http://e.com/base?a=1')->addPath(new \stdClass()));
- $this->assertEquals('http://e.com/base?a=1', (string) Url::factory('http://e.com/base?a=1')->addPath(''));
- $this->assertEquals('http://e.com/base?a=1', (string) Url::factory('http://e.com/base?a=1')->addPath('/'));
- $this->assertEquals('http://e.com/baz/foo', (string) Url::factory('http://e.com/baz/')->addPath('foo'));
- $this->assertEquals('http://e.com/base/relative?a=1', (string) Url::factory('http://e.com/base?a=1')->addPath('relative'));
- $this->assertEquals('http://e.com/base/relative?a=1', (string) Url::factory('http://e.com/base?a=1')->addPath('/relative'));
- $this->assertEquals('http://e.com/base/0', (string) Url::factory('http://e.com/base')->addPath('0'));
- $this->assertEquals('http://e.com/base/0/1', (string) Url::factory('http://e.com/base')->addPath('0')->addPath('1'));
- }
-
- /**
- * URL combination data provider
- *
- * @return array
- */
- public function urlCombineDataProvider()
- {
- return array(
- array('http://www.example.com/', 'http://www.example.com/', 'http://www.example.com/'),
- array('http://www.example.com/path', '/absolute', 'http://www.example.com/absolute'),
- array('http://www.example.com/path', '/absolute?q=2', 'http://www.example.com/absolute?q=2'),
- array('http://www.example.com/path', 'more', 'http://www.example.com/path/more'),
- array('http://www.example.com/path', 'more?q=1', 'http://www.example.com/path/more?q=1'),
- array('http://www.example.com/', '?q=1', 'http://www.example.com/?q=1'),
- array('http://www.example.com/path', 'http://test.com', 'http://test.com'),
- array('http://www.example.com:8080/path', 'http://test.com', 'http://test.com'),
- array('http://www.example.com:8080/path', '?q=2#abc', 'http://www.example.com:8080/path?q=2#abc'),
- array('http://u:a@www.example.com/path', 'test', 'http://u:a@www.example.com/path/test'),
- array('http://www.example.com/path', 'http://u:a@www.example.com/', 'http://u:a@www.example.com/'),
- array('/path?q=2', 'http://www.test.com/', 'http://www.test.com/path?q=2'),
- array('http://api.flickr.com/services/', 'http://www.flickr.com/services/oauth/access_token', 'http://www.flickr.com/services/oauth/access_token'),
- array('http://www.example.com/?foo=bar', 'some/path', 'http://www.example.com/some/path?foo=bar'),
- array('http://www.example.com/?foo=bar', 'some/path?boo=moo', 'http://www.example.com/some/path?boo=moo&foo=bar'),
- array('http://www.example.com/some/', 'path?foo=bar&foo=baz', 'http://www.example.com/some/path?foo=bar&foo=baz'),
- );
- }
-
- /**
- * @dataProvider urlCombineDataProvider
- */
- public function testCombinesUrls($a, $b, $c)
- {
- $this->assertEquals($c, (string) Url::factory($a)->combine($b));
- }
-
- public function testHasGettersAndSetters()
- {
- $url = Url::factory('http://www.test.com/');
- $this->assertEquals('example.com', $url->setHost('example.com')->getHost());
- $this->assertEquals('8080', $url->setPort(8080)->getPort());
- $this->assertEquals('/foo/bar', $url->setPath(array('foo', 'bar'))->getPath());
- $this->assertEquals('a', $url->setPassword('a')->getPassword());
- $this->assertEquals('b', $url->setUsername('b')->getUsername());
- $this->assertEquals('abc', $url->setFragment('abc')->getFragment());
- $this->assertEquals('https', $url->setScheme('https')->getScheme());
- $this->assertEquals('a=123', (string) $url->setQuery('a=123')->getQuery());
- $this->assertEquals('https://b:a@example.com:8080/foo/bar?a=123#abc', (string) $url);
- $this->assertEquals('b=boo', (string) $url->setQuery(new QueryString(array(
- 'b' => 'boo'
- )))->getQuery());
- $this->assertEquals('https://b:a@example.com:8080/foo/bar?b=boo#abc', (string) $url);
- }
-
- public function testSetQueryAcceptsArray()
- {
- $url = Url::factory('http://www.test.com');
- $url->setQuery(array('a' => 'b'));
- $this->assertEquals('http://www.test.com?a=b', (string) $url);
- }
-
- public function urlProvider()
- {
- return array(
- array('/foo/..', '/'),
- array('//foo//..', '/'),
- array('/foo/../..', '/'),
- array('/foo/../.', '/'),
- array('/./foo/..', '/'),
- array('/./foo', '/foo'),
- array('/./foo/', '/foo/'),
- array('/./foo/bar/baz/pho/../..', '/foo/bar'),
- array('*', '*'),
- array('/foo', '/foo'),
- array('/abc/123/../foo/', '/abc/foo/'),
- array('/a/b/c/./../../g', '/a/g'),
- array('/b/c/./../../g', '/g'),
- array('/b/c/./../../g', '/g'),
- array('/c/./../../g', '/g'),
- array('/./../../g', '/g'),
- );
- }
-
- /**
- * @dataProvider urlProvider
- */
- public function testNormalizesPaths($path, $result)
- {
- $url = Url::factory('http://www.example.com/');
- $url->setPath($path)->normalizePath();
- $this->assertEquals($result, $url->getPath());
- }
-
- public function testSettingHostWithPortModifiesPort()
- {
- $url = Url::factory('http://www.example.com');
- $url->setHost('foo:8983');
- $this->assertEquals('foo', $url->getHost());
- $this->assertEquals(8983, $url->getPort());
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testValidatesUrlCanBeParsed()
- {
- Url::factory('foo:////');
- }
-
- public function testConvertsSpecialCharsInPathWhenCastingToString()
- {
- $url = Url::factory('http://foo.com/baz bar?a=b');
- $url->addPath('?');
- $this->assertEquals('http://foo.com/baz%20bar/%3F?a=b', (string) $url);
- }
-
- /**
- * @link http://tools.ietf.org/html/rfc3986#section-5.4.1
- */
- public function rfc3986UrlProvider()
- {
- $result = array(
- array('g', 'http://a/b/c/g'),
- array('./g', 'http://a/b/c/g'),
- array('g/', 'http://a/b/c/g/'),
- array('/g', 'http://a/g'),
- array('?y', 'http://a/b/c/d;p?y'),
- array('g?y', 'http://a/b/c/g?y'),
- array('#s', 'http://a/b/c/d;p?q#s'),
- array('g#s', 'http://a/b/c/g#s'),
- array('g?y#s', 'http://a/b/c/g?y#s'),
- array(';x', 'http://a/b/c/;x'),
- array('g;x', 'http://a/b/c/g;x'),
- array('g;x?y#s', 'http://a/b/c/g;x?y#s'),
- array('', 'http://a/b/c/d;p?q'),
- array('.', 'http://a/b/c'),
- array('./', 'http://a/b/c/'),
- array('..', 'http://a/b'),
- array('../', 'http://a/b/'),
- array('../g', 'http://a/b/g'),
- array('../..', 'http://a/'),
- array('../../', 'http://a/'),
- array('../../g', 'http://a/g')
- );
-
- // This support was added in PHP 5.4.7: https://bugs.php.net/bug.php?id=62844
- if (version_compare(PHP_VERSION, '5.4.7', '>=')) {
- $result[] = array('//g', 'http://g');
- }
-
- return $result;
- }
-
- /**
- * @dataProvider rfc3986UrlProvider
- */
- public function testCombinesUrlsUsingRfc3986($relative, $result)
- {
- $a = Url::factory('http://a/b/c/d;p?q');
- $b = Url::factory($relative);
- $this->assertEquals($result, trim((string) $a->combine($b, true), '='));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/server.js b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/server.js
deleted file mode 100644
index 4156f1a..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Http/server.js
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * Guzzle node.js test server to return queued responses to HTTP requests and
- * expose a RESTful API for enqueueing responses and retrieving the requests
- * that have been received.
- *
- * - Delete all requests that have been received:
- * DELETE /guzzle-server/requests
- * Host: 127.0.0.1:8124
- *
- * - Enqueue responses
- * PUT /guzzle-server/responses
- * Host: 127.0.0.1:8124
- *
- * [{ "statusCode": 200, "reasonPhrase": "OK", "headers": {}, "body": "" }]
- *
- * - Get the received requests
- * GET /guzzle-server/requests
- * Host: 127.0.0.1:8124
- *
- * - Shutdown the server
- * DELETE /guzzle-server
- * Host: 127.0.0.1:8124
- *
- * @package Guzzle PHP
- * @license See the LICENSE file that was distributed with this source code.
- */
-
-var http = require("http");
-
-/**
- * Guzzle node.js server
- * @class
- */
-var GuzzleServer = function(port, log) {
-
- this.port = port;
- this.log = log;
- this.responses = [];
- this.requests = [];
- var that = this;
-
- var controlRequest = function(request, req, res) {
- if (req.url == '/guzzle-server/perf') {
- res.writeHead(200, "OK", {"Content-Length": 16});
- res.end("Body of response");
- } else if (req.method == "DELETE") {
- if (req.url == "/guzzle-server/requests") {
- // Clear the received requests
- that.requests = [];
- res.writeHead(200, "OK", { "Content-Length": 0 });
- res.end();
- if (this.log) {
- console.log("Flushing requests");
- }
- } else if (req.url == "/guzzle-server") {
- // Shutdown the server
- res.writeHead(200, "OK", { "Content-Length": 0, "Connection": "close" });
- res.end();
- if (this.log) {
- console.log("Shutting down");
- }
- that.server.close();
- }
- } else if (req.method == "GET") {
- if (req.url === "/guzzle-server/requests") {
- // Get received requests
- var data = that.requests.join("\n----[request]\n");
- res.writeHead(200, "OK", { "Content-Length": data.length });
- res.end(data);
- if (that.log) {
- console.log("Sending receiving requests");
- }
- }
- } else if (req.method == "PUT") {
- if (req.url == "/guzzle-server/responses") {
- if (that.log) {
- console.log("Adding responses...");
- }
- // Received response to queue
- var data = request.split("\r\n\r\n")[1];
- if (!data) {
- if (that.log) {
- console.log("No response data was provided");
- }
- res.writeHead(400, "NO RESPONSES IN REQUEST", { "Content-Length": 0 });
- } else {
- that.responses = eval("(" + data + ")");
- if (that.log) {
- console.log(that.responses);
- }
- res.writeHead(200, "OK", { "Content-Length": 0 });
- }
- res.end();
- }
- }
- };
-
- var receivedRequest = function(request, req, res) {
- if (req.url.indexOf("/guzzle-server") === 0) {
- controlRequest(request, req, res);
- } else if (req.url.indexOf("/guzzle-server") == -1 && !that.responses.length) {
- res.writeHead(500);
- res.end("No responses in queue");
- } else {
- var response = that.responses.shift();
- res.writeHead(response.statusCode, response.reasonPhrase, response.headers);
- res.end(response.body);
- that.requests.push(request);
- }
- };
-
- this.start = function() {
-
- that.server = http.createServer(function(req, res) {
-
- var request = req.method + " " + req.url + " HTTP/" + req.httpVersion + "\r\n";
- for (var i in req.headers) {
- request += i + ": " + req.headers[i] + "\r\n";
- }
- request += "\r\n";
-
- // Receive each chunk of the request body
- req.addListener("data", function(chunk) {
- request += chunk;
- });
-
- // Called when the request completes
- req.addListener("end", function() {
- receivedRequest(request, req, res);
- });
- });
- that.server.listen(port, "127.0.0.1");
-
- if (this.log) {
- console.log("Server running at http://127.0.0.1:8124/");
- }
- };
-};
-
-// Get the port from the arguments
-port = process.argv.length >= 3 ? process.argv[2] : 8124;
-log = process.argv.length >= 4 ? process.argv[3] : false;
-
-// Start the server
-server = new GuzzleServer(port, log);
-server.start();
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Inflection/InflectorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Inflection/InflectorTest.php
deleted file mode 100644
index 990c0af..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Inflection/InflectorTest.php
+++ /dev/null
@@ -1,37 +0,0 @@
-assertSame(Inflector::getDefault(), Inflector::getDefault());
- }
-
- public function testSnake()
- {
- $this->assertEquals('camel_case', Inflector::getDefault()->snake('camelCase'));
- $this->assertEquals('camel_case', Inflector::getDefault()->snake('CamelCase'));
- $this->assertEquals('camel_case_words', Inflector::getDefault()->snake('CamelCaseWords'));
- $this->assertEquals('camel_case_words', Inflector::getDefault()->snake('CamelCase_words'));
- $this->assertEquals('test', Inflector::getDefault()->snake('test'));
- $this->assertEquals('test', Inflector::getDefault()->snake('test'));
- $this->assertEquals('expect100_continue', Inflector::getDefault()->snake('Expect100Continue'));
- }
-
- public function testCamel()
- {
- $this->assertEquals('CamelCase', Inflector::getDefault()->camel('camel_case'));
- $this->assertEquals('CamelCaseWords', Inflector::getDefault()->camel('camel_case_words'));
- $this->assertEquals('Test', Inflector::getDefault()->camel('test'));
- $this->assertEquals('Expect100Continue', ucfirst(Inflector::getDefault()->camel('expect100_continue')));
- // Get from cache
- $this->assertEquals('Test', Inflector::getDefault()->camel('test', false));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Inflection/MemoizingInflectorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Inflection/MemoizingInflectorTest.php
deleted file mode 100644
index f00b7fa..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Inflection/MemoizingInflectorTest.php
+++ /dev/null
@@ -1,46 +0,0 @@
-getMock('Guzzle\Inflection\Inflector', array('snake', 'camel'));
- $mock->expects($this->once())->method('snake')->will($this->returnValue('foo_bar'));
- $mock->expects($this->once())->method('camel')->will($this->returnValue('FooBar'));
-
- $inflector = new MemoizingInflector($mock);
- $this->assertEquals('foo_bar', $inflector->snake('FooBar'));
- $this->assertEquals('foo_bar', $inflector->snake('FooBar'));
- $this->assertEquals('FooBar', $inflector->camel('foo_bar'));
- $this->assertEquals('FooBar', $inflector->camel('foo_bar'));
- }
-
- public function testProtectsAgainstCacheOverflow()
- {
- $inflector = new MemoizingInflector(new Inflector(), 10);
- for ($i = 1; $i < 11; $i++) {
- $inflector->camel('foo_' . $i);
- $inflector->snake('Foo' . $i);
- }
-
- $cache = $this->readAttribute($inflector, 'cache');
- $this->assertEquals(10, count($cache['snake']));
- $this->assertEquals(10, count($cache['camel']));
-
- $inflector->camel('baz!');
- $inflector->snake('baz!');
-
- // Now ensure that 20% of the cache was removed (2), then the item was added
- $cache = $this->readAttribute($inflector, 'cache');
- $this->assertEquals(9, count($cache['snake']));
- $this->assertEquals(9, count($cache['camel']));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Inflection/PreComputedInflectorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Inflection/PreComputedInflectorTest.php
deleted file mode 100644
index ff2654c..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Inflection/PreComputedInflectorTest.php
+++ /dev/null
@@ -1,45 +0,0 @@
-getMock('Guzzle\Inflection\Inflector', array('snake', 'camel'));
- $mock->expects($this->once())->method('snake')->with('Test')->will($this->returnValue('test'));
- $mock->expects($this->once())->method('camel')->with('Test')->will($this->returnValue('Test'));
- $inflector = new PreComputedInflector($mock, array('FooBar' => 'foo_bar'), array('foo_bar' => 'FooBar'));
- $this->assertEquals('FooBar', $inflector->camel('foo_bar'));
- $this->assertEquals('foo_bar', $inflector->snake('FooBar'));
- $this->assertEquals('Test', $inflector->camel('Test'));
- $this->assertEquals('test', $inflector->snake('Test'));
- }
-
- public function testMirrorsPrecomputedValues()
- {
- $mock = $this->getMock('Guzzle\Inflection\Inflector', array('snake', 'camel'));
- $mock->expects($this->never())->method('snake');
- $mock->expects($this->never())->method('camel');
- $inflector = new PreComputedInflector($mock, array('Zeep' => 'zeep'), array(), true);
- $this->assertEquals('Zeep', $inflector->camel('zeep'));
- $this->assertEquals('zeep', $inflector->snake('Zeep'));
- }
-
- public function testMirrorsPrecomputedValuesByMerging()
- {
- $mock = $this->getMock('Guzzle\Inflection\Inflector', array('snake', 'camel'));
- $mock->expects($this->never())->method('snake');
- $mock->expects($this->never())->method('camel');
- $inflector = new PreComputedInflector($mock, array('Zeep' => 'zeep'), array('foo' => 'Foo'), true);
- $this->assertEquals('Zeep', $inflector->camel('zeep'));
- $this->assertEquals('zeep', $inflector->snake('Zeep'));
- $this->assertEquals('Foo', $inflector->camel('foo'));
- $this->assertEquals('foo', $inflector->snake('Foo'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Iterator/AppendIteratorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Iterator/AppendIteratorTest.php
deleted file mode 100644
index 8d6ae84..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Iterator/AppendIteratorTest.php
+++ /dev/null
@@ -1,29 +0,0 @@
- 1,
- 'b' => 2
- ));
- $b = new \ArrayIterator(array());
- $c = new \ArrayIterator(array(
- 'c' => 3,
- 'd' => 4
- ));
- $i = new AppendIterator();
- $i->append($a);
- $i->append($b);
- $i->append($c);
- $this->assertEquals(array(1, 2, 3, 4), iterator_to_array($i, false));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Iterator/ChunkedIteratorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Iterator/ChunkedIteratorTest.php
deleted file mode 100644
index ec4c129..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Iterator/ChunkedIteratorTest.php
+++ /dev/null
@@ -1,52 +0,0 @@
-assertEquals(11, count($chunks));
- foreach ($chunks as $j => $chunk) {
- $this->assertEquals(range($j * 10, min(100, $j * 10 + 9)), $chunk);
- }
- }
-
- public function testChunksIteratorWithOddValues()
- {
- $chunked = new ChunkedIterator(new \ArrayIterator(array(1, 2, 3, 4, 5)), 2);
- $chunks = iterator_to_array($chunked, false);
- $this->assertEquals(3, count($chunks));
- $this->assertEquals(array(1, 2), $chunks[0]);
- $this->assertEquals(array(3, 4), $chunks[1]);
- $this->assertEquals(array(5), $chunks[2]);
- }
-
- public function testMustNotTerminateWithTraversable()
- {
- $traversable = simplexml_load_string(' ')->foo;
- $chunked = new ChunkedIterator($traversable, 2);
- $actual = iterator_to_array($chunked, false);
- $this->assertCount(2, $actual);
- }
-
- public function testSizeOfZeroMakesIteratorInvalid() {
- $chunked = new ChunkedIterator(new \ArrayIterator(range(1, 5)), 0);
- $chunked->rewind();
- $this->assertFalse($chunked->valid());
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testSizeLowerZeroThrowsException() {
- new ChunkedIterator(new \ArrayIterator(range(1, 5)), -1);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Iterator/FilterIteratorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Iterator/FilterIteratorTest.php
deleted file mode 100644
index 73b4f69..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Iterator/FilterIteratorTest.php
+++ /dev/null
@@ -1,28 +0,0 @@
-assertEquals(range(1, 99, 2), iterator_to_array($i, false));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesCallable()
- {
- $i = new FilterIterator(new \ArrayIterator(), new \stdClass());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Iterator/MapIteratorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Iterator/MapIteratorTest.php
deleted file mode 100644
index 4de4a6b..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Iterator/MapIteratorTest.php
+++ /dev/null
@@ -1,28 +0,0 @@
-assertEquals(range(0, 1000, 10), iterator_to_array($i, false));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesCallable()
- {
- $i = new MapIterator(new \ArrayIterator(), new \stdClass());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Iterator/MethodProxyIteratorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Iterator/MethodProxyIteratorTest.php
deleted file mode 100644
index 5bcf06f..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Iterator/MethodProxyIteratorTest.php
+++ /dev/null
@@ -1,28 +0,0 @@
-append('a');
- $proxy->append('b');
- $this->assertEquals(array('a', 'b'), $i->getArrayCopy());
- $this->assertEquals(array('a', 'b'), $proxy->getArrayCopy());
- }
-
- public function testUsesInnerIterator()
- {
- $i = new MethodProxyIterator(new ChunkedIterator(new \ArrayIterator(array(1, 2, 3, 4, 5)), 2));
- $this->assertEquals(3, count(iterator_to_array($i, false)));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Log/ArrayLogAdapterTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Log/ArrayLogAdapterTest.php
deleted file mode 100644
index a66882f..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Log/ArrayLogAdapterTest.php
+++ /dev/null
@@ -1,23 +0,0 @@
-log('test', \LOG_NOTICE, '127.0.0.1');
- $this->assertEquals(array(array('message' => 'test', 'priority' => \LOG_NOTICE, 'extras' => '127.0.0.1')), $adapter->getLogs());
- }
-
- public function testClearLog()
- {
- $adapter = new ArrayLogAdapter();
- $adapter->log('test', \LOG_NOTICE, '127.0.0.1');
- $adapter->clearLogs();
- $this->assertEquals(array(), $adapter->getLogs());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Log/ClosureLogAdapterTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Log/ClosureLogAdapterTest.php
deleted file mode 100644
index 0177dc0..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Log/ClosureLogAdapterTest.php
+++ /dev/null
@@ -1,30 +0,0 @@
-adapter = new ClosureLogAdapter(function($message, $priority, $extras = null) use ($that, &$modified) {
- $modified = array($message, $priority, $extras);
- });
- $this->adapter->log('test', LOG_NOTICE, '127.0.0.1');
- $this->assertEquals(array('test', LOG_NOTICE, '127.0.0.1'), $modified);
- }
-
- /**
- * @expectedException InvalidArgumentException
- */
- public function testThrowsExceptionWhenNotCallable()
- {
- $this->adapter = new ClosureLogAdapter(123);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Log/MessageFormatterTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Log/MessageFormatterTest.php
deleted file mode 100644
index 3ff4b07..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Log/MessageFormatterTest.php
+++ /dev/null
@@ -1,143 +0,0 @@
-request = new EntityEnclosingRequest('POST', 'http://foo.com?q=test', array(
- 'X-Foo' => 'bar',
- 'Authorization' => 'Baz'
- ));
- $this->request->setBody(EntityBody::factory('Hello'));
-
- $this->response = new Response(200, array(
- 'X-Test' => 'Abc'
- ), 'Foo');
-
- $this->handle = $this->getMockBuilder('Guzzle\Http\Curl\CurlHandle')
- ->disableOriginalConstructor()
- ->setMethods(array('getError', 'getErrorNo', 'getStderr', 'getInfo'))
- ->getMock();
-
- $this->handle->expects($this->any())
- ->method('getError')
- ->will($this->returnValue('e'));
-
- $this->handle->expects($this->any())
- ->method('getErrorNo')
- ->will($this->returnValue('123'));
-
- $this->handle->expects($this->any())
- ->method('getStderr')
- ->will($this->returnValue('testing'));
-
- $this->handle->expects($this->any())
- ->method('getInfo')
- ->will($this->returnValueMap(array(
- array(CURLINFO_CONNECT_TIME, '123'),
- array(CURLINFO_TOTAL_TIME, '456')
- )));
- }
-
- public function logProvider()
- {
- return array(
- // Uses the cache for the second time
- array('{method} - {method}', 'POST - POST'),
- array('{url}', 'http://foo.com?q=test'),
- array('{port}', '80'),
- array('{resource}', '/?q=test'),
- array('{host}', 'foo.com'),
- array('{hostname}', gethostname()),
- array('{protocol}/{version}', 'HTTP/1.1'),
- array('{code} {phrase}', '200 OK'),
- array('{req_header_Foo}', ''),
- array('{req_header_X-Foo}', 'bar'),
- array('{req_header_Authorization}', 'Baz'),
- array('{res_header_foo}', ''),
- array('{res_header_X-Test}', 'Abc'),
- array('{req_body}', 'Hello'),
- array('{res_body}', 'Foo'),
- array('{curl_stderr}', 'testing'),
- array('{curl_error}', 'e'),
- array('{curl_code}', '123'),
- array('{connect_time}', '123'),
- array('{total_time}', '456')
- );
- }
-
- /**
- * @dataProvider logProvider
- */
- public function testFormatsMessages($template, $output)
- {
- $formatter = new MessageFormatter($template);
- $this->assertEquals($output, $formatter->format($this->request, $this->response, $this->handle));
- }
-
- public function testFormatsRequestsAndResponses()
- {
- $formatter = new MessageFormatter();
- $formatter->setTemplate('{request}{response}');
- $this->assertEquals($this->request . $this->response, $formatter->format($this->request, $this->response));
- }
-
- public function testAddsTimestamp()
- {
- $formatter = new MessageFormatter('{ts}');
- $this->assertNotEmpty($formatter->format($this->request, $this->response));
- }
-
- public function testUsesResponseWhenNoHandleAndGettingCurlInformation()
- {
- $formatter = new MessageFormatter('{connect_time}/{total_time}');
- $response = $this->getMockBuilder('Guzzle\Http\Message\Response')
- ->setConstructorArgs(array(200))
- ->setMethods(array('getInfo'))
- ->getMock();
- $response->expects($this->exactly(2))
- ->method('getInfo')
- ->will($this->returnValueMap(array(
- array('connect_time', '1'),
- array('total_time', '2'),
- )));
- $this->assertEquals('1/2', $formatter->format($this->request, $response));
- }
-
- public function testUsesEmptyStringWhenNoHandleAndNoResponse()
- {
- $formatter = new MessageFormatter('{connect_time}/{total_time}');
- $this->assertEquals('/', $formatter->format($this->request));
- }
-
- public function testInjectsTotalTime()
- {
- $out = '';
- $formatter = new MessageFormatter('{connect_time}/{total_time}');
- $adapter = new ClosureLogAdapter(function ($m) use (&$out) { $out .= $m; });
- $log = new LogPlugin($adapter, $formatter);
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nHI");
- $client = new Client($this->getServer()->getUrl());
- $client->addSubscriber($log);
- $client->get('/')->send();
- $this->assertNotEquals('/', $out);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Log/PsrLogAdapterTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Log/PsrLogAdapterTest.php
deleted file mode 100644
index 7b72dd6..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Log/PsrLogAdapterTest.php
+++ /dev/null
@@ -1,25 +0,0 @@
-pushHandler($handler);
- $adapter = new PsrLogAdapter($log);
- $adapter->log('test!', LOG_INFO);
- $this->assertTrue($handler->hasInfoRecords());
- $this->assertSame($log, $adapter->getLogObject());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Log/Zf2LogAdapterTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Log/Zf2LogAdapterTest.php
deleted file mode 100644
index 1b61283..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Log/Zf2LogAdapterTest.php
+++ /dev/null
@@ -1,51 +0,0 @@
-stream = fopen('php://temp', 'r+');
- $this->log = new Logger();
- $this->log->addWriter(new Stream($this->stream));
- $this->adapter = new Zf2LogAdapter($this->log);
-
- }
-
- public function testLogsMessagesToAdaptedObject()
- {
- // Test without a priority
- $this->adapter->log('Zend_Test!', \LOG_NOTICE);
- rewind($this->stream);
- $contents = stream_get_contents($this->stream);
- $this->assertEquals(1, substr_count($contents, 'Zend_Test!'));
-
- // Test with a priority
- $this->adapter->log('Zend_Test!', \LOG_ALERT);
- rewind($this->stream);
- $contents = stream_get_contents($this->stream);
- $this->assertEquals(2, substr_count($contents, 'Zend_Test!'));
- }
-
- public function testExposesAdaptedLogObject()
- {
- $this->assertEquals($this->log, $this->adapter->getLogObject());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Mock/CustomResponseModel.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Mock/CustomResponseModel.php
deleted file mode 100644
index 3fb6527..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Mock/CustomResponseModel.php
+++ /dev/null
@@ -1,21 +0,0 @@
-command = $command;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Mock/ErrorResponseMock.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Mock/ErrorResponseMock.php
deleted file mode 100644
index aabb15f..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Mock/ErrorResponseMock.php
+++ /dev/null
@@ -1,25 +0,0 @@
-command = $command;
- $this->response = $response;
- $this->message = 'Error from ' . $response;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Mock/ExceptionMock.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Mock/ExceptionMock.php
deleted file mode 100644
index 97a1974..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Mock/ExceptionMock.php
+++ /dev/null
@@ -1,11 +0,0 @@
-multiHandle;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Mock/MockObserver.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Mock/MockObserver.php
deleted file mode 100644
index 11e22eb..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Mock/MockObserver.php
+++ /dev/null
@@ -1,65 +0,0 @@
-events as $event) {
- if ($event->getName() == $eventName) {
- return true;
- }
- }
-
- return false;
- }
-
- public function getLastEvent()
- {
- return end($this->events);
- }
-
- public function count()
- {
- return count($this->events);
- }
-
- public function getGrouped()
- {
- $events = array();
- foreach ($this->events as $event) {
- if (!isset($events[$event->getName()])) {
- $events[$event->getName()] = array();
- }
- $events[$event->getName()][] = $event;
- }
-
- return $events;
- }
-
- public function getData($event, $key, $occurrence = 0)
- {
- $grouped = $this->getGrouped();
- if (isset($grouped[$event])) {
- return $grouped[$event][$occurrence][$key];
- }
-
- return null;
- }
-
- public function update(Event $event)
- {
- $this->events[] = $event;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Mock/MockSubject.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Mock/MockSubject.php
deleted file mode 100644
index e011959..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Mock/MockSubject.php
+++ /dev/null
@@ -1,7 +0,0 @@
- 'allseeing-i.com',
- 'path' => '/',
- 'data' => array(
- 'PHPSESSID' => '6c951590e7a9359bcedde25cda73e43c'
- ),
- 'max_age' => NULL,
- 'expires' => 'Sat, 26-Jul-2008 17:00:42 GMT',
- 'version' => NULL,
- 'secure' => NULL,
- 'discard' => NULL,
- 'port' => NULL,
- 'cookies' => array(
- 'ASIHTTPRequestTestCookie' => 'This+is+the+value'
- ),
- 'comment' => null,
- 'comment_url' => null,
- 'http_only' => false
- )
- ),
- array('', false),
- array('foo', false),
- // Test setting a blank value for a cookie
- array(array(
- 'foo=', 'foo =', 'foo =;', 'foo= ;', 'foo =', 'foo= '),
- array(
- 'cookies' => array(
- 'foo' => ''
- ),
- 'data' => array(),
- 'discard' => null,
- 'domain' => null,
- 'expires' => null,
- 'max_age' => null,
- 'path' => '/',
- 'port' => null,
- 'secure' => null,
- 'version' => null,
- 'comment' => null,
- 'comment_url' => null,
- 'http_only' => false
- )
- ),
- // Test setting a value and removing quotes
- array(array(
- 'foo=1', 'foo =1', 'foo =1;', 'foo=1 ;', 'foo =1', 'foo= 1', 'foo = 1 ;', 'foo="1"', 'foo="1";', 'foo= "1";'),
- array(
- 'cookies' => array(
- 'foo' => '1'
- ),
- 'data' => array(),
- 'discard' => null,
- 'domain' => null,
- 'expires' => null,
- 'max_age' => null,
- 'path' => '/',
- 'port' => null,
- 'secure' => null,
- 'version' => null,
- 'comment' => null,
- 'comment_url' => null,
- 'http_only' => false
- )
- ),
- // Test setting multiple values
- array(array(
- 'foo=1; bar=2;', 'foo =1; bar = "2"', 'foo=1; bar=2'),
- array(
- 'cookies' => array(
- 'foo' => '1',
- 'bar' => '2',
- ),
- 'data' => array(),
- 'discard' => null,
- 'domain' => null,
- 'expires' => null,
- 'max_age' => null,
- 'path' => '/',
- 'port' => null,
- 'secure' => null,
- 'version' => null,
- 'comment' => null,
- 'comment_url' => null,
- 'http_only' => false
- )
- ),
- // Tests getting the domain and path from a reference request
- array(array(
- 'foo=1; port="80,8081"; httponly', 'foo=1; port="80,8081"; domain=www.test.com; HttpOnly;', 'foo=1; ; domain=www.test.com; path=/path; port="80,8081"; HttpOnly;'),
- array(
- 'cookies' => array(
- 'foo' => 1
- ),
- 'data' => array(),
- 'discard' => null,
- 'domain' => 'www.test.com',
- 'expires' => null,
- 'max_age' => null,
- 'path' => '/path',
- 'port' => array('80', '8081'),
- 'secure' => null,
- 'version' => null,
- 'comment' => null,
- 'comment_url' => null,
- 'http_only' => true
- ),
- 'http://www.test.com/path/'
- ),
- // Some of the following tests are based on http://framework.zend.com/svn/framework/standard/trunk/tests/Zend/Http/CookieTest.php
- array(
- 'justacookie=foo; domain=example.com',
- array(
- 'cookies' => array(
- 'justacookie' => 'foo'
- ),
- 'domain' => 'example.com',
- 'data' => array(),
- 'discard' => null,
- 'expires' => null,
- 'max_age' => null,
- 'path' => '/',
- 'port' => null,
- 'secure' => null,
- 'version' => null,
- 'comment' => null,
- 'comment_url' => null,
- 'http_only' => false
- )
- ),
- array(
- 'expires=tomorrow; secure; path=/Space Out/; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=.example.com',
- array(
- 'cookies' => array(
- 'expires' => 'tomorrow'
- ),
- 'domain' => '.example.com',
- 'path' => '/Space Out/',
- 'expires' => 'Tue, 21-Nov-2006 08:33:44 GMT',
- 'data' => array(),
- 'discard' => null,
- 'port' => null,
- 'secure' => true,
- 'version' => null,
- 'max_age' => null,
- 'comment' => null,
- 'comment_url' => null,
- 'http_only' => false
- )
- ),
- array(
- 'domain=unittests; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=example.com; path=/some value/',
- array(
- 'cookies' => array(
- 'domain' => 'unittests'
- ),
- 'domain' => 'example.com',
- 'path' => '/some value/',
- 'expires' => 'Tue, 21-Nov-2006 08:33:44 GMT',
- 'secure' => false,
- 'data' => array(),
- 'discard' => null,
- 'max_age' => null,
- 'port' => null,
- 'version' => null,
- 'comment' => null,
- 'comment_url' => null,
- 'http_only' => false
- )
- ),
- array(
- 'path=indexAction; path=/; domain=.foo.com; expires=Tue, 21-Nov-2006 08:33:44 GMT',
- array(
- 'cookies' => array(
- 'path' => 'indexAction'
- ),
- 'domain' => '.foo.com',
- 'path' => '/',
- 'expires' => 'Tue, 21-Nov-2006 08:33:44 GMT',
- 'secure' => false,
- 'data' => array(),
- 'discard' => null,
- 'max_age' => null,
- 'port' => null,
- 'version' => null,
- 'comment' => null,
- 'comment_url' => null,
- 'http_only' => false
- )
- ),
- array(
- 'secure=sha1; secure; SECURE; domain=some.really.deep.domain.com; version=1; Max-Age=86400',
- array(
- 'cookies' => array(
- 'secure' => 'sha1'
- ),
- 'domain' => 'some.really.deep.domain.com',
- 'path' => '/',
- 'secure' => true,
- 'data' => array(),
- 'discard' => null,
- 'expires' => time() + 86400,
- 'max_age' => 86400,
- 'port' => null,
- 'version' => 1,
- 'comment' => null,
- 'comment_url' => null,
- 'http_only' => false
- )
- ),
- array(
- 'PHPSESSID=123456789+abcd%2Cef; secure; discard; domain=.localdomain; path=/foo/baz; expires=Tue, 21-Nov-2006 08:33:44 GMT;',
- array(
- 'cookies' => array(
- 'PHPSESSID' => '123456789+abcd%2Cef'
- ),
- 'domain' => '.localdomain',
- 'path' => '/foo/baz',
- 'expires' => 'Tue, 21-Nov-2006 08:33:44 GMT',
- 'secure' => true,
- 'data' => array(),
- 'discard' => true,
- 'max_age' => null,
- 'port' => null,
- 'version' => null,
- 'comment' => null,
- 'comment_url' => null,
- 'http_only' => false
- )
- ),
- // rfc6265#section-5.1.4
- array(
- 'cookie=value',
- array(
- 'cookies' => array(
- 'cookie' => 'value'
- ),
- 'domain' => 'example.com',
- 'data' => array(),
- 'discard' => null,
- 'expires' => null,
- 'max_age' => null,
- 'path' => '/some/path',
- 'port' => null,
- 'secure' => null,
- 'version' => null,
- 'comment' => null,
- 'comment_url' => null,
- 'http_only' => false
- ),
- 'http://example.com/some/path/test.html'
- ),
- array(
- 'empty=path',
- array(
- 'cookies' => array(
- 'empty' => 'path'
- ),
- 'domain' => 'example.com',
- 'data' => array(),
- 'discard' => null,
- 'expires' => null,
- 'max_age' => null,
- 'path' => '/',
- 'port' => null,
- 'secure' => null,
- 'version' => null,
- 'comment' => null,
- 'comment_url' => null,
- 'http_only' => false
- ),
- 'http://example.com/test.html'
- ),
- array(
- 'baz=qux',
- array(
- 'cookies' => array(
- 'baz' => 'qux'
- ),
- 'domain' => 'example.com',
- 'data' => array(),
- 'discard' => null,
- 'expires' => null,
- 'max_age' => null,
- 'path' => '/',
- 'port' => null,
- 'secure' => null,
- 'version' => null,
- 'comment' => null,
- 'comment_url' => null,
- 'http_only' => false
- ),
- 'http://example.com?query=here'
- ),
- array(
- 'test=noSlashPath; path=someString',
- array(
- 'cookies' => array(
- 'test' => 'noSlashPath'
- ),
- 'domain' => 'example.com',
- 'data' => array(),
- 'discard' => null,
- 'expires' => null,
- 'max_age' => null,
- 'path' => '/real/path',
- 'port' => null,
- 'secure' => null,
- 'version' => null,
- 'comment' => null,
- 'comment_url' => null,
- 'http_only' => false
- ),
- 'http://example.com/real/path/'
- ),
- );
- }
-
- /**
- * @dataProvider cookieParserDataProvider
- */
- public function testParseCookie($cookie, $parsed, $url = null)
- {
- $c = $this->cookieParserClass;
- $parser = new $c();
-
- $request = null;
- if ($url) {
- $url = Url::factory($url);
- $host = $url->getHost();
- $path = $url->getPath();
- } else {
- $host = '';
- $path = '';
- }
-
- foreach ((array) $cookie as $c) {
- $p = $parser->parseCookie($c, $host, $path);
-
- // Remove expires values from the assertion if they are relatively equal by allowing a 5 minute difference
- if ($p['expires'] != $parsed['expires']) {
- if (abs($p['expires'] - $parsed['expires']) < 300) {
- unset($p['expires']);
- unset($parsed['expires']);
- }
- }
-
- if (is_array($parsed)) {
- foreach ($parsed as $key => $value) {
- $this->assertEquals($parsed[$key], $p[$key], 'Comparing ' . $key . ' ' . var_export($value, true) . ' : ' . var_export($parsed, true) . ' | ' . var_export($p, true));
- }
-
- foreach ($p as $key => $value) {
- $this->assertEquals($p[$key], $parsed[$key], 'Comparing ' . $key . ' ' . var_export($value, true) . ' : ' . var_export($parsed, true) . ' | ' . var_export($p, true));
- }
- } else {
- $this->assertEquals($parsed, $p);
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/Cookie/CookieParserTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/Cookie/CookieParserTest.php
deleted file mode 100644
index 75d336f..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/Cookie/CookieParserTest.php
+++ /dev/null
@@ -1,22 +0,0 @@
-parseCookie('foo=baz+bar', null, null, true);
- $this->assertEquals(array(
- 'foo' => 'baz bar'
- ), $result['cookies']);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/Message/MessageParserProvider.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/Message/MessageParserProvider.php
deleted file mode 100644
index da58bb4..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/Message/MessageParserProvider.php
+++ /dev/null
@@ -1,225 +0,0 @@
- 'GET',
- 'protocol' => 'HTTP',
- 'version' => '1.1',
- 'request_url' => array(
- 'scheme' => 'http',
- 'host' => '',
- 'port' => '',
- 'path' => '/',
- 'query' => ''
- ),
- 'headers' => array(),
- 'body' => ''
- )),
- // Path and query string, multiple header values per header and case sensitive storage
- array("HEAD /path?query=foo HTTP/1.0\r\nHost: example.com\r\nX-Foo: foo\r\nx-foo: Bar\r\nX-Foo: foo\r\nX-Foo: Baz\r\n\r\n", array(
- 'method' => 'HEAD',
- 'protocol' => 'HTTP',
- 'version' => '1.0',
- 'request_url' => array(
- 'scheme' => 'http',
- 'host' => 'example.com',
- 'port' => '',
- 'path' => '/path',
- 'query' => 'query=foo'
- ),
- 'headers' => array(
- 'Host' => 'example.com',
- 'X-Foo' => array('foo', 'foo', 'Baz'),
- 'x-foo' => 'Bar'
- ),
- 'body' => ''
- )),
- // Includes a body
- array("PUT / HTTP/1.0\r\nhost: example.com:443\r\nContent-Length: 4\r\n\r\ntest", array(
- 'method' => 'PUT',
- 'protocol' => 'HTTP',
- 'version' => '1.0',
- 'request_url' => array(
- 'scheme' => 'https',
- 'host' => 'example.com',
- 'port' => '443',
- 'path' => '/',
- 'query' => ''
- ),
- 'headers' => array(
- 'host' => 'example.com:443',
- 'Content-Length' => '4'
- ),
- 'body' => 'test'
- )),
- // Includes Authorization headers
- array("GET / HTTP/1.1\r\nHost: example.com:8080\r\nAuthorization: Basic {$auth}\r\n\r\n", array(
- 'method' => 'GET',
- 'protocol' => 'HTTP',
- 'version' => '1.1',
- 'request_url' => array(
- 'scheme' => 'http',
- 'host' => 'example.com',
- 'port' => '8080',
- 'path' => '/',
- 'query' => ''
- ),
- 'headers' => array(
- 'Host' => 'example.com:8080',
- 'Authorization' => "Basic {$auth}"
- ),
- 'body' => ''
- )),
- // Include authorization header
- array("GET / HTTP/1.1\r\nHost: example.com:8080\r\nauthorization: Basic {$auth}\r\n\r\n", array(
- 'method' => 'GET',
- 'protocol' => 'HTTP',
- 'version' => '1.1',
- 'request_url' => array(
- 'scheme' => 'http',
- 'host' => 'example.com',
- 'port' => '8080',
- 'path' => '/',
- 'query' => ''
- ),
- 'headers' => array(
- 'Host' => 'example.com:8080',
- 'authorization' => "Basic {$auth}"
- ),
- 'body' => ''
- )),
- );
- }
-
- public function responseProvider()
- {
- return array(
- // Empty request
- array('', false),
-
- array("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", array(
- 'protocol' => 'HTTP',
- 'version' => '1.1',
- 'code' => '200',
- 'reason_phrase' => 'OK',
- 'headers' => array(
- 'Content-Length' => 0
- ),
- 'body' => ''
- )),
- array("HTTP/1.0 400 Bad Request\r\nContent-Length: 0\r\n\r\n", array(
- 'protocol' => 'HTTP',
- 'version' => '1.0',
- 'code' => '400',
- 'reason_phrase' => 'Bad Request',
- 'headers' => array(
- 'Content-Length' => 0
- ),
- 'body' => ''
- )),
- array("HTTP/1.0 100 Continue\r\n\r\n", array(
- 'protocol' => 'HTTP',
- 'version' => '1.0',
- 'code' => '100',
- 'reason_phrase' => 'Continue',
- 'headers' => array(),
- 'body' => ''
- )),
- array("HTTP/1.1 204 No Content\r\nX-Foo: foo\r\nx-foo: Bar\r\nX-Foo: foo\r\n\r\n", array(
- 'protocol' => 'HTTP',
- 'version' => '1.1',
- 'code' => '204',
- 'reason_phrase' => 'No Content',
- 'headers' => array(
- 'X-Foo' => array('foo', 'foo'),
- 'x-foo' => 'Bar'
- ),
- 'body' => ''
- )),
- array("HTTP/1.1 200 Ok that is great!\r\nContent-Length: 4\r\n\r\nTest", array(
- 'protocol' => 'HTTP',
- 'version' => '1.1',
- 'code' => '200',
- 'reason_phrase' => 'Ok that is great!',
- 'headers' => array(
- 'Content-Length' => 4
- ),
- 'body' => 'Test'
- )),
- );
- }
-
- public function compareRequestResults($result, $expected)
- {
- if (!$result) {
- $this->assertFalse($expected);
- return;
- }
-
- $this->assertEquals($result['method'], $expected['method']);
- $this->assertEquals($result['protocol'], $expected['protocol']);
- $this->assertEquals($result['version'], $expected['version']);
- $this->assertEquals($result['request_url'], $expected['request_url']);
- $this->assertEquals($result['body'], $expected['body']);
- $this->compareHttpHeaders($result['headers'], $expected['headers']);
- }
-
- public function compareResponseResults($result, $expected)
- {
- if (!$result) {
- $this->assertFalse($expected);
- return;
- }
-
- $this->assertEquals($result['protocol'], $expected['protocol']);
- $this->assertEquals($result['version'], $expected['version']);
- $this->assertEquals($result['code'], $expected['code']);
- $this->assertEquals($result['reason_phrase'], $expected['reason_phrase']);
- $this->assertEquals($result['body'], $expected['body']);
- $this->compareHttpHeaders($result['headers'], $expected['headers']);
- }
-
- protected function normalizeHeaders($headers)
- {
- $normalized = array();
- foreach ($headers as $key => $value) {
- $key = strtolower($key);
- if (!isset($normalized[$key])) {
- $normalized[$key] = $value;
- } elseif (!is_array($normalized[$key])) {
- $normalized[$key] = array($value);
- } else {
- $normalized[$key][] = $value;
- }
- }
-
- foreach ($normalized as $key => &$value) {
- if (is_array($value)) {
- sort($value);
- }
- }
-
- return $normalized;
- }
-
- public function compareHttpHeaders($result, $expected)
- {
- // Aggregate all headers case-insensitively
- $result = $this->normalizeHeaders($result);
- $expected = $this->normalizeHeaders($expected);
- $this->assertEquals($result, $expected);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/Message/MessageParserTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/Message/MessageParserTest.php
deleted file mode 100644
index 2f52228..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/Message/MessageParserTest.php
+++ /dev/null
@@ -1,58 +0,0 @@
-compareRequestResults($parts, $parser->parseRequest($message));
- }
-
- /**
- * @dataProvider responseProvider
- */
- public function testParsesResponses($message, $parts)
- {
- $parser = new MessageParser();
- $this->compareResponseResults($parts, $parser->parseResponse($message));
- }
-
- public function testParsesRequestsWithMissingProtocol()
- {
- $parser = new MessageParser();
- $parts = $parser->parseRequest("GET /\r\nHost: Foo.com\r\n\r\n");
- $this->assertEquals('GET', $parts['method']);
- $this->assertEquals('HTTP', $parts['protocol']);
- $this->assertEquals('1.1', $parts['version']);
- }
-
- public function testParsesRequestsWithMissingVersion()
- {
- $parser = new MessageParser();
- $parts = $parser->parseRequest("GET / HTTP\r\nHost: Foo.com\r\n\r\n");
- $this->assertEquals('GET', $parts['method']);
- $this->assertEquals('HTTP', $parts['protocol']);
- $this->assertEquals('1.1', $parts['version']);
- }
-
- public function testParsesResponsesWithMissingReasonPhrase()
- {
- $parser = new MessageParser();
- $parts = $parser->parseResponse("HTTP/1.1 200\r\n\r\n");
- $this->assertEquals('200', $parts['code']);
- $this->assertEquals('', $parts['reason_phrase']);
- $this->assertEquals('HTTP', $parts['protocol']);
- $this->assertEquals('1.1', $parts['version']);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/Message/PeclHttpMessageParserTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/Message/PeclHttpMessageParserTest.php
deleted file mode 100644
index 6706e20..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/Message/PeclHttpMessageParserTest.php
+++ /dev/null
@@ -1,36 +0,0 @@
-markTestSkipped('pecl_http is not available.');
- }
- }
-
- /**
- * @dataProvider requestProvider
- */
- public function testParsesRequests($message, $parts)
- {
- $parser = new PeclHttpMessageParser();
- $this->compareRequestResults($parts, $parser->parseRequest($message));
- }
-
- /**
- * @dataProvider responseProvider
- */
- public function testParsesResponses($message, $parts)
- {
- $parser = new PeclHttpMessageParser();
- $this->compareResponseResults($parts, $parser->parseResponse($message));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/ParserRegistryTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/ParserRegistryTest.php
deleted file mode 100644
index 7675efb..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/ParserRegistryTest.php
+++ /dev/null
@@ -1,33 +0,0 @@
-registerParser('foo', $c);
- $this->assertSame($c, $r->getParser('foo'));
- }
-
- public function testReturnsNullWhenNotFound()
- {
- $r = new ParserRegistry();
- $this->assertNull($r->getParser('FOO'));
- }
-
- public function testReturnsLazyLoadedDefault()
- {
- $r = new ParserRegistry();
- $c = $r->getParser('cookie');
- $this->assertInstanceOf('Guzzle\Parser\Cookie\CookieParser', $c);
- $this->assertSame($c, $r->getParser('cookie'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/UriTemplate/AbstractUriTemplateTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/UriTemplate/AbstractUriTemplateTest.php
deleted file mode 100644
index a05fc2e..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/UriTemplate/AbstractUriTemplateTest.php
+++ /dev/null
@@ -1,113 +0,0 @@
- 'value',
- 'hello' => 'Hello World!',
- 'empty' => '',
- 'path' => '/foo/bar',
- 'x' => '1024',
- 'y' => '768',
- 'null' => null,
- 'list' => array('red', 'green', 'blue'),
- 'keys' => array(
- "semi" => ';',
- "dot" => '.',
- "comma" => ','
- ),
- 'empty_keys' => array(),
- );
-
- return array_map(function($t) use ($params) {
- $t[] = $params;
- return $t;
- }, array(
- array('foo', 'foo'),
- array('{var}', 'value'),
- array('{hello}', 'Hello%20World%21'),
- array('{+var}', 'value'),
- array('{+hello}', 'Hello%20World!'),
- array('{+path}/here', '/foo/bar/here'),
- array('here?ref={+path}', 'here?ref=/foo/bar'),
- array('X{#var}', 'X#value'),
- array('X{#hello}', 'X#Hello%20World!'),
- array('map?{x,y}', 'map?1024,768'),
- array('{x,hello,y}', '1024,Hello%20World%21,768'),
- array('{+x,hello,y}', '1024,Hello%20World!,768'),
- array('{+path,x}/here', '/foo/bar,1024/here'),
- array('{#x,hello,y}', '#1024,Hello%20World!,768'),
- array('{#path,x}/here', '#/foo/bar,1024/here'),
- array('X{.var}', 'X.value'),
- array('X{.x,y}', 'X.1024.768'),
- array('{/var}', '/value'),
- array('{/var,x}/here', '/value/1024/here'),
- array('{;x,y}', ';x=1024;y=768'),
- array('{;x,y,empty}', ';x=1024;y=768;empty'),
- array('{?x,y}', '?x=1024&y=768'),
- array('{?x,y,empty}', '?x=1024&y=768&empty='),
- array('?fixed=yes{&x}', '?fixed=yes&x=1024'),
- array('{&x,y,empty}', '&x=1024&y=768&empty='),
- array('{var:3}', 'val'),
- array('{var:30}', 'value'),
- array('{list}', 'red,green,blue'),
- array('{list*}', 'red,green,blue'),
- array('{keys}', 'semi,%3B,dot,.,comma,%2C'),
- array('{keys*}', 'semi=%3B,dot=.,comma=%2C'),
- array('{+path:6}/here', '/foo/b/here'),
- array('{+list}', 'red,green,blue'),
- array('{+list*}', 'red,green,blue'),
- array('{+keys}', 'semi,;,dot,.,comma,,'),
- array('{+keys*}', 'semi=;,dot=.,comma=,'),
- array('{#path:6}/here', '#/foo/b/here'),
- array('{#list}', '#red,green,blue'),
- array('{#list*}', '#red,green,blue'),
- array('{#keys}', '#semi,;,dot,.,comma,,'),
- array('{#keys*}', '#semi=;,dot=.,comma=,'),
- array('X{.var:3}', 'X.val'),
- array('X{.list}', 'X.red,green,blue'),
- array('X{.list*}', 'X.red.green.blue'),
- array('X{.keys}', 'X.semi,%3B,dot,.,comma,%2C'),
- array('X{.keys*}', 'X.semi=%3B.dot=..comma=%2C'),
- array('{/var:1,var}', '/v/value'),
- array('{/list}', '/red,green,blue'),
- array('{/list*}', '/red/green/blue'),
- array('{/list*,path:4}', '/red/green/blue/%2Ffoo'),
- array('{/keys}', '/semi,%3B,dot,.,comma,%2C'),
- array('{/keys*}', '/semi=%3B/dot=./comma=%2C'),
- array('{;hello:5}', ';hello=Hello'),
- array('{;list}', ';list=red,green,blue'),
- array('{;list*}', ';list=red;list=green;list=blue'),
- array('{;keys}', ';keys=semi,%3B,dot,.,comma,%2C'),
- array('{;keys*}', ';semi=%3B;dot=.;comma=%2C'),
- array('{?var:3}', '?var=val'),
- array('{?list}', '?list=red,green,blue'),
- array('{?list*}', '?list=red&list=green&list=blue'),
- array('{?keys}', '?keys=semi,%3B,dot,.,comma,%2C'),
- array('{?keys*}', '?semi=%3B&dot=.&comma=%2C'),
- array('{&var:3}', '&var=val'),
- array('{&list}', '&list=red,green,blue'),
- array('{&list*}', '&list=red&list=green&list=blue'),
- array('{&keys}', '&keys=semi,%3B,dot,.,comma,%2C'),
- array('{&keys*}', '&semi=%3B&dot=.&comma=%2C'),
- array('{.null}', ''),
- array('{.null,var}', '.value'),
- array('X{.empty_keys*}', 'X'),
- array('X{.empty_keys}', 'X'),
- // Test that missing expansions are skipped
- array('test{&missing*}', 'test'),
- // Test that multiple expansions can be set
- array('http://{var}/{var:2}{?keys*}', 'http://value/va?semi=%3B&dot=.&comma=%2C'),
- // Test more complex query string stuff
- array('http://www.test.com{+path}{?var,keys*}', 'http://www.test.com/foo/bar?var=value&semi=%3B&dot=.&comma=%2C')
- ));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/UriTemplate/PeclUriTemplateTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/UriTemplate/PeclUriTemplateTest.php
deleted file mode 100644
index 633c5d5..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/UriTemplate/PeclUriTemplateTest.php
+++ /dev/null
@@ -1,27 +0,0 @@
-markTestSkipped('uri_template PECL extension must be installed to test PeclUriTemplate');
- }
- }
-
- /**
- * @dataProvider templateProvider
- */
- public function testExpandsUriTemplates($template, $expansion, $params)
- {
- $uri = new PeclUriTemplate($template);
- $this->assertEquals($expansion, $uri->expand($template, $params));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/UriTemplate/UriTemplateTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/UriTemplate/UriTemplateTest.php
deleted file mode 100644
index 5130d6f..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Parser/UriTemplate/UriTemplateTest.php
+++ /dev/null
@@ -1,106 +0,0 @@
-assertEquals($expansion, $uri->expand($template, $params));
- }
-
- public function expressionProvider()
- {
- return array(
- array(
- '{+var*}', array(
- 'operator' => '+',
- 'values' => array(
- array('value' => 'var', 'modifier' => '*')
- )
- ),
- ),
- array(
- '{?keys,var,val}', array(
- 'operator' => '?',
- 'values' => array(
- array('value' => 'keys', 'modifier' => ''),
- array('value' => 'var', 'modifier' => ''),
- array('value' => 'val', 'modifier' => '')
- )
- ),
- ),
- array(
- '{+x,hello,y}', array(
- 'operator' => '+',
- 'values' => array(
- array('value' => 'x', 'modifier' => ''),
- array('value' => 'hello', 'modifier' => ''),
- array('value' => 'y', 'modifier' => '')
- )
- )
- )
- );
- }
-
- /**
- * @dataProvider expressionProvider
- */
- public function testParsesExpressions($exp, $data)
- {
- $template = new UriTemplate($exp);
-
- // Access the config object
- $class = new \ReflectionClass($template);
- $method = $class->getMethod('parseExpression');
- $method->setAccessible(true);
-
- $exp = substr($exp, 1, -1);
- $this->assertEquals($data, $method->invokeArgs($template, array($exp)));
- }
-
- /**
- * @ticket https://github.com/guzzle/guzzle/issues/90
- */
- public function testAllowsNestedArrayExpansion()
- {
- $template = new UriTemplate();
-
- $result = $template->expand('http://example.com{+path}{/segments}{?query,data*,foo*}', array(
- 'path' => '/foo/bar',
- 'segments' => array('one', 'two'),
- 'query' => 'test',
- 'data' => array(
- 'more' => array('fun', 'ice cream')
- ),
- 'foo' => array(
- 'baz' => array(
- 'bar' => 'fizz',
- 'test' => 'buzz'
- ),
- 'bam' => 'boo'
- )
- ));
-
- $this->assertEquals('http://example.com/foo/bar/one,two?query=test&more%5B0%5D=fun&more%5B1%5D=ice%20cream&baz%5Bbar%5D=fizz&baz%5Btest%5D=buzz&bam=boo', $result);
- }
-
- /**
- * @ticket https://github.com/guzzle/guzzle/issues/426
- */
- public function testSetRegex()
- {
- $template = new UriTemplate();
- $template->setRegex('/\<\$(.+)\>/');
- $this->assertSame('/foo', $template->expand('/<$a>', array('a' => 'foo')));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Async/AsyncPluginTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Async/AsyncPluginTest.php
deleted file mode 100644
index 16990a5..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Async/AsyncPluginTest.php
+++ /dev/null
@@ -1,93 +0,0 @@
-assertArrayHasKey('request.before_send', $events);
- $this->assertArrayHasKey('request.exception', $events);
- $this->assertArrayHasKey('curl.callback.progress', $events);
- }
-
- public function testEnablesProgressCallbacks()
- {
- $p = new AsyncPlugin();
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.example.com');
- $event = new Event(array(
- 'request' => $request
- ));
- $p->onBeforeSend($event);
- $this->assertEquals(true, $request->getCurlOptions()->get('progress'));
- }
-
- public function testAddsTimesOutAfterSending()
- {
- $p = new AsyncPlugin();
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.example.com');
- $handle = CurlHandle::factory($request);
- $event = new Event(array(
- 'request' => $request,
- 'handle' => $handle->getHandle(),
- 'uploaded' => 10,
- 'upload_size' => 10,
- 'downloaded' => 0
- ));
- $p->onCurlProgress($event);
- }
-
- public function testEnsuresRequestIsSet()
- {
- $p = new AsyncPlugin();
- $event = new Event(array(
- 'uploaded' => 10,
- 'upload_size' => 10,
- 'downloaded' => 0
- ));
- $p->onCurlProgress($event);
- }
-
- public function testMasksCurlExceptions()
- {
- $p = new AsyncPlugin();
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.example.com');
- $e = new CurlException('Error');
- $event = new Event(array(
- 'request' => $request,
- 'exception' => $e
- ));
- $p->onRequestTimeout($event);
- $this->assertEquals(RequestInterface::STATE_COMPLETE, $request->getState());
- $this->assertEquals(200, $request->getResponse()->getStatusCode());
- $this->assertTrue($request->getResponse()->hasHeader('X-Guzzle-Async'));
- }
-
- public function testEnsuresIntegration()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 204 FOO\r\nContent-Length: 4\r\n\r\ntest");
- $client = new Client($this->getServer()->getUrl());
- $request = $client->post('/', null, array(
- 'foo' => 'bar'
- ));
- $request->getEventDispatcher()->addSubscriber(new AsyncPlugin());
- $request->send();
- $this->assertEquals('', $request->getResponse()->getBody(true));
- $this->assertTrue($request->getResponse()->hasHeader('X-Guzzle-Async'));
- $received = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals('POST', $received[0]->getMethod());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/AbstractBackoffStrategyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/AbstractBackoffStrategyTest.php
deleted file mode 100644
index 72af263..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/AbstractBackoffStrategyTest.php
+++ /dev/null
@@ -1,86 +0,0 @@
-getMockBuilder('Guzzle\Plugin\Backoff\AbstractBackoffStrategy')
- ->setMethods(array('getDelay', 'makesDecision'))
- ->getMockForAbstractClass();
- }
-
- public function testReturnsZeroWhenNoNextAndGotNull()
- {
- $request = new Request('GET', 'http://www.foo.com');
- $mock = $this->getMockStrategy();
- $mock->expects($this->atLeastOnce())->method('getDelay')->will($this->returnValue(null));
- $this->assertEquals(0, $mock->getBackoffPeriod(0, $request));
- }
-
- public function testReturnsFalse()
- {
- $request = new Request('GET', 'http://www.foo.com');
- $mock = $this->getMockStrategy();
- $mock->expects($this->atLeastOnce())->method('getDelay')->will($this->returnValue(false));
- $this->assertEquals(false, $mock->getBackoffPeriod(0, $request));
- }
-
- public function testReturnsNextValueWhenNullOrTrue()
- {
- $request = new Request('GET', 'http://www.foo.com');
- $mock = $this->getMockStrategy();
- $mock->expects($this->atLeastOnce())->method('getDelay')->will($this->returnValue(null));
- $mock->expects($this->any())->method('makesDecision')->will($this->returnValue(false));
-
- $mock2 = $this->getMockStrategy();
- $mock2->expects($this->atLeastOnce())->method('getDelay')->will($this->returnValue(10));
- $mock2->expects($this->atLeastOnce())->method('makesDecision')->will($this->returnValue(true));
- $mock->setNext($mock2);
-
- $this->assertEquals(10, $mock->getBackoffPeriod(0, $request));
- }
-
- public function testReturnsFalseWhenNullAndNoNext()
- {
- $request = new Request('GET', 'http://www.foo.com');
- $s = new TruncatedBackoffStrategy(2);
- $this->assertFalse($s->getBackoffPeriod(0, $request));
- }
-
- public function testHasNext()
- {
- $a = new TruncatedBackoffStrategy(2);
- $b = new TruncatedBackoffStrategy(2);
- $a->setNext($b);
- $this->assertSame($b, $a->getNext());
- }
-
- public function testSkipsOtherDecisionsInChainWhenOneReturnsTrue()
- {
- $a = new CallbackBackoffStrategy(function () { return null; }, true);
- $b = new CallbackBackoffStrategy(function () { return true; }, true);
- $c = new CallbackBackoffStrategy(function () { return null; }, true);
- $d = new CallbackBackoffStrategy(function () { return 10; }, false);
- $a->setNext($b);
- $b->setNext($c);
- $c->setNext($d);
- $this->assertEquals(10, $a->getBackoffPeriod(2, new Request('GET', 'http://www.foo.com')));
- }
-
- public function testReturnsZeroWhenDecisionMakerReturnsTrueButNoFurtherStrategiesAreInTheChain()
- {
- $a = new CallbackBackoffStrategy(function () { return null; }, true);
- $b = new CallbackBackoffStrategy(function () { return true; }, true);
- $a->setNext($b);
- $this->assertSame(0, $a->getBackoffPeriod(2, new Request('GET', 'http://www.foo.com')));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/BackoffLoggerTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/BackoffLoggerTest.php
deleted file mode 100644
index a64dd82..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/BackoffLoggerTest.php
+++ /dev/null
@@ -1,110 +0,0 @@
-message = '';
- }
-
- public function testHasEventList()
- {
- $this->assertEquals(1, count(BackoffLogger::getSubscribedEvents()));
- }
-
- public function testLogsEvents()
- {
- list($logPlugin, $request, $response) = $this->getMocks();
-
- $response = $this->getMockBuilder('Guzzle\Http\Message\Response')
- ->setConstructorArgs(array(503))
- ->setMethods(array('getInfo'))
- ->getMock();
-
- $response->expects($this->any())
- ->method('getInfo')
- ->will($this->returnValue(2));
-
- $handle = $this->getMockHandle();
-
- $event = new Event(array(
- 'request' => $request,
- 'response' => $response,
- 'retries' => 1,
- 'delay' => 3,
- 'handle' => $handle
- ));
-
- $logPlugin->onRequestRetry($event);
- $this->assertContains(
- '] PUT http://www.example.com - 503 Service Unavailable - Retries: 1, Delay: 3, Time: 2, 2, cURL: 30 Foo',
- $this->message
- );
- }
-
- public function testCanSetTemplate()
- {
- $l = new BackoffLogger(new ClosureLogAdapter(function () {}));
- $l->setTemplate('foo');
- $t = $this->readAttribute($l, 'formatter');
- $this->assertEquals('foo', $this->readAttribute($t, 'template'));
- }
-
- /**
- * @return array
- */
- protected function getMocks()
- {
- $that = $this;
- $logger = new ClosureLogAdapter(function ($message) use ($that) {
- $that->message .= $message . "\n";
- });
- $logPlugin = new BackoffLogger($logger);
- $response = new Response(503);
- $request = RequestFactory::getInstance()->create('PUT', 'http://www.example.com', array(
- 'Content-Length' => 3,
- 'Foo' => 'Bar'
- ));
-
- return array($logPlugin, $request, $response);
- }
-
- /**
- * @return CurlHandle
- */
- protected function getMockHandle()
- {
- $handle = $this->getMockBuilder('Guzzle\Http\Curl\CurlHandle')
- ->disableOriginalConstructor()
- ->setMethods(array('getError', 'getErrorNo', 'getInfo'))
- ->getMock();
-
- $handle->expects($this->once())
- ->method('getError')
- ->will($this->returnValue('Foo'));
-
- $handle->expects($this->once())
- ->method('getErrorNo')
- ->will($this->returnValue(30));
-
- $handle->expects($this->any())
- ->method('getInfo')
- ->will($this->returnValue(2));
-
- return $handle;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/BackoffPluginTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/BackoffPluginTest.php
deleted file mode 100644
index 496e49e..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/BackoffPluginTest.php
+++ /dev/null
@@ -1,297 +0,0 @@
-retried = false;
- }
-
- public static function getSubscribedEvents()
- {
- return array(BackoffPlugin::RETRY_EVENT => 'onRequestRetry');
- }
-
- public function onRequestRetry(Event $event)
- {
- $this->retried = $event;
- }
-
- public function testHasEventList()
- {
- $this->assertEquals(1, count(BackoffPlugin::getAllEvents()));
- }
-
- public function testCreatesDefaultExponentialBackoffPlugin()
- {
- $plugin = BackoffPlugin::getExponentialBackoff(3, array(204), array(10));
- $this->assertInstanceOf('Guzzle\Plugin\Backoff\BackoffPlugin', $plugin);
- $strategy = $this->readAttribute($plugin, 'strategy');
- $this->assertInstanceOf('Guzzle\Plugin\Backoff\TruncatedBackoffStrategy', $strategy);
- $this->assertEquals(3, $this->readAttribute($strategy, 'max'));
- $strategy = $this->readAttribute($strategy, 'next');
- $this->assertInstanceOf('Guzzle\Plugin\Backoff\HttpBackoffStrategy', $strategy);
- $this->assertEquals(array(204 => true), $this->readAttribute($strategy, 'errorCodes'));
- $strategy = $this->readAttribute($strategy, 'next');
- $this->assertInstanceOf('Guzzle\Plugin\Backoff\CurlBackoffStrategy', $strategy);
- $this->assertEquals(array(10 => true), $this->readAttribute($strategy, 'errorCodes'));
- $strategy = $this->readAttribute($strategy, 'next');
- $this->assertInstanceOf('Guzzle\Plugin\Backoff\ExponentialBackoffStrategy', $strategy);
- }
-
- public function testDoesNotRetryUnlessStrategyReturnsNumber()
- {
- $request = new Request('GET', 'http://www.example.com');
- $request->setState('transfer');
-
- $mock = $this->getMockBuilder('Guzzle\Plugin\Backoff\BackoffStrategyInterface')
- ->setMethods(array('getBackoffPeriod'))
- ->getMockForAbstractClass();
-
- $mock->expects($this->once())
- ->method('getBackoffPeriod')
- ->will($this->returnValue(false));
-
- $plugin = new BackoffPlugin($mock);
- $plugin->addSubscriber($this);
- $plugin->onRequestSent(new Event(array('request' => $request)));
- $this->assertFalse($this->retried);
- }
-
- public function testUpdatesRequestForRetry()
- {
- $request = new Request('GET', 'http://www.example.com');
- $request->setState('transfer');
- $response = new Response(500);
- $handle = $this->getMockBuilder('Guzzle\Http\Curl\CurlHandle')->disableOriginalConstructor()->getMock();
- $e = new CurlException();
- $e->setCurlHandle($handle);
-
- $plugin = new BackoffPlugin(new ConstantBackoffStrategy(10));
- $plugin->addSubscriber($this);
-
- $event = new Event(array(
- 'request' => $request,
- 'response' => $response,
- 'exception' => $e
- ));
-
- $plugin->onRequestSent($event);
- $this->assertEquals(array(
- 'request' => $request,
- 'response' => $response,
- 'handle' => $handle,
- 'retries' => 1,
- 'delay' => 10
- ), $this->readAttribute($this->retried, 'context'));
-
- $plugin->onRequestSent($event);
- $this->assertEquals(array(
- 'request' => $request,
- 'response' => $response,
- 'handle' => $handle,
- 'retries' => 2,
- 'delay' => 10
- ), $this->readAttribute($this->retried, 'context'));
- }
-
- public function testDoesNothingWhenNotRetryingAndPollingRequest()
- {
- $request = new Request('GET', 'http://www.foo.com');
- $plugin = new BackoffPlugin(new ConstantBackoffStrategy(10));
- $plugin->onRequestPoll(new Event(array('request' => $request)));
- }
-
- public function testRetriesRequests()
- {
- // Create a script to return several 500 and 503 response codes
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata"
- ));
-
- $plugin = new BackoffPlugin(
- new TruncatedBackoffStrategy(3,
- new HttpBackoffStrategy(null,
- new CurlBackoffStrategy(null,
- new ConstantBackoffStrategy(0.05)
- )
- )
- )
- );
-
- $client = new Client($this->getServer()->getUrl());
- $client->getEventDispatcher()->addSubscriber($plugin);
- $request = $client->get();
- $request->send();
-
- // Make sure it eventually completed successfully
- $this->assertEquals(200, $request->getResponse()->getStatusCode());
- $this->assertEquals('data', $request->getResponse()->getBody(true));
-
- // Check that three requests were made to retry this request
- $this->assertEquals(3, count($this->getServer()->getReceivedRequests(false)));
- $this->assertEquals(2, $request->getParams()->get(BackoffPlugin::RETRY_PARAM));
- }
-
- /**
- * @expectedException \Guzzle\Http\Exception\ServerErrorResponseException
- */
- public function testFailsOnTruncation()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n"
- ));
-
- $plugin = new BackoffPlugin(
- new TruncatedBackoffStrategy(2,
- new HttpBackoffStrategy(null,
- new ConstantBackoffStrategy(0.05)
- )
- )
- );
-
- $client = new Client($this->getServer()->getUrl());
- $client->addSubscriber($plugin);
- $client->get()->send();
- }
-
- public function testRetriesRequestsWhenInParallel()
- {
- // Create a script to return several 500 and 503 response codes
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata",
- "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata",
- "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata",
- "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata",
- "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata"
- ));
-
- $plugin = new BackoffPlugin(
- new HttpBackoffStrategy(null,
- new TruncatedBackoffStrategy(3,
- new CurlBackoffStrategy(null,
- new ConstantBackoffStrategy(0.1)
- )
- )
- )
- );
- $client = new Client($this->getServer()->getUrl());
- $client->getEventDispatcher()->addSubscriber($plugin);
- $requests = array();
- for ($i = 0; $i < 5; $i++) {
- $requests[] = $client->get();
- }
- $client->send($requests);
-
- $this->assertEquals(15, count($this->getServer()->getReceivedRequests(false)));
- }
-
- /**
- * @covers Guzzle\Plugin\Backoff\BackoffPlugin
- * @covers Guzzle\Http\Curl\CurlMulti
- */
- public function testRetriesPooledRequestsUsingDelayAndPollingEvent()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ndata"
- ));
- // Need to sleep for some time ensure that the polling works correctly in the observer
- $plugin = new BackoffPlugin(new HttpBackoffStrategy(null,
- new TruncatedBackoffStrategy(1,
- new ConstantBackoffStrategy(0.5))));
-
- $client = new Client($this->getServer()->getUrl());
- $client->getEventDispatcher()->addSubscriber($plugin);
- $request = $client->get();
- $request->send();
- // Make sure it eventually completed successfully
- $this->assertEquals('data', $request->getResponse()->getBody(true));
- // Check that two requests were made to retry this request
- $this->assertEquals(2, count($this->getServer()->getReceivedRequests(false)));
- }
-
- public function testSeeksToBeginningOfRequestBodyWhenRetrying()
- {
- // Create a request with a body
- $request = new EntityEnclosingRequest('PUT', 'http://www.example.com');
- $request->setBody('abc');
- // Set the retry time to be something that will be retried always
- $request->getParams()->set(BackoffPlugin::DELAY_PARAM, 2);
- // Seek to the end of the stream
- $request->getBody()->seek(3);
- $this->assertEquals('', $request->getBody()->read(1));
- // Create a plugin that does not delay when retrying
- $plugin = new BackoffPlugin(new ConstantBackoffStrategy(0));
- $plugin->onRequestPoll($this->getMockEvent($request));
- // Ensure that the stream was seeked to 0
- $this->assertEquals('a', $request->getBody()->read(1));
- }
-
- public function testDoesNotSeekOnRequestsWithNoBodyWhenRetrying()
- {
- // Create a request with a body
- $request = new EntityEnclosingRequest('PUT', 'http://www.example.com');
- $request->getParams()->set(BackoffPlugin::DELAY_PARAM, 2);
- $plugin = new BackoffPlugin(new ConstantBackoffStrategy(0));
- $plugin->onRequestPoll($this->getMockEvent($request));
- }
-
- protected function getMockEvent(RequestInterface $request)
- {
- // Create a mock curl multi object
- $multi = $this->getMockBuilder('Guzzle\Http\Curl\CurlMulti')
- ->setMethods(array('remove', 'add'))
- ->getMock();
-
- // Create an event that is expected for the Poll event
- $event = new Event(array(
- 'request' => $request,
- 'curl_multi' => $multi
- ));
- $event->setName(CurlMultiInterface::POLLING_REQUEST);
-
- return $event;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/CallbackBackoffStrategyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/CallbackBackoffStrategyTest.php
deleted file mode 100644
index c0ce10d..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/CallbackBackoffStrategyTest.php
+++ /dev/null
@@ -1,31 +0,0 @@
-getMock('Guzzle\Http\Message\Request', array(), array(), '', false);
- $strategy = new CallbackBackoffStrategy(function () { return 10; }, true);
- $this->assertTrue($strategy->makesDecision());
- $this->assertEquals(10, $strategy->getBackoffPeriod(0, $request));
- // Ensure it chains correctly when null is returned
- $strategy = new CallbackBackoffStrategy(function () { return null; }, false);
- $this->assertFalse($strategy->makesDecision());
- $this->assertFalse($strategy->getBackoffPeriod(0, $request));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/ConstantBackoffStrategyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/ConstantBackoffStrategyTest.php
deleted file mode 100644
index 703eb4a..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/ConstantBackoffStrategyTest.php
+++ /dev/null
@@ -1,20 +0,0 @@
-assertFalse($strategy->makesDecision());
- $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false);
- $this->assertEquals(3.5, $strategy->getBackoffPeriod(0, $request));
- $this->assertEquals(3.5, $strategy->getBackoffPeriod(1, $request));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/CurlBackoffStrategyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/CurlBackoffStrategyTest.php
deleted file mode 100644
index 0a5c3e2..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/CurlBackoffStrategyTest.php
+++ /dev/null
@@ -1,36 +0,0 @@
-assertNotEmpty(CurlBackoffStrategy::getDefaultFailureCodes());
- $strategy = new CurlBackoffStrategy();
- $this->assertTrue($strategy->makesDecision());
- $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false);
- $e = new CurlException();
- $e->setError('foo', CURLE_BAD_CALLING_ORDER);
- $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request, null, $e));
-
- foreach (CurlBackoffStrategy::getDefaultFailureCodes() as $code) {
- $this->assertEquals(0, $strategy->getBackoffPeriod(0, $request, null, $e->setError('foo', $code)));
- }
- }
-
- public function testIgnoresNonErrors()
- {
- $strategy = new CurlBackoffStrategy();
- $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false);
- $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request, new Response(200)));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/ExponentialBackoffStrategyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/ExponentialBackoffStrategyTest.php
deleted file mode 100644
index 09965bc..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/ExponentialBackoffStrategyTest.php
+++ /dev/null
@@ -1,23 +0,0 @@
-assertFalse($strategy->makesDecision());
- $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false);
- $this->assertEquals(1, $strategy->getBackoffPeriod(0, $request));
- $this->assertEquals(2, $strategy->getBackoffPeriod(1, $request));
- $this->assertEquals(4, $strategy->getBackoffPeriod(2, $request));
- $this->assertEquals(8, $strategy->getBackoffPeriod(3, $request));
- $this->assertEquals(16, $strategy->getBackoffPeriod(4, $request));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/HttpBackoffStrategyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/HttpBackoffStrategyTest.php
deleted file mode 100644
index ae68a4e..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/HttpBackoffStrategyTest.php
+++ /dev/null
@@ -1,47 +0,0 @@
-assertNotEmpty(HttpBackoffStrategy::getDefaultFailureCodes());
- $strategy = new HttpBackoffStrategy();
- $this->assertTrue($strategy->makesDecision());
- $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false);
-
- $response = new Response(200);
- $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request, $response));
- $response->setStatus(400);
- $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request, $response));
-
- foreach (HttpBackoffStrategy::getDefaultFailureCodes() as $code) {
- $this->assertEquals(0, $strategy->getBackoffPeriod(0, $request, $response->setStatus($code)));
- }
- }
-
- public function testAllowsCustomCodes()
- {
- $strategy = new HttpBackoffStrategy(array(204));
- $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false);
- $response = new Response(204);
- $this->assertEquals(0, $strategy->getBackoffPeriod(0, $request, $response));
- $response->setStatus(500);
- $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request, $response));
- }
-
- public function testIgnoresNonErrors()
- {
- $strategy = new HttpBackoffStrategy();
- $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false);
- $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/LinearBackoffStrategyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/LinearBackoffStrategyTest.php
deleted file mode 100644
index b4ce8e4..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/LinearBackoffStrategyTest.php
+++ /dev/null
@@ -1,21 +0,0 @@
-assertFalse($strategy->makesDecision());
- $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false);
- $this->assertEquals(0, $strategy->getBackoffPeriod(0, $request));
- $this->assertEquals(5, $strategy->getBackoffPeriod(1, $request));
- $this->assertEquals(10, $strategy->getBackoffPeriod(2, $request));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/ReasonPhraseBackoffStrategyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/ReasonPhraseBackoffStrategyTest.php
deleted file mode 100644
index dea5a68..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/ReasonPhraseBackoffStrategyTest.php
+++ /dev/null
@@ -1,32 +0,0 @@
-assertEmpty(ReasonPhraseBackoffStrategy::getDefaultFailureCodes());
- $strategy = new ReasonPhraseBackoffStrategy(array('Foo', 'Internal Server Error'));
- $this->assertTrue($strategy->makesDecision());
- $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false);
- $response = new Response(200);
- $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request, $response));
- $response->setStatus(200, 'Foo');
- $this->assertEquals(0, $strategy->getBackoffPeriod(0, $request, $response));
- }
-
- public function testIgnoresNonErrors()
- {
- $strategy = new ReasonPhraseBackoffStrategy();
- $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false);
- $this->assertEquals(false, $strategy->getBackoffPeriod(0, $request));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/TruncatedBackoffStrategyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/TruncatedBackoffStrategyTest.php
deleted file mode 100644
index 5590dfb..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Backoff/TruncatedBackoffStrategyTest.php
+++ /dev/null
@@ -1,30 +0,0 @@
-assertTrue($strategy->makesDecision());
- $request = $this->getMock('Guzzle\Http\Message\Request', array(), array(), '', false);
- $this->assertFalse($strategy->getBackoffPeriod(0, $request));
- $this->assertFalse($strategy->getBackoffPeriod(1, $request));
- $this->assertFalse($strategy->getBackoffPeriod(2, $request));
-
- $response = new Response(500);
- $strategy->setNext(new HttpBackoffStrategy(null, new ConstantBackoffStrategy(10)));
- $this->assertEquals(10, $strategy->getBackoffPeriod(0, $request, $response));
- $this->assertEquals(10, $strategy->getBackoffPeriod(1, $request, $response));
- $this->assertFalse($strategy->getBackoffPeriod(2, $request, $response));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/CachePluginTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/CachePluginTest.php
deleted file mode 100644
index 69da60a..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/CachePluginTest.php
+++ /dev/null
@@ -1,441 +0,0 @@
-assertInstanceOf('Guzzle\Plugin\Cache\CacheStorageInterface', $this->readAttribute($plugin, 'storage'));
- }
-
- public function testAddsDefaultCollaborators()
- {
- $this->assertNotEmpty(CachePlugin::getSubscribedEvents());
- $plugin = new CachePlugin(array(
- 'storage' => $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface')->getMockForAbstractClass()
- ));
- $this->assertInstanceOf('Guzzle\Plugin\Cache\CacheStorageInterface', $this->readAttribute($plugin, 'storage'));
- $this->assertInstanceOf(
- 'Guzzle\Plugin\Cache\CanCacheStrategyInterface',
- $this->readAttribute($plugin, 'canCache')
- );
- $this->assertInstanceOf(
- 'Guzzle\Plugin\Cache\RevalidationInterface',
- $this->readAttribute($plugin, 'revalidation')
- );
- }
-
- public function testAddsCallbackCollaborators()
- {
- $this->assertNotEmpty(CachePlugin::getSubscribedEvents());
- $plugin = new CachePlugin(array('can_cache' => function () {}));
- $this->assertInstanceOf(
- 'Guzzle\Plugin\Cache\CallbackCanCacheStrategy',
- $this->readAttribute($plugin, 'canCache')
- );
- }
-
- public function testCanPassCacheAsOnlyArgumentToConstructor()
- {
- $p = new CachePlugin(new DoctrineCacheAdapter(new ArrayCache()));
- $p = new CachePlugin(new DefaultCacheStorage(new DoctrineCacheAdapter(new ArrayCache())));
- }
-
- public function testUsesCreatedCacheStorage()
- {
- $plugin = new CachePlugin(array(
- 'adapter' => $this->getMockBuilder('Guzzle\Cache\CacheAdapterInterface')->getMockForAbstractClass()
- ));
- $this->assertInstanceOf('Guzzle\Plugin\Cache\CacheStorageInterface', $this->readAttribute($plugin, 'storage'));
- }
-
- public function testUsesProvidedOptions()
- {
- $can = $this->getMockBuilder('Guzzle\Plugin\Cache\CanCacheStrategyInterface')->getMockForAbstractClass();
- $revalidate = $this->getMockBuilder('Guzzle\Plugin\Cache\RevalidationInterface')->getMockForAbstractClass();
- $plugin = new CachePlugin(array(
- 'storage' => $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface')->getMockForAbstractClass(),
- 'can_cache' => $can,
- 'revalidation' => $revalidate
- ));
- $this->assertSame($can, $this->readAttribute($plugin, 'canCache'));
- $this->assertSame($revalidate, $this->readAttribute($plugin, 'revalidation'));
- }
-
- public function satisfyProvider()
- {
- $req1 = new Request('GET', 'http://foo.com', array('Cache-Control' => 'no-cache'));
-
- return array(
- // The response is too old to satisfy the request
- array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'max-age=20')), new Response(200, array('Age' => 100)), false, false),
- // The response cannot satisfy the request because it is stale
- array(new Request('GET', 'http://foo.com'), new Response(200, array('Cache-Control' => 'max-age=10', 'Age' => 100)), false, false),
- // Allows the expired response to satisfy the request because of the max-stale
- array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'max-stale=15')), new Response(200, array('Cache-Control' => 'max-age=90', 'Age' => 100)), true, false),
- // Max stale is > than the allowed staleness
- array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'max-stale=5')), new Response(200, array('Cache-Control' => 'max-age=90', 'Age' => 100)), false, false),
- // Performs cache revalidation
- array($req1, new Response(200), true, true),
- // Performs revalidation due to ETag on the response and no cache-control on the request
- array(new Request('GET', 'http://foo.com'), new Response(200, array(
- 'ETag' => 'ABC',
- 'Expires' => date('c', strtotime('+1 year'))
- )), true, true),
- );
- }
-
- /**
- * @dataProvider satisfyProvider
- */
- public function testChecksIfResponseCanSatisfyRequest($request, $response, $can, $revalidates)
- {
- $didRevalidate = false;
- $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface')->getMockForAbstractClass();
- $revalidate = $this->getMockBuilder('Guzzle\Plugin\Cache\DefaultRevalidation')
- ->setMethods(array('revalidate'))
- ->setConstructorArgs(array($storage))
- ->getMockForAbstractClass();
-
- $revalidate->expects($this->any())
- ->method('revalidate')
- ->will($this->returnCallback(function () use (&$didRevalidate) {
- $didRevalidate = true;
- return true;
- }));
-
- $plugin = new CachePlugin(array(
- 'storage' => $storage,
- 'revalidation' => $revalidate
- ));
-
- $this->assertEquals($can, $plugin->canResponseSatisfyRequest($request, $response));
- $this->assertEquals($didRevalidate, $revalidates);
- }
-
- public function satisfyFailedProvider()
- {
- return array(
- // Neither has stale-if-error
- array(new Request('GET', 'http://foo.com', array()), new Response(200, array('Age' => 100)), false),
- // Request has stale-if-error
- array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'stale-if-error')), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50')), true),
- // Request has valid stale-if-error
- array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'stale-if-error=50')), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50')), true),
- // Request has expired stale-if-error
- array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'stale-if-error=20')), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50')), false),
- // Response has permanent stale-if-error
- array(new Request('GET', 'http://foo.com', array()), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50, stale-if-error', )), true),
- // Response has valid stale-if-error
- array(new Request('GET', 'http://foo.com', array()), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50, stale-if-error=50')), true),
- // Response has expired stale-if-error
- array(new Request('GET', 'http://foo.com', array()), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50, stale-if-error=20')), false),
- // Request has valid stale-if-error but response does not
- array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'stale-if-error=50')), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50, stale-if-error=20')), false),
- // Response has valid stale-if-error but request does not
- array(new Request('GET', 'http://foo.com', array('Cache-Control' => 'stale-if-error=20')), new Response(200, array('Age' => 100, 'Cache-Control' => 'max-age=50, stale-if-error=50')), false),
- );
- }
-
- /**
- * @dataProvider satisfyFailedProvider
- */
- public function testChecksIfResponseCanSatisfyFailedRequest($request, $response, $can)
- {
- $plugin = new CachePlugin();
-
- $this->assertEquals($can, $plugin->canResponseSatisfyFailedRequest($request, $response));
- }
-
- public function testDoesNothingWhenRequestIsNotCacheable()
- {
- $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface')
- ->setMethods(array('fetch'))
- ->getMockForAbstractClass();
- $storage->expects($this->never())->method('fetch');
-
- $plugin = new CachePlugin(array(
- 'storage' => $storage,
- 'can_cache' => new CallbackCanCacheStrategy(function () { return false; })
- ));
-
- $plugin->onRequestBeforeSend(new Event(array(
- 'request' => new Request('GET', 'http://foo.com')
- )));
- }
-
- public function satisfiableProvider()
- {
- $date = new \DateTime('-10 seconds');
-
- return array(
- // Fresh response
- array(new Response(200, array(), 'foo')),
- // Stale response
- array(new Response(200, array('Date' => $date->format('c'), 'Cache-Control' => 'max-age=5'), 'foo'))
- );
- }
-
- /**
- * @dataProvider satisfiableProvider
- */
- public function testInjectsSatisfiableResponses($response)
- {
- $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface')
- ->setMethods(array('fetch'))
- ->getMockForAbstractClass();
-
- $storage->expects($this->once())->method('fetch')->will($this->returnValue($response));
- $plugin = new CachePlugin(array('storage' => $storage));
- $request = new Request('GET', 'http://foo.com', array('Cache-Control' => 'max-stale'));
- $plugin->onRequestBeforeSend(new Event(array('request' => $request)));
- $plugin->onRequestSent(new Event(array('request' => $request, 'response' => $request->getResponse())));
- $this->assertEquals($response->getStatusCode(), $request->getResponse()->getStatusCode());
- $this->assertEquals((string) $response->getBody(), (string) $request->getResponse()->getBody());
- $this->assertTrue($request->getResponse()->hasHeader('Age'));
- if ($request->getResponse()->isFresh() === false) {
- $this->assertContains('110', (string) $request->getResponse()->getHeader('Warning'));
- }
- $this->assertSame(
- sprintf('%s GuzzleCache/%s', $request->getProtocolVersion(), Version::VERSION),
- (string) $request->getHeader('Via')
- );
- $this->assertSame(
- sprintf('%s GuzzleCache/%s',$request->getProtocolVersion(), Version::VERSION),
- (string) $request->getResponse()->getHeader('Via')
- );
- $this->assertTrue($request->getParams()->get('cache.lookup'));
- $this->assertTrue($request->getParams()->get('cache.hit'));
- $this->assertTrue($request->getResponse()->hasHeader('X-Cache-Lookup'));
- $this->assertTrue($request->getResponse()->hasHeader('X-Cache'));
- $this->assertEquals('HIT from GuzzleCache', (string) $request->getResponse()->getHeader('X-Cache'));
- $this->assertEquals('HIT from GuzzleCache', (string) $request->getResponse()->getHeader('X-Cache-Lookup'));
- }
-
- public function satisfiableOnErrorProvider()
- {
- $date = new \DateTime('-10 seconds');
- return array(
- array(
- new Response(200, array(
- 'Date' => $date->format('c'),
- 'Cache-Control' => 'max-age=5, stale-if-error'
- ), 'foo'),
- )
- );
- }
-
- /**
- * @dataProvider satisfiableOnErrorProvider
- */
- public function testInjectsSatisfiableResponsesOnError($cacheResponse)
- {
- $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface')
- ->setMethods(array('fetch'))
- ->getMockForAbstractClass();
- $storage->expects($this->exactly(2))->method('fetch')->will($this->returnValue($cacheResponse));
- $plugin = new CachePlugin(array('storage' => $storage));
- $request = new Request('GET', 'http://foo.com', array('Cache-Control' => 'max-stale'));
- $plugin->onRequestBeforeSend(new Event(array('request' => $request)));
- $plugin->onRequestError(
- $event = new Event(array(
- 'request' => $request,
- 'response' => $request->getResponse(),
- ))
- );
- $response = $event['response'];
- $this->assertEquals($cacheResponse->getStatusCode(), $response->getStatusCode());
- $this->assertEquals((string) $cacheResponse->getBody(), (string) $response->getBody());
- $this->assertTrue($response->hasHeader('Age'));
- if ($response->isFresh() === false) {
- $this->assertContains('110', (string) $response->getHeader('Warning'));
- }
- $this->assertSame(sprintf('%s GuzzleCache/%s', $request->getProtocolVersion(), Version::VERSION), (string) $request->getHeader('Via'));
- $this->assertSame(sprintf('%s GuzzleCache/%s', $request->getProtocolVersion(), Version::VERSION), (string) $response->getHeader('Via'));
- $this->assertTrue($request->getParams()->get('cache.lookup'));
- $this->assertSame('error', $request->getParams()->get('cache.hit'));
- $this->assertTrue($response->hasHeader('X-Cache-Lookup'));
- $this->assertTrue($response->hasHeader('X-Cache'));
- $this->assertEquals('HIT from GuzzleCache', (string) $response->getHeader('X-Cache-Lookup'));
- $this->assertEquals('HIT_ERROR from GuzzleCache', (string) $response->getHeader('X-Cache'));
- }
-
- /**
- * @dataProvider satisfiableOnErrorProvider
- */
- public function testInjectsSatisfiableResponsesOnException($cacheResponse)
- {
- $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface')
- ->setMethods(array('fetch'))
- ->getMockForAbstractClass();
- $storage->expects($this->exactly(2))->method('fetch')->will($this->returnValue($cacheResponse));
- $plugin = new CachePlugin(array('storage' => $storage));
- $request = new Request('GET', 'http://foo.com', array('Cache-Control' => 'max-stale'));
- $plugin->onRequestBeforeSend(new Event(array(
- 'request' => $request
- )));
- $plugin->onRequestException(
- new Event(array(
- 'request' => $request,
- 'response' => $request->getResponse(),
- 'exception' => $this->getMock('Guzzle\Http\Exception\CurlException'),
- ))
- );
- $plugin->onRequestSent(
- new Event(array(
- 'request' => $request,
- 'response' => $response = $request->getResponse(),
- ))
- );
- $this->assertEquals($cacheResponse->getStatusCode(), $response->getStatusCode());
- $this->assertEquals((string) $cacheResponse->getBody(), (string) $response->getBody());
- $this->assertTrue($response->hasHeader('Age'));
- if ($response->isFresh() === false) {
- $this->assertContains('110', (string) $response->getHeader('Warning'));
- }
- $this->assertSame(sprintf('%s GuzzleCache/%s', $request->getProtocolVersion(), Version::VERSION), (string) $request->getHeader('Via'));
- $this->assertSame(sprintf('%s GuzzleCache/%s', $request->getProtocolVersion(), Version::VERSION), (string) $response->getHeader('Via'));
- $this->assertTrue($request->getParams()->get('cache.lookup'));
- $this->assertSame('error', $request->getParams()->get('cache.hit'));
- $this->assertTrue($response->hasHeader('X-Cache-Lookup'));
- $this->assertTrue($response->hasHeader('X-Cache'));
- $this->assertEquals('HIT from GuzzleCache', (string) $response->getHeader('X-Cache-Lookup'));
- $this->assertEquals('HIT_ERROR from GuzzleCache', (string) $response->getHeader('X-Cache'));
- }
-
- public function unsatisfiableOnErrorProvider()
- {
- $date = new \DateTime('-10 seconds');
-
- return array(
- // no-store on request
- array(
- false,
- array('Cache-Control' => 'no-store'),
- new Response(200, array('Date' => $date->format('D, d M Y H:i:s T'), 'Cache-Control' => 'max-age=5, stale-if-error'), 'foo'),
- ),
- // request expired
- array(
- true,
- array('Cache-Control' => 'stale-if-error=4'),
- new Response(200, array('Date' => $date->format('D, d M Y H:i:s T'), 'Cache-Control' => 'max-age=5, stale-if-error'), 'foo'),
- ),
- // response expired
- array(
- true,
- array('Cache-Control' => 'stale-if-error'),
- new Response(200, array('Date' => $date->format('D, d M Y H:i:s T'), 'Cache-Control' => 'max-age=5, stale-if-error=4'), 'foo'),
- ),
- );
- }
-
- /**
- * @dataProvider unsatisfiableOnErrorProvider
- */
- public function testDoesNotInjectUnsatisfiableResponsesOnError($requestCanCache, $requestHeaders, $cacheResponse)
- {
- $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface')
- ->setMethods(array('fetch'))
- ->getMockForAbstractClass();
- $storage->expects($this->exactly($requestCanCache ? 2 : 0))->method('fetch')->will($this->returnValue($cacheResponse));
- $plugin = new CachePlugin(array('storage' => $storage));
- $request = new Request('GET', 'http://foo.com', $requestHeaders);
- $plugin->onRequestBeforeSend(new Event(array(
- 'request' => $request
- )));
- $plugin->onRequestError(
- $event = new Event(array(
- 'request' => $request,
- 'response' => $response = $request->getResponse(),
- ))
- );
-
- $this->assertSame($response, $event['response']);
- }
-
- /**
- * @dataProvider unsatisfiableOnErrorProvider
- */
- public function testDoesNotInjectUnsatisfiableResponsesOnException($requestCanCache, $requestHeaders, $responseParts)
- {
- $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface')
- ->setMethods(array('fetch'))
- ->getMockForAbstractClass();
- $storage->expects($this->exactly($requestCanCache ? 2 : 0))->method('fetch')->will($this->returnValue($responseParts));
- $plugin = new CachePlugin(array('storage' => $storage));
- $request = new Request('GET', 'http://foo.com', $requestHeaders);
- $plugin->onRequestBeforeSend(new Event(array(
- 'request' => $request
- )));
- $plugin->onRequestException(
- $event = new Event(array(
- 'request' => $request,
- 'response' => $response = $request->getResponse(),
- 'exception' => $this->getMock('Guzzle\Http\Exception\CurlException'),
- ))
- );
-
- $this->assertSame($response, $request->getResponse());
- }
-
- public function testCachesResponsesWhenCacheable()
- {
- $cache = new ArrayCache();
- $plugin = new CachePlugin($cache);
-
- $request = new Request('GET', 'http://foo.com');
- $response = new Response(200, array(), 'Foo');
- $plugin->onRequestBeforeSend(new Event(array(
- 'request' => $request
- )));
- $plugin->onRequestSent(new Event(array(
- 'request' => $request,
- 'response' => $response
- )));
- $data = $this->readAttribute($cache, 'data');
- $this->assertNotEmpty($data);
- }
-
- public function testPurgesRequests()
- {
- $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface')
- ->setMethods(array('purge'))
- ->getMockForAbstractClass();
- $storage->expects($this->atLeastOnce())->method('purge');
- $plugin = new CachePlugin(array('storage' => $storage));
- $request = new Request('GET', 'http://foo.com', array('X-Foo' => 'Bar'));
- $plugin->purge($request);
- }
-
- public function testAutoPurgesRequests()
- {
- $storage = $this->getMockBuilder('Guzzle\Plugin\Cache\CacheStorageInterface')
- ->setMethods(array('purge'))
- ->getMockForAbstractClass();
- $storage->expects($this->atLeastOnce())->method('purge');
- $plugin = new CachePlugin(array('storage' => $storage, 'auto_purge' => true));
- $client = new Client();
- $request = $client->put('http://foo.com', array('X-Foo' => 'Bar'));
- $request->addSubscriber($plugin);
- $request->setResponse(new Response(200), true);
- $request->send();
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/CallbackCanCacheStrategyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/CallbackCanCacheStrategyTest.php
deleted file mode 100644
index f3d9baf..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/CallbackCanCacheStrategyTest.php
+++ /dev/null
@@ -1,72 +0,0 @@
-assertTrue($c->canCacheRequest(new Request('DELETE', 'http://www.foo.com')));
- }
-
- /**
- * The following is a bit of an integration test to ensure that the CachePlugin honors a
- * custom can cache strategy.
- */
- public function testIntegrationWithCachePlugin()
- {
- $c = new CallbackCanCacheStrategy(
- function ($request) { return true; },
- function ($response) { return true; }
- );
-
- // Make a request and response that have no business being cached
- $request = new Request('DELETE', 'http://www.foo.com');
- $response = Response::fromMessage(
- "HTTP/1.1 200 OK\r\n"
- . "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n"
- . "Last-Modified: Wed, 09 Jan 2013 08:48:53 GMT\r\n"
- . "Content-Length: 2\r\n"
- . "Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\n\r\n"
- . "hi"
- );
-
- $this->assertTrue($c->canCacheRequest($request));
- $this->assertTrue($c->canCacheResponse($response));
-
- $s = $this->getMockBuilder('Guzzle\Plugin\Cache\DefaultCacheStorage')
- ->setConstructorArgs(array(new DoctrineCacheAdapter(new ArrayCache())))
- ->setMethods(array('fetch'))
- ->getMockForAbstractClass();
-
- $s->expects($this->once())
- ->method('fetch')
- ->will($this->returnValue($response));
-
- $plugin = new CachePlugin(array('can_cache' => $c, 'storage' => $s));
- $plugin->onRequestBeforeSend(new Event(array('request' => $request)));
-
- $this->assertEquals(200, $request->getResponse()->getStatusCode());
- $this->assertEquals('hi', $request->getResponse()->getBody(true));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/DefaultCacheStorageTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/DefaultCacheStorageTest.php
deleted file mode 100644
index 701a015..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/DefaultCacheStorageTest.php
+++ /dev/null
@@ -1,193 +0,0 @@
- 'application/json'));
- $response = new Response(200, array(
- 'Content-Type' => 'application/json',
- 'Connection' => 'close',
- 'X-Foo' => 'Bar',
- 'Vary' => 'Accept'
- ), 'test');
- $s->cache($request, $response);
- $data = $this->readAttribute($a, 'data');
-
- return array(
- 'cache' => $a,
- 'adapter' => $c,
- 'storage' => $s,
- 'request' => $request,
- 'response' => $response,
- 'serialized' => end($data)
- );
- }
-
- public function testReturnsNullForCacheMiss()
- {
- $cache = $this->getCache();
- $this->assertNull($cache['storage']->fetch(new Request('GET', 'http://test.com')));
- }
-
- public function testCachesRequests()
- {
- $cache = $this->getCache();
- $foundRequest = $foundBody = $bodyKey = false;
- foreach ($this->readAttribute($cache['cache'], 'data') as $key => $v) {
- if (strpos($v, 'foo.com')) {
- $foundRequest = true;
- $data = unserialize($v);
- $bodyKey = $data[0][3];
- $this->assertInternalType('integer', $data[0][4]);
- $this->assertFalse(isset($data[0][0]['connection']));
- $this->assertEquals('foo.com', $data[0][0]['host']);
- } elseif ($v == 'test') {
- $foundBody = $key;
- }
- }
- $this->assertContains($bodyKey, $foundBody);
- $this->assertTrue($foundRequest);
- }
-
- public function testFetchesResponse()
- {
- $cache = $this->getCache();
- $response = $cache['storage']->fetch($cache['request']);
- $this->assertEquals(200, $response->getStatusCode());
- $this->assertFalse($response->hasHeader('Connection'));
- $this->assertEquals('Bar', (string) $response->getHeader('X-Foo'));
- $this->assertEquals('test', (string) $response->getBody());
- $this->assertTrue(in_array($cache['serialized'], $this->readAttribute($cache['cache'], 'data')));
- }
-
- public function testDeletesRequestItemsAndBody()
- {
- $cache = $this->getCache();
- $cache['storage']->delete($cache['request']);
- $this->assertFalse(in_array('test', $this->readAttribute($cache['cache'], 'data')));
- $this->assertFalse(in_array($cache['serialized'], $this->readAttribute($cache['cache'], 'data')));
- }
-
- public function testCachesMultipleRequestsWithVary()
- {
- $cache = $this->getCache();
- $cache['request']->setHeader('Accept', 'application/xml');
- $response = $cache['response']->setHeader('Content-Type', 'application/xml');
- $response->setBody('123');
- $cache['storage']->cache($cache['request'], $response);
- $data = $this->readAttribute($cache['cache'], 'data');
- foreach ($data as $v) {
- if (strpos($v, 'foo.com')) {
- $u = unserialize($v);
- $this->assertEquals(2, count($u));
- $this->assertEquals($u[0][0]['accept'], 'application/xml');
- $this->assertEquals($u[0][1]['content-type'], 'application/xml');
- $this->assertEquals($u[1][0]['accept'], 'application/json');
- $this->assertEquals($u[1][1]['content-type'], 'application/json');
- $this->assertNotSame($u[0][3], $u[1][3]);
- break;
- }
- }
- }
-
- public function testPurgeRemovesAllMethodCaches()
- {
- $cache = $this->getCache();
- foreach (array('HEAD', 'POST', 'PUT', 'DELETE') as $method) {
- $request = RequestFactory::getInstance()->cloneRequestWithMethod($cache['request'], $method);
- $cache['storage']->cache($request, $cache['response']);
- }
- $cache['storage']->purge('http://foo.com');
- $this->assertFalse(in_array('test', $this->readAttribute($cache['cache'], 'data')));
- $this->assertFalse(in_array($cache['serialized'], $this->readAttribute($cache['cache'], 'data')));
- $this->assertEquals(
- array('DoctrineNamespaceCacheKey[]'),
- array_keys($this->readAttribute($cache['cache'], 'data'))
- );
- }
-
- public function testRemovesExpiredResponses()
- {
- $cache = $this->getCache();
- $request = new Request('GET', 'http://xyz.com');
- $response = new Response(200, array('Age' => 1000, 'Cache-Control' => 'max-age=-10000'));
- $cache['storage']->cache($request, $response);
- $this->assertNull($cache['storage']->fetch($request));
- $data = $this->readAttribute($cache['cache'], 'data');
- $this->assertFalse(in_array('xyz.com', $data));
- $this->assertTrue(in_array($cache['serialized'], $data));
- }
-
- public function testUsesVaryToDetermineResult()
- {
- $cache = $this->getCache();
- $this->assertInstanceOf('Guzzle\Http\Message\Response', $cache['storage']->fetch($cache['request']));
- $request = new Request('GET', 'http://foo.com', array('Accept' => 'application/xml'));
- $this->assertNull($cache['storage']->fetch($request));
- }
-
- public function testEnsuresResponseIsStillPresent()
- {
- $cache = $this->getCache();
- $data = $this->readAttribute($cache['cache'], 'data');
- $key = array_search('test', $data);
- $cache['cache']->delete(substr($key, 1, -4));
- $this->assertNull($cache['storage']->fetch($cache['request']));
- }
-
- public function staleProvider()
- {
- return array(
- array(
- new Request('GET', 'http://foo.com', array('Accept' => 'foo')),
- new Response(200, array('Cache-Control' => 'stale-if-error=100', 'Vary' => 'Accept'))
- ),
- array(
- new Request('GET', 'http://foo.com', array('Accept' => 'foo')),
- new Response(200, array('Cache-Control' => 'stale-if-error', 'Vary' => 'Accept'))
- )
- );
- }
-
- /**
- * @dataProvider staleProvider
- */
- public function testUsesStaleTimeDirectiveForTtd($request, $response)
- {
- $cache = $this->getCache();
- $cache['storage']->cache($request, $response);
- $data = $this->readAttribute($cache['cache'], 'data');
- foreach ($data as $v) {
- if (strpos($v, 'foo.com')) {
- $u = unserialize($v);
- $this->assertGreaterThan($u[1][4], $u[0][4]);
- break;
- }
- }
- }
-
- public function testCanFilterCacheKeys()
- {
- $cache = $this->getCache();
- $cache['request']->getQuery()->set('auth', 'foo');
- $this->assertNull($cache['storage']->fetch($cache['request']));
- $cache['request']->getParams()->set('cache.key_filter', 'auth');
- $this->assertNotNull($cache['storage']->fetch($cache['request']));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/DefaultCanCacheStrategyTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/DefaultCanCacheStrategyTest.php
deleted file mode 100644
index de4d182..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/DefaultCanCacheStrategyTest.php
+++ /dev/null
@@ -1,40 +0,0 @@
-assertTrue($strategy->canCacheRequest($request));
- }
-
- public function testDoesNotCacheNoStore()
- {
- $strategy = new DefaultCanCacheStrategy();
- $request = new Request('GET', 'http://foo.com', array('cache-control' => 'no-store'));
- $this->assertFalse($strategy->canCacheRequest($request));
- }
-
- public function testCanCacheResponse()
- {
- $response = $this->getMockBuilder('Guzzle\Http\Message\Response')
- ->setMethods(array('canCache'))
- ->setConstructorArgs(array(200))
- ->getMock();
- $response->expects($this->once())
- ->method('canCache')
- ->will($this->returnValue(true));
- $strategy = new DefaultCanCacheStrategy();
- $this->assertTrue($strategy->canCacheResponse($response));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/DefaultRevalidationTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/DefaultRevalidationTest.php
deleted file mode 100644
index 0699cb2..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/DefaultRevalidationTest.php
+++ /dev/null
@@ -1,248 +0,0 @@
-getHttpDate('-100 hours') . "\r\nContent-Length: 4\r\n\r\nData",
- "HTTP/1.1 304 NOT MODIFIED\r\nCache-Control: max-age=2000000\r\nContent-Length: 0\r\n\r\n",
- ),
- // Forces revalidation that overwrites what is in cache
- array(
- false,
- "\r\n",
- "HTTP/1.1 200 OK\r\nCache-Control: must-revalidate, no-cache\r\nDate: " . $this->getHttpDate('-10 hours') . "\r\nContent-Length: 4\r\n\r\nData",
- "HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\nDatas",
- "HTTP/1.1 200 OK\r\nContent-Length: 5\r\nDate: " . $this->getHttpDate('now') . "\r\n\r\nDatas"
- ),
- // Throws an exception during revalidation
- array(
- false,
- "\r\n",
- "HTTP/1.1 200 OK\r\nCache-Control: no-cache\r\nDate: " . $this->getHttpDate('-3 hours') . "\r\n\r\nData",
- "HTTP/1.1 500 INTERNAL SERVER ERROR\r\nContent-Length: 0\r\n\r\n"
- ),
- // ETag mismatch
- array(
- false,
- "\r\n",
- "HTTP/1.1 200 OK\r\nCache-Control: no-cache\r\nETag: \"123\"\r\nDate: " . $this->getHttpDate('-10 hours') . "\r\n\r\nData",
- "HTTP/1.1 304 NOT MODIFIED\r\nETag: \"123456\"\r\n\r\n",
- ),
- );
- }
-
- /**
- * @dataProvider cacheRevalidationDataProvider
- */
- public function testRevalidatesResponsesAgainstOriginServer($can, $request, $response, $validate = null, $result = null)
- {
- // Send some responses to the test server for cache validation
- $server = $this->getServer();
- $server->flush();
-
- if ($validate) {
- $server->enqueue($validate);
- }
-
- $request = RequestFactory::getInstance()->fromMessage("GET / HTTP/1.1\r\nHost: 127.0.0.1:" . $server->getPort() . "\r\n" . $request);
- $response = Response::fromMessage($response);
- $request->setClient(new Client());
-
- $plugin = new CachePlugin(new DoctrineCacheAdapter(new ArrayCache()));
- $this->assertEquals(
- $can,
- $plugin->canResponseSatisfyRequest($request, $response),
- '-> ' . $request . "\n" . $response
- );
-
- if ($result) {
- $result = Response::fromMessage($result);
- $result->removeHeader('Date');
- $request->getResponse()->removeHeader('Date');
- $request->getResponse()->removeHeader('Connection');
- // Get rid of dates
- $this->assertEquals((string) $result, (string) $request->getResponse());
- }
-
- if ($validate) {
- $this->assertEquals(1, count($server->getReceivedRequests()));
- }
- }
-
- public function testHandles404RevalidationResponses()
- {
- $request = new Request('GET', 'http://foo.com');
- $request->setClient(new Client());
- $badResponse = new Response(404, array(), 'Oh no!');
- $badRequest = clone $request;
- $badRequest->setResponse($badResponse, true);
- $response = new Response(200, array(), 'foo');
-
- // Seed the cache
- $s = new DefaultCacheStorage(new DoctrineCacheAdapter(new ArrayCache()));
- $s->cache($request, $response);
- $this->assertNotNull($s->fetch($request));
-
- $rev = $this->getMockBuilder('Guzzle\Plugin\Cache\DefaultRevalidation')
- ->setConstructorArgs(array($s))
- ->setMethods(array('createRevalidationRequest'))
- ->getMock();
-
- $rev->expects($this->once())
- ->method('createRevalidationRequest')
- ->will($this->returnValue($badRequest));
-
- try {
- $rev->revalidate($request, $response);
- $this->fail('Should have thrown an exception');
- } catch (BadResponseException $e) {
- $this->assertSame($badResponse, $e->getResponse());
- $this->assertNull($s->fetch($request));
- }
- }
-
- public function testCanRevalidateWithPlugin()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\n" .
- "Date: Mon, 12 Nov 2012 03:06:37 GMT\r\n" .
- "Cache-Control: private, s-maxage=0, max-age=0, must-revalidate\r\n" .
- "Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\r\n" .
- "Content-Length: 2\r\n\r\nhi",
- "HTTP/1.0 304 Not Modified\r\n" .
- "Date: Mon, 12 Nov 2012 03:06:38 GMT\r\n" .
- "Content-Type: text/html; charset=UTF-8\r\n" .
- "Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\r\n" .
- "Age: 6302\r\n\r\n",
- "HTTP/1.0 304 Not Modified\r\n" .
- "Date: Mon, 12 Nov 2012 03:06:38 GMT\r\n" .
- "Content-Type: text/html; charset=UTF-8\r\n" .
- "Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\r\n" .
- "Age: 6302\r\n\r\n",
- ));
- $client = new Client($this->getServer()->getUrl());
- $client->addSubscriber(new CachePlugin());
- $this->assertEquals(200, $client->get()->send()->getStatusCode());
- $this->assertEquals(200, $client->get()->send()->getStatusCode());
- $this->assertEquals(200, $client->get()->send()->getStatusCode());
- $this->assertEquals(3, count($this->getServer()->getReceivedRequests()));
- }
-
- public function testCanHandleRevalidationFailures()
- {
- $client = new Client($this->getServer()->getUrl());
- $lm = gmdate('c', time() - 60);
- $mock = new MockPlugin(array(
- new Response(200, array(
- 'Date' => $lm,
- 'Cache-Control' => 'max-age=100, must-revalidate, stale-if-error=9999',
- 'Last-Modified' => $lm,
- 'Content-Length' => 2
- ), 'hi'),
- new CurlException('Bleh'),
- new CurlException('Bleh')
- ));
- $client->addSubscriber(new CachePlugin());
- $client->addSubscriber($mock);
- $client->get()->send();
- $response = $client->get()->send();
- $this->assertEquals(200, $response->getStatusCode());
- $this->assertEquals('hi', $response->getBody(true));
- $this->assertEquals(3, count($mock->getReceivedRequests()));
- $this->assertEquals(0, count($mock->getQueue()));
- }
-
- public function testCanHandleStaleIfErrorWhenRevalidating()
- {
- $lm = gmdate('c', time() - 60);
- $mock = new MockPlugin(array(
- new Response(200, array(
- 'Date' => $lm,
- 'Cache-Control' => 'must-revalidate, max-age=0, stale-if-error=1200',
- 'Last-Modified' => $lm,
- 'Content-Length' => 2
- ), 'hi'),
- new CurlException('Oh no!'),
- new CurlException('Oh no!')
- ));
- $cache = new CachePlugin();
- $client = new Client('http://www.example.com');
- $client->addSubscriber($cache);
- $client->addSubscriber($mock);
- $this->assertEquals(200, $client->get()->send()->getStatusCode());
- $response = $client->get()->send();
- $this->assertEquals(200, $response->getStatusCode());
- $this->assertCount(0, $mock);
- $this->assertEquals('HIT from GuzzleCache', (string) $response->getHeader('X-Cache-Lookup'));
- $this->assertEquals('HIT_ERROR from GuzzleCache', (string) $response->getHeader('X-Cache'));
- }
-
- /**
- * @group issue-437
- */
- public function testDoesNotTouchClosureListeners()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\n" .
- "Date: Mon, 12 Nov 2012 03:06:37 GMT\r\n" .
- "Cache-Control: private, s-maxage=0, max-age=0, must-revalidate\r\n" .
- "Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\r\n" .
- "Content-Length: 2\r\n\r\nhi",
- "HTTP/1.0 304 Not Modified\r\n" .
- "Date: Mon, 12 Nov 2012 03:06:38 GMT\r\n" .
- "Content-Type: text/html; charset=UTF-8\r\n" .
- "Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\r\n" .
- "Age: 6302\r\n\r\n",
- "HTTP/1.0 304 Not Modified\r\n" .
- "Date: Mon, 12 Nov 2012 03:06:38 GMT\r\n" .
- "Content-Type: text/html; charset=UTF-8\r\n" .
- "Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\r\n" .
- "Age: 6302\r\n\r\n",
- ));
- $client = new Client($this->getServer()->getUrl());
- $client->addSubscriber(new CachePlugin());
- $client->getEventDispatcher()->addListener('command.after_send', function(){});
- $this->assertEquals(200, $client->get()->send()->getStatusCode());
- $this->assertEquals(200, $client->get()->send()->getStatusCode());
- $this->assertEquals(200, $client->get()->send()->getStatusCode());
- }
-
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/DenyRevalidationTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/DenyRevalidationTest.php
deleted file mode 100644
index 9af80f2..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/DenyRevalidationTest.php
+++ /dev/null
@@ -1,19 +0,0 @@
-assertFalse($deny->revalidate(new Request('GET', 'http://foo.com'), new Response(200)));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/SkipRevalidationTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/SkipRevalidationTest.php
deleted file mode 100644
index 4bcc04b..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/SkipRevalidationTest.php
+++ /dev/null
@@ -1,19 +0,0 @@
-assertTrue($skip->revalidate(new Request('GET', 'http://foo.com'), new Response(200)));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cookie/CookieJar/ArrayCookieJarTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cookie/CookieJar/ArrayCookieJarTest.php
deleted file mode 100644
index 5d0f668..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cookie/CookieJar/ArrayCookieJarTest.php
+++ /dev/null
@@ -1,385 +0,0 @@
-jar = new ArrayCookieJar();
- }
-
- protected function getTestCookies()
- {
- return array(
- new Cookie(array('name' => 'foo', 'value' => 'bar', 'domain' => 'foo.com', 'path' => '/', 'discard' => true)),
- new Cookie(array('name' => 'test', 'value' => '123', 'domain' => 'baz.com', 'path' => '/foo', 'expires' => 2)),
- new Cookie(array('name' => 'you', 'value' => '123', 'domain' => 'bar.com', 'path' => '/boo', 'expires' => time() + 1000))
- );
- }
-
- /**
- * Provides test data for cookie cookieJar retrieval
- */
- public function getCookiesDataProvider()
- {
- return array(
- array(array('foo', 'baz', 'test', 'muppet', 'googoo'), '', '', '', false),
- array(array('foo', 'baz', 'muppet', 'googoo'), '', '', '', true),
- array(array('googoo'), 'www.example.com', '', '', false),
- array(array('muppet', 'googoo'), 'test.y.example.com', '', '', false),
- array(array('foo', 'baz'), 'example.com', '', '', false),
- array(array('muppet'), 'x.y.example.com', '/acme/', '', false),
- array(array('muppet'), 'x.y.example.com', '/acme/test/', '', false),
- array(array('googoo'), 'x.y.example.com', '/test/acme/test/', '', false),
- array(array('foo', 'baz'), 'example.com', '', '', false),
- array(array('baz'), 'example.com', '', 'baz', false),
- );
- }
-
- public function testStoresAndRetrievesCookies()
- {
- $cookies = $this->getTestCookies();
- foreach ($cookies as $cookie) {
- $this->assertTrue($this->jar->add($cookie));
- }
-
- $this->assertEquals(3, count($this->jar));
- $this->assertEquals(3, count($this->jar->getIterator()));
- $this->assertEquals($cookies, $this->jar->all(null, null, null, false, false));
- }
-
- public function testRemovesExpiredCookies()
- {
- $cookies = $this->getTestCookies();
- foreach ($this->getTestCookies() as $cookie) {
- $this->jar->add($cookie);
- }
- $this->jar->removeExpired();
- $this->assertEquals(array($cookies[0], $cookies[2]), $this->jar->all());
- }
-
- public function testRemovesTemporaryCookies()
- {
- $cookies = $this->getTestCookies();
- foreach ($this->getTestCookies() as $cookie) {
- $this->jar->add($cookie);
- }
- $this->jar->removeTemporary();
- $this->assertEquals(array($cookies[2]), $this->jar->all());
- }
-
- public function testIsSerializable()
- {
- $this->assertEquals('[]', $this->jar->serialize());
- $this->jar->unserialize('[]');
- $this->assertEquals(array(), $this->jar->all());
-
- $cookies = $this->getTestCookies();
- foreach ($this->getTestCookies() as $cookie) {
- $this->jar->add($cookie);
- }
-
- // Remove discard and expired cookies
- $serialized = $this->jar->serialize();
- $data = json_decode($serialized, true);
- $this->assertEquals(1, count($data));
-
- $a = new ArrayCookieJar();
- $a->unserialize($serialized);
- $this->assertEquals(1, count($a));
- }
-
- public function testRemovesSelectively()
- {
- $cookies = $this->getTestCookies();
- foreach ($this->getTestCookies() as $cookie) {
- $this->jar->add($cookie);
- }
-
- // Remove foo.com cookies
- $this->jar->remove('foo.com');
- $this->assertEquals(2, count($this->jar));
- // Try again, removing no further cookies
- $this->jar->remove('foo.com');
- $this->assertEquals(2, count($this->jar));
-
- // Remove bar.com cookies with path of /boo
- $this->jar->remove('bar.com', '/boo');
- $this->assertEquals(1, count($this->jar));
-
- // Remove cookie by name
- $this->jar->remove(null, null, 'test');
- $this->assertEquals(0, count($this->jar));
- }
-
- public function testDoesNotAddIncompleteCookies()
- {
- $this->assertEquals(false, $this->jar->add(new Cookie()));
- $this->assertFalse($this->jar->add(new Cookie(array(
- 'name' => 'foo'
- ))));
- $this->assertFalse($this->jar->add(new Cookie(array(
- 'name' => false
- ))));
- $this->assertFalse($this->jar->add(new Cookie(array(
- 'name' => true
- ))));
- $this->assertFalse($this->jar->add(new Cookie(array(
- 'name' => 'foo',
- 'domain' => 'foo.com'
- ))));
- }
-
- public function testDoesAddValidCookies()
- {
- $this->assertTrue($this->jar->add(new Cookie(array(
- 'name' => 'foo',
- 'domain' => 'foo.com',
- 'value' => 0
- ))));
- $this->assertTrue($this->jar->add(new Cookie(array(
- 'name' => 'foo',
- 'domain' => 'foo.com',
- 'value' => 0.0
- ))));
- $this->assertTrue($this->jar->add(new Cookie(array(
- 'name' => 'foo',
- 'domain' => 'foo.com',
- 'value' => '0'
- ))));
- }
-
- public function testOverwritesCookiesThatAreOlderOrDiscardable()
- {
- $t = time() + 1000;
- $data = array(
- 'name' => 'foo',
- 'value' => 'bar',
- 'domain' => '.example.com',
- 'path' => '/',
- 'max_age' => '86400',
- 'port' => array(80, 8080),
- 'version' => '1',
- 'secure' => true,
- 'discard' => true,
- 'expires' => $t
- );
-
- // Make sure that the discard cookie is overridden with the non-discard
- $this->assertTrue($this->jar->add(new Cookie($data)));
-
- unset($data['discard']);
- $this->assertTrue($this->jar->add(new Cookie($data)));
- $this->assertEquals(1, count($this->jar));
-
- $c = $this->jar->all();
- $this->assertEquals(false, $c[0]->getDiscard());
-
- // Make sure it doesn't duplicate the cookie
- $this->jar->add(new Cookie($data));
- $this->assertEquals(1, count($this->jar));
-
- // Make sure the more future-ful expiration date supersede the other
- $data['expires'] = time() + 2000;
- $this->assertTrue($this->jar->add(new Cookie($data)));
- $this->assertEquals(1, count($this->jar));
- $c = $this->jar->all();
- $this->assertNotEquals($t, $c[0]->getExpires());
- }
-
- public function testOverwritesCookiesThatHaveChanged()
- {
- $t = time() + 1000;
- $data = array(
- 'name' => 'foo',
- 'value' => 'bar',
- 'domain' => '.example.com',
- 'path' => '/',
- 'max_age' => '86400',
- 'port' => array(80, 8080),
- 'version' => '1',
- 'secure' => true,
- 'discard' => true,
- 'expires' => $t
- );
-
- // Make sure that the discard cookie is overridden with the non-discard
- $this->assertTrue($this->jar->add(new Cookie($data)));
-
- $data['value'] = 'boo';
- $this->assertTrue($this->jar->add(new Cookie($data)));
- $this->assertEquals(1, count($this->jar));
-
- // Changing the value plus a parameter also must overwrite the existing one
- $data['value'] = 'zoo';
- $data['secure'] = false;
- $this->assertTrue($this->jar->add(new Cookie($data)));
- $this->assertEquals(1, count($this->jar));
-
- $c = $this->jar->all();
- $this->assertEquals('zoo', $c[0]->getValue());
- }
-
- public function testAddsCookiesFromResponseWithNoRequest()
- {
- $response = new Response(200, array(
- 'Set-Cookie' => array(
- "fpc=d=.Hm.yh4.1XmJWjJfs4orLQzKzPImxklQoxXSHOZATHUSEFciRueW_7704iYUtsXNEXq0M92Px2glMdWypmJ7HIQl6XIUvrZimWjQ3vIdeuRbI.FNQMAfcxu_XN1zSx7l.AcPdKL6guHc2V7hIQFhnjRW0rxm2oHY1P4bGQxFNz7f.tHm12ZD3DbdMDiDy7TBXsuP4DM-&v=2; expires=Fri, 02-Mar-2019 02:17:40 GMT; path=/; domain=127.0.0.1",
- "FPCK3=AgBNbvoQAGpGEABZLRAAbFsQAF1tEABkDhAAeO0=; expires=Sat, 02-Apr-2019 02:17:40 GMT; path=/; domain=127.0.0.1",
- "CH=deleted; expires=Wed, 03-Mar-2010 02:17:39 GMT; path=/; domain=127.0.0.1",
- "CH=AgBNbvoQAAEcEAApuhAAMJcQADQvEAAvGxAALe0QAD6uEAATwhAAC1AQAC8t; expires=Sat, 02-Apr-2019 02:17:40 GMT; path=/; domain=127.0.0.1"
- )
- ));
-
- $this->jar->addCookiesFromResponse($response);
- $this->assertEquals(3, count($this->jar));
- $this->assertEquals(1, count($this->jar->all(null, null, 'fpc')));
- $this->assertEquals(1, count($this->jar->all(null, null, 'FPCK3')));
- $this->assertEquals(1, count($this->jar->all(null, null, 'CH')));
- }
-
- public function testAddsCookiesFromResponseWithRequest()
- {
- $response = new Response(200, array(
- 'Set-Cookie' => "fpc=d=.Hm.yh4.1XmJWjJfs4orLQzKzPImxklQoxXSHOZATHUSEFciRueW_7704iYUtsXNEXq0M92Px2glMdWypmJ7HIQl6XIUvrZimWjQ3vIdeuRbI.FNQMAfcxu_XN1zSx7l.AcPdKL6guHc2V7hIQFhnjRW0rxm2oHY1P4bGQxFNz7f.tHm12ZD3DbdMDiDy7TBXsuP4DM-&v=2; expires=Fri, 02-Mar-2019 02:17:40 GMT;"
- ));
- $request = new Request('GET', 'http://www.example.com');
- $this->jar->addCookiesFromResponse($response, $request);
- $this->assertEquals(1, count($this->jar));
- }
-
- public function getMatchingCookiesDataProvider()
- {
- return array(
- array('https://example.com', array(0)),
- array('http://example.com', array()),
- array('https://example.com:8912', array()),
- array('https://foo.example.com', array(0)),
- array('http://foo.example.com/test/acme/', array(4))
- );
- }
-
- /**
- * @dataProvider getMatchingCookiesDataProvider
- */
- public function testReturnsCookiesMatchingRequests($url, $cookies)
- {
- $bag = array(
- new Cookie(array(
- 'name' => 'foo',
- 'value' => 'bar',
- 'domain' => 'example.com',
- 'path' => '/',
- 'max_age' => '86400',
- 'port' => array(443, 8080),
- 'version' => '1',
- 'secure' => true
- )),
- new Cookie(array(
- 'name' => 'baz',
- 'value' => 'foobar',
- 'domain' => 'example.com',
- 'path' => '/',
- 'max_age' => '86400',
- 'port' => array(80, 8080),
- 'version' => '1',
- 'secure' => true
- )),
- new Cookie(array(
- 'name' => 'test',
- 'value' => '123',
- 'domain' => 'www.foobar.com',
- 'path' => '/path/',
- 'discard' => true
- )),
- new Cookie(array(
- 'name' => 'muppet',
- 'value' => 'cookie_monster',
- 'domain' => '.y.example.com',
- 'path' => '/acme/',
- 'comment' => 'Comment goes here...',
- 'expires' => time() + 86400
- )),
- new Cookie(array(
- 'name' => 'googoo',
- 'value' => 'gaga',
- 'domain' => '.example.com',
- 'path' => '/test/acme/',
- 'max_age' => 1500,
- 'version' => 2
- ))
- );
-
- foreach ($bag as $cookie) {
- $this->jar->add($cookie);
- }
-
- $request = new Request('GET', $url);
- $results = $this->jar->getMatchingCookies($request);
- $this->assertEquals(count($cookies), count($results));
- foreach ($cookies as $i) {
- $this->assertContains($bag[$i], $results);
- }
- }
-
- /**
- * @expectedException \Guzzle\Plugin\Cookie\Exception\InvalidCookieException
- * @expectedExceptionMessage The cookie name must not contain invalid characters: abc:@123
- */
- public function testThrowsExceptionWithStrictMode()
- {
- $a = new ArrayCookieJar();
- $a->setStrictMode(true);
- $a->add(new Cookie(array(
- 'name' => 'abc:@123',
- 'value' => 'foo',
- 'domain' => 'bar'
- )));
- }
-
- public function testRemoveExistingCookieIfEmpty()
- {
- // Add a cookie that should not be affected
- $a = new Cookie(array(
- 'name' => 'foo',
- 'value' => 'nope',
- 'domain' => 'foo.com',
- 'path' => '/abc'
- ));
- $this->jar->add($a);
-
- $data = array(
- 'name' => 'foo',
- 'value' => 'bar',
- 'domain' => 'foo.com',
- 'path' => '/'
- );
-
- $b = new Cookie($data);
- $this->assertTrue($this->jar->add($b));
- $this->assertEquals(2, count($this->jar));
-
- // Try to re-set the same cookie with no value: assert that cookie is not added
- $data['value'] = null;
- $this->assertFalse($this->jar->add(new Cookie($data)));
- // assert that original cookie has been deleted
- $cookies = $this->jar->all('foo.com');
- $this->assertTrue(in_array($a, $cookies, true));
- $this->assertFalse(in_array($b, $cookies, true));
- $this->assertEquals(1, count($this->jar));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cookie/CookieJar/FileCookieJarTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cookie/CookieJar/FileCookieJarTest.php
deleted file mode 100644
index ac9471f..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cookie/CookieJar/FileCookieJarTest.php
+++ /dev/null
@@ -1,63 +0,0 @@
-file = tempnam('/tmp', 'file-cookies');
- }
-
- public function testLoadsFromFileFile()
- {
- $jar = new FileCookieJar($this->file);
- $this->assertEquals(array(), $jar->all());
- unlink($this->file);
- }
-
- public function testPersistsToFileFile()
- {
- $jar = new FileCookieJar($this->file);
- $jar->add(new Cookie(array(
- 'name' => 'foo',
- 'value' => 'bar',
- 'domain' => 'foo.com',
- 'expires' => time() + 1000
- )));
- $jar->add(new Cookie(array(
- 'name' => 'baz',
- 'value' => 'bar',
- 'domain' => 'foo.com',
- 'expires' => time() + 1000
- )));
- $jar->add(new Cookie(array(
- 'name' => 'boo',
- 'value' => 'bar',
- 'domain' => 'foo.com',
- )));
-
- $this->assertEquals(3, count($jar));
- unset($jar);
-
- // Make sure it wrote to the file
- $contents = file_get_contents($this->file);
- $this->assertNotEmpty($contents);
-
- // Load the cookieJar from the file
- $jar = new FileCookieJar($this->file);
-
- // Weeds out temporary and session cookies
- $this->assertEquals(2, count($jar));
- unset($jar);
- unlink($this->file);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cookie/CookiePluginTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cookie/CookiePluginTest.php
deleted file mode 100644
index f8c175c..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cookie/CookiePluginTest.php
+++ /dev/null
@@ -1,134 +0,0 @@
-getMockBuilder('Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar')
- ->setMethods(array('addCookiesFromResponse'))
- ->getMock();
-
- $mock->expects($this->exactly(1))
- ->method('addCookiesFromResponse')
- ->with($response);
-
- $plugin = new CookiePlugin($mock);
- $plugin->onRequestSent(new Event(array(
- 'response' => $response
- )));
- }
-
- public function testAddsCookiesToRequests()
- {
- $cookie = new Cookie(array(
- 'name' => 'foo',
- 'value' => 'bar'
- ));
-
- $mock = $this->getMockBuilder('Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar')
- ->setMethods(array('getMatchingCookies'))
- ->getMock();
-
- $mock->expects($this->once())
- ->method('getMatchingCookies')
- ->will($this->returnValue(array($cookie)));
-
- $plugin = new CookiePlugin($mock);
-
- $client = new Client();
- $client->getEventDispatcher()->addSubscriber($plugin);
-
- $request = $client->get('http://www.example.com');
- $plugin->onRequestBeforeSend(new Event(array(
- 'request' => $request
- )));
-
- $this->assertEquals('bar', $request->getCookie('foo'));
- }
-
- public function testCookiesAreExtractedFromRedirectResponses()
- {
- $plugin = new CookiePlugin(new ArrayCookieJar());
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 302 Moved Temporarily\r\n" .
- "Set-Cookie: test=583551; expires=Wednesday, 23-Mar-2050 19:49:45 GMT; path=/\r\n" .
- "Location: /redirect\r\n\r\n",
- "HTTP/1.1 200 OK\r\n" .
- "Content-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\n" .
- "Content-Length: 0\r\n\r\n"
- ));
-
- $client = new Client($this->getServer()->getUrl());
- $client->getEventDispatcher()->addSubscriber($plugin);
-
- $client->get()->send();
- $request = $client->get();
- $request->send();
- $this->assertEquals('test=583551', $request->getHeader('Cookie'));
-
- $requests = $this->getServer()->getReceivedRequests(true);
- // Confirm subsequent requests have the cookie.
- $this->assertEquals('test=583551', $requests[2]->getHeader('Cookie'));
- // Confirm the redirected request has the cookie.
- $this->assertEquals('test=583551', $requests[1]->getHeader('Cookie'));
- }
-
- public function testCookiesAreNotAddedWhenParamIsSet()
- {
- $jar = new ArrayCookieJar();
- $plugin = new CookiePlugin($jar);
-
- $jar->add(new Cookie(array(
- 'domain' => 'example.com',
- 'path' => '/',
- 'name' => 'test',
- 'value' => 'hi',
- 'expires' => time() + 3600
- )));
-
- $client = new Client('http://example.com');
- $client->getEventDispatcher()->addSubscriber($plugin);
-
- // Ensure that it is normally added
- $request = $client->get();
- $request->setResponse(new Response(200), true);
- $request->send();
- $this->assertEquals('hi', $request->getCookie('test'));
-
- // Now ensure that it is not added
- $request = $client->get();
- $request->getParams()->set('cookies.disable', true);
- $request->setResponse(new Response(200), true);
- $request->send();
- $this->assertNull($request->getCookie('test'));
- }
-
- public function testProvidesCookieJar()
- {
- $jar = new ArrayCookieJar();
- $plugin = new CookiePlugin($jar);
- $this->assertSame($jar, $plugin->getCookieJar());
- }
-
- public function testEscapesCookieDomains()
- {
- $cookie = new Cookie(array('domain' => '/foo/^$[A-Z]+/'));
- $this->assertFalse($cookie->matchesDomain('foo'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cookie/CookieTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cookie/CookieTest.php
deleted file mode 100644
index 9fb0b43..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cookie/CookieTest.php
+++ /dev/null
@@ -1,223 +0,0 @@
-assertEquals('/', $cookie->getPath());
- $this->assertEquals(array(), $cookie->getPorts());
- }
-
- public function testConvertsDateTimeMaxAgeToUnixTimestamp()
- {
- $cookie = new Cookie(array(
- 'expires' => 'November 20, 1984'
- ));
- $this->assertTrue(is_numeric($cookie->getExpires()));
- }
-
- public function testAddsExpiresBasedOnMaxAge()
- {
- $t = time();
- $cookie = new Cookie(array(
- 'max_age' => 100
- ));
- $this->assertEquals($t + 100, $cookie->getExpires());
- }
-
- public function testHoldsValues()
- {
- $t = time();
- $data = array(
- 'name' => 'foo',
- 'value' => 'baz',
- 'path' => '/bar',
- 'domain' => 'baz.com',
- 'expires' => $t,
- 'max_age' => 100,
- 'comment' => 'Hi',
- 'comment_url' => 'foo.com',
- 'port' => array(1, 2),
- 'version' => 2,
- 'secure' => true,
- 'discard' => true,
- 'http_only' => true,
- 'data' => array(
- 'foo' => 'baz',
- 'bar' => 'bam'
- )
- );
-
- $cookie = new Cookie($data);
- $this->assertEquals($data, $cookie->toArray());
-
- $this->assertEquals('foo', $cookie->getName());
- $this->assertEquals('baz', $cookie->getValue());
- $this->assertEquals('baz.com', $cookie->getDomain());
- $this->assertEquals('/bar', $cookie->getPath());
- $this->assertEquals($t, $cookie->getExpires());
- $this->assertEquals(100, $cookie->getMaxAge());
- $this->assertEquals('Hi', $cookie->getComment());
- $this->assertEquals('foo.com', $cookie->getCommentUrl());
- $this->assertEquals(array(1, 2), $cookie->getPorts());
- $this->assertEquals(2, $cookie->getVersion());
- $this->assertTrue($cookie->getSecure());
- $this->assertTrue($cookie->getDiscard());
- $this->assertTrue($cookie->getHttpOnly());
- $this->assertEquals('baz', $cookie->getAttribute('foo'));
- $this->assertEquals('bam', $cookie->getAttribute('bar'));
- $this->assertEquals(array(
- 'foo' => 'baz',
- 'bar' => 'bam'
- ), $cookie->getAttributes());
-
- $cookie->setName('a')
- ->setValue('b')
- ->setPath('c')
- ->setDomain('bar.com')
- ->setExpires(10)
- ->setMaxAge(200)
- ->setComment('e')
- ->setCommentUrl('f')
- ->setPorts(array(80))
- ->setVersion(3)
- ->setSecure(false)
- ->setHttpOnly(false)
- ->setDiscard(false)
- ->setAttribute('snoop', 'dog');
-
- $this->assertEquals('a', $cookie->getName());
- $this->assertEquals('b', $cookie->getValue());
- $this->assertEquals('c', $cookie->getPath());
- $this->assertEquals('bar.com', $cookie->getDomain());
- $this->assertEquals(10, $cookie->getExpires());
- $this->assertEquals(200, $cookie->getMaxAge());
- $this->assertEquals('e', $cookie->getComment());
- $this->assertEquals('f', $cookie->getCommentUrl());
- $this->assertEquals(array(80), $cookie->getPorts());
- $this->assertEquals(3, $cookie->getVersion());
- $this->assertFalse($cookie->getSecure());
- $this->assertFalse($cookie->getDiscard());
- $this->assertFalse($cookie->getHttpOnly());
- $this->assertEquals('dog', $cookie->getAttribute('snoop'));
- }
-
- public function testDeterminesIfExpired()
- {
- $c = new Cookie();
- $c->setExpires(10);
- $this->assertTrue($c->isExpired());
- $c->setExpires(time() + 10000);
- $this->assertFalse($c->isExpired());
- }
-
- public function testMatchesPorts()
- {
- $cookie = new Cookie();
- // Always matches when nothing is set
- $this->assertTrue($cookie->matchesPort(2));
-
- $cookie->setPorts(array(1, 2));
- $this->assertTrue($cookie->matchesPort(2));
- $this->assertFalse($cookie->matchesPort(100));
- }
-
- public function testMatchesDomain()
- {
- $cookie = new Cookie();
- $this->assertTrue($cookie->matchesDomain('baz.com'));
-
- $cookie->setDomain('baz.com');
- $this->assertTrue($cookie->matchesDomain('baz.com'));
- $this->assertFalse($cookie->matchesDomain('bar.com'));
-
- $cookie->setDomain('.baz.com');
- $this->assertTrue($cookie->matchesDomain('.baz.com'));
- $this->assertTrue($cookie->matchesDomain('foo.baz.com'));
- $this->assertFalse($cookie->matchesDomain('baz.bar.com'));
- $this->assertTrue($cookie->matchesDomain('baz.com'));
-
- $cookie->setDomain('.127.0.0.1');
- $this->assertTrue($cookie->matchesDomain('127.0.0.1'));
-
- $cookie->setDomain('127.0.0.1');
- $this->assertTrue($cookie->matchesDomain('127.0.0.1'));
-
- $cookie->setDomain('.com.');
- $this->assertFalse($cookie->matchesDomain('baz.com'));
-
- $cookie->setDomain('.local');
- $this->assertTrue($cookie->matchesDomain('example.local'));
- }
-
- public function testMatchesPath()
- {
- $cookie = new Cookie();
- $this->assertTrue($cookie->matchesPath('/foo'));
-
- $cookie->setPath('/foo');
-
- // o The cookie-path and the request-path are identical.
- $this->assertTrue($cookie->matchesPath('/foo'));
- $this->assertFalse($cookie->matchesPath('/bar'));
-
- // o The cookie-path is a prefix of the request-path, and the first
- // character of the request-path that is not included in the cookie-
- // path is a %x2F ("/") character.
- $this->assertTrue($cookie->matchesPath('/foo/bar'));
- $this->assertFalse($cookie->matchesPath('/fooBar'));
-
- // o The cookie-path is a prefix of the request-path, and the last
- // character of the cookie-path is %x2F ("/").
- $cookie->setPath('/foo/');
- $this->assertTrue($cookie->matchesPath('/foo/bar'));
- $this->assertFalse($cookie->matchesPath('/fooBaz'));
- $this->assertFalse($cookie->matchesPath('/foo'));
-
- }
-
- public function cookieValidateProvider()
- {
- return array(
- array('foo', 'baz', 'bar', true),
- array('0', '0', '0', true),
- array('', 'baz', 'bar', 'The cookie name must not be empty'),
- array('foo', '', 'bar', 'The cookie value must not be empty'),
- array('foo', 'baz', '', 'The cookie domain must not be empty'),
- array('foo\\', 'baz', '0', 'The cookie name must not contain invalid characters: foo\\'),
- );
- }
-
- /**
- * @dataProvider cookieValidateProvider
- */
- public function testValidatesCookies($name, $value, $domain, $result)
- {
- $cookie = new Cookie(array(
- 'name' => $name,
- 'value' => $value,
- 'domain' => $domain
- ));
- $this->assertSame($result, $cookie->validate());
- }
-
- public function testCreatesInvalidCharacterString()
- {
- $m = new \ReflectionMethod('Guzzle\Plugin\Cookie\Cookie', 'getInvalidCharacters');
- $m->setAccessible(true);
- $p = new \ReflectionProperty('Guzzle\Plugin\Cookie\Cookie', 'invalidCharString');
- $p->setAccessible(true);
- $p->setValue('');
- // Expects a string containing 51 invalid characters
- $this->assertEquals(51, strlen($m->invoke($m)));
- $this->assertContains('@', $m->invoke($m));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/CurlAuth/CurlAuthPluginTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/CurlAuth/CurlAuthPluginTest.php
deleted file mode 100644
index 2a4b49e..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/CurlAuth/CurlAuthPluginTest.php
+++ /dev/null
@@ -1,39 +0,0 @@
-getEventDispatcher()->addSubscriber($plugin);
- $request = $client->get('/');
- $this->assertEquals('michael', $request->getUsername());
- $this->assertEquals('test', $request->getPassword());
- Version::$emitWarnings = true;
- }
-
- public function testAddsDigestAuthentication()
- {
- Version::$emitWarnings = false;
- $plugin = new CurlAuthPlugin('julian', 'test', CURLAUTH_DIGEST);
- $client = new Client('http://www.test.com/');
- $client->getEventDispatcher()->addSubscriber($plugin);
- $request = $client->get('/');
- $this->assertEquals('julian', $request->getUsername());
- $this->assertEquals('test', $request->getPassword());
- $this->assertEquals('julian:test', $request->getCurlOptions()->get(CURLOPT_USERPWD));
- $this->assertEquals(CURLAUTH_DIGEST, $request->getCurlOptions()->get(CURLOPT_HTTPAUTH));
- Version::$emitWarnings = true;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/ErrorResponse/ErrorResponsePluginTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/ErrorResponse/ErrorResponsePluginTest.php
deleted file mode 100644
index 6f94186..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/ErrorResponse/ErrorResponsePluginTest.php
+++ /dev/null
@@ -1,137 +0,0 @@
-flush();
- }
-
- public function setUp()
- {
- $mockError = 'Guzzle\Tests\Mock\ErrorResponseMock';
- $description = ServiceDescription::factory(array(
- 'operations' => array(
- 'works' => array(
- 'httpMethod' => 'GET',
- 'errorResponses' => array(
- array('code' => 500, 'class' => $mockError),
- array('code' => 503, 'reason' => 'foo', 'class' => $mockError),
- array('code' => 200, 'reason' => 'Error!', 'class' => $mockError)
- )
- ),
- 'bad_class' => array(
- 'httpMethod' => 'GET',
- 'errorResponses' => array(
- array('code' => 500, 'class' => 'Does\\Not\\Exist')
- )
- ),
- 'does_not_implement' => array(
- 'httpMethod' => 'GET',
- 'errorResponses' => array(
- array('code' => 500, 'class' => __CLASS__)
- )
- ),
- 'no_errors' => array('httpMethod' => 'GET'),
- 'no_class' => array(
- 'httpMethod' => 'GET',
- 'errorResponses' => array(
- array('code' => 500)
- )
- ),
- )
- ));
- $this->client = new Client($this->getServer()->getUrl());
- $this->client->setDescription($description);
- }
-
- /**
- * @expectedException \Guzzle\Http\Exception\ServerErrorResponseException
- */
- public function testSkipsWhenErrorResponsesIsNotSet()
- {
- $this->getServer()->enqueue("HTTP/1.1 500 Foo\r\nContent-Length: 0\r\n\r\n");
- $this->client->addSubscriber(new ErrorResponsePlugin());
- $this->client->getCommand('no_errors')->execute();
- }
-
- public function testSkipsWhenErrorResponsesIsNotSetAndAllowsSuccess()
- {
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $this->client->addSubscriber(new ErrorResponsePlugin());
- $this->client->getCommand('no_errors')->execute();
- }
-
- /**
- * @expectedException \Guzzle\Plugin\ErrorResponse\Exception\ErrorResponseException
- * @expectedExceptionMessage Does\Not\Exist does not exist
- */
- public function testEnsuresErrorResponseExists()
- {
- $this->getServer()->enqueue("HTTP/1.1 500 Foo\r\nContent-Length: 0\r\n\r\n");
- $this->client->addSubscriber(new ErrorResponsePlugin());
- $this->client->getCommand('bad_class')->execute();
- }
-
- /**
- * @expectedException \Guzzle\Plugin\ErrorResponse\Exception\ErrorResponseException
- * @expectedExceptionMessage must implement Guzzle\Plugin\ErrorResponse\ErrorResponseExceptionInterface
- */
- public function testEnsuresErrorResponseImplementsInterface()
- {
- $this->getServer()->enqueue("HTTP/1.1 500 Foo\r\nContent-Length: 0\r\n\r\n");
- $this->client->addSubscriber(new ErrorResponsePlugin());
- $this->client->getCommand('does_not_implement')->execute();
- }
-
- public function testThrowsSpecificErrorResponseOnMatch()
- {
- try {
- $this->getServer()->enqueue("HTTP/1.1 500 Foo\r\nContent-Length: 0\r\n\r\n");
- $this->client->addSubscriber(new ErrorResponsePlugin());
- $command = $this->client->getCommand('works');
- $command->execute();
- $this->fail('Exception not thrown');
- } catch (ErrorResponseMock $e) {
- $this->assertSame($command, $e->command);
- $this->assertEquals(500, $e->response->getStatusCode());
- }
- }
-
- /**
- * @expectedException \Guzzle\Tests\Mock\ErrorResponseMock
- */
- public function testThrowsWhenCodeAndPhraseMatch()
- {
- $this->getServer()->enqueue("HTTP/1.1 200 Error!\r\nContent-Length: 0\r\n\r\n");
- $this->client->addSubscriber(new ErrorResponsePlugin());
- $this->client->getCommand('works')->execute();
- }
-
- public function testSkipsWhenReasonDoesNotMatch()
- {
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $this->client->addSubscriber(new ErrorResponsePlugin());
- $this->client->getCommand('works')->execute();
- }
-
- public function testSkipsWhenNoClassIsSet()
- {
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $this->client->addSubscriber(new ErrorResponsePlugin());
- $this->client->getCommand('no_class')->execute();
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/History/HistoryPluginTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/History/HistoryPluginTest.php
deleted file mode 100644
index 41aa673..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/History/HistoryPluginTest.php
+++ /dev/null
@@ -1,140 +0,0 @@
-get();
- $requests[$i]->setResponse(new Response(200), true);
- $requests[$i]->send();
- $h->add($requests[$i]);
- }
-
- return $requests;
- }
-
- public function testDescribesSubscribedEvents()
- {
- $this->assertInternalType('array', HistoryPlugin::getSubscribedEvents());
- }
-
- public function testMaintainsLimitValue()
- {
- $h = new HistoryPlugin();
- $this->assertSame($h, $h->setLimit(10));
- $this->assertEquals(10, $h->getLimit());
- }
-
- public function testAddsRequests()
- {
- $h = new HistoryPlugin();
- $requests = $this->addRequests($h, 1);
- $this->assertEquals(1, count($h));
- $i = $h->getIterator();
- $this->assertEquals(1, count($i));
- $this->assertEquals($requests[0], $i[0]);
- }
-
- /**
- * @depends testAddsRequests
- */
- public function testMaintainsLimit()
- {
- $h = new HistoryPlugin();
- $h->setLimit(2);
- $requests = $this->addRequests($h, 3);
- $this->assertEquals(2, count($h));
- $i = 0;
- foreach ($h as $request) {
- if ($i > 0) {
- $this->assertSame($requests[$i], $request);
- }
- }
- }
-
- public function testReturnsLastRequest()
- {
- $h = new HistoryPlugin();
- $requests = $this->addRequests($h, 5);
- $this->assertSame(end($requests), $h->getLastRequest());
- }
-
- public function testReturnsLastResponse()
- {
- $h = new HistoryPlugin();
- $requests = $this->addRequests($h, 5);
- $this->assertSame(end($requests)->getResponse(), $h->getLastResponse());
- }
-
- public function testClearsHistory()
- {
- $h = new HistoryPlugin();
- $requests = $this->addRequests($h, 5);
- $this->assertEquals(5, count($h));
- $h->clear();
- $this->assertEquals(0, count($h));
- }
-
- /**
- * @depends testAddsRequests
- */
- public function testUpdatesAddRequests()
- {
- $h = new HistoryPlugin();
- $client = new Client('http://127.0.0.1/');
- $client->getEventDispatcher()->addSubscriber($h);
-
- $request = $client->get();
- $request->setResponse(new Response(200), true);
- $request->send();
-
- $this->assertSame($request, $h->getLastRequest());
- }
-
- public function testCanCastToString()
- {
- $client = new Client('http://127.0.0.1/');
- $h = new HistoryPlugin();
- $client->getEventDispatcher()->addSubscriber($h);
-
- $mock = new MockPlugin(array(
- new Response(301, array('Location' => '/redirect1', 'Content-Length' => 0)),
- new Response(307, array('Location' => '/redirect2', 'Content-Length' => 0)),
- new Response(200, array('Content-Length' => '2'), 'HI')
- ));
-
- $client->getEventDispatcher()->addSubscriber($mock);
- $request = $client->get();
- $request->send();
- $this->assertEquals(3, count($h));
- $this->assertEquals(3, count($mock->getReceivedRequests()));
-
- $h = str_replace("\r", '', $h);
- $this->assertContains("> GET / HTTP/1.1\nHost: 127.0.0.1\nUser-Agent:", $h);
- $this->assertContains("< HTTP/1.1 301 Moved Permanently\nLocation: /redirect1", $h);
- $this->assertContains("< HTTP/1.1 307 Temporary Redirect\nLocation: /redirect2", $h);
- $this->assertContains("< HTTP/1.1 200 OK\nContent-Length: 2\n\nHI", $h);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Log/LogPluginTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Log/LogPluginTest.php
deleted file mode 100644
index ad663a5..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Log/LogPluginTest.php
+++ /dev/null
@@ -1,95 +0,0 @@
-adapter = new ClosureLogAdapter(function ($message) {
- echo $message;
- });
- }
-
- public function testIgnoresCurlEventsWhenNotWiringBodies()
- {
- $p = new LogPlugin($this->adapter);
- $this->assertNotEmpty($p->getSubscribedEvents());
- $event = new Event(array('request' => new Request('GET', 'http://foo.com')));
- $p->onCurlRead($event);
- $p->onCurlWrite($event);
- $p->onRequestBeforeSend($event);
- }
-
- public function testLogsWhenComplete()
- {
- $output = '';
- $p = new LogPlugin(new ClosureLogAdapter(function ($message) use (&$output) {
- $output = $message;
- }), '{method} {resource} | {code} {res_body}');
-
- $p->onRequestSent(new Event(array(
- 'request' => new Request('GET', 'http://foo.com'),
- 'response' => new Response(200, array(), 'Foo')
- )));
-
- $this->assertEquals('GET / | 200 Foo', $output);
- }
-
- public function testWiresBodiesWhenNeeded()
- {
- $client = new Client($this->getServer()->getUrl());
- $plugin = new LogPlugin($this->adapter, '{req_body} | {res_body}', true);
- $client->getEventDispatcher()->addSubscriber($plugin);
- $request = $client->put();
-
- // Send the response from the dummy server as the request body
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\nsend");
- $stream = fopen($this->getServer()->getUrl(), 'r');
- $request->setBody(EntityBody::factory($stream, 4));
-
- $tmpFile = tempnam(sys_get_temp_dir(), 'non_repeatable');
- $request->setResponseBody(EntityBody::factory(fopen($tmpFile, 'w')));
-
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 8\r\n\r\nresponse");
-
- ob_start();
- $request->send();
- $message = ob_get_clean();
-
- unlink($tmpFile);
- $this->assertContains("send", $message);
- $this->assertContains("response", $message);
- }
-
- public function testHasHelpfulStaticFactoryMethod()
- {
- $s = fopen('php://temp', 'r+');
- $client = new Client();
- $client->addSubscriber(LogPlugin::getDebugPlugin(true, $s));
- $request = $client->put('http://foo.com', array('Content-Type' => 'Foo'), 'Bar');
- $request->setresponse(new Response(200), true);
- $request->send();
- rewind($s);
- $contents = stream_get_contents($s);
- $this->assertContains('# Request:', $contents);
- $this->assertContainsIns('PUT / HTTP/1.1', $contents);
- $this->assertContains('# Response:', $contents);
- $this->assertContainsIns('HTTP/1.1 200 OK', $contents);
- $this->assertContains('# Errors:', $contents);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Md5/CommandContentMd5PluginTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Md5/CommandContentMd5PluginTest.php
deleted file mode 100644
index 4bd4111..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Md5/CommandContentMd5PluginTest.php
+++ /dev/null
@@ -1,97 +0,0 @@
- array(
- 'test' => array(
- 'httpMethod' => 'PUT',
- 'parameters' => array(
- 'ContentMD5' => array(),
- 'Body' => array(
- 'location' => 'body'
- )
- )
- )
- )
- ));
-
- $client = new Client();
- $client->setDescription($description);
-
- return $client;
- }
-
- public function testHasEvents()
- {
- $this->assertNotEmpty(CommandContentMd5Plugin::getSubscribedEvents());
- }
-
- public function testValidatesMd5WhenParamExists()
- {
- $client = $this->getClient();
- $command = $client->getCommand('test', array(
- 'Body' => 'Foo',
- 'ContentMD5' => true
- ));
- $event = new Event(array('command' => $command));
- $request = $command->prepare();
- $plugin = new CommandContentMd5Plugin();
- $plugin->onCommandBeforeSend($event);
- $this->assertEquals('E1bGfXrRY42Ba/uCLdLCXQ==', (string) $request->getHeader('Content-MD5'));
- }
-
- public function testDoesNothingWhenNoPayloadExists()
- {
- $client = $this->getClient();
- $client->getDescription()->getOperation('test')->setHttpMethod('GET');
- $command = $client->getCommand('test');
- $event = new Event(array('command' => $command));
- $request = $command->prepare();
- $plugin = new CommandContentMd5Plugin();
- $plugin->onCommandBeforeSend($event);
- $this->assertNull($request->getHeader('Content-MD5'));
- }
-
- public function testAddsValidationToResponsesOfContentMd5()
- {
- $client = $this->getClient();
- $client->getDescription()->getOperation('test')->setHttpMethod('GET');
- $command = $client->getCommand('test', array(
- 'ValidateMD5' => true
- ));
- $event = new Event(array('command' => $command));
- $request = $command->prepare();
- $plugin = new CommandContentMd5Plugin();
- $plugin->onCommandBeforeSend($event);
- $listeners = $request->getEventDispatcher()->getListeners('request.complete');
- $this->assertNotEmpty($listeners);
- }
-
- public function testIgnoresValidationWhenDisabled()
- {
- $client = $this->getClient();
- $client->getDescription()->getOperation('test')->setHttpMethod('GET');
- $command = $client->getCommand('test', array(
- 'ValidateMD5' => false
- ));
- $event = new Event(array('command' => $command));
- $request = $command->prepare();
- $plugin = new CommandContentMd5Plugin();
- $plugin->onCommandBeforeSend($event);
- $listeners = $request->getEventDispatcher()->getListeners('request.complete');
- $this->assertEmpty($listeners);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Md5/Md5ValidatorPluginTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Md5/Md5ValidatorPluginTest.php
deleted file mode 100644
index 482e92b..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Md5/Md5ValidatorPluginTest.php
+++ /dev/null
@@ -1,120 +0,0 @@
-create('GET', 'http://www.test.com/');
- $request->getEventDispatcher()->addSubscriber($plugin);
-
- $body = 'abc';
- $hash = md5($body);
- $response = new Response(200, array(
- 'Content-MD5' => $hash,
- 'Content-Length' => 3
- ), 'abc');
-
- $request->dispatch('request.complete', array(
- 'response' => $response
- ));
-
- // Try again with no Content-MD5
- $response->removeHeader('Content-MD5');
- $request->dispatch('request.complete', array(
- 'response' => $response
- ));
- }
-
- /**
- * @expectedException UnexpectedValueException
- */
- public function testThrowsExceptionOnInvalidMd5()
- {
- $plugin = new Md5ValidatorPlugin();
- $request = RequestFactory::getInstance()->create('GET', 'http://www.test.com/');
- $request->getEventDispatcher()->addSubscriber($plugin);
-
- $request->dispatch('request.complete', array(
- 'response' => new Response(200, array(
- 'Content-MD5' => 'foobar',
- 'Content-Length' => 3
- ), 'abc')
- ));
- }
-
- public function testSkipsWhenContentLengthIsTooLarge()
- {
- $plugin = new Md5ValidatorPlugin(false, 1);
- $request = RequestFactory::getInstance()->create('GET', 'http://www.test.com/');
- $request->getEventDispatcher()->addSubscriber($plugin);
-
- $request->dispatch('request.complete', array(
- 'response' => new Response(200, array(
- 'Content-MD5' => 'foobar',
- 'Content-Length' => 3
- ), 'abc')
- ));
- }
-
- public function testProperlyValidatesWhenUsingContentEncoding()
- {
- $plugin = new Md5ValidatorPlugin(true);
- $request = RequestFactory::getInstance()->create('GET', 'http://www.test.com/');
- $request->getEventDispatcher()->addSubscriber($plugin);
-
- // Content-MD5 is the MD5 hash of the canonical content after all
- // content-encoding has been applied. Because cURL will automatically
- // decompress entity bodies, we need to re-compress it to calculate.
- $body = EntityBody::factory('abc');
- $body->compress();
- $hash = $body->getContentMd5();
- $body->uncompress();
-
- $response = new Response(200, array(
- 'Content-MD5' => $hash,
- 'Content-Encoding' => 'gzip'
- ), 'abc');
- $request->dispatch('request.complete', array(
- 'response' => $response
- ));
- $this->assertEquals('abc', $response->getBody(true));
-
- // Try again with an unknown encoding
- $response = new Response(200, array(
- 'Content-MD5' => $hash,
- 'Content-Encoding' => 'foobar'
- ), 'abc');
- $request->dispatch('request.complete', array(
- 'response' => $response
- ));
-
- // Try again with compress
- $body->compress('bzip2.compress');
- $response = new Response(200, array(
- 'Content-MD5' => $body->getContentMd5(),
- 'Content-Encoding' => 'compress'
- ), 'abc');
- $request->dispatch('request.complete', array(
- 'response' => $response
- ));
-
- // Try again with encoding and disabled content-encoding checks
- $request->getEventDispatcher()->removeSubscriber($plugin);
- $plugin = new Md5ValidatorPlugin(false);
- $request->getEventDispatcher()->addSubscriber($plugin);
- $request->dispatch('request.complete', array(
- 'response' => $response
- ));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Mock/MockPluginTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Mock/MockPluginTest.php
deleted file mode 100644
index 3af8fef..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Mock/MockPluginTest.php
+++ /dev/null
@@ -1,199 +0,0 @@
-assertInternalType('array', MockPlugin::getSubscribedEvents());
- }
-
- public function testDescribesEvents()
- {
- $this->assertInternalType('array', MockPlugin::getAllEvents());
- }
-
- public function testCanBeTemporary()
- {
- $plugin = new MockPlugin();
- $this->assertFalse($plugin->isTemporary());
- $plugin = new MockPlugin(null, true);
- $this->assertTrue($plugin->isTemporary());
- }
-
- public function testIsCountable()
- {
- $plugin = new MockPlugin();
- $plugin->addResponse(Response::fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"));
- $this->assertEquals(1, count($plugin));
- }
-
- /**
- * @depends testIsCountable
- */
- public function testCanClearQueue()
- {
- $plugin = new MockPlugin();
- $plugin->addResponse(Response::fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"));
- $plugin->clearQueue();
- $this->assertEquals(0, count($plugin));
- }
-
- public function testCanInspectQueue()
- {
- $plugin = new MockPlugin();
- $this->assertInternalType('array', $plugin->getQueue());
- $plugin->addResponse(Response::fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"));
- $queue = $plugin->getQueue();
- $this->assertInternalType('array', $queue);
- $this->assertEquals(1, count($queue));
- }
-
- public function testRetrievesResponsesFromFiles()
- {
- $response = MockPlugin::getMockFile(__DIR__ . '/../../TestData/mock_response');
- $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $response);
- $this->assertEquals(200, $response->getStatusCode());
- }
-
- /**
- * @expectedException InvalidArgumentException
- */
- public function testThrowsExceptionWhenResponseFileIsNotFound()
- {
- MockPlugin::getMockFile('missing/filename');
- }
-
- /**
- * @expectedException InvalidArgumentException
- */
- public function testInvalidResponsesThrowAnException()
- {
- $p = new MockPlugin();
- $p->addResponse($this);
- }
-
- public function testAddsResponseObjectsToQueue()
- {
- $p = new MockPlugin();
- $response = Response::fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $p->addResponse($response);
- $this->assertEquals(array($response), $p->getQueue());
- }
-
- public function testAddsResponseFilesToQueue()
- {
- $p = new MockPlugin();
- $p->addResponse(__DIR__ . '/../../TestData/mock_response');
- $this->assertEquals(1, count($p));
- }
-
- /**
- * @depends testAddsResponseFilesToQueue
- */
- public function testAddsMockResponseToRequestFromClient()
- {
- $p = new MockPlugin();
- $response = MockPlugin::getMockFile(__DIR__ . '/../../TestData/mock_response');
- $p->addResponse($response);
-
- $client = new Client('http://127.0.0.1:123/');
- $client->getEventDispatcher()->addSubscriber($p, 9999);
- $request = $client->get();
- $request->send();
-
- $this->assertSame($response, $request->getResponse());
- $this->assertEquals(0, count($p));
- }
-
- /**
- * @depends testAddsResponseFilesToQueue
- * @expectedException \OutOfBoundsException
- */
- public function testUpdateThrowsExceptionWhenEmpty()
- {
- $p = new MockPlugin();
- $p->onRequestBeforeSend(new Event());
- }
-
- /**
- * @depends testAddsMockResponseToRequestFromClient
- */
- public function testDetachesTemporaryWhenEmpty()
- {
- $p = new MockPlugin(null, true);
- $p->addResponse(MockPlugin::getMockFile(__DIR__ . '/../../TestData/mock_response'));
- $client = new Client('http://127.0.0.1:123/');
- $client->getEventDispatcher()->addSubscriber($p, 9999);
- $request = $client->get();
- $request->send();
-
- $this->assertFalse($this->hasSubscriber($client, $p));
- }
-
- public function testLoadsResponsesFromConstructor()
- {
- $p = new MockPlugin(array(new Response(200)));
- $this->assertEquals(1, $p->count());
- }
-
- public function testStoresMockedRequests()
- {
- $p = new MockPlugin(array(new Response(200), new Response(200)));
- $client = new Client('http://127.0.0.1:123/');
- $client->getEventDispatcher()->addSubscriber($p, 9999);
-
- $request1 = $client->get();
- $request1->send();
- $this->assertEquals(array($request1), $p->getReceivedRequests());
-
- $request2 = $client->get();
- $request2->send();
- $this->assertEquals(array($request1, $request2), $p->getReceivedRequests());
-
- $p->flush();
- $this->assertEquals(array(), $p->getReceivedRequests());
- }
-
- public function testReadsBodiesFromMockedRequests()
- {
- $p = new MockPlugin(array(new Response(200)));
- $p->readBodies(true);
- $client = new Client('http://127.0.0.1:123/');
- $client->getEventDispatcher()->addSubscriber($p, 9999);
-
- $body = EntityBody::factory('foo');
- $request = $client->put();
- $request->setBody($body);
- $request->send();
- $this->assertEquals(3, $body->ftell());
- }
-
- public function testCanMockBadRequestExceptions()
- {
- $client = new Client('http://127.0.0.1:123/');
- $ex = new CurlException('Foo');
- $mock = new MockPlugin(array($ex));
- $client->addSubscriber($mock);
- $request = $client->get('foo');
-
- try {
- $request->send();
- $this->fail('Did not dequeue an exception');
- } catch (CurlException $e) {
- $this->assertSame($e, $ex);
- $this->assertSame($request, $ex->getRequest());
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Oauth/OauthPluginTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Oauth/OauthPluginTest.php
deleted file mode 100644
index 3892fb6..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Oauth/OauthPluginTest.php
+++ /dev/null
@@ -1,345 +0,0 @@
- 'foo',
- 'consumer_secret' => 'bar',
- 'token' => 'count',
- 'token_secret' => 'dracula'
- );
-
- protected function getRequest()
- {
- return RequestFactory::getInstance()->create('POST', 'http://www.test.com/path?a=b&c=d', null, array(
- 'e' => 'f'
- ));
- }
-
- public function testSubscribesToEvents()
- {
- $events = OauthPlugin::getSubscribedEvents();
- $this->assertArrayHasKey('request.before_send', $events);
- }
-
- public function testAcceptsConfigurationData()
- {
- $p = new OauthPlugin($this->config);
-
- // Access the config object
- $class = new \ReflectionClass($p);
- $property = $class->getProperty('config');
- $property->setAccessible(true);
- $config = $property->getValue($p);
-
- $this->assertEquals('foo', $config['consumer_key']);
- $this->assertEquals('bar', $config['consumer_secret']);
- $this->assertEquals('count', $config['token']);
- $this->assertEquals('dracula', $config['token_secret']);
- $this->assertEquals('1.0', $config['version']);
- $this->assertEquals('HMAC-SHA1', $config['signature_method']);
- $this->assertEquals('header', $config['request_method']);
- }
-
- public function testCreatesStringToSignFromPostRequest()
- {
- $p = new OauthPlugin($this->config);
- $request = $this->getRequest();
- $signString = $p->getStringToSign($request, self::TIMESTAMP, self::NONCE);
-
- $this->assertContains('&e=f', rawurldecode($signString));
-
- $expectedSignString =
- // Method and URL
- 'POST&http%3A%2F%2Fwww.test.com%2Fpath' .
- // Sorted parameters from query string and body
- '&a%3Db%26c%3Dd%26e%3Df%26oauth_consumer_key%3Dfoo' .
- '%26oauth_nonce%3De7aa11195ca58349bec8b5ebe351d3497eb9e603%26' .
- 'oauth_signature_method%3DHMAC-SHA1' .
- '%26oauth_timestamp%3D' . self::TIMESTAMP . '%26oauth_token%3Dcount%26oauth_version%3D1.0';
-
- $this->assertEquals($expectedSignString, $signString);
- }
-
- public function testCreatesStringToSignIgnoringPostFields()
- {
- $config = $this->config;
- $config['disable_post_params'] = true;
- $p = new OauthPlugin($config);
- $request = $this->getRequest();
- $sts = rawurldecode($p->getStringToSign($request, self::TIMESTAMP, self::NONCE));
- $this->assertNotContains('&e=f', $sts);
- }
-
- public function testCreatesStringToSignFromPostRequestWithCustomContentType()
- {
- $p = new OauthPlugin($this->config);
- $request = $this->getRequest();
- $request->setHeader('Content-Type', 'Foo');
- $this->assertEquals(
- // Method and URL
- 'POST&http%3A%2F%2Fwww.test.com%2Fpath' .
- // Sorted parameters from query string and body
- '&a%3Db%26c%3Dd%26oauth_consumer_key%3Dfoo' .
- '%26oauth_nonce%3D'. self::NONCE .'%26' .
- 'oauth_signature_method%3DHMAC-SHA1' .
- '%26oauth_timestamp%3D' . self::TIMESTAMP . '%26oauth_token%3Dcount%26oauth_version%3D1.0',
- $p->getStringToSign($request, self::TIMESTAMP, self::NONCE)
- );
- }
-
- /**
- * @depends testCreatesStringToSignFromPostRequest
- */
- public function testConvertsBooleansToStrings()
- {
- $p = new OauthPlugin($this->config);
- $request = $this->getRequest();
- $request->getQuery()->set('a', true);
- $request->getQuery()->set('c', false);
- $this->assertContains('&a%3Dtrue%26c%3Dfalse', $p->getStringToSign($request, self::TIMESTAMP, self::NONCE));
- }
-
- public function testCreatesStringToSignFromPostRequestWithNullValues()
- {
- $config = array(
- 'consumer_key' => 'foo',
- 'consumer_secret' => 'bar',
- 'token' => null,
- 'token_secret' => 'dracula'
- );
-
- $p = new OauthPlugin($config);
- $request = $this->getRequest();
- $signString = $p->getStringToSign($request, self::TIMESTAMP, self::NONCE);
-
- $this->assertContains('&e=f', rawurldecode($signString));
-
- $expectedSignString = // Method and URL
- 'POST&http%3A%2F%2Fwww.test.com%2Fpath' .
- // Sorted parameters from query string and body
- '&a%3Db%26c%3Dd%26e%3Df%26oauth_consumer_key%3Dfoo' .
- '%26oauth_nonce%3De7aa11195ca58349bec8b5ebe351d3497eb9e603%26' .
- 'oauth_signature_method%3DHMAC-SHA1' .
- '%26oauth_timestamp%3D' . self::TIMESTAMP . '%26oauth_version%3D1.0';
-
- $this->assertEquals($expectedSignString, $signString);
- }
-
- /**
- * @depends testCreatesStringToSignFromPostRequest
- */
- public function testMultiDimensionalArray()
- {
- $p = new OauthPlugin($this->config);
- $request = $this->getRequest();
- $request->getQuery()->set('a', array('b' => array('e' => 'f', 'c' => 'd')));
- $this->assertContains('a%255Bb%255D%255Bc%255D%3Dd%26a%255Bb%255D%255Be%255D%3Df%26c%3Dd%26e%3Df%26', $p->getStringToSign($request, self::TIMESTAMP, self::NONCE));
- }
-
- /**
- * @depends testMultiDimensionalArray
- */
- public function testMultiDimensionalArrayWithNonDefaultQueryAggregator()
- {
- $p = new OauthPlugin($this->config);
- $request = $this->getRequest();
- $aggregator = new CommaAggregator();
- $query = $request->getQuery()->setAggregator($aggregator)
- ->set('g', array('h', 'i', 'j'))
- ->set('k', array('l'))
- ->set('m', array('n', 'o'));
- $this->assertContains('a%3Db%26c%3Dd%26e%3Df%26g%3Dh%2Ci%2Cj%26k%3Dl%26m%3Dn%2Co', $p->getStringToSign($request, self::TIMESTAMP, self::NONCE));
- }
-
- /**
- * @depends testCreatesStringToSignFromPostRequest
- */
- public function testSignsStrings()
- {
- $p = new OauthPlugin(array_merge($this->config, array(
- 'signature_callback' => function($string, $key) {
- return "_{$string}|{$key}_";
- }
- )));
- $request = $this->getRequest();
- $sig = $p->getSignature($request, self::TIMESTAMP, self::NONCE);
- $this->assertEquals(
- '_POST&http%3A%2F%2Fwww.test.com%2Fpath&a%3Db%26c%3Dd%26e%3Df%26oauth_consumer_key%3Dfoo' .
- '%26oauth_nonce%3D'. self::NONCE .'%26oauth_signature_method%3DHMAC-SHA1' .
- '%26oauth_timestamp%3D' . self::TIMESTAMP . '%26oauth_token%3Dcount%26oauth_version%3D1.0|' .
- 'bar&dracula_',
- base64_decode($sig)
- );
- }
-
- /**
- * Test that the Oauth is signed correctly and that extra strings haven't been added
- * to the authorization header.
- */
- public function testSignsOauthRequests()
- {
- $p = new OauthPlugin($this->config);
- $event = new Event(array(
- 'request' => $this->getRequest(),
- 'timestamp' => self::TIMESTAMP
- ));
- $params = $p->onRequestBeforeSend($event);
-
- $this->assertTrue($event['request']->hasHeader('Authorization'));
-
- $authorizationHeader = (string)$event['request']->getHeader('Authorization');
-
- $this->assertStringStartsWith('OAuth ', $authorizationHeader);
-
- $stringsToCheck = array(
- 'oauth_consumer_key="foo"',
- 'oauth_nonce="'.urlencode($params['oauth_nonce']).'"',
- 'oauth_signature="'.urlencode($params['oauth_signature']).'"',
- 'oauth_signature_method="HMAC-SHA1"',
- 'oauth_timestamp="' . self::TIMESTAMP . '"',
- 'oauth_token="count"',
- 'oauth_version="1.0"',
- );
-
- $totalLength = strlen('OAuth ');
-
- //Separator is not used before first parameter.
- $separator = '';
-
- foreach ($stringsToCheck as $stringToCheck) {
- $this->assertContains($stringToCheck, $authorizationHeader);
- $totalLength += strlen($separator);
- $totalLength += strlen($stringToCheck);
- $separator = ', ';
- }
-
- // Technically this test is not universally valid. It would be allowable to have extra \n characters
- // in the Authorization header. However Guzzle does not do this, so we just perform a simple check
- // on length to validate the Authorization header is composed of only the strings above.
- $this->assertEquals($totalLength, strlen($authorizationHeader), 'Authorization has extra characters i.e. contains extra elements compared to stringsToCheck.');
- }
-
- public function testSignsOauthQueryStringRequest()
- {
- $config = array_merge(
- $this->config,
- array('request_method' => OauthPlugin::REQUEST_METHOD_QUERY)
- );
-
- $p = new OauthPlugin($config);
- $event = new Event(array(
- 'request' => $this->getRequest(),
- 'timestamp' => self::TIMESTAMP
- ));
- $params = $p->onRequestBeforeSend($event);
-
- $this->assertFalse($event['request']->hasHeader('Authorization'));
-
- $stringsToCheck = array(
- 'a=b',
- 'c=d',
- 'oauth_consumer_key=foo',
- 'oauth_nonce='.urlencode($params['oauth_nonce']),
- 'oauth_signature='.urlencode($params['oauth_signature']),
- 'oauth_signature_method=HMAC-SHA1',
- 'oauth_timestamp='.self::TIMESTAMP,
- 'oauth_token=count',
- 'oauth_version=1.0',
- );
-
- $queryString = (string) $event['request']->getQuery();
-
- $totalLength = strlen('?');
-
- //Separator is not used before first parameter.
- $separator = '';
-
- foreach ($stringsToCheck as $stringToCheck) {
- $this->assertContains($stringToCheck, $queryString);
- $totalLength += strlen($separator);
- $totalLength += strlen($stringToCheck);
- $separator = '&';
- }
-
- // Removes the last query string separator '&'
- $totalLength -= 1;
-
- $this->assertEquals($totalLength, strlen($queryString), 'Query string has extra characters i.e. contains extra elements compared to stringsToCheck.');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testInvalidArgumentExceptionOnMethodError()
- {
- $config = array_merge(
- $this->config,
- array('request_method' => 'FakeMethod')
- );
-
- $p = new OauthPlugin($config);
- $event = new Event(array(
- 'request' => $this->getRequest(),
- 'timestamp' => self::TIMESTAMP
- ));
-
- $p->onRequestBeforeSend($event);
- }
-
- public function testDoesNotAddFalseyValuesToAuthorization()
- {
- unset($this->config['token']);
- $p = new OauthPlugin($this->config);
- $event = new Event(array('request' => $this->getRequest(), 'timestamp' => self::TIMESTAMP));
- $p->onRequestBeforeSend($event);
- $this->assertTrue($event['request']->hasHeader('Authorization'));
- $this->assertNotContains('oauth_token=', (string) $event['request']->getHeader('Authorization'));
- }
-
- public function testOptionalOauthParametersAreNotAutomaticallyAdded()
- {
- // The only required Oauth parameters are the consumer key and secret. That is enough credentials
- // for signing oauth requests.
- $config = array(
- 'consumer_key' => 'foo',
- 'consumer_secret' => 'bar',
- );
-
- $plugin = new OauthPlugin($config);
- $event = new Event(array(
- 'request' => $this->getRequest(),
- 'timestamp' => self::TIMESTAMP
- ));
-
- $timestamp = $plugin->getTimestamp($event);
- $request = $event['request'];
- $nonce = $plugin->generateNonce($request);
-
- $paramsToSign = $plugin->getParamsToSign($request, $timestamp, $nonce);
-
- $optionalParams = array(
- 'callback' => 'oauth_callback',
- 'token' => 'oauth_token',
- 'verifier' => 'oauth_verifier',
- 'token_secret' => 'token_secret'
- );
-
- foreach ($optionalParams as $optionName => $oauthName) {
- $this->assertArrayNotHasKey($oauthName, $paramsToSign, "Optional Oauth param '$oauthName' was not set via config variable '$optionName', but it is listed in getParamsToSign().");
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/AbstractConfigLoaderTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/AbstractConfigLoaderTest.php
deleted file mode 100644
index 8b42fb8..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/AbstractConfigLoaderTest.php
+++ /dev/null
@@ -1,149 +0,0 @@
-loader = $this->getMockBuilder('Guzzle\Service\AbstractConfigLoader')
- ->setMethods(array('build'))
- ->getMockForAbstractClass();
- }
-
- public function tearDown()
- {
- foreach ($this->cleanup as $file) {
- unlink($file);
- }
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testOnlyLoadsSupportedTypes()
- {
- $this->loader->load(new \stdClass());
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\InvalidArgumentException
- * @expectedExceptionMessage Unable to open fooooooo.json
- */
- public function testFileMustBeReadable()
- {
- $this->loader->load('fooooooo.json');
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\InvalidArgumentException
- * @expectedExceptionMessage Unknown file extension
- */
- public function testMustBeSupportedExtension()
- {
- $this->loader->load(dirname(__DIR__) . '/TestData/FileBody.txt');
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\RuntimeException
- * @expectedExceptionMessage Error loading JSON data from
- */
- public function testJsonMustBeValue()
- {
- $filename = tempnam(sys_get_temp_dir(), 'json') . '.json';
- file_put_contents($filename, '{/{./{}foo');
- $this->cleanup[] = $filename;
- $this->loader->load($filename);
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\InvalidArgumentException
- * @expectedExceptionMessage PHP files must return an array
- */
- public function testPhpFilesMustReturnAnArray()
- {
- $filename = tempnam(sys_get_temp_dir(), 'php') . '.php';
- file_put_contents($filename, 'cleanup[] = $filename;
- $this->loader->load($filename);
- }
-
- public function testLoadsPhpFileIncludes()
- {
- $filename = tempnam(sys_get_temp_dir(), 'php') . '.php';
- file_put_contents($filename, ' "bar");');
- $this->cleanup[] = $filename;
- $this->loader->expects($this->exactly(1))->method('build')->will($this->returnArgument(0));
- $config = $this->loader->load($filename);
- $this->assertEquals(array('foo' => 'bar'), $config);
- }
-
- public function testCanCreateFromJson()
- {
- $file = dirname(__DIR__) . '/TestData/services/json1.json';
- // The build method will just return the config data
- $this->loader->expects($this->exactly(1))->method('build')->will($this->returnArgument(0));
- $data = $this->loader->load($file);
- // Ensure that the config files were merged using the includes directives
- $this->assertArrayHasKey('includes', $data);
- $this->assertArrayHasKey('services', $data);
- $this->assertInternalType('array', $data['services']['foo']);
- $this->assertInternalType('array', $data['services']['abstract']);
- $this->assertInternalType('array', $data['services']['mock']);
- $this->assertEquals('bar', $data['services']['foo']['params']['baz']);
- }
-
- public function testUsesAliases()
- {
- $file = dirname(__DIR__) . '/TestData/services/json1.json';
- $this->loader->addAlias('foo', $file);
- // The build method will just return the config data
- $this->loader->expects($this->exactly(1))->method('build')->will($this->returnArgument(0));
- $data = $this->loader->load('foo');
- $this->assertEquals('bar', $data['services']['foo']['params']['baz']);
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\InvalidArgumentException
- * @expectedExceptionMessage Unable to open foo.json
- */
- public function testCanRemoveAliases()
- {
- $file = dirname(__DIR__) . '/TestData/services/json1.json';
- $this->loader->addAlias('foo.json', $file);
- $this->loader->removeAlias('foo.json');
- $this->loader->load('foo.json');
- }
-
- public function testCanLoadArraysWithIncludes()
- {
- $file = dirname(__DIR__) . '/TestData/services/json1.json';
- $config = array('includes' => array($file));
- // The build method will just return the config data
- $this->loader->expects($this->exactly(1))->method('build')->will($this->returnArgument(0));
- $data = $this->loader->load($config);
- $this->assertEquals('bar', $data['services']['foo']['params']['baz']);
- }
-
- public function testDoesNotEnterInfiniteLoop()
- {
- $prefix = $file = dirname(__DIR__) . '/TestData/description';
- $this->loader->load("{$prefix}/baz.json");
- $this->assertCount(4, $this->readAttribute($this->loader, 'loadedFiles'));
- // Ensure that the internal list of loaded files is reset
- $this->loader->load("{$prefix}/../test_service2.json");
- $this->assertCount(1, $this->readAttribute($this->loader, 'loadedFiles'));
- // Ensure that previously loaded files will be reloaded when starting fresh
- $this->loader->load("{$prefix}/baz.json");
- $this->assertCount(4, $this->readAttribute($this->loader, 'loadedFiles'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Builder/ServiceBuilderLoaderTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Builder/ServiceBuilderLoaderTest.php
deleted file mode 100644
index f63070e..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Builder/ServiceBuilderLoaderTest.php
+++ /dev/null
@@ -1,177 +0,0 @@
- array(
- 'abstract' => array(
- 'params' => array(
- 'access_key' => 'xyz',
- 'secret' => 'abc',
- ),
- ),
- 'foo' => array(
- 'extends' => 'abstract',
- 'params' => array(
- 'baz' => 'bar',
- ),
- ),
- 'mock' => array(
- 'extends' => 'abstract',
- 'params' => array(
- 'username' => 'foo',
- 'password' => 'baz',
- 'subdomain' => 'bar',
- )
- )
- )
- );
-
- $builder = $arrayFactory->load($data);
-
- // Ensure that services were parsed
- $this->assertTrue(isset($builder['mock']));
- $this->assertTrue(isset($builder['abstract']));
- $this->assertTrue(isset($builder['foo']));
- $this->assertFalse(isset($builder['jimmy']));
- }
-
- /**
- * @expectedException Guzzle\Service\Exception\ServiceNotFoundException
- * @expectedExceptionMessage foo is trying to extend a non-existent service: abstract
- */
- public function testThrowsExceptionWhenExtendingNonExistentService()
- {
- $arrayFactory = new ServiceBuilderLoader();
-
- $data = array(
- 'services' => array(
- 'foo' => array(
- 'extends' => 'abstract'
- )
- )
- );
-
- $builder = $arrayFactory->load($data);
- }
-
- public function testAllowsGlobalParameterOverrides()
- {
- $arrayFactory = new ServiceBuilderLoader();
-
- $data = array(
- 'services' => array(
- 'foo' => array(
- 'params' => array(
- 'foo' => 'baz',
- 'bar' => 'boo'
- )
- )
- )
- );
-
- $builder = $arrayFactory->load($data, array(
- 'bar' => 'jar',
- 'far' => 'car'
- ));
-
- $compiled = json_decode($builder->serialize(), true);
- $this->assertEquals(array(
- 'foo' => 'baz',
- 'bar' => 'jar',
- 'far' => 'car'
- ), $compiled['foo']['params']);
- }
-
- public function tstDoesNotErrorOnCircularReferences()
- {
- $arrayFactory = new ServiceBuilderLoader();
- $arrayFactory->load(array(
- 'services' => array(
- 'too' => array('extends' => 'ball'),
- 'ball' => array('extends' => 'too'),
- )
- ));
- }
-
- public function configProvider()
- {
- $foo = array(
- 'extends' => 'bar',
- 'class' => 'stdClass',
- 'params' => array('a' => 'test', 'b' => '456')
- );
-
- return array(
- array(
- // Does not extend the existing `foo` service but overwrites it
- array(
- 'services' => array(
- 'foo' => $foo,
- 'bar' => array('params' => array('baz' => '123'))
- )
- ),
- array(
- 'services' => array(
- 'foo' => array('class' => 'Baz')
- )
- ),
- array(
- 'services' => array(
- 'foo' => array('class' => 'Baz'),
- 'bar' => array('params' => array('baz' => '123'))
- )
- )
- ),
- array(
- // Extends the existing `foo` service
- array(
- 'services' => array(
- 'foo' => $foo,
- 'bar' => array('params' => array('baz' => '123'))
- )
- ),
- array(
- 'services' => array(
- 'foo' => array(
- 'extends' => 'foo',
- 'params' => array('b' => '123', 'c' => 'def')
- )
- )
- ),
- array(
- 'services' => array(
- 'foo' => array(
- 'extends' => 'bar',
- 'class' => 'stdClass',
- 'params' => array('a' => 'test', 'b' => '123', 'c' => 'def')
- ),
- 'bar' => array('params' => array('baz' => '123'))
- )
- )
- )
- );
- }
-
- /**
- * @dataProvider configProvider
- */
- public function testCombinesConfigs($a, $b, $c)
- {
- $l = new ServiceBuilderLoader();
- $m = new \ReflectionMethod($l, 'mergeData');
- $m->setAccessible(true);
- $this->assertEquals($c, $m->invoke($l, $a, $b));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Builder/ServiceBuilderTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Builder/ServiceBuilderTest.php
deleted file mode 100644
index e1b3a1d..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Builder/ServiceBuilderTest.php
+++ /dev/null
@@ -1,317 +0,0 @@
- array(
- 'class' => 'Guzzle\Tests\Service\Mock\MockClient',
- 'params' => array(
- 'username' => 'michael',
- 'password' => 'testing123',
- 'subdomain' => 'michael',
- ),
- ),
- 'billy.mock' => array(
- 'alias' => 'Hello!',
- 'class' => 'Guzzle\Tests\Service\Mock\MockClient',
- 'params' => array(
- 'username' => 'billy',
- 'password' => 'passw0rd',
- 'subdomain' => 'billy',
- ),
- ),
- 'billy.testing' => array(
- 'extends' => 'billy.mock',
- 'params' => array(
- 'subdomain' => 'test.billy',
- ),
- ),
- 'missing_params' => array(
- 'extends' => 'billy.mock'
- )
- );
-
- public function testAllowsSerialization()
- {
- $builder = ServiceBuilder::factory($this->arrayData);
- $cached = unserialize(serialize($builder));
- $this->assertEquals($cached, $builder);
- }
-
- public function testDelegatesFactoryMethodToAbstractFactory()
- {
- $builder = ServiceBuilder::factory($this->arrayData);
- $c = $builder->get('michael.mock');
- $this->assertInstanceOf('Guzzle\Tests\Service\Mock\MockClient', $c);
- }
-
- /**
- * @expectedException Guzzle\Service\Exception\ServiceNotFoundException
- * @expectedExceptionMessage No service is registered as foobar
- */
- public function testThrowsExceptionWhenGettingInvalidClient()
- {
- ServiceBuilder::factory($this->arrayData)->get('foobar');
- }
-
- public function testStoresClientCopy()
- {
- $builder = ServiceBuilder::factory($this->arrayData);
- $client = $builder->get('michael.mock');
- $this->assertInstanceOf('Guzzle\Tests\Service\Mock\MockClient', $client);
- $this->assertEquals('http://127.0.0.1:8124/v1/michael', $client->getBaseUrl());
- $this->assertEquals($client, $builder->get('michael.mock'));
-
- // Get another client but throw this one away
- $client2 = $builder->get('billy.mock', true);
- $this->assertInstanceOf('Guzzle\Tests\Service\Mock\MockClient', $client2);
- $this->assertEquals('http://127.0.0.1:8124/v1/billy', $client2->getBaseUrl());
-
- // Make sure the original client is still there and set
- $this->assertTrue($client === $builder->get('michael.mock'));
-
- // Create a new billy.mock client that is stored
- $client3 = $builder->get('billy.mock');
-
- // Make sure that the stored billy.mock client is equal to the other stored client
- $this->assertTrue($client3 === $builder->get('billy.mock'));
-
- // Make sure that this client is not equal to the previous throwaway client
- $this->assertFalse($client2 === $builder->get('billy.mock'));
- }
-
- public function testBuildersPassOptionsThroughToClients()
- {
- $s = new ServiceBuilder(array(
- 'michael.mock' => array(
- 'class' => 'Guzzle\Tests\Service\Mock\MockClient',
- 'params' => array(
- 'base_url' => 'http://www.test.com/',
- 'subdomain' => 'michael',
- 'password' => 'test',
- 'username' => 'michael',
- 'curl.curlopt_proxyport' => 8080
- )
- )
- ));
-
- $c = $s->get('michael.mock');
- $this->assertEquals(8080, $c->getConfig('curl.curlopt_proxyport'));
- }
-
- public function testUsesTheDefaultBuilderWhenNoBuilderIsSpecified()
- {
- $s = new ServiceBuilder(array(
- 'michael.mock' => array(
- 'class' => 'Guzzle\Tests\Service\Mock\MockClient',
- 'params' => array(
- 'base_url' => 'http://www.test.com/',
- 'subdomain' => 'michael',
- 'password' => 'test',
- 'username' => 'michael',
- 'curl.curlopt_proxyport' => 8080
- )
- )
- ));
-
- $c = $s->get('michael.mock');
- $this->assertInstanceOf('Guzzle\Tests\Service\Mock\MockClient', $c);
- }
-
- public function testUsedAsArray()
- {
- $b = ServiceBuilder::factory($this->arrayData);
- $this->assertTrue($b->offsetExists('michael.mock'));
- $this->assertFalse($b->offsetExists('not_there'));
- $this->assertInstanceOf('Guzzle\Service\Client', $b['michael.mock']);
-
- unset($b['michael.mock']);
- $this->assertFalse($b->offsetExists('michael.mock'));
-
- $b['michael.mock'] = new Client('http://www.test.com/');
- $this->assertInstanceOf('Guzzle\Service\Client', $b['michael.mock']);
- }
-
- public function testFactoryCanCreateFromJson()
- {
- $tmp = sys_get_temp_dir() . '/test.js';
- file_put_contents($tmp, json_encode($this->arrayData));
- $b = ServiceBuilder::factory($tmp);
- unlink($tmp);
- $s = $b->get('billy.testing');
- $this->assertEquals('test.billy', $s->getConfig('subdomain'));
- $this->assertEquals('billy', $s->getConfig('username'));
- }
-
- public function testFactoryCanCreateFromArray()
- {
- $b = ServiceBuilder::factory($this->arrayData);
- $s = $b->get('billy.testing');
- $this->assertEquals('test.billy', $s->getConfig('subdomain'));
- $this->assertEquals('billy', $s->getConfig('username'));
- }
-
- public function testFactoryDoesNotRequireParams()
- {
- $b = ServiceBuilder::factory($this->arrayData);
- $s = $b->get('missing_params');
- $this->assertEquals('billy', $s->getConfig('username'));
- }
-
- public function testBuilderAllowsReferencesBetweenClients()
- {
- $builder = ServiceBuilder::factory(array(
- 'a' => array(
- 'class' => 'Guzzle\Tests\Service\Mock\MockClient',
- 'params' => array(
- 'other_client' => '{b}',
- 'username' => 'x',
- 'password' => 'y',
- 'subdomain' => 'z'
- )
- ),
- 'b' => array(
- 'class' => 'Guzzle\Tests\Service\Mock\MockClient',
- 'params' => array(
- 'username' => '1',
- 'password' => '2',
- 'subdomain' => '3'
- )
- )
- ));
-
- $client = $builder['a'];
- $this->assertEquals('x', $client->getConfig('username'));
- $this->assertSame($builder['b'], $client->getConfig('other_client'));
- $this->assertEquals('1', $builder['b']->getConfig('username'));
- }
-
- public function testEmitsEventsWhenClientsAreCreated()
- {
- // Ensure that the client signals that it emits an event
- $this->assertEquals(array('service_builder.create_client'), ServiceBuilder::getAllEvents());
-
- // Create a test service builder
- $builder = ServiceBuilder::factory(array(
- 'a' => array(
- 'class' => 'Guzzle\Tests\Service\Mock\MockClient',
- 'params' => array(
- 'username' => 'test',
- 'password' => '123',
- 'subdomain' => 'z'
- )
- )
- ));
-
- // Add an event listener to pick up client creation events
- $emits = 0;
- $builder->getEventDispatcher()->addListener('service_builder.create_client', function($event) use (&$emits) {
- $emits++;
- });
-
- // Get the 'a' client by name
- $client = $builder->get('a');
-
- // Ensure that the event was emitted once, and that the client was present
- $this->assertEquals(1, $emits);
- $this->assertInstanceOf('Guzzle\Tests\Service\Mock\MockClient', $client);
- }
-
- public function testCanAddGlobalParametersToServicesOnLoad()
- {
- $builder = ServiceBuilder::factory($this->arrayData, array(
- 'username' => 'fred',
- 'new_value' => 'test'
- ));
-
- $data = json_decode($builder->serialize(), true);
-
- foreach ($data as $service) {
- $this->assertEquals('fred', $service['params']['username']);
- $this->assertEquals('test', $service['params']['new_value']);
- }
- }
-
- public function testAddsGlobalPlugins()
- {
- $b = new ServiceBuilder($this->arrayData);
- $b->addGlobalPlugin(new HistoryPlugin());
- $s = $b->get('michael.mock');
- $this->assertTrue($s->getEventDispatcher()->hasListeners('request.sent'));
- }
-
- public function testCanGetData()
- {
- $b = new ServiceBuilder($this->arrayData);
- $this->assertEquals($this->arrayData['michael.mock'], $b->getData('michael.mock'));
- $this->assertNull($b->getData('ewofweoweofe'));
- }
-
- public function testCanGetByAlias()
- {
- $b = new ServiceBuilder($this->arrayData);
- $this->assertSame($b->get('billy.mock'), $b->get('Hello!'));
- }
-
- public function testCanOverwriteParametersForThrowawayClients()
- {
- $b = new ServiceBuilder($this->arrayData);
-
- $c1 = $b->get('michael.mock');
- $this->assertEquals('michael', $c1->getConfig('username'));
-
- $c2 = $b->get('michael.mock', array('username' => 'jeremy'));
- $this->assertEquals('jeremy', $c2->getConfig('username'));
- }
-
- public function testGettingAThrowawayClientWithParametersDoesNotAffectGettingOtherClients()
- {
- $b = new ServiceBuilder($this->arrayData);
-
- $c1 = $b->get('michael.mock', array('username' => 'jeremy'));
- $this->assertEquals('jeremy', $c1->getConfig('username'));
-
- $c2 = $b->get('michael.mock');
- $this->assertEquals('michael', $c2->getConfig('username'));
- }
-
- public function testCanUseArbitraryData()
- {
- $b = new ServiceBuilder();
- $b['a'] = 'foo';
- $this->assertTrue(isset($b['a']));
- $this->assertEquals('foo', $b['a']);
- unset($b['a']);
- $this->assertFalse(isset($b['a']));
- }
-
- public function testCanRegisterServiceData()
- {
- $b = new ServiceBuilder();
- $b['a'] = array(
- 'class' => 'Guzzle\Tests\Service\Mock\MockClient',
- 'params' => array(
- 'username' => 'billy',
- 'password' => 'passw0rd',
- 'subdomain' => 'billy',
- )
- );
- $this->assertTrue(isset($b['a']));
- $this->assertInstanceOf('Guzzle\Tests\Service\Mock\MockClient', $b['a']);
- $client = $b['a'];
- unset($b['a']);
- $this->assertFalse(isset($b['a']));
- // Ensure that instantiated clients can be registered
- $b['mock'] = $client;
- $this->assertSame($client, $b['mock']);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/CachingConfigLoaderTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/CachingConfigLoaderTest.php
deleted file mode 100644
index b8245ad..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/CachingConfigLoaderTest.php
+++ /dev/null
@@ -1,43 +0,0 @@
-getMockBuilder('Guzzle\Service\ConfigLoaderInterface')
- ->setMethods(array('load'))
- ->getMockForAbstractClass();
- $data = array('foo' => 'bar');
- $loader->expects($this->once())
- ->method('load')
- ->will($this->returnValue($data));
- $cache = new CachingConfigLoader($loader, $cache);
- $this->assertEquals($data, $cache->load('foo'));
- $this->assertEquals($data, $cache->load('foo'));
- }
-
- public function testDoesNotCacheArrays()
- {
- $cache = new DoctrineCacheAdapter(new ArrayCache());
- $loader = $this->getMockBuilder('Guzzle\Service\ConfigLoaderInterface')
- ->setMethods(array('load'))
- ->getMockForAbstractClass();
- $data = array('foo' => 'bar');
- $loader->expects($this->exactly(2))
- ->method('load')
- ->will($this->returnValue($data));
- $cache = new CachingConfigLoader($loader, $cache);
- $this->assertEquals($data, $cache->load(array()));
- $this->assertEquals($data, $cache->load(array()));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/ClientTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/ClientTest.php
deleted file mode 100644
index aee29ed..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/ClientTest.php
+++ /dev/null
@@ -1,320 +0,0 @@
-serviceTest = new ServiceDescription(array(
- 'test_command' => new Operation(array(
- 'doc' => 'documentationForCommand',
- 'method' => 'DELETE',
- 'class' => 'Guzzle\\Tests\\Service\\Mock\\Command\\MockCommand',
- 'args' => array(
- 'bucket' => array(
- 'required' => true
- ),
- 'key' => array(
- 'required' => true
- )
- )
- ))
- ));
-
- $this->service = ServiceDescription::factory(__DIR__ . '/../TestData/test_service.json');
- }
-
- public function testAllowsCustomClientParameters()
- {
- $client = new Mock\MockClient(null, array(
- Client::COMMAND_PARAMS => array(AbstractCommand::RESPONSE_PROCESSING => 'foo')
- ));
- $command = $client->getCommand('mock_command');
- $this->assertEquals('foo', $command->get(AbstractCommand::RESPONSE_PROCESSING));
- }
-
- public function testFactoryCreatesClient()
- {
- $client = Client::factory(array(
- 'base_url' => 'http://www.test.com/',
- 'test' => '123'
- ));
-
- $this->assertEquals('http://www.test.com/', $client->getBaseUrl());
- $this->assertEquals('123', $client->getConfig('test'));
- }
-
- public function testFactoryDoesNotRequireBaseUrl()
- {
- $client = Client::factory();
- }
-
- public function testDescribesEvents()
- {
- $this->assertInternalType('array', Client::getAllEvents());
- }
-
- public function testExecutesCommands()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
-
- $client = new Client($this->getServer()->getUrl());
- $cmd = new MockCommand();
- $client->execute($cmd);
-
- $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $cmd->getResponse());
- $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $cmd->getResult());
- $this->assertEquals(1, count($this->getServer()->getReceivedRequests(false)));
- }
-
- public function testExecutesCommandsWithArray()
- {
- $client = new Client('http://www.test.com/');
- $client->getEventDispatcher()->addSubscriber(new MockPlugin(array(
- new Response(200),
- new Response(200)
- )));
-
- // Create a command set and a command
- $set = array(new MockCommand(), new MockCommand());
- $client->execute($set);
-
- // Make sure it sent
- $this->assertTrue($set[0]->isExecuted());
- $this->assertTrue($set[1]->isExecuted());
- }
-
- /**
- * @expectedException Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testThrowsExceptionWhenInvalidCommandIsExecuted()
- {
- $client = new Client();
- $client->execute(new \stdClass());
- }
-
- /**
- * @expectedException InvalidArgumentException
- */
- public function testThrowsExceptionWhenMissingCommand()
- {
- $client = new Client();
-
- $mock = $this->getMock('Guzzle\\Service\\Command\\Factory\\FactoryInterface');
- $mock->expects($this->any())
- ->method('factory')
- ->with($this->equalTo('test'))
- ->will($this->returnValue(null));
-
- $client->setCommandFactory($mock);
- $client->getCommand('test');
- }
-
- public function testCreatesCommandsUsingCommandFactory()
- {
- $mockCommand = new MockCommand();
-
- $client = new Mock\MockClient();
- $mock = $this->getMock('Guzzle\\Service\\Command\\Factory\\FactoryInterface');
- $mock->expects($this->any())
- ->method('factory')
- ->with($this->equalTo('foo'))
- ->will($this->returnValue($mockCommand));
-
- $client->setCommandFactory($mock);
-
- $command = $client->getCommand('foo', array('acl' => '123'));
- $this->assertSame($mockCommand, $command);
- $command = $client->getCommand('foo', array('acl' => '123'));
- $this->assertSame($mockCommand, $command);
- $this->assertSame($client, $command->getClient());
- }
-
- public function testOwnsServiceDescription()
- {
- $client = new Mock\MockClient();
- $this->assertNull($client->getDescription());
-
- $description = $this->getMock('Guzzle\\Service\\Description\\ServiceDescription');
- $this->assertSame($client, $client->setDescription($description));
- $this->assertSame($description, $client->getDescription());
- }
-
- public function testOwnsResourceIteratorFactory()
- {
- $client = new Mock\MockClient();
-
- $method = new \ReflectionMethod($client, 'getResourceIteratorFactory');
- $method->setAccessible(TRUE);
- $rf1 = $method->invoke($client);
-
- $rf = $this->readAttribute($client, 'resourceIteratorFactory');
- $this->assertInstanceOf('Guzzle\\Service\\Resource\\ResourceIteratorClassFactory', $rf);
- $this->assertSame($rf1, $rf);
-
- $rf = new ResourceIteratorClassFactory('Guzzle\Tests\Service\Mock');
- $client->setResourceIteratorFactory($rf);
- $this->assertNotSame($rf1, $rf);
- }
-
- public function testClientResetsRequestsBeforeExecutingCommands()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nHi",
- "HTTP/1.1 200 OK\r\nContent-Length: 1\r\n\r\nI"
- ));
-
- $client = new Mock\MockClient($this->getServer()->getUrl());
-
- $command = $client->getCommand('mock_command');
- $client->execute($command);
- $client->execute($command);
- $this->assertEquals('I', $command->getResponse()->getBody(true));
- }
-
- public function testClientCreatesIterators()
- {
- $client = new Mock\MockClient();
-
- $iterator = $client->getIterator('mock_command', array(
- 'foo' => 'bar'
- ), array(
- 'limit' => 10
- ));
-
- $this->assertInstanceOf('Guzzle\Tests\Service\Mock\Model\MockCommandIterator', $iterator);
- $this->assertEquals(10, $this->readAttribute($iterator, 'limit'));
-
- $command = $this->readAttribute($iterator, 'originalCommand');
- $this->assertEquals('bar', $command->get('foo'));
- }
-
- public function testClientCreatesIteratorsWithNoOptions()
- {
- $client = new Mock\MockClient();
- $iterator = $client->getIterator('mock_command');
- $this->assertInstanceOf('Guzzle\Tests\Service\Mock\Model\MockCommandIterator', $iterator);
- }
-
- public function testClientCreatesIteratorsWithCommands()
- {
- $client = new Mock\MockClient();
- $command = new MockCommand();
- $iterator = $client->getIterator($command);
- $this->assertInstanceOf('Guzzle\Tests\Service\Mock\Model\MockCommandIterator', $iterator);
- $iteratorCommand = $this->readAttribute($iterator, 'originalCommand');
- $this->assertSame($command, $iteratorCommand);
- }
-
- public function testClientHoldsInflector()
- {
- $client = new Mock\MockClient();
- $this->assertInstanceOf('Guzzle\Inflection\MemoizingInflector', $client->getInflector());
-
- $inflector = new Inflector();
- $client->setInflector($inflector);
- $this->assertSame($inflector, $client->getInflector());
- }
-
- public function testClientAddsGlobalCommandOptions()
- {
- $client = new Mock\MockClient('http://www.foo.com', array(
- Client::COMMAND_PARAMS => array(
- 'mesa' => 'bar'
- )
- ));
- $command = $client->getCommand('mock_command');
- $this->assertEquals('bar', $command->get('mesa'));
- }
-
- public function testSupportsServiceDescriptionBaseUrls()
- {
- $description = new ServiceDescription(array('baseUrl' => 'http://foo.com'));
- $client = new Client();
- $client->setDescription($description);
- $this->assertEquals('http://foo.com', $client->getBaseUrl());
- }
-
- public function testMergesDefaultCommandParamsCorrectly()
- {
- $client = new Mock\MockClient('http://www.foo.com', array(
- Client::COMMAND_PARAMS => array(
- 'mesa' => 'bar',
- 'jar' => 'jar'
- )
- ));
- $command = $client->getCommand('mock_command', array('jar' => 'test'));
- $this->assertEquals('bar', $command->get('mesa'));
- $this->assertEquals('test', $command->get('jar'));
- }
-
- /**
- * @expectedException \Guzzle\Http\Exception\BadResponseException
- */
- public function testWrapsSingleCommandExceptions()
- {
- $client = new Mock\MockClient('http://foobaz.com');
- $mock = new MockPlugin(array(new Response(401)));
- $client->addSubscriber($mock);
- $client->execute(new MockCommand());
- }
-
- public function testWrapsMultipleCommandExceptions()
- {
- $client = new Mock\MockClient('http://foobaz.com');
- $mock = new MockPlugin(array(new Response(200), new Response(200), new Response(404), new Response(500)));
- $client->addSubscriber($mock);
-
- $cmds = array(new MockCommand(), new MockCommand(), new MockCommand(), new MockCommand());
- try {
- $client->execute($cmds);
- } catch (CommandTransferException $e) {
- $this->assertEquals(2, count($e->getFailedRequests()));
- $this->assertEquals(2, count($e->getSuccessfulRequests()));
- $this->assertEquals(2, count($e->getFailedCommands()));
- $this->assertEquals(2, count($e->getSuccessfulCommands()));
-
- foreach ($e->getSuccessfulCommands() as $c) {
- $this->assertTrue($c->getResponse()->isSuccessful());
- }
-
- foreach ($e->getFailedCommands() as $c) {
- $this->assertFalse($c->getRequest()->getResponse()->isSuccessful());
- }
- }
- }
-
- public function testGetCommandAfterTwoSetDescriptions()
- {
- $service1 = ServiceDescription::factory(__DIR__ . '/../TestData/test_service.json');
- $service2 = ServiceDescription::factory(__DIR__ . '/../TestData/test_service_3.json');
-
- $client = new Mock\MockClient();
-
- $client->setDescription($service1);
- $client->getCommand('foo_bar');
- $client->setDescription($service2);
- $client->getCommand('baz_qux');
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/AbstractCommandTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/AbstractCommandTest.php
deleted file mode 100644
index 1004fae..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/AbstractCommandTest.php
+++ /dev/null
@@ -1,16 +0,0 @@
-setDescription(ServiceDescription::factory(__DIR__ . '/../../TestData/test_service.json'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/ClosureCommandTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/ClosureCommandTest.php
deleted file mode 100644
index d762246..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/ClosureCommandTest.php
+++ /dev/null
@@ -1,54 +0,0 @@
- function($command, $api) {
- $command->set('testing', '123');
- $request = RequestFactory::getInstance()->create('GET', 'http://www.test.com/');
- return $request;
- }
- ));
-
- $client = $this->getServiceBuilder()->get('mock');
- $c->setClient($client)->prepare();
- $this->assertEquals('123', $c->get('testing'));
- $this->assertEquals('http://www.test.com/', $c->getRequest()->getUrl());
- }
-
- /**
- * @expectedException UnexpectedValueException
- * @expectedExceptionMessage Closure command did not return a RequestInterface object
- */
- public function testMustReturnRequest()
- {
- $c = new ClosureCommand(array(
- 'closure' => function($command, $api) {
- return false;
- }
- ));
-
- $client = $this->getServiceBuilder()->get('mock');
- $c->setClient($client)->prepare();
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/CommandTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/CommandTest.php
deleted file mode 100644
index b7173d4..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/CommandTest.php
+++ /dev/null
@@ -1,445 +0,0 @@
-assertEquals('123', $command->get('test'));
- $this->assertFalse($command->isPrepared());
- $this->assertFalse($command->isExecuted());
- }
-
- public function testDeterminesShortName()
- {
- $api = new Operation(array('name' => 'foobar'));
- $command = new MockCommand(array(), $api);
- $this->assertEquals('foobar', $command->getName());
-
- $command = new MockCommand();
- $this->assertEquals('mock_command', $command->getName());
-
- $command = new Sub();
- $this->assertEquals('sub.sub', $command->getName());
- }
-
- /**
- * @expectedException RuntimeException
- */
- public function testGetRequestThrowsExceptionBeforePreparation()
- {
- $command = new MockCommand();
- $command->getRequest();
- }
-
- public function testGetResponseExecutesCommandsWhenNeeded()
- {
- $response = new Response(200);
- $client = $this->getClient();
- $this->setMockResponse($client, array($response));
- $command = new MockCommand();
- $command->setClient($client);
- $this->assertSame($response, $command->getResponse());
- $this->assertSame($response, $command->getResponse());
- }
-
- public function testGetResultExecutesCommandsWhenNeeded()
- {
- $response = new Response(200);
- $client = $this->getClient();
- $this->setMockResponse($client, array($response));
- $command = new MockCommand();
- $command->setClient($client);
- $this->assertSame($response, $command->getResult());
- $this->assertSame($response, $command->getResult());
- }
-
- public function testSetClient()
- {
- $command = new MockCommand();
- $client = $this->getClient();
-
- $command->setClient($client);
- $this->assertEquals($client, $command->getClient());
-
- unset($client);
- unset($command);
-
- $command = new MockCommand();
- $client = $this->getClient();
-
- $command->setClient($client)->prepare();
- $this->assertEquals($client, $command->getClient());
- $this->assertTrue($command->isPrepared());
- }
-
- public function testExecute()
- {
- $client = $this->getClient();
- $response = new Response(200, array(
- 'Content-Type' => 'application/xml'
- ), '123 ');
- $this->setMockResponse($client, array($response));
- $command = new MockCommand();
- $this->assertSame($command, $command->setClient($client));
-
- // Returns the result of the command
- $this->assertInstanceOf('SimpleXMLElement', $command->execute());
-
- $this->assertTrue($command->isPrepared());
- $this->assertTrue($command->isExecuted());
- $this->assertSame($response, $command->getResponse());
- $this->assertInstanceOf('Guzzle\\Http\\Message\\Request', $command->getRequest());
- // Make sure that the result was automatically set to a SimpleXMLElement
- $this->assertInstanceOf('SimpleXMLElement', $command->getResult());
- $this->assertEquals('123', (string) $command->getResult()->data);
- }
-
- public function testConvertsJsonResponsesToArray()
- {
- $client = $this->getClient();
- $this->setMockResponse($client, array(
- new \Guzzle\Http\Message\Response(200, array(
- 'Content-Type' => 'application/json'
- ), '{ "key": "Hi!" }'
- )
- ));
- $command = new MockCommand();
- $command->setClient($client);
- $command->execute();
- $this->assertEquals(array(
- 'key' => 'Hi!'
- ), $command->getResult());
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\RuntimeException
- */
- public function testConvertsInvalidJsonResponsesToArray()
- {
- $json = '{ "key": "Hi!" }invalid';
- // Some implementations of php-json extension are not strict enough
- // and allow to parse invalid json ignoring invalid parts
- // See https://github.com/remicollet/pecl-json-c/issues/5
- if (json_decode($json) && JSON_ERROR_NONE === json_last_error()) {
- $this->markTestSkipped('php-pecl-json library regression issues');
- }
-
- $client = $this->getClient();
- $this->setMockResponse($client, array(
- new \Guzzle\Http\Message\Response(200, array(
- 'Content-Type' => 'application/json'
- ), $json
- )
- ));
- $command = new MockCommand();
- $command->setClient($client);
- $command->execute();
- }
-
- public function testProcessResponseIsNotXml()
- {
- $client = $this->getClient();
- $this->setMockResponse($client, array(
- new Response(200, array(
- 'Content-Type' => 'application/octet-stream'
- ), 'abc,def,ghi')
- ));
- $command = new MockCommand();
- $client->execute($command);
-
- // Make sure that the result was not converted to XML
- $this->assertFalse($command->getResult() instanceof \SimpleXMLElement);
- }
-
- /**
- * @expectedException RuntimeException
- */
- public function testExecuteThrowsExceptionWhenNoClientIsSet()
- {
- $command = new MockCommand();
- $command->execute();
- }
-
- /**
- * @expectedException RuntimeException
- */
- public function testPrepareThrowsExceptionWhenNoClientIsSet()
- {
- $command = new MockCommand();
- $command->prepare();
- }
-
- public function testCommandsAllowsCustomRequestHeaders()
- {
- $command = new MockCommand();
- $command->getRequestHeaders()->set('test', '123');
- $this->assertInstanceOf('Guzzle\Common\Collection', $command->getRequestHeaders());
- $this->assertEquals('123', $command->getRequestHeaders()->get('test'));
-
- $command->setClient($this->getClient())->prepare();
- $this->assertEquals('123', (string) $command->getRequest()->getHeader('test'));
- }
-
- public function testCommandsAllowsCustomRequestHeadersAsArray()
- {
- $command = new MockCommand(array(AbstractCommand::HEADERS_OPTION => array('Foo' => 'Bar')));
- $this->assertInstanceOf('Guzzle\Common\Collection', $command->getRequestHeaders());
- $this->assertEquals('Bar', $command->getRequestHeaders()->get('Foo'));
- }
-
- private function getOperation()
- {
- return new Operation(array(
- 'name' => 'foobar',
- 'httpMethod' => 'POST',
- 'class' => 'Guzzle\\Tests\\Service\\Mock\\Command\\MockCommand',
- 'parameters' => array(
- 'test' => array(
- 'default' => '123',
- 'type' => 'string'
- )
- )));
- }
-
- public function testCommandsUsesOperation()
- {
- $api = $this->getOperation();
- $command = new MockCommand(array(), $api);
- $this->assertSame($api, $command->getOperation());
- $command->setClient($this->getClient())->prepare();
- $this->assertEquals('123', $command->get('test'));
- $this->assertSame($api, $command->getOperation($api));
- }
-
- public function testCloneMakesNewRequest()
- {
- $client = $this->getClient();
- $command = new MockCommand(array(), $this->getOperation());
- $command->setClient($client);
-
- $command->prepare();
- $this->assertTrue($command->isPrepared());
-
- $command2 = clone $command;
- $this->assertFalse($command2->isPrepared());
- }
-
- public function testHasOnCompleteMethod()
- {
- $that = $this;
- $called = 0;
-
- $testFunction = function($command) use (&$called, $that) {
- $called++;
- $that->assertInstanceOf('Guzzle\Service\Command\CommandInterface', $command);
- };
-
- $client = $this->getClient();
- $command = new MockCommand(array(
- 'command.on_complete' => $testFunction
- ), $this->getOperation());
- $command->setClient($client);
-
- $command->prepare()->setResponse(new Response(200), true);
- $command->execute();
- $this->assertEquals(1, $called);
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testOnCompleteMustBeCallable()
- {
- $client = $this->getClient();
- $command = new MockCommand();
- $command->setOnComplete('foo');
- }
-
- public function testCanSetResultManually()
- {
- $client = $this->getClient();
- $client->getEventDispatcher()->addSubscriber(new MockPlugin(array(
- new Response(200)
- )));
- $command = new MockCommand();
- $client->execute($command);
- $command->setResult('foo!');
- $this->assertEquals('foo!', $command->getResult());
- }
-
- public function testCanInitConfig()
- {
- $command = $this->getMockBuilder('Guzzle\\Service\\Command\\AbstractCommand')
- ->setConstructorArgs(array(array(
- 'foo' => 'bar'
- ), new Operation(array(
- 'parameters' => array(
- 'baz' => new Parameter(array(
- 'default' => 'baaar'
- ))
- )
- ))))
- ->getMockForAbstractClass();
-
- $this->assertEquals('bar', $command['foo']);
- $this->assertEquals('baaar', $command['baz']);
- }
-
- public function testAddsCurlOptionsToRequestsWhenPreparing()
- {
- $command = new MockCommand(array(
- 'foo' => 'bar',
- 'curl.options' => array('CURLOPT_PROXYPORT' => 8080)
- ));
- $client = new Client();
- $command->setClient($client);
- $request = $command->prepare();
- $this->assertEquals(8080, $request->getCurlOptions()->get(CURLOPT_PROXYPORT));
- }
-
- public function testIsInvokable()
- {
- $client = $this->getClient();
- $response = new Response(200);
- $this->setMockResponse($client, array($response));
- $command = new MockCommand();
- $command->setClient($client);
- // Returns the result of the command
- $this->assertSame($response, $command());
- }
-
- public function testCreatesDefaultOperation()
- {
- $command = $this->getMockBuilder('Guzzle\Service\Command\AbstractCommand')->getMockForAbstractClass();
- $this->assertInstanceOf('Guzzle\Service\Description\Operation', $command->getOperation());
- }
-
- public function testAllowsValidatorToBeInjected()
- {
- $command = $this->getMockBuilder('Guzzle\Service\Command\AbstractCommand')->getMockForAbstractClass();
- $v = new SchemaValidator();
- $command->setValidator($v);
- $this->assertSame($v, $this->readAttribute($command, 'validator'));
- }
-
- public function testCanDisableValidation()
- {
- $command = new MockCommand();
- $command->setClient(new \Guzzle\Service\Client());
- $v = $this->getMockBuilder('Guzzle\Service\Description\SchemaValidator')
- ->setMethods(array('validate'))
- ->getMock();
- $v->expects($this->never())->method('validate');
- $command->setValidator($v);
- $command->set(AbstractCommand::DISABLE_VALIDATION, true);
- $command->prepare();
- }
-
- public function testValidatorDoesNotUpdateNonDefaultValues()
- {
- $command = new MockCommand(array('test' => 123, 'foo' => 'bar'));
- $command->setClient(new \Guzzle\Service\Client());
- $command->prepare();
- $this->assertEquals(123, $command->get('test'));
- $this->assertEquals('bar', $command->get('foo'));
- }
-
- public function testValidatorUpdatesDefaultValues()
- {
- $command = new MockCommand();
- $command->setClient(new \Guzzle\Service\Client());
- $command->prepare();
- $this->assertEquals(123, $command->get('test'));
- $this->assertEquals('abc', $command->get('_internal'));
- }
-
- /**
- * @expectedException \Guzzle\Service\Exception\ValidationException
- * @expectedExceptionMessage [Foo] Baz
- */
- public function testValidatesCommandBeforeSending()
- {
- $command = new MockCommand();
- $command->setClient(new \Guzzle\Service\Client());
- $v = $this->getMockBuilder('Guzzle\Service\Description\SchemaValidator')
- ->setMethods(array('validate', 'getErrors'))
- ->getMock();
- $v->expects($this->any())->method('validate')->will($this->returnValue(false));
- $v->expects($this->any())->method('getErrors')->will($this->returnValue(array('[Foo] Baz', '[Bar] Boo')));
- $command->setValidator($v);
- $command->prepare();
- }
-
- /**
- * @expectedException \Guzzle\Service\Exception\ValidationException
- * @expectedExceptionMessage Validation errors: [abc] must be of type string
- */
- public function testValidatesAdditionalParameters()
- {
- $description = ServiceDescription::factory(array(
- 'operations' => array(
- 'foo' => array(
- 'parameters' => array(
- 'baz' => array('type' => 'integer')
- ),
- 'additionalParameters' => array(
- 'type' => 'string'
- )
- )
- )
- ));
-
- $client = new Client();
- $client->setDescription($description);
- $command = $client->getCommand('foo', array(
- 'abc' => false,
- 'command.headers' => array('foo' => 'bar')
- ));
- $command->prepare();
- }
-
- public function testCanAccessValidationErrorsFromCommand()
- {
- $validationErrors = array('[Foo] Baz', '[Bar] Boo');
- $command = new MockCommand();
- $command->setClient(new \Guzzle\Service\Client());
-
- $this->assertFalse($command->getValidationErrors());
-
- $v = $this->getMockBuilder('Guzzle\Service\Description\SchemaValidator')
- ->setMethods(array('validate', 'getErrors'))
- ->getMock();
- $v->expects($this->any())->method('getErrors')->will($this->returnValue($validationErrors));
- $command->setValidator($v);
-
- $this->assertEquals($validationErrors, $command->getValidationErrors());
- }
-
- public function testCanChangeResponseBody()
- {
- $body = EntityBody::factory();
- $command = new MockCommand();
- $command->setClient(new \Guzzle\Service\Client());
- $command->set(AbstractCommand::RESPONSE_BODY, $body);
- $request = $command->prepare();
- $this->assertSame($body, $this->readAttribute($request, 'responseBody'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/DefaultRequestSerializerTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/DefaultRequestSerializerTest.php
deleted file mode 100644
index b7a4682..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/DefaultRequestSerializerTest.php
+++ /dev/null
@@ -1,122 +0,0 @@
-serializer = DefaultRequestSerializer::getInstance();
- $this->client = new Client('http://foo.com/baz');
- $this->operation = new Operation(array('httpMethod' => 'POST'));
- $this->command = $this->getMockBuilder('Guzzle\Service\Command\AbstractCommand')
- ->setConstructorArgs(array(array(), $this->operation))
- ->getMockForAbstractClass();
- $this->command->setClient($this->client);
- }
-
- public function testAllowsCustomVisitor()
- {
- $this->serializer->addVisitor('custom', new HeaderVisitor());
- $this->command['test'] = '123';
- $this->operation->addParam(new Parameter(array('name' => 'test', 'location' => 'custom')));
- $request = $this->serializer->prepare($this->command);
- $this->assertEquals('123', (string) $request->getHeader('test'));
- }
-
- public function testUsesRelativePath()
- {
- $this->operation->setUri('bar');
- $request = $this->serializer->prepare($this->command);
- $this->assertEquals('http://foo.com/baz/bar', (string) $request->getUrl());
- }
-
- public function testUsesRelativePathWithUriLocations()
- {
- $this->command['test'] = '123';
- $this->operation->setUri('bar/{test}');
- $this->operation->addParam(new Parameter(array('name' => 'test', 'location' => 'uri')));
- $request = $this->serializer->prepare($this->command);
- $this->assertEquals('http://foo.com/baz/bar/123', (string) $request->getUrl());
- }
-
- public function testAllowsCustomFactory()
- {
- $f = new VisitorFlyweight();
- $serializer = new DefaultRequestSerializer($f);
- $this->assertSame($f, $this->readAttribute($serializer, 'factory'));
- }
-
- public function testMixedParams()
- {
- $this->operation->setUri('bar{?limit,fields}');
- $this->operation->addParam(new Parameter(array(
- 'name' => 'limit',
- 'location' => 'uri',
- 'required' => false,
- )));
- $this->operation->addParam(new Parameter(array(
- 'name' => 'fields',
- 'location' => 'uri',
- 'required' => true,
- )));
-
- $this->command['fields'] = array('id', 'name');
-
- $request = $this->serializer->prepare($this->command);
- $this->assertEquals('http://foo.com/baz/bar?fields='.urlencode('id,name'), (string) $request->getUrl());
- }
-
- public function testValidatesAdditionalParameters()
- {
- $description = ServiceDescription::factory(array(
- 'operations' => array(
- 'foo' => array(
- 'httpMethod' => 'PUT',
- 'parameters' => array(
- 'bar' => array('location' => 'header')
- ),
- 'additionalParameters' => array(
- 'location' => 'json'
- )
- )
- )
- ));
-
- $client = new Client();
- $client->setDescription($description);
- $command = $client->getCommand('foo');
- $command['bar'] = 'test';
- $command['hello'] = 'abc';
- $request = $command->prepare();
- $this->assertEquals('test', (string) $request->getHeader('bar'));
- $this->assertEquals('{"hello":"abc"}', (string) $request->getBody());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/DefaultResponseParserTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/DefaultResponseParserTest.php
deleted file mode 100644
index a6a02f9..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/DefaultResponseParserTest.php
+++ /dev/null
@@ -1,59 +0,0 @@
-setClient(new Client());
- $request = $op->prepare();
- $request->setResponse(new Response(200, array(
- 'Content-Type' => 'application/xml'
- ), 'Bar '), true);
- $this->assertInstanceOf('SimpleXMLElement', $op->execute());
- }
-
- public function testParsesJsonResponses()
- {
- $op = new OperationCommand(array(), new Operation());
- $op->setClient(new Client());
- $request = $op->prepare();
- $request->setResponse(new Response(200, array(
- 'Content-Type' => 'application/json'
- ), '{"Baz":"Bar"}'), true);
- $this->assertEquals(array('Baz' => 'Bar'), $op->execute());
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\RuntimeException
- */
- public function testThrowsExceptionWhenParsingJsonFails()
- {
- $op = new OperationCommand(array(), new Operation());
- $op->setClient(new Client());
- $request = $op->prepare();
- $request->setResponse(new Response(200, array('Content-Type' => 'application/json'), '{"Baz":ddw}'), true);
- $op->execute();
- }
-
- public function testAddsContentTypeWhenExpectsIsSetOnCommand()
- {
- $op = new OperationCommand(array(), new Operation());
- $op['command.expects'] = 'application/json';
- $op->setClient(new Client());
- $request = $op->prepare();
- $request->setResponse(new Response(200, null, '{"Baz":"Bar"}'), true);
- $this->assertEquals(array('Baz' => 'Bar'), $op->execute());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/AliasFactoryTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/AliasFactoryTest.php
deleted file mode 100644
index ab1041a..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/AliasFactoryTest.php
+++ /dev/null
@@ -1,76 +0,0 @@
-client = new Client();
-
- $map = new MapFactory(array(
- 'test' => 'Guzzle\Tests\Service\Mock\Command\MockCommand',
- 'test1' => 'Guzzle\Tests\Service\Mock\Command\OtherCommand'
- ));
-
- $this->factory = new AliasFactory($this->client, array(
- 'foo' => 'test',
- 'bar' => 'sub',
- 'sub' => 'test1',
- 'krull' => 'test3',
- 'krull_2' => 'krull',
- 'sub_2' => 'bar',
- 'bad_link' => 'jarjar'
- ));
-
- $map2 = new MapFactory(array(
- 'test3' => 'Guzzle\Tests\Service\Mock\Command\Sub\Sub'
- ));
-
- $this->client->setCommandFactory(new CompositeFactory(array($map, $this->factory, $map2)));
- }
-
- public function aliasProvider()
- {
- return array(
- array('foo', 'Guzzle\Tests\Service\Mock\Command\MockCommand', false),
- array('bar', 'Guzzle\Tests\Service\Mock\Command\OtherCommand', false),
- array('sub', 'Guzzle\Tests\Service\Mock\Command\OtherCommand', false),
- array('sub_2', 'Guzzle\Tests\Service\Mock\Command\OtherCommand', false),
- array('krull', 'Guzzle\Tests\Service\Mock\Command\Sub\Sub', false),
- array('krull_2', 'Guzzle\Tests\Service\Mock\Command\Sub\Sub', false),
- array('missing', null, true),
- array('bad_link', null, true)
- );
- }
-
- /**
- * @dataProvider aliasProvider
- */
- public function testAliasesCommands($key, $result, $exception)
- {
- try {
- $command = $this->client->getCommand($key);
- if (is_null($result)) {
- $this->assertNull($command);
- } else {
- $this->assertInstanceof($result, $command);
- }
- } catch (\Exception $e) {
- if (!$exception) {
- $this->fail('Got exception when it was not expected');
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/CompositeFactoryTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/CompositeFactoryTest.php
deleted file mode 100644
index b896dcf..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/CompositeFactoryTest.php
+++ /dev/null
@@ -1,124 +0,0 @@
-getMockBuilder($class)
- ->disableOriginalConstructor()
- ->getMock();
- }
-
- public function testIsIterable()
- {
- $factory = new CompositeFactory(array($this->getFactory(), $this->getFactory()));
- $this->assertEquals(2, count($factory));
- $this->assertEquals(2, count(iterator_to_array($factory->getIterator())));
- }
-
- public function testFindsFactories()
- {
- $f1 = $this->getFactory();
- $f2 = $this->getFactory('Guzzle\\Service\\Command\\Factory\\CompositeFactory');
- $factory = new CompositeFactory(array($f1, $f2));
- $this->assertNull($factory->find('foo'));
- $this->assertNull($factory->find($this->getFactory()));
- $this->assertSame($f1, $factory->find('Guzzle\\Service\\Command\\Factory\\MapFactory'));
- $this->assertSame($f2, $factory->find('Guzzle\\Service\\Command\\Factory\\CompositeFactory'));
- $this->assertSame($f1, $factory->find($f1));
- $this->assertSame($f2, $factory->find($f2));
-
- $this->assertFalse($factory->has('foo'));
- $this->assertTrue($factory->has('Guzzle\\Service\\Command\\Factory\\MapFactory'));
- $this->assertTrue($factory->has('Guzzle\\Service\\Command\\Factory\\CompositeFactory'));
- }
-
- public function testCreatesCommands()
- {
- $factory = new CompositeFactory();
- $this->assertNull($factory->factory('foo'));
-
- $f1 = $this->getFactory();
- $mockCommand1 = $this->getMockForAbstractClass('Guzzle\\Service\\Command\\AbstractCommand');
-
- $f1->expects($this->once())
- ->method('factory')
- ->with($this->equalTo('foo'))
- ->will($this->returnValue($mockCommand1));
-
- $factory = new CompositeFactory(array($f1));
- $this->assertSame($mockCommand1, $factory->factory('foo'));
- }
-
- public function testAllowsRemovalOfFactories()
- {
- $f1 = $this->getFactory();
- $f2 = $this->getFactory();
- $f3 = $this->getFactory('Guzzle\\Service\\Command\\Factory\\CompositeFactory');
- $factories = array($f1, $f2, $f3);
- $factory = new CompositeFactory($factories);
-
- $factory->remove('foo');
- $this->assertEquals($factories, $factory->getIterator()->getArrayCopy());
-
- $factory->remove($f1);
- $this->assertEquals(array($f2, $f3), $factory->getIterator()->getArrayCopy());
-
- $factory->remove('Guzzle\\Service\\Command\\Factory\\MapFactory');
- $this->assertEquals(array($f3), $factory->getIterator()->getArrayCopy());
-
- $factory->remove('Guzzle\\Service\\Command\\Factory\\CompositeFactory');
- $this->assertEquals(array(), $factory->getIterator()->getArrayCopy());
-
- $factory->remove('foo');
- $this->assertEquals(array(), $factory->getIterator()->getArrayCopy());
- }
-
- public function testAddsFactoriesBeforeAndAtEnd()
- {
- $f1 = $this->getFactory();
- $f2 = $this->getFactory();
- $f3 = $this->getFactory('Guzzle\\Service\\Command\\Factory\\CompositeFactory');
- $f4 = $this->getFactory();
-
- $factory = new CompositeFactory();
-
- $factory->add($f1);
- $this->assertEquals(array($f1), $factory->getIterator()->getArrayCopy());
-
- $factory->add($f2);
- $this->assertEquals(array($f1, $f2), $factory->getIterator()->getArrayCopy());
-
- $factory->add($f3, $f2);
- $this->assertEquals(array($f1, $f3, $f2), $factory->getIterator()->getArrayCopy());
-
- $factory->add($f4, 'Guzzle\\Service\\Command\\Factory\\CompositeFactory');
- $this->assertEquals(array($f1, $f4, $f3, $f2), $factory->getIterator()->getArrayCopy());
- }
-
- public function testProvidesDefaultChainForClients()
- {
- $client = $this->getMock('Guzzle\\Service\\Client');
- $chain = CompositeFactory::getDefaultChain($client);
- $a = $chain->getIterator()->getArrayCopy();
- $this->assertEquals(1, count($a));
- $this->assertInstanceOf('Guzzle\\Service\\Command\\Factory\\ConcreteClassFactory', $a[0]);
-
- $description = $this->getMock('Guzzle\\Service\\Description\\ServiceDescription');
- $client->expects($this->once())
- ->method('getDescription')
- ->will($this->returnValue($description));
- $chain = CompositeFactory::getDefaultChain($client);
- $a = $chain->getIterator()->getArrayCopy();
- $this->assertEquals(2, count($a));
- $this->assertInstanceOf('Guzzle\\Service\\Command\\Factory\\ServiceDescriptionFactory', $a[0]);
- $this->assertInstanceOf('Guzzle\\Service\\Command\\Factory\\ConcreteClassFactory', $a[1]);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/ConcreteClassFactoryTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/ConcreteClassFactoryTest.php
deleted file mode 100644
index 7664718..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/ConcreteClassFactoryTest.php
+++ /dev/null
@@ -1,49 +0,0 @@
- $prefix
- ));
- }
-
- $factory = new ConcreteClassFactory($client);
-
- if (is_null($result)) {
- $this->assertNull($factory->factory($key));
- } else {
- $this->assertInstanceof($result, $factory->factory($key));
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/MapFactoryTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/MapFactoryTest.php
deleted file mode 100644
index ee720d1..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/MapFactoryTest.php
+++ /dev/null
@@ -1,37 +0,0 @@
- 'Guzzle\Tests\Service\Mock\Command\MockCommand',
- 'test1' => 'Guzzle\Tests\Service\Mock\Command\OtherCommand'
- ));
-
- if (is_null($result)) {
- $this->assertNull($factory->factory($key));
- } else {
- $this->assertInstanceof($result, $factory->factory($key));
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/ServiceDescriptionFactoryTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/ServiceDescriptionFactoryTest.php
deleted file mode 100644
index 3372634..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/ServiceDescriptionFactoryTest.php
+++ /dev/null
@@ -1,68 +0,0 @@
-getDescription();
-
- $factory = new ServiceDescriptionFactory($d);
- $this->assertSame($d, $factory->getServiceDescription());
-
- if (is_null($result)) {
- $this->assertNull($factory->factory($key));
- } else {
- $this->assertInstanceof($result, $factory->factory($key));
- }
- }
-
- public function testUsesUcFirstIfNoExactMatch()
- {
- $d = $this->getDescription();
- $factory = new ServiceDescriptionFactory($d, new Inflector());
- $this->assertInstanceof('Guzzle\Tests\Service\Mock\Command\OtherCommand', $factory->factory('Test'));
- $this->assertInstanceof('Guzzle\Tests\Service\Mock\Command\OtherCommand', $factory->factory('test'));
- }
-
- public function testUsesInflectionIfNoExactMatch()
- {
- $d = $this->getDescription();
- $factory = new ServiceDescriptionFactory($d, new Inflector());
- $this->assertInstanceof('Guzzle\Tests\Service\Mock\Command\OtherCommand', $factory->factory('Binks'));
- $this->assertInstanceof('Guzzle\Tests\Service\Mock\Command\OtherCommand', $factory->factory('binks'));
- $this->assertInstanceof('Guzzle\Tests\Service\Mock\Command\MockCommand', $factory->factory('JarJar'));
- $this->assertInstanceof('Guzzle\Tests\Service\Mock\Command\MockCommand', $factory->factory('jar_jar'));
- }
-
- protected function getDescription()
- {
- return ServiceDescription::factory(array(
- 'operations' => array(
- 'jar_jar' => array('class' => 'Guzzle\Tests\Service\Mock\Command\MockCommand'),
- 'binks' => array('class' => 'Guzzle\Tests\Service\Mock\Command\OtherCommand'),
- 'Test' => array('class' => 'Guzzle\Tests\Service\Mock\Command\OtherCommand')
- )
- ));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/AbstractVisitorTestCase.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/AbstractVisitorTestCase.php
deleted file mode 100644
index 46b472e..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/AbstractVisitorTestCase.php
+++ /dev/null
@@ -1,110 +0,0 @@
-command = new MockCommand();
- $this->request = new EntityEnclosingRequest('POST', 'http://www.test.com/some/path.php');
- $this->validator = new SchemaValidator();
- }
-
- protected function getCommand($location)
- {
- $command = new OperationCommand(array(), $this->getNestedCommand($location));
- $command->setClient(new MockClient());
-
- return $command;
- }
-
- protected function getNestedCommand($location)
- {
- return new Operation(array(
- 'httpMethod' => 'POST',
- 'parameters' => array(
- 'foo' => new Parameter(array(
- 'type' => 'object',
- 'location' => $location,
- 'sentAs' => 'Foo',
- 'required' => true,
- 'properties' => array(
- 'test' => array(
- 'type' => 'object',
- 'required' => true,
- 'properties' => array(
- 'baz' => array(
- 'type' => 'boolean',
- 'default' => true
- ),
- 'jenga' => array(
- 'type' => 'string',
- 'default' => 'hello',
- 'sentAs' => 'Jenga_Yall!',
- 'filters' => array('strtoupper')
- )
- )
- ),
- 'bar' => array('default' => 123)
- ),
- 'additionalProperties' => array(
- 'type' => 'string',
- 'filters' => array('strtoupper'),
- 'location' => $location
- )
- )),
- 'arr' => new Parameter(array(
- 'type' => 'array',
- 'location' => $location,
- 'items' => array(
- 'type' => 'string',
- 'filters' => array('strtoupper')
- )
- )),
- )
- ));
- }
-
- protected function getCommandWithArrayParamAndFilters()
- {
- $operation = new Operation(array(
- 'httpMethod' => 'POST',
- 'parameters' => array(
- 'foo' => new Parameter(array(
- 'type' => 'string',
- 'location' => 'query',
- 'sentAs' => 'Foo',
- 'required' => true,
- 'default' => 'bar',
- 'filters' => array('strtoupper')
- )),
- 'arr' => new Parameter(array(
- 'type' => 'array',
- 'location' => 'query',
- 'sentAs' => 'Arr',
- 'required' => true,
- 'default' => array(123, 456, 789),
- 'filters' => array(array('method' => 'implode', 'args' => array(',', '@value')))
- ))
- )
- ));
- $command = new OperationCommand(array(), $operation);
- $command->setClient(new MockClient());
-
- return $command;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/BodyVisitorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/BodyVisitorTest.php
deleted file mode 100644
index 2a95c45..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/BodyVisitorTest.php
+++ /dev/null
@@ -1,63 +0,0 @@
-getNestedCommand('body')->getParam('foo')->setSentAs('Foo');
- $visitor->visit($this->command, $this->request, $param, '123');
- $this->assertEquals('123', (string) $this->request->getBody());
- $this->assertNull($this->request->getHeader('Expect'));
- }
-
- public function testAddsExpectHeaderWhenSetToTrue()
- {
- $visitor = new Visitor();
- $param = $this->getNestedCommand('body')->getParam('foo')->setSentAs('Foo');
- $param->setData('expect_header', true);
- $visitor->visit($this->command, $this->request, $param, '123');
- $this->assertEquals('123', (string) $this->request->getBody());
- }
-
- public function testCanDisableExpectHeader()
- {
- $visitor = new Visitor();
- $param = $this->getNestedCommand('body')->getParam('foo')->setSentAs('Foo');
- $param->setData('expect_header', false);
- $visitor->visit($this->command, $this->request, $param, '123');
- $this->assertNull($this->request->getHeader('Expect'));
- }
-
- public function testCanSetExpectHeaderBasedOnSize()
- {
- $visitor = new Visitor();
- $param = $this->getNestedCommand('body')->getParam('foo')->setSentAs('Foo');
- // The body is less than the cutoff
- $param->setData('expect_header', 5);
- $visitor->visit($this->command, $this->request, $param, '123');
- $this->assertNull($this->request->getHeader('Expect'));
- // Now check when the body is greater than the cutoff
- $param->setData('expect_header', 2);
- $visitor->visit($this->command, $this->request, $param, '123');
- $this->assertEquals('100-Continue', (string) $this->request->getHeader('Expect'));
- }
-
- public function testAddsContentEncodingWhenSetOnBody()
- {
- $visitor = new Visitor();
- $param = $this->getNestedCommand('body')->getParam('foo')->setSentAs('Foo');
- $body = EntityBody::factory('foo');
- $body->compress();
- $visitor->visit($this->command, $this->request, $param, $body);
- $this->assertEquals('gzip', (string) $this->request->getHeader('Content-Encoding'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/HeaderVisitorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/HeaderVisitorTest.php
deleted file mode 100644
index 7ea1ae9..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/HeaderVisitorTest.php
+++ /dev/null
@@ -1,48 +0,0 @@
-getNestedCommand('header')->getParam('foo')->setSentAs('test');
- $param->setAdditionalProperties(new Parameter(array()));
- $visitor->visit($this->command, $this->request, $param, 'test');
- }
-
- public function testVisitsLocation()
- {
- $visitor = new Visitor();
- $param = $this->getNestedCommand('header')->getParam('foo')->setSentAs('test');
- $param->setAdditionalProperties(false);
- $visitor->visit($this->command, $this->request, $param, '123');
- $this->assertEquals('123', (string) $this->request->getHeader('test'));
- }
-
- public function testVisitsMappedPrefixHeaders()
- {
- $visitor = new Visitor();
- $param = $this->getNestedCommand('header')->getParam('foo')->setSentAs('test');
- $param->setSentAs('x-foo-');
- $param->setAdditionalProperties(new Parameter(array(
- 'type' => 'string'
- )));
- $visitor->visit($this->command, $this->request, $param, array(
- 'bar' => 'test',
- 'baz' => '123'
- ));
- $this->assertEquals('test', (string) $this->request->getHeader('x-foo-bar'));
- $this->assertEquals('123', (string) $this->request->getHeader('x-foo-baz'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/JsonVisitorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/JsonVisitorTest.php
deleted file mode 100644
index ea6782f..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/JsonVisitorTest.php
+++ /dev/null
@@ -1,60 +0,0 @@
-after($this->command, $this->request);
-
- $param = $this->getNestedCommand('json')->getParam('foo');
- $visitor->visit($this->command, $this->request, $param->setSentAs('test'), '123');
- $visitor->visit($this->command, $this->request, $param->setSentAs('test2'), 'abc');
- $visitor->after($this->command, $this->request);
- $this->assertEquals('{"test":"123","test2":"abc"}', (string) $this->request->getBody());
- }
-
- public function testAddsJsonHeader()
- {
- $visitor = new Visitor();
- $visitor->setContentTypeHeader('application/json-foo');
- $param = $this->getNestedCommand('json')->getParam('foo');
- $visitor->visit($this->command, $this->request, $param->setSentAs('test'), '123');
- $visitor->after($this->command, $this->request);
- $this->assertEquals('application/json-foo', (string) $this->request->getHeader('Content-Type'));
- }
-
- public function testRecursivelyBuildsJsonBodies()
- {
- $command = $this->getCommand('json');
- $request = $command->prepare();
- $this->assertEquals('{"Foo":{"test":{"baz":true,"Jenga_Yall!":"HELLO"},"bar":123}}', (string) $request->getBody());
- }
-
- public function testAppliesFiltersToAdditionalProperties()
- {
- $command = $this->getCommand('json');
- $command->set('foo', array('not_set' => 'abc'));
- $request = $command->prepare();
- $result = json_decode($request->getBody(), true);
- $this->assertEquals('ABC', $result['Foo']['not_set']);
- }
-
- public function testAppliesFiltersToArrayItemValues()
- {
- $command = $this->getCommand('json');
- $command->set('arr', array('a', 'b'));
- $request = $command->prepare();
- $result = json_decode($request->getBody(), true);
- $this->assertEquals(array('A', 'B'), $result['arr']);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/PostFieldVisitorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/PostFieldVisitorTest.php
deleted file mode 100644
index 540b410..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/PostFieldVisitorTest.php
+++ /dev/null
@@ -1,33 +0,0 @@
-getNestedCommand('postField')->getParam('foo');
- $visitor->visit($this->command, $this->request, $param->setSentAs('test'), '123');
- $this->assertEquals('123', (string) $this->request->getPostField('test'));
- }
-
- public function testRecursivelyBuildsPostFields()
- {
- $command = $this->getCommand('postField');
- $request = $command->prepare();
- $visitor = new Visitor();
- $param = $command->getOperation()->getParam('foo');
- $visitor->visit($command, $request, $param, $command['foo']);
- $visitor->after($command, $request);
- $this->assertEquals(
- 'Foo[test][baz]=1&Foo[test][Jenga_Yall!]=HELLO&Foo[bar]=123',
- rawurldecode((string) $request->getPostFields())
- );
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/PostFileVisitorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/PostFileVisitorTest.php
deleted file mode 100644
index 21e3cec..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/PostFileVisitorTest.php
+++ /dev/null
@@ -1,54 +0,0 @@
-getNestedCommand('postFile')->getParam('foo');
-
- // Test using a path to a file
- $visitor->visit($this->command, $this->request, $param->setSentAs('test_3'), __FILE__);
- $this->assertInternalType('array', $this->request->getPostFile('test_3'));
-
- // Test with a PostFile
- $visitor->visit($this->command, $this->request, $param->setSentAs(null), new PostFile('baz', __FILE__));
- $this->assertInternalType('array', $this->request->getPostFile('baz'));
- }
-
- public function testVisitsLocationWithMultipleFiles()
- {
- $description = ServiceDescription::factory(array(
- 'operations' => array(
- 'DoPost' => array(
- 'httpMethod' => 'POST',
- 'parameters' => array(
- 'foo' => array(
- 'location' => 'postFile',
- 'type' => array('string', 'array')
- )
- )
- )
- )
- ));
- $this->getServer()->flush();
- $this->getServer()->enqueue(array("HTTP/1.1 200 OK\r\nContent-Length:0\r\n\r\n"));
- $client = new Client($this->getServer()->getUrl());
- $client->setDescription($description);
- $command = $client->getCommand('DoPost', array('foo' => array(__FILE__, __FILE__)));
- $command->execute();
- $received = $this->getServer()->getReceivedRequests();
- $this->assertContains('name="foo[0]";', $received[0]);
- $this->assertContains('name="foo[1]";', $received[0]);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/QueryVisitorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/QueryVisitorTest.php
deleted file mode 100644
index 607af76..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/QueryVisitorTest.php
+++ /dev/null
@@ -1,48 +0,0 @@
-getNestedCommand('query')->getParam('foo')->setSentAs('test');
- $visitor->visit($this->command, $this->request, $param, '123');
- $this->assertEquals('123', $this->request->getQuery()->get('test'));
- }
-
- /**
- * @covers Guzzle\Service\Command\LocationVisitor\Request\QueryVisitor
- * @covers Guzzle\Service\Command\LocationVisitor\Request\AbstractRequestVisitor::resolveRecursively
- */
- public function testRecursivelyBuildsQueryStrings()
- {
- $command = $this->getCommand('query');
- $command->getOperation()->getParam('foo')->setSentAs('Foo');
- $request = $command->prepare();
- $this->assertEquals(
- 'Foo[test][baz]=1&Foo[test][Jenga_Yall!]=HELLO&Foo[bar]=123',
- rawurldecode($request->getQuery())
- );
- }
-
- /**
- * @covers Guzzle\Service\Command\LocationVisitor\Request\AbstractRequestVisitor::resolveRecursively
- */
- public function testFiltersAreAppliedToArrayParamType()
- {
- $command = $this->getCommandWithArrayParamAndFilters();
- $request = $command->prepare();
- $query = $request->getQuery();
- // param type 'string'
- $this->assertEquals('BAR', $query->get('Foo'));
- // param type 'array'
- $this->assertEquals('123,456,789', $query->get('Arr'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/ResponseBodyVisitorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/ResponseBodyVisitorTest.php
deleted file mode 100644
index ff8cec5..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/ResponseBodyVisitorTest.php
+++ /dev/null
@@ -1,20 +0,0 @@
-getNestedCommand('response_body')->getParam('foo');
- $visitor->visit($this->command, $this->request, $param, sys_get_temp_dir() . '/foo.txt');
- $body = $this->readAttribute($this->request, 'responseBody');
- $this->assertContains('/foo.txt', $body->getUri());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/XmlVisitorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/XmlVisitorTest.php
deleted file mode 100644
index beb58b0..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/XmlVisitorTest.php
+++ /dev/null
@@ -1,558 +0,0 @@
- array(
- 'xmlRoot' => array(
- 'name' => 'test',
- 'namespaces' => 'http://foo.com'
- )
- ),
- 'parameters' => array(
- 'Foo' => array('location' => 'xml', 'type' => 'string'),
- 'Baz' => array('location' => 'xml', 'type' => 'string')
- )
- ),
- array('Foo' => 'test', 'Baz' => 'bar'),
- 'test bar '
- ),
- // Ensure that the content-type is not added
- array(array('parameters' => array('Foo' => array('location' => 'xml', 'type' => 'string'))), array(), ''),
- // Test with adding attributes and no namespace
- array(
- array(
- 'data' => array(
- 'xmlRoot' => array(
- 'name' => 'test'
- )
- ),
- 'parameters' => array(
- 'Foo' => array('location' => 'xml', 'type' => 'string', 'data' => array('xmlAttribute' => true))
- )
- ),
- array('Foo' => 'test', 'Baz' => 'bar'),
- ' '
- ),
- // Test adding with an array
- array(
- array(
- 'parameters' => array(
- 'Foo' => array('location' => 'xml', 'type' => 'string'),
- 'Baz' => array(
- 'type' => 'array',
- 'location' => 'xml',
- 'items' => array(
- 'type' => 'numeric',
- 'sentAs' => 'Bar'
- )
- )
- )
- ),
- array('Foo' => 'test', 'Baz' => array(1, 2)),
- 'test 1 2 '
- ),
- // Test adding an object
- array(
- array(
- 'parameters' => array(
- 'Foo' => array('location' => 'xml', 'type' => 'string'),
- 'Baz' => array(
- 'type' => 'object',
- 'location' => 'xml',
- 'properties' => array(
- 'Bar' => array('type' => 'string'),
- 'Bam' => array()
- )
- )
- )
- ),
- array('Foo' => 'test', 'Baz' => array('Bar' => 'abc', 'Bam' => 'foo')),
- 'test abc foo '
- ),
- // Add an array that contains an object
- array(
- array(
- 'parameters' => array(
- 'Baz' => array(
- 'type' => 'array',
- 'location' => 'xml',
- 'items' => array(
- 'type' => 'object',
- 'sentAs' => 'Bar',
- 'properties' => array('A' => array(), 'B' => array())
- )
- )
- )
- ),
- array('Baz' => array(
- array('A' => '1', 'B' => '2'),
- array('A' => '3', 'B' => '4')
- )),
- '1 2 3 4 '
- ),
- // Add an object of attributes
- array(
- array(
- 'parameters' => array(
- 'Foo' => array('location' => 'xml', 'type' => 'string'),
- 'Baz' => array(
- 'type' => 'object',
- 'location' => 'xml',
- 'properties' => array(
- 'Bar' => array('type' => 'string', 'data' => array('xmlAttribute' => true)),
- 'Bam' => array()
- )
- )
- )
- ),
- array('Foo' => 'test', 'Baz' => array('Bar' => 'abc', 'Bam' => 'foo')),
- 'test foo '
- ),
- // Check order doesn't matter
- array(
- array(
- 'parameters' => array(
- 'Foo' => array('location' => 'xml', 'type' => 'string'),
- 'Baz' => array(
- 'type' => 'object',
- 'location' => 'xml',
- 'properties' => array(
- 'Bar' => array('type' => 'string', 'data' => array('xmlAttribute' => true)),
- 'Bam' => array()
- )
- )
- )
- ),
- array('Foo' => 'test', 'Baz' => array('Bam' => 'foo', 'Bar' => 'abc')),
- 'test foo '
- ),
- // Add values with custom namespaces
- array(
- array(
- 'parameters' => array(
- 'Foo' => array(
- 'location' => 'xml',
- 'type' => 'string',
- 'data' => array(
- 'xmlNamespace' => 'http://foo.com'
- )
- )
- )
- ),
- array('Foo' => 'test'),
- 'test '
- ),
- // Add attributes with custom namespace prefix
- array(
- array(
- 'parameters' => array(
- 'Wrap' => array(
- 'type' => 'object',
- 'location' => 'xml',
- 'properties' => array(
- 'Foo' => array(
- 'type' => 'string',
- 'sentAs' => 'xsi:baz',
- 'data' => array(
- 'xmlNamespace' => 'http://foo.com',
- 'xmlAttribute' => true
- )
- )
- )
- ),
- )
- ),
- array('Wrap' => array(
- 'Foo' => 'test'
- )),
- ' '
- ),
- // Add nodes with custom namespace prefix
- array(
- array(
- 'parameters' => array(
- 'Wrap' => array(
- 'type' => 'object',
- 'location' => 'xml',
- 'properties' => array(
- 'Foo' => array(
- 'type' => 'string',
- 'sentAs' => 'xsi:Foo',
- 'data' => array(
- 'xmlNamespace' => 'http://foobar.com'
- )
- )
- )
- ),
- )
- ),
- array('Wrap' => array(
- 'Foo' => 'test'
- )),
- 'test '
- ),
- array(
- array(
- 'parameters' => array(
- 'Foo' => array(
- 'location' => 'xml',
- 'type' => 'string',
- 'data' => array(
- 'xmlNamespace' => 'http://foo.com'
- )
- )
- )
- ),
- array('Foo' => 'This is a title '),
- 'This is a title]]> '
- ),
- // Flat array at top level
- array(
- array(
- 'parameters' => array(
- 'Bars' => array(
- 'type' => 'array',
- 'data' => array('xmlFlattened' => true),
- 'location' => 'xml',
- 'items' => array(
- 'type' => 'object',
- 'sentAs' => 'Bar',
- 'properties' => array(
- 'A' => array(),
- 'B' => array()
- )
- )
- ),
- 'Boos' => array(
- 'type' => 'array',
- 'data' => array('xmlFlattened' => true),
- 'location' => 'xml',
- 'items' => array(
- 'sentAs' => 'Boo',
- 'type' => 'string'
- )
- )
- )
- ),
- array(
- 'Bars' => array(
- array('A' => '1', 'B' => '2'),
- array('A' => '3', 'B' => '4')
- ),
- 'Boos' => array('test', '123')
- ),
- '1 2 3 4 test 123 '
- ),
- // Nested flat arrays
- array(
- array(
- 'parameters' => array(
- 'Delete' => array(
- 'type' => 'object',
- 'location' => 'xml',
- 'properties' => array(
- 'Items' => array(
- 'type' => 'array',
- 'data' => array('xmlFlattened' => true),
- 'items' => array(
- 'type' => 'object',
- 'sentAs' => 'Item',
- 'properties' => array(
- 'A' => array(),
- 'B' => array()
- )
- )
- )
- )
- )
- )
- ),
- array(
- 'Delete' => array(
- 'Items' => array(
- array('A' => '1', 'B' => '2'),
- array('A' => '3', 'B' => '4')
- )
- )
- ),
- '1 2 3 4 '
- )
- );
- }
-
- /**
- * @dataProvider xmlProvider
- */
- public function testSerializesXml(array $operation, array $input, $xml)
- {
- $operation = new Operation($operation);
- $command = $this->getMockBuilder('Guzzle\Service\Command\OperationCommand')
- ->setConstructorArgs(array($input, $operation))
- ->getMockForAbstractClass();
- $command->setClient(new Client('http://www.test.com/some/path.php'));
- $request = $command->prepare();
- if (!empty($input)) {
- $this->assertEquals('application/xml', (string) $request->getHeader('Content-Type'));
- } else {
- $this->assertNull($request->getHeader('Content-Type'));
- }
- $body = str_replace(array("\n", ""), '', (string) $request->getBody());
- $this->assertEquals($xml, $body);
- }
-
- public function testAddsContentTypeAndTopLevelValues()
- {
- $operation = new Operation(array(
- 'data' => array(
- 'xmlRoot' => array(
- 'name' => 'test',
- 'namespaces' => array(
- 'xsi' => 'http://foo.com'
- )
- )
- ),
- 'parameters' => array(
- 'Foo' => array('location' => 'xml', 'type' => 'string'),
- 'Baz' => array('location' => 'xml', 'type' => 'string')
- )
- ));
-
- $command = $this->getMockBuilder('Guzzle\Service\Command\OperationCommand')
- ->setConstructorArgs(array(array(
- 'Foo' => 'test',
- 'Baz' => 'bar'
- ), $operation))
- ->getMockForAbstractClass();
-
- $command->setClient(new Client());
- $request = $command->prepare();
- $this->assertEquals('application/xml', (string) $request->getHeader('Content-Type'));
- $this->assertEquals(
- '' . "\n"
- . 'test bar ' . "\n",
- (string) $request->getBody()
- );
- }
-
- public function testCanChangeContentType()
- {
- $visitor = new XmlVisitor();
- $visitor->setContentTypeHeader('application/foo');
- $this->assertEquals('application/foo', $this->readAttribute($visitor, 'contentType'));
- }
-
- public function testCanAddArrayOfSimpleTypes()
- {
- $request = new EntityEnclosingRequest('POST', 'http://foo.com');
- $visitor = new XmlVisitor();
- $param = new Parameter(array(
- 'type' => 'object',
- 'location' => 'xml',
- 'name' => 'Out',
- 'properties' => array(
- 'Nodes' => array(
- 'required' => true,
- 'type' => 'array',
- 'min' => 1,
- 'items' => array('type' => 'string', 'sentAs' => 'Node')
- )
- )
- ));
-
- $param->setParent(new Operation(array(
- 'data' => array(
- 'xmlRoot' => array(
- 'name' => 'Test',
- 'namespaces' => array(
- 'https://foo/'
- )
- )
- )
- )));
-
- $value = array('Nodes' => array('foo', 'baz'));
- $this->assertTrue($this->validator->validate($param, $value));
- $visitor->visit($this->command, $request, $param, $value);
- $visitor->after($this->command, $request);
-
- $this->assertEquals(
- "\n"
- . "foo baz \n",
- (string) $request->getBody()
- );
- }
-
- public function testCanAddMultipleNamespacesToRoot()
- {
- $operation = new Operation(array(
- 'data' => array(
- 'xmlRoot' => array(
- 'name' => 'Hi',
- 'namespaces' => array(
- 'xsi' => 'http://foo.com',
- 'foo' => 'http://foobar.com'
- )
- )
- ),
- 'parameters' => array(
- 'Foo' => array('location' => 'xml', 'type' => 'string')
- )
- ));
-
- $command = $this->getMockBuilder('Guzzle\Service\Command\OperationCommand')
- ->setConstructorArgs(array(array(
- 'Foo' => 'test'
- ), $operation))
- ->getMockForAbstractClass();
-
- $command->setClient(new Client());
- $request = $command->prepare();
- $this->assertEquals('application/xml', (string) $request->getHeader('Content-Type'));
- $this->assertEquals(
- '' . "\n"
- . 'test ' . "\n",
- (string) $request->getBody()
- );
- }
-
- public function testValuesAreFiltered()
- {
- $operation = new Operation(array(
- 'parameters' => array(
- 'Foo' => array(
- 'location' => 'xml',
- 'type' => 'string',
- 'filters' => array('strtoupper')
- ),
- 'Bar' => array(
- 'location' => 'xml',
- 'type' => 'object',
- 'properties' => array(
- 'Baz' => array(
- 'filters' => array('strtoupper')
- )
- )
- )
- )
- ));
-
- $command = $this->getMockBuilder('Guzzle\Service\Command\OperationCommand')
- ->setConstructorArgs(array(array(
- 'Foo' => 'test',
- 'Bar' => array(
- 'Baz' => 'abc'
- )
- ), $operation))
- ->getMockForAbstractClass();
-
- $command->setClient(new Client());
- $request = $command->prepare();
- $this->assertEquals(
- '' . "\n"
- . 'TEST ABC ' . "\n",
- (string) $request->getBody()
- );
- }
-
- public function testSkipsNullValues()
- {
- $operation = new Operation(array(
- 'parameters' => array(
- 'Foo' => array(
- 'location' => 'xml',
- 'type' => 'string'
- ),
- 'Bar' => array(
- 'location' => 'xml',
- 'type' => 'object',
- 'properties' => array(
- 'Baz' => array(),
- 'Bam' => array(),
- )
- ),
- 'Arr' => array(
- 'type' => 'array',
- 'items' => array(
- 'type' => 'string'
- )
- )
- )
- ));
-
- $command = $this->getMockBuilder('Guzzle\Service\Command\OperationCommand')
- ->setConstructorArgs(array(array(
- 'Foo' => null,
- 'Bar' => array(
- 'Bar' => null,
- 'Bam' => 'test'
- ),
- 'Arr' => array(null)
- ), $operation))
- ->getMockForAbstractClass();
-
- $command->setClient(new Client());
- $request = $command->prepare();
- $this->assertEquals(
- '' . "\n"
- . 'test ' . "\n",
- (string) $request->getBody()
- );
- }
-
- public function testAllowsXmlEncoding()
- {
- $operation = new Operation(array(
- 'data' => array(
- 'xmlEncoding' => 'UTF-8'
- ),
- 'parameters' => array(
- 'Foo' => array('location' => 'xml')
- )
- ));
- $command = $this->getMockBuilder('Guzzle\Service\Command\OperationCommand')
- ->setConstructorArgs(array(array('Foo' => 'test'), $operation))
- ->getMockForAbstractClass();
- $command->setClient(new Client());
- $request = $command->prepare();
- $this->assertEquals(
- '' . "\n"
- . 'test ' . "\n",
- (string) $request->getBody()
- );
- }
-
- public function testAllowsSendingXmlPayloadIfNoXmlParamsWereSet()
- {
- $operation = new Operation(array(
- 'httpMethod' => 'POST',
- 'data' => array('xmlAllowEmpty' => true),
- 'parameters' => array('Foo' => array('location' => 'xml'))
- ));
- $command = $this->getMockBuilder('Guzzle\Service\Command\OperationCommand')
- ->setConstructorArgs(array(array(), $operation))
- ->getMockForAbstractClass();
- $command->setClient(new Client('http://foo.com'));
- $request = $command->prepare();
- $this->assertEquals(
- '' . "\n"
- . ' ' . "\n",
- (string) $request->getBody()
- );
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/AbstractResponseVisitorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/AbstractResponseVisitorTest.php
deleted file mode 100644
index 7b86003..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/AbstractResponseVisitorTest.php
+++ /dev/null
@@ -1,29 +0,0 @@
-value = array();
- $this->command = new MockCommand();
- $this->response = new Response(200, array(
- 'X-Foo' => 'bar',
- 'Content-Length' => 3,
- 'Content-Type' => 'text/plain'
- ), 'Foo');
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/BodyVisitorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/BodyVisitorTest.php
deleted file mode 100644
index 932e39b..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/BodyVisitorTest.php
+++ /dev/null
@@ -1,21 +0,0 @@
- 'body', 'name' => 'foo'));
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals('Foo', (string) $this->value['foo']);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/HeaderVisitorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/HeaderVisitorTest.php
deleted file mode 100644
index db54b1a..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/HeaderVisitorTest.php
+++ /dev/null
@@ -1,98 +0,0 @@
- 'header',
- 'name' => 'ContentType',
- 'sentAs' => 'Content-Type'
- ));
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals('text/plain', $this->value['ContentType']);
- }
-
- public function testVisitsLocationWithFilters()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'location' => 'header',
- 'name' => 'Content-Type',
- 'filters' => array('strtoupper')
- ));
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals('TEXT/PLAIN', $this->value['Content-Type']);
- }
-
- public function testVisitsMappedPrefixHeaders()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'location' => 'header',
- 'name' => 'Metadata',
- 'sentAs' => 'X-Baz-',
- 'type' => 'object',
- 'additionalProperties' => array(
- 'type' => 'string'
- )
- ));
- $response = new Response(200, array(
- 'X-Baz-Test' => 'ABC',
- 'X-Baz-Bar' => array('123', '456'),
- 'Content-Length' => 3
- ), 'Foo');
- $visitor->visit($this->command, $response, $param, $this->value);
- $this->assertEquals(array(
- 'Metadata' => array(
- 'Test' => 'ABC',
- 'Bar' => array('123', '456')
- )
- ), $this->value);
- }
-
- /**
- * @group issue-399
- * @link https://github.com/guzzle/guzzle/issues/399
- */
- public function testDiscardingUnknownHeaders()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'location' => 'header',
- 'name' => 'Content-Type',
- 'additionalParameters' => false
- ));
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals('text/plain', $this->value['Content-Type']);
- $this->assertArrayNotHasKey('X-Foo', $this->value);
- }
-
- /**
- * @group issue-399
- * @link https://github.com/guzzle/guzzle/issues/399
- */
- public function testDiscardingUnknownPropertiesWithAliasing()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'location' => 'header',
- 'name' => 'ContentType',
- 'sentAs' => 'Content-Type',
- 'additionalParameters' => false
- ));
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals('text/plain', $this->value['ContentType']);
- $this->assertArrayNotHasKey('X-Foo', $this->value);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/JsonVisitorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/JsonVisitorTest.php
deleted file mode 100644
index 4f8d30b..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/JsonVisitorTest.php
+++ /dev/null
@@ -1,157 +0,0 @@
-getMockBuilder('Guzzle\Service\Command\AbstractCommand')
- ->setMethods(array('getResponse'))
- ->getMockForAbstractClass();
- $command->expects($this->once())
- ->method('getResponse')
- ->will($this->returnValue(new Response(200, null, '{"foo":"bar"}')));
- $result = array();
- $visitor->before($command, $result);
- $this->assertEquals(array('foo' => 'bar'), $result);
- }
-
- public function testVisitsLocation()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'array',
- 'items' => array(
- 'filters' => 'strtoupper',
- 'type' => 'string'
- )
- ));
- $this->value = array('foo' => array('a', 'b', 'c'));
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals(array('A', 'B', 'C'), $this->value['foo']);
- }
-
- public function testRenamesTopLevelValues()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'name' => 'foo',
- 'sentAs' => 'Baz',
- 'type' => 'string',
- ));
- $this->value = array('Baz' => 'test');
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals(array('foo' => 'test'), $this->value);
- }
-
- public function testRenamesDoesNotFailForNonExistentKey()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'properties' => array(
- 'bar' => array(
- 'name' => 'bar',
- 'sentAs' => 'baz',
- ),
- ),
- ));
- $this->value = array('foo' => array('unknown' => 'Unknown'));
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals(array('foo' => array('unknown' => 'Unknown')), $this->value);
- }
-
- public function testTraversesObjectsAndAppliesFilters()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'properties' => array(
- 'foo' => array('filters' => 'strtoupper'),
- 'bar' => array('filters' => 'strtolower')
- )
- ));
- $this->value = array('foo' => array('foo' => 'hello', 'bar' => 'THERE'));
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals(array('foo' => 'HELLO', 'bar' => 'there'), $this->value['foo']);
- }
-
- /**
- * @group issue-399
- * @link https://github.com/guzzle/guzzle/issues/399
- */
- public function testDiscardingUnknownProperties()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'additionalProperties' => false,
- 'properties' => array(
- 'bar' => array(
- 'type' => 'string',
- 'name' => 'bar',
- ),
- ),
- ));
- $this->value = array('foo' => array('bar' => 15, 'unknown' => 'Unknown'));
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals(array('foo' => array('bar' => 15)), $this->value);
- }
-
- /**
- * @group issue-399
- * @link https://github.com/guzzle/guzzle/issues/399
- */
- public function testDiscardingUnknownPropertiesWithAliasing()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'additionalProperties' => false,
- 'properties' => array(
- 'bar' => array(
- 'name' => 'bar',
- 'sentAs' => 'baz',
- ),
- ),
- ));
- $this->value = array('foo' => array('baz' => 15, 'unknown' => 'Unknown'));
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals(array('foo' => array('bar' => 15)), $this->value);
- }
-
- public function testWalksAdditionalProperties()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'additionalProperties' => array(
- 'type' => 'object',
- 'properties' => array(
- 'bar' => array(
- 'type' => 'string',
- 'filters' => array('base64_decode')
- )
- ),
- ),
- ));
- $this->value = array('foo' => array('baz' => array('bar' => 'Zm9v')));
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals('foo', $this->value['foo']['baz']['bar']);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/ReasonPhraseVisitorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/ReasonPhraseVisitorTest.php
deleted file mode 100644
index 23cd40f..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/ReasonPhraseVisitorTest.php
+++ /dev/null
@@ -1,21 +0,0 @@
- 'reasonPhrase', 'name' => 'phrase'));
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals('OK', $this->value['phrase']);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/StatusCodeVisitorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/StatusCodeVisitorTest.php
deleted file mode 100644
index 7211a58..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/StatusCodeVisitorTest.php
+++ /dev/null
@@ -1,21 +0,0 @@
- 'statusCode', 'name' => 'code'));
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals(200, $this->value['code']);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/XmlVisitorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/XmlVisitorTest.php
deleted file mode 100644
index f87cec7..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Response/XmlVisitorTest.php
+++ /dev/null
@@ -1,431 +0,0 @@
-getMockBuilder('Guzzle\Service\Command\AbstractCommand')
- ->setMethods(array('getResponse'))
- ->getMockForAbstractClass();
- $command->expects($this->once())
- ->method('getResponse')
- ->will($this->returnValue(new Response(200, null, 'test ')));
- $result = array();
- $visitor->before($command, $result);
- $this->assertEquals(array('Bar' => 'test'), $result);
- }
-
- public function testBeforeMethodParsesXmlWithNamespace()
- {
- $this->markTestSkipped("Response/XmlVisitor cannot accept 'xmlns' in response, see #368 (http://git.io/USa1mA).");
-
- $visitor = new Visitor();
- $command = $this->getMockBuilder('Guzzle\Service\Command\AbstractCommand')
- ->setMethods(array('getResponse'))
- ->getMockForAbstractClass();
- $command->expects($this->once())
- ->method('getResponse')
- ->will($this->returnValue(new Response(200, null, 'test ')));
- $result = array();
- $visitor->before($command, $result);
- $this->assertEquals(array('Bar' => 'test'), $result);
- }
-
- public function testBeforeMethodParsesNestedXml()
- {
- $visitor = new Visitor();
- $command = $this->getMockBuilder('Guzzle\Service\Command\AbstractCommand')
- ->setMethods(array('getResponse'))
- ->getMockForAbstractClass();
- $command->expects($this->once())
- ->method('getResponse')
- ->will($this->returnValue(new Response(200, null, 'test ')));
- $result = array();
- $visitor->before($command, $result);
- $this->assertEquals(array('Items' => array('Bar' => 'test')), $result);
- }
-
- public function testCanExtractAndRenameTopLevelXmlValues()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'location' => 'xml',
- 'name' => 'foo',
- 'sentAs' => 'Bar'
- ));
- $value = array('Bar' => 'test');
- $visitor->visit($this->command, $this->response, $param, $value);
- $this->assertArrayHasKey('foo', $value);
- $this->assertEquals('test', $value['foo']);
- }
-
- public function testEnsuresRepeatedArraysAreInCorrectLocations()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'location' => 'xml',
- 'name' => 'foo',
- 'sentAs' => 'Foo',
- 'type' => 'array',
- 'items' => array(
- 'type' => 'object',
- 'properties' => array(
- 'Bar' => array('type' => 'string'),
- 'Baz' => array('type' => 'string'),
- 'Bam' => array('type' => 'string')
- )
- )
- ));
-
- $xml = new \SimpleXMLElement('1 2 ');
- $value = json_decode(json_encode($xml), true);
- $visitor->visit($this->command, $this->response, $param, $value);
- $this->assertEquals(array(
- 'foo' => array(
- array (
- 'Bar' => '1',
- 'Baz' => '2'
- )
- )
- ), $value);
- }
-
- public function testEnsuresFlatArraysAreFlat()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'location' => 'xml',
- 'name' => 'foo',
- 'type' => 'array',
- 'items' => array('type' => 'string')
- ));
-
- $value = array('foo' => array('bar', 'baz'));
- $visitor->visit($this->command, $this->response, $param, $value);
- $this->assertEquals(array('foo' => array('bar', 'baz')), $value);
-
- $value = array('foo' => 'bar');
- $visitor->visit($this->command, $this->response, $param, $value);
- $this->assertEquals(array('foo' => array('bar')), $value);
- }
-
- public function xmlDataProvider()
- {
- $param = new Parameter(array(
- 'location' => 'xml',
- 'name' => 'Items',
- 'type' => 'array',
- 'items' => array(
- 'type' => 'object',
- 'name' => 'Item',
- 'properties' => array(
- 'Bar' => array('type' => 'string'),
- 'Baz' => array('type' => 'string')
- )
- )
- ));
-
- return array(
- array($param, '1 2 ', array(
- 'Items' => array(
- array('Bar' => 1),
- array('Bar' => 2)
- )
- )),
- array($param, '1 ', array(
- 'Items' => array(
- array('Bar' => 1)
- )
- )),
- array($param, ' ', array(
- 'Items' => array()
- ))
- );
- }
-
- /**
- * @dataProvider xmlDataProvider
- */
- public function testEnsuresWrappedArraysAreInCorrectLocations($param, $xml, $result)
- {
- $visitor = new Visitor();
- $xml = new \SimpleXMLElement($xml);
- $value = json_decode(json_encode($xml), true);
- $visitor->visit($this->command, $this->response, $param, $value);
- $this->assertEquals($result, $value);
- }
-
- public function testCanRenameValues()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'name' => 'TerminatingInstances',
- 'type' => 'array',
- 'location' => 'xml',
- 'sentAs' => 'instancesSet',
- 'items' => array(
- 'name' => 'item',
- 'type' => 'object',
- 'sentAs' => 'item',
- 'properties' => array(
- 'InstanceId' => array(
- 'type' => 'string',
- 'sentAs' => 'instanceId',
- ),
- 'CurrentState' => array(
- 'type' => 'object',
- 'sentAs' => 'currentState',
- 'properties' => array(
- 'Code' => array(
- 'type' => 'numeric',
- 'sentAs' => 'code',
- ),
- 'Name' => array(
- 'type' => 'string',
- 'sentAs' => 'name',
- ),
- ),
- ),
- 'PreviousState' => array(
- 'type' => 'object',
- 'sentAs' => 'previousState',
- 'properties' => array(
- 'Code' => array(
- 'type' => 'numeric',
- 'sentAs' => 'code',
- ),
- 'Name' => array(
- 'type' => 'string',
- 'sentAs' => 'name',
- ),
- ),
- ),
- ),
- )
- ));
-
- $value = array(
- 'instancesSet' => array (
- 'item' => array (
- 'instanceId' => 'i-3ea74257',
- 'currentState' => array(
- 'code' => '32',
- 'name' => 'shutting-down',
- ),
- 'previousState' => array(
- 'code' => '16',
- 'name' => 'running',
- ),
- ),
- )
- );
-
- $visitor->visit($this->command, $this->response, $param, $value);
-
- $this->assertEquals(array(
- 'TerminatingInstances' => array(
- array(
- 'InstanceId' => 'i-3ea74257',
- 'CurrentState' => array(
- 'Code' => '32',
- 'Name' => 'shutting-down',
- ),
- 'PreviousState' => array(
- 'Code' => '16',
- 'Name' => 'running',
- )
- )
- )
- ), $value);
- }
-
- public function testCanRenameAttributes()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'name' => 'RunningQueues',
- 'type' => 'array',
- 'location' => 'xml',
- 'items' => array(
- 'type' => 'object',
- 'sentAs' => 'item',
- 'properties' => array(
- 'QueueId' => array(
- 'type' => 'string',
- 'sentAs' => 'queue_id',
- 'data' => array(
- 'xmlAttribute' => true,
- ),
- ),
- 'CurrentState' => array(
- 'type' => 'object',
- 'properties' => array(
- 'Code' => array(
- 'type' => 'numeric',
- 'sentAs' => 'code',
- 'data' => array(
- 'xmlAttribute' => true,
- ),
- ),
- 'Name' => array(
- 'sentAs' => 'name',
- 'data' => array(
- 'xmlAttribute' => true,
- ),
- ),
- ),
- ),
- 'PreviousState' => array(
- 'type' => 'object',
- 'properties' => array(
- 'Code' => array(
- 'type' => 'numeric',
- 'sentAs' => 'code',
- 'data' => array(
- 'xmlAttribute' => true,
- ),
- ),
- 'Name' => array(
- 'sentAs' => 'name',
- 'data' => array(
- 'xmlAttribute' => true,
- ),
- ),
- ),
- ),
- ),
- )
- ));
-
- $xml = ' ';
- $value = json_decode(json_encode(new \SimpleXMLElement($xml)), true);
- $visitor->visit($this->command, $this->response, $param, $value);
-
- $this->assertEquals(array(
- 'RunningQueues' => array(
- array(
- 'QueueId' => 'q-3ea74257',
- 'CurrentState' => array(
- 'Code' => '32',
- 'Name' => 'processing',
- ),
- 'PreviousState' => array(
- 'Code' => '16',
- 'Name' => 'wait',
- ),
- ),
- )
- ), $value);
- }
-
- public function testAddsEmptyArraysWhenValueIsMissing()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'name' => 'Foo',
- 'type' => 'array',
- 'location' => 'xml',
- 'items' => array(
- 'type' => 'object',
- 'properties' => array(
- 'Baz' => array('type' => 'array'),
- 'Bar' => array(
- 'type' => 'object',
- 'properties' => array(
- 'Baz' => array('type' => 'array'),
- )
- )
- )
- )
- ));
-
- $value = array();
- $visitor->visit($this->command, $this->response, $param, $value);
-
- $value = array(
- 'Foo' => array(
- 'Bar' => array()
- )
- );
- $visitor->visit($this->command, $this->response, $param, $value);
- $this->assertEquals(array(
- 'Foo' => array(
- array(
- 'Bar' => array()
- )
- )
- ), $value);
- }
-
- /**
- * @group issue-399
- * @link https://github.com/guzzle/guzzle/issues/399
- */
- public function testDiscardingUnknownProperties()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'additionalProperties' => false,
- 'properties' => array(
- 'bar' => array(
- 'type' => 'string',
- 'name' => 'bar',
- ),
- ),
- ));
- $this->value = array('foo' => array('bar' => 15, 'unknown' => 'Unknown'));
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals(array('foo' => array('bar' => 15)), $this->value);
- }
-
- /**
- * @group issue-399
- * @link https://github.com/guzzle/guzzle/issues/399
- */
- public function testDiscardingUnknownPropertiesWithAliasing()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'additionalProperties' => false,
- 'properties' => array(
- 'bar' => array(
- 'name' => 'bar',
- 'sentAs' => 'baz',
- ),
- ),
- ));
- $this->value = array('foo' => array('baz' => 15, 'unknown' => 'Unknown'));
- $visitor->visit($this->command, $this->response, $param, $this->value);
- $this->assertEquals(array('foo' => array('bar' => 15)), $this->value);
- }
-
- public function testProperlyHandlesEmptyStringValues()
- {
- $visitor = new Visitor();
- $param = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'properties' => array(
- 'bar' => array('type' => 'string')
- ),
- ));
- $xml = ' ';
- $value = json_decode(json_encode(new \SimpleXMLElement($xml)), true);
- $visitor->visit($this->command, $this->response, $param, $value);
- $this->assertEquals(array('foo' => array('bar' => '')), $value);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/VisitorFlyweightTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/VisitorFlyweightTest.php
deleted file mode 100644
index a252ffe..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/VisitorFlyweightTest.php
+++ /dev/null
@@ -1,53 +0,0 @@
-assertInstanceOf('Guzzle\Service\Command\LocationVisitor\Request\JsonVisitor', $f->getRequestVisitor('json'));
- $this->assertInstanceOf('Guzzle\Service\Command\LocationVisitor\Response\JsonVisitor', $f->getResponseVisitor('json'));
- }
-
- public function testCanUseCustomMappings()
- {
- $f = new VisitorFlyweight(array());
- $this->assertEquals(array(), $this->readAttribute($f, 'mappings'));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage No request visitor has been mapped for foo
- */
- public function testThrowsExceptionWhenRetrievingUnknownVisitor()
- {
- VisitorFlyweight::getInstance()->getRequestVisitor('foo');
- }
-
- public function testCachesVisitors()
- {
- $f = new VisitorFlyweight();
- $v1 = $f->getRequestVisitor('json');
- $this->assertSame($v1, $f->getRequestVisitor('json'));
- }
-
- public function testAllowsAddingVisitors()
- {
- $f = new VisitorFlyweight();
- $j1 = new JsonRequestVisitor();
- $j2 = new JsonResponseVisitor();
- $f->addRequestVisitor('json', $j1);
- $f->addResponseVisitor('json', $j2);
- $this->assertSame($j1, $f->getRequestVisitor('json'));
- $this->assertSame($j2, $f->getResponseVisitor('json'));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/OperationCommandTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/OperationCommandTest.php
deleted file mode 100644
index 95fb533..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/OperationCommandTest.php
+++ /dev/null
@@ -1,102 +0,0 @@
-getRequestSerializer();
- $b = new DefaultRequestSerializer(VisitorFlyweight::getInstance());
- $operation->setRequestSerializer($b);
- $this->assertNotSame($a, $operation->getRequestSerializer());
- }
-
- public function testPreparesRequestUsingSerializer()
- {
- $op = new OperationCommand(array(), new Operation());
- $op->setClient(new Client());
- $s = $this->getMockBuilder('Guzzle\Service\Command\RequestSerializerInterface')
- ->setMethods(array('prepare'))
- ->getMockForAbstractClass();
- $s->expects($this->once())
- ->method('prepare')
- ->will($this->returnValue(new EntityEnclosingRequest('POST', 'http://foo.com')));
- $op->setRequestSerializer($s);
- $op->prepare();
- }
-
- public function testParsesResponsesWithResponseParser()
- {
- $op = new OperationCommand(array(), new Operation());
- $p = $this->getMockBuilder('Guzzle\Service\Command\ResponseParserInterface')
- ->setMethods(array('parse'))
- ->getMockForAbstractClass();
- $p->expects($this->once())
- ->method('parse')
- ->will($this->returnValue(array('foo' => 'bar')));
- $op->setResponseParser($p);
- $op->setClient(new Client());
- $request = $op->prepare();
- $request->setResponse(new Response(200), true);
- $this->assertEquals(array('foo' => 'bar'), $op->execute());
- }
-
- public function testParsesResponsesUsingModelParserWhenMatchingModelIsFound()
- {
- $description = ServiceDescription::factory(array(
- 'operations' => array(
- 'foo' => array('responseClass' => 'bar', 'responseType' => 'model')
- ),
- 'models' => array(
- 'bar' => array(
- 'type' => 'object',
- 'properties' => array(
- 'Baz' => array('type' => 'string', 'location' => 'xml')
- )
- )
- )
- ));
-
- $op = new OperationCommand(array(), $description->getOperation('foo'));
- $op->setClient(new Client());
- $request = $op->prepare();
- $request->setResponse(new Response(200, array(
- 'Content-Type' => 'application/xml'
- ), 'Bar '), true);
- $result = $op->execute();
- $this->assertEquals(new Model(array('Baz' => 'Bar')), $result);
- }
-
- public function testAllowsRawResponses()
- {
- $description = new ServiceDescription(array(
- 'operations' => array('foo' => array('responseClass' => 'bar', 'responseType' => 'model')),
- 'models' => array('bar' => array())
- ));
- $op = new OperationCommand(array(
- OperationCommand::RESPONSE_PROCESSING => OperationCommand::TYPE_RAW
- ), $description->getOperation('foo'));
- $op->setClient(new Client());
- $request = $op->prepare();
- $response = new Response(200, array(
- 'Content-Type' => 'application/xml'
- ), 'Bar ');
- $request->setResponse($response, true);
- $this->assertSame($response, $op->execute());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/OperationResponseParserTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/OperationResponseParserTest.php
deleted file mode 100644
index 69ba1fc..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/OperationResponseParserTest.php
+++ /dev/null
@@ -1,335 +0,0 @@
-addVisitor('foo', $visitor);
- $this->assertSame($visitor, $this->readAttribute($p, 'factory')->getResponseVisitor('foo'));
- }
-
- public function testUsesParentParser()
- {
- $p = new OperationResponseParser(new VisitorFlyweight());
- $operation = new Operation();
- $operation->setServiceDescription(new ServiceDescription());
- $op = new OperationCommand(array(), $operation);
- $op->setResponseParser($p)->setClient(new Client());
- $op->prepare()->setResponse(new Response(200, array('Content-Type' => 'application/xml'), 'C '), true);
- $this->assertInstanceOf('SimpleXMLElement', $op->execute());
- }
-
- public function testVisitsLocations()
- {
- $parser = new OperationResponseParser(new VisitorFlyweight(array()));
- $parser->addVisitor('statusCode', new StatusCodeVisitor());
- $parser->addVisitor('reasonPhrase', new ReasonPhraseVisitor());
- $parser->addVisitor('json', new JsonVisitor());
- $op = new OperationCommand(array(), $this->getDescription()->getOperation('test'));
- $op->setResponseParser($parser)->setClient(new Client());
- $op->prepare()->setResponse(new Response(201), true);
- $result = $op->execute();
- $this->assertEquals(201, $result['code']);
- $this->assertEquals('Created', $result['phrase']);
- }
-
- public function testVisitsLocationsForJsonResponse()
- {
- $parser = OperationResponseParser::getInstance();
- $operation = $this->getDescription()->getOperation('test');
- $op = new OperationCommand(array(), $operation);
- $op->setResponseParser($parser)->setClient(new Client());
- $op->prepare()->setResponse(new Response(200, array(
- 'Content-Type' => 'application/json'
- ), '{"baz":"bar","enigma":"123"}'), true);
- $result = $op->execute();
- $this->assertEquals(array(
- 'baz' => 'bar',
- 'enigma' => '123',
- 'code' => 200,
- 'phrase' => 'OK'
- ), $result->toArray());
- }
-
- public function testSkipsUnkownModels()
- {
- $parser = OperationResponseParser::getInstance();
- $operation = $this->getDescription()->getOperation('test');
- $operation->setResponseClass('Baz')->setResponseType('model');
- $op = new OperationCommand(array(), $operation);
- $op->setResponseParser($parser)->setClient(new Client());
- $op->prepare()->setResponse(new Response(201), true);
- $this->assertInstanceOf('Guzzle\Http\Message\Response', $op->execute());
- }
-
- public function testAllowsModelProcessingToBeDisabled()
- {
- $parser = OperationResponseParser::getInstance();
- $operation = $this->getDescription()->getOperation('test');
- $op = new OperationCommand(array('command.response_processing' => 'native'), $operation);
- $op->setResponseParser($parser)->setClient(new Client());
- $op->prepare()->setResponse(new Response(200, array(
- 'Content-Type' => 'application/json'
- ), '{"baz":"bar","enigma":"123"}'), true);
- $result = $op->execute();
- $this->assertInstanceOf('Guzzle\Service\Resource\Model', $result);
- $this->assertEquals(array(
- 'baz' => 'bar',
- 'enigma' => '123'
- ), $result->toArray());
- }
-
- public function testCanInjectModelSchemaIntoModels()
- {
- $parser = new OperationResponseParser(VisitorFlyweight::getInstance(), true);
- $desc = $this->getDescription();
- $operation = $desc->getOperation('test');
- $op = new OperationCommand(array(), $operation);
- $op->setResponseParser($parser)->setClient(new Client());
- $op->prepare()->setResponse(new Response(200, array(
- 'Content-Type' => 'application/json'
- ), '{"baz":"bar","enigma":"123"}'), true);
- $result = $op->execute();
- $this->assertSame($result->getStructure(), $desc->getModel('Foo'));
- }
-
- public function testDoesNotParseXmlWhenNotUsingXmlVisitor()
- {
- $parser = OperationResponseParser::getInstance();
- $description = ServiceDescription::factory(array(
- 'operations' => array('test' => array('responseClass' => 'Foo')),
- 'models' => array(
- 'Foo' => array(
- 'type' => 'object',
- 'properties' => array('baz' => array('location' => 'body'))
- )
- )
- ));
- $operation = $description->getOperation('test');
- $op = new OperationCommand(array(), $operation);
- $op->setResponseParser($parser)->setClient(new Client());
- $brokenXml = '<><><>>>>';
- $op->prepare()->setResponse(new Response(200, array(
- 'Content-Type' => 'application/xml'
- ), $brokenXml), true);
- $result = $op->execute();
- $this->assertEquals(array('baz'), $result->getKeys());
- $this->assertEquals($brokenXml, (string) $result['baz']);
- }
-
- public function testVisitsAdditionalProperties()
- {
- $parser = OperationResponseParser::getInstance();
- $description = ServiceDescription::factory(array(
- 'operations' => array('test' => array('responseClass' => 'Foo')),
- 'models' => array(
- 'Foo' => array(
- 'type' => 'object',
- 'properties' => array(
- 'code' => array('location' => 'statusCode')
- ),
- 'additionalProperties' => array(
- 'location' => 'json',
- 'type' => 'object',
- 'properties' => array(
- 'a' => array(
- 'type' => 'string',
- 'filters' => 'strtoupper'
- )
- )
- )
- )
- )
- ));
-
- $operation = $description->getOperation('test');
- $op = new OperationCommand(array(), $operation);
- $op->setResponseParser($parser)->setClient(new Client());
- $json = '[{"a":"test"},{"a":"baz"}]';
- $op->prepare()->setResponse(new Response(200, array('Content-Type' => 'application/json'), $json), true);
- $result = $op->execute()->toArray();
- $this->assertEquals(array(
- 'code' => 200,
- array('a' => 'TEST'),
- array('a' => 'BAZ')
- ), $result);
- }
-
- /**
- * @group issue-399
- * @link https://github.com/guzzle/guzzle/issues/399
- */
- public function testAdditionalPropertiesDisabledDiscardsData()
- {
- $parser = OperationResponseParser::getInstance();
- $description = ServiceDescription::factory(array(
- 'operations' => array('test' => array('responseClass' => 'Foo')),
- 'models' => array(
- 'Foo' => array(
- 'type' => 'object',
- 'additionalProperties' => false,
- 'properties' => array(
- 'name' => array(
- 'location' => 'json',
- 'type' => 'string',
- ),
- 'nested' => array(
- 'location' => 'json',
- 'type' => 'object',
- 'additionalProperties' => false,
- 'properties' => array(
- 'width' => array(
- 'type' => 'integer'
- )
- ),
- ),
- 'code' => array('location' => 'statusCode')
- ),
-
- )
- )
- ));
-
- $operation = $description->getOperation('test');
- $op = new OperationCommand(array(), $operation);
- $op->setResponseParser($parser)->setClient(new Client());
- $json = '{"name":"test", "volume":2.0, "nested":{"width":10,"bogus":1}}';
- $op->prepare()->setResponse(new Response(200, array('Content-Type' => 'application/json'), $json), true);
- $result = $op->execute()->toArray();
- $this->assertEquals(array(
- 'name' => 'test',
- 'nested' => array(
- 'width' => 10,
- ),
- 'code' => 200
- ), $result);
- }
-
- public function testCreatesCustomResponseClassInterface()
- {
- $parser = OperationResponseParser::getInstance();
- $description = ServiceDescription::factory(array(
- 'operations' => array('test' => array('responseClass' => 'Guzzle\Tests\Mock\CustomResponseModel'))
- ));
- $operation = $description->getOperation('test');
- $op = new OperationCommand(array(), $operation);
- $op->setResponseParser($parser)->setClient(new Client());
- $op->prepare()->setResponse(new Response(200, array('Content-Type' => 'application/json'), 'hi!'), true);
- $result = $op->execute();
- $this->assertInstanceOf('Guzzle\Tests\Mock\CustomResponseModel', $result);
- $this->assertSame($op, $result->command);
- }
-
- /**
- * @expectedException \Guzzle\Service\Exception\ResponseClassException
- * @expectedExceptionMessage must exist
- */
- public function testEnsuresResponseClassExists()
- {
- $parser = OperationResponseParser::getInstance();
- $description = ServiceDescription::factory(array(
- 'operations' => array('test' => array('responseClass' => 'Foo\Baz\Bar'))
- ));
- $operation = $description->getOperation('test');
- $op = new OperationCommand(array(), $operation);
- $op->setResponseParser($parser)->setClient(new Client());
- $op->prepare()->setResponse(new Response(200, array('Content-Type' => 'application/json'), 'hi!'), true);
- $op->execute();
- }
-
- /**
- * @expectedException \Guzzle\Service\Exception\ResponseClassException
- * @expectedExceptionMessage and implement
- */
- public function testEnsuresResponseClassImplementsResponseClassInterface()
- {
- $parser = OperationResponseParser::getInstance();
- $description = ServiceDescription::factory(array(
- 'operations' => array('test' => array('responseClass' => __CLASS__))
- ));
- $operation = $description->getOperation('test');
- $op = new OperationCommand(array(), $operation);
- $op->setResponseParser($parser)->setClient(new Client());
- $op->prepare()->setResponse(new Response(200, array('Content-Type' => 'application/json'), 'hi!'), true);
- $op->execute();
- }
-
- protected function getDescription()
- {
- return ServiceDescription::factory(array(
- 'operations' => array('test' => array('responseClass' => 'Foo')),
- 'models' => array(
- 'Foo' => array(
- 'type' => 'object',
- 'properties' => array(
- 'baz' => array('type' => 'string', 'location' => 'json'),
- 'code' => array('location' => 'statusCode'),
- 'phrase' => array('location' => 'reasonPhrase'),
- )
- )
- )
- ));
- }
-
- public function testCanAddListenerToParseDomainObjects()
- {
- $client = new Client();
- $client->setDescription(ServiceDescription::factory(array(
- 'operations' => array('test' => array('responseClass' => 'FooBazBar'))
- )));
- $foo = new \stdClass();
- $client->getEventDispatcher()->addListener('command.parse_response', function ($e) use ($foo) {
- $e['result'] = $foo;
- });
- $command = $client->getCommand('test');
- $command->prepare()->setResponse(new Response(200), true);
- $result = $command->execute();
- $this->assertSame($result, $foo);
- }
-
- /**
- * @group issue-399
- * @link https://github.com/guzzle/guzzle/issues/501
- */
- public function testAdditionalPropertiesWithRefAreResolved()
- {
- $parser = OperationResponseParser::getInstance();
- $description = ServiceDescription::factory(array(
- 'operations' => array('test' => array('responseClass' => 'Foo')),
- 'models' => array(
- 'Baz' => array('type' => 'string'),
- 'Foo' => array(
- 'type' => 'object',
- 'additionalProperties' => array('$ref' => 'Baz', 'location' => 'json')
- )
- )
- ));
- $operation = $description->getOperation('test');
- $op = new OperationCommand(array(), $operation);
- $op->setResponseParser($parser)->setClient(new Client());
- $json = '{"a":"a","b":"b","c":"c"}';
- $op->prepare()->setResponse(new Response(200, array('Content-Type' => 'application/json'), $json), true);
- $result = $op->execute()->toArray();
- $this->assertEquals(array('a' => 'a', 'b' => 'b', 'c' => 'c'), $result);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/OperationTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/OperationTest.php
deleted file mode 100644
index ae33b69..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/OperationTest.php
+++ /dev/null
@@ -1,308 +0,0 @@
- 'test',
- 'summary' => 'doc',
- 'notes' => 'notes',
- 'documentationUrl' => 'http://www.example.com',
- 'httpMethod' => 'POST',
- 'uri' => '/api/v1',
- 'responseClass' => 'array',
- 'responseNotes' => 'returns the json_decoded response',
- 'deprecated' => true,
- 'parameters' => array(
- 'key' => array(
- 'required' => true,
- 'type' => 'string',
- 'maxLength' => 10
- ),
- 'key_2' => array(
- 'required' => true,
- 'type' => 'integer',
- 'default' => 10
- )
- )
- ));
-
- $this->assertEquals('test', $c->getName());
- $this->assertEquals('doc', $c->getSummary());
- $this->assertEquals('http://www.example.com', $c->getDocumentationUrl());
- $this->assertEquals('POST', $c->getHttpMethod());
- $this->assertEquals('/api/v1', $c->getUri());
- $this->assertEquals('array', $c->getResponseClass());
- $this->assertEquals('returns the json_decoded response', $c->getResponseNotes());
- $this->assertTrue($c->getDeprecated());
- $this->assertEquals('Guzzle\\Service\\Command\\OperationCommand', $c->getClass());
- $this->assertEquals(array(
- 'key' => new Parameter(array(
- 'name' => 'key',
- 'required' => true,
- 'type' => 'string',
- 'maxLength' => 10,
- 'parent' => $c
- )),
- 'key_2' => new Parameter(array(
- 'name' => 'key_2',
- 'required' => true,
- 'type' => 'integer',
- 'default' => 10,
- 'parent' => $c
- ))
- ), $c->getParams());
-
- $this->assertEquals(new Parameter(array(
- 'name' => 'key_2',
- 'required' => true,
- 'type' => 'integer',
- 'default' => 10,
- 'parent' => $c
- )), $c->getParam('key_2'));
-
- $this->assertNull($c->getParam('afefwef'));
- $this->assertArrayNotHasKey('parent', $c->getParam('key_2')->toArray());
- }
-
- public function testAllowsConcreteCommands()
- {
- $c = new Operation(array(
- 'name' => 'test',
- 'class' => 'Guzzle\\Service\\Command\ClosureCommand',
- 'parameters' => array(
- 'p' => new Parameter(array(
- 'name' => 'foo'
- ))
- )
- ));
- $this->assertEquals('Guzzle\\Service\\Command\ClosureCommand', $c->getClass());
- }
-
- public function testConvertsToArray()
- {
- $data = array(
- 'name' => 'test',
- 'class' => 'Guzzle\\Service\\Command\ClosureCommand',
- 'summary' => 'test',
- 'documentationUrl' => 'http://www.example.com',
- 'httpMethod' => 'PUT',
- 'uri' => '/',
- 'parameters' => array('p' => array('name' => 'foo'))
- );
- $c = new Operation($data);
- $toArray = $c->toArray();
- unset($data['name']);
- $this->assertArrayHasKey('parameters', $toArray);
- $this->assertInternalType('array', $toArray['parameters']);
-
- // Normalize the array
- unset($data['parameters']);
- unset($toArray['parameters']);
-
- $data['responseType'] = 'primitive';
- $data['responseClass'] = 'array';
- $this->assertEquals($data, $toArray);
- }
-
- public function testDeterminesIfHasParam()
- {
- $command = $this->getTestCommand();
- $this->assertTrue($command->hasParam('data'));
- $this->assertFalse($command->hasParam('baz'));
- }
-
- public function testReturnsParamNames()
- {
- $command = $this->getTestCommand();
- $this->assertEquals(array('data'), $command->getParamNames());
- }
-
- protected function getTestCommand()
- {
- return new Operation(array(
- 'parameters' => array(
- 'data' => new Parameter(array(
- 'type' => 'string'
- ))
- )
- ));
- }
-
- public function testCanBuildUpCommands()
- {
- $c = new Operation(array());
- $c->setName('foo')
- ->setClass('Baz')
- ->setDeprecated(false)
- ->setSummary('summary')
- ->setDocumentationUrl('http://www.foo.com')
- ->setHttpMethod('PUT')
- ->setResponseNotes('oh')
- ->setResponseClass('string')
- ->setUri('/foo/bar')
- ->addParam(new Parameter(array(
- 'name' => 'test'
- )));
-
- $this->assertEquals('foo', $c->getName());
- $this->assertEquals('Baz', $c->getClass());
- $this->assertEquals(false, $c->getDeprecated());
- $this->assertEquals('summary', $c->getSummary());
- $this->assertEquals('http://www.foo.com', $c->getDocumentationUrl());
- $this->assertEquals('PUT', $c->getHttpMethod());
- $this->assertEquals('oh', $c->getResponseNotes());
- $this->assertEquals('string', $c->getResponseClass());
- $this->assertEquals('/foo/bar', $c->getUri());
- $this->assertEquals(array('test'), $c->getParamNames());
- }
-
- public function testCanRemoveParams()
- {
- $c = new Operation(array());
- $c->addParam(new Parameter(array('name' => 'foo')));
- $this->assertTrue($c->hasParam('foo'));
- $c->removeParam('foo');
- $this->assertFalse($c->hasParam('foo'));
- }
-
- public function testAddsNameToParametersIfNeeded()
- {
- $command = new Operation(array('parameters' => array('foo' => new Parameter(array()))));
- $this->assertEquals('foo', $command->getParam('foo')->getName());
- }
-
- public function testContainsApiErrorInformation()
- {
- $command = $this->getOperation();
- $this->assertEquals(1, count($command->getErrorResponses()));
- $arr = $command->toArray();
- $this->assertEquals(1, count($arr['errorResponses']));
- $command->addErrorResponse(400, 'Foo', 'Baz\\Bar');
- $this->assertEquals(2, count($command->getErrorResponses()));
- $command->setErrorResponses(array());
- $this->assertEquals(0, count($command->getErrorResponses()));
- }
-
- public function testHasNotes()
- {
- $o = new Operation(array('notes' => 'foo'));
- $this->assertEquals('foo', $o->getNotes());
- $o->setNotes('bar');
- $this->assertEquals('bar', $o->getNotes());
- }
-
- public function testHasData()
- {
- $o = new Operation(array('data' => array('foo' => 'baz', 'bar' => 123)));
- $o->setData('test', false);
- $this->assertEquals('baz', $o->getData('foo'));
- $this->assertEquals(123, $o->getData('bar'));
- $this->assertNull($o->getData('wfefwe'));
- $this->assertEquals(array(
- 'parameters' => array(),
- 'class' => 'Guzzle\Service\Command\OperationCommand',
- 'data' => array('foo' => 'baz', 'bar' => 123, 'test' => false),
- 'responseClass' => 'array',
- 'responseType' => 'primitive'
- ), $o->toArray());
- }
-
- public function testHasServiceDescription()
- {
- $s = new ServiceDescription();
- $o = new Operation(array(), $s);
- $this->assertSame($s, $o->getServiceDescription());
- }
-
- /**
- * @expectedException Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testValidatesResponseType()
- {
- $o = new Operation(array('responseClass' => 'array', 'responseType' => 'foo'));
- }
-
- public function testInfersResponseType()
- {
- $o = $this->getOperation();
- $o->setServiceDescription(new ServiceDescription(array('models' => array('Foo' => array()))));
- $this->assertEquals('primitive', $o->getResponseType());
- $this->assertEquals('primitive', $o->setResponseClass('boolean')->getResponseType());
- $this->assertEquals('primitive', $o->setResponseClass('array')->getResponseType());
- $this->assertEquals('primitive', $o->setResponseClass('integer')->getResponseType());
- $this->assertEquals('primitive', $o->setResponseClass('string')->getResponseType());
- $this->assertEquals('class', $o->setResponseClass('foo')->getResponseType());
- $this->assertEquals('class', $o->setResponseClass(__CLASS__)->getResponseType());
- $this->assertEquals('model', $o->setResponseClass('Foo')->getResponseType());
- }
-
- public function testHasResponseType()
- {
- // infers in the constructor
- $o = new Operation(array('responseClass' => 'array'));
- $this->assertEquals('primitive', $o->getResponseType());
- // Infers when set
- $o = new Operation();
- $this->assertEquals('primitive', $o->getResponseType());
- $this->assertEquals('model', $o->setResponseType('model')->getResponseType());
- }
-
- public function testHasAdditionalParameters()
- {
- $o = new Operation(array(
- 'additionalParameters' => array(
- 'type' => 'string', 'name' => 'binks'
- ),
- 'parameters' => array(
- 'foo' => array('type' => 'integer')
- )
- ));
- $this->assertEquals('string', $o->getAdditionalParameters()->getType());
- $arr = $o->toArray();
- $this->assertEquals(array(
- 'type' => 'string'
- ), $arr['additionalParameters']);
- }
-
- /**
- * @return Operation
- */
- protected function getOperation()
- {
- return new Operation(array(
- 'name' => 'OperationTest',
- 'class' => get_class($this),
- 'parameters' => array(
- 'test' => array('type' => 'object'),
- 'bool_1' => array('default' => true, 'type' => 'boolean'),
- 'bool_2' => array('default' => false),
- 'float' => array('type' => 'numeric'),
- 'int' => array('type' => 'integer'),
- 'date' => array('type' => 'string'),
- 'timestamp' => array('type' => 'string'),
- 'string' => array('type' => 'string'),
- 'username' => array('type' => 'string', 'required' => true, 'filters' => 'strtolower'),
- 'test_function' => array('type' => 'string', 'filters' => __CLASS__ . '::strtoupper')
- ),
- 'errorResponses' => array(
- array('code' => 503, 'reason' => 'InsufficientCapacity', 'class' => 'Guzzle\\Exception\\RuntimeException')
- )
- ));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/ParameterTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/ParameterTest.php
deleted file mode 100644
index b9c162a..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/ParameterTest.php
+++ /dev/null
@@ -1,411 +0,0 @@
- 'foo',
- 'type' => 'bar',
- 'required' => true,
- 'default' => '123',
- 'description' => '456',
- 'minLength' => 2,
- 'maxLength' => 5,
- 'location' => 'body',
- 'static' => 'static!',
- 'filters' => array('trim', 'json_encode')
- );
-
- public function testCreatesParamFromArray()
- {
- $p = new Parameter($this->data);
- $this->assertEquals('foo', $p->getName());
- $this->assertEquals('bar', $p->getType());
- $this->assertEquals(true, $p->getRequired());
- $this->assertEquals('123', $p->getDefault());
- $this->assertEquals('456', $p->getDescription());
- $this->assertEquals(2, $p->getMinLength());
- $this->assertEquals(5, $p->getMaxLength());
- $this->assertEquals('body', $p->getLocation());
- $this->assertEquals('static!', $p->getStatic());
- $this->assertEquals(array('trim', 'json_encode'), $p->getFilters());
- }
-
- public function testCanConvertToArray()
- {
- $p = new Parameter($this->data);
- unset($this->data['name']);
- $this->assertEquals($this->data, $p->toArray());
- }
-
- public function testUsesStatic()
- {
- $d = $this->data;
- $d['default'] = 'booboo';
- $d['static'] = true;
- $p = new Parameter($d);
- $this->assertEquals('booboo', $p->getValue('bar'));
- }
-
- public function testUsesDefault()
- {
- $d = $this->data;
- $d['default'] = 'foo';
- $d['static'] = null;
- $p = new Parameter($d);
- $this->assertEquals('foo', $p->getValue(null));
- }
-
- public function testReturnsYourValue()
- {
- $d = $this->data;
- $d['static'] = null;
- $p = new Parameter($d);
- $this->assertEquals('foo', $p->getValue('foo'));
- }
-
- public function testZeroValueDoesNotCauseDefaultToBeReturned()
- {
- $d = $this->data;
- $d['default'] = '1';
- $d['static'] = null;
- $p = new Parameter($d);
- $this->assertEquals('0', $p->getValue('0'));
- }
-
- public function testFiltersValues()
- {
- $d = $this->data;
- $d['static'] = null;
- $d['filters'] = 'strtoupper';
- $p = new Parameter($d);
- $this->assertEquals('FOO', $p->filter('foo'));
- }
-
- public function testConvertsBooleans()
- {
- $p = new Parameter(array('type' => 'boolean'));
- $this->assertEquals(true, $p->filter('true'));
- $this->assertEquals(false, $p->filter('false'));
- }
-
- public function testUsesArrayByDefaultForFilters()
- {
- $d = $this->data;
- $d['filters'] = null;
- $p = new Parameter($d);
- $this->assertEquals(array(), $p->getFilters());
- }
-
- public function testAllowsSimpleLocationValue()
- {
- $p = new Parameter(array('name' => 'myname', 'location' => 'foo', 'sentAs' => 'Hello'));
- $this->assertEquals('foo', $p->getLocation());
- $this->assertEquals('Hello', $p->getSentAs());
- }
-
- public function testParsesTypeValues()
- {
- $p = new Parameter(array('type' => 'foo'));
- $this->assertEquals('foo', $p->getType());
- }
-
- /**
- * @expectedException InvalidArgumentException
- * @expectedExceptionMessage A [method] value must be specified for each complex filter
- */
- public function testValidatesComplexFilters()
- {
- $p = new Parameter(array('filters' => array(array('args' => 'foo'))));
- }
-
- public function testCanBuildUpParams()
- {
- $p = new Parameter(array());
- $p->setName('foo')
- ->setDescription('c')
- ->setFilters(array('d'))
- ->setLocation('e')
- ->setSentAs('f')
- ->setMaxLength(1)
- ->setMinLength(1)
- ->setMinimum(2)
- ->setMaximum(2)
- ->setMinItems(3)
- ->setMaxItems(3)
- ->setRequired(true)
- ->setStatic(true)
- ->setDefault('h')
- ->setType('i');
-
- $p->addFilter('foo');
-
- $this->assertEquals('foo', $p->getName());
- $this->assertEquals('h', $p->getDefault());
- $this->assertEquals('c', $p->getDescription());
- $this->assertEquals(array('d', 'foo'), $p->getFilters());
- $this->assertEquals('e', $p->getLocation());
- $this->assertEquals('f', $p->getSentAs());
- $this->assertEquals(1, $p->getMaxLength());
- $this->assertEquals(1, $p->getMinLength());
- $this->assertEquals(2, $p->getMaximum());
- $this->assertEquals(2, $p->getMinimum());
- $this->assertEquals(3, $p->getMaxItems());
- $this->assertEquals(3, $p->getMinItems());
- $this->assertEquals(true, $p->getRequired());
- $this->assertEquals(true, $p->getStatic());
- $this->assertEquals('i', $p->getType());
- }
-
- public function testAllowsNestedShape()
- {
- $command = $this->getServiceBuilder()->get('mock')->getCommand('mock_command')->getOperation();
- $param = new Parameter(array(
- 'parent' => $command,
- 'name' => 'foo',
- 'type' => 'object',
- 'location' => 'query',
- 'properties' => array(
- 'foo' => array(
- 'type' => 'object',
- 'required' => true,
- 'properties' => array(
- 'baz' => array(
- 'name' => 'baz',
- 'type' => 'bool',
- )
- )
- ),
- 'bar' => array(
- 'name' => 'bar',
- 'default' => '123'
- )
- )
- ));
-
- $this->assertSame($command, $param->getParent());
- $this->assertNotEmpty($param->getProperties());
- $this->assertInstanceOf('Guzzle\Service\Description\Parameter', $param->getProperty('foo'));
- $this->assertSame($param, $param->getProperty('foo')->getParent());
- $this->assertSame($param->getProperty('foo'), $param->getProperty('foo')->getProperty('baz')->getParent());
- $this->assertInstanceOf('Guzzle\Service\Description\Parameter', $param->getProperty('bar'));
- $this->assertSame($param, $param->getProperty('bar')->getParent());
-
- $array = $param->toArray();
- $this->assertInternalType('array', $array['properties']);
- $this->assertArrayHasKey('foo', $array['properties']);
- $this->assertArrayHasKey('bar', $array['properties']);
- }
-
- public function testAllowsComplexFilters()
- {
- $that = $this;
- $param = new Parameter(array());
- $param->setFilters(array(array('method' => function ($a, $b, $c, $d) use ($that, $param) {
- $that->assertEquals('test', $a);
- $that->assertEquals('my_value!', $b);
- $that->assertEquals('bar', $c);
- $that->assertSame($param, $d);
- return 'abc' . $b;
- }, 'args' => array('test', '@value', 'bar', '@api'))));
- $this->assertEquals('abcmy_value!', $param->filter('my_value!'));
- }
-
- public function testCanChangeParentOfNestedParameter()
- {
- $param1 = new Parameter(array('name' => 'parent'));
- $param2 = new Parameter(array('name' => 'child'));
- $param2->setParent($param1);
- $this->assertSame($param1, $param2->getParent());
- }
-
- public function testCanRemoveFromNestedStructure()
- {
- $param1 = new Parameter(array('name' => 'parent'));
- $param2 = new Parameter(array('name' => 'child'));
- $param1->addProperty($param2);
- $this->assertSame($param1, $param2->getParent());
- $this->assertSame($param2, $param1->getProperty('child'));
-
- // Remove a single child from the structure
- $param1->removeProperty('child');
- $this->assertNull($param1->getProperty('child'));
- // Remove the entire structure
- $param1->addProperty($param2);
- $param1->removeProperty('child');
- $this->assertNull($param1->getProperty('child'));
- }
-
- public function testAddsAdditionalProperties()
- {
- $p = new Parameter(array(
- 'type' => 'object',
- 'additionalProperties' => array('type' => 'string')
- ));
- $this->assertInstanceOf('Guzzle\Service\Description\Parameter', $p->getAdditionalProperties());
- $this->assertNull($p->getAdditionalProperties()->getAdditionalProperties());
- $p = new Parameter(array('type' => 'object'));
- $this->assertTrue($p->getAdditionalProperties());
- }
-
- public function testAddsItems()
- {
- $p = new Parameter(array(
- 'type' => 'array',
- 'items' => array('type' => 'string')
- ));
- $this->assertInstanceOf('Guzzle\Service\Description\Parameter', $p->getItems());
- $out = $p->toArray();
- $this->assertEquals('array', $out['type']);
- $this->assertInternalType('array', $out['items']);
- }
-
- public function testHasExtraProperties()
- {
- $p = new Parameter();
- $this->assertEquals(array(), $p->getData());
- $p->setData(array('foo' => 'bar'));
- $this->assertEquals('bar', $p->getData('foo'));
- $p->setData('baz', 'boo');
- $this->assertEquals(array('foo' => 'bar', 'baz' => 'boo'), $p->getData());
- }
-
- public function testCanRetrieveKnownPropertiesUsingDataMethod()
- {
- $p = new Parameter();
- $this->assertEquals(null, $p->getData('foo'));
- $p->setName('test');
- $this->assertEquals('test', $p->getData('name'));
- }
-
- public function testHasInstanceOf()
- {
- $p = new Parameter();
- $this->assertNull($p->getInstanceOf());
- $p->setInstanceOf('Foo');
- $this->assertEquals('Foo', $p->getInstanceOf());
- }
-
- public function testHasPattern()
- {
- $p = new Parameter();
- $this->assertNull($p->getPattern());
- $p->setPattern('/[0-9]+/');
- $this->assertEquals('/[0-9]+/', $p->getPattern());
- }
-
- public function testHasEnum()
- {
- $p = new Parameter();
- $this->assertNull($p->getEnum());
- $p->setEnum(array('foo', 'bar'));
- $this->assertEquals(array('foo', 'bar'), $p->getEnum());
- }
-
- public function testSerializesItems()
- {
- $p = new Parameter(array(
- 'type' => 'object',
- 'additionalProperties' => array('type' => 'string')
- ));
- $this->assertEquals(array(
- 'type' => 'object',
- 'additionalProperties' => array('type' => 'string')
- ), $p->toArray());
- }
-
- public function testResolvesRefKeysRecursively()
- {
- $description = new ServiceDescription(array(
- 'models' => array(
- 'JarJar' => array('type' => 'string', 'default' => 'Mesa address tha senate!'),
- 'Anakin' => array('type' => 'array', 'items' => array('$ref' => 'JarJar'))
- )
- ));
- $p = new Parameter(array('$ref' => 'Anakin', 'description' => 'added'), $description);
- $this->assertEquals(array(
- 'type' => 'array',
- 'items' => array('type' => 'string', 'default' => 'Mesa address tha senate!'),
- 'description' => 'added'
- ), $p->toArray());
- }
-
- public function testResolvesExtendsRecursively()
- {
- $jarJar = array('type' => 'string', 'default' => 'Mesa address tha senate!', 'description' => 'a');
- $anakin = array('type' => 'array', 'items' => array('extends' => 'JarJar', 'description' => 'b'));
- $description = new ServiceDescription(array(
- 'models' => array('JarJar' => $jarJar, 'Anakin' => $anakin)
- ));
- // Description attribute will be updated, and format added
- $p = new Parameter(array('extends' => 'Anakin', 'format' => 'date'), $description);
- $this->assertEquals(array(
- 'type' => 'array',
- 'format' => 'date',
- 'items' => array(
- 'type' => 'string',
- 'default' => 'Mesa address tha senate!',
- 'description' => 'b'
- )
- ), $p->toArray());
- }
-
- public function testHasKeyMethod()
- {
- $p = new Parameter(array('name' => 'foo', 'sentAs' => 'bar'));
- $this->assertEquals('bar', $p->getWireName());
- $p->setSentAs(null);
- $this->assertEquals('foo', $p->getWireName());
- }
-
- public function testIncludesNameInToArrayWhenItemsAttributeHasName()
- {
- $p = new Parameter(array(
- 'type' => 'array',
- 'name' => 'Abc',
- 'items' => array(
- 'name' => 'Foo',
- 'type' => 'object'
- )
- ));
- $result = $p->toArray();
- $this->assertEquals(array(
- 'type' => 'array',
- 'items' => array(
- 'name' => 'Foo',
- 'type' => 'object',
- 'additionalProperties' => true
- )
- ), $result);
- }
-
- public function dateTimeProvider()
- {
- $d = 'October 13, 2012 16:15:46 UTC';
-
- return array(
- array($d, 'date-time', '2012-10-13T16:15:46Z'),
- array($d, 'date', '2012-10-13'),
- array($d, 'timestamp', strtotime($d)),
- array(new \DateTime($d), 'timestamp', strtotime($d))
- );
- }
-
- /**
- * @dataProvider dateTimeProvider
- */
- public function testAppliesFormat($d, $format, $result)
- {
- $p = new Parameter();
- $p->setFormat($format);
- $this->assertEquals($format, $p->getFormat());
- $this->assertEquals($result, $p->filter($d));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/SchemaFormatterTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/SchemaFormatterTest.php
deleted file mode 100644
index eb3619b..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/SchemaFormatterTest.php
+++ /dev/null
@@ -1,61 +0,0 @@
-assertEquals($result, SchemaFormatter::format($format, $value));
- }
-
- /**
- * @expectedException \Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testValidatesDateTimeInput()
- {
- SchemaFormatter::format('date-time', false);
- }
-
- public function testEnsuresTimestampsAreIntegers()
- {
- $t = time();
- $result = SchemaFormatter::format('timestamp', $t);
- $this->assertSame($t, $result);
- $this->assertInternalType('int', $result);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/SchemaValidatorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/SchemaValidatorTest.php
deleted file mode 100644
index 4d6cc87..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/SchemaValidatorTest.php
+++ /dev/null
@@ -1,326 +0,0 @@
-validator = new SchemaValidator();
- }
-
- public function testValidatesArrayListsAreNumericallyIndexed()
- {
- $value = array(array(1));
- $this->assertFalse($this->validator->validate($this->getComplexParam(), $value));
- $this->assertEquals(
- array('[Foo][0] must be an array of properties. Got a numerically indexed array.'),
- $this->validator->getErrors()
- );
- }
-
- public function testValidatesArrayListsContainProperItems()
- {
- $value = array(true);
- $this->assertFalse($this->validator->validate($this->getComplexParam(), $value));
- $this->assertEquals(
- array('[Foo][0] must be of type object'),
- $this->validator->getErrors()
- );
- }
-
- public function testAddsDefaultValuesInLists()
- {
- $value = array(array());
- $this->assertTrue($this->validator->validate($this->getComplexParam(), $value));
- $this->assertEquals(array(array('Bar' => true)), $value);
- }
-
- public function testMergesDefaultValuesInLists()
- {
- $value = array(
- array('Baz' => 'hello!'),
- array('Bar' => false)
- );
- $this->assertTrue($this->validator->validate($this->getComplexParam(), $value));
- $this->assertEquals(array(
- array(
- 'Baz' => 'hello!',
- 'Bar' => true
- ),
- array('Bar' => false)
- ), $value);
- }
-
- public function testCorrectlyConvertsParametersToArrayWhenArraysArePresent()
- {
- $param = $this->getComplexParam();
- $result = $param->toArray();
- $this->assertInternalType('array', $result['items']);
- $this->assertEquals('array', $result['type']);
- $this->assertInstanceOf('Guzzle\Service\Description\Parameter', $param->getItems());
- }
-
- public function testAllowsInstanceOf()
- {
- $p = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'instanceOf' => get_class($this)
- ));
- $this->assertTrue($this->validator->validate($p, $this));
- $this->assertFalse($this->validator->validate($p, $p));
- $this->assertEquals(array('[foo] must be an instance of ' . __CLASS__), $this->validator->getErrors());
- }
-
- public function testEnforcesInstanceOfOnlyWhenObject()
- {
- $p = new Parameter(array(
- 'name' => 'foo',
- 'type' => array('object', 'string'),
- 'instanceOf' => get_class($this)
- ));
- $this->assertTrue($this->validator->validate($p, $this));
- $s = 'test';
- $this->assertTrue($this->validator->validate($p, $s));
- }
-
- public function testConvertsObjectsToArraysWhenToArrayInterface()
- {
- $o = $this->getMockBuilder('Guzzle\Common\ToArrayInterface')
- ->setMethods(array('toArray'))
- ->getMockForAbstractClass();
- $o->expects($this->once())
- ->method('toArray')
- ->will($this->returnValue(array(
- 'foo' => 'bar'
- )));
- $p = new Parameter(array(
- 'name' => 'test',
- 'type' => 'object',
- 'properties' => array(
- 'foo' => array('required' => 'true')
- )
- ));
- $this->assertTrue($this->validator->validate($p, $o));
- }
-
- public function testMergesValidationErrorsInPropertiesWithParent()
- {
- $p = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'properties' => array(
- 'bar' => array('type' => 'string', 'required' => true, 'description' => 'This is what it does'),
- 'test' => array('type' => 'string', 'minLength' => 2, 'maxLength' => 5),
- 'test2' => array('type' => 'string', 'minLength' => 2, 'maxLength' => 2),
- 'test3' => array('type' => 'integer', 'minimum' => 100),
- 'test4' => array('type' => 'integer', 'maximum' => 10),
- 'test5' => array('type' => 'array', 'maxItems' => 2),
- 'test6' => array('type' => 'string', 'enum' => array('a', 'bc')),
- 'test7' => array('type' => 'string', 'pattern' => '/[0-9]+/'),
- 'test8' => array('type' => 'number'),
- 'baz' => array(
- 'type' => 'array',
- 'minItems' => 2,
- 'required' => true,
- "items" => array("type" => "string")
- )
- )
- ));
-
- $value = array(
- 'test' => 'a',
- 'test2' => 'abc',
- 'baz' => array(false),
- 'test3' => 10,
- 'test4' => 100,
- 'test5' => array(1, 3, 4),
- 'test6' => 'Foo',
- 'test7' => 'abc',
- 'test8' => 'abc'
- );
-
- $this->assertFalse($this->validator->validate($p, $value));
- $this->assertEquals(array (
- '[foo][bar] is a required string: This is what it does',
- '[foo][baz] must contain 2 or more elements',
- '[foo][baz][0] must be of type string',
- '[foo][test2] length must be less than or equal to 2',
- '[foo][test3] must be greater than or equal to 100',
- '[foo][test4] must be less than or equal to 10',
- '[foo][test5] must contain 2 or fewer elements',
- '[foo][test6] must be one of "a" or "bc"',
- '[foo][test7] must match the following regular expression: /[0-9]+/',
- '[foo][test8] must be of type number',
- '[foo][test] length must be greater than or equal to 2',
- ), $this->validator->getErrors());
- }
-
- public function testHandlesNullValuesInArraysWithDefaults()
- {
- $p = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'required' => true,
- 'properties' => array(
- 'bar' => array(
- 'type' => 'object',
- 'required' => true,
- 'properties' => array(
- 'foo' => array('default' => 'hi')
- )
- )
- )
- ));
- $value = array();
- $this->assertTrue($this->validator->validate($p, $value));
- $this->assertEquals(array('bar' => array('foo' => 'hi')), $value);
- }
-
- public function testFailsWhenNullValuesInArraysWithNoDefaults()
- {
- $p = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'required' => true,
- 'properties' => array(
- 'bar' => array(
- 'type' => 'object',
- 'required' => true,
- 'properties' => array('foo' => array('type' => 'string'))
- )
- )
- ));
- $value = array();
- $this->assertFalse($this->validator->validate($p, $value));
- $this->assertEquals(array('[foo][bar] is a required object'), $this->validator->getErrors());
- }
-
- public function testChecksTypes()
- {
- $p = new SchemaValidator();
- $r = new \ReflectionMethod($p, 'determineType');
- $r->setAccessible(true);
- $this->assertEquals('any', $r->invoke($p, 'any', 'hello'));
- $this->assertEquals(false, $r->invoke($p, 'foo', 'foo'));
- $this->assertEquals('string', $r->invoke($p, 'string', 'hello'));
- $this->assertEquals(false, $r->invoke($p, 'string', false));
- $this->assertEquals('integer', $r->invoke($p, 'integer', 1));
- $this->assertEquals(false, $r->invoke($p, 'integer', 'abc'));
- $this->assertEquals('numeric', $r->invoke($p, 'numeric', 1));
- $this->assertEquals('numeric', $r->invoke($p, 'numeric', '1'));
- $this->assertEquals('number', $r->invoke($p, 'number', 1));
- $this->assertEquals('number', $r->invoke($p, 'number', '1'));
- $this->assertEquals(false, $r->invoke($p, 'numeric', 'a'));
- $this->assertEquals('boolean', $r->invoke($p, 'boolean', true));
- $this->assertEquals('boolean', $r->invoke($p, 'boolean', false));
- $this->assertEquals(false, $r->invoke($p, 'boolean', 'false'));
- $this->assertEquals('null', $r->invoke($p, 'null', null));
- $this->assertEquals(false, $r->invoke($p, 'null', 'abc'));
- $this->assertEquals('array', $r->invoke($p, 'array', array()));
- $this->assertEquals(false, $r->invoke($p, 'array', 'foo'));
- }
-
- public function testValidatesFalseAdditionalProperties()
- {
- $param = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'properties' => array('bar' => array('type' => 'string')),
- 'additionalProperties' => false
- ));
- $value = array('test' => '123');
- $this->assertFalse($this->validator->validate($param, $value));
- $this->assertEquals(array('[foo][test] is not an allowed property'), $this->validator->getErrors());
- $value = array('bar' => '123');
- $this->assertTrue($this->validator->validate($param, $value));
- }
-
- public function testAllowsUndefinedAdditionalProperties()
- {
- $param = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'properties' => array('bar' => array('type' => 'string'))
- ));
- $value = array('test' => '123');
- $this->assertTrue($this->validator->validate($param, $value));
- }
-
- public function testValidatesAdditionalProperties()
- {
- $param = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'properties' => array('bar' => array('type' => 'string')),
- 'additionalProperties' => array('type' => 'integer')
- ));
- $value = array('test' => 'foo');
- $this->assertFalse($this->validator->validate($param, $value));
- $this->assertEquals(array('[foo][test] must be of type integer'), $this->validator->getErrors());
- }
-
- public function testValidatesAdditionalPropertiesThatArrayArrays()
- {
- $param = new Parameter(array(
- 'name' => 'foo',
- 'type' => 'object',
- 'additionalProperties' => array(
- 'type' => 'array',
- 'items' => array('type' => 'string')
- )
- ));
- $value = array('test' => array(true));
- $this->assertFalse($this->validator->validate($param, $value));
- $this->assertEquals(array('[foo][test][0] must be of type string'), $this->validator->getErrors());
- }
-
- public function testIntegersCastToStringWhenTypeMismatch()
- {
- $param = new Parameter(array('name' => 'test', 'type' => 'string'));
- $value = 12;
- $this->assertTrue($this->validator->validate($param, $value));
- $this->assertEquals('12', $value);
- }
-
- public function testRequiredMessageIncludesType()
- {
- $param = new Parameter(array('name' => 'test', 'type' => array('string', 'boolean'), 'required' => true));
- $value = null;
- $this->assertFalse($this->validator->validate($param, $value));
- $this->assertEquals(array('[test] is a required string or boolean'), $this->validator->getErrors());
- }
-
- protected function getComplexParam()
- {
- return new Parameter(array(
- 'name' => 'Foo',
- 'type' => 'array',
- 'required' => true,
- 'min' => 1,
- 'items' => array(
- 'type' => 'object',
- 'properties' => array(
- 'Baz' => array(
- 'type' => 'string',
- ),
- 'Bar' => array(
- 'required' => true,
- 'type' => 'boolean',
- 'default' => true
- )
- )
- )
- ));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/ServiceDescriptionLoaderTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/ServiceDescriptionLoaderTest.php
deleted file mode 100644
index bbfd1d6..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/ServiceDescriptionLoaderTest.php
+++ /dev/null
@@ -1,177 +0,0 @@
- true,
- 'baz' => array('bar'),
- 'apiVersion' => '123',
- 'operations' => array()
- ));
-
- $this->assertEquals(true, $d->getData('foo'));
- $this->assertEquals(array('bar'), $d->getData('baz'));
- $this->assertEquals('123', $d->getApiVersion());
- }
-
- public function testAllowsDeepNestedInheritance()
- {
- $d = ServiceDescription::factory(array(
- 'operations' => array(
- 'abstract' => array(
- 'httpMethod' => 'HEAD',
- 'parameters' => array(
- 'test' => array('type' => 'string', 'required' => true)
- )
- ),
- 'abstract2' => array('uri' => '/test', 'extends' => 'abstract'),
- 'concrete' => array('extends' => 'abstract2'),
- 'override' => array('extends' => 'abstract', 'httpMethod' => 'PUT'),
- 'override2' => array('extends' => 'override', 'httpMethod' => 'POST', 'uri' => '/')
- )
- ));
-
- $c = $d->getOperation('concrete');
- $this->assertEquals('/test', $c->getUri());
- $this->assertEquals('HEAD', $c->getHttpMethod());
- $params = $c->getParams();
- $param = $params['test'];
- $this->assertEquals('string', $param->getType());
- $this->assertTrue($param->getRequired());
-
- // Ensure that merging HTTP method does not make an array
- $this->assertEquals('PUT', $d->getOperation('override')->getHttpMethod());
- $this->assertEquals('POST', $d->getOperation('override2')->getHttpMethod());
- $this->assertEquals('/', $d->getOperation('override2')->getUri());
- }
-
- /**
- * @expectedException RuntimeException
- */
- public function testThrowsExceptionWhenExtendingMissingCommand()
- {
- ServiceDescription::factory(array(
- 'operations' => array(
- 'concrete' => array(
- 'extends' => 'missing'
- )
- )
- ));
- }
-
- public function testAllowsMultipleInheritance()
- {
- $description = ServiceDescription::factory(array(
- 'operations' => array(
- 'a' => array(
- 'httpMethod' => 'GET',
- 'parameters' => array(
- 'a1' => array(
- 'default' => 'foo',
- 'required' => true,
- 'prepend' => 'hi'
- )
- )
- ),
- 'b' => array(
- 'extends' => 'a',
- 'parameters' => array(
- 'b2' => array()
- )
- ),
- 'c' => array(
- 'parameters' => array(
- 'a1' => array(
- 'default' => 'bar',
- 'required' => true,
- 'description' => 'test'
- ),
- 'c3' => array()
- )
- ),
- 'd' => array(
- 'httpMethod' => 'DELETE',
- 'extends' => array('b', 'c'),
- 'parameters' => array(
- 'test' => array()
- )
- )
- )
- ));
-
- $command = $description->getOperation('d');
- $this->assertEquals('DELETE', $command->getHttpMethod());
- $this->assertContains('a1', $command->getParamNames());
- $this->assertContains('b2', $command->getParamNames());
- $this->assertContains('c3', $command->getParamNames());
- $this->assertContains('test', $command->getParamNames());
-
- $this->assertTrue($command->getParam('a1')->getRequired());
- $this->assertEquals('bar', $command->getParam('a1')->getDefault());
- $this->assertEquals('test', $command->getParam('a1')->getDescription());
- }
-
- public function testAddsOtherFields()
- {
- $description = ServiceDescription::factory(array(
- 'operations' => array(),
- 'description' => 'Foo',
- 'apiVersion' => 'bar'
- ));
- $this->assertEquals('Foo', $description->getDescription());
- $this->assertEquals('bar', $description->getApiVersion());
- }
-
- public function testCanLoadNestedExtends()
- {
- $description = ServiceDescription::factory(array(
- 'operations' => array(
- 'root' => array(
- 'class' => 'foo'
- ),
- 'foo' => array(
- 'extends' => 'root',
- 'parameters' => array(
- 'baz' => array('type' => 'string')
- )
- ),
- 'foo_2' => array(
- 'extends' => 'foo',
- 'parameters' => array(
- 'bar' => array('type' => 'string')
- )
- ),
- 'foo_3' => array(
- 'class' => 'bar',
- 'parameters' => array(
- 'bar2' => array('type' => 'string')
- )
- ),
- 'foo_4' => array(
- 'extends' => array('foo_2', 'foo_3'),
- 'parameters' => array(
- 'bar3' => array('type' => 'string')
- )
- )
- )
- ));
-
- $this->assertTrue($description->hasOperation('foo_4'));
- $foo4 = $description->getOperation('foo_4');
- $this->assertTrue($foo4->hasParam('baz'));
- $this->assertTrue($foo4->hasParam('bar'));
- $this->assertTrue($foo4->hasParam('bar2'));
- $this->assertTrue($foo4->hasParam('bar3'));
- $this->assertEquals('bar', $foo4->getClass());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/ServiceDescriptionTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/ServiceDescriptionTest.php
deleted file mode 100644
index ff25452..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Description/ServiceDescriptionTest.php
+++ /dev/null
@@ -1,240 +0,0 @@
-serviceData = array(
- 'test_command' => new Operation(array(
- 'name' => 'test_command',
- 'description' => 'documentationForCommand',
- 'httpMethod' => 'DELETE',
- 'class' => 'Guzzle\\Tests\\Service\\Mock\\Command\\MockCommand',
- 'parameters' => array(
- 'bucket' => array('required' => true),
- 'key' => array('required' => true)
- )
- ))
- );
- }
-
- /**
- * @covers Guzzle\Service\Description\ServiceDescription::factory
- * @covers Guzzle\Service\Description\ServiceDescriptionLoader::build
- */
- public function testFactoryDelegatesToConcreteFactories()
- {
- $jsonFile = __DIR__ . '/../../TestData/test_service.json';
- $this->assertInstanceOf('Guzzle\Service\Description\ServiceDescription', ServiceDescription::factory($jsonFile));
- }
-
- public function testConstructor()
- {
- $service = new ServiceDescription(array('operations' => $this->serviceData));
- $this->assertEquals(1, count($service->getOperations()));
- $this->assertFalse($service->hasOperation('foobar'));
- $this->assertTrue($service->hasOperation('test_command'));
- }
-
- public function testIsSerializable()
- {
- $service = new ServiceDescription(array('operations' => $this->serviceData));
- $data = serialize($service);
- $d2 = unserialize($data);
- $this->assertEquals(serialize($service), serialize($d2));
- }
-
- public function testSerializesParameters()
- {
- $service = new ServiceDescription(array(
- 'operations' => array(
- 'foo' => new Operation(array('parameters' => array('foo' => array('type' => 'string'))))
- )
- ));
- $serialized = serialize($service);
- $this->assertContains('"parameters":{"foo":', $serialized);
- $service = unserialize($serialized);
- $this->assertTrue($service->getOperation('foo')->hasParam('foo'));
- }
-
- public function testAllowsForJsonBasedArrayParamsFunctionalTest()
- {
- $description = new ServiceDescription(array(
- 'operations' => array(
- 'test' => new Operation(array(
- 'httpMethod' => 'PUT',
- 'parameters' => array(
- 'data' => array(
- 'required' => true,
- 'filters' => 'json_encode',
- 'location' => 'body'
- )
- )
- ))
- )
- ));
- $client = new Client();
- $client->setDescription($description);
- $command = $client->getCommand('test', array(
- 'data' => array(
- 'foo' => 'bar'
- )
- ));
-
- $request = $command->prepare();
- $this->assertEquals('{"foo":"bar"}', (string) $request->getBody());
- }
-
- public function testContainsModels()
- {
- $d = new ServiceDescription(array(
- 'operations' => array('foo' => array()),
- 'models' => array(
- 'Tag' => array('type' => 'object'),
- 'Person' => array('type' => 'object')
- )
- ));
- $this->assertTrue($d->hasModel('Tag'));
- $this->assertTrue($d->hasModel('Person'));
- $this->assertFalse($d->hasModel('Foo'));
- $this->assertInstanceOf('Guzzle\Service\Description\Parameter', $d->getModel('Tag'));
- $this->assertNull($d->getModel('Foo'));
- $this->assertContains('"models":{', serialize($d));
- $this->assertEquals(array('Tag', 'Person'), array_keys($d->getModels()));
- }
-
- public function testCanAddModels()
- {
- $d = new ServiceDescription(array());
- $this->assertFalse($d->hasModel('Foo'));
- $d->addModel(new Parameter(array('name' => 'Foo')));
- $this->assertTrue($d->hasModel('Foo'));
- }
-
- public function testHasAttributes()
- {
- $d = new ServiceDescription(array(
- 'operations' => array(),
- 'name' => 'Name',
- 'description' => 'Description',
- 'apiVersion' => '1.24'
- ));
-
- $this->assertEquals('Name', $d->getName());
- $this->assertEquals('Description', $d->getDescription());
- $this->assertEquals('1.24', $d->getApiVersion());
-
- $s = serialize($d);
- $this->assertContains('"name":"Name"', $s);
- $this->assertContains('"description":"Description"', $s);
- $this->assertContains('"apiVersion":"1.24"', $s);
-
- $d = unserialize($s);
- $this->assertEquals('Name', $d->getName());
- $this->assertEquals('Description', $d->getDescription());
- $this->assertEquals('1.24', $d->getApiVersion());
- }
-
- public function testPersistsCustomAttributes()
- {
- $data = array(
- 'operations' => array('foo' => array('class' => 'foo', 'parameters' => array())),
- 'name' => 'Name',
- 'description' => 'Test',
- 'apiVersion' => '1.24',
- 'auth' => 'foo',
- 'keyParam' => 'bar'
- );
- $d = new ServiceDescription($data);
- $d->setData('hello', 'baz');
- $this->assertEquals('foo', $d->getData('auth'));
- $this->assertEquals('baz', $d->getData('hello'));
- $this->assertEquals('bar', $d->getData('keyParam'));
- // responseClass and responseType are added by default
- $data['operations']['foo']['responseClass'] = 'array';
- $data['operations']['foo']['responseType'] = 'primitive';
- $this->assertEquals($data + array('hello' => 'baz'), json_decode($d->serialize(), true));
- }
-
- public function testHasToArray()
- {
- $data = array(
- 'operations' => array(),
- 'name' => 'Name',
- 'description' => 'Test'
- );
- $d = new ServiceDescription($data);
- $arr = $d->toArray();
- $this->assertEquals('Name', $arr['name']);
- $this->assertEquals('Test', $arr['description']);
- }
-
- public function testReturnsNullWhenRetrievingMissingOperation()
- {
- $s = new ServiceDescription(array());
- $this->assertNull($s->getOperation('foo'));
- }
-
- public function testCanAddOperations()
- {
- $s = new ServiceDescription(array());
- $this->assertFalse($s->hasOperation('Foo'));
- $s->addOperation(new Operation(array('name' => 'Foo')));
- $this->assertTrue($s->hasOperation('Foo'));
- }
-
- /**
- * @expectedException Guzzle\Common\Exception\InvalidArgumentException
- */
- public function testValidatesOperationTypes()
- {
- $s = new ServiceDescription(array(
- 'operations' => array('foo' => new \stdClass())
- ));
- }
-
- public function testHasBaseUrl()
- {
- $description = new ServiceDescription(array('baseUrl' => 'http://foo.com'));
- $this->assertEquals('http://foo.com', $description->getBaseUrl());
- $description->setBaseUrl('http://foobar.com');
- $this->assertEquals('http://foobar.com', $description->getBaseUrl());
- }
-
- public function testCanUseBasePath()
- {
- $description = new ServiceDescription(array('basePath' => 'http://foo.com'));
- $this->assertEquals('http://foo.com', $description->getBaseUrl());
- }
-
- public function testModelsHaveNames()
- {
- $desc = array(
- 'models' => array(
- 'date' => array('type' => 'string'),
- 'user'=> array(
- 'type' => 'object',
- 'properties' => array(
- 'dob' => array('$ref' => 'date')
- )
- )
- )
- );
-
- $s = ServiceDescription::factory($desc);
- $this->assertEquals('date', $s->getModel('date')->getName());
- $this->assertEquals('dob', $s->getModel('user')->getProperty('dob')->getName());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Exception/CommandTransferExceptionTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Exception/CommandTransferExceptionTest.php
deleted file mode 100644
index be0d4ac..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Exception/CommandTransferExceptionTest.php
+++ /dev/null
@@ -1,66 +0,0 @@
-addSuccessfulCommand($c1)->addFailedCommand($c2);
- $this->assertSame(array($c1), $e->getSuccessfulCommands());
- $this->assertSame(array($c2), $e->getFailedCommands());
- $this->assertSame(array($c1, $c2), $e->getAllCommands());
- }
-
- public function testConvertsMultiExceptionIntoCommandTransfer()
- {
- $r1 = new Request('GET', 'http://foo.com');
- $r2 = new Request('GET', 'http://foobaz.com');
- $e = new MultiTransferException('Test', 123);
- $e->addSuccessfulRequest($r1)->addFailedRequest($r2);
- $ce = CommandTransferException::fromMultiTransferException($e);
-
- $this->assertInstanceOf('Guzzle\Service\Exception\CommandTransferException', $ce);
- $this->assertEquals('Test', $ce->getMessage());
- $this->assertEquals(123, $ce->getCode());
- $this->assertSame(array($r1), $ce->getSuccessfulRequests());
- $this->assertSame(array($r2), $ce->getFailedRequests());
- }
-
- public function testCanRetrieveExceptionForCommand()
- {
- $r1 = new Request('GET', 'http://foo.com');
- $e1 = new \Exception('foo');
- $c1 = $this->getMockBuilder('Guzzle\Tests\Service\Mock\Command\MockCommand')
- ->setMethods(array('getRequest'))
- ->getMock();
- $c1->expects($this->once())->method('getRequest')->will($this->returnValue($r1));
-
- $e = new MultiTransferException('Test', 123);
- $e->addFailedRequestWithException($r1, $e1);
- $ce = CommandTransferException::fromMultiTransferException($e);
- $ce->addFailedCommand($c1);
-
- $this->assertSame($e1, $ce->getExceptionForFailedCommand($c1));
- }
-
- public function testAddsNonRequestExceptions()
- {
- $e = new MultiTransferException();
- $e->add(new \Exception('bar'));
- $e->addFailedRequestWithException(new Request('GET', 'http://www.foo.com'), new \Exception('foo'));
- $ce = CommandTransferException::fromMultiTransferException($e);
- $this->assertEquals(2, count($ce));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Exception/InconsistentClientTransferExceptionTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Exception/InconsistentClientTransferExceptionTest.php
deleted file mode 100644
index 6455295..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Exception/InconsistentClientTransferExceptionTest.php
+++ /dev/null
@@ -1,15 +0,0 @@
-assertEquals($items, $e->getCommands());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Exception/ValidationExceptionTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Exception/ValidationExceptionTest.php
deleted file mode 100644
index ef789d8..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Exception/ValidationExceptionTest.php
+++ /dev/null
@@ -1,17 +0,0 @@
-setErrors($errors);
- $this->assertEquals($errors, $e->getErrors());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Mock/Command/IterableCommand.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Mock/Command/IterableCommand.php
deleted file mode 100644
index 4ab423e..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Mock/Command/IterableCommand.php
+++ /dev/null
@@ -1,31 +0,0 @@
- 'iterable_command',
- 'parameters' => array(
- 'page_size' => array('type' => 'integer'),
- 'next_token' => array('type' => 'string')
- )
- ));
- }
-
- protected function build()
- {
- $this->request = $this->client->createRequest('GET');
-
- // Add the next token and page size query string values
- $this->request->getQuery()->set('next_token', $this->get('next_token'));
-
- if ($this->get('page_size')) {
- $this->request->getQuery()->set('page_size', $this->get('page_size'));
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Mock/Command/MockCommand.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Mock/Command/MockCommand.php
deleted file mode 100644
index 831a7e7..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Mock/Command/MockCommand.php
+++ /dev/null
@@ -1,32 +0,0 @@
- get_called_class() == __CLASS__ ? 'mock_command' : 'sub.sub',
- 'httpMethod' => 'POST',
- 'parameters' => array(
- 'test' => array(
- 'default' => 123,
- 'required' => true,
- 'doc' => 'Test argument'
- ),
- '_internal' => array(
- 'default' => 'abc'
- ),
- 'foo' => array('filters' => array('strtoupper'))
- )
- ));
- }
-
- protected function build()
- {
- $this->request = $this->client->createRequest();
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Mock/Command/OtherCommand.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Mock/Command/OtherCommand.php
deleted file mode 100644
index 72ae1f6..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Mock/Command/OtherCommand.php
+++ /dev/null
@@ -1,30 +0,0 @@
- 'other_command',
- 'parameters' => array(
- 'test' => array(
- 'default' => '123',
- 'required' => true,
- 'doc' => 'Test argument'
- ),
- 'other' => array(),
- 'arg' => array('type' => 'string'),
- 'static' => array('static' => true, 'default' => 'this is static')
- )
- ));
- }
-
- protected function build()
- {
- $this->request = $this->client->getRequest('HEAD');
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Mock/Command/Sub/Sub.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Mock/Command/Sub/Sub.php
deleted file mode 100644
index d348480..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Mock/Command/Sub/Sub.php
+++ /dev/null
@@ -1,7 +0,0 @@
- '{scheme}://127.0.0.1:8124/{api_version}/{subdomain}',
- 'scheme' => 'http',
- 'api_version' => 'v1'
- ), array('username', 'password', 'subdomain'));
-
- return new self($config->get('base_url'), $config);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Mock/Model/MockCommandIterator.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Mock/Model/MockCommandIterator.php
deleted file mode 100644
index 8faf412..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Mock/Model/MockCommandIterator.php
+++ /dev/null
@@ -1,42 +0,0 @@
-nextToken) {
- $this->command->set('next_token', $this->nextToken);
- }
-
- $this->command->set('page_size', (int) $this->calculatePageSize());
- $this->command->execute();
-
- $data = json_decode($this->command->getResponse()->getBody(true), true);
-
- $this->nextToken = $data['next_token'];
-
- return $data['resources'];
- }
-
- public function next()
- {
- $this->calledNext++;
- parent::next();
- }
-
- public function getResources()
- {
- return $this->resources;
- }
-
- public function getIteratedCount()
- {
- return $this->iteratedCount;
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Resource/CompositeResourceIteratorFactoryTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Resource/CompositeResourceIteratorFactoryTest.php
deleted file mode 100644
index 41c2073..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Resource/CompositeResourceIteratorFactoryTest.php
+++ /dev/null
@@ -1,37 +0,0 @@
-assertFalse($factory->canBuild($cmd));
- $factory->build($cmd);
- }
-
- public function testBuildsResourceIterators()
- {
- $f1 = new ResourceIteratorClassFactory('Guzzle\Tests\Service\Mock\Model');
- $factory = new CompositeResourceIteratorFactory(array());
- $factory->addFactory($f1);
- $command = new MockCommand();
- $iterator = $factory->build($command, array('client.namespace' => 'Guzzle\Tests\Service\Mock'));
- $this->assertInstanceOf('Guzzle\Tests\Service\Mock\Model\MockCommandIterator', $iterator);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Resource/MapResourceIteratorFactoryTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Resource/MapResourceIteratorFactoryTest.php
deleted file mode 100644
index d166e92..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Resource/MapResourceIteratorFactoryTest.php
+++ /dev/null
@@ -1,40 +0,0 @@
-build(new MockCommand());
- }
-
- public function testBuildsResourceIterators()
- {
- $factory = new MapResourceIteratorFactory(array(
- 'mock_command' => 'Guzzle\Tests\Service\Mock\Model\MockCommandIterator'
- ));
- $iterator = $factory->build(new MockCommand());
- $this->assertInstanceOf('Guzzle\Tests\Service\Mock\Model\MockCommandIterator', $iterator);
- }
-
- public function testUsesWildcardMappings()
- {
- $factory = new MapResourceIteratorFactory(array(
- '*' => 'Guzzle\Tests\Service\Mock\Model\MockCommandIterator'
- ));
- $iterator = $factory->build(new MockCommand());
- $this->assertInstanceOf('Guzzle\Tests\Service\Mock\Model\MockCommandIterator', $iterator);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Resource/ModelTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Resource/ModelTest.php
deleted file mode 100644
index 7214133..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Resource/ModelTest.php
+++ /dev/null
@@ -1,65 +0,0 @@
- 'object'));
- $model = new Model(array('foo' => 'bar'), $param);
- $this->assertSame($param, $model->getStructure());
- $this->assertEquals('bar', $model->get('foo'));
- $this->assertEquals('bar', $model['foo']);
- }
-
- public function testCanBeUsedWithoutStructure()
- {
- $model = new Model(array(
- 'Foo' => 'baz',
- 'Bar' => array(
- 'Boo' => 'Bam'
- )
- ));
- $transform = function ($key, $value) {
- return ($value && is_array($value)) ? new Collection($value) : $value;
- };
- $model = $model->map($transform);
- $this->assertInstanceOf('Guzzle\Common\Collection', $model->getPath('Bar'));
- }
-
- public function testAllowsFiltering()
- {
- $model = new Model(array(
- 'Foo' => 'baz',
- 'Bar' => 'a'
- ));
- $model = $model->filter(function ($i, $v) {
- return $v[0] == 'a';
- });
- $this->assertEquals(array('Bar' => 'a'), $model->toArray());
- }
-
- public function testDoesNotIncludeEmptyStructureInString()
- {
- $model = new Model(array('Foo' => 'baz'));
- $str = (string) $model;
- $this->assertContains('Debug output of model', $str);
- $this->assertNotContains('Model structure', $str);
- }
-
- public function testDoesIncludeModelStructureInString()
- {
- $model = new Model(array('Foo' => 'baz'), new Parameter(array('name' => 'Foo')));
- $str = (string) $model;
- $this->assertContains('Debug output of Foo model', $str);
- $this->assertContains('Model structure', $str);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Resource/ResourceIteratorClassFactoryTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Resource/ResourceIteratorClassFactoryTest.php
deleted file mode 100644
index 7b061b5..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Resource/ResourceIteratorClassFactoryTest.php
+++ /dev/null
@@ -1,41 +0,0 @@
-registerNamespace('Baz');
- $command = new MockCommand();
- $factory->build($command);
- }
-
- public function testBuildsResourceIterators()
- {
- $factory = new ResourceIteratorClassFactory('Guzzle\Tests\Service\Mock\Model');
- $command = new MockCommand();
- $iterator = $factory->build($command, array('client.namespace' => 'Guzzle\Tests\Service\Mock'));
- $this->assertInstanceOf('Guzzle\Tests\Service\Mock\Model\MockCommandIterator', $iterator);
- }
-
- public function testChecksIfCanBuild()
- {
- $factory = new ResourceIteratorClassFactory('Guzzle\Tests\Service');
- $this->assertFalse($factory->canBuild(new MockCommand()));
- $factory = new ResourceIteratorClassFactory('Guzzle\Tests\Service\Mock\Model');
- $this->assertTrue($factory->canBuild(new MockCommand()));
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Resource/ResourceIteratorTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Resource/ResourceIteratorTest.php
deleted file mode 100644
index 573fb6d..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Service/Resource/ResourceIteratorTest.php
+++ /dev/null
@@ -1,184 +0,0 @@
-assertInternalType('array', ResourceIterator::getAllEvents());
- }
-
- public function testConstructorConfiguresDefaults()
- {
- $ri = $this->getMockForAbstractClass('Guzzle\\Service\\Resource\\ResourceIterator', array(
- $this->getServiceBuilder()->get('mock')->getCommand('iterable_command'),
- array(
- 'limit' => 10,
- 'page_size' => 3
- )
- ), 'MockIterator');
-
- $this->assertEquals(false, $ri->getNextToken());
- $this->assertEquals(false, $ri->current());
- }
-
- public function testSendsRequestsForNextSetOfResources()
- {
- // Queue up an array of responses for iterating
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"g\", \"resources\": [\"d\", \"e\", \"f\"] }",
- "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"j\", \"resources\": [\"g\", \"h\", \"i\"] }",
- "HTTP/1.1 200 OK\r\nContent-Length: 41\r\n\r\n{ \"next_token\": \"\", \"resources\": [\"j\"] }"
- ));
-
- // Create a new resource iterator using the IterableCommand mock
- $ri = new MockCommandIterator($this->getServiceBuilder()->get('mock')->getCommand('iterable_command'), array(
- 'page_size' => 3
- ));
-
- // Ensure that no requests have been sent yet
- $this->assertEquals(0, count($this->getServer()->getReceivedRequests(false)));
-
- //$this->assertEquals(array('d', 'e', 'f', 'g', 'h', 'i', 'j'), $ri->toArray());
- $ri->toArray();
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals(3, count($requests));
-
- $this->assertEquals(3, $requests[0]->getQuery()->get('page_size'));
- $this->assertEquals(3, $requests[1]->getQuery()->get('page_size'));
- $this->assertEquals(3, $requests[2]->getQuery()->get('page_size'));
-
- // Reset and resend
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"g\", \"resources\": [\"d\", \"e\", \"f\"] }",
- "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"j\", \"resources\": [\"g\", \"h\", \"i\"] }",
- "HTTP/1.1 200 OK\r\nContent-Length: 41\r\n\r\n{ \"next_token\": \"\", \"resources\": [\"j\"] }",
- ));
-
- $d = array();
- foreach ($ri as $data) {
- $d[] = $data;
- }
- $this->assertEquals(array('d', 'e', 'f', 'g', 'h', 'i', 'j'), $d);
- }
-
- public function testCalculatesPageSize()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"g\", \"resources\": [\"d\", \"e\", \"f\"] }",
- "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"j\", \"resources\": [\"g\", \"h\", \"i\"] }",
- "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"j\", \"resources\": [\"j\", \"k\"] }"
- ));
-
- $ri = new MockCommandIterator($this->getServiceBuilder()->get('mock')->getCommand('iterable_command'), array(
- 'page_size' => 3,
- 'limit' => 7
- ));
-
- $this->assertEquals(array('d', 'e', 'f', 'g', 'h', 'i', 'j'), $ri->toArray());
- $requests = $this->getServer()->getReceivedRequests(true);
- $this->assertEquals(3, count($requests));
- $this->assertEquals(3, $requests[0]->getQuery()->get('page_size'));
- $this->assertEquals(3, $requests[1]->getQuery()->get('page_size'));
- $this->assertEquals(1, $requests[2]->getQuery()->get('page_size'));
- }
-
- public function testUseAsArray()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"g\", \"resources\": [\"d\", \"e\", \"f\"] }",
- "HTTP/1.1 200 OK\r\nContent-Length: 52\r\n\r\n{ \"next_token\": \"\", \"resources\": [\"g\", \"h\", \"i\"] }"
- ));
-
- $ri = new MockCommandIterator($this->getServiceBuilder()->get('mock')->getCommand('iterable_command'));
-
- // Ensure that the key is never < 0
- $this->assertEquals(0, $ri->key());
- $this->assertEquals(0, count($ri));
-
- // Ensure that the iterator can be used as KVP array
- $data = array();
- foreach ($ri as $key => $value) {
- $data[$key] = $value;
- }
-
- // Ensure that the iterate is countable
- $this->assertEquals(6, count($ri));
- $this->assertEquals(array('d', 'e', 'f', 'g', 'h', 'i'), $data);
- }
-
- public function testBailsWhenSendReturnsNoResults()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\n\r\n{ \"next_token\": \"g\", \"resources\": [\"d\", \"e\", \"f\"] }",
- "HTTP/1.1 200 OK\r\n\r\n{ \"next_token\": \"\", \"resources\": [] }"
- ));
-
- $ri = new MockCommandIterator($this->getServiceBuilder()->get('mock')->getCommand('iterable_command'));
-
- // Ensure that the iterator can be used as KVP array
- $data = $ri->toArray();
-
- // Ensure that the iterate is countable
- $this->assertEquals(3, count($ri));
- $this->assertEquals(array('d', 'e', 'f'), $data);
-
- $this->assertEquals(2, $ri->getRequestCount());
- }
-
- public function testHoldsDataOptions()
- {
- $ri = new MockCommandIterator($this->getServiceBuilder()->get('mock')->getCommand('iterable_command'));
- $this->assertNull($ri->get('foo'));
- $this->assertSame($ri, $ri->set('foo', 'bar'));
- $this->assertEquals('bar', $ri->get('foo'));
- }
-
- public function testSettingLimitOrPageSizeClearsData()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\n\r\n{ \"next_token\": \"\", \"resources\": [\"d\", \"e\", \"f\"] }",
- "HTTP/1.1 200 OK\r\n\r\n{ \"next_token\": \"\", \"resources\": [\"d\", \"e\", \"f\"] }",
- "HTTP/1.1 200 OK\r\n\r\n{ \"next_token\": \"\", \"resources\": [\"d\", \"e\", \"f\"] }"
- ));
-
- $ri = new MockCommandIterator($this->getServiceBuilder()->get('mock')->getCommand('iterable_command'));
- $ri->toArray();
- $this->assertNotEmpty($this->readAttribute($ri, 'resources'));
-
- $ri->setLimit(10);
- $this->assertEmpty($this->readAttribute($ri, 'resources'));
-
- $ri->toArray();
- $this->assertNotEmpty($this->readAttribute($ri, 'resources'));
- $ri->setPageSize(10);
- $this->assertEmpty($this->readAttribute($ri, 'resources'));
- }
-
- public function testWorksWithCustomAppendIterator()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue(array(
- "HTTP/1.1 200 OK\r\n\r\n{ \"next_token\": \"\", \"resources\": [\"d\", \"e\", \"f\"] }"
- ));
- $ri = new MockCommandIterator($this->getServiceBuilder()->get('mock')->getCommand('iterable_command'));
- $a = new \Guzzle\Iterator\AppendIterator();
- $a->append($ri);
- $results = iterator_to_array($a, false);
- $this->assertEquals(4, $ri->calledNext);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Stream/PhpStreamRequestFactoryTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Stream/PhpStreamRequestFactoryTest.php
deleted file mode 100644
index 083aaa0..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Stream/PhpStreamRequestFactoryTest.php
+++ /dev/null
@@ -1,172 +0,0 @@
-client = new Client($this->getServer()->getUrl());
- $this->factory = new PhpStreamRequestFactory();
- }
-
- public function testOpensValidStreamByCreatingContext()
- {
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi");
- $request = $this->client->get('/');
- $stream = $this->factory->fromRequest($request);
- $this->assertEquals('hi', (string) $stream);
- $headers = $this->factory->getLastResponseHeaders();
- $this->assertContains('HTTP/1.1 200 OK', $headers);
- $this->assertContains('Content-Length: 2', $headers);
- $this->assertSame($headers, $stream->getCustomData('response_headers'));
- $this->assertEquals(2, $stream->getSize());
- }
-
- public function testOpensValidStreamByPassingContextAndMerging()
- {
- $request = $this->client->get('/');
- $this->factory = $this->getMockBuilder('Guzzle\Stream\PhpStreamRequestFactory')
- ->setMethods(array('createContext', 'createStream'))
- ->getMock();
- $this->factory->expects($this->never())
- ->method('createContext');
- $this->factory->expects($this->once())
- ->method('createStream')
- ->will($this->returnValue(new Stream(fopen('php://temp', 'r'))));
-
- $context = array('http' => array('method' => 'HEAD', 'ignore_errors' => false));
- $this->factory->fromRequest($request, stream_context_create($context));
- $options = stream_context_get_options($this->readAttribute($this->factory, 'context'));
- $this->assertEquals('HEAD', $options['http']['method']);
- $this->assertFalse($options['http']['ignore_errors']);
- $this->assertEquals('1.1', $options['http']['protocol_version']);
- }
-
- public function testAppliesProxySettings()
- {
- $request = $this->client->get('/');
- $request->getCurlOptions()->set(CURLOPT_PROXY, 'tcp://foo.com');
- $this->factory = $this->getMockBuilder('Guzzle\Stream\PhpStreamRequestFactory')
- ->setMethods(array('createStream'))
- ->getMock();
- $this->factory->expects($this->once())
- ->method('createStream')
- ->will($this->returnValue(new Stream(fopen('php://temp', 'r'))));
- $this->factory->fromRequest($request);
- $options = stream_context_get_options($this->readAttribute($this->factory, 'context'));
- $this->assertEquals('tcp://foo.com', $options['http']['proxy']);
- }
-
- public function testAddsPostFields()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi");
- $request = $this->client->post('/', array('Foo' => 'Bar'), array('foo' => 'baz bar'));
- $stream = $this->factory->fromRequest($request);
- $this->assertEquals('hi', (string) $stream);
-
- $headers = $this->factory->getLastResponseHeaders();
- $this->assertContains('HTTP/1.1 200 OK', $headers);
- $this->assertContains('Content-Length: 2', $headers);
- $this->assertSame($headers, $stream->getCustomData('response_headers'));
-
- $received = $this->getServer()->getReceivedRequests();
- $this->assertEquals(1, count($received));
- $this->assertContains('POST / HTTP/1.1', $received[0]);
- $this->assertContains('host: ', $received[0]);
- $this->assertContains('user-agent: Guzzle/', $received[0]);
- $this->assertContains('foo: Bar', $received[0]);
- $this->assertContains('content-length: 13', $received[0]);
- $this->assertContains('foo=baz%20bar', $received[0]);
- }
-
- public function testAddsBody()
- {
- $this->getServer()->flush();
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi");
- $request = $this->client->put('/', array('Foo' => 'Bar'), 'Testing...123');
- $stream = $this->factory->fromRequest($request);
- $this->assertEquals('hi', (string) $stream);
-
- $headers = $this->factory->getLastResponseHeaders();
- $this->assertContains('HTTP/1.1 200 OK', $headers);
- $this->assertContains('Content-Length: 2', $headers);
- $this->assertSame($headers, $stream->getCustomData('response_headers'));
-
- $received = $this->getServer()->getReceivedRequests();
- $this->assertEquals(1, count($received));
- $this->assertContains('PUT / HTTP/1.1', $received[0]);
- $this->assertContains('host: ', $received[0]);
- $this->assertContains('user-agent: Guzzle/', $received[0]);
- $this->assertContains('foo: Bar', $received[0]);
- $this->assertContains('content-length: 13', $received[0]);
- $this->assertContains('Testing...123', $received[0]);
- }
-
- public function testCanDisableSslValidation()
- {
- $request = $this->client->get('/');
- $request->getCurlOptions()->set(CURLOPT_SSL_VERIFYPEER, false);
- $this->factory = $this->getMockBuilder('Guzzle\Stream\PhpStreamRequestFactory')
- ->setMethods(array('createStream'))
- ->getMock();
- $this->factory->expects($this->once())
- ->method('createStream')
- ->will($this->returnValue(new Stream(fopen('php://temp', 'r'))));
- $this->factory->fromRequest($request);
- $options = stream_context_get_options($this->readAttribute($this->factory, 'context'));
- $this->assertFalse($options['ssl']['verify_peer']);
- }
-
- public function testUsesSslValidationByDefault()
- {
- $request = $this->client->get('/');
- $this->factory = $this->getMockBuilder('Guzzle\Stream\PhpStreamRequestFactory')
- ->setMethods(array('createStream'))
- ->getMock();
- $this->factory->expects($this->once())
- ->method('createStream')
- ->will($this->returnValue(new Stream(fopen('php://temp', 'r'))));
- $this->factory->fromRequest($request);
- $options = stream_context_get_options($this->readAttribute($this->factory, 'context'));
- $this->assertTrue($options['ssl']['verify_peer']);
- $this->assertSame($request->getCurlOptions()->get(CURLOPT_CAINFO), $options['ssl']['cafile']);
- }
-
- public function testBasicAuthAddsUserAndPassToUrl()
- {
- $request = $this->client->get('/');
- $request->setAuth('Foo', 'Bar');
- $this->factory = $this->getMockBuilder('Guzzle\Stream\PhpStreamRequestFactory')
- ->setMethods(array('createStream'))
- ->getMock();
- $this->factory->expects($this->once())
- ->method('createStream')
- ->will($this->returnValue(new Stream(fopen('php://temp', 'r'))));
- $this->factory->fromRequest($request);
- $this->assertContains('Foo:Bar@', (string) $this->readAttribute($this->factory, 'url'));
- }
-
- public function testCanCreateCustomStreamClass()
- {
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nhi");
- $request = $this->client->get('/');
- $stream = $this->factory->fromRequest($request, array(), array('stream_class' => 'Guzzle\Http\EntityBody'));
- $this->assertInstanceOf('Guzzle\Http\EntityBody', $stream);
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Stream/StreamTest.php b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Stream/StreamTest.php
deleted file mode 100644
index 4973f25..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/Stream/StreamTest.php
+++ /dev/null
@@ -1,189 +0,0 @@
-assertEquals($handle, $stream->getStream());
- $this->assertTrue($stream->isReadable());
- $this->assertTrue($stream->isWritable());
- $this->assertTrue($stream->isLocal());
- $this->assertTrue($stream->isSeekable());
- $this->assertEquals('PHP', $stream->getWrapper());
- $this->assertEquals('TEMP', $stream->getStreamType());
- $this->assertEquals(4, $stream->getSize());
- $this->assertEquals('php://temp', $stream->getUri());
- $this->assertEquals(array(), $stream->getWrapperData());
- $this->assertFalse($stream->isConsumed());
- unset($stream);
- }
-
- public function testCanModifyStream()
- {
- $handle1 = fopen('php://temp', 'r+');
- $handle2 = fopen('php://temp', 'r+');
- $stream = new Stream($handle1);
- $this->assertSame($handle1, $stream->getStream());
- $stream->setStream($handle2, 10);
- $this->assertEquals(10, $stream->getSize());
- $this->assertSame($handle2, $stream->getStream());
- }
-
- public function testStreamClosesHandleOnDestruct()
- {
- $handle = fopen('php://temp', 'r');
- $stream = new Stream($handle);
- unset($stream);
- $this->assertFalse(is_resource($handle));
- }
-
- public function testConvertsToString()
- {
- $handle = fopen('php://temp', 'w+');
- fwrite($handle, 'data');
- $stream = new Stream($handle);
- $this->assertEquals('data', (string) $stream);
- unset($stream);
-
- $handle = fopen(__DIR__ . '/../TestData/FileBody.txt', 'r');
- $stream = new Stream($handle);
- $this->assertEquals('', (string) $stream);
- unset($stream);
- }
-
- public function testConvertsToStringAndRestoresCursorPos()
- {
- $handle = fopen('php://temp', 'w+');
- $stream = new Stream($handle);
- $stream->write('foobazbar');
- $stream->seek(3);
- $this->assertEquals('foobazbar', (string) $stream);
- $this->assertEquals(3, $stream->ftell());
- }
-
- public function testIsConsumed()
- {
- $handle = fopen('php://temp', 'w+');
- fwrite($handle, 'data');
- $stream = new Stream($handle);
- $this->assertFalse($stream->isConsumed());
- $stream->read(4);
- $this->assertTrue($stream->isConsumed());
- }
-
- public function testAllowsSettingManualSize()
- {
- $handle = fopen('php://temp', 'w+');
- fwrite($handle, 'data');
- $stream = new Stream($handle);
- $stream->setSize(10);
- $this->assertEquals(10, $stream->getSize());
- unset($stream);
- }
-
- public function testWrapsStream()
- {
- $handle = fopen('php://temp', 'w+');
- fwrite($handle, 'data');
- $stream = new Stream($handle);
- $this->assertTrue($stream->isSeekable());
- $this->assertTrue($stream->isReadable());
- $this->assertTrue($stream->seek(0));
- $this->assertEquals('da', $stream->read(2));
- $this->assertEquals('ta', $stream->read(2));
- $this->assertTrue($stream->seek(0));
- $this->assertEquals('data', $stream->read(4));
- $stream->write('_appended');
- $stream->seek(0);
- $this->assertEquals('data_appended', $stream->read(13));
- }
-
- public function testGetSize()
- {
- $size = filesize(__DIR__ . '/../../../bootstrap.php');
- $handle = fopen(__DIR__ . '/../../../bootstrap.php', 'r');
- $stream = new Stream($handle);
- $this->assertEquals($handle, $stream->getStream());
- $this->assertEquals($size, $stream->getSize());
- $this->assertEquals($size, $stream->getSize());
- unset($stream);
-
- // Make sure that false is returned when the size cannot be determined
- $this->getServer()->enqueue("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
- $handle = fopen('http://127.0.0.1:' . $this->getServer()->getPort(), 'r');
- $stream = new Stream($handle);
- $this->assertEquals(false, $stream->getSize());
- unset($stream);
- }
-
- public function testEnsuresSizeIsConsistent()
- {
- $h = fopen('php://temp', 'r+');
- fwrite($h, 'foo');
- $stream = new Stream($h);
- $this->assertEquals(3, $stream->getSize());
- $stream->write('test');
- $this->assertEquals(7, $stream->getSize());
- fclose($h);
- }
-
- public function testAbstractsMetaData()
- {
- $handle = fopen(__DIR__ . '/../../../bootstrap.php', 'r');
- $stream = new Stream($handle);
- $this->assertEquals('plainfile', $stream->getMetaData('wrapper_type'));
- $this->assertEquals(null, $stream->getMetaData('wrapper_data'));
- $this->assertInternalType('array', $stream->getMetaData());
- }
-
- public function testDoesNotAttemptToWriteToReadonlyStream()
- {
- $handle = fopen(__DIR__ . '/../../../bootstrap.php', 'r');
- $stream = new Stream($handle);
- $this->assertEquals(0, $stream->write('foo'));
- }
-
- public function testProvidesStreamPosition()
- {
- $handle = fopen(__DIR__ . '/../../../bootstrap.php', 'r');
- $stream = new Stream($handle);
- $stream->read(2);
- $this->assertSame(ftell($handle), $stream->ftell());
- $this->assertEquals(2, $stream->ftell());
- }
-
- public function testRewindIsSeekZero()
- {
- $stream = new Stream(fopen('php://temp', 'w+'));
- $stream->write('foobazbar');
- $this->assertTrue($stream->rewind());
- $this->assertEquals('foobazbar', $stream->read(9));
- }
-
- public function testCanDetachStream()
- {
- $r = fopen('php://temp', 'w+');
- $stream = new Stream($r);
- $stream->detachStream();
- $this->assertNull($stream->getStream());
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/description/bar.json b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/description/bar.json
deleted file mode 100644
index c354ed7..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/description/bar.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "includes": ["foo.json"]
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/description/baz.json b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/description/baz.json
deleted file mode 100644
index 765237b..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/description/baz.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "includes": ["foo.json", "bar.json"]
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/description/foo.json b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/description/foo.json
deleted file mode 100644
index cee5005..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/description/foo.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "includes": ["recursive.json"],
- "operations": {
- "abstract": {
- "httpMethod": "POST"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/description/recursive.json b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/description/recursive.json
deleted file mode 100644
index c354ed7..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/description/recursive.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "includes": ["foo.json"]
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/mock_response b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/mock_response
deleted file mode 100644
index b6938a2..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/mock_response
+++ /dev/null
@@ -1,3 +0,0 @@
-HTTP/1.1 200 OK
-Content-Length: 0
-
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/services/json1.json b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/services/json1.json
deleted file mode 100644
index 7b2a9da..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/services/json1.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "includes": [ "json2.json" ],
- "services": {
- "abstract": {
- "access_key": "xyz",
- "secret": "abc"
- },
- "mock": {
- "class": "Guzzle\\Tests\\Service\\Mock\\MockClient",
- "extends": "abstract",
- "params": {
- "username": "foo",
- "password": "baz",
- "subdomain": "bar"
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/services/json2.json b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/services/json2.json
deleted file mode 100644
index 08e5566..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/services/json2.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "services": {
- "foo": {
- "class": "Guzzle\\Tests\\Service\\Mock\\MockClient",
- "extends": "abstract",
- "params": {
- "baz": "bar"
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/services/services.json b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/services/services.json
deleted file mode 100644
index 25452e4..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/services/services.json
+++ /dev/null
@@ -1,71 +0,0 @@
-{
- "abstract": {
- "access_key": "xyz",
- "secret": "abc"
- },
- "mock": {
- "class": "Guzzle\\Tests\\Service\\Mock\\MockClient",
- "extends": "abstract",
- "params": {
- "username": "foo",
- "password": "baz",
- "subdomain": "bar"
- }
- },
-
- "test.abstract.aws": {
- "params": {
- "access_key": "12345",
- "secret_key": "abcd"
- }
- },
-
- "test.s3": {
- "class": "Guzzle\\Service\\Aws\\S3Client",
- "extends": "test.abstract.aws",
- "params": {
- "devpay_product_token": "",
- "devpay_user_token": ""
- }
- },
-
- "test.simple_db": {
- "class": "Guzzle\\Service\\Aws\\SimpleDb\\SimpleDbClient",
- "extends": "test.abstract.aws"
- },
-
- "test.sqs": {
- "class": "Guzzle\\Service\\Aws\\Sqs\\SqsClient",
- "extends": "test.abstract.aws"
- },
-
- "test.centinel": {
- "class": "Guzzle\\Service\\CardinalCommerce\\Centinel.CentinelClient",
- "params": {
- "password": "test",
- "processor_id": "123",
- "merchant_id": "456"
- }
- },
-
- "test.mws": {
- "class": "Guzzle\\Service\\Mws\\MwsClient",
- "extends": "test.abstract.aws",
- "params": {
- "merchant_id": "ABCDE",
- "marketplace_id": "FGHIJ",
- "application_name": "GuzzleTest",
- "application_version": "0.1",
- "base_url": "https://mws.amazonservices.com"
- }
- },
-
- "mock": {
- "class": "Guzzle\\Tests\\Service\\Mock\\MockClient",
- "params": {
- "username": "test_user",
- "password": "****",
- "subdomain": "test"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/test_service.json b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/test_service.json
deleted file mode 100644
index 01557ca..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/test_service.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "includes": [ "test_service2.json" ],
- "operations": {
- "test": {
- "uri": "/path"
- },
- "concrete": {
- "extends": "abstract"
- },
- "foo_bar": {
- "uri": "/testing",
- "parameters": {
- "other": {
- "location": "json",
- "location_key": "Other"
- },
- "test": {
- "type": "object",
- "location": "json",
- "properties": {
- "baz": {
- "type": "boolean",
- "default": true
- },
- "bar": {
- "type": "string",
- "filters": [
- {
- "method": "strtolower",
- "args": ["test", "@value"]
- },
- "strtoupper"
- ]
- }
- }
- }
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/test_service2.json b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/test_service2.json
deleted file mode 100644
index 66dd9ef..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/test_service2.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "operations": {
- "abstract": {
- "uri": "/abstract"
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/test_service_3.json b/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/test_service_3.json
deleted file mode 100644
index ae2ae0b..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/Guzzle/Tests/TestData/test_service_3.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "includes": [ "test_service2.json" ],
- "operations": {
- "test": {
- "uri": "/path"
- },
- "concrete": {
- "extends": "abstract"
- },
- "baz_qux": {
- "uri": "/testing",
- "parameters": {
- "other": {
- "location": "json",
- "location_key": "Other"
- },
- "test": {
- "type": "object",
- "location": "json",
- "properties": {
- "baz": {
- "type": "boolean",
- "default": true
- },
- "bar": {
- "type": "string",
- "filters": [
- {
- "method": "strtolower",
- "args": ["test", "@value"]
- },
- "strtoupper"
- ]
- }
- }
- }
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzle/guzzle/tests/bootstrap.php b/lib/gerencianet/guzzle/guzzle/tests/bootstrap.php
deleted file mode 100644
index 28908d3..0000000
--- a/lib/gerencianet/guzzle/guzzle/tests/bootstrap.php
+++ /dev/null
@@ -1,10 +0,0 @@
-= 5.5
+* Updated to use PSR-7
+ * Requires immutable messages, which basically means an event based system
+ owned by a request instance is no longer possible.
+ * Utilizing the [Guzzle PSR-7 package](https://github.com/guzzle/psr7).
+ * Removed the dependency on `guzzlehttp/streams`. These stream abstractions
+ are available in the `guzzlehttp/psr7` package under the `GuzzleHttp\Psr7`
+ namespace.
+* Added middleware and handler system
+ * Replaced the Guzzle event and subscriber system with a middleware system.
+ * No longer depends on RingPHP, but rather places the HTTP handlers directly
+ in Guzzle, operating on PSR-7 messages.
+ * Retry logic is now encapsulated in `GuzzleHttp\Middleware::retry`, which
+ means the `guzzlehttp/retry-subscriber` is now obsolete.
+ * Mocking responses is now handled using `GuzzleHttp\Handler\MockHandler`.
+* Asynchronous responses
+ * No longer supports the `future` request option to send an async request.
+ Instead, use one of the `*Async` methods of a client (e.g., `requestAsync`,
+ `getAsync`, etc.).
+ * Utilizing `GuzzleHttp\Promise` instead of React's promise library to avoid
+ recursion required by chaining and forwarding react promises. See
+ https://github.com/guzzle/promises
+ * Added `requestAsync` and `sendAsync` to send request asynchronously.
+ * Added magic methods for `getAsync()`, `postAsync()`, etc. to send requests
+ asynchronously.
+* Request options
+ * POST and form updates
+ * Added the `form_fields` and `form_files` request options.
+ * Removed the `GuzzleHttp\Post` namespace.
+ * The `body` request option no longer accepts an array for POST requests.
+ * The `exceptions` request option has been deprecated in favor of the
+ `http_errors` request options.
+ * The `save_to` request option has been deprecated in favor of `sink` request
+ option.
+* Clients no longer accept an array of URI template string and variables for
+ URI variables. You will need to expand URI templates before passing them
+ into a client constructor or request method.
+* Client methods `get()`, `post()`, `put()`, `patch()`, `options()`, etc. are
+ now magic methods that will send synchronous requests.
+* Replaced `Utils.php` with plain functions in `functions.php`.
+* Removed `GuzzleHttp\Collection`.
+* Removed `GuzzleHttp\BatchResults`. Batched pool results are now returned as
+ an array.
+* Removed `GuzzleHttp\Query`. Query string handling is now handled using an
+ associative array passed into the `query` request option. The query string
+ is serialized using PHP's `http_build_query`. If you need more control, you
+ can pass the query string in as a string.
+* `GuzzleHttp\QueryParser` has been replaced with the
+ `GuzzleHttp\Psr7\parse_query`.
+
## 5.2.0 - 2015-01-27
* Added `AppliesHeadersInterface` to make applying headers to a request based
@@ -73,7 +484,7 @@ object).
* Note: This has been changed in 5.0.3 to now encode query string values by
default unless the `rawString` argument is provided when setting the query
string on a URL: Now allowing many more characters to be present in the
- query string without being percent encoded. See http://tools.ietf.org/html/rfc3986#appendix-A
+ query string without being percent encoded. See https://tools.ietf.org/html/rfc3986#appendix-A
## 5.0.1 - 2014-10-16
@@ -115,7 +526,7 @@ interfaces.
responses, `GuzzleHttp\Collection`, `GuzzleHttp\Url`,
`GuzzleHttp\Query`, `GuzzleHttp\Post\PostBody`, and
`GuzzleHttp\Cookie\SetCookie`. This blog post provides a good outline of
- why I did this: http://ocramius.github.io/blog/fluent-interfaces-are-evil/.
+ why I did this: https://ocramius.github.io/blog/fluent-interfaces-are-evil/.
This also makes the Guzzle message interfaces compatible with the current
PSR-7 message proposal.
* Removed "functions.php", so that Guzzle is truly PSR-4 compliant. Except
@@ -301,8 +712,6 @@ interfaces.
## 4.0.0 - 2014-03-29
-* For more information on the 4.0 transition, see:
- http://mtdowling.com/blog/2014/03/15/guzzle-4-rc/
* For information on changes and upgrading, see:
https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40
* Added `GuzzleHttp\batch()` as a convenience function for sending requests in
@@ -567,7 +976,7 @@ interfaces.
* Deprecating Response::getRequest() and now using a shallow clone of a request object to remove a circular reference
to help with refcount based garbage collection of resources created by sending a request
* Deprecating ZF1 cache and log adapters. These will be removed in the next major version.
-* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it'sdeprecated). Use the
+* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it's deprecated). Use the
HistoryPlugin for a history.
* Added a `responseBody` alias for the `response_body` location
* Refactored internals to no longer rely on Response::getRequest()
@@ -611,7 +1020,7 @@ interfaces.
## 3.4.0 - 2013-04-11
-* Bug fix: URLs are now resolved correctly based on http://tools.ietf.org/html/rfc3986#section-5.2. #289
+* Bug fix: URLs are now resolved correctly based on https://tools.ietf.org/html/rfc3986#section-5.2. #289
* Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289
* Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263
* Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264.
diff --git a/lib/gerencianet/guzzlehttp/guzzle/LICENSE b/lib/gerencianet/guzzlehttp/guzzle/LICENSE
index 71d3b78..d51aa69 100644
--- a/lib/gerencianet/guzzlehttp/guzzle/LICENSE
+++ b/lib/gerencianet/guzzlehttp/guzzle/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2014 Michael Dowling, https://github.com/mtdowling
+Copyright (c) 2011 Michael Dowling, https://github.com/mtdowling
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/lib/gerencianet/guzzlehttp/guzzle/Makefile b/lib/gerencianet/guzzlehttp/guzzle/Makefile
deleted file mode 100644
index 69bf327..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/Makefile
+++ /dev/null
@@ -1,50 +0,0 @@
-all: clean coverage docs
-
-start-server:
- cd vendor/guzzlehttp/ringphp && make start-server
-
-stop-server:
- cd vendor/guzzlehttp/ringphp && make stop-server
-
-test: start-server
- vendor/bin/phpunit
- $(MAKE) stop-server
-
-coverage: start-server
- vendor/bin/phpunit --coverage-html=artifacts/coverage
- $(MAKE) stop-server
-
-view-coverage:
- open artifacts/coverage/index.html
-
-clean:
- rm -rf artifacts/*
-
-docs:
- cd docs && make html && cd ..
-
-view-docs:
- open docs/_build/html/index.html
-
-tag:
- $(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=4.2.1"))
- @echo Tagging $(TAG)
- chag update $(TAG)
- sed -i '' -e "s/VERSION = '.*'/VERSION = '$(TAG)'/" src/ClientInterface.php
- php -l src/ClientInterface.php
- git add -A
- git commit -m '$(TAG) release'
- chag tag
-
-perf: start-server
- php tests/perf.php
- $(MAKE) stop-server
-
-package: burgomaster
- php build/packager.php
-
-burgomaster:
- mkdir -p build/artifacts
- curl -s https://raw.githubusercontent.com/mtdowling/Burgomaster/0.0.2/src/Burgomaster.php > build/artifacts/Burgomaster.php
-
-.PHONY: docs burgomaster
diff --git a/lib/gerencianet/guzzlehttp/guzzle/README.md b/lib/gerencianet/guzzlehttp/guzzle/README.md
index d41e7e7..363d6f8 100644
--- a/lib/gerencianet/guzzlehttp/guzzle/README.md
+++ b/lib/gerencianet/guzzlehttp/guzzle/README.md
@@ -1,70 +1,79 @@
-Guzzle, PHP HTTP client and webservice framework
-================================================
+
-[](http://travis-ci.org/guzzle/guzzle)
+# Guzzle, PHP HTTP client
+
+[](https://github.com/guzzle/guzzle/releases)
+[](https://github.com/guzzle/guzzle/actions?query=workflow%3ACI)
+[](https://packagist.org/packages/guzzlehttp/guzzle)
Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and
trivial to integrate with web services.
-- Manages things like persistent connections, represents query strings as
- collections, simplifies sending streaming POST requests with fields and
- files, and abstracts away the underlying HTTP transport layer.
-- Can send both synchronous and asynchronous requests using the same interface
- without requiring a dependency on a specific event loop.
-- Pluggable HTTP adapters allows Guzzle to integrate with any method you choose
- for sending HTTP requests over the wire (e.g., cURL, sockets, PHP's stream
- wrapper, non-blocking event loops like ReactPHP.
-- Guzzle makes it so that you no longer need to fool around with cURL options,
- stream contexts, or sockets.
+- Simple interface for building query strings, POST requests, streaming large
+ uploads, streaming large downloads, using HTTP cookies, uploading JSON data,
+ etc...
+- Can send both synchronous and asynchronous requests using the same interface.
+- Uses PSR-7 interfaces for requests, responses, and streams. This allows you
+ to utilize other PSR-7 compatible libraries with Guzzle.
+- Supports PSR-18 allowing interoperability between other PSR-18 HTTP Clients.
+- Abstracts away the underlying HTTP transport, allowing you to write
+ environment and transport agnostic code; i.e., no hard dependency on cURL,
+ PHP streams, sockets, or non-blocking event loops.
+- Middleware system allows you to augment and compose client behavior.
```php
-$client = new GuzzleHttp\Client();
-$response = $client->get('http://guzzlephp.org');
-$res = $client->get('https://api.github.com/user', ['auth' => ['user', 'pass']]);
-echo $res->getStatusCode();
-// "200"
-echo $res->getHeader('content-type');
-// 'application/json; charset=utf8'
-echo $res->getBody();
-// {"type":"User"...'
-var_export($res->json());
-// Outputs the JSON decoded data
+$client = new \GuzzleHttp\Client();
+$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle');
+
+echo $response->getStatusCode(); // 200
+echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
+echo $response->getBody(); // '{"id": 1420053, "name": "guzzle", ...}'
// Send an asynchronous request.
-$req = $client->createRequest('GET', 'http://httpbin.org', ['future' => true]);
-$client->send($req)->then(function ($response) {
- echo 'I completed! ' . $response;
+$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org');
+$promise = $client->sendAsync($request)->then(function ($response) {
+ echo 'I completed! ' . $response->getBody();
});
+
+$promise->wait();
```
-Get more information and answers with the
-[Documentation](http://guzzlephp.org/),
-[Forums](https://groups.google.com/forum/?hl=en#!forum/guzzle),
-and [Gitter](https://gitter.im/guzzle/guzzle).
+## Help and docs
-### Installing via Composer
+We use GitHub issues only to discuss bugs and new features. For support please refer to:
-The recommended way to install Guzzle is through
-[Composer](http://getcomposer.org).
+- [Documentation](http://guzzlephp.org/)
+- [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle)
+- [#guzzle](https://app.slack.com/client/T0D2S9JCT/CE6UAAKL4) channel on [PHP-HTTP Slack](http://slack.httplug.io/)
+- [Gitter](https://gitter.im/guzzle/guzzle)
-```bash
-# Install Composer
-curl -sS https://getcomposer.org/installer | php
-```
-Next, run the Composer command to install the latest stable version of Guzzle:
+## Installing Guzzle
+
+The recommended way to install Guzzle is through
+[Composer](https://getcomposer.org/).
```bash
-composer.phar require guzzlehttp/guzzle
+composer require guzzlehttp/guzzle
```
-After installing, you need to require Composer's autoloader:
-```php
-require 'vendor/autoload.php';
-```
+## Version Guidance
-### Documentation
+| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version |
+|---------|------------|---------------------|--------------|---------------------|---------------------|-------|-------------|
+| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >= 5.3.3 |
+| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >= 5.4 |
+| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >= 5.4 |
+| 6.x | Security fixes | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 |
+| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >= 7.2 |
-More information can be found in the online documentation at
-http://guzzlephp.org/.
+[guzzle-3-repo]: https://github.com/guzzle/guzzle3
+[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x
+[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3
+[guzzle-6-repo]: https://github.com/guzzle/guzzle/tree/6.5
+[guzzle-7-repo]: https://github.com/guzzle/guzzle
+[guzzle-3-docs]: http://guzzle3.readthedocs.org
+[guzzle-5-docs]: http://docs.guzzlephp.org/en/5.3/
+[guzzle-6-docs]: http://docs.guzzlephp.org/en/6.5/
+[guzzle-7-docs]: http://docs.guzzlephp.org/en/latest/
diff --git a/lib/gerencianet/guzzlehttp/guzzle/UPGRADING.md b/lib/gerencianet/guzzlehttp/guzzle/UPGRADING.md
index 2b3877f..45417a7 100644
--- a/lib/gerencianet/guzzlehttp/guzzle/UPGRADING.md
+++ b/lib/gerencianet/guzzlehttp/guzzle/UPGRADING.md
@@ -1,6 +1,209 @@
Guzzle Upgrade Guide
====================
+6.0 to 7.0
+----------
+
+In order to take advantage of the new features of PHP, Guzzle dropped the support
+of PHP 5. The minimum supported PHP version is now PHP 7.2. Type hints and return
+types for functions and methods have been added wherever possible.
+
+Please make sure:
+- You are calling a function or a method with the correct type.
+- If you extend a class of Guzzle; update all signatures on methods you override.
+
+#### Other backwards compatibility breaking changes
+
+- Class `GuzzleHttp\UriTemplate` is removed.
+- Class `GuzzleHttp\Exception\SeekException` is removed.
+- Classes `GuzzleHttp\Exception\BadResponseException`, `GuzzleHttp\Exception\ClientException`,
+ `GuzzleHttp\Exception\ServerException` can no longer be initialized with an empty
+ Response as argument.
+- Class `GuzzleHttp\Exception\ConnectException` now extends `GuzzleHttp\Exception\TransferException`
+ instead of `GuzzleHttp\Exception\RequestException`.
+- Function `GuzzleHttp\Exception\ConnectException::getResponse()` is removed.
+- Function `GuzzleHttp\Exception\ConnectException::hasResponse()` is removed.
+- Constant `GuzzleHttp\ClientInterface::VERSION` is removed. Added `GuzzleHttp\ClientInterface::MAJOR_VERSION` instead.
+- Function `GuzzleHttp\Exception\RequestException::getResponseBodySummary` is removed.
+ Use `\GuzzleHttp\Psr7\get_message_body_summary` as an alternative.
+- Function `GuzzleHttp\Cookie\CookieJar::getCookieValue` is removed.
+- Request option `exception` is removed. Please use `http_errors`.
+- Request option `save_to` is removed. Please use `sink`.
+- Pool option `pool_size` is removed. Please use `concurrency`.
+- We now look for environment variables in the `$_SERVER` super global, due to thread safety issues with `getenv`. We continue to fallback to `getenv` in CLI environments, for maximum compatibility.
+- The `get`, `head`, `put`, `post`, `patch`, `delete`, `getAsync`, `headAsync`, `putAsync`, `postAsync`, `patchAsync`, and `deleteAsync` methods are now implemented as genuine methods on `GuzzleHttp\Client`, with strong typing. The original `__call` implementation remains unchanged for now, for maximum backwards compatibility, but won't be invoked under normal operation.
+- The `log` middleware will log the errors with level `error` instead of `notice`
+- Support for international domain names (IDN) is now disabled by default, and enabling it requires installing ext-intl, linked against a modern version of the C library (ICU 4.6 or higher).
+
+#### Native functions calls
+
+All internal native functions calls of Guzzle are now prefixed with a slash. This
+change makes it impossible for method overloading by other libraries or applications.
+Example:
+
+```php
+// Before:
+curl_version();
+
+// After:
+\curl_version();
+```
+
+For the full diff you can check [here](https://github.com/guzzle/guzzle/compare/6.5.4..master).
+
+5.0 to 6.0
+----------
+
+Guzzle now uses [PSR-7](https://www.php-fig.org/psr/psr-7/) for HTTP messages.
+Due to the fact that these messages are immutable, this prompted a refactoring
+of Guzzle to use a middleware based system rather than an event system. Any
+HTTP message interaction (e.g., `GuzzleHttp\Message\Request`) need to be
+updated to work with the new immutable PSR-7 request and response objects. Any
+event listeners or subscribers need to be updated to become middleware
+functions that wrap handlers (or are injected into a
+`GuzzleHttp\HandlerStack`).
+
+- Removed `GuzzleHttp\BatchResults`
+- Removed `GuzzleHttp\Collection`
+- Removed `GuzzleHttp\HasDataTrait`
+- Removed `GuzzleHttp\ToArrayInterface`
+- The `guzzlehttp/streams` dependency has been removed. Stream functionality
+ is now present in the `GuzzleHttp\Psr7` namespace provided by the
+ `guzzlehttp/psr7` package.
+- Guzzle no longer uses ReactPHP promises and now uses the
+ `guzzlehttp/promises` library. We use a custom promise library for three
+ significant reasons:
+ 1. React promises (at the time of writing this) are recursive. Promise
+ chaining and promise resolution will eventually blow the stack. Guzzle
+ promises are not recursive as they use a sort of trampolining technique.
+ Note: there has been movement in the React project to modify promises to
+ no longer utilize recursion.
+ 2. Guzzle needs to have the ability to synchronously block on a promise to
+ wait for a result. Guzzle promises allows this functionality (and does
+ not require the use of recursion).
+ 3. Because we need to be able to wait on a result, doing so using React
+ promises requires wrapping react promises with RingPHP futures. This
+ overhead is no longer needed, reducing stack sizes, reducing complexity,
+ and improving performance.
+- `GuzzleHttp\Mimetypes` has been moved to a function in
+ `GuzzleHttp\Psr7\mimetype_from_extension` and
+ `GuzzleHttp\Psr7\mimetype_from_filename`.
+- `GuzzleHttp\Query` and `GuzzleHttp\QueryParser` have been removed. Query
+ strings must now be passed into request objects as strings, or provided to
+ the `query` request option when creating requests with clients. The `query`
+ option uses PHP's `http_build_query` to convert an array to a string. If you
+ need a different serialization technique, you will need to pass the query
+ string in as a string. There are a couple helper functions that will make
+ working with query strings easier: `GuzzleHttp\Psr7\parse_query` and
+ `GuzzleHttp\Psr7\build_query`.
+- Guzzle no longer has a dependency on RingPHP. Due to the use of a middleware
+ system based on PSR-7, using RingPHP and it's middleware system as well adds
+ more complexity than the benefits it provides. All HTTP handlers that were
+ present in RingPHP have been modified to work directly with PSR-7 messages
+ and placed in the `GuzzleHttp\Handler` namespace. This significantly reduces
+ complexity in Guzzle, removes a dependency, and improves performance. RingPHP
+ will be maintained for Guzzle 5 support, but will no longer be a part of
+ Guzzle 6.
+- As Guzzle now uses a middleware based systems the event system and RingPHP
+ integration has been removed. Note: while the event system has been removed,
+ it is possible to add your own type of event system that is powered by the
+ middleware system.
+ - Removed the `Event` namespace.
+ - Removed the `Subscriber` namespace.
+ - Removed `Transaction` class
+ - Removed `RequestFsm`
+ - Removed `RingBridge`
+ - `GuzzleHttp\Subscriber\Cookie` is now provided by
+ `GuzzleHttp\Middleware::cookies`
+ - `GuzzleHttp\Subscriber\HttpError` is now provided by
+ `GuzzleHttp\Middleware::httpError`
+ - `GuzzleHttp\Subscriber\History` is now provided by
+ `GuzzleHttp\Middleware::history`
+ - `GuzzleHttp\Subscriber\Mock` is now provided by
+ `GuzzleHttp\Handler\MockHandler`
+ - `GuzzleHttp\Subscriber\Prepare` is now provided by
+ `GuzzleHttp\PrepareBodyMiddleware`
+ - `GuzzleHttp\Subscriber\Redirect` is now provided by
+ `GuzzleHttp\RedirectMiddleware`
+- Guzzle now uses `Psr\Http\Message\UriInterface` (implements in
+ `GuzzleHttp\Psr7\Uri`) for URI support. `GuzzleHttp\Url` is now gone.
+- Static functions in `GuzzleHttp\Utils` have been moved to namespaced
+ functions under the `GuzzleHttp` namespace. This requires either a Composer
+ based autoloader or you to include functions.php.
+- `GuzzleHttp\ClientInterface::getDefaultOption` has been renamed to
+ `GuzzleHttp\ClientInterface::getConfig`.
+- `GuzzleHttp\ClientInterface::setDefaultOption` has been removed.
+- The `json` and `xml` methods of response objects has been removed. With the
+ migration to strictly adhering to PSR-7 as the interface for Guzzle messages,
+ adding methods to message interfaces would actually require Guzzle messages
+ to extend from PSR-7 messages rather then work with them directly.
+
+## Migrating to middleware
+
+The change to PSR-7 unfortunately required significant refactoring to Guzzle
+due to the fact that PSR-7 messages are immutable. Guzzle 5 relied on an event
+system from plugins. The event system relied on mutability of HTTP messages and
+side effects in order to work. With immutable messages, you have to change your
+workflow to become more about either returning a value (e.g., functional
+middlewares) or setting a value on an object. Guzzle v6 has chosen the
+functional middleware approach.
+
+Instead of using the event system to listen for things like the `before` event,
+you now create a stack based middleware function that intercepts a request on
+the way in and the promise of the response on the way out. This is a much
+simpler and more predictable approach than the event system and works nicely
+with PSR-7 middleware. Due to the use of promises, the middleware system is
+also asynchronous.
+
+v5:
+
+```php
+use GuzzleHttp\Event\BeforeEvent;
+$client = new GuzzleHttp\Client();
+// Get the emitter and listen to the before event.
+$client->getEmitter()->on('before', function (BeforeEvent $e) {
+ // Guzzle v5 events relied on mutation
+ $e->getRequest()->setHeader('X-Foo', 'Bar');
+});
+```
+
+v6:
+
+In v6, you can modify the request before it is sent using the `mapRequest`
+middleware. The idiomatic way in v6 to modify the request/response lifecycle is
+to setup a handler middleware stack up front and inject the handler into a
+client.
+
+```php
+use GuzzleHttp\Middleware;
+// Create a handler stack that has all of the default middlewares attached
+$handler = GuzzleHttp\HandlerStack::create();
+// Push the handler onto the handler stack
+$handler->push(Middleware::mapRequest(function (RequestInterface $request) {
+ // Notice that we have to return a request object
+ return $request->withHeader('X-Foo', 'Bar');
+}));
+// Inject the handler into the client
+$client = new GuzzleHttp\Client(['handler' => $handler]);
+```
+
+## POST Requests
+
+This version added the [`form_params`](http://guzzle.readthedocs.org/en/latest/request-options.html#form_params)
+and `multipart` request options. `form_params` is an associative array of
+strings or array of strings and is used to serialize an
+`application/x-www-form-urlencoded` POST request. The
+[`multipart`](http://guzzle.readthedocs.org/en/latest/request-options.html#multipart)
+option is now used to send a multipart/form-data POST request.
+
+`GuzzleHttp\Post\PostFile` has been removed. Use the `multipart` option to add
+POST files to a multipart/form-data request.
+
+The `body` option no longer accepts an array to send POST requests. Please use
+`multipart` or `form_params` instead.
+
+The `base_url` option has been renamed to `base_uri`.
+
4.x to 5.0
----------
@@ -14,7 +217,7 @@ passing a `GuzzleHttp\Adapter\AdapterInterface`, you must now pass a PHP
## Removed Fluent Interfaces
-[Fluent interfaces were removed](http://ocramius.github.io/blog/fluent-interfaces-are-evil)
+[Fluent interfaces were removed](https://ocramius.github.io/blog/fluent-interfaces-are-evil/)
from the following classes:
- `GuzzleHttp\Collection`
@@ -447,7 +650,7 @@ these if needed):
The following plugins are not part of the core Guzzle package, but are provided
in separate repositories:
-- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be muchs simpler
+- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be much simpler
to build custom retry policies using simple functions rather than various
chained classes. See: https://github.com/guzzle/retry-subscriber
- `Guzzle\Http\Plugin\Cache\CachePlugin` has moved to
@@ -511,8 +714,8 @@ that contain additional metadata accessible via `getMetadata()`.
The entire concept of the StreamRequestFactory has been removed. The way this
was used in Guzzle 3 broke the actual interface of sending streaming requests
-(instead of getting back a Response, you got a StreamInterface). Streeaming
-PHP requests are now implemented throught the `GuzzleHttp\Adapter\StreamAdapter`.
+(instead of getting back a Response, you got a StreamInterface). Streaming
+PHP requests are now implemented through the `GuzzleHttp\Adapter\StreamAdapter`.
3.6 to 3.7
----------
@@ -667,7 +870,7 @@ HeaderInterface (e.g. toArray(), getAll(), etc.).
3.3 to 3.4
----------
-Base URLs of a client now follow the rules of http://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs.
+Base URLs of a client now follow the rules of https://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs.
3.2 to 3.3
----------
diff --git a/lib/gerencianet/guzzlehttp/guzzle/build/packager.php b/lib/gerencianet/guzzlehttp/guzzle/build/packager.php
deleted file mode 100644
index 724bf63..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/build/packager.php
+++ /dev/null
@@ -1,21 +0,0 @@
-deepCopy($file, $file);
-}
-
-// Copy each dependency to the staging directory. Copy *.php and *.pem files.
-$packager->recursiveCopy('src', 'GuzzleHttp', ['php']);
-$packager->recursiveCopy('vendor/react/promise/src', 'React/Promise');
-$packager->recursiveCopy('vendor/guzzlehttp/ringphp/src', 'GuzzleHttp/Ring');
-$packager->recursiveCopy('vendor/guzzlehttp/streams/src', 'GuzzleHttp/Stream');
-$packager->createAutoloader(['React/Promise/functions.php']);
-$packager->createPhar(__DIR__ . '/artifacts/guzzle.phar');
-$packager->createZip(__DIR__ . '/artifacts/guzzle.zip');
diff --git a/lib/gerencianet/guzzlehttp/guzzle/composer.json b/lib/gerencianet/guzzlehttp/guzzle/composer.json
index 6ec7dad..5da35a5 100644
--- a/lib/gerencianet/guzzlehttp/guzzle/composer.json
+++ b/lib/gerencianet/guzzlehttp/guzzle/composer.json
@@ -1,8 +1,18 @@
{
"name": "guzzlehttp/guzzle",
"type": "library",
- "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients",
- "keywords": ["framework", "http", "rest", "web service", "curl", "client", "HTTP client"],
+ "description": "Guzzle is a PHP HTTP client library",
+ "keywords": [
+ "framework",
+ "http",
+ "rest",
+ "web service",
+ "curl",
+ "client",
+ "HTTP client",
+ "PSR-7",
+ "PSR-18"
+ ],
"homepage": "http://guzzlephp.org/",
"license": "MIT",
"authors": [
@@ -10,30 +20,54 @@
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://sagikazarmark.hu"
}
],
"require": {
- "php": ">=5.4.0",
- "guzzlehttp/ringphp": "^1.1"
+ "php": "^7.2.5 || ^8.0",
+ "ext-json": "*",
+ "guzzlehttp/promises": "^1.4",
+ "guzzlehttp/psr7": "^1.7 || ^2.0",
+ "psr/http-client": "^1.0"
+ },
+ "provide": {
+ "psr/http-client-implementation": "1.0"
},
"require-dev": {
"ext-curl": "*",
- "psr/log": "^1.0",
- "phpunit/phpunit": "^4.0"
+ "bamarni/composer-bin-plugin": "^1.4.1",
+ "php-http/client-integration-tests": "^3.0",
+ "phpunit/phpunit": "^8.5.5 || ^9.3.5",
+ "psr/log": "^1.1"
+ },
+ "suggest": {
+ "ext-curl": "Required for CURL handler support",
+ "ext-intl": "Required for Internationalized Domain Name (IDN) support",
+ "psr/log": "Required for using the Log middleware"
+ },
+ "config": {
+ "sort-packages": true
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "7.3-dev"
+ }
},
"autoload": {
"psr-4": {
"GuzzleHttp\\": "src/"
- }
+ },
+ "files": [
+ "src/functions_include.php"
+ ]
},
"autoload-dev": {
"psr-4": {
"GuzzleHttp\\Tests\\": "tests/"
}
- },
- "extra": {
- "branch-alias": {
- "dev-master": "5.0-dev"
- }
}
}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/Makefile b/lib/gerencianet/guzzlehttp/guzzle/docs/Makefile
deleted file mode 100644
index d92e03f..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/docs/Makefile
+++ /dev/null
@@ -1,153 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = sphinx-build
-PAPER =
-BUILDDIR = _build
-
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-# the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
-
-help:
- @echo "Please use \`make ' where is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " texinfo to make Texinfo files"
- @echo " info to make Texinfo files and run them through makeinfo"
- @echo " gettext to make PO message catalogs"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
-
-clean:
- -rm -rf $(BUILDDIR)/*
-
-html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-dirhtml:
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-singlehtml:
- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
-
-pickle:
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
- @echo
- @echo "Build finished; now you can process the pickle files."
-
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-htmlhelp:
- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
- @echo
- @echo "Build finished; now you can run HTML Help Workshop with the" \
- ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-qthelp:
- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
- @echo
- @echo "Build finished; now you can run "qcollectiongenerator" with the" \
- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Guzzle.qhcp"
- @echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Guzzle.qhc"
-
-devhelp:
- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
- @echo
- @echo "Build finished."
- @echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/Guzzle"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Guzzle"
- @echo "# devhelp"
-
-epub:
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
- "(use \`make latexpdf' here to do that automatically)."
-
-latexpdf:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through pdflatex..."
- $(MAKE) -C $(BUILDDIR)/latex all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-text:
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-man:
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-texinfo:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo
- @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
- @echo "Run \`make' in that directory to run these through makeinfo" \
- "(use \`make info' here to do that automatically)."
-
-info:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo "Running Texinfo files through makeinfo..."
- make -C $(BUILDDIR)/texinfo info
- @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
-
-gettext:
- $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
- @echo
- @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
-
-changes:
- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
- @echo
- @echo "The overview file is in $(BUILDDIR)/changes."
-
-linkcheck:
- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
- @echo
- @echo "Link check complete; look for any errors in the above output " \
- "or in $(BUILDDIR)/linkcheck/output.txt."
-
-doctest:
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/_static/guzzle-icon.png b/lib/gerencianet/guzzlehttp/guzzle/docs/_static/guzzle-icon.png
deleted file mode 100644
index f1017f7..0000000
Binary files a/lib/gerencianet/guzzlehttp/guzzle/docs/_static/guzzle-icon.png and /dev/null differ
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/_static/logo.png b/lib/gerencianet/guzzlehttp/guzzle/docs/_static/logo.png
deleted file mode 100644
index 965a4ef..0000000
Binary files a/lib/gerencianet/guzzlehttp/guzzle/docs/_static/logo.png and /dev/null differ
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/_templates/nav_links.html b/lib/gerencianet/guzzlehttp/guzzle/docs/_templates/nav_links.html
deleted file mode 100644
index 7950a0f..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/docs/_templates/nav_links.html
+++ /dev/null
@@ -1,3 +0,0 @@
-GitHub
-Forum
-IRC
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/clients.rst b/lib/gerencianet/guzzlehttp/guzzle/docs/clients.rst
deleted file mode 100644
index 35a9806..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/docs/clients.rst
+++ /dev/null
@@ -1,1326 +0,0 @@
-=======
-Clients
-=======
-
-Clients are used to create requests, create transactions, send requests
-through an HTTP handler, and return a response. You can add default request
-options to a client that are applied to every request (e.g., default headers,
-default query string parameters, etc.), and you can add event listeners and
-subscribers to every request created by a client.
-
-Creating a client
-=================
-
-The constructor of a client accepts an associative array of configuration
-options.
-
-base_url
- Configures a base URL for the client so that requests created
- using a relative URL are combined with the ``base_url`` of the client
- according to section `5.2 of RFC 3986 `_.
-
- .. code-block:: php
-
- // Create a client with a base URL
- $client = new GuzzleHttp\Client(['base_url' => 'https://github.com']);
- // Send a request to https://github.com/notifications
- $response = $client->get('/notifications');
-
- Don't feel like reading RFC 3986? Here are some quick examples on how a
- ``base_url`` is resolved with another URI.
-
- ======================= ================== ===============================
- base_url URI Result
- ======================= ================== ===============================
- ``http://foo.com`` ``/bar`` ``http://foo.com/bar``
- ``http://foo.com/foo`` ``/bar`` ``http://foo.com/bar``
- ``http://foo.com/foo`` ``bar`` ``http://foo.com/bar``
- ``http://foo.com/foo/`` ``bar`` ``http://foo.com/foo/bar``
- ``http://foo.com`` ``http://baz.com`` ``http://baz.com``
- ``http://foo.com/?bar`` ``bar`` ``http://foo.com/bar``
- ======================= ================== ===============================
-
-handler
- Configures the `RingPHP handler `_
- used to transfer the HTTP requests of a client. Guzzle will, by default,
- utilize a stacked handlers that chooses the best handler to use based on the
- provided request options and based on the extensions available in the
- environment.
-
-message_factory
- Specifies the factory used to create HTTP requests and responses
- (``GuzzleHttp\Message\MessageFactoryInterface``).
-
-defaults
- Associative array of :ref:`request-options` that are applied to every
- request created by the client. This allows you to specify things like
- default headers (e.g., User-Agent), default query string parameters, SSL
- configurations, and any other supported request options.
-
-emitter
- Specifies an event emitter (``GuzzleHttp\Event\EmitterInterface``) instance
- to be used by the client to emit request events. This option is useful if
- you need to inject an emitter with listeners/subscribers already attached.
-
-Here's an example of creating a client with various options.
-
-.. code-block:: php
-
- use GuzzleHttp\Client;
-
- $client = new Client([
- 'base_url' => ['https://api.twitter.com/{version}/', ['version' => 'v1.1']],
- 'defaults' => [
- 'headers' => ['Foo' => 'Bar'],
- 'query' => ['testing' => '123'],
- 'auth' => ['username', 'password'],
- 'proxy' => 'tcp://localhost:80'
- ]
- ]);
-
-Sending Requests
-================
-
-Requests can be created using various methods of a client. You can create
-**and** send requests using one of the following methods:
-
-- ``GuzzleHttp\Client::get``: Sends a GET request.
-- ``GuzzleHttp\Client::head``: Sends a HEAD request
-- ``GuzzleHttp\Client::post``: Sends a POST request
-- ``GuzzleHttp\Client::put``: Sends a PUT request
-- ``GuzzleHttp\Client::delete``: Sends a DELETE request
-- ``GuzzleHttp\Client::options``: Sends an OPTIONS request
-
-Each of the above methods accepts a URL as the first argument and an optional
-associative array of :ref:`request-options` as the second argument.
-
-Synchronous Requests
---------------------
-
-Guzzle sends synchronous (blocking) requests when the ``future`` request option
-is not specified. This means that the request will complete immediately, and if
-an error is encountered, a ``GuzzleHttp\Exception\RequestException`` will be
-thrown.
-
-.. code-block:: php
-
- $client = new GuzzleHttp\Client();
-
- $client->put('http://httpbin.org', [
- 'headers' => ['X-Foo' => 'Bar'],
- 'body' => 'this is the body!',
- 'save_to' => '/path/to/local/file',
- 'allow_redirects' => false,
- 'timeout' => 5
- ]);
-
-Synchronous Error Handling
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-When a recoverable error is encountered while calling the ``send()`` method of
-a client, a ``GuzzleHttp\Exception\RequestException`` is thrown.
-
-.. code-block:: php
-
- use GuzzleHttp\Client;
- use GuzzleHttp\Exception\RequestException;
-
- $client = new Client();
-
- try {
- $client->get('http://httpbin.org');
- } catch (RequestException $e) {
- echo $e->getRequest() . "\n";
- if ($e->hasResponse()) {
- echo $e->getResponse() . "\n";
- }
- }
-
-``GuzzleHttp\Exception\RequestException`` always contains a
-``GuzzleHttp\Message\RequestInterface`` object that can be accessed using the
-exception's ``getRequest()`` method.
-
-A response might be present in the exception. In the event of a networking
-error, no response will be received. You can check if a ``RequestException``
-has a response using the ``hasResponse()`` method. If the exception has a
-response, then you can access the associated
-``GuzzleHttp\Message\ResponseInterface`` using the ``getResponse()`` method of
-the exception.
-
-Asynchronous Requests
----------------------
-
-You can send asynchronous requests by setting the ``future`` request option
-to ``true`` (or a string that your handler understands). This creates a
-``GuzzleHttp\Message\FutureResponse`` object that has not yet completed. Once
-you have a future response, you can use a promise object obtained by calling
-the ``then`` method of the response to take an action when the response has
-completed or encounters an error.
-
-.. code-block:: php
-
- $response = $client->put('http://httpbin.org/get', ['future' => true]);
-
- // Call the function when the response completes
- $response->then(function ($response) {
- echo $response->getStatusCode();
- });
-
-You can call the ``wait()`` method of a future response to block until it has
-completed. You also use a future response object just like a normal response
-object by accessing the methods of the response. Using a future response like a
-normal response object, also known as *dereferencing*, will block until the
-response has completed.
-
-.. code-block:: php
-
- $response = $client->put('http://httpbin.org/get', ['future' => true]);
-
- // Block until the response has completed
- echo $response->getStatusCode();
-
-.. important::
-
- If an exception occurred while transferring the future response, then the
- exception encountered will be thrown when dereferencing.
-
-.. note::
-
- It depends on the RingPHP handler used by a client, but you typically need
- to use the same RingPHP handler in order to utilize asynchronous requests
- across multiple clients.
-
-Asynchronous Error Handling
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Handling errors with future response object promises is a bit different. When
-using a promise, exceptions are forwarded to the ``$onError`` function provided
-to the second argument of the ``then()`` function.
-
-.. code-block:: php
-
- $response = $client->put('http://httpbin.org/get', ['future' => true]);
-
- $response
- ->then(
- function ($response) {
- // This is called when the request succeeded
- echo 'Success: ' . $response->getStatusCode();
- // Returning a value will forward the value to the next promise
- // in the chain.
- return $response;
- },
- function ($error) {
- // This is called when the exception failed.
- echo 'Exception: ' . $error->getMessage();
- // Throwing will "forward" the exception to the next promise
- // in the chain.
- throw $error;
- }
- )
- ->then(
- function($response) {
- // This is called after the first promise in the chain. It
- // receives the value returned from the first promise.
- echo $response->getReasonPhrase();
- },
- function ($error) {
- // This is called if the first promise error handler in the
- // chain rethrows the exception.
- echo 'Error: ' . $error->getMessage();
- }
- );
-
-Please see the `React/Promises project documentation `_
-for more information on how promise resolution and rejection forwarding works.
-
-HTTP Errors
------------
-
-If the ``exceptions`` request option is not set to ``false``, then exceptions
-are thrown for HTTP protocol errors as well:
-``GuzzleHttp\Exception\ClientErrorResponseException`` for 4xx level HTTP
-responses and ``GuzzleHttp\Exception\ServerException`` for 5xx level responses,
-both of which extend from ``GuzzleHttp\Exception\BadResponseException``.
-
-Creating Requests
------------------
-
-You can create a request without sending it. This is useful for building up
-requests over time or sending requests in concurrently.
-
-.. code-block:: php
-
- $request = $client->createRequest('GET', 'http://httpbin.org', [
- 'headers' => ['X-Foo' => 'Bar']
- ]);
-
- // Modify the request as needed
- $request->setHeader('Baz', 'bar');
-
-After creating a request, you can send it with the client's ``send()`` method.
-
-.. code-block:: php
-
- $response = $client->send($request);
-
-Sending Requests With a Pool
-============================
-
-You can send requests concurrently using a fixed size pool via the
-``GuzzleHttp\Pool`` class. The Pool class is an implementation of
-``GuzzleHttp\Ring\Future\FutureInterface``, meaning it can be dereferenced at a
-later time or cancelled before sending. The Pool constructor accepts a client
-object, iterator or array that yields ``GuzzleHttp\Message\RequestInterface``
-objects, and an optional associative array of options that can be used to
-affect the transfer.
-
-.. code-block:: php
-
- use GuzzleHttp\Pool;
-
- $requests = [
- $client->createRequest('GET', 'http://httpbin.org'),
- $client->createRequest('DELETE', 'http://httpbin.org/delete'),
- $client->createRequest('PUT', 'http://httpbin.org/put', ['body' => 'test'])
- ];
-
- $options = [];
-
- // Create a pool. Note: the options array is optional.
- $pool = new Pool($client, $requests, $options);
-
- // Send the requests
- $pool->wait();
-
-The Pool constructor accepts the following associative array of options:
-
-- **pool_size**: Integer representing the maximum number of requests that are
- allowed to be sent concurrently.
-- **before**: Callable or array representing the event listeners to add to
- each request's :ref:`before_event` event.
-- **complete**: Callable or array representing the event listeners to add to
- each request's :ref:`complete_event` event.
-- **error**: Callable or array representing the event listeners to add to
- each request's :ref:`error_event` event.
-- **end**: Callable or array representing the event listeners to add to
- each request's :ref:`end_event` event.
-
-The "before", "complete", "error", and "end" event options accept a callable or
-an array of associative arrays where each associative array contains a "fn" key
-with a callable value, an optional "priority" key representing the event
-priority (with a default value of 0), and an optional "once" key that can be
-set to true so that the event listener will be removed from the request after
-it is first triggered.
-
-.. code-block:: php
-
- use GuzzleHttp\Pool;
- use GuzzleHttp\Event\CompleteEvent;
-
- // Add a single event listener using a callable.
- Pool::send($client, $requests, [
- 'complete' => function (CompleteEvent $event) {
- echo 'Completed request to ' . $event->getRequest()->getUrl() . "\n";
- echo 'Response: ' . $event->getResponse()->getBody() . "\n\n";
- }
- ]);
-
- // The above is equivalent to the following, but the following structure
- // allows you to add multiple event listeners to the same event name.
- Pool::send($client, $requests, [
- 'complete' => [
- [
- 'fn' => function (CompleteEvent $event) { /* ... */ },
- 'priority' => 0, // Optional
- 'once' => false // Optional
- ]
- ]
- ]);
-
-Asynchronous Response Handling
-------------------------------
-
-When sending requests concurrently using a pool, the request/response/error
-lifecycle must be handled asynchronously. This means that you give the Pool
-multiple requests and handle the response or errors that is associated with the
-request using event callbacks.
-
-.. code-block:: php
-
- use GuzzleHttp\Pool;
- use GuzzleHttp\Event\ErrorEvent;
-
- Pool::send($client, $requests, [
- 'complete' => function (CompleteEvent $event) {
- echo 'Completed request to ' . $event->getRequest()->getUrl() . "\n";
- echo 'Response: ' . $event->getResponse()->getBody() . "\n\n";
- // Do something with the completion of the request...
- },
- 'error' => function (ErrorEvent $event) {
- echo 'Request failed: ' . $event->getRequest()->getUrl() . "\n";
- echo $event->getException();
- // Do something to handle the error...
- }
- ]);
-
-The ``GuzzleHttp\Event\ErrorEvent`` event object is emitted when an error
-occurs during a transfer. With this event, you have access to the request that
-was sent, the response that was received (if one was received), access to
-transfer statistics, and the ability to intercept the exception with a
-different ``GuzzleHttp\Message\ResponseInterface`` object. See :doc:`events`
-for more information.
-
-Handling Errors After Transferring
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-It sometimes might be easier to handle all of the errors that occurred during a
-transfer after all of the requests have been sent. Here we are adding each
-failed request to an array that we can use to process errors later.
-
-.. code-block:: php
-
- use GuzzleHttp\Pool;
- use GuzzleHttp\Event\ErrorEvent;
-
- $errors = [];
- Pool::send($client, $requests, [
- 'error' => function (ErrorEvent $event) use (&$errors) {
- $errors[] = $event;
- }
- ]);
-
- foreach ($errors as $error) {
- // Handle the error...
- }
-
-.. _batch-requests:
-
-Batching Requests
------------------
-
-Sometimes you just want to send a few requests concurrently and then process
-the results all at once after they've been sent. Guzzle provides a convenience
-function ``GuzzleHttp\Pool::batch()`` that makes this very simple:
-
-.. code-block:: php
-
- use GuzzleHttp\Pool;
- use GuzzleHttp\Client;
-
- $client = new Client();
-
- $requests = [
- $client->createRequest('GET', 'http://httpbin.org/get'),
- $client->createRequest('HEAD', 'http://httpbin.org/get'),
- $client->createRequest('PUT', 'http://httpbin.org/put'),
- ];
-
- // Results is a GuzzleHttp\BatchResults object.
- $results = Pool::batch($client, $requests);
-
- // Can be accessed by index.
- echo $results[0]->getStatusCode();
-
- // Can be accessed by request.
- echo $results->getResult($requests[0])->getStatusCode();
-
- // Retrieve all successful responses
- foreach ($results->getSuccessful() as $response) {
- echo $response->getStatusCode() . "\n";
- }
-
- // Retrieve all failures.
- foreach ($results->getFailures() as $requestException) {
- echo $requestException->getMessage() . "\n";
- }
-
-``GuzzleHttp\Pool::batch()`` accepts an optional associative array of options
-in the third argument that allows you to specify the 'before', 'complete',
-'error', and 'end' events as well as specify the maximum number of requests to
-send concurrently using the 'pool_size' option key.
-
-.. _request-options:
-
-Request Options
-===============
-
-You can customize requests created by a client using **request options**.
-Request options control various aspects of a request including, headers,
-query string parameters, timeout settings, the body of a request, and much
-more.
-
-All of the following examples use the following client:
-
-.. code-block:: php
-
- $client = new GuzzleHttp\Client(['base_url' => 'http://httpbin.org']);
-
-headers
--------
-
-:Summary: Associative array of headers to add to the request. Each key is the
- name of a header, and each value is a string or array of strings
- representing the header field values.
-:Types: array
-:Defaults: None
-
-.. code-block:: php
-
- // Set various headers on a request
- $client->get('/get', [
- 'headers' => [
- 'User-Agent' => 'testing/1.0',
- 'Accept' => 'application/json',
- 'X-Foo' => ['Bar', 'Baz']
- ]
- ]);
-
-body
-----
-
-:Summary: The ``body`` option is used to control the body of an entity
- enclosing request (e.g., PUT, POST, PATCH).
-:Types:
- - string
- - ``fopen()`` resource
- - ``GuzzleHttp\Stream\StreamInterface``
- - ``GuzzleHttp\Post\PostBodyInterface``
-:Default: None
-
-This setting can be set to any of the following types:
-
-- string
-
- .. code-block:: php
-
- // You can send requests that use a string as the message body.
- $client->put('/put', ['body' => 'foo']);
-
-- resource returned from ``fopen()``
-
- .. code-block:: php
-
- // You can send requests that use a stream resource as the body.
- $resource = fopen('http://httpbin.org', 'r');
- $client->put('/put', ['body' => $resource]);
-
-- Array
-
- Use an array to send POST style requests that use a
- ``GuzzleHttp\Post\PostBodyInterface`` object as the body.
-
- .. code-block:: php
-
- // You can send requests that use a POST body containing fields & files.
- $client->post('/post', [
- 'body' => [
- 'field' => 'abc',
- 'other_field' => '123',
- 'file_name' => fopen('/path/to/file', 'r')
- ]
- ]);
-
-- ``GuzzleHttp\Stream\StreamInterface``
-
- .. code-block:: php
-
- // You can send requests that use a Guzzle stream object as the body
- $stream = GuzzleHttp\Stream\Stream::factory('contents...');
- $client->post('/post', ['body' => $stream]);
-
-json
-----
-
-:Summary: The ``json`` option is used to easily upload JSON encoded data as the
- body of a request. A Content-Type header of ``application/json`` will be
- added if no Content-Type header is already present on the message.
-:Types:
- Any PHP type that can be operated on by PHP's ``json_encode()`` function.
-:Default: None
-
-.. code-block:: php
-
- $request = $client->createRequest('PUT', '/put', ['json' => ['foo' => 'bar']]);
- echo $request->getHeader('Content-Type');
- // application/json
- echo $request->getBody();
- // {"foo":"bar"}
-
-.. note::
-
- This request option does not support customizing the Content-Type header
- or any of the options from PHP's `json_encode() `_
- function. If you need to customize these settings, then you must pass the
- JSON encoded data into the request yourself using the ``body`` request
- option and you must specify the correct Content-Type header using the
- ``headers`` request option.
-
-query
------
-
-:Summary: Associative array of query string values to add to the request.
-:Types:
- - array
- - ``GuzzleHttp\Query``
-:Default: None
-
-.. code-block:: php
-
- // Send a GET request to /get?foo=bar
- $client->get('/get', ['query' => ['foo' => 'bar']]);
-
-Query strings specified in the ``query`` option are combined with any query
-string values that are parsed from the URL.
-
-.. code-block:: php
-
- // Send a GET request to /get?abc=123&foo=bar
- $client->get('/get?abc=123', ['query' => ['foo' => 'bar']]);
-
-auth
-----
-
-:Summary: Pass an array of HTTP authentication parameters to use with the
- request. The array must contain the username in index [0], the password in
- index [1], and you can optionally provide a built-in authentication type in
- index [2]. Pass ``null`` to disable authentication for a request.
-:Types:
- - array
- - string
- - null
-:Default: None
-
-The built-in authentication types are as follows:
-
-basic
- Use `basic HTTP authentication `_ in
- the ``Authorization`` header (the default setting used if none is
- specified).
-
- .. code-block:: php
-
- $client->get('/get', ['auth' => ['username', 'password']]);
-
-digest
- Use `digest authentication `_ (must be
- supported by the HTTP handler).
-
- .. code-block:: php
-
- $client->get('/get', ['auth' => ['username', 'password', 'digest']]);
-
- *This is currently only supported when using the cURL handler, but creating
- a replacement that can be used with any HTTP handler is planned.*
-
-.. important::
-
- The authentication type (whether it's provided as a string or as the third
- option in an array) is always converted to a lowercase string. Take this
- into account when implementing custom authentication types and when
- implementing custom message factories.
-
-Custom Authentication Schemes
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You can also provide a string representing a custom authentication type name.
-When using a custom authentication type string, you will need to implement
-the authentication method in an event listener that checks the ``auth`` request
-option of a request before it is sent. Authentication listeners that require
-a request is not modified after they are signed should have a very low priority
-to ensure that they are fired last or near last in the event chain.
-
-.. code-block:: php
-
- use GuzzleHttp\Event\BeforeEvent;
- use GuzzleHttp\Event\RequestEvents;
-
- /**
- * Custom authentication listener that handles the "foo" auth type.
- *
- * Listens to the "before" event of a request and only modifies the request
- * when the "auth" config setting of the request is "foo".
- */
- class FooAuth implements GuzzleHttp\Event\SubscriberInterface
- {
- private $password;
-
- public function __construct($password)
- {
- $this->password = $password;
- }
-
- public function getEvents()
- {
- return ['before' => ['sign', RequestEvents::SIGN_REQUEST]];
- }
-
- public function sign(BeforeEvent $e)
- {
- if ($e->getRequest()->getConfig()['auth'] == 'foo') {
- $e->getRequest()->setHeader('X-Foo', 'Foo ' . $this->password);
- }
- }
- }
-
- $client->getEmitter()->attach(new FooAuth('password'));
- $client->get('/', ['auth' => 'foo']);
-
-Adapter Specific Authentication Schemes
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-If you need to use authentication methods provided by cURL (e.g., NTLM, GSS,
-etc.), then you need to specify a curl handler option in the ``options``
-request option array. See :ref:`config-option` for more information.
-
-.. _cookies-option:
-
-cookies
--------
-
-:Summary: Specifies whether or not cookies are used in a request or what cookie
- jar to use or what cookies to send.
-:Types:
- - bool
- - array
- - ``GuzzleHttp\Cookie\CookieJarInterface``
-:Default: None
-
-Set to ``true`` to use a shared cookie session associated with the client.
-
-.. code-block:: php
-
- // Enable cookies using the shared cookie jar of the client.
- $client->get('/get', ['cookies' => true]);
-
-Pass an associative array containing cookies to send in the request and start a
-new cookie session.
-
-.. code-block:: php
-
- // Enable cookies and send specific cookies
- $client->get('/get', ['cookies' => ['foo' => 'bar']]);
-
-Set to a ``GuzzleHttp\Cookie\CookieJarInterface`` object to use an existing
-cookie jar.
-
-.. code-block:: php
-
- $jar = new GuzzleHttp\Cookie\CookieJar();
- $client->get('/get', ['cookies' => $jar]);
-
-.. _allow_redirects-option:
-
-allow_redirects
----------------
-
-:Summary: Describes the redirect behavior of a request
-:Types:
- - bool
- - array
-:Default:
- ::
-
- [
- 'max' => 5,
- 'strict' => false,
- 'referer' => true,
- 'protocols' => ['http', 'https']
- ]
-
-Set to ``false`` to disable redirects.
-
-.. code-block:: php
-
- $res = $client->get('/redirect/3', ['allow_redirects' => false]);
- echo $res->getStatusCode();
- // 302
-
-Set to ``true`` (the default setting) to enable normal redirects with a maximum
-number of 5 redirects.
-
-.. code-block:: php
-
- $res = $client->get('/redirect/3');
- echo $res->getStatusCode();
- // 200
-
-Pass an associative array containing the 'max' key to specify the maximum
-number of redirects, provide a 'strict' key value to specify whether or not to
-use strict RFC compliant redirects (meaning redirect POST requests with POST
-requests vs. doing what most browsers do which is redirect POST requests with
-GET requests), provide a 'referer' key to specify whether or not the "Referer"
-header should be added when redirecting, and provide a 'protocols' array that
-specifies which protocols are supported for redirects (defaults to
-``['http', 'https']``).
-
-.. code-block:: php
-
- $res = $client->get('/redirect/3', [
- 'allow_redirects' => [
- 'max' => 10, // allow at most 10 redirects.
- 'strict' => true, // use "strict" RFC compliant redirects.
- 'referer' => true, // add a Referer header
- 'protocols' => ['https'] // only allow https URLs
- ]
- ]);
- echo $res->getStatusCode();
- // 200
-
-decode_content
---------------
-
-:Summary: Specify whether or not ``Content-Encoding`` responses (gzip,
- deflate, etc.) are automatically decoded.
-:Types:
- - string
- - bool
-:Default: ``true``
-
-This option can be used to control how content-encoded response bodies are
-handled. By default, ``decode_content`` is set to true, meaning any gzipped
-or deflated response will be decoded by Guzzle.
-
-When set to ``false``, the body of a response is never decoded, meaning the
-bytes pass through the handler unchanged.
-
-.. code-block:: php
-
- // Request gzipped data, but do not decode it while downloading
- $client->get('/foo.js', [
- 'headers' => ['Accept-Encoding' => 'gzip'],
- 'decode_content' => false
- ]);
-
-When set to a string, the bytes of a response are decoded and the string value
-provided to the ``decode_content`` option is passed as the ``Accept-Encoding``
-header of the request.
-
-.. code-block:: php
-
- // Pass "gzip" as the Accept-Encoding header.
- $client->get('/foo.js', ['decode_content' => 'gzip']);
-
-.. _save_to-option:
-
-save_to
--------
-
-:Summary: Specify where the body of a response will be saved.
-:Types:
- - string
- - ``fopen()`` resource
- - ``GuzzleHttp\Stream\StreamInterface``
-:Default: PHP temp stream
-
-Pass a string to specify the path to a file that will store the contents of the
-response body:
-
-.. code-block:: php
-
- $client->get('/stream/20', ['save_to' => '/path/to/file']);
-
-Pass a resource returned from ``fopen()`` to write the response to a PHP stream:
-
-.. code-block:: php
-
- $resource = fopen('/path/to/file', 'w');
- $client->get('/stream/20', ['save_to' => $resource]);
-
-Pass a ``GuzzleHttp\Stream\StreamInterface`` object to stream the response body
-to an open Guzzle stream:
-
-.. code-block:: php
-
- $resource = fopen('/path/to/file', 'w');
- $stream = GuzzleHttp\Stream\Stream::factory($resource);
- $client->get('/stream/20', ['save_to' => $stream]);
-
-.. _events-option:
-
-events
-------
-
-:Summary: An associative array mapping event names to a callable. Or an
- associative array containing the 'fn' key that maps to a callable, an
- optional 'priority' key used to specify the event priority, and an optional
- 'once' key used to specify if the event should remove itself the first time
- it is triggered.
-:Types: array
-:Default: None
-
-.. code-block:: php
-
- use GuzzleHttp\Event\BeforeEvent;
- use GuzzleHttp\Event\HeadersEvent;
- use GuzzleHttp\Event\CompleteEvent;
- use GuzzleHttp\Event\ErrorEvent;
-
- $client->get('/', [
- 'events' => [
- 'before' => function (BeforeEvent $e) { echo 'Before'; },
- 'complete' => function (CompleteEvent $e) { echo 'Complete'; },
- 'error' => function (ErrorEvent $e) { echo 'Error'; },
- ]
- ]);
-
-Here's an example of using the associative array format for control over the
-priority and whether or not an event should be triggered more than once.
-
-.. code-block:: php
-
- $client->get('/', [
- 'events' => [
- 'before' => [
- 'fn' => function (BeforeEvent $e) { echo 'Before'; },
- 'priority' => 100,
- 'once' => true
- ]
- ]
- ]);
-
-.. _subscribers-option:
-
-subscribers
------------
-
-:Summary: Array of event subscribers to add to the request. Each value in the
- array must be an instance of ``GuzzleHttp\Event\SubscriberInterface``.
-:Types: array
-:Default: None
-
-.. code-block:: php
-
- use GuzzleHttp\Subscriber\History;
- use GuzzleHttp\Subscriber\Mock;
- use GuzzleHttp\Message\Response;
-
- $history = new History();
- $mock = new Mock([new Response(200)]);
- $client->get('/', ['subscribers' => [$history, $mock]]);
-
- echo $history;
- // Outputs the request and response history
-
-.. _exceptions-option:
-
-exceptions
-----------
-
-:Summary: Set to ``false`` to disable throwing exceptions on an HTTP protocol
- errors (i.e., 4xx and 5xx responses). Exceptions are thrown by default when
- HTTP protocol errors are encountered.
-:Types: bool
-:Default: ``true``
-
-.. code-block:: php
-
- $client->get('/status/500');
- // Throws a GuzzleHttp\Exception\ServerException
-
- $res = $client->get('/status/500', ['exceptions' => false]);
- echo $res->getStatusCode();
- // 500
-
-.. _timeout-option:
-
-timeout
--------
-
-:Summary: Float describing the timeout of the request in seconds. Use ``0``
- to wait indefinitely (the default behavior).
-:Types: float
-:Default: ``0``
-
-.. code-block:: php
-
- // Timeout if a server does not return a response in 3.14 seconds.
- $client->get('/delay/5', ['timeout' => 3.14]);
- // PHP Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException'
-
-.. _connect_timeout-option:
-
-connect_timeout
----------------
-
-:Summary: Float describing the number of seconds to wait while trying to connect
- to a server. Use ``0`` to wait indefinitely (the default behavior).
-:Types: float
-:Default: ``0``
-
-.. code-block:: php
-
- // Timeout if the client fails to connect to the server in 3.14 seconds.
- $client->get('/delay/5', ['connect_timeout' => 3.14]);
-
-.. note::
-
- This setting must be supported by the HTTP handler used to send a request.
- ``connect_timeout`` is currently only supported by the built-in cURL
- handler.
-
-.. _verify-option:
-
-verify
-------
-
-:Summary: Describes the SSL certificate verification behavior of a request.
-
- - Set to ``true`` to enable SSL certificate verification and use the default
- CA bundle provided by operating system.
- - Set to ``false`` to disable certificate verification (this is insecure!).
- - Set to a string to provide the path to a CA bundle to enable verification
- using a custom certificate.
-:Types:
- - bool
- - string
-:Default: ``true``
-
-.. code-block:: php
-
- // Use the system's CA bundle (this is the default setting)
- $client->get('/', ['verify' => true]);
-
- // Use a custom SSL certificate on disk.
- $client->get('/', ['verify' => '/path/to/cert.pem']);
-
- // Disable validation entirely (don't do this!).
- $client->get('/', ['verify' => false]);
-
-Not all system's have a known CA bundle on disk. For example, Windows and
-OS X do not have a single common location for CA bundles. When setting
-"verify" to ``true``, Guzzle will do its best to find the most appropriate
-CA bundle on your system. When using cURL or the PHP stream wrapper on PHP
-versions >= 5.6, this happens by default. When using the PHP stream
-wrapper on versions < 5.6, Guzzle tries to find your CA bundle in the
-following order:
-
-1. Check if ``openssl.cafile`` is set in your php.ini file.
-2. Check if ``curl.cainfo`` is set in your php.ini file.
-3. Check if ``/etc/pki/tls/certs/ca-bundle.crt`` exists (Red Hat, CentOS,
- Fedora; provided by the ca-certificates package)
-4. Check if ``/etc/ssl/certs/ca-certificates.crt`` exists (Ubuntu, Debian;
- provided by the ca-certificates package)
-5. Check if ``/usr/local/share/certs/ca-root-nss.crt`` exists (FreeBSD;
- provided by the ca_root_nss package)
-6. Check if ``/usr/local/etc/openssl/cert.pem`` (OS X; provided by homebrew)
-7. Check if ``C:\windows\system32\curl-ca-bundle.crt`` exists (Windows)
-8. Check if ``C:\windows\curl-ca-bundle.crt`` exists (Windows)
-
-The result of this lookup is cached in memory so that subsequent calls
-in the same process will return very quickly. However, when sending only
-a single request per-process in something like Apache, you should consider
-setting the ``openssl.cafile`` environment variable to the path on disk
-to the file so that this entire process is skipped.
-
-If you do not need a specific certificate bundle, then Mozilla provides a
-commonly used CA bundle which can be downloaded
-`here `_
-(provided by the maintainer of cURL). Once you have a CA bundle available on
-disk, you can set the "openssl.cafile" PHP ini setting to point to the path to
-the file, allowing you to omit the "verify" request option. Much more detail on
-SSL certificates can be found on the
-`cURL website `_.
-
-.. _cert-option:
-
-cert
-----
-
-:Summary: Set to a string to specify the path to a file containing a PEM
- formatted client side certificate. If a password is required, then set to
- an array containing the path to the PEM file in the first array element
- followed by the password required for the certificate in the second array
- element.
-:Types:
- - string
- - array
-:Default: None
-
-.. code-block:: php
-
- $client->get('/', ['cert' => ['/path/server.pem', 'password']]);
-
-.. _ssl_key-option:
-
-ssl_key
--------
-
-:Summary: Specify the path to a file containing a private SSL key in PEM
- format. If a password is required, then set to an array containing the path
- to the SSL key in the first array element followed by the password required
- for the certificate in the second element.
-:Types:
- - string
- - array
-:Default: None
-
-.. note::
-
- ``ssl_key`` is implemented by HTTP handlers. This is currently only
- supported by the cURL handler, but might be supported by other third-part
- handlers.
-
-.. _proxy-option:
-
-proxy
------
-
-:Summary: Pass a string to specify an HTTP proxy, or an array to specify
- different proxies for different protocols.
-:Types:
- - string
- - array
-:Default: None
-
-Pass a string to specify a proxy for all protocols.
-
-.. code-block:: php
-
- $client->get('/', ['proxy' => 'tcp://localhost:8125']);
-
-Pass an associative array to specify HTTP proxies for specific URI schemes
-(i.e., "http", "https").
-
-.. code-block:: php
-
- $client->get('/', [
- 'proxy' => [
- 'http' => 'tcp://localhost:8125', // Use this proxy with "http"
- 'https' => 'tcp://localhost:9124' // Use this proxy with "https"
- ]
- ]);
-
-.. note::
-
- You can provide proxy URLs that contain a scheme, username, and password.
- For example, ``"http://username:password@192.168.16.1:10"``.
-
-.. _debug-option:
-
-debug
------
-
-:Summary: Set to ``true`` or set to a PHP stream returned by ``fopen()`` to
- enable debug output with the handler used to send a request. For example,
- when using cURL to transfer requests, cURL's verbose of ``CURLOPT_VERBOSE``
- will be emitted. When using the PHP stream wrapper, stream wrapper
- notifications will be emitted. If set to true, the output is written to
- PHP's STDOUT. If a PHP stream is provided, output is written to the stream.
-:Types:
- - bool
- - ``fopen()`` resource
-:Default: None
-
-.. code-block:: php
-
- $client->get('/get', ['debug' => true]);
-
-Running the above example would output something like the following:
-
-::
-
- * About to connect() to httpbin.org port 80 (#0)
- * Trying 107.21.213.98... * Connected to httpbin.org (107.21.213.98) port 80 (#0)
- > GET /get HTTP/1.1
- Host: httpbin.org
- User-Agent: Guzzle/4.0 curl/7.21.4 PHP/5.5.7
-
- < HTTP/1.1 200 OK
- < Access-Control-Allow-Origin: *
- < Content-Type: application/json
- < Date: Sun, 16 Feb 2014 06:50:09 GMT
- < Server: gunicorn/0.17.4
- < Content-Length: 335
- < Connection: keep-alive
- <
- * Connection #0 to host httpbin.org left intact
-
-.. _stream-option:
-
-stream
-------
-
-:Summary: Set to ``true`` to stream a response rather than download it all
- up-front.
-:Types: bool
-:Default: ``false``
-
-.. code-block:: php
-
- $response = $client->get('/stream/20', ['stream' => true]);
- // Read bytes off of the stream until the end of the stream is reached
- $body = $response->getBody();
- while (!$body->eof()) {
- echo $body->read(1024);
- }
-
-.. note::
-
- Streaming response support must be implemented by the HTTP handler used by
- a client. This option might not be supported by every HTTP handler, but the
- interface of the response object remains the same regardless of whether or
- not it is supported by the handler.
-
-.. _expect-option:
-
-expect
-------
-
-:Summary: Controls the behavior of the "Expect: 100-Continue" header.
-:Types:
- - bool
- - integer
-:Default: ``1048576``
-
-Set to ``true`` to enable the "Expect: 100-Continue" header for all requests
-that sends a body. Set to ``false`` to disable the "Expect: 100-Continue"
-header for all requests. Set to a number so that the size of the payload must
-be greater than the number in order to send the Expect header. Setting to a
-number will send the Expect header for all requests in which the size of the
-payload cannot be determined or where the body is not rewindable.
-
-By default, Guzzle will add the "Expect: 100-Continue" header when the size of
-the body of a request is greater than 1 MB and a request is using HTTP/1.1.
-
-.. note::
-
- This option only takes effect when using HTTP/1.1. The HTTP/1.0 and
- HTTP/2.0 protocols do not support the "Expect: 100-Continue" header.
- Support for handling the "Expect: 100-Continue" workflow must be
- implemented by Guzzle HTTP handlers used by a client.
-
-.. _version-option:
-
-version
--------
-
-:Summary: Protocol version to use with the request.
-:Types: string, float
-:Default: ``1.1``
-
-.. code-block:: php
-
- // Force HTTP/1.0
- $request = $client->createRequest('GET', '/get', ['version' => 1.0]);
- echo $request->getProtocolVersion();
- // 1.0
-
-.. _config-option:
-
-config
-------
-
-:Summary: Associative array of config options that are forwarded to a request's
- configuration collection. These values are used as configuration options
- that can be consumed by plugins and handlers.
-:Types: array
-:Default: None
-
-.. code-block:: php
-
- $request = $client->createRequest('GET', '/get', ['config' => ['foo' => 'bar']]);
- echo $request->getConfig('foo');
- // 'bar'
-
-Some HTTP handlers allow you to specify custom handler-specific settings. For
-example, you can pass custom cURL options to requests by passing an associative
-array in the ``config`` request option under the ``curl`` key.
-
-.. code-block:: php
-
- // Use custom cURL options with the request. This example uses NTLM auth
- // to authenticate with a server.
- $client->get('/', [
- 'config' => [
- 'curl' => [
- CURLOPT_HTTPAUTH => CURLAUTH_NTLM,
- CURLOPT_USERPWD => 'username:password'
- ]
- ]
- ]);
-
-future
-------
-
-:Summary: Specifies whether or not a response SHOULD be an instance of a
- ``GuzzleHttp\Message\FutureResponse`` object.
-:Types:
- - bool
- - string
-:Default: ``false``
-
-By default, Guzzle requests should be synchronous. You can create asynchronous
-future responses by passing the ``future`` request option as ``true``. The
-response will only be executed when it is used like a normal response, the
-``wait()`` method of the response is called, or the corresponding handler that
-created the response is destructing and there are futures that have not been
-resolved.
-
-.. important::
-
- This option only has an effect if your handler can create and return future
- responses. However, even if a response is completed synchronously, Guzzle
- will ensure that a FutureResponse object is returned for API consistency.
-
-.. code-block:: php
-
- $response = $client->get('/foo', ['future' => true])
- ->then(function ($response) {
- echo 'I got a response! ' . $response;
- });
-
-Event Subscribers
-=================
-
-Requests emit lifecycle events when they are transferred. A client object has a
-``GuzzleHttp\Common\EventEmitter`` object that can be used to add event
-*listeners* and event *subscribers* to all requests created by the client.
-
-.. important::
-
- **Every** event listener or subscriber added to a client will be added to
- every request created by the client.
-
-.. code-block:: php
-
- use GuzzleHttp\Client;
- use GuzzleHttp\Event\BeforeEvent;
-
- $client = new Client();
-
- // Add a listener that will echo out requests before they are sent
- $client->getEmitter()->on('before', function (BeforeEvent $e) {
- echo 'About to send request: ' . $e->getRequest();
- });
-
- $client->get('http://httpbin.org/get');
- // Outputs the request as a string because of the event
-
-See :doc:`events` for more information on the event system used in Guzzle.
-
-Environment Variables
-=====================
-
-Guzzle exposes a few environment variables that can be used to customize the
-behavior of the library.
-
-``GUZZLE_CURL_SELECT_TIMEOUT``
- Controls the duration in seconds that a curl_multi_* handler will use when
- selecting on curl handles using ``curl_multi_select()``. Some systems
- have issues with PHP's implementation of ``curl_multi_select()`` where
- calling this function always results in waiting for the maximum duration of
- the timeout.
-``HTTP_PROXY``
- Defines the proxy to use when sending requests using the "http" protocol.
-``HTTPS_PROXY``
- Defines the proxy to use when sending requests using the "https" protocol.
-
-Relevant ini Settings
----------------------
-
-Guzzle can utilize PHP ini settings when configuring clients.
-
-``openssl.cafile``
- Specifies the path on disk to a CA file in PEM format to use when sending
- requests over "https". See: https://wiki.php.net/rfc/tls-peer-verification#phpini_defaults
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/conf.py b/lib/gerencianet/guzzlehttp/guzzle/docs/conf.py
deleted file mode 100644
index 917bdf4..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/docs/conf.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import sys, os
-from sphinx.highlighting import lexers
-from pygments.lexers.web import PhpLexer
-
-
-lexers['php'] = PhpLexer(startinline=True, linenos=1)
-lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1)
-primary_domain = 'php'
-
-extensions = []
-templates_path = ['_templates']
-source_suffix = '.rst'
-master_doc = 'index'
-project = u'Guzzle'
-copyright = u'2014, Michael Dowling'
-version = '5.0.0'
-html_title = "Guzzle Documentation"
-html_short_title = "Guzzle"
-
-exclude_patterns = ['_build']
-html_static_path = ['_static']
-
-on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
-
-if not on_rtd: # only import and set the theme if we're building docs locally
- import sphinx_rtd_theme
- html_theme = 'sphinx_rtd_theme'
- html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/events.rst b/lib/gerencianet/guzzlehttp/guzzle/docs/events.rst
deleted file mode 100644
index 30afdb6..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/docs/events.rst
+++ /dev/null
@@ -1,516 +0,0 @@
-============
-Event System
-============
-
-Guzzle uses an event emitter to allow you to easily extend the behavior of a
-request, change the response associated with a request, and implement custom
-error handling. All events in Guzzle are managed and emitted by an
-**event emitter**.
-
-Event Emitters
-==============
-
-Clients, requests, and any other class that implements the
-``GuzzleHttp\Event\HasEmitterInterface`` interface have a
-``GuzzleHttp\Event\Emitter`` object. You can add event *listeners* and
-event *subscribers* to an event *emitter*.
-
-emitter
- An object that implements ``GuzzleHttp\Event\EmitterInterface``. This
- object emits named events to event listeners. You may register event
- listeners on subscribers on an emitter.
-
-event listeners
- Callable functions that are registered on an event emitter for specific
- events. Event listeners are registered on an emitter with a *priority*
- setting. If no priority is provided, ``0`` is used by default.
-
-event subscribers
- Classes that tell an event emitter what methods to listen to and what
- functions on the class to invoke when the event is triggered. Event
- subscribers subscribe event listeners to an event emitter. They should be
- used when creating more complex event based logic in applications (i.e.,
- cookie handling is implemented using an event subscriber because it's
- easier to share a subscriber than an anonymous function and because
- handling cookies is a complex process).
-
-priority
- Describes the order in which event listeners are invoked when an event is
- emitted. The higher a priority value, the earlier the event listener will
- be invoked (a higher priority means the listener is more important). If
- no priority is provided, the priority is assumed to be ``0``.
-
- When specifying an event priority, you can pass ``"first"`` or ``"last"`` to
- dynamically specify the priority based on the current event priorities
- associated with the given event name in the emitter. Use ``"first"`` to set
- the priority to the current highest priority plus one. Use ``"last"`` to
- set the priority to the current lowest event priority minus one. It is
- important to remember that these dynamic priorities are calculated only at
- the point of insertion into the emitter and they are not rearranged after
- subsequent listeners are added to an emitter.
-
-propagation
- Describes whether or not other event listeners are triggered. Event
- emitters will trigger every event listener registered to a specific event
- in priority order until all of the listeners have been triggered **or**
- until the propagation of an event is stopped.
-
-Getting an EventEmitter
------------------------
-
-You can get the event emitter of ``GuzzleHttp\Event\HasEmitterInterface``
-object using the the ``getEmitter()`` method. Here's an example of getting a
-client object's event emitter.
-
-.. code-block:: php
-
- $client = new GuzzleHttp\Client();
- $emitter = $client->getEmitter();
-
-.. note::
-
- You'll notice that the event emitter used in Guzzle is very similar to the
- `Symfony2 EventDispatcher component `_.
- This is because the Guzzle event system is based on the Symfony2 event
- system with several changes. Guzzle uses its own event emitter to improve
- performance, isolate Guzzle from changes to the Symfony, and provide a few
- improvements that make it easier to use for an HTTP client (e.g., the
- addition of the ``once()`` method).
-
-Adding Event Listeners
-----------------------
-
-After you have the emitter, you can register event listeners that listen to
-specific events using the ``on()`` method. When registering an event listener,
-you must tell the emitter what event to listen to (e.g., "before", "after",
-"progress", "complete", "error", etc.), what callable to invoke when the
-event is triggered, and optionally provide a priority.
-
-.. code-block:: php
-
- use GuzzleHttp\Event\BeforeEvent;
-
- $emitter->on('before', function (BeforeEvent $event) {
- echo $event->getRequest();
- });
-
-When a listener is triggered, it is passed an event that implements the
-``GuzzleHttp\Event\EventInterface`` interface, the name of the event, and the
-event emitter itself. The above example could more verbosely be written as
-follows:
-
-.. code-block:: php
-
- use GuzzleHttp\Event\BeforeEvent;
-
- $emitter->on('before', function (BeforeEvent $event, $name) {
- echo $event->getRequest();
- });
-
-You can add an event listener that automatically removes itself after it is
-triggered using the ``once()`` method of an event emitter.
-
-.. code-block:: php
-
- $client = new GuzzleHttp\Client();
- $client->getEmitter()->once('before', function () {
- echo 'This will only happen once... per request!';
- });
-
-Event Propagation
------------------
-
-Event listeners can prevent other event listeners from being triggered by
-stopping an event's propagation.
-
-Stopping event propagation can be useful, for example, if an event listener has
-changed the state of the subject to such an extent that allowing subsequent
-event listeners to be triggered could place the subject in an inconsistent
-state. This technique is used in Guzzle extensively when intercepting error
-events with responses.
-
-You can stop the propagation of an event using the ``stopPropagation()`` method
-of a ``GuzzleHttp\Event\EventInterface`` object:
-
-.. code-block:: php
-
- use GuzzleHttp\Event\ErrorEvent;
-
- $emitter->on('error', function (ErrorEvent $event) {
- $event->stopPropagation();
- });
-
-After stopping the propagation of an event, any subsequent event listeners that
-have not yet been triggered will not be triggered. You can check to see if the
-propagation of an event was stopped using the ``isPropagationStopped()`` method
-of the event.
-
-.. code-block:: php
-
- $client = new GuzzleHttp\Client();
- $emitter = $client->getEmitter();
- // Note: assume that the $errorEvent was created
- if ($emitter->emit('error', $errorEvent)->isPropagationStopped()) {
- echo 'It was stopped!';
- }
-
-.. hint::
-
- When emitting events, the event that was emitted is returned from the
- emitter. This allows you to easily chain calls as shown in the above
- example.
-
-Event Subscribers
------------------
-
-Event subscribers are classes that implement the
-``GuzzleHttp\Event\SubscriberInterface`` object. They are used to register
-one or more event listeners to methods of the class. Event subscribers tell
-event emitters exactly which events to listen to and what method to invoke on
-the class when the event is triggered by called the ``getEvents()`` method of
-a subscriber.
-
-The following example registers event listeners to the ``before`` and
-``complete`` event of a request. When the ``before`` event is emitted, the
-``onBefore`` instance method of the subscriber is invoked. When the
-``complete`` event is emitted, the ``onComplete`` event of the subscriber is
-invoked. Each array value in the ``getEvents()`` return value MUST
-contain the name of the method to invoke and can optionally contain the
-priority of the listener (as shown in the ``before`` listener in the example).
-
-.. code-block:: php
-
- use GuzzleHttp\Event\EmitterInterface;
- use GuzzleHttp\Event\SubscriberInterface;
- use GuzzleHttp\Event\BeforeEvent;
- use GuzzleHttp\Event\CompleteEvent;
-
- class SimpleSubscriber implements SubscriberInterface
- {
- public function getEvents()
- {
- return [
- // Provide name and optional priority
- 'before' => ['onBefore', 100],
- 'complete' => ['onComplete'],
- // You can pass a list of listeners with different priorities
- 'error' => [['beforeError', 'first'], ['afterError', 'last']]
- ];
- }
-
- public function onBefore(BeforeEvent $event, $name)
- {
- echo 'Before!';
- }
-
- public function onComplete(CompleteEvent $event, $name)
- {
- echo 'Complete!';
- }
- }
-
-To register the listeners the subscriber needs to be attached to the emitter:
-
-.. code-block:: php
-
- $client = new GuzzleHttp\Client();
- $emitter = $client->getEmitter();
- $subscriber = new SimpleSubscriber();
- $emitter->attach($subscriber);
-
- //to remove the listeners
- $emitter->detach($subscriber);
-
-.. note::
-
- You can specify event priorities using integers or ``"first"`` and
- ``"last"`` to dynamically determine the priority.
-
-Event Priorities
-================
-
-When adding event listeners or subscribers, you can provide an optional event
-priority. This priority is used to determine how early or late a listener is
-triggered. Specifying the correct priority is an important aspect of ensuring
-a listener behaves as expected. For example, if you wanted to ensure that
-cookies associated with a redirect were added to a cookie jar, you'd need to
-make sure that the listener that collects the cookies is triggered before the
-listener that performs the redirect.
-
-In order to help make the process of determining the correct event priority of
-a listener easier, Guzzle provides several pre-determined named event
-priorities. These priorities are exposed as constants on the
-``GuzzleHttp\Event\RequestEvents`` object.
-
-last
- Use ``"last"`` as an event priority to set the priority to the current
- lowest event priority minus one.
-
-first
- Use ``"first"`` as an event priority to set the priority to the current
- highest priority plus one.
-
-``GuzzleHttp\Event\RequestEvents::EARLY``
- Used when you want a listener to be triggered as early as possible in the
- event chain.
-
-``GuzzleHttp\Event\RequestEvents::LATE``
- Used when you want a listener to be to be triggered as late as possible in
- the event chain.
-
-``GuzzleHttp\Event\RequestEvents::PREPARE_REQUEST``
- Used when you want a listener to be trigger while a request is being
- prepared during the ``before`` event. This event priority is used by the
- ``GuzzleHttp\Subscriber\Prepare`` event subscriber which is responsible for
- guessing a Content-Type, Content-Length, and Expect header of a request.
- You should subscribe after this event is triggered if you want to ensure
- that this subscriber has already been triggered.
-
-``GuzzleHttp\Event\RequestEvents::SIGN_REQUEST``
- Used when you want a listener to be triggered when a request is about to be
- signed. Any listener triggered at this point should expect that the request
- object will no longer be mutated. If you are implementing a custom
- signature subscriber, then you should use this event priority to sign
- requests.
-
-``GuzzleHttp\Event\RequestEvents::VERIFY_RESPONSE``
- Used when you want a listener to be triggered when a response is being
- validated during the ``complete`` event. The
- ``GuzzleHttp\Subscriber\HttpError`` event subscriber uses this event
- priority to check if an exception should be thrown due to a 4xx or 5xx
- level response status code. If you are doing any kind of verification of a
- response during the complete event, it should happen at this priority.
-
-``GuzzleHttp\Event\RequestEvents::REDIRECT_RESPONSE``
- Used when you want a listener to be triggered when a response is being
- redirected during the ``complete`` event. The
- ``GuzzleHttp\Subscriber\Redirect`` event subscriber uses this event
- priority when performing redirects.
-
-You can use the above event priorities as a guideline for determining the
-priority of you event listeners. You can use these constants and add to or
-subtract from them to ensure that a listener happens before or after the named
-priority.
-
-.. note::
-
- "first" and "last" priorities are not adjusted after they added to an
- emitter. For example, if you add a listener with a priority of "first",
- you can still add subsequent listeners with a higher priority which would
- be triggered before the listener added with a priority of "first".
-
-Working With Request Events
-===========================
-
-Requests emit lifecycle events when they are transferred.
-
-.. important::
-
- Excluding the ``end`` event, request lifecycle events may be triggered
- multiple times due to redirects, retries, or reusing a request multiple
- times. Use the ``once()`` method want the event to be triggered once. You
- can also remove an event listener from an emitter by using the emitter which
- is provided to the listener.
-
-.. _before_event:
-
-before
-------
-
-The ``before`` event is emitted before a request is sent. The event emitted is
-a ``GuzzleHttp\Event\BeforeEvent``.
-
-.. code-block:: php
-
- use GuzzleHttp\Client;
- use GuzzleHttp\Event\EmitterInterface;
- use GuzzleHttp\Event\BeforeEvent;
-
- $client = new Client(['base_url' => 'http://httpbin.org']);
- $request = $client->createRequest('GET', '/');
- $request->getEmitter()->on(
- 'before',
- function (BeforeEvent $e, $name) {
- echo $name . "\n";
- // "before"
- echo $e->getRequest()->getMethod() . "\n";
- // "GET" / "POST" / "PUT" / etc.
- echo get_class($e->getClient());
- // "GuzzleHttp\Client"
- }
- );
-
-You can intercept a request with a response before the request is sent over the
-wire. The ``intercept()`` method of the ``BeforeEvent`` accepts a
-``GuzzleHttp\Message\ResponseInterface``. Intercepting the event will prevent
-the request from being sent over the wire and stops the propagation of the
-``before`` event, preventing subsequent event listeners from being invoked.
-
-.. code-block:: php
-
- use GuzzleHttp\Client;
- use GuzzleHttp\Event\BeforeEvent;
- use GuzzleHttp\Message\Response;
-
- $client = new Client(['base_url' => 'http://httpbin.org']);
- $request = $client->createRequest('GET', '/status/500');
- $request->getEmitter()->on('before', function (BeforeEvent $e) {
- $response = new Response(200);
- $e->intercept($response);
- });
-
- $response = $client->send($request);
- echo $response->getStatusCode();
- // 200
-
-.. attention::
-
- Any exception encountered while executing the ``before`` event will trigger
- the ``error`` event of a request.
-
-.. _complete_event:
-
-complete
---------
-
-The ``complete`` event is emitted after a transaction completes and an entire
-response has been received. The event is a ``GuzzleHttp\Event\CompleteEvent``.
-
-You can intercept the ``complete`` event with a different response if needed
-using the ``intercept()`` method of the event. This can be useful, for example,
-for changing the response for caching.
-
-.. code-block:: php
-
- use GuzzleHttp\Client;
- use GuzzleHttp\Event\CompleteEvent;
- use GuzzleHttp\Message\Response;
-
- $client = new Client(['base_url' => 'http://httpbin.org']);
- $request = $client->createRequest('GET', '/status/302');
- $cachedResponse = new Response(200);
-
- $request->getEmitter()->on(
- 'complete',
- function (CompleteEvent $e) use ($cachedResponse) {
- if ($e->getResponse()->getStatusCode() == 302) {
- // Intercept the original transaction with the new response
- $e->intercept($cachedResponse);
- }
- }
- );
-
- $response = $client->send($request);
- echo $response->getStatusCode();
- // 200
-
-.. attention::
-
- Any ``GuzzleHttp\Exception\RequestException`` encountered while executing
- the ``complete`` event will trigger the ``error`` event of a request.
-
-.. _error_event:
-
-error
------
-
-The ``error`` event is emitted when a request fails (whether it's from a
-networking error or an HTTP protocol error). The event emitted is a
-``GuzzleHttp\Event\ErrorEvent``.
-
-This event is useful for retrying failed requests. Here's an example of
-retrying failed basic auth requests by re-sending the original request with
-a username and password.
-
-.. code-block:: php
-
- use GuzzleHttp\Client;
- use GuzzleHttp\Event\ErrorEvent;
-
- $client = new Client(['base_url' => 'http://httpbin.org']);
- $request = $client->createRequest('GET', '/basic-auth/foo/bar');
- $request->getEmitter()->on('error', function (ErrorEvent $e) {
- if ($e->getResponse()->getStatusCode() == 401) {
- // Add authentication stuff as needed and retry the request
- $e->getRequest()->setHeader('Authorization', 'Basic ' . base64_encode('foo:bar'));
- // Get the client of the event and retry the request
- $newResponse = $e->getClient()->send($e->getRequest());
- // Intercept the original transaction with the new response
- $e->intercept($newResponse);
- }
- });
-
-.. attention::
-
- If an ``error`` event is intercepted with a response, then the ``complete``
- event of a request is triggered. If the ``complete`` event fails, then the
- ``error`` event is triggered once again.
-
-.. _progress_event:
-
-progress
---------
-
-The ``progress`` event is emitted when data is uploaded or downloaded. The
-event emitted is a ``GuzzleHttp\Event\ProgressEvent``.
-
-You can access the emitted progress values using the corresponding public
-properties of the event object:
-
-- ``$downloadSize``: The number of bytes that will be downloaded (if known)
-- ``$downloaded``: The number of bytes that have been downloaded
-- ``$uploadSize``: The number of bytes that will be uploaded (if known)
-- ``$uploaded``: The number of bytes that have been uploaded
-
-This event cannot be intercepted.
-
-.. code-block:: php
-
- use GuzzleHttp\Client;
- use GuzzleHttp\Event\ProgressEvent;
-
- $client = new Client(['base_url' => 'http://httpbin.org']);
- $request = $client->createRequest('PUT', '/put', [
- 'body' => str_repeat('.', 100000)
- ]);
-
- $request->getEmitter()->on('progress', function (ProgressEvent $e) {
- echo 'Downloaded ' . $e->downloaded . ' of ' . $e->downloadSize . ' '
- . 'Uploaded ' . $e->uploaded . ' of ' . $e->uploadSize . "\r";
- });
-
- $client->send($request);
- echo "\n";
-
-.. _end_event:
-
-end
----
-
-The ``end`` event is a terminal event, emitted once per request, that provides
-access to the response that was received or the exception that was encountered.
-The event emitted is a ``GuzzleHttp\Event\EndEvent``.
-
-This event can be intercepted, but keep in mind that the ``complete`` event
-will not fire after intercepting this event.
-
-.. code-block:: php
-
- use GuzzleHttp\Client;
- use GuzzleHttp\Event\EndEvent;
-
- $client = new Client(['base_url' => 'http://httpbin.org']);
- $request = $client->createRequest('PUT', '/put', [
- 'body' => str_repeat('.', 100000)
- ]);
-
- $request->getEmitter()->on('end', function (EndEvent $e) {
- if ($e->getException()) {
- echo 'Error: ' . $e->getException()->getMessage();
- } else {
- echo 'Response: ' . $e->getResponse();
- }
- });
-
- $client->send($request);
- echo "\n";
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/faq.rst b/lib/gerencianet/guzzlehttp/guzzle/docs/faq.rst
deleted file mode 100644
index a8e9ad0..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/docs/faq.rst
+++ /dev/null
@@ -1,199 +0,0 @@
-===
-FAQ
-===
-
-Why should I use Guzzle?
-========================
-
-Guzzle makes it easy to send HTTP requests and super simple to integrate with
-web services. Guzzle manages things like persistent connections, represents
-query strings as collections, makes it simple to send streaming POST requests
-with fields and files, and abstracts away the underlying HTTP transport layer.
-By providing an object oriented interface for HTTP clients, requests, responses,
-headers, and message bodies, Guzzle makes it so that you no longer need to fool
-around with cURL options, stream contexts, or sockets.
-
-**Asynchronous and Synchronous Requests**
-
-Guzzle allows you to send both asynchronous and synchronous requests using the
-same interface and no direct dependency on an event loop. This flexibility
-allows Guzzle to send an HTTP request using the most appropriate HTTP handler
-based on the request being sent. For example, when sending synchronous
-requests, Guzzle will by default send requests using cURL easy handles to
-ensure you're using the fastest possible method for serially transferring HTTP
-requests. When sending asynchronous requests, Guzzle might use cURL's multi
-interface or any other asynchronous handler you configure. When you request
-streaming data, Guzzle will by default use PHP's stream wrapper.
-
-**Streams**
-
-Request and response message bodies use :doc:`Guzzle Streams `,
-allowing you to stream data without needing to load it all into memory.
-Guzzle's stream layer provides a large suite of functionality:
-
-- You can modify streams at runtime using custom or a number of
- pre-made decorators.
-- You can emit progress events as data is read from a stream.
-- You can validate the integrity of a stream using a rolling hash as data is
- read from a stream.
-
-**Event System and Plugins**
-
-Guzzle's event system allows you to completely modify the behavior of a client
-or request at runtime to cater them for any API. You can send a request with a
-client, and the client can do things like automatically retry your request if
-it fails, automatically redirect, log HTTP messages that are sent over the
-wire, emit progress events as data is uploaded and downloaded, sign requests
-using OAuth 1.0, verify the integrity of messages before and after they are
-sent over the wire, and anything else you might need.
-
-**Testable**
-
-Another important aspect of Guzzle is that it's really
-:doc:`easy to test clients `. You can mock HTTP responses and when
-testing an handler implementation, Guzzle provides a mock node.js web server.
-
-**Ecosystem**
-
-Guzzle has a large `ecosystem of plugins `_,
-including `service descriptions `_
-which allows you to abstract web services using service descriptions. These
-service descriptions define how to serialize an HTTP request and how to parse
-an HTTP response into a more meaningful model object.
-
-- `Guzzle Command `_: Provides the building
- blocks for service description abstraction.
-- `Guzzle Services `_: Provides an
- implementation of "Guzzle Command" that utilizes Guzzle's service description
- format.
-
-Does Guzzle require cURL?
-=========================
-
-No. Guzzle can use any HTTP handler to send requests. This means that Guzzle
-can be used with cURL, PHP's stream wrapper, sockets, and non-blocking libraries
-like `React `_. You just need to configure a
-`RingPHP `_ handler to use a
-different method of sending requests.
-
-.. note::
-
- Guzzle has historically only utilized cURL to send HTTP requests. cURL is
- an amazing HTTP client (arguably the best), and Guzzle will continue to use
- it by default when it is available. It is rare, but some developers don't
- have cURL installed on their systems or run into version specific issues.
- By allowing swappable HTTP handlers, Guzzle is now much more customizable
- and able to adapt to fit the needs of more developers.
-
-Can Guzzle send asynchronous requests?
-======================================
-
-Yes. Pass the ``future`` true request option to a request to send it
-asynchronously. Guzzle will then return a ``GuzzleHttp\Message\FutureResponse``
-object that can be used synchronously by accessing the response object like a
-normal response, and it can be used asynchronously using a promise that is
-notified when the response is resolved with a real response or rejected with an
-exception.
-
-.. code-block:: php
-
- $request = $client->createRequest('GET', ['future' => true]);
- $client->send($request)->then(function ($response) {
- echo 'Got a response! ' . $response;
- });
-
-You can force an asynchronous response to complete using the ``wait()`` method
-of a response.
-
-.. code-block:: php
-
- $request = $client->createRequest('GET', ['future' => true]);
- $futureResponse = $client->send($request);
- $futureResponse->wait();
-
-How can I add custom cURL options?
-==================================
-
-cURL offer a huge number of `customizable options `_.
-While Guzzle normalizes many of these options across different handlers, there
-are times when you need to set custom cURL options. This can be accomplished
-by passing an associative array of cURL settings in the **curl** key of the
-**config** request option.
-
-For example, let's say you need to customize the outgoing network interface
-used with a client.
-
-.. code-block:: php
-
- $client->get('/', [
- 'config' => [
- 'curl' => [
- CURLOPT_INTERFACE => 'xxx.xxx.xxx.xxx'
- ]
- ]
- ]);
-
-How can I add custom stream context options?
-============================================
-
-You can pass custom `stream context options `_
-using the **stream_context** key of the **config** request option. The
-**stream_context** array is an associative array where each key is a PHP
-transport, and each value is an associative array of transport options.
-
-For example, let's say you need to customize the outgoing network interface
-used with a client and allow self-signed certificates.
-
-.. code-block:: php
-
- $client->get('/', [
- 'stream' => true,
- 'config' => [
- 'stream_context' => [
- 'ssl' => [
- 'allow_self_signed' => true
- ],
- 'socket' => [
- 'bindto' => 'xxx.xxx.xxx.xxx'
- ]
- ]
- ]
- ]);
-
-Why am I getting an SSL verification error?
-===========================================
-
-You need to specify the path on disk to the CA bundle used by Guzzle for
-verifying the peer certificate. See :ref:`verify-option`.
-
-What is this Maximum function nesting error?
-============================================
-
- Maximum function nesting level of '100' reached, aborting
-
-You could run into this error if you have the XDebug extension installed and
-you execute a lot of requests in callbacks. This error message comes
-specifically from the XDebug extension. PHP itself does not have a function
-nesting limit. Change this setting in your php.ini to increase the limit::
-
- xdebug.max_nesting_level = 1000
-
-Why am I getting a 417 error response?
-======================================
-
-This can occur for a number of reasons, but if you are sending PUT, POST, or
-PATCH requests with an ``Expect: 100-Continue`` header, a server that does not
-support this header will return a 417 response. You can work around this by
-setting the ``expect`` request option to ``false``:
-
-.. code-block:: php
-
- $client = new GuzzleHttp\Client();
-
- // Disable the expect header on a single request
- $response = $client->put('/', [], 'the body', [
- 'expect' => false
- ]);
-
- // Disable the expect header on all client requests
- $client->setDefaultOption('expect', false)
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/handlers.rst b/lib/gerencianet/guzzlehttp/guzzle/docs/handlers.rst
deleted file mode 100644
index d452003..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/docs/handlers.rst
+++ /dev/null
@@ -1,43 +0,0 @@
-================
-RingPHP Handlers
-================
-
-Guzzle uses RingPHP handlers to send HTTP requests over the wire.
-RingPHP provides a low-level library that can be used to "glue" Guzzle with
-any transport method you choose. By default, Guzzle utilizes cURL and PHP's
-stream wrappers to send HTTP requests.
-
-RingPHP handlers makes it extremely simple to integrate Guzzle with any
-HTTP transport. For example, you could quite easily bridge Guzzle and React
-to use Guzzle in React's event loop.
-
-Using a handler
----------------
-
-You can change the handler used by a client using the ``handler`` option in the
-``GuzzleHttp\Client`` constructor.
-
-.. code-block:: php
-
- use GuzzleHttp\Client;
- use GuzzleHttp\Ring\Client\MockHandler;
-
- // Create a mock handler that always returns a 200 response.
- $handler = new MockHandler(['status' => 200]);
-
- // Configure to client to use the mock handler.
- $client = new Client(['handler' => $handler]);
-
-At its core, handlers are simply PHP callables that accept a request array
-and return a ``GuzzleHttp\Ring\Future\FutureArrayInterface``. This future array
-can be used just like a normal PHP array, causing it to block, or you can use
-the promise interface using the ``then()`` method of the future. Guzzle hooks
-up to the RingPHP project using a very simple bridge class
-(``GuzzleHttp\RingBridge``).
-
-Creating a handler
-------------------
-
-See the `RingPHP `_ project
-documentation for more information on creating custom handlers that can be
-used with Guzzle clients.
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/http-messages.rst b/lib/gerencianet/guzzlehttp/guzzle/docs/http-messages.rst
deleted file mode 100644
index 0c6527a..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/docs/http-messages.rst
+++ /dev/null
@@ -1,483 +0,0 @@
-=============================
-Request and Response Messages
-=============================
-
-Guzzle is an HTTP client that sends HTTP requests to a server and receives HTTP
-responses. Both requests and responses are referred to as messages.
-
-Headers
-=======
-
-Both request and response messages contain HTTP headers.
-
-Complex Headers
----------------
-
-Some headers contain additional key value pair information. For example, Link
-headers contain a link and several key value pairs:
-
-::
-
- ; rel="thing"; type="image/jpeg"
-
-Guzzle provides a convenience feature that can be used to parse these types of
-headers:
-
-.. code-block:: php
-
- use GuzzleHttp\Message\Request;
-
- $request = new Request('GET', '/', [
- 'Link' => '; rel="front"; type="image/jpeg"'
- ]);
-
- $parsed = Request::parseHeader($request, 'Link');
- var_export($parsed);
-
-Will output:
-
-.. code-block:: php
-
- array (
- 0 =>
- array (
- 0 => '',
- 'rel' => 'front',
- 'type' => 'image/jpeg',
- ),
- )
-
-The result contains a hash of key value pairs. Header values that have no key
-(i.e., the link) are indexed numerically while headers parts that form a key
-value pair are added as a key value pair.
-
-See :ref:`headers` for information on how the headers of a request and response
-can be accessed and modified.
-
-Body
-====
-
-Both request and response messages can contain a body.
-
-You can check to see if a request or response has a body using the
-``getBody()`` method:
-
-.. code-block:: php
-
- $response = GuzzleHttp\get('http://httpbin.org/get');
- if ($response->getBody()) {
- echo $response->getBody();
- // JSON string: { ... }
- }
-
-The body used in request and response objects is a
-``GuzzleHttp\Stream\StreamInterface``. This stream is used for both uploading
-data and downloading data. Guzzle will, by default, store the body of a message
-in a stream that uses PHP temp streams. When the size of the body exceeds
-2 MB, the stream will automatically switch to storing data on disk rather than
-in memory (protecting your application from memory exhaustion).
-
-You can change the body used in a request or response using the ``setBody()``
-method:
-
-.. code-block:: php
-
- use GuzzleHttp\Stream\Stream;
- $request = $client->createRequest('PUT', 'http://httpbin.org/put');
- $request->setBody(Stream::factory('foo'));
-
-The easiest way to create a body for a request is using the static
-``GuzzleHttp\Stream\Stream::factory()`` method. This method accepts various
-inputs like strings, resources returned from ``fopen()``, and other
-``GuzzleHttp\Stream\StreamInterface`` objects.
-
-The body of a request or response can be cast to a string or you can read and
-write bytes off of the stream as needed.
-
-.. code-block:: php
-
- use GuzzleHttp\Stream\Stream;
- $request = $client->createRequest('PUT', 'http://httpbin.org/put', ['body' => 'testing...']);
-
- echo $request->getBody()->read(4);
- // test
- echo $request->getBody()->read(4);
- // ing.
- echo $request->getBody()->read(1024);
- // ..
- var_export($request->eof());
- // true
-
-You can find out more about Guzzle stream objects in :doc:`streams`.
-
-Requests
-========
-
-Requests are sent from a client to a server. Requests include the method to
-be applied to a resource, the identifier of the resource, and the protocol
-version to use.
-
-Clients are used to create request messages. More precisely, clients use
-a ``GuzzleHttp\Message\MessageFactoryInterface`` to create request messages.
-You create requests with a client using the ``createRequest()`` method.
-
-.. code-block:: php
-
- // Create a request but don't send it immediately
- $request = $client->createRequest('GET', 'http://httpbin.org/get');
-
-Request Methods
----------------
-
-When creating a request, you are expected to provide the HTTP method you wish
-to perform. You can specify any method you'd like, including a custom method
-that might not be part of RFC 7231 (like "MOVE").
-
-.. code-block:: php
-
- // Create a request using a completely custom HTTP method
- $request = $client->createRequest('MOVE', 'http://httpbin.org/move', ['exceptions' => false]);
-
- echo $request->getMethod();
- // MOVE
-
- $response = $client->send($request);
- echo $response->getStatusCode();
- // 405
-
-You can create and send a request using methods on a client that map to the
-HTTP method you wish to use.
-
-:GET: ``$client->get('http://httpbin.org/get', [/** options **/])``
-:POST: ``$client->post('http://httpbin.org/post', [/** options **/])``
-:HEAD: ``$client->head('http://httpbin.org/get', [/** options **/])``
-:PUT: ``$client->put('http://httpbin.org/put', [/** options **/])``
-:DELETE: ``$client->delete('http://httpbin.org/delete', [/** options **/])``
-:OPTIONS: ``$client->options('http://httpbin.org/get', [/** options **/])``
-:PATCH: ``$client->patch('http://httpbin.org/put', [/** options **/])``
-
-.. code-block:: php
-
- $response = $client->patch('http://httpbin.org/patch', ['body' => 'content']);
-
-Request URI
------------
-
-The resource you are requesting with an HTTP request is identified by the
-path of the request, the query string, and the "Host" header of the request.
-
-When creating a request, you can provide the entire resource URI as a URL.
-
-.. code-block:: php
-
- $response = $client->get('http://httbin.org/get?q=foo');
-
-Using the above code, you will send a request that uses ``httpbin.org`` as
-the Host header, sends the request over port 80, uses ``/get`` as the path,
-and sends ``?q=foo`` as the query string. All of this is parsed automatically
-from the provided URI.
-
-Sometimes you don't know what the entire request will be when it is created.
-In these cases, you can modify the request as needed before sending it using
-the ``createRequest()`` method of the client and methods on the request that
-allow you to change it.
-
-.. code-block:: php
-
- $request = $client->createRequest('GET', 'http://httbin.org');
-
-You can change the path of the request using ``setPath()``:
-
-.. code-block:: php
-
- $request->setPath('/get');
- echo $request->getPath();
- // /get
- echo $request->getUrl();
- // http://httpbin.com/get
-
-Scheme
-~~~~~~
-
-The `scheme `_ of a request
-specifies the protocol to use when sending the request. When using Guzzle, the
-scheme can be set to "http" or "https".
-
-You can change the scheme of the request using the ``setScheme()`` method:
-
-.. code-block:: php
-
- $request = $client->createRequest('GET', 'http://httbin.org');
- $request->setScheme('https');
- echo $request->getScheme();
- // https
- echo $request->getUrl();
- // https://httpbin.com/get
-
-Port
-~~~~
-
-No port is necessary when using the "http" or "https" schemes, but you can
-override the port using ``setPort()``. If you need to modify the port used with
-the specified scheme from the default setting, then you must use the
-``setPort()`` method.
-
-.. code-block:: php
-
- $request = $client->createRequest('GET', 'http://httbin.org');
- $request->setPort(8080);
- echo $request->getPort();
- // 8080
- echo $request->getUrl();
- // https://httpbin.com:8080/get
-
- // Set the port back to the default value for the scheme
- $request->setPort(443);
- echo $request->getUrl();
- // https://httpbin.com/get
-
-Query string
-~~~~~~~~~~~~
-
-You can get the query string of the request using the ``getQuery()`` method.
-This method returns a ``GuzzleHttp\Query`` object. A Query object can be
-accessed like a PHP array, iterated in a foreach statement like a PHP array,
-and cast to a string.
-
-.. code-block:: php
-
- $request = $client->createRequest('GET', 'http://httbin.org');
- $query = $request->getQuery();
- $query['foo'] = 'bar';
- $query['baz'] = 'bam';
- $query['bam'] = ['test' => 'abc'];
-
- echo $request->getQuery();
- // foo=bar&baz=bam&bam%5Btest%5D=abc
-
- echo $request->getQuery()['foo'];
- // bar
- echo $request->getQuery()->get('foo');
- // bar
- echo $request->getQuery()->get('foo');
- // bar
-
- var_export($request->getQuery()['bam']);
- // array('test' => 'abc')
-
- foreach ($query as $key => $value) {
- var_export($value);
- }
-
- echo $request->getUrl();
- // https://httpbin.com/get?foo=bar&baz=bam&bam%5Btest%5D=abc
-
-Query Aggregators
-^^^^^^^^^^^^^^^^^
-
-Query objects can store scalar values or arrays of values. When an array of
-values is added to a query object, the query object uses a query aggregator to
-convert the complex structure into a string. Query objects will use
-`PHP style query strings `_ when complex
-query string parameters are converted to a string. You can customize how
-complex query string parameters are aggregated using the ``setAggregator()``
-method of a query string object.
-
-.. code-block:: php
-
- $query->setAggregator($query::duplicateAggregator());
-
-In the above example, we've changed the query object to use the
-"duplicateAggregator". This aggregator will allow duplicate entries to appear
-in a query string rather than appending "[n]" to each value. So if you had a
-query string with ``['a' => ['b', 'c']]``, the duplicate aggregator would
-convert this to "a=b&a=c" while the default aggregator would convert this to
-"a[0]=b&a[1]=c" (with urlencoded brackets).
-
-The ``setAggregator()`` method accepts a ``callable`` which is used to convert
-a deeply nested array of query string variables into a flattened array of key
-value pairs. The callable accepts an array of query data and returns a
-flattened array of key value pairs where each value is an array of strings.
-You can use the ``GuzzleHttp\Query::walkQuery()`` static function to easily
-create custom query aggregators.
-
-Host
-~~~~
-
-You can change the host header of the request in a predictable way using the
-``setHost()`` method of a request:
-
-.. code-block:: php
-
- $request->setHost('www.google.com');
- echo $request->getHost();
- // www.google.com
- echo $request->getUrl();
- // https://www.google.com/get?foo=bar&baz=bam
-
-.. note::
-
- The Host header can also be changed by modifying the Host header of a
- request directly, but modifying the Host header directly could result in
- sending a request to a different Host than what is specified in the Host
- header (sometimes this is actually the desired behavior).
-
-Resource
-~~~~~~~~
-
-You can use the ``getResource()`` method of a request to return the path and
-query string of a request in a single string.
-
-.. code-block:: php
-
- $request = $client->createRequest('GET', 'http://httpbin.org/get?baz=bar');
- echo $request->getResource();
- // /get?baz=bar
-
-Request Config
---------------
-
-Request messages contain a configuration collection that can be used by
-event listeners and HTTP handlers to modify how a request behaves or is
-transferred over the wire. For example, many of the request options that are
-specified when creating a request are actually set as config options that are
-only acted upon by handlers and listeners when the request is sent.
-
-You can get access to the request's config object using the ``getConfig()``
-method of a request.
-
-.. code-block:: php
-
- $request = $client->createRequest('GET', '/');
- $config = $request->getConfig();
-
-The config object is a ``GuzzleHttp\Collection`` object that acts like
-an associative array. You can grab values from the collection using array like
-access. You can also modify and remove values using array like access.
-
-.. code-block:: php
-
- $config['foo'] = 'bar';
- echo $config['foo'];
- // bar
-
- var_export(isset($config['foo']));
- // true
-
- unset($config['foo']);
- var_export(isset($config['foo']));
- // false
-
- var_export($config['foo']);
- // NULL
-
-HTTP handlers and event listeners can expose additional customization options
-through request config settings. For example, in order to specify custom cURL
-options to the cURL handler, you need to specify an associative array in the
-``curl`` ``config`` request option.
-
-.. code-block:: php
-
- $client->get('/', [
- 'config' => [
- 'curl' => [
- CURLOPT_HTTPAUTH => CURLAUTH_NTLM,
- CURLOPT_USERPWD => 'username:password'
- ]
- ]
- ]);
-
-Consult the HTTP handlers and event listeners you are using to see if they
-allow customization through request configuration options.
-
-Event Emitter
--------------
-
-Request objects implement ``GuzzleHttp\Event\HasEmitterInterface``, so they
-have a method called ``getEmitter()`` that can be used to get an event emitter
-used by the request. Any listener or subscriber attached to a request will only
-be triggered for the lifecycle events of a specific request. Conversely, adding
-an event listener or subscriber to a client will listen to all lifecycle events
-of all requests created by the client.
-
-See :doc:`events` for more information.
-
-Responses
-=========
-
-Responses are the HTTP messages a client receives from a server after sending
-an HTTP request message.
-
-Start-Line
-----------
-
-The start-line of a response contains the protocol and protocol version,
-status code, and reason phrase.
-
-.. code-block:: php
-
- $response = GuzzleHttp\get('http://httpbin.org/get');
- echo $response->getStatusCode();
- // 200
- echo $response->getReasonPhrase();
- // OK
- echo $response->getProtocolVersion();
- // 1.1
-
-Body
-----
-
-As described earlier, you can get the body of a response using the
-``getBody()`` method.
-
-.. code-block:: php
-
- if ($body = $response->getBody()) {
- echo $body;
- // Cast to a string: { ... }
- $body->seek(0);
- // Rewind the body
- $body->read(1024);
- // Read bytes of the body
- }
-
-When working with JSON responses, you can use the ``json()`` method of a
-response:
-
-.. code-block:: php
-
- $json = $response->json();
-
-.. note::
-
- Guzzle uses the ``json_decode()`` method of PHP and uses arrays rather than
- ``stdClass`` objects for objects.
-
-You can use the ``xml()`` method when working with XML data.
-
-.. code-block:: php
-
- $xml = $response->xml();
-
-.. note::
-
- Guzzle uses the ``SimpleXMLElement`` objects when converting response
- bodies to XML.
-
-Effective URL
--------------
-
-The URL that was ultimately accessed that returned a response can be accessed
-using the ``getEffectiveUrl()`` method of a response. This method will return
-the URL of a request or the URL of the last redirected URL if any redirects
-occurred while transferring a request.
-
-.. code-block:: php
-
- $response = GuzzleHttp\get('http://httpbin.org/get');
- echo $response->getEffectiveUrl();
- // http://httpbin.org/get
-
- $response = GuzzleHttp\get('http://httpbin.org/redirect-to?url=http://www.google.com');
- echo $response->getEffectiveUrl();
- // http://www.google.com
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/index.rst b/lib/gerencianet/guzzlehttp/guzzle/docs/index.rst
deleted file mode 100644
index d456a5f..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/docs/index.rst
+++ /dev/null
@@ -1,98 +0,0 @@
-.. title:: Guzzle | PHP HTTP client and framework for consuming RESTful web services
-
-======
-Guzzle
-======
-
-Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and
-trivial to integrate with web services.
-
-- Manages things like persistent connections, represents query strings as
- collections, simplifies sending streaming POST requests with fields and
- files, and abstracts away the underlying HTTP transport layer.
-- Can send both synchronous and asynchronous requests using the same interface
- without requiring a dependency on a specific event loop.
-- Pluggable HTTP handlers allows Guzzle to integrate with any method you choose
- for sending HTTP requests over the wire (e.g., cURL, sockets, PHP's stream
- wrapper, non-blocking event loops like `React `_, etc.).
-- Guzzle makes it so that you no longer need to fool around with cURL options,
- stream contexts, or sockets.
-
-.. code-block:: php
-
- $client = new GuzzleHttp\Client();
- $response = $client->get('http://guzzlephp.org');
- $res = $client->get('https://api.github.com/user', ['auth' => ['user', 'pass']]);
- echo $res->getStatusCode();
- // "200"
- echo $res->getHeader('content-type');
- // 'application/json; charset=utf8'
- echo $res->getBody();
- // {"type":"User"...'
- var_export($res->json());
- // Outputs the JSON decoded data
-
- // Send an asynchronous request.
- $req = $client->createRequest('GET', 'http://httpbin.org', ['future' => true]);
- $client->send($req)->then(function ($response) {
- echo 'I completed! ' . $response;
- });
-
-User guide
-----------
-
-.. toctree::
- :maxdepth: 2
-
- overview
- quickstart
- clients
- http-messages
- events
- streams
- handlers
- testing
- faq
-
-HTTP Components
----------------
-
-There are a number of optional libraries you can use along with Guzzle's HTTP
-layer to add capabilities to the client.
-
-`Log Subscriber `_
- Logs HTTP requests and responses sent over the wire using customizable
- log message templates.
-
-`OAuth Subscriber `_
- Signs requests using OAuth 1.0.
-
-`Cache Subscriber `_
- Implements a private transparent proxy cache that caches HTTP responses.
-
-`Retry Subscriber `_
- Retries failed requests using customizable retry strategies (e.g., retry
- based on response status code, cURL error codes, etc.)
-
-`Message Integrity Subscriber `_
- Verifies the message integrity of HTTP responses using customizable
- validators. This plugin can be used, for example, to verify the Content-MD5
- headers of responses.
-
-Service Description Commands
-----------------------------
-
-You can use the **Guzzle Command** library to encapsulate interaction with a
-web service using command objects. Building on top of Guzzle's command
-abstraction allows you to easily implement things like service description that
-can be used to serialize requests and parse responses using a meta-description
-of a web service.
-
-`Guzzle Command `_
- Provides the foundational elements used to build high-level, command based,
- web service clients with Guzzle.
-
-`Guzzle Services `_
- Provides an implementation of the *Guzzle Command* library that uses
- Guzzle service descriptions to describe web services, serialize requests,
- and parse responses into easy to use model structures.
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/overview.rst b/lib/gerencianet/guzzlehttp/guzzle/docs/overview.rst
deleted file mode 100644
index 1355afa..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/docs/overview.rst
+++ /dev/null
@@ -1,150 +0,0 @@
-========
-Overview
-========
-
-Requirements
-============
-
-#. PHP 5.4.0
-#. To use the PHP stream handler, ``allow_url_fopen`` must be enabled in your
- system's php.ini.
-#. To use the cURL handler, you must have a recent version of cURL >= 7.16.2
- compiled with OpenSSL and zlib.
-
-.. note::
-
- Guzzle no longer requires cURL in order to send HTTP requests. Guzzle will
- use the PHP stream wrapper to send HTTP requests if cURL is not installed.
- Alternatively, you can provide your own HTTP handler used to send requests.
-
-.. _installation:
-
-Installation
-============
-
-The recommended way to install Guzzle is with `Composer `_. Composer is a dependency
-management tool for PHP that allows you to declare the dependencies your project needs and installs them into your
-project.
-
-.. code-block:: bash
-
- # Install Composer
- curl -sS https://getcomposer.org/installer | php
-
-You can add Guzzle as a dependency using the composer.phar CLI:
-
-.. code-block:: bash
-
- php composer.phar require guzzlehttp/guzzle:~5.0
-
-Alternatively, you can specify Guzzle as a dependency in your project's
-existing composer.json file:
-
-.. code-block:: js
-
- {
- "require": {
- "guzzlehttp/guzzle": "~5.0"
- }
- }
-
-After installing, you need to require Composer's autoloader:
-
-.. code-block:: php
-
- require 'vendor/autoload.php';
-
-You can find out more on how to install Composer, configure autoloading, and
-other best-practices for defining dependencies at `getcomposer.org `_.
-
-Bleeding edge
--------------
-
-During your development, you can keep up with the latest changes on the master
-branch by setting the version requirement for Guzzle to ``~5.0@dev``.
-
-.. code-block:: js
-
- {
- "require": {
- "guzzlehttp/guzzle": "~5.0@dev"
- }
- }
-
-License
-=======
-
-Licensed using the `MIT license `_.
-
- Copyright (c) 2014 Michael Dowling
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-
-Contributing
-============
-
-Guidelines
-----------
-
-1. Guzzle follows PSR-0, PSR-1, and PSR-2.
-2. Guzzle is meant to be lean and fast with very few dependencies.
-3. Guzzle has a minimum PHP version requirement of PHP 5.4. Pull requests must
- not require a PHP version greater than PHP 5.4.
-4. All pull requests must include unit tests to ensure the change works as
- expected and to prevent regressions.
-
-Running the tests
------------------
-
-In order to contribute, you'll need to checkout the source from GitHub and
-install Guzzle's dependencies using Composer:
-
-.. code-block:: bash
-
- git clone https://github.com/guzzle/guzzle.git
- cd guzzle && curl -s http://getcomposer.org/installer | php && ./composer.phar install --dev
-
-Guzzle is unit tested with PHPUnit. Run the tests using the vendored PHPUnit
-binary:
-
-.. code-block:: bash
-
- vendor/bin/phpunit
-
-.. note::
-
- You'll need to install node.js v0.5.0 or newer in order to perform
- integration tests on Guzzle's HTTP handlers.
-
-Reporting a security vulnerability
-==================================
-
-We want to ensure that Guzzle is a secure HTTP client library for everyone. If
-you've discovered a security vulnerability in Guzzle, we appreciate your help
-in disclosing it to us in a `responsible manner `_.
-
-Publicly disclosing a vulnerability can put the entire community at risk. If
-you've discovered a security concern, please email us at
-security@guzzlephp.org. We'll work with you to make sure that we understand the
-scope of the issue, and that we fully address your concern. We consider
-correspondence sent to security@guzzlephp.org our highest priority, and work to
-address any issues that arise as quickly as possible.
-
-After a security vulnerability has been corrected, a security hotfix release will
-be deployed as soon as possible.
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/quickstart.rst b/lib/gerencianet/guzzlehttp/guzzle/docs/quickstart.rst
deleted file mode 100644
index 65a70ed..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/docs/quickstart.rst
+++ /dev/null
@@ -1,448 +0,0 @@
-==========
-Quickstart
-==========
-
-This page provides a quick introduction to Guzzle and introductory examples.
-If you have not already installed, Guzzle, head over to the :ref:`installation`
-page.
-
-Make a Request
-==============
-
-You can send requests with Guzzle using a ``GuzzleHttp\ClientInterface``
-object.
-
-Creating a Client
------------------
-
-The procedural API is simple but not very testable; it's best left for quick
-prototyping. If you want to use Guzzle in a more flexible and testable way,
-then you'll need to use a ``GuzzleHttp\ClientInterface`` object.
-
-.. code-block:: php
-
- use GuzzleHttp\Client;
-
- $client = new Client();
- $response = $client->get('http://httpbin.org/get');
-
- // You can use the same methods you saw in the procedural API
- $response = $client->delete('http://httpbin.org/delete');
- $response = $client->head('http://httpbin.org/get');
- $response = $client->options('http://httpbin.org/get');
- $response = $client->patch('http://httpbin.org/patch');
- $response = $client->post('http://httpbin.org/post');
- $response = $client->put('http://httpbin.org/put');
-
-You can create a request with a client and then send the request with the
-client when you're ready.
-
-.. code-block:: php
-
- $request = $client->createRequest('GET', 'http://www.foo.com');
- $response = $client->send($request);
-
-Client objects provide a great deal of flexibility in how request are
-transferred including default request options, subscribers that are attached
-to each request, and a base URL that allows you to send requests with relative
-URLs. You can find out all about clients in the :doc:`clients` page of the
-documentation.
-
-Using Responses
-===============
-
-In the previous examples, we retrieved a ``$response`` variable. This value is
-actually a ``GuzzleHttp\Message\ResponseInterface`` object and contains lots
-of helpful information.
-
-You can get the status code and reason phrase of the response.
-
-.. code-block:: php
-
- $code = $response->getStatusCode();
- // 200
-
- $reason = $response->getReasonPhrase();
- // OK
-
-By providing the ``future`` request option to a request, you can send requests
-asynchronously using the promise interface of a future response.
-
-.. code-block:: php
-
- $client->get('http://httpbin.org', ['future' => true])
- ->then(function ($response) {
- echo $response->getStatusCode();
- });
-
-Response Body
--------------
-
-The body of a response can be retrieved and cast to a string.
-
-.. code-block:: php
-
- $body = $response->getBody();
- echo $body;
- // { "some_json_data" ...}
-
-You can also read read bytes from body of a response like a stream.
-
-.. code-block:: php
-
- $body = $response->getBody();
-
- while (!$body->eof()) {
- echo $body->read(1024);
- }
-
-JSON Responses
-~~~~~~~~~~~~~~
-
-You can more easily work with JSON responses using the ``json()`` method of a
-response.
-
-.. code-block:: php
-
- $response = $client->get('http://httpbin.org/get');
- $json = $response->json();
- var_dump($json[0]['origin']);
-
-Guzzle internally uses PHP's ``json_decode()`` function to parse responses. If
-Guzzle is unable to parse the JSON response body, then a
-``GuzzleHttp\Exception\ParseException`` is thrown.
-
-XML Responses
-~~~~~~~~~~~~~
-
-You can use a response's ``xml()`` method to more easily work with responses
-that contain XML data.
-
-.. code-block:: php
-
- $response = $client->get('https://github.com/mtdowling.atom');
- $xml = $response->xml();
- echo $xml->id;
- // tag:github.com,2008:/mtdowling
-
-Guzzle internally uses a ``SimpleXMLElement`` object to parse responses. If
-Guzzle is unable to parse the XML response body, then a
-``GuzzleHttp\Exception\ParseException`` is thrown.
-
-Query String Parameters
-=======================
-
-Sending query string parameters with a request is easy. You can set query
-string parameters in the request's URL.
-
-.. code-block:: php
-
- $response = $client->get('http://httpbin.org?foo=bar');
-
-You can also specify the query string parameters using the ``query`` request
-option.
-
-.. code-block:: php
-
- $client->get('http://httpbin.org', [
- 'query' => ['foo' => 'bar']
- ]);
-
-And finally, you can build up the query string of a request as needed by
-calling the ``getQuery()`` method of a request and modifying the request's
-``GuzzleHttp\Query`` object as needed.
-
-.. code-block:: php
-
- $request = $client->createRequest('GET', 'http://httpbin.org');
- $query = $request->getQuery();
- $query->set('foo', 'bar');
-
- // You can use the query string object like an array
- $query['baz'] = 'bam';
-
- // The query object can be cast to a string
- echo $query;
- // foo=bar&baz=bam
-
- // Setting a value to false or null will cause the "=" sign to be omitted
- $query['empty'] = null;
- echo $query;
- // foo=bar&baz=bam&empty
-
- // Use an empty string to include the "=" sign with an empty value
- $query['empty'] = '';
- echo $query;
- // foo=bar&baz=bam&empty=
-
-.. _headers:
-
-Request and Response Headers
-----------------------------
-
-You can specify request headers when sending or creating requests with a
-client. In the following example, we send the ``X-Foo-Header`` with a value of
-``value`` by setting the ``headers`` request option.
-
-.. code-block:: php
-
- $response = $client->get('http://httpbin.org/get', [
- 'headers' => ['X-Foo-Header' => 'value']
- ]);
-
-You can view the headers of a response using header specific methods of a
-response class. Headers work exactly the same way for request and response
-object.
-
-You can retrieve a header from a request or response using the ``getHeader()``
-method of the object. This method is case-insensitive and by default will
-return a string containing the header field value.
-
-.. code-block:: php
-
- $response = $client->get('http://www.yahoo.com');
- $length = $response->getHeader('Content-Length');
-
-Header fields that contain multiple values can be retrieved as a string or as
-an array. Retrieving the field values as a string will naively concatenate all
-of the header values together with a comma. Because not all header fields
-should be represented this way (e.g., ``Set-Cookie``), you can pass an optional
-flag to the ``getHeader()`` method to retrieve the header values as an array.
-
-.. code-block:: php
-
- $values = $response->getHeader('Set-Cookie', true);
- foreach ($values as $value) {
- echo $value;
- }
-
-You can test if a request or response has a specific header using the
-``hasHeader()`` method. This method accepts a case-insensitive string and
-returns true if the header is present or false if it is not.
-
-You can retrieve all of the headers of a message using the ``getHeaders()``
-method of a request or response. The return value is an associative array where
-the keys represent the header name as it will be sent over the wire, and each
-value is an array of strings associated with the header.
-
-.. code-block:: php
-
- $headers = $response->getHeaders();
- foreach ($message->getHeaders() as $name => $values) {
- echo $name . ": " . implode(", ", $values);
- }
-
-Modifying headers
------------------
-
-The headers of a message can be modified using the ``setHeader()``,
-``addHeader()``, ``setHeaders()``, and ``removeHeader()`` methods of a request
-or response object.
-
-.. code-block:: php
-
- $request = $client->createRequest('GET', 'http://httpbin.org/get');
-
- // Set a single value for a header
- $request->setHeader('User-Agent', 'Testing!');
-
- // Set multiple values for a header in one call
- $request->setHeader('X-Foo', ['Baz', 'Bar']);
-
- // Add a header to the message
- $request->addHeader('X-Foo', 'Bam');
-
- echo $request->getHeader('X-Foo');
- // Baz, Bar, Bam
-
- // Remove a specific header using a case-insensitive name
- $request->removeHeader('x-foo');
- echo $request->getHeader('X-Foo');
- // Echoes an empty string: ''
-
-Uploading Data
-==============
-
-Guzzle provides several methods of uploading data.
-
-You can send requests that contain a stream of data by passing a string,
-resource returned from ``fopen``, or a ``GuzzleHttp\Stream\StreamInterface``
-object to the ``body`` request option.
-
-.. code-block:: php
-
- $r = $client->post('http://httpbin.org/post', ['body' => 'raw data']);
-
-You can easily upload JSON data using the ``json`` request option.
-
-.. code-block:: php
-
- $r = $client->put('http://httpbin.org/put', ['json' => ['foo' => 'bar']]);
-
-POST Requests
--------------
-
-In addition to specifying the raw data of a request using the ``body`` request
-option, Guzzle provides helpful abstractions over sending POST data.
-
-Sending POST Fields
-~~~~~~~~~~~~~~~~~~~
-
-Sending ``application/x-www-form-urlencoded`` POST requests requires that you
-specify the body of a POST request as an array.
-
-.. code-block:: php
-
- $response = $client->post('http://httpbin.org/post', [
- 'body' => [
- 'field_name' => 'abc',
- 'other_field' => '123'
- ]
- ]);
-
-You can also build up POST requests before sending them.
-
-.. code-block:: php
-
- $request = $client->createRequest('POST', 'http://httpbin.org/post');
- $postBody = $request->getBody();
-
- // $postBody is an instance of GuzzleHttp\Post\PostBodyInterface
- $postBody->setField('foo', 'bar');
- echo $postBody->getField('foo');
- // 'bar'
-
- echo json_encode($postBody->getFields());
- // {"foo": "bar"}
-
- // Send the POST request
- $response = $client->send($request);
-
-Sending POST Files
-~~~~~~~~~~~~~~~~~~
-
-Sending ``multipart/form-data`` POST requests (POST requests that contain
-files) is the same as sending ``application/x-www-form-urlencoded``, except
-some of the array values of the POST fields map to PHP ``fopen`` resources, or
-``GuzzleHttp\Stream\StreamInterface``, or
-``GuzzleHttp\Post\PostFileInterface`` objects.
-
-.. code-block:: php
-
- use GuzzleHttp\Post\PostFile;
-
- $response = $client->post('http://httpbin.org/post', [
- 'body' => [
- 'field_name' => 'abc',
- 'file_filed' => fopen('/path/to/file', 'r'),
- 'other_file' => new PostFile('other_file', 'this is the content')
- ]
- ]);
-
-Just like when sending POST fields, you can also build up POST requests with
-files before sending them.
-
-.. code-block:: php
-
- use GuzzleHttp\Post\PostFile;
-
- $request = $client->createRequest('POST', 'http://httpbin.org/post');
- $postBody = $request->getBody();
- $postBody->setField('foo', 'bar');
- $postBody->addFile(new PostFile('test', fopen('/path/to/file', 'r')));
- $response = $client->send($request);
-
-Cookies
-=======
-
-Guzzle can maintain a cookie session for you if instructed using the
-``cookies`` request option.
-
-- Set to ``true`` to use a shared cookie session associated with the client.
-- Pass an associative array containing cookies to send in the request and start
- a new cookie session.
-- Set to a ``GuzzleHttp\Subscriber\CookieJar\CookieJarInterface`` object to use
- an existing cookie jar.
-
-Redirects
-=========
-
-Guzzle will automatically follow redirects unless you tell it not to. You can
-customize the redirect behavior using the ``allow_redirects`` request option.
-
-- Set to true to enable normal redirects with a maximum number of 5 redirects.
- This is the default setting.
-- Set to false to disable redirects.
-- Pass an associative array containing the 'max' key to specify the maximum
- number of redirects and optionally provide a 'strict' key value to specify
- whether or not to use strict RFC compliant redirects (meaning redirect POST
- requests with POST requests vs. doing what most browsers do which is
- redirect POST requests with GET requests).
-
-.. code-block:: php
-
- $response = $client->get('http://github.com');
- echo $response->getStatusCode();
- // 200
- echo $response->getEffectiveUrl();
- // 'https://github.com/'
-
-The following example shows that redirects can be disabled.
-
-.. code-block:: php
-
- $response = $client->get('http://github.com', ['allow_redirects' => false]);
- echo $response->getStatusCode();
- // 301
- echo $response->getEffectiveUrl();
- // 'http://github.com/'
-
-Exceptions
-==========
-
-Guzzle throws exceptions for errors that occur during a transfer.
-
-- In the event of a networking error (connection timeout, DNS errors, etc.),
- a ``GuzzleHttp\Exception\RequestException`` is thrown. This exception
- extends from ``GuzzleHttp\Exception\TransferException``. Catching this
- exception will catch any exception that can be thrown while transferring
- (non-parallel) requests.
-
- .. code-block:: php
-
- use GuzzleHttp\Exception\RequestException;
-
- try {
- $client->get('https://github.com/_abc_123_404');
- } catch (RequestException $e) {
- echo $e->getRequest();
- if ($e->hasResponse()) {
- echo $e->getResponse();
- }
- }
-
-- A ``GuzzleHttp\Exception\ClientException`` is thrown for 400
- level errors if the ``exceptions`` request option is set to true. This
- exception extends from ``GuzzleHttp\Exception\BadResponseException`` and
- ``GuzzleHttp\Exception\BadResponseException`` extends from
- ``GuzzleHttp\Exception\RequestException``.
-
- .. code-block:: php
-
- use GuzzleHttp\Exception\ClientException;
-
- try {
- $client->get('https://github.com/_abc_123_404');
- } catch (ClientException $e) {
- echo $e->getRequest();
- echo $e->getResponse();
- }
-
-- A ``GuzzleHttp\Exception\ServerException`` is thrown for 500 level
- errors if the ``exceptions`` request option is set to true. This
- exception extends from ``GuzzleHttp\Exception\BadResponseException``.
-- A ``GuzzleHttp\Exception\TooManyRedirectsException`` is thrown when too
- many redirects are followed. This exception extends from ``GuzzleHttp\Exception\RequestException``.
-
-All of the above exceptions extend from
-``GuzzleHttp\Exception\TransferException``.
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/requirements.txt b/lib/gerencianet/guzzlehttp/guzzle/docs/requirements.txt
deleted file mode 100644
index fe7a4ea..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/docs/requirements.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Sphinx>=1.2b1
-guzzle_sphinx_theme>=0.6.0
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/streams.rst b/lib/gerencianet/guzzlehttp/guzzle/docs/streams.rst
deleted file mode 100644
index 8fe9a69..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/docs/streams.rst
+++ /dev/null
@@ -1,213 +0,0 @@
-=======
-Streams
-=======
-
-Guzzle uses stream objects to represent request and response message bodies.
-These stream objects allow you to work with various types of data all using a
-common interface.
-
-HTTP messages consist of a start-line, headers, and a body. The body of an HTTP
-message can be very small or extremely large. Attempting to represent the body
-of a message as a string can easily consume more memory than intended because
-the body must be stored completely in memory. Attempting to store the body of a
-request or response in memory would preclude the use of that implementation from
-being able to work with large message bodies. The StreamInterface is used in
-order to hide the implementation details of where a stream of data is read from
-or written to.
-
-Guzzle's StreamInterface exposes several methods that enable streams to be read
-from, written to, and traversed effectively.
-
-Streams expose their capabilities using three methods: ``isReadable()``,
-``isWritable()``, and ``isSeekable()``. These methods can be used by stream
-collaborators to determine if a stream is capable of their requirements.
-
-Each stream instance has various capabilities: they can be read-only,
-write-only, read-write, allow arbitrary random access (seeking forwards or
-backwards to any location), or only allow sequential access (for example in the
-case of a socket or pipe).
-
-Creating Streams
-================
-
-The best way to create a stream is using the static factory method,
-``GuzzleHttp\Stream\Stream::factory()``. This factory accepts strings,
-resources returned from ``fopen()``, an object that implements
-``__toString()``, and an object that implements
-``GuzzleHttp\Stream\StreamInterface``.
-
-.. code-block:: php
-
- use GuzzleHttp\Stream\Stream;
-
- $stream = Stream::factory('string data');
- echo $stream;
- // string data
- echo $stream->read(3);
- // str
- echo $stream->getContents();
- // ing data
- var_export($stream->eof());
- // true
- var_export($stream->tell());
- // 11
-
-Metadata
-========
-
-Guzzle streams expose stream metadata through the ``getMetadata()`` method.
-This method provides the data you would retrieve when calling PHP's
-`stream_get_meta_data() function `_,
-and can optionally expose other custom data.
-
-.. code-block:: php
-
- use GuzzleHttp\Stream\Stream;
-
- $resource = fopen('/path/to/file', 'r');
- $stream = Stream::factory($resource);
- echo $stream->getMetadata('uri');
- // /path/to/file
- var_export($stream->isReadable());
- // true
- var_export($stream->isWritable());
- // false
- var_export($stream->isSeekable());
- // true
-
-Stream Decorators
-=================
-
-With the small and focused interface, add custom functionality to streams is
-very simple with stream decorators. Guzzle provides several built-in decorators
-that provide additional stream functionality.
-
-CachingStream
--------------
-
-The CachingStream is used to allow seeking over previously read bytes on
-non-seekable streams. This can be useful when transferring a non-seekable
-entity body fails due to needing to rewind the stream (for example, resulting
-from a redirect). Data that is read from the remote stream will be buffered in
-a PHP temp stream so that previously read bytes are cached first in memory,
-then on disk.
-
-.. code-block:: php
-
- use GuzzleHttp\Stream\Stream;
- use GuzzleHttp\Stream\CachingStream;
-
- $original = Stream::factory(fopen('http://www.google.com', 'r'));
- $stream = new CachingStream($original);
-
- $stream->read(1024);
- echo $stream->tell();
- // 1024
-
- $stream->seek(0);
- echo $stream->tell();
- // 0
-
-LimitStream
------------
-
-LimitStream can be used to read a subset or slice of an existing stream object.
-This can be useful for breaking a large file into smaller pieces to be sent in
-chunks (e.g. Amazon S3's multipart upload API).
-
-.. code-block:: php
-
- use GuzzleHttp\Stream\Stream;
- use GuzzleHttp\Stream\LimitStream;
-
- $original = Stream::factory(fopen('/tmp/test.txt', 'r+'));
- echo $original->getSize();
- // >>> 1048576
-
- // Limit the size of the body to 1024 bytes and start reading from byte 2048
- $stream = new LimitStream($original, 1024, 2048);
- echo $stream->getSize();
- // >>> 1024
- echo $stream->tell();
- // >>> 0
-
-NoSeekStream
-------------
-
-NoSeekStream wraps a stream and does not allow seeking.
-
-.. code-block:: php
-
- use GuzzleHttp\Stream\Stream;
- use GuzzleHttp\Stream\LimitStream;
-
- $original = Stream::factory('foo');
- $noSeek = new NoSeekStream($original);
-
- echo $noSeek->read(3);
- // foo
- var_export($noSeek->isSeekable());
- // false
- $noSeek->seek(0);
- var_export($noSeek->read(3));
- // NULL
-
-Creating Custom Decorators
---------------------------
-
-Creating a stream decorator is very easy thanks to the
-``GuzzleHttp\Stream\StreamDecoratorTrait``. This trait provides methods that
-implement ``GuzzleHttp\Stream\StreamInterface`` by proxying to an underlying
-stream. Just ``use`` the ``StreamDecoratorTrait`` and implement your custom
-methods.
-
-For example, let's say we wanted to call a specific function each time the last
-byte is read from a stream. This could be implemented by overriding the
-``read()`` method.
-
-.. code-block:: php
-
- use GuzzleHttp\Stream\StreamDecoratorTrait;
-
- class EofCallbackStream implements StreamInterface
- {
- use StreamDecoratorTrait;
-
- private $callback;
-
- public function __construct(StreamInterface $stream, callable $callback)
- {
- $this->stream = $stream;
- $this->callback = $callback;
- }
-
- public function read($length)
- {
- $result = $this->stream->read($length);
-
- // Invoke the callback when EOF is hit.
- if ($this->eof()) {
- call_user_func($this->callback);
- }
-
- return $result;
- }
- }
-
-This decorator could be added to any existing stream and used like so:
-
-.. code-block:: php
-
- use GuzzleHttp\Stream\Stream;
-
- $original = Stream::factory('foo');
- $eofStream = new EofCallbackStream($original, function () {
- echo 'EOF!';
- });
-
- $eofStream->read(2);
- $eofStream->read(1);
- // echoes "EOF!"
- $eofStream->seek(0);
- $eofStream->read(3);
- // echoes "EOF!"
diff --git a/lib/gerencianet/guzzlehttp/guzzle/docs/testing.rst b/lib/gerencianet/guzzlehttp/guzzle/docs/testing.rst
deleted file mode 100644
index 03bcc2e..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/docs/testing.rst
+++ /dev/null
@@ -1,232 +0,0 @@
-======================
-Testing Guzzle Clients
-======================
-
-Guzzle provides several tools that will enable you to easily mock the HTTP
-layer without needing to send requests over the internet.
-
-* Mock subscriber
-* Mock handler
-* Node.js web server for integration testing
-
-Mock Subscriber
-===============
-
-When testing HTTP clients, you often need to simulate specific scenarios like
-returning a successful response, returning an error, or returning specific
-responses in a certain order. Because unit tests need to be predictable, easy
-to bootstrap, and fast, hitting an actual remote API is a test smell.
-
-Guzzle provides a mock subscriber that can be attached to clients or requests
-that allows you to queue up a list of responses to use rather than hitting a
-remote API.
-
-.. code-block:: php
-
- use GuzzleHttp\Client;
- use GuzzleHttp\Subscriber\Mock;
- use GuzzleHttp\Message\Response;
-
- $client = new Client();
-
- // Create a mock subscriber and queue two responses.
- $mock = new Mock([
- new Response(200, ['X-Foo' => 'Bar']), // Use response object
- "HTTP/1.1 202 OK\r\nContent-Length: 0\r\n\r\n" // Use a response string
- ]);
-
- // Add the mock subscriber to the client.
- $client->getEmitter()->attach($mock);
- // The first request is intercepted with the first response.
- echo $client->get('/')->getStatusCode();
- //> 200
- // The second request is intercepted with the second response.
- echo $client->get('/')->getStatusCode();
- //> 202
-
-When no more responses are in the queue and a request is sent, an
-``OutOfBoundsException`` is thrown.
-
-History Subscriber
-==================
-
-When using things like the ``Mock`` subscriber, you often need to know if the
-requests you expected to send were sent exactly as you intended. While the mock
-subscriber responds with mocked responses, the ``GuzzleHttp\Subscriber\History``
-subscriber maintains a history of the requests that were sent by a client.
-
-.. code-block:: php
-
- use GuzzleHttp\Client;
- use GuzzleHttp\Subscriber\History;
-
- $client = new Client();
- $history = new History();
-
- // Add the history subscriber to the client.
- $client->getEmitter()->attach($history);
-
- $client->get('http://httpbin.org/get');
- $client->head('http://httpbin.org/get');
-
- // Count the number of transactions
- echo count($history);
- //> 2
- // Get the last request
- $lastRequest = $history->getLastRequest();
- // Get the last response
- $lastResponse = $history->getLastResponse();
-
- // Iterate over the transactions that were sent
- foreach ($history as $transaction) {
- echo $transaction['request']->getMethod();
- //> GET, HEAD
- echo $transaction['response']->getStatusCode();
- //> 200, 200
- }
-
-The history subscriber can also be printed, revealing the requests and
-responses that were sent as a string, in order.
-
-.. code-block:: php
-
- echo $history;
-
-::
-
- > GET /get HTTP/1.1
- Host: httpbin.org
- User-Agent: Guzzle/4.0-dev curl/7.21.4 PHP/5.5.8
-
- < HTTP/1.1 200 OK
- Access-Control-Allow-Origin: *
- Content-Type: application/json
- Date: Tue, 25 Mar 2014 03:53:27 GMT
- Server: gunicorn/0.17.4
- Content-Length: 270
- Connection: keep-alive
-
- {
- "headers": {
- "Connection": "close",
- "X-Request-Id": "3d0f7d5c-c937-4394-8248-2b8e03fcccdb",
- "User-Agent": "Guzzle/4.0-dev curl/7.21.4 PHP/5.5.8",
- "Host": "httpbin.org"
- },
- "origin": "76.104.247.1",
- "args": {},
- "url": "http://httpbin.org/get"
- }
-
- > HEAD /get HTTP/1.1
- Host: httpbin.org
- User-Agent: Guzzle/4.0-dev curl/7.21.4 PHP/5.5.8
-
- < HTTP/1.1 200 OK
- Access-Control-Allow-Origin: *
- Content-length: 270
- Content-Type: application/json
- Date: Tue, 25 Mar 2014 03:53:27 GMT
- Server: gunicorn/0.17.4
- Connection: keep-alive
-
-Mock Adapter
-============
-
-In addition to using the Mock subscriber, you can use the
-``GuzzleHttp\Ring\Client\MockHandler`` as the handler of a client to return the
-same response over and over or return the result of a callable function.
-
-Test Web Server
-===============
-
-Using mock responses is almost always enough when testing a web service client.
-When implementing custom :doc:`HTTP handlers `, you'll need to send
-actual HTTP requests in order to sufficiently test the handler. However, a
-best practice is to contact a local web server rather than a server over the
-internet.
-
-- Tests are more reliable
-- Tests do not require a network connection
-- Tests have no external dependencies
-
-Using the test server
----------------------
-
-.. warning::
-
- The following functionality is provided to help developers of Guzzle
- develop HTTP handlers. There is no promise of backwards compatibility
- when it comes to the node.js test server or the ``GuzzleHttp\Tests\Server``
- class. If you are using the test server or ``Server`` class outside of
- guzzlehttp/guzzle, then you will need to configure autoloading and
- ensure the web server is started manually.
-
-.. hint::
-
- You almost never need to use this test web server. You should only ever
- consider using it when developing HTTP handlers. The test web server
- is not necessary for mocking requests. For that, please use the
- Mock subcribers and History subscriber.
-
-Guzzle ships with a node.js test server that receives requests and returns
-responses from a queue. The test server exposes a simple API that is used to
-enqueue responses and inspect the requests that it has received.
-
-Any operation on the ``Server`` object will ensure that
-the server is running and wait until it is able to receive requests before
-returning.
-
-.. code-block:: php
-
- use GuzzleHttp\Client;
- use GuzzleHttp\Tests\Server;
-
- // Start the server and queue a response
- Server::enqueue("HTTP/1.1 200 OK\r\n\Content-Length: 0r\n\r\n");
-
- $client = new Client(['base_url' => Server::$url]);
- echo $client->get('/foo')->getStatusCode();
- // 200
-
-``GuzzleHttp\Tests\Server`` provides a static interface to the test server. You
-can queue an HTTP response or an array of responses by calling
-``Server::enqueue()``. This method accepts a string representing an HTTP
-response message, a ``GuzzleHttp\Message\ResponseInterface``, or an array of
-HTTP message strings / ``GuzzleHttp\Message\ResponseInterface`` objects.
-
-.. code-block:: php
-
- // Queue single response
- Server::enqueue("HTTP/1.1 200 OK\r\n\Content-Length: 0r\n\r\n");
-
- // Clear the queue and queue an array of responses
- Server::enqueue([
- "HTTP/1.1 200 OK\r\n\Content-Length: 0r\n\r\n",
- "HTTP/1.1 404 Not Found\r\n\Content-Length: 0r\n\r\n"
- ]);
-
-When a response is queued on the test server, the test server will remove any
-previously queued responses. As the server receives requests, queued responses
-are dequeued and returned to the request. When the queue is empty, the server
-will return a 500 response.
-
-You can inspect the requests that the server has retrieved by calling
-``Server::received()``. This method accepts an optional ``$hydrate`` parameter
-that specifies if you are retrieving an array of HTTP requests as strings or an
-array of ``GuzzleHttp\Message\RequestInterface`` objects.
-
-.. code-block:: php
-
- foreach (Server::received() as $response) {
- echo $response;
- }
-
-You can clear the list of received requests from the web server using the
-``Server::flush()`` method.
-
-.. code-block:: php
-
- Server::flush();
- echo count(Server::received());
- // 0
diff --git a/lib/gerencianet/guzzlehttp/guzzle/phpunit.xml.dist b/lib/gerencianet/guzzlehttp/guzzle/phpunit.xml.dist
deleted file mode 100644
index 500cd53..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/phpunit.xml.dist
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
- tests
-
-
-
-
- src
-
- src/
-
-
-
-
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/BatchResults.php b/lib/gerencianet/guzzlehttp/guzzle/src/BatchResults.php
deleted file mode 100644
index e5af433..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/BatchResults.php
+++ /dev/null
@@ -1,148 +0,0 @@
-hash = $hash;
- }
-
- /**
- * Get the keys that are available on the batch result.
- *
- * @return array
- */
- public function getKeys()
- {
- return iterator_to_array($this->hash);
- }
-
- /**
- * Gets a result from the container for the given object. When getting
- * results for a batch of requests, provide the request object.
- *
- * @param object $forObject Object to retrieve the result for.
- *
- * @return mixed|null
- */
- public function getResult($forObject)
- {
- return isset($this->hash[$forObject]) ? $this->hash[$forObject] : null;
- }
-
- /**
- * Get an array of successful results.
- *
- * @return array
- */
- public function getSuccessful()
- {
- $results = [];
- foreach ($this->hash as $key) {
- if (!($this->hash[$key] instanceof \Exception)) {
- $results[] = $this->hash[$key];
- }
- }
-
- return $results;
- }
-
- /**
- * Get an array of failed results.
- *
- * @return array
- */
- public function getFailures()
- {
- $results = [];
- foreach ($this->hash as $key) {
- if ($this->hash[$key] instanceof \Exception) {
- $results[] = $this->hash[$key];
- }
- }
-
- return $results;
- }
-
- /**
- * Allows iteration over all batch result values.
- *
- * @return \ArrayIterator
- */
- public function getIterator()
- {
- $results = [];
- foreach ($this->hash as $key) {
- $results[] = $this->hash[$key];
- }
-
- return new \ArrayIterator($results);
- }
-
- /**
- * Counts the number of elements in the batch result.
- *
- * @return int
- */
- public function count()
- {
- return count($this->hash);
- }
-
- /**
- * Checks if the batch contains a specific numerical array index.
- *
- * @param int $key Index to access
- *
- * @return bool
- */
- public function offsetExists($key)
- {
- return $key < count($this->hash);
- }
-
- /**
- * Allows access of the batch using a numerical array index.
- *
- * @param int $key Index to access.
- *
- * @return mixed|null
- */
- public function offsetGet($key)
- {
- $i = -1;
- foreach ($this->hash as $obj) {
- if ($key === ++$i) {
- return $this->hash[$obj];
- }
- }
-
- return null;
- }
-
- public function offsetUnset($key)
- {
- throw new \RuntimeException('Not implemented');
- }
-
- public function offsetSet($key, $value)
- {
- throw new \RuntimeException('Not implemented');
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/BodySummarizer.php b/lib/gerencianet/guzzlehttp/guzzle/src/BodySummarizer.php
new file mode 100644
index 0000000..6eca94e
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/BodySummarizer.php
@@ -0,0 +1,28 @@
+truncateAt = $truncateAt;
+ }
+
+ /**
+ * Returns a summarized message body.
+ */
+ public function summarize(MessageInterface $message): ?string
+ {
+ return $this->truncateAt === null
+ ? \GuzzleHttp\Psr7\Message::bodySummary($message)
+ : \GuzzleHttp\Psr7\Message::bodySummary($message, $this->truncateAt);
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/BodySummarizerInterface.php b/lib/gerencianet/guzzlehttp/guzzle/src/BodySummarizerInterface.php
new file mode 100644
index 0000000..3e02e03
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/BodySummarizerInterface.php
@@ -0,0 +1,13 @@
+ [
- * 'http://www.foo.com/{version}/',
- * ['version' => '123']
- * ],
- * 'defaults' => [
- * 'timeout' => 10,
- * 'allow_redirects' => false,
- * 'proxy' => '192.168.16.1:10'
- * ]
+ * 'base_uri' => 'http://www.foo.com/1.0/',
+ * 'timeout' => 0,
+ * 'allow_redirects' => false,
+ * 'proxy' => '192.168.16.1:10'
* ]);
*
- * @param array $config Client configuration settings
- * - base_url: Base URL of the client that is merged into relative URLs.
- * Can be a string or an array that contains a URI template followed
- * by an associative array of expansion variables to inject into the
- * URI template.
- * - handler: callable RingPHP handler used to transfer requests
- * - message_factory: Factory used to create request and response object
- * - defaults: Default request options to apply to each request
- * - emitter: Event emitter used for request events
- * - fsm: (internal use only) The request finite state machine. A
- * function that accepts a transaction and optional final state. The
- * function is responsible for transitioning a request through its
- * lifecycle events.
+ * Client configuration settings include the following options:
+ *
+ * - handler: (callable) Function that transfers HTTP requests over the
+ * wire. The function is called with a Psr7\Http\Message\RequestInterface
+ * and array of transfer options, and must return a
+ * GuzzleHttp\Promise\PromiseInterface that is fulfilled with a
+ * Psr7\Http\Message\ResponseInterface on success.
+ * If no handler is provided, a default handler will be created
+ * that enables all of the request options below by attaching all of the
+ * default middleware to the handler.
+ * - base_uri: (string|UriInterface) Base URI of the client that is merged
+ * into relative URIs. Can be a string or instance of UriInterface.
+ * - **: any request option
+ *
+ * @param array $config Client configuration settings.
+ *
+ * @see \GuzzleHttp\RequestOptions for a list of available request options.
*/
public function __construct(array $config = [])
{
- $this->configureBaseUrl($config);
- $this->configureDefaults($config);
-
- if (isset($config['emitter'])) {
- $this->emitter = $config['emitter'];
+ if (!isset($config['handler'])) {
+ $config['handler'] = HandlerStack::create();
+ } elseif (!\is_callable($config['handler'])) {
+ throw new InvalidArgumentException('handler must be a callable');
}
- $this->messageFactory = isset($config['message_factory'])
- ? $config['message_factory']
- : new MessageFactory();
-
- if (isset($config['fsm'])) {
- $this->fsm = $config['fsm'];
- } else {
- if (isset($config['handler'])) {
- $handler = $config['handler'];
- } elseif (isset($config['adapter'])) {
- $handler = $config['adapter'];
- } else {
- $handler = Utils::getDefaultHandler();
- }
- $this->fsm = new RequestFsm($handler, $this->messageFactory);
+ // Convert the base_uri to a UriInterface
+ if (isset($config['base_uri'])) {
+ $config['base_uri'] = Psr7\Utils::uriFor($config['base_uri']);
}
- }
- public function getDefaultOption($keyOrPath = null)
- {
- return $keyOrPath === null
- ? $this->defaults
- : Utils::getPath($this->defaults, $keyOrPath);
+ $this->configureDefaults($config);
}
- public function setDefaultOption($keyOrPath, $value)
+ /**
+ * @param string $method
+ * @param array $args
+ *
+ * @return PromiseInterface|ResponseInterface
+ *
+ * @deprecated Client::__call will be removed in guzzlehttp/guzzle:8.0.
+ */
+ public function __call($method, $args)
{
- Utils::setPath($this->defaults, $keyOrPath, $value);
- }
+ if (\count($args) < 1) {
+ throw new InvalidArgumentException('Magic request methods require a URI and optional options array');
+ }
- public function getBaseUrl()
- {
- return (string) $this->baseUrl;
- }
+ $uri = $args[0];
+ $opts = $args[1] ?? [];
- public function createRequest($method, $url = null, array $options = [])
- {
- $options = $this->mergeDefaults($options);
- // Use a clone of the client's emitter
- $options['config']['emitter'] = clone $this->getEmitter();
- $url = $url || (is_string($url) && strlen($url))
- ? $this->buildUrl($url)
- : (string) $this->baseUrl;
-
- return $this->messageFactory->createRequest($method, $url, $options);
+ return \substr($method, -5) === 'Async'
+ ? $this->requestAsync(\substr($method, 0, -5), $uri, $opts)
+ : $this->request($method, $uri, $opts);
}
- public function get($url = null, $options = [])
+ /**
+ * Asynchronously send an HTTP request.
+ *
+ * @param array $options Request options to apply to the given
+ * request and to the transfer. See \GuzzleHttp\RequestOptions.
+ */
+ public function sendAsync(RequestInterface $request, array $options = []): PromiseInterface
{
- return $this->send($this->createRequest('GET', $url, $options));
- }
+ // Merge the base URI into the request URI if needed.
+ $options = $this->prepareDefaults($options);
- public function head($url = null, array $options = [])
- {
- return $this->send($this->createRequest('HEAD', $url, $options));
+ return $this->transfer(
+ $request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')),
+ $options
+ );
}
- public function delete($url = null, array $options = [])
+ /**
+ * Send an HTTP request.
+ *
+ * @param array $options Request options to apply to the given
+ * request and to the transfer. See \GuzzleHttp\RequestOptions.
+ *
+ * @throws GuzzleException
+ */
+ public function send(RequestInterface $request, array $options = []): ResponseInterface
{
- return $this->send($this->createRequest('DELETE', $url, $options));
+ $options[RequestOptions::SYNCHRONOUS] = true;
+ return $this->sendAsync($request, $options)->wait();
}
- public function put($url = null, array $options = [])
+ /**
+ * The HttpClient PSR (PSR-18) specify this method.
+ *
+ * @inheritDoc
+ */
+ public function sendRequest(RequestInterface $request): ResponseInterface
{
- return $this->send($this->createRequest('PUT', $url, $options));
- }
+ $options[RequestOptions::SYNCHRONOUS] = true;
+ $options[RequestOptions::ALLOW_REDIRECTS] = false;
+ $options[RequestOptions::HTTP_ERRORS] = false;
- public function patch($url = null, array $options = [])
- {
- return $this->send($this->createRequest('PATCH', $url, $options));
+ return $this->sendAsync($request, $options)->wait();
}
- public function post($url = null, array $options = [])
+ /**
+ * Create and send an asynchronous HTTP request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string $method HTTP method
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions.
+ */
+ public function requestAsync(string $method, $uri = '', array $options = []): PromiseInterface
{
- return $this->send($this->createRequest('POST', $url, $options));
- }
+ $options = $this->prepareDefaults($options);
+ // Remove request modifying parameter because it can be done up-front.
+ $headers = $options['headers'] ?? [];
+ $body = $options['body'] ?? null;
+ $version = $options['version'] ?? '1.1';
+ // Merge the URI into the base URI.
+ $uri = $this->buildUri(Psr7\Utils::uriFor($uri), $options);
+ if (\is_array($body)) {
+ throw $this->invalidBody();
+ }
+ $request = new Psr7\Request($method, $uri, $headers, $body, $version);
+ // Remove the option so that they are not doubly-applied.
+ unset($options['headers'], $options['body'], $options['version']);
- public function options($url = null, array $options = [])
- {
- return $this->send($this->createRequest('OPTIONS', $url, $options));
+ return $this->transfer($request, $options);
}
- public function send(RequestInterface $request)
+ /**
+ * Create and send an HTTP request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well.
+ *
+ * @param string $method HTTP method.
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions.
+ *
+ * @throws GuzzleException
+ */
+ public function request(string $method, $uri = '', array $options = []): ResponseInterface
{
- $isFuture = $request->getConfig()->get('future');
- $trans = new Transaction($this, $request, $isFuture);
- $fn = $this->fsm;
-
- try {
- $fn($trans);
- if ($isFuture) {
- // Turn the normal response into a future if needed.
- return $trans->response instanceof FutureInterface
- ? $trans->response
- : new FutureResponse(new FulfilledPromise($trans->response));
- }
- // Resolve deep futures if this is not a future
- // transaction. This accounts for things like retries
- // that do not have an immediate side-effect.
- while ($trans->response instanceof FutureInterface) {
- $trans->response = $trans->response->wait();
- }
- return $trans->response;
- } catch (\Exception $e) {
- if ($isFuture) {
- // Wrap the exception in a promise
- return new FutureResponse(new RejectedPromise($e));
- }
- throw RequestException::wrapException($trans->request, $e);
- }
+ $options[RequestOptions::SYNCHRONOUS] = true;
+ return $this->requestAsync($method, $uri, $options)->wait();
}
/**
- * Get an array of default options to apply to the client
+ * Get a client configuration option.
+ *
+ * These options include default request options of the client, a "handler"
+ * (if utilized by the concrete client), and a "base_uri" if utilized by
+ * the concrete client.
*
- * @return array
+ * @param string|null $option The config option to retrieve.
+ *
+ * @return mixed
+ *
+ * @deprecated Client::getConfig will be removed in guzzlehttp/guzzle:8.0.
*/
- protected function getDefaultOptions()
+ public function getConfig(?string $option = null)
{
- $settings = [
- 'allow_redirects' => true,
- 'exceptions' => true,
- 'decode_content' => true,
- 'verify' => true
- ];
+ return $option === null
+ ? $this->config
+ : ($this->config[$option] ?? null);
+ }
- // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set
- if ($proxy = getenv('HTTP_PROXY')) {
- $settings['proxy']['http'] = $proxy;
+ private function buildUri(UriInterface $uri, array $config): UriInterface
+ {
+ if (isset($config['base_uri'])) {
+ $uri = Psr7\UriResolver::resolve(Psr7\Utils::uriFor($config['base_uri']), $uri);
}
- if ($proxy = getenv('HTTPS_PROXY')) {
- $settings['proxy']['https'] = $proxy;
+ if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) {
+ $idnOptions = ($config['idn_conversion'] === true) ? \IDNA_DEFAULT : $config['idn_conversion'];
+ $uri = Utils::idnUriConvert($uri, $idnOptions);
}
- return $settings;
+ return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri;
}
/**
- * Expand a URI template and inherit from the base URL if it's relative
- *
- * @param string|array $url URL or an array of the URI template to expand
- * followed by a hash of template varnames.
- * @return string
- * @throws \InvalidArgumentException
+ * Configures the default options for a client.
*/
- private function buildUrl($url)
+ private function configureDefaults(array $config): void
{
- // URI template (absolute or relative)
- if (!is_array($url)) {
- return strpos($url, '://')
- ? (string) $url
- : (string) $this->baseUrl->combine($url);
+ $defaults = [
+ 'allow_redirects' => RedirectMiddleware::$defaultSettings,
+ 'http_errors' => true,
+ 'decode_content' => true,
+ 'verify' => true,
+ 'cookies' => false,
+ 'idn_conversion' => false,
+ ];
+
+ // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set.
+
+ // We can only trust the HTTP_PROXY environment variable in a CLI
+ // process due to the fact that PHP has no reliable mechanism to
+ // get environment variables that start with "HTTP_".
+ if (\PHP_SAPI === 'cli' && ($proxy = Utils::getenv('HTTP_PROXY'))) {
+ $defaults['proxy']['http'] = $proxy;
}
- if (!isset($url[1])) {
- throw new \InvalidArgumentException('You must provide a hash of '
- . 'varname options in the second element of a URL array.');
+ if ($proxy = Utils::getenv('HTTPS_PROXY')) {
+ $defaults['proxy']['https'] = $proxy;
}
- // Absolute URL
- if (strpos($url[0], '://')) {
- return Utils::uriTemplate($url[0], $url[1]);
+ if ($noProxy = Utils::getenv('NO_PROXY')) {
+ $cleanedNoProxy = \str_replace(' ', '', $noProxy);
+ $defaults['proxy']['no'] = \explode(',', $cleanedNoProxy);
}
- // Combine the relative URL with the base URL
- return (string) $this->baseUrl->combine(
- Utils::uriTemplate($url[0], $url[1])
- );
- }
+ $this->config = $config + $defaults;
- private function configureBaseUrl(&$config)
- {
- if (!isset($config['base_url'])) {
- $this->baseUrl = new Url('', '');
- } elseif (!is_array($config['base_url'])) {
- $this->baseUrl = Url::fromString($config['base_url']);
- } elseif (count($config['base_url']) < 2) {
- throw new \InvalidArgumentException('You must provide a hash of '
- . 'varname options in the second element of a base_url array.');
- } else {
- $this->baseUrl = Url::fromString(
- Utils::uriTemplate(
- $config['base_url'][0],
- $config['base_url'][1]
- )
- );
- $config['base_url'] = (string) $this->baseUrl;
+ if (!empty($config['cookies']) && $config['cookies'] === true) {
+ $this->config['cookies'] = new CookieJar();
}
- }
- private function configureDefaults($config)
- {
- if (!isset($config['defaults'])) {
- $this->defaults = $this->getDefaultOptions();
+ // Add the default user-agent header.
+ if (!isset($this->config['headers'])) {
+ $this->config['headers'] = ['User-Agent' => Utils::defaultUserAgent()];
} else {
- $this->defaults = array_replace(
- $this->getDefaultOptions(),
- $config['defaults']
- );
- }
-
- // Add the default user-agent header
- if (!isset($this->defaults['headers'])) {
- $this->defaults['headers'] = [
- 'User-Agent' => Utils::getDefaultUserAgent()
- ];
- } elseif (!Core::hasHeader($this->defaults, 'User-Agent')) {
- // Add the User-Agent header if one was not already set
- $this->defaults['headers']['User-Agent'] = Utils::getDefaultUserAgent();
+ // Add the User-Agent header if one was not already set.
+ foreach (\array_keys($this->config['headers']) as $name) {
+ if (\strtolower($name) === 'user-agent') {
+ return;
+ }
+ }
+ $this->config['headers']['User-Agent'] = Utils::defaultUserAgent();
}
}
/**
- * Merges default options into the array passed by reference.
+ * Merges default options into the array.
*
* @param array $options Options to modify by reference
- *
- * @return array
*/
- private function mergeDefaults($options)
+ private function prepareDefaults(array $options): array
{
- $defaults = $this->defaults;
-
- // Case-insensitively merge in default headers if both defaults and
- // options have headers specified.
- if (!empty($defaults['headers']) && !empty($options['headers'])) {
- // Create a set of lowercased keys that are present.
- $lkeys = [];
- foreach (array_keys($options['headers']) as $k) {
- $lkeys[strtolower($k)] = true;
- }
- // Merge in lowercase default keys when not present in above set.
- foreach ($defaults['headers'] as $key => $value) {
- if (!isset($lkeys[strtolower($key)])) {
- $options['headers'][$key] = $value;
- }
- }
- // No longer need to merge in headers.
+ $defaults = $this->config;
+
+ if (!empty($defaults['headers'])) {
+ // Default headers are only added if they are not present.
+ $defaults['_conditional'] = $defaults['headers'];
unset($defaults['headers']);
}
- $result = array_replace_recursive($defaults, $options);
- foreach ($options as $k => $v) {
+ // Special handling for headers is required as they are added as
+ // conditional headers and as headers passed to a request ctor.
+ if (\array_key_exists('headers', $options)) {
+ // Allows default headers to be unset.
+ if ($options['headers'] === null) {
+ $defaults['_conditional'] = [];
+ unset($options['headers']);
+ } elseif (!\is_array($options['headers'])) {
+ throw new InvalidArgumentException('headers must be an array');
+ }
+ }
+
+ // Shallow merge defaults underneath options.
+ $result = $options + $defaults;
+
+ // Remove null values.
+ foreach ($result as $k => $v) {
if ($v === null) {
unset($result[$k]);
}
@@ -326,27 +314,161 @@ private function mergeDefaults($options)
}
/**
- * @deprecated Use {@see GuzzleHttp\Pool} instead.
- * @see GuzzleHttp\Pool
+ * Transfers the given request and applies request options.
+ *
+ * The URI of the request is not modified and the request options are used
+ * as-is without merging in default options.
+ *
+ * @param array $options See \GuzzleHttp\RequestOptions.
*/
- public function sendAll($requests, array $options = [])
+ private function transfer(RequestInterface $request, array $options): PromiseInterface
{
- Pool::send($this, $requests, $options);
+ $request = $this->applyOptions($request, $options);
+ /** @var HandlerStack $handler */
+ $handler = $options['handler'];
+
+ try {
+ return P\Create::promiseFor($handler($request, $options));
+ } catch (\Exception $e) {
+ return P\Create::rejectionFor($e);
+ }
}
/**
- * @deprecated Use GuzzleHttp\Utils::getDefaultHandler
+ * Applies the array of request options to a request.
*/
- public static function getDefaultHandler()
+ private function applyOptions(RequestInterface $request, array &$options): RequestInterface
{
- return Utils::getDefaultHandler();
+ $modify = [
+ 'set_headers' => [],
+ ];
+
+ if (isset($options['headers'])) {
+ $modify['set_headers'] = $options['headers'];
+ unset($options['headers']);
+ }
+
+ if (isset($options['form_params'])) {
+ if (isset($options['multipart'])) {
+ throw new InvalidArgumentException('You cannot use '
+ . 'form_params and multipart at the same time. Use the '
+ . 'form_params option if you want to send application/'
+ . 'x-www-form-urlencoded requests, and the multipart '
+ . 'option to send multipart/form-data requests.');
+ }
+ $options['body'] = \http_build_query($options['form_params'], '', '&');
+ unset($options['form_params']);
+ // Ensure that we don't have the header in different case and set the new value.
+ $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']);
+ $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded';
+ }
+
+ if (isset($options['multipart'])) {
+ $options['body'] = new Psr7\MultipartStream($options['multipart']);
+ unset($options['multipart']);
+ }
+
+ if (isset($options['json'])) {
+ $options['body'] = Utils::jsonEncode($options['json']);
+ unset($options['json']);
+ // Ensure that we don't have the header in different case and set the new value.
+ $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']);
+ $options['_conditional']['Content-Type'] = 'application/json';
+ }
+
+ if (!empty($options['decode_content'])
+ && $options['decode_content'] !== true
+ ) {
+ // Ensure that we don't have the header in different case and set the new value.
+ $options['_conditional'] = Psr7\Utils::caselessRemove(['Accept-Encoding'], $options['_conditional']);
+ $modify['set_headers']['Accept-Encoding'] = $options['decode_content'];
+ }
+
+ if (isset($options['body'])) {
+ if (\is_array($options['body'])) {
+ throw $this->invalidBody();
+ }
+ $modify['body'] = Psr7\Utils::streamFor($options['body']);
+ unset($options['body']);
+ }
+
+ if (!empty($options['auth']) && \is_array($options['auth'])) {
+ $value = $options['auth'];
+ $type = isset($value[2]) ? \strtolower($value[2]) : 'basic';
+ switch ($type) {
+ case 'basic':
+ // Ensure that we don't have the header in different case and set the new value.
+ $modify['set_headers'] = Psr7\Utils::caselessRemove(['Authorization'], $modify['set_headers']);
+ $modify['set_headers']['Authorization'] = 'Basic '
+ . \base64_encode("$value[0]:$value[1]");
+ break;
+ case 'digest':
+ // @todo: Do not rely on curl
+ $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_DIGEST;
+ $options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]";
+ break;
+ case 'ntlm':
+ $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_NTLM;
+ $options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]";
+ break;
+ }
+ }
+
+ if (isset($options['query'])) {
+ $value = $options['query'];
+ if (\is_array($value)) {
+ $value = \http_build_query($value, '', '&', \PHP_QUERY_RFC3986);
+ }
+ if (!\is_string($value)) {
+ throw new InvalidArgumentException('query must be a string or array');
+ }
+ $modify['query'] = $value;
+ unset($options['query']);
+ }
+
+ // Ensure that sink is not an invalid value.
+ if (isset($options['sink'])) {
+ // TODO: Add more sink validation?
+ if (\is_bool($options['sink'])) {
+ throw new InvalidArgumentException('sink must not be a boolean');
+ }
+ }
+
+ $request = Psr7\Utils::modifyRequest($request, $modify);
+ if ($request->getBody() instanceof Psr7\MultipartStream) {
+ // Use a multipart/form-data POST if a Content-Type is not set.
+ // Ensure that we don't have the header in different case and set the new value.
+ $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']);
+ $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary='
+ . $request->getBody()->getBoundary();
+ }
+
+ // Merge in conditional headers if they are not present.
+ if (isset($options['_conditional'])) {
+ // Build up the changes so it's in a single clone of the message.
+ $modify = [];
+ foreach ($options['_conditional'] as $k => $v) {
+ if (!$request->hasHeader($k)) {
+ $modify['set_headers'][$k] = $v;
+ }
+ }
+ $request = Psr7\Utils::modifyRequest($request, $modify);
+ // Don't pass this internal value along to middleware/handlers.
+ unset($options['_conditional']);
+ }
+
+ return $request;
}
/**
- * @deprecated Use GuzzleHttp\Utils::getDefaultUserAgent
+ * Return an InvalidArgumentException with pre-set message.
*/
- public static function getDefaultUserAgent()
+ private function invalidBody(): InvalidArgumentException
{
- return Utils::getDefaultUserAgent();
+ return new InvalidArgumentException('Passing in the "body" request '
+ . 'option as an array to send a request is not supported. '
+ . 'Please use the "form_params" request option to send a '
+ . 'application/x-www-form-urlencoded request, or the "multipart" '
+ . 'request option to send a multipart/form-data request.');
}
}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/ClientInterface.php b/lib/gerencianet/guzzlehttp/guzzle/src/ClientInterface.php
index 63f0174..f257a1a 100644
--- a/lib/gerencianet/guzzlehttp/guzzle/src/ClientInterface.php
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/ClientInterface.php
@@ -1,150 +1,84 @@
request('GET', $uri, $options);
+ }
+
+ /**
+ * Create and send an HTTP HEAD request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ *
+ * @throws GuzzleException
+ */
+ public function head($uri, array $options = []): ResponseInterface
+ {
+ return $this->request('HEAD', $uri, $options);
+ }
+
+ /**
+ * Create and send an HTTP PUT request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ *
+ * @throws GuzzleException
+ */
+ public function put($uri, array $options = []): ResponseInterface
+ {
+ return $this->request('PUT', $uri, $options);
+ }
+
+ /**
+ * Create and send an HTTP POST request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ *
+ * @throws GuzzleException
+ */
+ public function post($uri, array $options = []): ResponseInterface
+ {
+ return $this->request('POST', $uri, $options);
+ }
+
+ /**
+ * Create and send an HTTP PATCH request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ *
+ * @throws GuzzleException
+ */
+ public function patch($uri, array $options = []): ResponseInterface
+ {
+ return $this->request('PATCH', $uri, $options);
+ }
+
+ /**
+ * Create and send an HTTP DELETE request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ *
+ * @throws GuzzleException
+ */
+ public function delete($uri, array $options = []): ResponseInterface
+ {
+ return $this->request('DELETE', $uri, $options);
+ }
+
+ /**
+ * Create and send an asynchronous HTTP request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string $method HTTP method
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ */
+ abstract public function requestAsync(string $method, $uri, array $options = []): PromiseInterface;
+
+ /**
+ * Create and send an asynchronous HTTP GET request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ */
+ public function getAsync($uri, array $options = []): PromiseInterface
+ {
+ return $this->requestAsync('GET', $uri, $options);
+ }
+
+ /**
+ * Create and send an asynchronous HTTP HEAD request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ */
+ public function headAsync($uri, array $options = []): PromiseInterface
+ {
+ return $this->requestAsync('HEAD', $uri, $options);
+ }
+
+ /**
+ * Create and send an asynchronous HTTP PUT request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ */
+ public function putAsync($uri, array $options = []): PromiseInterface
+ {
+ return $this->requestAsync('PUT', $uri, $options);
+ }
+
+ /**
+ * Create and send an asynchronous HTTP POST request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ */
+ public function postAsync($uri, array $options = []): PromiseInterface
+ {
+ return $this->requestAsync('POST', $uri, $options);
+ }
+
+ /**
+ * Create and send an asynchronous HTTP PATCH request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ */
+ public function patchAsync($uri, array $options = []): PromiseInterface
+ {
+ return $this->requestAsync('PATCH', $uri, $options);
+ }
+
+ /**
+ * Create and send an asynchronous HTTP DELETE request.
+ *
+ * Use an absolute path to override the base path of the client, or a
+ * relative path to append to the base path of the client. The URL can
+ * contain the query string as well. Use an array to provide a URL
+ * template and additional variables to use in the URL template expansion.
+ *
+ * @param string|UriInterface $uri URI object or string.
+ * @param array $options Request options to apply.
+ */
+ public function deleteAsync($uri, array $options = []): PromiseInterface
+ {
+ return $this->requestAsync('DELETE', $uri, $options);
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Collection.php b/lib/gerencianet/guzzlehttp/guzzle/src/Collection.php
deleted file mode 100644
index 4aabd20..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Collection.php
+++ /dev/null
@@ -1,236 +0,0 @@
-data = $data;
- }
-
- /**
- * Create a new collection from an array, validate the keys, and add default
- * values where missing
- *
- * @param array $config Configuration values to apply.
- * @param array $defaults Default parameters
- * @param array $required Required parameter names
- *
- * @return self
- * @throws \InvalidArgumentException if a parameter is missing
- */
- public static function fromConfig(
- array $config = [],
- array $defaults = [],
- array $required = []
- ) {
- $data = $config + $defaults;
-
- if ($missing = array_diff($required, array_keys($data))) {
- throw new \InvalidArgumentException(
- 'Config is missing the following keys: ' .
- implode(', ', $missing));
- }
-
- return new self($data);
- }
-
- /**
- * Removes all key value pairs
- */
- public function clear()
- {
- $this->data = [];
- }
-
- /**
- * Get a specific key value.
- *
- * @param string $key Key to retrieve.
- *
- * @return mixed|null Value of the key or NULL
- */
- public function get($key)
- {
- return isset($this->data[$key]) ? $this->data[$key] : null;
- }
-
- /**
- * Set a key value pair
- *
- * @param string $key Key to set
- * @param mixed $value Value to set
- */
- public function set($key, $value)
- {
- $this->data[$key] = $value;
- }
-
- /**
- * Add a value to a key. If a key of the same name has already been added,
- * the key value will be converted into an array and the new value will be
- * pushed to the end of the array.
- *
- * @param string $key Key to add
- * @param mixed $value Value to add to the key
- */
- public function add($key, $value)
- {
- if (!array_key_exists($key, $this->data)) {
- $this->data[$key] = $value;
- } elseif (is_array($this->data[$key])) {
- $this->data[$key][] = $value;
- } else {
- $this->data[$key] = array($this->data[$key], $value);
- }
- }
-
- /**
- * Remove a specific key value pair
- *
- * @param string $key A key to remove
- */
- public function remove($key)
- {
- unset($this->data[$key]);
- }
-
- /**
- * Get all keys in the collection
- *
- * @return array
- */
- public function getKeys()
- {
- return array_keys($this->data);
- }
-
- /**
- * Returns whether or not the specified key is present.
- *
- * @param string $key The key for which to check the existence.
- *
- * @return bool
- */
- public function hasKey($key)
- {
- return array_key_exists($key, $this->data);
- }
-
- /**
- * Checks if any keys contains a certain value
- *
- * @param string $value Value to search for
- *
- * @return mixed Returns the key if the value was found FALSE if the value
- * was not found.
- */
- public function hasValue($value)
- {
- return array_search($value, $this->data, true);
- }
-
- /**
- * Replace the data of the object with the value of an array
- *
- * @param array $data Associative array of data
- */
- public function replace(array $data)
- {
- $this->data = $data;
- }
-
- /**
- * Add and merge in a Collection or array of key value pair data.
- *
- * @param Collection|array $data Associative array of key value pair data
- */
- public function merge($data)
- {
- foreach ($data as $key => $value) {
- $this->add($key, $value);
- }
- }
-
- /**
- * Overwrite key value pairs in this collection with all of the data from
- * an array or collection.
- *
- * @param array|\Traversable $data Values to override over this config
- */
- public function overwriteWith($data)
- {
- if (is_array($data)) {
- $this->data = $data + $this->data;
- } elseif ($data instanceof Collection) {
- $this->data = $data->toArray() + $this->data;
- } else {
- foreach ($data as $key => $value) {
- $this->data[$key] = $value;
- }
- }
- }
-
- /**
- * Returns a Collection containing all the elements of the collection after
- * applying the callback function to each one.
- *
- * The callable should accept three arguments:
- * - (string) $key
- * - (string) $value
- * - (array) $context
- *
- * The callable must return a the altered or unaltered value.
- *
- * @param callable $closure Map function to apply
- * @param array $context Context to pass to the callable
- *
- * @return Collection
- */
- public function map(callable $closure, array $context = [])
- {
- $collection = new static();
- foreach ($this as $key => $value) {
- $collection[$key] = $closure($key, $value, $context);
- }
-
- return $collection;
- }
-
- /**
- * Iterates over each key value pair in the collection passing them to the
- * callable. If the callable returns true, the current value from input is
- * returned into the result Collection.
- *
- * The callable must accept two arguments:
- * - (string) $key
- * - (string) $value
- *
- * @param callable $closure Evaluation function
- *
- * @return Collection
- */
- public function filter(callable $closure)
- {
- $collection = new static();
- foreach ($this->data as $key => $value) {
- if ($closure($key, $value)) {
- $collection[$key] = $value;
- }
- }
-
- return $collection;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/CookieJar.php b/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/CookieJar.php
index f8ac7dd..d6757c6 100644
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/CookieJar.php
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/CookieJar.php
@@ -1,28 +1,33 @@
strictMode = $strictMode;
@@ -39,10 +44,8 @@ public function __construct($strictMode = false, $cookieArray = [])
*
* @param array $cookies Cookies to create the jar from
* @param string $domain Domain to set the cookies to
- *
- * @return self
*/
- public static function fromArray(array $cookies, $domain)
+ public static function fromArray(array $cookies, string $domain): self
{
$cookieJar = new self();
foreach ($cookies as $name => $value) {
@@ -58,56 +61,78 @@ public static function fromArray(array $cookies, $domain)
}
/**
- * Quote the cookie value if it is not already quoted and it contains
- * problematic characters.
+ * Evaluate if this cookie should be persisted to storage
+ * that survives between requests.
*
- * @param string $value Value that may or may not need to be quoted
+ * @param SetCookie $cookie Being evaluated.
+ * @param bool $allowSessionCookies If we should persist session cookies
+ */
+ public static function shouldPersist(SetCookie $cookie, bool $allowSessionCookies = false): bool
+ {
+ if ($cookie->getExpires() || $allowSessionCookies) {
+ if (!$cookie->getDiscard()) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Finds and returns the cookie based on the name
+ *
+ * @param string $name cookie name to search for
*
- * @return string
+ * @return SetCookie|null cookie that was found or null if not found
*/
- public static function getCookieValue($value)
+ public function getCookieByName(string $name): ?SetCookie
{
- if (substr($value, 0, 1) !== '"' &&
- substr($value, -1, 1) !== '"' &&
- strpbrk($value, ';,')
- ) {
- $value = '"' . $value . '"';
+ foreach ($this->cookies as $cookie) {
+ if ($cookie->getName() !== null && \strcasecmp($cookie->getName(), $name) === 0) {
+ return $cookie;
+ }
}
- return $value;
+ return null;
}
- public function toArray()
+ /**
+ * @inheritDoc
+ */
+ public function toArray(): array
{
- return array_map(function (SetCookie $cookie) {
+ return \array_map(static function (SetCookie $cookie): array {
return $cookie->toArray();
}, $this->getIterator()->getArrayCopy());
}
- public function clear($domain = null, $path = null, $name = null)
+ /**
+ * @inheritDoc
+ */
+ public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void
{
if (!$domain) {
$this->cookies = [];
return;
} elseif (!$path) {
- $this->cookies = array_filter(
+ $this->cookies = \array_filter(
$this->cookies,
- function (SetCookie $cookie) use ($path, $domain) {
+ static function (SetCookie $cookie) use ($domain): bool {
return !$cookie->matchesDomain($domain);
}
);
} elseif (!$name) {
- $this->cookies = array_filter(
+ $this->cookies = \array_filter(
$this->cookies,
- function (SetCookie $cookie) use ($path, $domain) {
+ static function (SetCookie $cookie) use ($path, $domain): bool {
return !($cookie->matchesPath($path) &&
$cookie->matchesDomain($domain));
}
);
} else {
- $this->cookies = array_filter(
+ $this->cookies = \array_filter(
$this->cookies,
- function (SetCookie $cookie) use ($path, $domain, $name) {
+ static function (SetCookie $cookie) use ($path, $domain, $name) {
return !($cookie->getName() == $name &&
$cookie->matchesPath($path) &&
$cookie->matchesDomain($domain));
@@ -116,27 +141,39 @@ function (SetCookie $cookie) use ($path, $domain, $name) {
}
}
- public function clearSessionCookies()
+ /**
+ * @inheritDoc
+ */
+ public function clearSessionCookies(): void
{
- $this->cookies = array_filter(
+ $this->cookies = \array_filter(
$this->cookies,
- function (SetCookie $cookie) {
+ static function (SetCookie $cookie): bool {
return !$cookie->getDiscard() && $cookie->getExpires();
}
);
}
- public function setCookie(SetCookie $cookie)
+ /**
+ * @inheritDoc
+ */
+ public function setCookie(SetCookie $cookie): bool
{
+ // If the name string is empty (but not 0), ignore the set-cookie
+ // string entirely.
+ $name = $cookie->getName();
+ if (!$name && $name !== '0') {
+ return false;
+ }
+
// Only allow cookies with set and valid domain, name, value
$result = $cookie->validate();
if ($result !== true) {
if ($this->strictMode) {
throw new \RuntimeException('Invalid cookie: ' . $result);
- } else {
- $this->removeCookieIfEmpty($cookie);
- return false;
}
+ $this->removeCookieIfEmpty($cookie);
+ return false;
}
// Resolve conflicts with previously set cookies
@@ -180,61 +217,89 @@ public function setCookie(SetCookie $cookie)
return true;
}
- public function count()
+ public function count(): int
{
- return count($this->cookies);
+ return \count($this->cookies);
}
- public function getIterator()
+ /**
+ * @return \ArrayIterator
+ */
+ public function getIterator(): \ArrayIterator
{
- return new \ArrayIterator(array_values($this->cookies));
+ return new \ArrayIterator(\array_values($this->cookies));
}
- public function extractCookies(
- RequestInterface $request,
- ResponseInterface $response
- ) {
- if ($cookieHeader = $response->getHeaderAsArray('Set-Cookie')) {
+ public function extractCookies(RequestInterface $request, ResponseInterface $response): void
+ {
+ if ($cookieHeader = $response->getHeader('Set-Cookie')) {
foreach ($cookieHeader as $cookie) {
$sc = SetCookie::fromString($cookie);
if (!$sc->getDomain()) {
- $sc->setDomain($request->getHost());
+ $sc->setDomain($request->getUri()->getHost());
+ }
+ if (0 !== \strpos($sc->getPath(), '/')) {
+ $sc->setPath($this->getCookiePathFromRequest($request));
}
$this->setCookie($sc);
}
}
}
- public function addCookieHeader(RequestInterface $request)
+ /**
+ * Computes cookie path following RFC 6265 section 5.1.4
+ *
+ * @link https://tools.ietf.org/html/rfc6265#section-5.1.4
+ */
+ private function getCookiePathFromRequest(RequestInterface $request): string
+ {
+ $uriPath = $request->getUri()->getPath();
+ if ('' === $uriPath) {
+ return '/';
+ }
+ if (0 !== \strpos($uriPath, '/')) {
+ return '/';
+ }
+ if ('/' === $uriPath) {
+ return '/';
+ }
+ $lastSlashPos = \strrpos($uriPath, '/');
+ if (0 === $lastSlashPos || false === $lastSlashPos) {
+ return '/';
+ }
+
+ return \substr($uriPath, 0, $lastSlashPos);
+ }
+
+ public function withCookieHeader(RequestInterface $request): RequestInterface
{
$values = [];
- $scheme = $request->getScheme();
- $host = $request->getHost();
- $path = $request->getPath();
+ $uri = $request->getUri();
+ $scheme = $uri->getScheme();
+ $host = $uri->getHost();
+ $path = $uri->getPath() ?: '/';
foreach ($this->cookies as $cookie) {
if ($cookie->matchesPath($path) &&
$cookie->matchesDomain($host) &&
!$cookie->isExpired() &&
- (!$cookie->getSecure() || $scheme == 'https')
+ (!$cookie->getSecure() || $scheme === 'https')
) {
$values[] = $cookie->getName() . '='
- . self::getCookieValue($cookie->getValue());
+ . $cookie->getValue();
}
}
- if ($values) {
- $request->setHeader('Cookie', implode('; ', $values));
- }
+ return $values
+ ? $request->withHeader('Cookie', \implode('; ', $values))
+ : $request;
}
/**
* If a cookie already exists and the server asks to set it again with a
* null value, the cookie must be deleted.
- *
- * @param SetCookie $cookie
*/
- private function removeCookieIfEmpty(SetCookie $cookie)
+ private function removeCookieIfEmpty(SetCookie $cookie): void
{
$cookieValue = $cookie->getValue();
if ($cookieValue === null || $cookieValue === '') {
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php
index 4ea8567..7df374b 100644
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php
@@ -1,8 +1,9 @@
*/
interface CookieJarInterface extends \Countable, \IteratorAggregate
{
/**
- * Add a Cookie header to a request.
+ * Create a request with added cookie headers.
*
* If no matching cookies are found in the cookie jar, then no Cookie
- * header is added to the request.
+ * header is added to the request and the same request is returned.
+ *
+ * @param RequestInterface $request Request object to modify.
*
- * @param RequestInterface $request Request object to update
+ * @return RequestInterface returns the modified request.
*/
- public function addCookieHeader(RequestInterface $request);
+ public function withCookieHeader(RequestInterface $request): RequestInterface;
/**
* Extract cookies from an HTTP response and store them in the CookieJar.
@@ -32,10 +36,7 @@ public function addCookieHeader(RequestInterface $request);
* @param RequestInterface $request Request that was sent
* @param ResponseInterface $response Response that was received
*/
- public function extractCookies(
- RequestInterface $request,
- ResponseInterface $response
- );
+ public function extractCookies(RequestInterface $request, ResponseInterface $response): void;
/**
* Sets a cookie in the cookie jar.
@@ -44,7 +45,7 @@ public function extractCookies(
*
* @return bool Returns true on success or false on failure
*/
- public function setCookie(SetCookie $cookie);
+ public function setCookie(SetCookie $cookie): bool;
/**
* Remove cookies currently held in the cookie jar.
@@ -56,13 +57,11 @@ public function setCookie(SetCookie $cookie);
* arguments, then the cookie with the specified name, path and domain is
* removed.
*
- * @param string $domain Clears cookies matching a domain
- * @param string $path Clears cookies matching a domain and path
- * @param string $name Clears cookies matching a domain, path, and name
- *
- * @return CookieJarInterface
+ * @param string|null $domain Clears cookies matching a domain
+ * @param string|null $path Clears cookies matching a domain and path
+ * @param string|null $name Clears cookies matching a domain, path, and name
*/
- public function clear($domain = null, $path = null, $name = null);
+ public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void;
/**
* Discard all sessions cookies.
@@ -71,5 +70,10 @@ public function clear($domain = null, $path = null, $name = null);
* field set to true. To be called when the user agent shuts down according
* to RFC 2965.
*/
- public function clearSessionCookies();
+ public function clearSessionCookies(): void;
+
+ /**
+ * Converts the cookie jar to an array.
+ */
+ public function toArray(): array;
}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php b/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php
index e431851..290236d 100644
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php
@@ -1,4 +1,5 @@
filename = $cookieFile;
+ $this->storeSessionCookies = $storeSessionCookies;
- if (file_exists($cookieFile)) {
+ if (\file_exists($cookieFile)) {
$this->load($cookieFile);
}
}
@@ -39,21 +51,22 @@ public function __destruct()
* Saves the cookies to a file.
*
* @param string $filename File to save
+ *
* @throws \RuntimeException if the file cannot be found or created
*/
- public function save($filename)
+ public function save(string $filename): void
{
$json = [];
+ /** @var SetCookie $cookie */
foreach ($this as $cookie) {
- if ($cookie->getExpires() && !$cookie->getDiscard()) {
+ if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
$json[] = $cookie->toArray();
}
}
- if (false === file_put_contents($filename, json_encode($json))) {
- // @codeCoverageIgnoreStart
+ $jsonStr = Utils::jsonEncode($json);
+ if (false === \file_put_contents($filename, $jsonStr, \LOCK_EX)) {
throw new \RuntimeException("Unable to save file {$filename}");
- // @codeCoverageIgnoreEnd
}
}
@@ -63,23 +76,25 @@ public function save($filename)
* Old cookies are kept unless overwritten by newly loaded ones.
*
* @param string $filename Cookie file to load.
+ *
* @throws \RuntimeException if the file cannot be loaded.
*/
- public function load($filename)
+ public function load(string $filename): void
{
- $json = file_get_contents($filename);
+ $json = \file_get_contents($filename);
if (false === $json) {
- // @codeCoverageIgnoreStart
throw new \RuntimeException("Unable to load file {$filename}");
- // @codeCoverageIgnoreEnd
+ }
+ if ($json === '') {
+ return;
}
$data = Utils::jsonDecode($json, true);
- if (is_array($data)) {
- foreach (Utils::jsonDecode($json, true) as $cookie) {
+ if (\is_array($data)) {
+ foreach ($data as $cookie) {
$this->setCookie(new SetCookie($cookie));
}
- } elseif (strlen($data)) {
+ } elseif (\is_scalar($data) && !empty($data)) {
throw new \RuntimeException("Invalid cookie file: {$filename}");
}
}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php b/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php
index 71a02d5..5d51ca9 100644
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php
@@ -1,24 +1,35 @@
sessionKey = $sessionKey;
+ $this->storeSessionCookies = $storeSessionCookies;
$this->load();
}
@@ -33,33 +44,33 @@ public function __destruct()
/**
* Save cookies to the client session
*/
- public function save()
+ public function save(): void
{
$json = [];
+ /** @var SetCookie $cookie */
foreach ($this as $cookie) {
- if ($cookie->getExpires() && !$cookie->getDiscard()) {
+ if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
$json[] = $cookie->toArray();
}
}
- $_SESSION[$this->sessionKey] = json_encode($json);
+ $_SESSION[$this->sessionKey] = \json_encode($json);
}
/**
* Load the contents of the client session into the data array
*/
- protected function load()
+ protected function load(): void
{
- $cookieJar = isset($_SESSION[$this->sessionKey])
- ? $_SESSION[$this->sessionKey]
- : null;
-
- $data = Utils::jsonDecode($cookieJar, true);
- if (is_array($data)) {
+ if (!isset($_SESSION[$this->sessionKey])) {
+ return;
+ }
+ $data = \json_decode($_SESSION[$this->sessionKey], true);
+ if (\is_array($data)) {
foreach ($data as $cookie) {
$this->setCookie(new SetCookie($cookie));
}
- } elseif (strlen($data)) {
+ } elseif (\strlen($data)) {
throw new \RuntimeException("Invalid cookie data");
}
}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/SetCookie.php
index ac9a890..602370d 100644
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/SetCookie.php
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Cookie/SetCookie.php
@@ -1,14 +1,15 @@
null,
'Value' => null,
@@ -21,43 +22,42 @@ class SetCookie implements ToArrayInterface
'HttpOnly' => false
];
- /** @var array Cookie data */
+ /**
+ * @var array Cookie data
+ */
private $data;
/**
- * Create a new SetCookie object from a string
+ * Create a new SetCookie object from a string.
*
* @param string $cookie Set-Cookie header string
- *
- * @return self
*/
- public static function fromString($cookie)
+ public static function fromString(string $cookie): self
{
// Create the default return array
$data = self::$defaults;
// Explode the cookie string using a series of semicolons
- $pieces = array_filter(array_map('trim', explode(';', $cookie)));
- // The name of the cookie (first kvp) must include an equal sign.
- if (empty($pieces) || !strpos($pieces[0], '=')) {
+ $pieces = \array_filter(\array_map('trim', \explode(';', $cookie)));
+ // The name of the cookie (first kvp) must exist and include an equal sign.
+ if (!isset($pieces[0]) || \strpos($pieces[0], '=') === false) {
return new self($data);
}
// Add the cookie pieces into the parsed data array
foreach ($pieces as $part) {
-
- $cookieParts = explode('=', $part, 2);
- $key = trim($cookieParts[0]);
+ $cookieParts = \explode('=', $part, 2);
+ $key = \trim($cookieParts[0]);
$value = isset($cookieParts[1])
- ? trim($cookieParts[1], " \n\r\t\0\x0B\"")
+ ? \trim($cookieParts[1], " \n\r\t\0\x0B")
: true;
// Only check for non-cookies when cookies have been found
- if (empty($data['Name'])) {
+ if (!isset($data['Name'])) {
$data['Name'] = $key;
$data['Value'] = $value;
} else {
- foreach (array_keys(self::$defaults) as $search) {
- if (!strcasecmp($search, $key)) {
+ foreach (\array_keys(self::$defaults) as $search) {
+ if (!\strcasecmp($search, $key)) {
$data[$search] = $value;
continue 2;
}
@@ -74,13 +74,19 @@ public static function fromString($cookie)
*/
public function __construct(array $data = [])
{
- $this->data = array_replace(self::$defaults, $data);
+ /** @var array|null $replaced will be null in case of replace error */
+ $replaced = \array_replace(self::$defaults, $data);
+ if ($replaced === null) {
+ throw new \InvalidArgumentException('Unable to replace the default values for the Cookie.');
+ }
+
+ $this->data = $replaced;
// Extract the Expires value and turn it into a UNIX timestamp if needed
if (!$this->getExpires() && $this->getMaxAge()) {
// Calculate the Expires date
- $this->setExpires(time() + $this->getMaxAge());
- } elseif ($this->getExpires() && !is_numeric($this->getExpires())) {
- $this->setExpires($this->getExpires());
+ $this->setExpires(\time() + $this->getMaxAge());
+ } elseif (null !== ($expires = $this->getExpires()) && !\is_numeric($expires)) {
+ $this->setExpires($expires);
}
}
@@ -88,25 +94,25 @@ public function __toString()
{
$str = $this->data['Name'] . '=' . $this->data['Value'] . '; ';
foreach ($this->data as $k => $v) {
- if ($k != 'Name' && $k != 'Value' && $v !== null && $v !== false) {
- if ($k == 'Expires') {
- $str .= 'Expires=' . gmdate('D, d M Y H:i:s \G\M\T', $v) . '; ';
+ if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) {
+ if ($k === 'Expires') {
+ $str .= 'Expires=' . \gmdate('D, d M Y H:i:s \G\M\T', $v) . '; ';
} else {
$str .= ($v === true ? $k : "{$k}={$v}") . '; ';
}
}
}
- return rtrim($str, '; ');
+ return \rtrim($str, '; ');
}
- public function toArray()
+ public function toArray(): array
{
return $this->data;
}
/**
- * Get the cookie name
+ * Get the cookie name.
*
* @return string
*/
@@ -116,19 +122,19 @@ public function getName()
}
/**
- * Set the cookie name
+ * Set the cookie name.
*
* @param string $name Cookie name
*/
- public function setName($name)
+ public function setName($name): void
{
$this->data['Name'] = $name;
}
/**
- * Get the cookie value
+ * Get the cookie value.
*
- * @return string
+ * @return string|null
*/
public function getValue()
{
@@ -136,17 +142,17 @@ public function getValue()
}
/**
- * Set the cookie value
+ * Set the cookie value.
*
* @param string $value Cookie value
*/
- public function setValue($value)
+ public function setValue($value): void
{
$this->data['Value'] = $value;
}
/**
- * Get the domain
+ * Get the domain.
*
* @return string|null
*/
@@ -156,17 +162,17 @@ public function getDomain()
}
/**
- * Set the domain of the cookie
+ * Set the domain of the cookie.
*
* @param string $domain
*/
- public function setDomain($domain)
+ public function setDomain($domain): void
{
$this->data['Domain'] = $domain;
}
/**
- * Get the path
+ * Get the path.
*
* @return string
*/
@@ -176,17 +182,17 @@ public function getPath()
}
/**
- * Set the path of the cookie
+ * Set the path of the cookie.
*
* @param string $path Path of the cookie
*/
- public function setPath($path)
+ public function setPath($path): void
{
$this->data['Path'] = $path;
}
/**
- * Maximum lifetime of the cookie in seconds
+ * Maximum lifetime of the cookie in seconds.
*
* @return int|null
*/
@@ -196,19 +202,19 @@ public function getMaxAge()
}
/**
- * Set the max-age of the cookie
+ * Set the max-age of the cookie.
*
* @param int $maxAge Max age of the cookie in seconds
*/
- public function setMaxAge($maxAge)
+ public function setMaxAge($maxAge): void
{
$this->data['Max-Age'] = $maxAge;
}
/**
- * The UNIX timestamp when the cookie Expires
+ * The UNIX timestamp when the cookie Expires.
*
- * @return mixed
+ * @return string|int|null
*/
public function getExpires()
{
@@ -216,21 +222,21 @@ public function getExpires()
}
/**
- * Set the unix timestamp for which the cookie will expire
+ * Set the unix timestamp for which the cookie will expire.
*
- * @param int $timestamp Unix timestamp
+ * @param int|string $timestamp Unix timestamp or any English textual datetime description.
*/
- public function setExpires($timestamp)
+ public function setExpires($timestamp): void
{
- $this->data['Expires'] = is_numeric($timestamp)
+ $this->data['Expires'] = \is_numeric($timestamp)
? (int) $timestamp
- : strtotime($timestamp);
+ : \strtotime($timestamp);
}
/**
- * Get whether or not this is a secure cookie
+ * Get whether or not this is a secure cookie.
*
- * @return null|bool
+ * @return bool|null
*/
public function getSecure()
{
@@ -238,19 +244,19 @@ public function getSecure()
}
/**
- * Set whether or not the cookie is secure
+ * Set whether or not the cookie is secure.
*
* @param bool $secure Set to true or false if secure
*/
- public function setSecure($secure)
+ public function setSecure($secure): void
{
$this->data['Secure'] = $secure;
}
/**
- * Get whether or not this is a session cookie
+ * Get whether or not this is a session cookie.
*
- * @return null|bool
+ * @return bool|null
*/
public function getDiscard()
{
@@ -258,17 +264,17 @@ public function getDiscard()
}
/**
- * Set whether or not this is a session cookie
+ * Set whether or not this is a session cookie.
*
* @param bool $discard Set to true or false if this is a session cookie
*/
- public function setDiscard($discard)
+ public function setDiscard($discard): void
{
$this->data['Discard'] = $discard;
}
/**
- * Get whether or not this is an HTTP only cookie
+ * Get whether or not this is an HTTP only cookie.
*
* @return bool
*/
@@ -278,93 +284,124 @@ public function getHttpOnly()
}
/**
- * Set whether or not this is an HTTP only cookie
+ * Set whether or not this is an HTTP only cookie.
*
* @param bool $httpOnly Set to true or false if this is HTTP only
*/
- public function setHttpOnly($httpOnly)
+ public function setHttpOnly($httpOnly): void
{
$this->data['HttpOnly'] = $httpOnly;
}
/**
- * Check if the cookie matches a path value
+ * Check if the cookie matches a path value.
*
- * @param string $path Path to check against
+ * A request-path path-matches a given cookie-path if at least one of
+ * the following conditions holds:
*
- * @return bool
+ * - The cookie-path and the request-path are identical.
+ * - The cookie-path is a prefix of the request-path, and the last
+ * character of the cookie-path is %x2F ("/").
+ * - The cookie-path is a prefix of the request-path, and the first
+ * character of the request-path that is not included in the cookie-
+ * path is a %x2F ("/") character.
+ *
+ * @param string $requestPath Path to check against
*/
- public function matchesPath($path)
+ public function matchesPath(string $requestPath): bool
{
- return !$this->getPath() || 0 === stripos($path, $this->getPath());
+ $cookiePath = $this->getPath();
+
+ // Match on exact matches or when path is the default empty "/"
+ if ($cookiePath === '/' || $cookiePath == $requestPath) {
+ return true;
+ }
+
+ // Ensure that the cookie-path is a prefix of the request path.
+ if (0 !== \strpos($requestPath, $cookiePath)) {
+ return false;
+ }
+
+ // Match if the last character of the cookie-path is "/"
+ if (\substr($cookiePath, -1, 1) === '/') {
+ return true;
+ }
+
+ // Match if the first character not included in cookie path is "/"
+ return \substr($requestPath, \strlen($cookiePath), 1) === '/';
}
/**
- * Check if the cookie matches a domain value
+ * Check if the cookie matches a domain value.
*
* @param string $domain Domain to check against
- *
- * @return bool
*/
- public function matchesDomain($domain)
+ public function matchesDomain(string $domain): bool
{
+ $cookieDomain = $this->getDomain();
+ if (null === $cookieDomain) {
+ return true;
+ }
+
// Remove the leading '.' as per spec in RFC 6265.
- // http://tools.ietf.org/html/rfc6265#section-5.2.3
- $cookieDomain = ltrim($this->getDomain(), '.');
+ // https://tools.ietf.org/html/rfc6265#section-5.2.3
+ $cookieDomain = \ltrim($cookieDomain, '.');
// Domain not set or exact match.
- if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) {
+ if (!$cookieDomain || !\strcasecmp($domain, $cookieDomain)) {
return true;
}
// Matching the subdomain according to RFC 6265.
- // http://tools.ietf.org/html/rfc6265#section-5.1.3
- if (filter_var($domain, FILTER_VALIDATE_IP)) {
+ // https://tools.ietf.org/html/rfc6265#section-5.1.3
+ if (\filter_var($domain, \FILTER_VALIDATE_IP)) {
return false;
}
- return (bool) preg_match('/\.' . preg_quote($cookieDomain) . '$/i', $domain);
+ return (bool) \preg_match('/\.' . \preg_quote($cookieDomain, '/') . '$/', $domain);
}
/**
- * Check if the cookie is expired
- *
- * @return bool
+ * Check if the cookie is expired.
*/
- public function isExpired()
+ public function isExpired(): bool
{
- return $this->getExpires() && time() > $this->getExpires();
+ return $this->getExpires() !== null && \time() > $this->getExpires();
}
/**
- * Check if the cookie is valid according to RFC 6265
+ * Check if the cookie is valid according to RFC 6265.
*
* @return bool|string Returns true if valid or an error message if invalid
*/
public function validate()
{
- // Names must not be empty, but can be 0
$name = $this->getName();
- if (empty($name) && !is_numeric($name)) {
+ if ($name === '') {
return 'The cookie name must not be empty';
}
// Check if any of the invalid characters are present in the cookie name
- if (preg_match("/[=,; \t\r\n\013\014]/", $name)) {
- return "Cookie name must not cannot invalid characters: =,; \\t\\r\\n\\013\\014";
+ if (\preg_match(
+ '/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/',
+ $name
+ )) {
+ return 'Cookie name must not contain invalid characters: ASCII '
+ . 'Control characters (0-31;127), space, tab and the '
+ . 'following characters: ()<>@,;:\"/?={}';
}
- // Value must not be empty, but can be 0
+ // Value must not be null. 0 and empty string are valid. Empty strings
+ // are technically against RFC 6265, but known to happen in the wild.
$value = $this->getValue();
- if (empty($value) && !is_numeric($value)) {
+ if ($value === null) {
return 'The cookie value must not be empty';
}
- // Domains must not be empty, but can be 0
- // A "0" is not a valid internet domain, but may be used as server name
- // in a private network.
+ // Domains must not be empty, but can be 0. "0" is not a valid internet
+ // domain, but may be used as server name in a private network.
$domain = $this->getDomain();
- if (empty($domain) && !is_numeric($domain)) {
+ if ($domain === null || $domain === '') {
return 'The cookie domain must not be empty';
}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Event/AbstractEvent.php b/lib/gerencianet/guzzlehttp/guzzle/src/Event/AbstractEvent.php
deleted file mode 100644
index 0d2f4db..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Event/AbstractEvent.php
+++ /dev/null
@@ -1,20 +0,0 @@
-propagationStopped;
- }
-
- public function stopPropagation()
- {
- $this->propagationStopped = true;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Event/AbstractRequestEvent.php b/lib/gerencianet/guzzlehttp/guzzle/src/Event/AbstractRequestEvent.php
deleted file mode 100644
index 8a6ee47..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Event/AbstractRequestEvent.php
+++ /dev/null
@@ -1,61 +0,0 @@
-transaction = $transaction;
- }
-
- /**
- * Get the HTTP client associated with the event.
- *
- * @return ClientInterface
- */
- public function getClient()
- {
- return $this->transaction->client;
- }
-
- /**
- * Get the request object
- *
- * @return RequestInterface
- */
- public function getRequest()
- {
- return $this->transaction->request;
- }
-
- /**
- * Get the number of transaction retries.
- *
- * @return int
- */
- public function getRetryCount()
- {
- return $this->transaction->retries;
- }
-
- /**
- * @return Transaction
- */
- public function getTransaction()
- {
- return $this->transaction;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Event/AbstractRetryableEvent.php b/lib/gerencianet/guzzlehttp/guzzle/src/Event/AbstractRetryableEvent.php
deleted file mode 100644
index bbbdfaf..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Event/AbstractRetryableEvent.php
+++ /dev/null
@@ -1,40 +0,0 @@
-transaction->state = 'retry';
-
- if ($afterDelay) {
- $this->transaction->request->getConfig()->set('delay', $afterDelay);
- }
-
- $this->stopPropagation();
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Event/AbstractTransferEvent.php b/lib/gerencianet/guzzlehttp/guzzle/src/Event/AbstractTransferEvent.php
deleted file mode 100644
index 3b106df..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Event/AbstractTransferEvent.php
+++ /dev/null
@@ -1,63 +0,0 @@
-transaction->transferInfo;
- }
-
- return isset($this->transaction->transferInfo[$name])
- ? $this->transaction->transferInfo[$name]
- : null;
- }
-
- /**
- * Returns true/false if a response is available.
- *
- * @return bool
- */
- public function hasResponse()
- {
- return !($this->transaction->response instanceof FutureInterface);
- }
-
- /**
- * Get the response.
- *
- * @return ResponseInterface|null
- */
- public function getResponse()
- {
- return $this->hasResponse() ? $this->transaction->response : null;
- }
-
- /**
- * Intercept the request and associate a response
- *
- * @param ResponseInterface $response Response to set
- */
- public function intercept(ResponseInterface $response)
- {
- $this->transaction->response = $response;
- $this->transaction->exception = null;
- $this->stopPropagation();
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Event/BeforeEvent.php b/lib/gerencianet/guzzlehttp/guzzle/src/Event/BeforeEvent.php
deleted file mode 100644
index f313c37..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Event/BeforeEvent.php
+++ /dev/null
@@ -1,26 +0,0 @@
-transaction->response = $response;
- $this->transaction->exception = null;
- $this->stopPropagation();
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Event/CompleteEvent.php b/lib/gerencianet/guzzlehttp/guzzle/src/Event/CompleteEvent.php
deleted file mode 100644
index 56cc557..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Event/CompleteEvent.php
+++ /dev/null
@@ -1,14 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- *
- * @link https://github.com/symfony/symfony/tree/master/src/Symfony/Component/EventDispatcher
- */
-class Emitter implements EmitterInterface
-{
- /** @var array */
- private $listeners = [];
-
- /** @var array */
- private $sorted = [];
-
- public function on($eventName, callable $listener, $priority = 0)
- {
- if ($priority === 'first') {
- $priority = isset($this->listeners[$eventName])
- ? max(array_keys($this->listeners[$eventName])) + 1
- : 1;
- } elseif ($priority === 'last') {
- $priority = isset($this->listeners[$eventName])
- ? min(array_keys($this->listeners[$eventName])) - 1
- : -1;
- }
-
- $this->listeners[$eventName][$priority][] = $listener;
- unset($this->sorted[$eventName]);
- }
-
- public function once($eventName, callable $listener, $priority = 0)
- {
- $onceListener = function (
- EventInterface $event,
- $eventName
- ) use (&$onceListener, $eventName, $listener, $priority) {
- $this->removeListener($eventName, $onceListener);
- $listener($event, $eventName);
- };
-
- $this->on($eventName, $onceListener, $priority);
- }
-
- public function removeListener($eventName, callable $listener)
- {
- if (empty($this->listeners[$eventName])) {
- return;
- }
-
- foreach ($this->listeners[$eventName] as $priority => $listeners) {
- if (false !== ($key = array_search($listener, $listeners, true))) {
- unset(
- $this->listeners[$eventName][$priority][$key],
- $this->sorted[$eventName]
- );
- }
- }
- }
-
- public function listeners($eventName = null)
- {
- // Return all events in a sorted priority order
- if ($eventName === null) {
- foreach (array_keys($this->listeners) as $eventName) {
- if (empty($this->sorted[$eventName])) {
- $this->listeners($eventName);
- }
- }
- return $this->sorted;
- }
-
- // Return the listeners for a specific event, sorted in priority order
- if (empty($this->sorted[$eventName])) {
- $this->sorted[$eventName] = [];
- if (isset($this->listeners[$eventName])) {
- krsort($this->listeners[$eventName], SORT_NUMERIC);
- foreach ($this->listeners[$eventName] as $listeners) {
- foreach ($listeners as $listener) {
- $this->sorted[$eventName][] = $listener;
- }
- }
- }
- }
-
- return $this->sorted[$eventName];
- }
-
- public function hasListeners($eventName)
- {
- return !empty($this->listeners[$eventName]);
- }
-
- public function emit($eventName, EventInterface $event)
- {
- if (isset($this->listeners[$eventName])) {
- foreach ($this->listeners($eventName) as $listener) {
- $listener($event, $eventName);
- if ($event->isPropagationStopped()) {
- break;
- }
- }
- }
-
- return $event;
- }
-
- public function attach(SubscriberInterface $subscriber)
- {
- foreach ($subscriber->getEvents() as $eventName => $listeners) {
- if (is_array($listeners[0])) {
- foreach ($listeners as $listener) {
- $this->on(
- $eventName,
- [$subscriber, $listener[0]],
- isset($listener[1]) ? $listener[1] : 0
- );
- }
- } else {
- $this->on(
- $eventName,
- [$subscriber, $listeners[0]],
- isset($listeners[1]) ? $listeners[1] : 0
- );
- }
- }
- }
-
- public function detach(SubscriberInterface $subscriber)
- {
- foreach ($subscriber->getEvents() as $eventName => $listener) {
- $this->removeListener($eventName, [$subscriber, $listener[0]]);
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Event/EmitterInterface.php b/lib/gerencianet/guzzlehttp/guzzle/src/Event/EmitterInterface.php
deleted file mode 100644
index 9783efd..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Event/EmitterInterface.php
+++ /dev/null
@@ -1,96 +0,0 @@
-transaction->exception;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Event/ErrorEvent.php b/lib/gerencianet/guzzlehttp/guzzle/src/Event/ErrorEvent.php
deleted file mode 100644
index 7432134..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Event/ErrorEvent.php
+++ /dev/null
@@ -1,27 +0,0 @@
-transaction->exception;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Event/EventInterface.php b/lib/gerencianet/guzzlehttp/guzzle/src/Event/EventInterface.php
deleted file mode 100644
index 97247e8..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Event/EventInterface.php
+++ /dev/null
@@ -1,23 +0,0 @@
-emitter) {
- $this->emitter = new Emitter();
- }
-
- return $this->emitter;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Event/ListenerAttacherTrait.php b/lib/gerencianet/guzzlehttp/guzzle/src/Event/ListenerAttacherTrait.php
deleted file mode 100644
index 407dc92..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Event/ListenerAttacherTrait.php
+++ /dev/null
@@ -1,88 +0,0 @@
-getEmitter();
- foreach ($listeners as $el) {
- if ($el['once']) {
- $emitter->once($el['name'], $el['fn'], $el['priority']);
- } else {
- $emitter->on($el['name'], $el['fn'], $el['priority']);
- }
- }
- }
-
- /**
- * Extracts the allowed events from the provided array, and ignores anything
- * else in the array. The event listener must be specified as a callable or
- * as an array of event listener data ("name", "fn", "priority", "once").
- *
- * @param array $source Array containing callables or hashes of data to be
- * prepared as event listeners.
- * @param array $events Names of events to look for in the provided $source
- * array. Other keys are ignored.
- * @return array
- */
- private function prepareListeners(array $source, array $events)
- {
- $listeners = [];
- foreach ($events as $name) {
- if (isset($source[$name])) {
- $this->buildListener($name, $source[$name], $listeners);
- }
- }
-
- return $listeners;
- }
-
- /**
- * Creates a complete event listener definition from the provided array of
- * listener data. Also works recursively if more than one listeners are
- * contained in the provided array.
- *
- * @param string $name Name of the event the listener is for.
- * @param array|callable $data Event listener data to prepare.
- * @param array $listeners Array of listeners, passed by reference.
- *
- * @throws \InvalidArgumentException if the event data is malformed.
- */
- private function buildListener($name, $data, &$listeners)
- {
- static $defaults = ['priority' => 0, 'once' => false];
-
- // If a callable is provided, normalize it to the array format.
- if (is_callable($data)) {
- $data = ['fn' => $data];
- }
-
- // Prepare the listener and add it to the array, recursively.
- if (isset($data['fn'])) {
- $data['name'] = $name;
- $listeners[] = $data + $defaults;
- } elseif (is_array($data)) {
- foreach ($data as $listenerData) {
- $this->buildListener($name, $listenerData, $listeners);
- }
- } else {
- throw new \InvalidArgumentException('Each event listener must be a '
- . 'callable or an associative array containing a "fn" key.');
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Event/ProgressEvent.php b/lib/gerencianet/guzzlehttp/guzzle/src/Event/ProgressEvent.php
deleted file mode 100644
index 3fd0de4..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Event/ProgressEvent.php
+++ /dev/null
@@ -1,51 +0,0 @@
-downloadSize = $downloadSize;
- $this->downloaded = $downloaded;
- $this->uploadSize = $uploadSize;
- $this->uploaded = $uploaded;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Event/RequestEvents.php b/lib/gerencianet/guzzlehttp/guzzle/src/Event/RequestEvents.php
deleted file mode 100644
index f51d420..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Event/RequestEvents.php
+++ /dev/null
@@ -1,56 +0,0 @@
- ['methodName']]
- * - ['eventName' => ['methodName', $priority]]
- * - ['eventName' => [['methodName'], ['otherMethod']]
- * - ['eventName' => [['methodName'], ['otherMethod', $priority]]
- * - ['eventName' => [['methodName', $priority], ['otherMethod', $priority]]
- *
- * @return array
- */
- public function getEvents();
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/lib/gerencianet/guzzlehttp/guzzle/src/Exception/BadResponseException.php
index fd78431..a80956c 100644
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Exception/BadResponseException.php
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Exception/BadResponseException.php
@@ -1,7 +1,39 @@
request = $request;
+ $this->handlerContext = $handlerContext;
+ }
+
+ /**
+ * Get the request that caused the exception
+ */
+ public function getRequest(): RequestInterface
+ {
+ return $this->request;
+ }
+
+ /**
+ * Get contextual information about the error from the underlying handler.
+ *
+ * The contents of this array will vary depending on which handler you are
+ * using. It may also be just an empty array. Relying on this data will
+ * couple you to a specific handler, but can give more debug information
+ * when needed.
+ */
+ public function getHandlerContext(): array
+ {
+ return $this->handlerContext;
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Exception/CouldNotRewindStreamException.php b/lib/gerencianet/guzzlehttp/guzzle/src/Exception/CouldNotRewindStreamException.php
deleted file mode 100644
index fbe2dcd..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Exception/CouldNotRewindStreamException.php
+++ /dev/null
@@ -1,4 +0,0 @@
-response = $response;
- }
- /**
- * Get the associated response
- *
- * @return ResponseInterface|null
- */
- public function getResponse()
- {
- return $this->response;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Exception/RequestException.php b/lib/gerencianet/guzzlehttp/guzzle/src/Exception/RequestException.php
index 3f052d3..54623cf 100644
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Exception/RequestException.php
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Exception/RequestException.php
@@ -1,121 +1,166 @@
getStatusCode()
- : 0;
+ $code = $response ? $response->getStatusCode() : 0;
parent::__construct($message, $code, $previous);
$this->request = $request;
$this->response = $response;
+ $this->handlerContext = $handlerContext;
}
/**
* Wrap non-RequestExceptions with a RequestException
- *
- * @param RequestInterface $request
- * @param \Exception $e
- *
- * @return RequestException
*/
- public static function wrapException(RequestInterface $request, \Exception $e)
+ public static function wrapException(RequestInterface $request, \Throwable $e): RequestException
{
- if ($e instanceof RequestException) {
- return $e;
- } elseif ($e instanceof ConnectException) {
- return new HttpConnectException($e->getMessage(), $request, null, $e);
- } else {
- return new RequestException($e->getMessage(), $request, null, $e);
- }
+ return $e instanceof RequestException ? $e : new RequestException($e->getMessage(), $request, null, $e);
}
/**
* Factory method to create a new exception with a normalized error message
*
- * @param RequestInterface $request Request
- * @param ResponseInterface $response Response received
- * @param \Exception $previous Previous exception
- *
- * @return self
+ * @param RequestInterface $request Request sent
+ * @param ResponseInterface $response Response received
+ * @param \Throwable|null $previous Previous exception
+ * @param array $handlerContext Optional handler context
+ * @param BodySummarizerInterface|null $bodySummarizer Optional body summarizer
*/
public static function create(
RequestInterface $request,
ResponseInterface $response = null,
- \Exception $previous = null
- ) {
+ \Throwable $previous = null,
+ array $handlerContext = [],
+ BodySummarizerInterface $bodySummarizer = null
+ ): self {
if (!$response) {
- return new self('Error completing request', $request, null, $previous);
+ return new self(
+ 'Error completing request',
+ $request,
+ null,
+ $previous,
+ $handlerContext
+ );
}
- $level = floor($response->getStatusCode() / 100);
- if ($level == '4') {
- $label = 'Client error response';
- $className = __NAMESPACE__ . '\\ClientException';
- } elseif ($level == '5') {
- $label = 'Server error response';
- $className = __NAMESPACE__ . '\\ServerException';
+ $level = (int) \floor($response->getStatusCode() / 100);
+ if ($level === 4) {
+ $label = 'Client error';
+ $className = ClientException::class;
+ } elseif ($level === 5) {
+ $label = 'Server error';
+ $className = ServerException::class;
} else {
- $label = 'Unsuccessful response';
+ $label = 'Unsuccessful request';
$className = __CLASS__;
}
- $message = $label . ' [url] ' . $request->getUrl()
- . ' [status code] ' . $response->getStatusCode()
- . ' [reason phrase] ' . $response->getReasonPhrase();
+ $uri = $request->getUri();
+ $uri = static::obfuscateUri($uri);
+
+ // Client Error: `GET /` resulted in a `404 Not Found` response:
+ // ... (truncated)
+ $message = \sprintf(
+ '%s: `%s %s` resulted in a `%s %s` response',
+ $label,
+ $request->getMethod(),
+ $uri,
+ $response->getStatusCode(),
+ $response->getReasonPhrase()
+ );
+
+ $summary = ($bodySummarizer ?? new BodySummarizer())->summarize($response);
+
+ if ($summary !== null) {
+ $message .= ":\n{$summary}\n";
+ }
- return new $className($message, $request, $response, $previous);
+ return new $className($message, $request, $response, $previous, $handlerContext);
+ }
+
+ /**
+ * Obfuscates URI if there is a username and a password present
+ */
+ private static function obfuscateUri(UriInterface $uri): UriInterface
+ {
+ $userInfo = $uri->getUserInfo();
+
+ if (false !== ($pos = \strpos($userInfo, ':'))) {
+ return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***');
+ }
+
+ return $uri;
}
/**
* Get the request that caused the exception
- *
- * @return RequestInterface
*/
- public function getRequest()
+ public function getRequest(): RequestInterface
{
return $this->request;
}
/**
* Get the associated response
- *
- * @return ResponseInterface|null
*/
- public function getResponse()
+ public function getResponse(): ?ResponseInterface
{
return $this->response;
}
/**
* Check if a response was received
- *
- * @return bool
*/
- public function hasResponse()
+ public function hasResponse(): bool
{
return $this->response !== null;
}
+
+ /**
+ * Get contextual information about the error from the underlying handler.
+ *
+ * The contents of this array will vary depending on which handler you are
+ * using. It may also be just an empty array. Relying on this data will
+ * couple you to a specific handler, but can give more debug information
+ * when needed.
+ */
+ public function getHandlerContext(): array
+ {
+ return $this->handlerContext;
+ }
}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Exception/ServerException.php b/lib/gerencianet/guzzlehttp/guzzle/src/Exception/ServerException.php
index 7cdd340..8055e06 100644
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Exception/ServerException.php
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Exception/ServerException.php
@@ -1,7 +1,10 @@
error = $error;
- }
-
- /**
- * Get the associated error
- *
- * @return \LibXMLError|null
- */
- public function getError()
- {
- return $this->error;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Handler/CurlFactory.php b/lib/gerencianet/guzzlehttp/guzzle/src/Handler/CurlFactory.php
new file mode 100644
index 0000000..36d478a
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Handler/CurlFactory.php
@@ -0,0 +1,592 @@
+maxHandles = $maxHandles;
+ }
+
+ public function create(RequestInterface $request, array $options): EasyHandle
+ {
+ if (isset($options['curl']['body_as_string'])) {
+ $options['_body_as_string'] = $options['curl']['body_as_string'];
+ unset($options['curl']['body_as_string']);
+ }
+
+ $easy = new EasyHandle;
+ $easy->request = $request;
+ $easy->options = $options;
+ $conf = $this->getDefaultConf($easy);
+ $this->applyMethod($easy, $conf);
+ $this->applyHandlerOptions($easy, $conf);
+ $this->applyHeaders($easy, $conf);
+ unset($conf['_headers']);
+
+ // Add handler options from the request configuration options
+ if (isset($options['curl'])) {
+ $conf = \array_replace($conf, $options['curl']);
+ }
+
+ $conf[\CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy);
+ $easy->handle = $this->handles ? \array_pop($this->handles) : \curl_init();
+ curl_setopt_array($easy->handle, $conf);
+
+ return $easy;
+ }
+
+ public function release(EasyHandle $easy): void
+ {
+ $resource = $easy->handle;
+ unset($easy->handle);
+
+ if (\count($this->handles) >= $this->maxHandles) {
+ \curl_close($resource);
+ } else {
+ // Remove all callback functions as they can hold onto references
+ // and are not cleaned up by curl_reset. Using curl_setopt_array
+ // does not work for some reason, so removing each one
+ // individually.
+ \curl_setopt($resource, \CURLOPT_HEADERFUNCTION, null);
+ \curl_setopt($resource, \CURLOPT_READFUNCTION, null);
+ \curl_setopt($resource, \CURLOPT_WRITEFUNCTION, null);
+ \curl_setopt($resource, \CURLOPT_PROGRESSFUNCTION, null);
+ \curl_reset($resource);
+ $this->handles[] = $resource;
+ }
+ }
+
+ /**
+ * Completes a cURL transaction, either returning a response promise or a
+ * rejected promise.
+ *
+ * @param callable(RequestInterface, array): PromiseInterface $handler
+ * @param CurlFactoryInterface $factory Dictates how the handle is released
+ */
+ public static function finish(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface
+ {
+ if (isset($easy->options['on_stats'])) {
+ self::invokeStats($easy);
+ }
+
+ if (!$easy->response || $easy->errno) {
+ return self::finishError($handler, $easy, $factory);
+ }
+
+ // Return the response if it is present and there is no error.
+ $factory->release($easy);
+
+ // Rewind the body of the response if possible.
+ $body = $easy->response->getBody();
+ if ($body->isSeekable()) {
+ $body->rewind();
+ }
+
+ return new FulfilledPromise($easy->response);
+ }
+
+ private static function invokeStats(EasyHandle $easy): void
+ {
+ $curlStats = \curl_getinfo($easy->handle);
+ $curlStats['appconnect_time'] = \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME);
+ $stats = new TransferStats(
+ $easy->request,
+ $easy->response,
+ $curlStats['total_time'],
+ $easy->errno,
+ $curlStats
+ );
+ ($easy->options['on_stats'])($stats);
+ }
+
+ /**
+ * @param callable(RequestInterface, array): PromiseInterface $handler
+ */
+ private static function finishError(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface
+ {
+ // Get error information and release the handle to the factory.
+ $ctx = [
+ 'errno' => $easy->errno,
+ 'error' => \curl_error($easy->handle),
+ 'appconnect_time' => \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME),
+ ] + \curl_getinfo($easy->handle);
+ $ctx[self::CURL_VERSION_STR] = \curl_version()['version'];
+ $factory->release($easy);
+
+ // Retry when nothing is present or when curl failed to rewind.
+ if (empty($easy->options['_err_message']) && (!$easy->errno || $easy->errno == 65)) {
+ return self::retryFailedRewind($handler, $easy, $ctx);
+ }
+
+ return self::createRejection($easy, $ctx);
+ }
+
+ private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface
+ {
+ static $connectionErrors = [
+ \CURLE_OPERATION_TIMEOUTED => true,
+ \CURLE_COULDNT_RESOLVE_HOST => true,
+ \CURLE_COULDNT_CONNECT => true,
+ \CURLE_SSL_CONNECT_ERROR => true,
+ \CURLE_GOT_NOTHING => true,
+ ];
+
+ if ($easy->createResponseException) {
+ return P\Create::rejectionFor(
+ new RequestException(
+ 'An error was encountered while creating the response',
+ $easy->request,
+ $easy->response,
+ $easy->createResponseException,
+ $ctx
+ )
+ );
+ }
+
+ // If an exception was encountered during the onHeaders event, then
+ // return a rejected promise that wraps that exception.
+ if ($easy->onHeadersException) {
+ return P\Create::rejectionFor(
+ new RequestException(
+ 'An error was encountered during the on_headers event',
+ $easy->request,
+ $easy->response,
+ $easy->onHeadersException,
+ $ctx
+ )
+ );
+ }
+
+ $message = \sprintf(
+ 'cURL error %s: %s (%s)',
+ $ctx['errno'],
+ $ctx['error'],
+ 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html'
+ );
+ $uriString = (string) $easy->request->getUri();
+ if ($uriString !== '' && false === \strpos($ctx['error'], $uriString)) {
+ $message .= \sprintf(' for %s', $uriString);
+ }
+
+ // Create a connection exception if it was a specific error code.
+ $error = isset($connectionErrors[$easy->errno])
+ ? new ConnectException($message, $easy->request, null, $ctx)
+ : new RequestException($message, $easy->request, $easy->response, null, $ctx);
+
+ return P\Create::rejectionFor($error);
+ }
+
+ /**
+ * @return array
+ */
+ private function getDefaultConf(EasyHandle $easy): array
+ {
+ $conf = [
+ '_headers' => $easy->request->getHeaders(),
+ \CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(),
+ \CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''),
+ \CURLOPT_RETURNTRANSFER => false,
+ \CURLOPT_HEADER => false,
+ \CURLOPT_CONNECTTIMEOUT => 150,
+ ];
+
+ if (\defined('CURLOPT_PROTOCOLS')) {
+ $conf[\CURLOPT_PROTOCOLS] = \CURLPROTO_HTTP | \CURLPROTO_HTTPS;
+ }
+
+ $version = $easy->request->getProtocolVersion();
+ if ($version == 1.1) {
+ $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_1;
+ } elseif ($version == 2.0) {
+ $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2_0;
+ } else {
+ $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_0;
+ }
+
+ return $conf;
+ }
+
+ private function applyMethod(EasyHandle $easy, array &$conf): void
+ {
+ $body = $easy->request->getBody();
+ $size = $body->getSize();
+
+ if ($size === null || $size > 0) {
+ $this->applyBody($easy->request, $easy->options, $conf);
+ return;
+ }
+
+ $method = $easy->request->getMethod();
+ if ($method === 'PUT' || $method === 'POST') {
+ // See https://tools.ietf.org/html/rfc7230#section-3.3.2
+ if (!$easy->request->hasHeader('Content-Length')) {
+ $conf[\CURLOPT_HTTPHEADER][] = 'Content-Length: 0';
+ }
+ } elseif ($method === 'HEAD') {
+ $conf[\CURLOPT_NOBODY] = true;
+ unset(
+ $conf[\CURLOPT_WRITEFUNCTION],
+ $conf[\CURLOPT_READFUNCTION],
+ $conf[\CURLOPT_FILE],
+ $conf[\CURLOPT_INFILE]
+ );
+ }
+ }
+
+ private function applyBody(RequestInterface $request, array $options, array &$conf): void
+ {
+ $size = $request->hasHeader('Content-Length')
+ ? (int) $request->getHeaderLine('Content-Length')
+ : null;
+
+ // Send the body as a string if the size is less than 1MB OR if the
+ // [curl][body_as_string] request value is set.
+ if (($size !== null && $size < 1000000) || !empty($options['_body_as_string'])) {
+ $conf[\CURLOPT_POSTFIELDS] = (string) $request->getBody();
+ // Don't duplicate the Content-Length header
+ $this->removeHeader('Content-Length', $conf);
+ $this->removeHeader('Transfer-Encoding', $conf);
+ } else {
+ $conf[\CURLOPT_UPLOAD] = true;
+ if ($size !== null) {
+ $conf[\CURLOPT_INFILESIZE] = $size;
+ $this->removeHeader('Content-Length', $conf);
+ }
+ $body = $request->getBody();
+ if ($body->isSeekable()) {
+ $body->rewind();
+ }
+ $conf[\CURLOPT_READFUNCTION] = static function ($ch, $fd, $length) use ($body) {
+ return $body->read($length);
+ };
+ }
+
+ // If the Expect header is not present, prevent curl from adding it
+ if (!$request->hasHeader('Expect')) {
+ $conf[\CURLOPT_HTTPHEADER][] = 'Expect:';
+ }
+
+ // cURL sometimes adds a content-type by default. Prevent this.
+ if (!$request->hasHeader('Content-Type')) {
+ $conf[\CURLOPT_HTTPHEADER][] = 'Content-Type:';
+ }
+ }
+
+ private function applyHeaders(EasyHandle $easy, array &$conf): void
+ {
+ foreach ($conf['_headers'] as $name => $values) {
+ foreach ($values as $value) {
+ $value = (string) $value;
+ if ($value === '') {
+ // cURL requires a special format for empty headers.
+ // See https://github.com/guzzle/guzzle/issues/1882 for more details.
+ $conf[\CURLOPT_HTTPHEADER][] = "$name;";
+ } else {
+ $conf[\CURLOPT_HTTPHEADER][] = "$name: $value";
+ }
+ }
+ }
+
+ // Remove the Accept header if one was not set
+ if (!$easy->request->hasHeader('Accept')) {
+ $conf[\CURLOPT_HTTPHEADER][] = 'Accept:';
+ }
+ }
+
+ /**
+ * Remove a header from the options array.
+ *
+ * @param string $name Case-insensitive header to remove
+ * @param array $options Array of options to modify
+ */
+ private function removeHeader(string $name, array &$options): void
+ {
+ foreach (\array_keys($options['_headers']) as $key) {
+ if (!\strcasecmp($key, $name)) {
+ unset($options['_headers'][$key]);
+ return;
+ }
+ }
+ }
+
+ private function applyHandlerOptions(EasyHandle $easy, array &$conf): void
+ {
+ $options = $easy->options;
+ if (isset($options['verify'])) {
+ if ($options['verify'] === false) {
+ unset($conf[\CURLOPT_CAINFO]);
+ $conf[\CURLOPT_SSL_VERIFYHOST] = 0;
+ $conf[\CURLOPT_SSL_VERIFYPEER] = false;
+ } else {
+ $conf[\CURLOPT_SSL_VERIFYHOST] = 2;
+ $conf[\CURLOPT_SSL_VERIFYPEER] = true;
+ if (\is_string($options['verify'])) {
+ // Throw an error if the file/folder/link path is not valid or doesn't exist.
+ if (!\file_exists($options['verify'])) {
+ throw new \InvalidArgumentException("SSL CA bundle not found: {$options['verify']}");
+ }
+ // If it's a directory or a link to a directory use CURLOPT_CAPATH.
+ // If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO.
+ if (
+ \is_dir($options['verify']) ||
+ (
+ \is_link($options['verify']) === true &&
+ ($verifyLink = \readlink($options['verify'])) !== false &&
+ \is_dir($verifyLink)
+ )
+ ) {
+ $conf[\CURLOPT_CAPATH] = $options['verify'];
+ } else {
+ $conf[\CURLOPT_CAINFO] = $options['verify'];
+ }
+ }
+ }
+ }
+
+ if (!isset($options['curl'][\CURLOPT_ENCODING]) && !empty($options['decode_content'])) {
+ $accept = $easy->request->getHeaderLine('Accept-Encoding');
+ if ($accept) {
+ $conf[\CURLOPT_ENCODING] = $accept;
+ } else {
+ $conf[\CURLOPT_ENCODING] = '';
+ // Don't let curl send the header over the wire
+ $conf[\CURLOPT_HTTPHEADER][] = 'Accept-Encoding:';
+ }
+ }
+
+ if (!isset($options['sink'])) {
+ // Use a default temp stream if no sink was set.
+ $options['sink'] = \GuzzleHttp\Psr7\Utils::tryFopen('php://temp', 'w+');
+ }
+ $sink = $options['sink'];
+ if (!\is_string($sink)) {
+ $sink = \GuzzleHttp\Psr7\Utils::streamFor($sink);
+ } elseif (!\is_dir(\dirname($sink))) {
+ // Ensure that the directory exists before failing in curl.
+ throw new \RuntimeException(\sprintf('Directory %s does not exist for sink value of %s', \dirname($sink), $sink));
+ } else {
+ $sink = new LazyOpenStream($sink, 'w+');
+ }
+ $easy->sink = $sink;
+ $conf[\CURLOPT_WRITEFUNCTION] = static function ($ch, $write) use ($sink): int {
+ return $sink->write($write);
+ };
+
+ $timeoutRequiresNoSignal = false;
+ if (isset($options['timeout'])) {
+ $timeoutRequiresNoSignal |= $options['timeout'] < 1;
+ $conf[\CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000;
+ }
+
+ // CURL default value is CURL_IPRESOLVE_WHATEVER
+ if (isset($options['force_ip_resolve'])) {
+ if ('v4' === $options['force_ip_resolve']) {
+ $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4;
+ } elseif ('v6' === $options['force_ip_resolve']) {
+ $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V6;
+ }
+ }
+
+ if (isset($options['connect_timeout'])) {
+ $timeoutRequiresNoSignal |= $options['connect_timeout'] < 1;
+ $conf[\CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000;
+ }
+
+ if ($timeoutRequiresNoSignal && \strtoupper(\substr(\PHP_OS, 0, 3)) !== 'WIN') {
+ $conf[\CURLOPT_NOSIGNAL] = true;
+ }
+
+ if (isset($options['proxy'])) {
+ if (!\is_array($options['proxy'])) {
+ $conf[\CURLOPT_PROXY] = $options['proxy'];
+ } else {
+ $scheme = $easy->request->getUri()->getScheme();
+ if (isset($options['proxy'][$scheme])) {
+ $host = $easy->request->getUri()->getHost();
+ if (!isset($options['proxy']['no']) || !Utils::isHostInNoProxy($host, $options['proxy']['no'])) {
+ $conf[\CURLOPT_PROXY] = $options['proxy'][$scheme];
+ }
+ }
+ }
+ }
+
+ if (isset($options['cert'])) {
+ $cert = $options['cert'];
+ if (\is_array($cert)) {
+ $conf[\CURLOPT_SSLCERTPASSWD] = $cert[1];
+ $cert = $cert[0];
+ }
+ if (!\file_exists($cert)) {
+ throw new \InvalidArgumentException("SSL certificate not found: {$cert}");
+ }
+ # OpenSSL (versions 0.9.3 and later) also support "P12" for PKCS#12-encoded files.
+ # see https://curl.se/libcurl/c/CURLOPT_SSLCERTTYPE.html
+ $ext = pathinfo($cert, \PATHINFO_EXTENSION);
+ if (preg_match('#^(der|p12)$#i', $ext)) {
+ $conf[\CURLOPT_SSLCERTTYPE] = strtoupper($ext);
+ }
+ $conf[\CURLOPT_SSLCERT] = $cert;
+ }
+
+ if (isset($options['ssl_key'])) {
+ if (\is_array($options['ssl_key'])) {
+ if (\count($options['ssl_key']) === 2) {
+ [$sslKey, $conf[\CURLOPT_SSLKEYPASSWD]] = $options['ssl_key'];
+ } else {
+ [$sslKey] = $options['ssl_key'];
+ }
+ }
+
+ $sslKey = $sslKey ?? $options['ssl_key'];
+
+ if (!\file_exists($sslKey)) {
+ throw new \InvalidArgumentException("SSL private key not found: {$sslKey}");
+ }
+ $conf[\CURLOPT_SSLKEY] = $sslKey;
+ }
+
+ if (isset($options['progress'])) {
+ $progress = $options['progress'];
+ if (!\is_callable($progress)) {
+ throw new \InvalidArgumentException('progress client option must be callable');
+ }
+ $conf[\CURLOPT_NOPROGRESS] = false;
+ $conf[\CURLOPT_PROGRESSFUNCTION] = static function ($resource, int $downloadSize, int $downloaded, int $uploadSize, int $uploaded) use ($progress) {
+ $progress($downloadSize, $downloaded, $uploadSize, $uploaded);
+ };
+ }
+
+ if (!empty($options['debug'])) {
+ $conf[\CURLOPT_STDERR] = Utils::debugResource($options['debug']);
+ $conf[\CURLOPT_VERBOSE] = true;
+ }
+ }
+
+ /**
+ * This function ensures that a response was set on a transaction. If one
+ * was not set, then the request is retried if possible. This error
+ * typically means you are sending a payload, curl encountered a
+ * "Connection died, retrying a fresh connect" error, tried to rewind the
+ * stream, and then encountered a "necessary data rewind wasn't possible"
+ * error, causing the request to be sent through curl_multi_info_read()
+ * without an error status.
+ *
+ * @param callable(RequestInterface, array): PromiseInterface $handler
+ */
+ private static function retryFailedRewind(callable $handler, EasyHandle $easy, array $ctx): PromiseInterface
+ {
+ try {
+ // Only rewind if the body has been read from.
+ $body = $easy->request->getBody();
+ if ($body->tell() > 0) {
+ $body->rewind();
+ }
+ } catch (\RuntimeException $e) {
+ $ctx['error'] = 'The connection unexpectedly failed without '
+ . 'providing an error. The request would have been retried, '
+ . 'but attempting to rewind the request body failed. '
+ . 'Exception: ' . $e;
+ return self::createRejection($easy, $ctx);
+ }
+
+ // Retry no more than 3 times before giving up.
+ if (!isset($easy->options['_curl_retries'])) {
+ $easy->options['_curl_retries'] = 1;
+ } elseif ($easy->options['_curl_retries'] == 2) {
+ $ctx['error'] = 'The cURL request was retried 3 times '
+ . 'and did not succeed. The most likely reason for the failure '
+ . 'is that cURL was unable to rewind the body of the request '
+ . 'and subsequent retries resulted in the same error. Turn on '
+ . 'the debug option to see what went wrong. See '
+ . 'https://bugs.php.net/bug.php?id=47204 for more information.';
+ return self::createRejection($easy, $ctx);
+ } else {
+ $easy->options['_curl_retries']++;
+ }
+
+ return $handler($easy->request, $easy->options);
+ }
+
+ private function createHeaderFn(EasyHandle $easy): callable
+ {
+ if (isset($easy->options['on_headers'])) {
+ $onHeaders = $easy->options['on_headers'];
+
+ if (!\is_callable($onHeaders)) {
+ throw new \InvalidArgumentException('on_headers must be callable');
+ }
+ } else {
+ $onHeaders = null;
+ }
+
+ return static function ($ch, $h) use (
+ $onHeaders,
+ $easy,
+ &$startingResponse
+ ) {
+ $value = \trim($h);
+ if ($value === '') {
+ $startingResponse = true;
+ try {
+ $easy->createResponse();
+ } catch (\Exception $e) {
+ $easy->createResponseException = $e;
+ return -1;
+ }
+ if ($onHeaders !== null) {
+ try {
+ $onHeaders($easy->response);
+ } catch (\Exception $e) {
+ // Associate the exception with the handle and trigger
+ // a curl header write error by returning 0.
+ $easy->onHeadersException = $e;
+ return -1;
+ }
+ }
+ } elseif ($startingResponse) {
+ $startingResponse = false;
+ $easy->headers = [$value];
+ } else {
+ $easy->headers[] = $value;
+ }
+ return \strlen($h);
+ };
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php b/lib/gerencianet/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php
new file mode 100644
index 0000000..fe57ed5
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php
@@ -0,0 +1,25 @@
+factory = $options['handle_factory']
+ ?? new CurlFactory(3);
+ }
+
+ public function __invoke(RequestInterface $request, array $options): PromiseInterface
+ {
+ if (isset($options['delay'])) {
+ \usleep($options['delay'] * 1000);
+ }
+
+ $easy = $this->factory->create($request, $options);
+ \curl_exec($easy->handle);
+ $easy->errno = \curl_errno($easy->handle);
+
+ return CurlFactory::finish($this, $easy, $this->factory);
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/lib/gerencianet/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
new file mode 100644
index 0000000..4e31263
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
@@ -0,0 +1,253 @@
+ An array of delay times, indexed by handle id in `addRequest`.
+ *
+ * @see CurlMultiHandler::addRequest
+ */
+ private $delays = [];
+
+ /**
+ * @var array An associative array of CURLMOPT_* options and corresponding values for curl_multi_setopt()
+ */
+ private $options = [];
+
+ /**
+ * This handler accepts the following options:
+ *
+ * - handle_factory: An optional factory used to create curl handles
+ * - select_timeout: Optional timeout (in seconds) to block before timing
+ * out while selecting curl handles. Defaults to 1 second.
+ * - options: An associative array of CURLMOPT_* options and
+ * corresponding values for curl_multi_setopt()
+ */
+ public function __construct(array $options = [])
+ {
+ $this->factory = $options['handle_factory'] ?? new CurlFactory(50);
+
+ if (isset($options['select_timeout'])) {
+ $this->selectTimeout = $options['select_timeout'];
+ } elseif ($selectTimeout = Utils::getenv('GUZZLE_CURL_SELECT_TIMEOUT')) {
+ @trigger_error('Since guzzlehttp/guzzle 7.2.0: Using environment variable GUZZLE_CURL_SELECT_TIMEOUT is deprecated. Use option "select_timeout" instead.', \E_USER_DEPRECATED);
+ $this->selectTimeout = (int) $selectTimeout;
+ } else {
+ $this->selectTimeout = 1;
+ }
+
+ $this->options = $options['options'] ?? [];
+ }
+
+ /**
+ * @param string $name
+ *
+ * @return resource|\CurlMultiHandle
+ *
+ * @throws \BadMethodCallException when another field as `_mh` will be gotten
+ * @throws \RuntimeException when curl can not initialize a multi handle
+ */
+ public function __get($name)
+ {
+ if ($name !== '_mh') {
+ throw new \BadMethodCallException("Can not get other property as '_mh'.");
+ }
+
+ $multiHandle = \curl_multi_init();
+
+ if (false === $multiHandle) {
+ throw new \RuntimeException('Can not initialize curl multi handle.');
+ }
+
+ $this->_mh = $multiHandle;
+
+ foreach ($this->options as $option => $value) {
+ // A warning is raised in case of a wrong option.
+ curl_multi_setopt($this->_mh, $option, $value);
+ }
+
+ return $this->_mh;
+ }
+
+ public function __destruct()
+ {
+ if (isset($this->_mh)) {
+ \curl_multi_close($this->_mh);
+ unset($this->_mh);
+ }
+ }
+
+ public function __invoke(RequestInterface $request, array $options): PromiseInterface
+ {
+ $easy = $this->factory->create($request, $options);
+ $id = (int) $easy->handle;
+
+ $promise = new Promise(
+ [$this, 'execute'],
+ function () use ($id) {
+ return $this->cancel($id);
+ }
+ );
+
+ $this->addRequest(['easy' => $easy, 'deferred' => $promise]);
+
+ return $promise;
+ }
+
+ /**
+ * Ticks the curl event loop.
+ */
+ public function tick(): void
+ {
+ // Add any delayed handles if needed.
+ if ($this->delays) {
+ $currentTime = Utils::currentTime();
+ foreach ($this->delays as $id => $delay) {
+ if ($currentTime >= $delay) {
+ unset($this->delays[$id]);
+ \curl_multi_add_handle(
+ $this->_mh,
+ $this->handles[$id]['easy']->handle
+ );
+ }
+ }
+ }
+
+ // Step through the task queue which may add additional requests.
+ P\Utils::queue()->run();
+
+ if ($this->active && \curl_multi_select($this->_mh, $this->selectTimeout) === -1) {
+ // Perform a usleep if a select returns -1.
+ // See: https://bugs.php.net/bug.php?id=61141
+ \usleep(250);
+ }
+
+ while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM);
+
+ $this->processMessages();
+ }
+
+ /**
+ * Runs until all outstanding connections have completed.
+ */
+ public function execute(): void
+ {
+ $queue = P\Utils::queue();
+
+ while ($this->handles || !$queue->isEmpty()) {
+ // If there are no transfers, then sleep for the next delay
+ if (!$this->active && $this->delays) {
+ \usleep($this->timeToNext());
+ }
+ $this->tick();
+ }
+ }
+
+ private function addRequest(array $entry): void
+ {
+ $easy = $entry['easy'];
+ $id = (int) $easy->handle;
+ $this->handles[$id] = $entry;
+ if (empty($easy->options['delay'])) {
+ \curl_multi_add_handle($this->_mh, $easy->handle);
+ } else {
+ $this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000);
+ }
+ }
+
+ /**
+ * Cancels a handle from sending and removes references to it.
+ *
+ * @param int $id Handle ID to cancel and remove.
+ *
+ * @return bool True on success, false on failure.
+ */
+ private function cancel($id): bool
+ {
+ // Cannot cancel if it has been processed.
+ if (!isset($this->handles[$id])) {
+ return false;
+ }
+
+ $handle = $this->handles[$id]['easy']->handle;
+ unset($this->delays[$id], $this->handles[$id]);
+ \curl_multi_remove_handle($this->_mh, $handle);
+ \curl_close($handle);
+
+ return true;
+ }
+
+ private function processMessages(): void
+ {
+ while ($done = \curl_multi_info_read($this->_mh)) {
+ $id = (int) $done['handle'];
+ \curl_multi_remove_handle($this->_mh, $done['handle']);
+
+ if (!isset($this->handles[$id])) {
+ // Probably was cancelled.
+ continue;
+ }
+
+ $entry = $this->handles[$id];
+ unset($this->handles[$id], $this->delays[$id]);
+ $entry['easy']->errno = $done['result'];
+ $entry['deferred']->resolve(
+ CurlFactory::finish($this, $entry['easy'], $this->factory)
+ );
+ }
+ }
+
+ private function timeToNext(): int
+ {
+ $currentTime = Utils::currentTime();
+ $nextTime = \PHP_INT_MAX;
+ foreach ($this->delays as $time) {
+ if ($time < $nextTime) {
+ $nextTime = $time;
+ }
+ }
+
+ return ((int) \max(0, $nextTime - $currentTime)) * 1000000;
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Handler/EasyHandle.php b/lib/gerencianet/guzzlehttp/guzzle/src/Handler/EasyHandle.php
new file mode 100644
index 0000000..224344d
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Handler/EasyHandle.php
@@ -0,0 +1,112 @@
+headers);
+
+ $normalizedKeys = Utils::normalizeHeaderKeys($headers);
+
+ if (!empty($this->options['decode_content']) && isset($normalizedKeys['content-encoding'])) {
+ $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']];
+ unset($headers[$normalizedKeys['content-encoding']]);
+ if (isset($normalizedKeys['content-length'])) {
+ $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']];
+
+ $bodyLength = (int) $this->sink->getSize();
+ if ($bodyLength) {
+ $headers[$normalizedKeys['content-length']] = $bodyLength;
+ } else {
+ unset($headers[$normalizedKeys['content-length']]);
+ }
+ }
+ }
+
+ // Attach a response to the easy handle with the parsed headers.
+ $this->response = new Response(
+ $status,
+ $headers,
+ $this->sink,
+ $ver,
+ $reason
+ );
+ }
+
+ /**
+ * @param string $name
+ *
+ * @return void
+ *
+ * @throws \BadMethodCallException
+ */
+ public function __get($name)
+ {
+ $msg = $name === 'handle' ? 'The EasyHandle has been released' : 'Invalid property: ' . $name;
+ throw new \BadMethodCallException($msg);
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php b/lib/gerencianet/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php
new file mode 100644
index 0000000..a098884
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php
@@ -0,0 +1,42 @@
+|null $queue The parameters to be passed to the append function, as an indexed array.
+ * @param callable|null $onFulfilled Callback to invoke when the return value is fulfilled.
+ * @param callable|null $onRejected Callback to invoke when the return value is rejected.
+ */
+ public function __construct(array $queue = null, callable $onFulfilled = null, callable $onRejected = null)
+ {
+ $this->onFulfilled = $onFulfilled;
+ $this->onRejected = $onRejected;
+
+ if ($queue) {
+ // array_values included for BC
+ $this->append(...array_values($queue));
+ }
+ }
+
+ public function __invoke(RequestInterface $request, array $options): PromiseInterface
+ {
+ if (!$this->queue) {
+ throw new \OutOfBoundsException('Mock queue is empty');
+ }
+
+ if (isset($options['delay']) && \is_numeric($options['delay'])) {
+ \usleep((int) $options['delay'] * 1000);
+ }
+
+ $this->lastRequest = $request;
+ $this->lastOptions = $options;
+ $response = \array_shift($this->queue);
+
+ if (isset($options['on_headers'])) {
+ if (!\is_callable($options['on_headers'])) {
+ throw new \InvalidArgumentException('on_headers must be callable');
+ }
+ try {
+ $options['on_headers']($response);
+ } catch (\Exception $e) {
+ $msg = 'An error was encountered during the on_headers event';
+ $response = new RequestException($msg, $request, $response, $e);
+ }
+ }
+
+ if (\is_callable($response)) {
+ $response = $response($request, $options);
+ }
+
+ $response = $response instanceof \Throwable
+ ? P\Create::rejectionFor($response)
+ : P\Create::promiseFor($response);
+
+ return $response->then(
+ function (?ResponseInterface $value) use ($request, $options) {
+ $this->invokeStats($request, $options, $value);
+ if ($this->onFulfilled) {
+ ($this->onFulfilled)($value);
+ }
+
+ if ($value !== null && isset($options['sink'])) {
+ $contents = (string) $value->getBody();
+ $sink = $options['sink'];
+
+ if (\is_resource($sink)) {
+ \fwrite($sink, $contents);
+ } elseif (\is_string($sink)) {
+ \file_put_contents($sink, $contents);
+ } elseif ($sink instanceof StreamInterface) {
+ $sink->write($contents);
+ }
+ }
+
+ return $value;
+ },
+ function ($reason) use ($request, $options) {
+ $this->invokeStats($request, $options, null, $reason);
+ if ($this->onRejected) {
+ ($this->onRejected)($reason);
+ }
+ return P\Create::rejectionFor($reason);
+ }
+ );
+ }
+
+ /**
+ * Adds one or more variadic requests, exceptions, callables, or promises
+ * to the queue.
+ *
+ * @param mixed ...$values
+ */
+ public function append(...$values): void
+ {
+ foreach ($values as $value) {
+ if ($value instanceof ResponseInterface
+ || $value instanceof \Throwable
+ || $value instanceof PromiseInterface
+ || \is_callable($value)
+ ) {
+ $this->queue[] = $value;
+ } else {
+ throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found ' . Utils::describeType($value));
+ }
+ }
+ }
+
+ /**
+ * Get the last received request.
+ */
+ public function getLastRequest(): ?RequestInterface
+ {
+ return $this->lastRequest;
+ }
+
+ /**
+ * Get the last received request options.
+ */
+ public function getLastOptions(): array
+ {
+ return $this->lastOptions;
+ }
+
+ /**
+ * Returns the number of remaining items in the queue.
+ */
+ public function count(): int
+ {
+ return \count($this->queue);
+ }
+
+ public function reset(): void
+ {
+ $this->queue = [];
+ }
+
+ /**
+ * @param mixed $reason Promise or reason.
+ */
+ private function invokeStats(
+ RequestInterface $request,
+ array $options,
+ ResponseInterface $response = null,
+ $reason = null
+ ): void {
+ if (isset($options['on_stats'])) {
+ $transferTime = $options['transfer_time'] ?? 0;
+ $stats = new TransferStats($request, $response, $transferTime, $reason);
+ ($options['on_stats'])($stats);
+ }
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Handler/Proxy.php b/lib/gerencianet/guzzlehttp/guzzle/src/Handler/Proxy.php
new file mode 100644
index 0000000..f045b52
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Handler/Proxy.php
@@ -0,0 +1,51 @@
+withoutHeader('Expect');
+
+ // Append a content-length header if body size is zero to match
+ // cURL's behavior.
+ if (0 === $request->getBody()->getSize()) {
+ $request = $request->withHeader('Content-Length', '0');
+ }
+
+ return $this->createResponse(
+ $request,
+ $options,
+ $this->createStream($request, $options),
+ $startTime
+ );
+ } catch (\InvalidArgumentException $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ // Determine if the error was a networking error.
+ $message = $e->getMessage();
+ // This list can probably get more comprehensive.
+ if (false !== \strpos($message, 'getaddrinfo') // DNS lookup failed
+ || false !== \strpos($message, 'Connection refused')
+ || false !== \strpos($message, "couldn't connect to host") // error on HHVM
+ || false !== \strpos($message, "connection attempt failed")
+ ) {
+ $e = new ConnectException($e->getMessage(), $request, $e);
+ } else {
+ $e = RequestException::wrapException($request, $e);
+ }
+ $this->invokeStats($options, $request, $startTime, null, $e);
+
+ return P\Create::rejectionFor($e);
+ }
+ }
+
+ private function invokeStats(
+ array $options,
+ RequestInterface $request,
+ ?float $startTime,
+ ResponseInterface $response = null,
+ \Throwable $error = null
+ ): void {
+ if (isset($options['on_stats'])) {
+ $stats = new TransferStats($request, $response, Utils::currentTime() - $startTime, $error, []);
+ ($options['on_stats'])($stats);
+ }
+ }
+
+ /**
+ * @param resource $stream
+ */
+ private function createResponse(RequestInterface $request, array $options, $stream, ?float $startTime): PromiseInterface
+ {
+ $hdrs = $this->lastHeaders;
+ $this->lastHeaders = [];
+
+ try {
+ [$ver, $status, $reason, $headers] = HeaderProcessor::parseHeaders($hdrs);
+ } catch (\Exception $e) {
+ return P\Create::rejectionFor(
+ new RequestException('An error was encountered while creating the response', $request, null, $e)
+ );
+ }
+
+ [$stream, $headers] = $this->checkDecode($options, $headers, $stream);
+ $stream = Psr7\Utils::streamFor($stream);
+ $sink = $stream;
+
+ if (\strcasecmp('HEAD', $request->getMethod())) {
+ $sink = $this->createSink($stream, $options);
+ }
+
+ try {
+ $response = new Psr7\Response($status, $headers, $sink, $ver, $reason);
+ } catch (\Exception $e) {
+ return P\Create::rejectionFor(
+ new RequestException('An error was encountered while creating the response', $request, null, $e)
+ );
+ }
+
+ if (isset($options['on_headers'])) {
+ try {
+ $options['on_headers']($response);
+ } catch (\Exception $e) {
+ return P\Create::rejectionFor(
+ new RequestException('An error was encountered during the on_headers event', $request, $response, $e)
+ );
+ }
+ }
+
+ // Do not drain when the request is a HEAD request because they have
+ // no body.
+ if ($sink !== $stream) {
+ $this->drain($stream, $sink, $response->getHeaderLine('Content-Length'));
+ }
+
+ $this->invokeStats($options, $request, $startTime, $response, null);
+
+ return new FulfilledPromise($response);
+ }
+
+ private function createSink(StreamInterface $stream, array $options): StreamInterface
+ {
+ if (!empty($options['stream'])) {
+ return $stream;
+ }
+
+ $sink = $options['sink'] ?? Psr7\Utils::tryFopen('php://temp', 'r+');
+
+ return \is_string($sink) ? new Psr7\LazyOpenStream($sink, 'w+') : Psr7\Utils::streamFor($sink);
+ }
+
+ /**
+ * @param resource $stream
+ */
+ private function checkDecode(array $options, array $headers, $stream): array
+ {
+ // Automatically decode responses when instructed.
+ if (!empty($options['decode_content'])) {
+ $normalizedKeys = Utils::normalizeHeaderKeys($headers);
+ if (isset($normalizedKeys['content-encoding'])) {
+ $encoding = $headers[$normalizedKeys['content-encoding']];
+ if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') {
+ $stream = new Psr7\InflateStream(Psr7\Utils::streamFor($stream));
+ $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']];
+
+ // Remove content-encoding header
+ unset($headers[$normalizedKeys['content-encoding']]);
+
+ // Fix content-length header
+ if (isset($normalizedKeys['content-length'])) {
+ $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']];
+ $length = (int) $stream->getSize();
+ if ($length === 0) {
+ unset($headers[$normalizedKeys['content-length']]);
+ } else {
+ $headers[$normalizedKeys['content-length']] = [$length];
+ }
+ }
+ }
+ }
+ }
+
+ return [$stream, $headers];
+ }
+
+ /**
+ * Drains the source stream into the "sink" client option.
+ *
+ * @param string $contentLength Header specifying the amount of
+ * data to read.
+ *
+ * @throws \RuntimeException when the sink option is invalid.
+ */
+ private function drain(StreamInterface $source, StreamInterface $sink, string $contentLength): StreamInterface
+ {
+ // If a content-length header is provided, then stop reading once
+ // that number of bytes has been read. This can prevent infinitely
+ // reading from a stream when dealing with servers that do not honor
+ // Connection: Close headers.
+ Psr7\Utils::copyToStream(
+ $source,
+ $sink,
+ (\strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1
+ );
+
+ $sink->seek(0);
+ $source->close();
+
+ return $sink;
+ }
+
+ /**
+ * Create a resource and check to ensure it was created successfully
+ *
+ * @param callable $callback Callable that returns stream resource
+ *
+ * @return resource
+ *
+ * @throws \RuntimeException on error
+ */
+ private function createResource(callable $callback)
+ {
+ $errors = [];
+ \set_error_handler(static function ($_, $msg, $file, $line) use (&$errors): bool {
+ $errors[] = [
+ 'message' => $msg,
+ 'file' => $file,
+ 'line' => $line
+ ];
+ return true;
+ });
+
+ $resource = $callback();
+ \restore_error_handler();
+
+ if (!$resource) {
+ $message = 'Error creating resource: ';
+ foreach ($errors as $err) {
+ foreach ($err as $key => $value) {
+ $message .= "[$key] $value" . \PHP_EOL;
+ }
+ }
+ throw new \RuntimeException(\trim($message));
+ }
+
+ return $resource;
+ }
+
+ /**
+ * @return resource
+ */
+ private function createStream(RequestInterface $request, array $options)
+ {
+ static $methods;
+ if (!$methods) {
+ $methods = \array_flip(\get_class_methods(__CLASS__));
+ }
+
+ // HTTP/1.1 streams using the PHP stream wrapper require a
+ // Connection: close header
+ if ($request->getProtocolVersion() == '1.1'
+ && !$request->hasHeader('Connection')
+ ) {
+ $request = $request->withHeader('Connection', 'close');
+ }
+
+ // Ensure SSL is verified by default
+ if (!isset($options['verify'])) {
+ $options['verify'] = true;
+ }
+
+ $params = [];
+ $context = $this->getDefaultContext($request);
+
+ if (isset($options['on_headers']) && !\is_callable($options['on_headers'])) {
+ throw new \InvalidArgumentException('on_headers must be callable');
+ }
+
+ if (!empty($options)) {
+ foreach ($options as $key => $value) {
+ $method = "add_{$key}";
+ if (isset($methods[$method])) {
+ $this->{$method}($request, $context, $value, $params);
+ }
+ }
+ }
+
+ if (isset($options['stream_context'])) {
+ if (!\is_array($options['stream_context'])) {
+ throw new \InvalidArgumentException('stream_context must be an array');
+ }
+ $context = \array_replace_recursive($context, $options['stream_context']);
+ }
+
+ // Microsoft NTLM authentication only supported with curl handler
+ if (isset($options['auth'][2]) && 'ntlm' === $options['auth'][2]) {
+ throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler');
+ }
+
+ $uri = $this->resolveHost($request, $options);
+
+ $contextResource = $this->createResource(
+ static function () use ($context, $params) {
+ return \stream_context_create($context, $params);
+ }
+ );
+
+ return $this->createResource(
+ function () use ($uri, &$http_response_header, $contextResource, $context, $options, $request) {
+ $resource = @\fopen((string) $uri, 'r', false, $contextResource);
+ $this->lastHeaders = $http_response_header;
+
+ if (false === $resource) {
+ throw new ConnectException(sprintf('Connection refused for URI %s', $uri), $request, null, $context);
+ }
+
+ if (isset($options['read_timeout'])) {
+ $readTimeout = $options['read_timeout'];
+ $sec = (int) $readTimeout;
+ $usec = ($readTimeout - $sec) * 100000;
+ \stream_set_timeout($resource, $sec, $usec);
+ }
+
+ return $resource;
+ }
+ );
+ }
+
+ private function resolveHost(RequestInterface $request, array $options): UriInterface
+ {
+ $uri = $request->getUri();
+
+ if (isset($options['force_ip_resolve']) && !\filter_var($uri->getHost(), \FILTER_VALIDATE_IP)) {
+ if ('v4' === $options['force_ip_resolve']) {
+ $records = \dns_get_record($uri->getHost(), \DNS_A);
+ if (false === $records || !isset($records[0]['ip'])) {
+ throw new ConnectException(\sprintf("Could not resolve IPv4 address for host '%s'", $uri->getHost()), $request);
+ }
+ return $uri->withHost($records[0]['ip']);
+ }
+ if ('v6' === $options['force_ip_resolve']) {
+ $records = \dns_get_record($uri->getHost(), \DNS_AAAA);
+ if (false === $records || !isset($records[0]['ipv6'])) {
+ throw new ConnectException(\sprintf("Could not resolve IPv6 address for host '%s'", $uri->getHost()), $request);
+ }
+ return $uri->withHost('[' . $records[0]['ipv6'] . ']');
+ }
+ }
+
+ return $uri;
+ }
+
+ private function getDefaultContext(RequestInterface $request): array
+ {
+ $headers = '';
+ foreach ($request->getHeaders() as $name => $value) {
+ foreach ($value as $val) {
+ $headers .= "$name: $val\r\n";
+ }
+ }
+
+ $context = [
+ 'http' => [
+ 'method' => $request->getMethod(),
+ 'header' => $headers,
+ 'protocol_version' => $request->getProtocolVersion(),
+ 'ignore_errors' => true,
+ 'follow_location' => 0,
+ ],
+ ];
+
+ $body = (string) $request->getBody();
+
+ if (!empty($body)) {
+ $context['http']['content'] = $body;
+ // Prevent the HTTP handler from adding a Content-Type header.
+ if (!$request->hasHeader('Content-Type')) {
+ $context['http']['header'] .= "Content-Type:\r\n";
+ }
+ }
+
+ $context['http']['header'] = \rtrim($context['http']['header']);
+
+ return $context;
+ }
+
+ /**
+ * @param mixed $value as passed via Request transfer options.
+ */
+ private function add_proxy(RequestInterface $request, array &$options, $value, array &$params): void
+ {
+ $uri = null;
+
+ if (!\is_array($value)) {
+ $uri = $value;
+ } else {
+ $scheme = $request->getUri()->getScheme();
+ if (isset($value[$scheme])) {
+ if (!isset($value['no']) || !Utils::isHostInNoProxy($request->getUri()->getHost(), $value['no'])) {
+ $uri = $value[$scheme];
+ }
+ }
+ }
+
+ if (!$uri) {
+ return;
+ }
+
+ $parsed = $this->parse_proxy($uri);
+ $options['http']['proxy'] = $parsed['proxy'];
+
+ if ($parsed['auth']) {
+ if (!isset($options['http']['header'])) {
+ $options['http']['header'] = [];
+ }
+ $options['http']['header'] .= "\r\nProxy-Authorization: {$parsed['auth']}";
+ }
+ }
+
+ /**
+ * Parses the given proxy URL to make it compatible with the format PHP's stream context expects.
+ */
+ private function parse_proxy(string $url): array
+ {
+ $parsed = \parse_url($url);
+
+ if ($parsed !== false && isset($parsed['scheme']) && $parsed['scheme'] === 'http') {
+ if (isset($parsed['host']) && isset($parsed['port'])) {
+ $auth = null;
+ if (isset($parsed['user']) && isset($parsed['pass'])) {
+ $auth = \base64_encode("{$parsed['user']}:{$parsed['pass']}");
+ }
+
+ return [
+ 'proxy' => "tcp://{$parsed['host']}:{$parsed['port']}",
+ 'auth' => $auth ? "Basic {$auth}" : null,
+ ];
+ }
+ }
+
+ // Return proxy as-is.
+ return [
+ 'proxy' => $url,
+ 'auth' => null,
+ ];
+ }
+
+ /**
+ * @param mixed $value as passed via Request transfer options.
+ */
+ private function add_timeout(RequestInterface $request, array &$options, $value, array &$params): void
+ {
+ if ($value > 0) {
+ $options['http']['timeout'] = $value;
+ }
+ }
+
+ /**
+ * @param mixed $value as passed via Request transfer options.
+ */
+ private function add_verify(RequestInterface $request, array &$options, $value, array &$params): void
+ {
+ if ($value === false) {
+ $options['ssl']['verify_peer'] = false;
+ $options['ssl']['verify_peer_name'] = false;
+
+ return;
+ }
+
+ if (\is_string($value)) {
+ $options['ssl']['cafile'] = $value;
+ if (!\file_exists($value)) {
+ throw new \RuntimeException("SSL CA bundle not found: $value");
+ }
+ } elseif ($value !== true) {
+ throw new \InvalidArgumentException('Invalid verify request option');
+ }
+
+ $options['ssl']['verify_peer'] = true;
+ $options['ssl']['verify_peer_name'] = true;
+ $options['ssl']['allow_self_signed'] = false;
+ }
+
+ /**
+ * @param mixed $value as passed via Request transfer options.
+ */
+ private function add_cert(RequestInterface $request, array &$options, $value, array &$params): void
+ {
+ if (\is_array($value)) {
+ $options['ssl']['passphrase'] = $value[1];
+ $value = $value[0];
+ }
+
+ if (!\file_exists($value)) {
+ throw new \RuntimeException("SSL certificate not found: {$value}");
+ }
+
+ $options['ssl']['local_cert'] = $value;
+ }
+
+ /**
+ * @param mixed $value as passed via Request transfer options.
+ */
+ private function add_progress(RequestInterface $request, array &$options, $value, array &$params): void
+ {
+ self::addNotification(
+ $params,
+ static function ($code, $a, $b, $c, $transferred, $total) use ($value) {
+ if ($code == \STREAM_NOTIFY_PROGRESS) {
+ $value($total, $transferred, null, null);
+ }
+ }
+ );
+ }
+
+ /**
+ * @param mixed $value as passed via Request transfer options.
+ */
+ private function add_debug(RequestInterface $request, array &$options, $value, array &$params): void
+ {
+ if ($value === false) {
+ return;
+ }
+
+ static $map = [
+ \STREAM_NOTIFY_CONNECT => 'CONNECT',
+ \STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED',
+ \STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT',
+ \STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS',
+ \STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS',
+ \STREAM_NOTIFY_REDIRECTED => 'REDIRECTED',
+ \STREAM_NOTIFY_PROGRESS => 'PROGRESS',
+ \STREAM_NOTIFY_FAILURE => 'FAILURE',
+ \STREAM_NOTIFY_COMPLETED => 'COMPLETED',
+ \STREAM_NOTIFY_RESOLVE => 'RESOLVE',
+ ];
+ static $args = ['severity', 'message', 'message_code', 'bytes_transferred', 'bytes_max'];
+
+ $value = Utils::debugResource($value);
+ $ident = $request->getMethod() . ' ' . $request->getUri()->withFragment('');
+ self::addNotification(
+ $params,
+ static function (int $code, ...$passed) use ($ident, $value, $map, $args): void {
+ \fprintf($value, '<%s> [%s] ', $ident, $map[$code]);
+ foreach (\array_filter($passed) as $i => $v) {
+ \fwrite($value, $args[$i] . ': "' . $v . '" ');
+ }
+ \fwrite($value, "\n");
+ }
+ );
+ }
+
+ private static function addNotification(array &$params, callable $notify): void
+ {
+ // Wrap the existing function if needed.
+ if (!isset($params['notification'])) {
+ $params['notification'] = $notify;
+ } else {
+ $params['notification'] = self::callArray([
+ $params['notification'],
+ $notify
+ ]);
+ }
+ }
+
+ private static function callArray(array $functions): callable
+ {
+ return static function (...$args) use ($functions) {
+ foreach ($functions as $fn) {
+ $fn(...$args);
+ }
+ };
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/HandlerStack.php b/lib/gerencianet/guzzlehttp/guzzle/src/HandlerStack.php
new file mode 100644
index 0000000..b67239e
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/HandlerStack.php
@@ -0,0 +1,271 @@
+push(Middleware::httpErrors(), 'http_errors');
+ $stack->push(Middleware::redirect(), 'allow_redirects');
+ $stack->push(Middleware::cookies(), 'cookies');
+ $stack->push(Middleware::prepareBody(), 'prepare_body');
+
+ return $stack;
+ }
+
+ /**
+ * @param null|callable(RequestInterface, array): PromiseInterface $handler Underlying HTTP handler.
+ */
+ public function __construct(callable $handler = null)
+ {
+ $this->handler = $handler;
+ }
+
+ /**
+ * Invokes the handler stack as a composed handler
+ *
+ * @return ResponseInterface|PromiseInterface
+ */
+ public function __invoke(RequestInterface $request, array $options)
+ {
+ $handler = $this->resolve();
+
+ return $handler($request, $options);
+ }
+
+ /**
+ * Dumps a string representation of the stack.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $depth = 0;
+ $stack = [];
+
+ if ($this->handler !== null) {
+ $stack[] = "0) Handler: " . $this->debugCallable($this->handler);
+ }
+
+ $result = '';
+ foreach (\array_reverse($this->stack) as $tuple) {
+ $depth++;
+ $str = "{$depth}) Name: '{$tuple[1]}', ";
+ $str .= "Function: " . $this->debugCallable($tuple[0]);
+ $result = "> {$str}\n{$result}";
+ $stack[] = $str;
+ }
+
+ foreach (\array_keys($stack) as $k) {
+ $result .= "< {$stack[$k]}\n";
+ }
+
+ return $result;
+ }
+
+ /**
+ * Set the HTTP handler that actually returns a promise.
+ *
+ * @param callable(RequestInterface, array): PromiseInterface $handler Accepts a request and array of options and
+ * returns a Promise.
+ */
+ public function setHandler(callable $handler): void
+ {
+ $this->handler = $handler;
+ $this->cached = null;
+ }
+
+ /**
+ * Returns true if the builder has a handler.
+ */
+ public function hasHandler(): bool
+ {
+ return $this->handler !== null ;
+ }
+
+ /**
+ * Unshift a middleware to the bottom of the stack.
+ *
+ * @param callable(callable): callable $middleware Middleware function
+ * @param string $name Name to register for this middleware.
+ */
+ public function unshift(callable $middleware, ?string $name = null): void
+ {
+ \array_unshift($this->stack, [$middleware, $name]);
+ $this->cached = null;
+ }
+
+ /**
+ * Push a middleware to the top of the stack.
+ *
+ * @param callable(callable): callable $middleware Middleware function
+ * @param string $name Name to register for this middleware.
+ */
+ public function push(callable $middleware, string $name = ''): void
+ {
+ $this->stack[] = [$middleware, $name];
+ $this->cached = null;
+ }
+
+ /**
+ * Add a middleware before another middleware by name.
+ *
+ * @param string $findName Middleware to find
+ * @param callable(callable): callable $middleware Middleware function
+ * @param string $withName Name to register for this middleware.
+ */
+ public function before(string $findName, callable $middleware, string $withName = ''): void
+ {
+ $this->splice($findName, $withName, $middleware, true);
+ }
+
+ /**
+ * Add a middleware after another middleware by name.
+ *
+ * @param string $findName Middleware to find
+ * @param callable(callable): callable $middleware Middleware function
+ * @param string $withName Name to register for this middleware.
+ */
+ public function after(string $findName, callable $middleware, string $withName = ''): void
+ {
+ $this->splice($findName, $withName, $middleware, false);
+ }
+
+ /**
+ * Remove a middleware by instance or name from the stack.
+ *
+ * @param callable|string $remove Middleware to remove by instance or name.
+ */
+ public function remove($remove): void
+ {
+ $this->cached = null;
+ $idx = \is_callable($remove) ? 0 : 1;
+ $this->stack = \array_values(\array_filter(
+ $this->stack,
+ static function ($tuple) use ($idx, $remove) {
+ return $tuple[$idx] !== $remove;
+ }
+ ));
+ }
+
+ /**
+ * Compose the middleware and handler into a single callable function.
+ *
+ * @return callable(RequestInterface, array): PromiseInterface
+ */
+ public function resolve(): callable
+ {
+ if ($this->cached === null) {
+ if (($prev = $this->handler) === null) {
+ throw new \LogicException('No handler has been specified');
+ }
+
+ foreach (\array_reverse($this->stack) as $fn) {
+ /** @var callable(RequestInterface, array): PromiseInterface $prev */
+ $prev = $fn[0]($prev);
+ }
+
+ $this->cached = $prev;
+ }
+
+ return $this->cached;
+ }
+
+ private function findByName(string $name): int
+ {
+ foreach ($this->stack as $k => $v) {
+ if ($v[1] === $name) {
+ return $k;
+ }
+ }
+
+ throw new \InvalidArgumentException("Middleware not found: $name");
+ }
+
+ /**
+ * Splices a function into the middleware list at a specific position.
+ */
+ private function splice(string $findName, string $withName, callable $middleware, bool $before): void
+ {
+ $this->cached = null;
+ $idx = $this->findByName($findName);
+ $tuple = [$middleware, $withName];
+
+ if ($before) {
+ if ($idx === 0) {
+ \array_unshift($this->stack, $tuple);
+ } else {
+ $replacement = [$tuple, $this->stack[$idx]];
+ \array_splice($this->stack, $idx, 1, $replacement);
+ }
+ } elseif ($idx === \count($this->stack) - 1) {
+ $this->stack[] = $tuple;
+ } else {
+ $replacement = [$this->stack[$idx], $tuple];
+ \array_splice($this->stack, $idx, 1, $replacement);
+ }
+ }
+
+ /**
+ * Provides a debug string for a given callable.
+ *
+ * @param callable $fn Function to write as a string.
+ */
+ private function debugCallable($fn): string
+ {
+ if (\is_string($fn)) {
+ return "callable({$fn})";
+ }
+
+ if (\is_array($fn)) {
+ return \is_string($fn[0])
+ ? "callable({$fn[0]}::{$fn[1]})"
+ : "callable(['" . \get_class($fn[0]) . "', '{$fn[1]}'])";
+ }
+
+ /** @var object $fn */
+ return 'callable(' . \spl_object_hash($fn) . ')';
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/HasDataTrait.php b/lib/gerencianet/guzzlehttp/guzzle/src/HasDataTrait.php
deleted file mode 100644
index 020dfc9..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/HasDataTrait.php
+++ /dev/null
@@ -1,75 +0,0 @@
-data);
- }
-
- public function offsetGet($offset)
- {
- return isset($this->data[$offset]) ? $this->data[$offset] : null;
- }
-
- public function offsetSet($offset, $value)
- {
- $this->data[$offset] = $value;
- }
-
- public function offsetExists($offset)
- {
- return isset($this->data[$offset]);
- }
-
- public function offsetUnset($offset)
- {
- unset($this->data[$offset]);
- }
-
- public function toArray()
- {
- return $this->data;
- }
-
- public function count()
- {
- return count($this->data);
- }
-
- /**
- * Get a value from the collection using a path syntax to retrieve nested
- * data.
- *
- * @param string $path Path to traverse and retrieve a value from
- *
- * @return mixed|null
- */
- public function getPath($path)
- {
- return Utils::getPath($this->data, $path);
- }
-
- /**
- * Set a value into a nested array key. Keys will be created as needed to
- * set the value.
- *
- * @param string $path Path to set
- * @param mixed $value Value to set at the key
- *
- * @throws \RuntimeException when trying to setPath using a nested path
- * that travels through a scalar value
- */
- public function setPath($path, $value)
- {
- Utils::setPath($this->data, $path, $value);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Message/AbstractMessage.php b/lib/gerencianet/guzzlehttp/guzzle/src/Message/AbstractMessage.php
deleted file mode 100644
index 0c67575..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Message/AbstractMessage.php
+++ /dev/null
@@ -1,253 +0,0 @@
-getBody();
- }
-
- public function getProtocolVersion()
- {
- return $this->protocolVersion;
- }
-
- public function getBody()
- {
- return $this->body;
- }
-
- public function setBody(StreamInterface $body = null)
- {
- if ($body === null) {
- // Setting a null body will remove the body of the request
- $this->removeHeader('Content-Length');
- $this->removeHeader('Transfer-Encoding');
- }
-
- $this->body = $body;
- }
-
- public function addHeader($header, $value)
- {
- if (is_array($value)) {
- $current = array_merge($this->getHeaderAsArray($header), $value);
- } else {
- $current = $this->getHeaderAsArray($header);
- $current[] = (string) $value;
- }
-
- $this->setHeader($header, $current);
- }
-
- public function addHeaders(array $headers)
- {
- foreach ($headers as $name => $header) {
- $this->addHeader($name, $header);
- }
- }
-
- public function getHeader($header)
- {
- $name = strtolower($header);
- return isset($this->headers[$name])
- ? implode(', ', $this->headers[$name])
- : '';
- }
-
- public function getHeaderAsArray($header)
- {
- $name = strtolower($header);
- return isset($this->headers[$name]) ? $this->headers[$name] : [];
- }
-
- public function getHeaders()
- {
- $headers = [];
- foreach ($this->headers as $name => $values) {
- $headers[$this->headerNames[$name]] = $values;
- }
-
- return $headers;
- }
-
- public function setHeader($header, $value)
- {
- $header = trim($header);
- $name = strtolower($header);
- $this->headerNames[$name] = $header;
-
- if (is_array($value)) {
- foreach ($value as &$v) {
- $v = trim($v);
- }
- $this->headers[$name] = $value;
- } else {
- $this->headers[$name] = [trim($value)];
- }
- }
-
- public function setHeaders(array $headers)
- {
- $this->headers = $this->headerNames = [];
- foreach ($headers as $key => $value) {
- $this->setHeader($key, $value);
- }
- }
-
- public function hasHeader($header)
- {
- return isset($this->headers[strtolower($header)]);
- }
-
- public function removeHeader($header)
- {
- $name = strtolower($header);
- unset($this->headers[$name], $this->headerNames[$name]);
- }
-
- /**
- * Parse an array of header values containing ";" separated data into an
- * array of associative arrays representing the header key value pair
- * data of the header. When a parameter does not contain a value, but just
- * contains a key, this function will inject a key with a '' string value.
- *
- * @param MessageInterface $message That contains the header
- * @param string $header Header to retrieve from the message
- *
- * @return array Returns the parsed header values.
- */
- public static function parseHeader(MessageInterface $message, $header)
- {
- static $trimmed = "\"' \n\t\r";
- $params = $matches = [];
-
- foreach (self::normalizeHeader($message, $header) as $val) {
- $part = [];
- foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) {
- if (preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) {
- $m = $matches[0];
- if (isset($m[1])) {
- $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed);
- } else {
- $part[] = trim($m[0], $trimmed);
- }
- }
- }
- if ($part) {
- $params[] = $part;
- }
- }
-
- return $params;
- }
-
- /**
- * Converts an array of header values that may contain comma separated
- * headers into an array of headers with no comma separated values.
- *
- * @param MessageInterface $message That contains the header
- * @param string $header Header to retrieve from the message
- *
- * @return array Returns the normalized header field values.
- */
- public static function normalizeHeader(MessageInterface $message, $header)
- {
- $h = $message->getHeaderAsArray($header);
- for ($i = 0, $total = count($h); $i < $total; $i++) {
- if (strpos($h[$i], ',') === false) {
- continue;
- }
- foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $h[$i]) as $v) {
- $h[] = trim($v);
- }
- unset($h[$i]);
- }
-
- return $h;
- }
-
- /**
- * Gets the start-line and headers of a message as a string
- *
- * @param MessageInterface $message
- *
- * @return string
- */
- public static function getStartLineAndHeaders(MessageInterface $message)
- {
- return static::getStartLine($message)
- . self::getHeadersAsString($message);
- }
-
- /**
- * Gets the headers of a message as a string
- *
- * @param MessageInterface $message
- *
- * @return string
- */
- public static function getHeadersAsString(MessageInterface $message)
- {
- $result = '';
- foreach ($message->getHeaders() as $name => $values) {
- $result .= "\r\n{$name}: " . implode(', ', $values);
- }
-
- return $result;
- }
-
- /**
- * Gets the start line of a message
- *
- * @param MessageInterface $message
- *
- * @return string
- * @throws \InvalidArgumentException
- */
- public static function getStartLine(MessageInterface $message)
- {
- if ($message instanceof RequestInterface) {
- return trim($message->getMethod() . ' '
- . $message->getResource())
- . ' HTTP/' . $message->getProtocolVersion();
- } elseif ($message instanceof ResponseInterface) {
- return 'HTTP/' . $message->getProtocolVersion() . ' '
- . $message->getStatusCode() . ' '
- . $message->getReasonPhrase();
- } else {
- throw new \InvalidArgumentException('Unknown message type');
- }
- }
-
- /**
- * Accepts and modifies the options provided to the message in the
- * constructor.
- *
- * Can be overridden in subclasses as necessary.
- *
- * @param array $options Options array passed by reference.
- */
- protected function handleOptions(array &$options)
- {
- if (isset($options['protocol_version'])) {
- $this->protocolVersion = $options['protocol_version'];
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Message/AppliesHeadersInterface.php b/lib/gerencianet/guzzlehttp/guzzle/src/Message/AppliesHeadersInterface.php
deleted file mode 100644
index ca42f20..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Message/AppliesHeadersInterface.php
+++ /dev/null
@@ -1,24 +0,0 @@
-then($onFulfilled, $onRejected, $onProgress),
- [$future, 'wait'],
- [$future, 'cancel']
- );
- }
-
- public function getStatusCode()
- {
- return $this->_value->getStatusCode();
- }
-
- public function setStatusCode($code)
- {
- $this->_value->setStatusCode($code);
- }
-
- public function getReasonPhrase()
- {
- return $this->_value->getReasonPhrase();
- }
-
- public function setReasonPhrase($phrase)
- {
- $this->_value->setReasonPhrase($phrase);
- }
-
- public function getEffectiveUrl()
- {
- return $this->_value->getEffectiveUrl();
- }
-
- public function setEffectiveUrl($url)
- {
- $this->_value->setEffectiveUrl($url);
- }
-
- public function json(array $config = [])
- {
- return $this->_value->json($config);
- }
-
- public function xml(array $config = [])
- {
- return $this->_value->xml($config);
- }
-
- public function __toString()
- {
- try {
- return $this->_value->__toString();
- } catch (\Exception $e) {
- trigger_error($e->getMessage(), E_USER_WARNING);
- return '';
- }
- }
-
- public function getProtocolVersion()
- {
- return $this->_value->getProtocolVersion();
- }
-
- public function setBody(StreamInterface $body = null)
- {
- $this->_value->setBody($body);
- }
-
- public function getBody()
- {
- return $this->_value->getBody();
- }
-
- public function getHeaders()
- {
- return $this->_value->getHeaders();
- }
-
- public function getHeader($header)
- {
- return $this->_value->getHeader($header);
- }
-
- public function getHeaderAsArray($header)
- {
- return $this->_value->getHeaderAsArray($header);
- }
-
- public function hasHeader($header)
- {
- return $this->_value->hasHeader($header);
- }
-
- public function removeHeader($header)
- {
- $this->_value->removeHeader($header);
- }
-
- public function addHeader($header, $value)
- {
- $this->_value->addHeader($header, $value);
- }
-
- public function addHeaders(array $headers)
- {
- $this->_value->addHeaders($headers);
- }
-
- public function setHeader($header, $value)
- {
- $this->_value->setHeader($header, $value);
- }
-
- public function setHeaders(array $headers)
- {
- $this->_value->setHeaders($headers);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Message/MessageFactory.php b/lib/gerencianet/guzzlehttp/guzzle/src/Message/MessageFactory.php
deleted file mode 100644
index 85984e2..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Message/MessageFactory.php
+++ /dev/null
@@ -1,364 +0,0 @@
- 1, 'timeout' => 1, 'verify' => 1, 'ssl_key' => 1,
- 'cert' => 1, 'proxy' => 1, 'debug' => 1, 'save_to' => 1, 'stream' => 1,
- 'expect' => 1, 'future' => 1
- ];
-
- /** @var array Default allow_redirects request option settings */
- private static $defaultRedirect = [
- 'max' => 5,
- 'strict' => false,
- 'referer' => false,
- 'protocols' => ['http', 'https']
- ];
-
- /**
- * @param array $customOptions Associative array of custom request option
- * names mapping to functions used to apply
- * the option. The function accepts the request
- * and the option value to apply.
- */
- public function __construct(array $customOptions = [])
- {
- $this->errorPlugin = new HttpError();
- $this->redirectPlugin = new Redirect();
- $this->customOptions = $customOptions;
- }
-
- public function createResponse(
- $statusCode,
- array $headers = [],
- $body = null,
- array $options = []
- ) {
- if (null !== $body) {
- $body = Stream::factory($body);
- }
-
- return new Response($statusCode, $headers, $body, $options);
- }
-
- public function createRequest($method, $url, array $options = [])
- {
- // Handle the request protocol version option that needs to be
- // specified in the request constructor.
- if (isset($options['version'])) {
- $options['config']['protocol_version'] = $options['version'];
- unset($options['version']);
- }
-
- $request = new Request($method, $url, [], null,
- isset($options['config']) ? $options['config'] : []);
-
- unset($options['config']);
-
- // Use a POST body by default
- if ($method == 'POST'
- && !isset($options['body'])
- && !isset($options['json'])
- ) {
- $options['body'] = [];
- }
-
- if ($options) {
- $this->applyOptions($request, $options);
- }
-
- return $request;
- }
-
- /**
- * Create a request or response object from an HTTP message string
- *
- * @param string $message Message to parse
- *
- * @return RequestInterface|ResponseInterface
- * @throws \InvalidArgumentException if unable to parse a message
- */
- public function fromMessage($message)
- {
- static $parser;
- if (!$parser) {
- $parser = new MessageParser();
- }
-
- // Parse a response
- if (strtoupper(substr($message, 0, 4)) == 'HTTP') {
- $data = $parser->parseResponse($message);
- return $this->createResponse(
- $data['code'],
- $data['headers'],
- $data['body'] === '' ? null : $data['body'],
- $data
- );
- }
-
- // Parse a request
- if (!($data = ($parser->parseRequest($message)))) {
- throw new \InvalidArgumentException('Unable to parse request');
- }
-
- return $this->createRequest(
- $data['method'],
- Url::buildUrl($data['request_url']),
- [
- 'headers' => $data['headers'],
- 'body' => $data['body'] === '' ? null : $data['body'],
- 'config' => [
- 'protocol_version' => $data['protocol_version']
- ]
- ]
- );
- }
-
- /**
- * Apply POST fields and files to a request to attempt to give an accurate
- * representation.
- *
- * @param RequestInterface $request Request to update
- * @param array $body Body to apply
- */
- protected function addPostData(RequestInterface $request, array $body)
- {
- static $fields = ['string' => true, 'array' => true, 'NULL' => true,
- 'boolean' => true, 'double' => true, 'integer' => true];
-
- $post = new PostBody();
- foreach ($body as $key => $value) {
- if (isset($fields[gettype($value)])) {
- $post->setField($key, $value);
- } elseif ($value instanceof PostFileInterface) {
- $post->addFile($value);
- } else {
- $post->addFile(new PostFile($key, $value));
- }
- }
-
- if ($request->getHeader('Content-Type') == 'multipart/form-data') {
- $post->forceMultipartUpload(true);
- }
-
- $request->setBody($post);
- }
-
- protected function applyOptions(
- RequestInterface $request,
- array $options = []
- ) {
- $config = $request->getConfig();
- $emitter = $request->getEmitter();
-
- foreach ($options as $key => $value) {
-
- if (isset(self::$configMap[$key])) {
- $config[$key] = $value;
- continue;
- }
-
- switch ($key) {
-
- case 'allow_redirects':
-
- if ($value === false) {
- continue;
- }
-
- if ($value === true) {
- $value = self::$defaultRedirect;
- } elseif (!is_array($value)) {
- throw new Iae('allow_redirects must be true, false, or array');
- } else {
- // Merge the default settings with the provided settings
- $value += self::$defaultRedirect;
- }
-
- $config['redirect'] = $value;
- $emitter->attach($this->redirectPlugin);
- break;
-
- case 'decode_content':
-
- if ($value === false) {
- continue;
- }
-
- $config['decode_content'] = true;
- if ($value !== true) {
- $request->setHeader('Accept-Encoding', $value);
- }
- break;
-
- case 'headers':
-
- if (!is_array($value)) {
- throw new Iae('header value must be an array');
- }
- foreach ($value as $k => $v) {
- $request->setHeader($k, $v);
- }
- break;
-
- case 'exceptions':
-
- if ($value === true) {
- $emitter->attach($this->errorPlugin);
- }
- break;
-
- case 'body':
-
- if (is_array($value)) {
- $this->addPostData($request, $value);
- } elseif ($value !== null) {
- $request->setBody(Stream::factory($value));
- }
- break;
-
- case 'auth':
-
- if (!$value) {
- continue;
- }
-
- if (is_array($value)) {
- $type = isset($value[2]) ? strtolower($value[2]) : 'basic';
- } else {
- $type = strtolower($value);
- }
-
- $config['auth'] = $value;
-
- if ($type == 'basic') {
- $request->setHeader(
- 'Authorization',
- 'Basic ' . base64_encode("$value[0]:$value[1]")
- );
- } elseif ($type == 'digest') {
- // @todo: Do not rely on curl
- $config->setPath('curl/' . CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
- $config->setPath('curl/' . CURLOPT_USERPWD, "$value[0]:$value[1]");
- }
- break;
-
- case 'query':
-
- if ($value instanceof Query) {
- $original = $request->getQuery();
- // Do not overwrite existing query string variables by
- // overwriting the object with the query string data passed
- // in the URL
- $value->overwriteWith($original->toArray());
- $request->setQuery($value);
- } elseif (is_array($value)) {
- // Do not overwrite existing query string variables
- $query = $request->getQuery();
- foreach ($value as $k => $v) {
- if (!isset($query[$k])) {
- $query[$k] = $v;
- }
- }
- } else {
- throw new Iae('query must be an array or Query object');
- }
- break;
-
- case 'cookies':
-
- if ($value === true) {
- static $cookie = null;
- if (!$cookie) {
- $cookie = new Cookie();
- }
- $emitter->attach($cookie);
- } elseif (is_array($value)) {
- $emitter->attach(
- new Cookie(CookieJar::fromArray($value, $request->getHost()))
- );
- } elseif ($value instanceof CookieJarInterface) {
- $emitter->attach(new Cookie($value));
- } elseif ($value !== false) {
- throw new Iae('cookies must be an array, true, or CookieJarInterface');
- }
- break;
-
- case 'events':
-
- if (!is_array($value)) {
- throw new Iae('events must be an array');
- }
-
- $this->attachListeners($request,
- $this->prepareListeners(
- $value,
- ['before', 'complete', 'error', 'progress', 'end']
- )
- );
- break;
-
- case 'subscribers':
-
- if (!is_array($value)) {
- throw new Iae('subscribers must be an array');
- }
-
- foreach ($value as $subscribers) {
- $emitter->attach($subscribers);
- }
- break;
-
- case 'json':
-
- $request->setBody(Stream::factory(json_encode($value)));
- if (!$request->hasHeader('Content-Type')) {
- $request->setHeader('Content-Type', 'application/json');
- }
- break;
-
- default:
-
- // Check for custom handler functions.
- if (isset($this->customOptions[$key])) {
- $fn = $this->customOptions[$key];
- $fn($request, $value);
- continue;
- }
-
- throw new Iae("No method can handle the {$key} config key");
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Message/MessageFactoryInterface.php b/lib/gerencianet/guzzlehttp/guzzle/src/Message/MessageFactoryInterface.php
deleted file mode 100644
index 86ae9c7..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Message/MessageFactoryInterface.php
+++ /dev/null
@@ -1,71 +0,0 @@
-getHeaders() as $name => $values) {
- * echo $name . ": " . implode(", ", $values);
- * }
- *
- * @return array Returns an associative array of the message's headers.
- */
- public function getHeaders();
-
- /**
- * Retrieve a header by the given case-insensitive name.
- *
- * @param string $header Case-insensitive header name.
- *
- * @return string
- */
- public function getHeader($header);
-
- /**
- * Retrieves a header by the given case-insensitive name as an array of strings.
- *
- * @param string $header Case-insensitive header name.
- *
- * @return string[]
- */
- public function getHeaderAsArray($header);
-
- /**
- * Checks if a header exists by the given case-insensitive name.
- *
- * @param string $header Case-insensitive header name.
- *
- * @return bool Returns true if any header names match the given header
- * name using a case-insensitive string comparison. Returns false if
- * no matching header name is found in the message.
- */
- public function hasHeader($header);
-
- /**
- * Remove a specific header by case-insensitive name.
- *
- * @param string $header Case-insensitive header name.
- */
- public function removeHeader($header);
-
- /**
- * Appends a header value to any existing values associated with the
- * given header name.
- *
- * @param string $header Header name to add
- * @param string $value Value of the header
- */
- public function addHeader($header, $value);
-
- /**
- * Merges in an associative array of headers.
- *
- * Each array key MUST be a string representing the case-insensitive name
- * of a header. Each value MUST be either a string or an array of strings.
- * For each value, the value is appended to any existing header of the same
- * name, or, if a header does not already exist by the given name, then the
- * header is added.
- *
- * @param array $headers Associative array of headers to add to the message
- */
- public function addHeaders(array $headers);
-
- /**
- * Sets a header, replacing any existing values of any headers with the
- * same case-insensitive name.
- *
- * The header values MUST be a string or an array of strings.
- *
- * @param string $header Header name
- * @param string|array $value Header value(s)
- */
- public function setHeader($header, $value);
-
- /**
- * Sets headers, replacing any headers that have already been set on the
- * message.
- *
- * The array keys MUST be a string. The array values must be either a
- * string or an array of strings.
- *
- * @param array $headers Headers to set.
- */
- public function setHeaders(array $headers);
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Message/MessageParser.php b/lib/gerencianet/guzzlehttp/guzzle/src/Message/MessageParser.php
deleted file mode 100644
index c3cc195..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Message/MessageParser.php
+++ /dev/null
@@ -1,171 +0,0 @@
-parseMessage($message))) {
- return false;
- }
-
- // Parse the protocol and protocol version
- if (isset($parts['start_line'][2])) {
- $startParts = explode('/', $parts['start_line'][2]);
- $protocol = strtoupper($startParts[0]);
- $version = isset($startParts[1]) ? $startParts[1] : '1.1';
- } else {
- $protocol = 'HTTP';
- $version = '1.1';
- }
-
- $parsed = [
- 'method' => strtoupper($parts['start_line'][0]),
- 'protocol' => $protocol,
- 'protocol_version' => $version,
- 'headers' => $parts['headers'],
- 'body' => $parts['body']
- ];
-
- $parsed['request_url'] = $this->getUrlPartsFromMessage(
- (isset($parts['start_line'][1]) ? $parts['start_line'][1] : ''), $parsed);
-
- return $parsed;
- }
-
- /**
- * Parse an HTTP response message into an associative array of parts.
- *
- * @param string $message HTTP response to parse
- *
- * @return array|bool Returns false if the message is invalid
- */
- public function parseResponse($message)
- {
- if (!($parts = $this->parseMessage($message))) {
- return false;
- }
-
- list($protocol, $version) = explode('/', trim($parts['start_line'][0]));
-
- return [
- 'protocol' => $protocol,
- 'protocol_version' => $version,
- 'code' => $parts['start_line'][1],
- 'reason_phrase' => isset($parts['start_line'][2]) ? $parts['start_line'][2] : '',
- 'headers' => $parts['headers'],
- 'body' => $parts['body']
- ];
- }
-
- /**
- * Parse a message into parts
- *
- * @param string $message Message to parse
- *
- * @return array|bool
- */
- private function parseMessage($message)
- {
- if (!$message) {
- return false;
- }
-
- $startLine = null;
- $headers = [];
- $body = '';
-
- // Iterate over each line in the message, accounting for line endings
- $lines = preg_split('/(\\r?\\n)/', $message, -1, PREG_SPLIT_DELIM_CAPTURE);
- for ($i = 0, $totalLines = count($lines); $i < $totalLines; $i += 2) {
-
- $line = $lines[$i];
-
- // If two line breaks were encountered, then this is the end of body
- if (empty($line)) {
- if ($i < $totalLines - 1) {
- $body = implode('', array_slice($lines, $i + 2));
- }
- break;
- }
-
- // Parse message headers
- if (!$startLine) {
- $startLine = explode(' ', $line, 3);
- } elseif (strpos($line, ':')) {
- $parts = explode(':', $line, 2);
- $key = trim($parts[0]);
- $value = isset($parts[1]) ? trim($parts[1]) : '';
- if (!isset($headers[$key])) {
- $headers[$key] = $value;
- } elseif (!is_array($headers[$key])) {
- $headers[$key] = [$headers[$key], $value];
- } else {
- $headers[$key][] = $value;
- }
- }
- }
-
- return [
- 'start_line' => $startLine,
- 'headers' => $headers,
- 'body' => $body
- ];
- }
-
- /**
- * Create URL parts from HTTP message parts
- *
- * @param string $requestUrl Associated URL
- * @param array $parts HTTP message parts
- *
- * @return array
- */
- private function getUrlPartsFromMessage($requestUrl, array $parts)
- {
- // Parse the URL information from the message
- $urlParts = ['path' => $requestUrl, 'scheme' => 'http'];
-
- // Check for the Host header
- if (isset($parts['headers']['Host'])) {
- $urlParts['host'] = $parts['headers']['Host'];
- } elseif (isset($parts['headers']['host'])) {
- $urlParts['host'] = $parts['headers']['host'];
- } else {
- $urlParts['host'] = null;
- }
-
- if (false === strpos($urlParts['host'], ':')) {
- $urlParts['port'] = '';
- } else {
- $hostParts = explode(':', $urlParts['host']);
- $urlParts['host'] = trim($hostParts[0]);
- $urlParts['port'] = (int) trim($hostParts[1]);
- if ($urlParts['port'] == 443) {
- $urlParts['scheme'] = 'https';
- }
- }
-
- // Check if a query is present
- $path = $urlParts['path'];
- $qpos = strpos($path, '?');
- if ($qpos) {
- $urlParts['query'] = substr($path, $qpos + 1);
- $urlParts['path'] = substr($path, 0, $qpos);
- } else {
- $urlParts['query'] = '';
- }
-
- return $urlParts;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Message/Request.php b/lib/gerencianet/guzzlehttp/guzzle/src/Message/Request.php
deleted file mode 100644
index 38714af..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Message/Request.php
+++ /dev/null
@@ -1,195 +0,0 @@
-setUrl($url);
- $this->method = strtoupper($method);
- $this->handleOptions($options);
- $this->transferOptions = new Collection($options);
- $this->addPrepareEvent();
-
- if ($body !== null) {
- $this->setBody($body);
- }
-
- if ($headers) {
- foreach ($headers as $key => $value) {
- $this->addHeader($key, $value);
- }
- }
- }
-
- public function __clone()
- {
- if ($this->emitter) {
- $this->emitter = clone $this->emitter;
- }
- $this->transferOptions = clone $this->transferOptions;
- $this->url = clone $this->url;
- }
-
- public function setUrl($url)
- {
- $this->url = $url instanceof Url ? $url : Url::fromString($url);
- $this->updateHostHeaderFromUrl();
- }
-
- public function getUrl()
- {
- return (string) $this->url;
- }
-
- public function setQuery($query)
- {
- $this->url->setQuery($query);
- }
-
- public function getQuery()
- {
- return $this->url->getQuery();
- }
-
- public function setMethod($method)
- {
- $this->method = strtoupper($method);
- }
-
- public function getMethod()
- {
- return $this->method;
- }
-
- public function getScheme()
- {
- return $this->url->getScheme();
- }
-
- public function setScheme($scheme)
- {
- $this->url->setScheme($scheme);
- }
-
- public function getPort()
- {
- return $this->url->getPort();
- }
-
- public function setPort($port)
- {
- $this->url->setPort($port);
- $this->updateHostHeaderFromUrl();
- }
-
- public function getHost()
- {
- return $this->url->getHost();
- }
-
- public function setHost($host)
- {
- $this->url->setHost($host);
- $this->updateHostHeaderFromUrl();
- }
-
- public function getPath()
- {
- return '/' . ltrim($this->url->getPath(), '/');
- }
-
- public function setPath($path)
- {
- $this->url->setPath($path);
- }
-
- public function getResource()
- {
- $resource = $this->getPath();
- if ($query = (string) $this->url->getQuery()) {
- $resource .= '?' . $query;
- }
-
- return $resource;
- }
-
- public function getConfig()
- {
- return $this->transferOptions;
- }
-
- protected function handleOptions(array &$options)
- {
- parent::handleOptions($options);
- // Use a custom emitter if one is specified, and remove it from
- // options that are exposed through getConfig()
- if (isset($options['emitter'])) {
- $this->emitter = $options['emitter'];
- unset($options['emitter']);
- }
- }
-
- /**
- * Adds a subscriber that ensures a request's body is prepared before
- * sending.
- */
- private function addPrepareEvent()
- {
- static $subscriber;
- if (!$subscriber) {
- $subscriber = new Prepare();
- }
-
- $this->getEmitter()->attach($subscriber);
- }
-
- private function updateHostHeaderFromUrl()
- {
- $port = $this->url->getPort();
- $scheme = $this->url->getScheme();
- if ($host = $this->url->getHost()) {
- if (($port == 80 && $scheme == 'http') ||
- ($port == 443 && $scheme == 'https')
- ) {
- $this->setHeader('Host', $host);
- } else {
- $this->setHeader('Host', "{$host}:{$port}");
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Message/RequestInterface.php b/lib/gerencianet/guzzlehttp/guzzle/src/Message/RequestInterface.php
deleted file mode 100644
index f6a69d1..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Message/RequestInterface.php
+++ /dev/null
@@ -1,136 +0,0 @@
- 'Continue',
- 101 => 'Switching Protocols',
- 102 => 'Processing',
- 200 => 'OK',
- 201 => 'Created',
- 202 => 'Accepted',
- 203 => 'Non-Authoritative Information',
- 204 => 'No Content',
- 205 => 'Reset Content',
- 206 => 'Partial Content',
- 207 => 'Multi-Status',
- 208 => 'Already Reported',
- 226 => 'IM Used',
- 300 => 'Multiple Choices',
- 301 => 'Moved Permanently',
- 302 => 'Found',
- 303 => 'See Other',
- 304 => 'Not Modified',
- 305 => 'Use Proxy',
- 307 => 'Temporary Redirect',
- 308 => 'Permanent Redirect',
- 400 => 'Bad Request',
- 401 => 'Unauthorized',
- 402 => 'Payment Required',
- 403 => 'Forbidden',
- 404 => 'Not Found',
- 405 => 'Method Not Allowed',
- 406 => 'Not Acceptable',
- 407 => 'Proxy Authentication Required',
- 408 => 'Request Timeout',
- 409 => 'Conflict',
- 410 => 'Gone',
- 411 => 'Length Required',
- 412 => 'Precondition Failed',
- 413 => 'Request Entity Too Large',
- 414 => 'Request-URI Too Long',
- 415 => 'Unsupported Media Type',
- 416 => 'Requested Range Not Satisfiable',
- 417 => 'Expectation Failed',
- 422 => 'Unprocessable Entity',
- 423 => 'Locked',
- 424 => 'Failed Dependency',
- 425 => 'Reserved for WebDAV advanced collections expired proposal',
- 426 => 'Upgrade required',
- 428 => 'Precondition Required',
- 429 => 'Too Many Requests',
- 431 => 'Request Header Fields Too Large',
- 500 => 'Internal Server Error',
- 501 => 'Not Implemented',
- 502 => 'Bad Gateway',
- 503 => 'Service Unavailable',
- 504 => 'Gateway Timeout',
- 505 => 'HTTP Version Not Supported',
- 506 => 'Variant Also Negotiates (Experimental)',
- 507 => 'Insufficient Storage',
- 508 => 'Loop Detected',
- 510 => 'Not Extended',
- 511 => 'Network Authentication Required',
- ];
-
- /** @var string The reason phrase of the response (human readable code) */
- private $reasonPhrase;
-
- /** @var string The status code of the response */
- private $statusCode;
-
- /** @var string The effective URL that returned this response */
- private $effectiveUrl;
-
- /**
- * @param int|string $statusCode The response status code (e.g. 200)
- * @param array $headers The response headers
- * @param StreamInterface $body The body of the response
- * @param array $options Response message options
- * - reason_phrase: Set a custom reason phrase
- * - protocol_version: Set a custom protocol version
- */
- public function __construct(
- $statusCode,
- array $headers = [],
- StreamInterface $body = null,
- array $options = []
- ) {
- $this->statusCode = (int) $statusCode;
- $this->handleOptions($options);
-
- // Assume a reason phrase if one was not applied as an option
- if (!$this->reasonPhrase &&
- isset(self::$statusTexts[$this->statusCode])
- ) {
- $this->reasonPhrase = self::$statusTexts[$this->statusCode];
- }
-
- if ($headers) {
- $this->setHeaders($headers);
- }
-
- if ($body) {
- $this->setBody($body);
- }
- }
-
- public function getStatusCode()
- {
- return $this->statusCode;
- }
-
- public function setStatusCode($code)
- {
- return $this->statusCode = (int) $code;
- }
-
- public function getReasonPhrase()
- {
- return $this->reasonPhrase;
- }
-
- public function setReasonPhrase($phrase)
- {
- return $this->reasonPhrase = $phrase;
- }
-
- public function json(array $config = [])
- {
- try {
- return Utils::jsonDecode(
- (string) $this->getBody(),
- isset($config['object']) ? !$config['object'] : true,
- 512,
- isset($config['big_int_strings']) ? JSON_BIGINT_AS_STRING : 0
- );
- } catch (\InvalidArgumentException $e) {
- throw new ParseException(
- $e->getMessage(),
- $this
- );
- }
- }
-
- public function xml(array $config = [])
- {
- $disableEntities = libxml_disable_entity_loader(true);
- $internalErrors = libxml_use_internal_errors(true);
-
- try {
- // Allow XML to be retrieved even if there is no response body
- $xml = new \SimpleXMLElement(
- (string) $this->getBody() ?: ' ',
- isset($config['libxml_options']) ? $config['libxml_options'] : LIBXML_NONET,
- false,
- isset($config['ns']) ? $config['ns'] : '',
- isset($config['ns_is_prefix']) ? $config['ns_is_prefix'] : false
- );
- libxml_disable_entity_loader($disableEntities);
- libxml_use_internal_errors($internalErrors);
- } catch (\Exception $e) {
- libxml_disable_entity_loader($disableEntities);
- libxml_use_internal_errors($internalErrors);
- throw new XmlParseException(
- 'Unable to parse response body into XML: ' . $e->getMessage(),
- $this,
- $e,
- (libxml_get_last_error()) ?: null
- );
- }
-
- return $xml;
- }
-
- public function getEffectiveUrl()
- {
- return $this->effectiveUrl;
- }
-
- public function setEffectiveUrl($url)
- {
- $this->effectiveUrl = $url;
- }
-
- /**
- * Accepts and modifies the options provided to the response in the
- * constructor.
- *
- * @param array $options Options array passed by reference.
- */
- protected function handleOptions(array &$options = [])
- {
- parent::handleOptions($options);
- if (isset($options['reason_phrase'])) {
- $this->reasonPhrase = $options['reason_phrase'];
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Message/ResponseInterface.php b/lib/gerencianet/guzzlehttp/guzzle/src/Message/ResponseInterface.php
deleted file mode 100644
index c0ae9be..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Message/ResponseInterface.php
+++ /dev/null
@@ -1,111 +0,0 @@
->>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}";
+ public const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}';
+
+ /**
+ * @var string Template used to format log messages
+ */
+ private $template;
+
+ /**
+ * @param string $template Log message template
+ */
+ public function __construct(?string $template = self::CLF)
+ {
+ $this->template = $template ?: self::CLF;
+ }
+
+ /**
+ * Returns a formatted message string.
+ *
+ * @param RequestInterface $request Request that was sent
+ * @param ResponseInterface|null $response Response that was received
+ * @param \Throwable|null $error Exception that was received
+ */
+ public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string
+ {
+ $cache = [];
+
+ /** @var string */
+ return \preg_replace_callback(
+ '/{\s*([A-Za-z_\-\.0-9]+)\s*}/',
+ function (array $matches) use ($request, $response, $error, &$cache) {
+ if (isset($cache[$matches[1]])) {
+ return $cache[$matches[1]];
+ }
+
+ $result = '';
+ switch ($matches[1]) {
+ case 'request':
+ $result = Psr7\Message::toString($request);
+ break;
+ case 'response':
+ $result = $response ? Psr7\Message::toString($response) : '';
+ break;
+ case 'req_headers':
+ $result = \trim($request->getMethod()
+ . ' ' . $request->getRequestTarget())
+ . ' HTTP/' . $request->getProtocolVersion() . "\r\n"
+ . $this->headers($request);
+ break;
+ case 'res_headers':
+ $result = $response ?
+ \sprintf(
+ 'HTTP/%s %d %s',
+ $response->getProtocolVersion(),
+ $response->getStatusCode(),
+ $response->getReasonPhrase()
+ ) . "\r\n" . $this->headers($response)
+ : 'NULL';
+ break;
+ case 'req_body':
+ $result = $request->getBody()->__toString();
+ break;
+ case 'res_body':
+ if (!$response instanceof ResponseInterface) {
+ $result = 'NULL';
+ break;
+ }
+
+ $body = $response->getBody();
+
+ if (!$body->isSeekable()) {
+ $result = 'RESPONSE_NOT_LOGGEABLE';
+ break;
+ }
+
+ $result = $response->getBody()->__toString();
+ break;
+ case 'ts':
+ case 'date_iso_8601':
+ $result = \gmdate('c');
+ break;
+ case 'date_common_log':
+ $result = \date('d/M/Y:H:i:s O');
+ break;
+ case 'method':
+ $result = $request->getMethod();
+ break;
+ case 'version':
+ $result = $request->getProtocolVersion();
+ break;
+ case 'uri':
+ case 'url':
+ $result = $request->getUri();
+ break;
+ case 'target':
+ $result = $request->getRequestTarget();
+ break;
+ case 'req_version':
+ $result = $request->getProtocolVersion();
+ break;
+ case 'res_version':
+ $result = $response
+ ? $response->getProtocolVersion()
+ : 'NULL';
+ break;
+ case 'host':
+ $result = $request->getHeaderLine('Host');
+ break;
+ case 'hostname':
+ $result = \gethostname();
+ break;
+ case 'code':
+ $result = $response ? $response->getStatusCode() : 'NULL';
+ break;
+ case 'phrase':
+ $result = $response ? $response->getReasonPhrase() : 'NULL';
+ break;
+ case 'error':
+ $result = $error ? $error->getMessage() : 'NULL';
+ break;
+ default:
+ // handle prefixed dynamic headers
+ if (\strpos($matches[1], 'req_header_') === 0) {
+ $result = $request->getHeaderLine(\substr($matches[1], 11));
+ } elseif (\strpos($matches[1], 'res_header_') === 0) {
+ $result = $response
+ ? $response->getHeaderLine(\substr($matches[1], 11))
+ : 'NULL';
+ }
+ }
+
+ $cache[$matches[1]] = $result;
+ return $result;
+ },
+ $this->template
+ );
+ }
+
+ /**
+ * Get headers from message as string
+ */
+ private function headers(MessageInterface $message): string
+ {
+ $result = '';
+ foreach ($message->getHeaders() as $name => $values) {
+ $result .= $name . ': ' . \implode(', ', $values) . "\r\n";
+ }
+
+ return \trim($result);
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/MessageFormatterInterface.php b/lib/gerencianet/guzzlehttp/guzzle/src/MessageFormatterInterface.php
new file mode 100644
index 0000000..a39ac24
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/MessageFormatterInterface.php
@@ -0,0 +1,18 @@
+withCookieHeader($request);
+ return $handler($request, $options)
+ ->then(
+ static function (ResponseInterface $response) use ($cookieJar, $request): ResponseInterface {
+ $cookieJar->extractCookies($request, $response);
+ return $response;
+ }
+ );
+ };
+ };
+ }
+
+ /**
+ * Middleware that throws exceptions for 4xx or 5xx responses when the
+ * "http_errors" request option is set to true.
+ *
+ * @param BodySummarizerInterface|null $bodySummarizer The body summarizer to use in exception messages.
+ *
+ * @return callable(callable): callable Returns a function that accepts the next handler.
+ */
+ public static function httpErrors(BodySummarizerInterface $bodySummarizer = null): callable
+ {
+ return static function (callable $handler) use ($bodySummarizer): callable {
+ return static function ($request, array $options) use ($handler, $bodySummarizer) {
+ if (empty($options['http_errors'])) {
+ return $handler($request, $options);
+ }
+ return $handler($request, $options)->then(
+ static function (ResponseInterface $response) use ($request, $bodySummarizer) {
+ $code = $response->getStatusCode();
+ if ($code < 400) {
+ return $response;
+ }
+ throw RequestException::create($request, $response, null, [], $bodySummarizer);
+ }
+ );
+ };
+ };
+ }
+
+ /**
+ * Middleware that pushes history data to an ArrayAccess container.
+ *
+ * @param array|\ArrayAccess $container Container to hold the history (by reference).
+ *
+ * @return callable(callable): callable Returns a function that accepts the next handler.
+ *
+ * @throws \InvalidArgumentException if container is not an array or ArrayAccess.
+ */
+ public static function history(&$container): callable
+ {
+ if (!\is_array($container) && !$container instanceof \ArrayAccess) {
+ throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess');
+ }
+
+ return static function (callable $handler) use (&$container): callable {
+ return static function (RequestInterface $request, array $options) use ($handler, &$container) {
+ return $handler($request, $options)->then(
+ static function ($value) use ($request, &$container, $options) {
+ $container[] = [
+ 'request' => $request,
+ 'response' => $value,
+ 'error' => null,
+ 'options' => $options
+ ];
+ return $value;
+ },
+ static function ($reason) use ($request, &$container, $options) {
+ $container[] = [
+ 'request' => $request,
+ 'response' => null,
+ 'error' => $reason,
+ 'options' => $options
+ ];
+ return P\Create::rejectionFor($reason);
+ }
+ );
+ };
+ };
+ }
+
+ /**
+ * Middleware that invokes a callback before and after sending a request.
+ *
+ * The provided listener cannot modify or alter the response. It simply
+ * "taps" into the chain to be notified before returning the promise. The
+ * before listener accepts a request and options array, and the after
+ * listener accepts a request, options array, and response promise.
+ *
+ * @param callable $before Function to invoke before forwarding the request.
+ * @param callable $after Function invoked after forwarding.
+ *
+ * @return callable Returns a function that accepts the next handler.
+ */
+ public static function tap(callable $before = null, callable $after = null): callable
+ {
+ return static function (callable $handler) use ($before, $after): callable {
+ return static function (RequestInterface $request, array $options) use ($handler, $before, $after) {
+ if ($before) {
+ $before($request, $options);
+ }
+ $response = $handler($request, $options);
+ if ($after) {
+ $after($request, $options, $response);
+ }
+ return $response;
+ };
+ };
+ }
+
+ /**
+ * Middleware that handles request redirects.
+ *
+ * @return callable Returns a function that accepts the next handler.
+ */
+ public static function redirect(): callable
+ {
+ return static function (callable $handler): RedirectMiddleware {
+ return new RedirectMiddleware($handler);
+ };
+ }
+
+ /**
+ * Middleware that retries requests based on the boolean result of
+ * invoking the provided "decider" function.
+ *
+ * If no delay function is provided, a simple implementation of exponential
+ * backoff will be utilized.
+ *
+ * @param callable $decider Function that accepts the number of retries,
+ * a request, [response], and [exception] and
+ * returns true if the request is to be retried.
+ * @param callable $delay Function that accepts the number of retries and
+ * returns the number of milliseconds to delay.
+ *
+ * @return callable Returns a function that accepts the next handler.
+ */
+ public static function retry(callable $decider, callable $delay = null): callable
+ {
+ return static function (callable $handler) use ($decider, $delay): RetryMiddleware {
+ return new RetryMiddleware($decider, $handler, $delay);
+ };
+ }
+
+ /**
+ * Middleware that logs requests, responses, and errors using a message
+ * formatter.
+ *
+ * @phpstan-param \Psr\Log\LogLevel::* $logLevel Level at which to log requests.
+ *
+ * @param LoggerInterface $logger Logs messages.
+ * @param MessageFormatterInterface|MessageFormatter $formatter Formatter used to create message strings.
+ * @param string $logLevel Level at which to log requests.
+ *
+ * @return callable Returns a function that accepts the next handler.
+ */
+ public static function log(LoggerInterface $logger, $formatter, string $logLevel = 'info'): callable
+ {
+ // To be compatible with Guzzle 7.1.x we need to allow users to pass a MessageFormatter
+ if (!$formatter instanceof MessageFormatter && !$formatter instanceof MessageFormatterInterface) {
+ throw new \LogicException(sprintf('Argument 2 to %s::log() must be of type %s', self::class, MessageFormatterInterface::class));
+ }
+
+ return static function (callable $handler) use ($logger, $formatter, $logLevel): callable {
+ return static function (RequestInterface $request, array $options = []) use ($handler, $logger, $formatter, $logLevel) {
+ return $handler($request, $options)->then(
+ static function ($response) use ($logger, $request, $formatter, $logLevel): ResponseInterface {
+ $message = $formatter->format($request, $response);
+ $logger->log($logLevel, $message);
+ return $response;
+ },
+ static function ($reason) use ($logger, $request, $formatter): PromiseInterface {
+ $response = $reason instanceof RequestException ? $reason->getResponse() : null;
+ $message = $formatter->format($request, $response, P\Create::exceptionFor($reason));
+ $logger->error($message);
+ return P\Create::rejectionFor($reason);
+ }
+ );
+ };
+ };
+ }
+
+ /**
+ * This middleware adds a default content-type if possible, a default
+ * content-length or transfer-encoding header, and the expect header.
+ */
+ public static function prepareBody(): callable
+ {
+ return static function (callable $handler): PrepareBodyMiddleware {
+ return new PrepareBodyMiddleware($handler);
+ };
+ }
+
+ /**
+ * Middleware that applies a map function to the request before passing to
+ * the next handler.
+ *
+ * @param callable $fn Function that accepts a RequestInterface and returns
+ * a RequestInterface.
+ */
+ public static function mapRequest(callable $fn): callable
+ {
+ return static function (callable $handler) use ($fn): callable {
+ return static function (RequestInterface $request, array $options) use ($handler, $fn) {
+ return $handler($fn($request), $options);
+ };
+ };
+ }
+
+ /**
+ * Middleware that applies a map function to the resolved promise's
+ * response.
+ *
+ * @param callable $fn Function that accepts a ResponseInterface and
+ * returns a ResponseInterface.
+ */
+ public static function mapResponse(callable $fn): callable
+ {
+ return static function (callable $handler) use ($fn): callable {
+ return static function (RequestInterface $request, array $options) use ($handler, $fn) {
+ return $handler($request, $options)->then($fn);
+ };
+ };
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Mimetypes.php b/lib/gerencianet/guzzlehttp/guzzle/src/Mimetypes.php
deleted file mode 100644
index 66ac63c..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Mimetypes.php
+++ /dev/null
@@ -1,963 +0,0 @@
- 'text/vnd.in3d.3dml',
- '3g2' => 'video/3gpp2',
- '3gp' => 'video/3gpp',
- '7z' => 'application/x-7z-compressed',
- 'aab' => 'application/x-authorware-bin',
- 'aac' => 'audio/x-aac',
- 'aam' => 'application/x-authorware-map',
- 'aas' => 'application/x-authorware-seg',
- 'abw' => 'application/x-abiword',
- 'ac' => 'application/pkix-attr-cert',
- 'acc' => 'application/vnd.americandynamics.acc',
- 'ace' => 'application/x-ace-compressed',
- 'acu' => 'application/vnd.acucobol',
- 'acutc' => 'application/vnd.acucorp',
- 'adp' => 'audio/adpcm',
- 'aep' => 'application/vnd.audiograph',
- 'afm' => 'application/x-font-type1',
- 'afp' => 'application/vnd.ibm.modcap',
- 'ahead' => 'application/vnd.ahead.space',
- 'ai' => 'application/postscript',
- 'aif' => 'audio/x-aiff',
- 'aifc' => 'audio/x-aiff',
- 'aiff' => 'audio/x-aiff',
- 'air' => 'application/vnd.adobe.air-application-installer-package+zip',
- 'ait' => 'application/vnd.dvb.ait',
- 'ami' => 'application/vnd.amiga.ami',
- 'apk' => 'application/vnd.android.package-archive',
- 'application' => 'application/x-ms-application',
- 'apr' => 'application/vnd.lotus-approach',
- 'asa' => 'text/plain',
- 'asax' => 'application/octet-stream',
- 'asc' => 'application/pgp-signature',
- 'ascx' => 'text/plain',
- 'asf' => 'video/x-ms-asf',
- 'ashx' => 'text/plain',
- 'asm' => 'text/x-asm',
- 'asmx' => 'text/plain',
- 'aso' => 'application/vnd.accpac.simply.aso',
- 'asp' => 'text/plain',
- 'aspx' => 'text/plain',
- 'asx' => 'video/x-ms-asf',
- 'atc' => 'application/vnd.acucorp',
- 'atom' => 'application/atom+xml',
- 'atomcat' => 'application/atomcat+xml',
- 'atomsvc' => 'application/atomsvc+xml',
- 'atx' => 'application/vnd.antix.game-component',
- 'au' => 'audio/basic',
- 'avi' => 'video/x-msvideo',
- 'aw' => 'application/applixware',
- 'axd' => 'text/plain',
- 'azf' => 'application/vnd.airzip.filesecure.azf',
- 'azs' => 'application/vnd.airzip.filesecure.azs',
- 'azw' => 'application/vnd.amazon.ebook',
- 'bat' => 'application/x-msdownload',
- 'bcpio' => 'application/x-bcpio',
- 'bdf' => 'application/x-font-bdf',
- 'bdm' => 'application/vnd.syncml.dm+wbxml',
- 'bed' => 'application/vnd.realvnc.bed',
- 'bh2' => 'application/vnd.fujitsu.oasysprs',
- 'bin' => 'application/octet-stream',
- 'bmi' => 'application/vnd.bmi',
- 'bmp' => 'image/bmp',
- 'book' => 'application/vnd.framemaker',
- 'box' => 'application/vnd.previewsystems.box',
- 'boz' => 'application/x-bzip2',
- 'bpk' => 'application/octet-stream',
- 'btif' => 'image/prs.btif',
- 'bz' => 'application/x-bzip',
- 'bz2' => 'application/x-bzip2',
- 'c' => 'text/x-c',
- 'c11amc' => 'application/vnd.cluetrust.cartomobile-config',
- 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg',
- 'c4d' => 'application/vnd.clonk.c4group',
- 'c4f' => 'application/vnd.clonk.c4group',
- 'c4g' => 'application/vnd.clonk.c4group',
- 'c4p' => 'application/vnd.clonk.c4group',
- 'c4u' => 'application/vnd.clonk.c4group',
- 'cab' => 'application/vnd.ms-cab-compressed',
- 'car' => 'application/vnd.curl.car',
- 'cat' => 'application/vnd.ms-pki.seccat',
- 'cc' => 'text/x-c',
- 'cct' => 'application/x-director',
- 'ccxml' => 'application/ccxml+xml',
- 'cdbcmsg' => 'application/vnd.contact.cmsg',
- 'cdf' => 'application/x-netcdf',
- 'cdkey' => 'application/vnd.mediastation.cdkey',
- 'cdmia' => 'application/cdmi-capability',
- 'cdmic' => 'application/cdmi-container',
- 'cdmid' => 'application/cdmi-domain',
- 'cdmio' => 'application/cdmi-object',
- 'cdmiq' => 'application/cdmi-queue',
- 'cdx' => 'chemical/x-cdx',
- 'cdxml' => 'application/vnd.chemdraw+xml',
- 'cdy' => 'application/vnd.cinderella',
- 'cer' => 'application/pkix-cert',
- 'cfc' => 'application/x-coldfusion',
- 'cfm' => 'application/x-coldfusion',
- 'cgm' => 'image/cgm',
- 'chat' => 'application/x-chat',
- 'chm' => 'application/vnd.ms-htmlhelp',
- 'chrt' => 'application/vnd.kde.kchart',
- 'cif' => 'chemical/x-cif',
- 'cii' => 'application/vnd.anser-web-certificate-issue-initiation',
- 'cil' => 'application/vnd.ms-artgalry',
- 'cla' => 'application/vnd.claymore',
- 'class' => 'application/java-vm',
- 'clkk' => 'application/vnd.crick.clicker.keyboard',
- 'clkp' => 'application/vnd.crick.clicker.palette',
- 'clkt' => 'application/vnd.crick.clicker.template',
- 'clkw' => 'application/vnd.crick.clicker.wordbank',
- 'clkx' => 'application/vnd.crick.clicker',
- 'clp' => 'application/x-msclip',
- 'cmc' => 'application/vnd.cosmocaller',
- 'cmdf' => 'chemical/x-cmdf',
- 'cml' => 'chemical/x-cml',
- 'cmp' => 'application/vnd.yellowriver-custom-menu',
- 'cmx' => 'image/x-cmx',
- 'cod' => 'application/vnd.rim.cod',
- 'com' => 'application/x-msdownload',
- 'conf' => 'text/plain',
- 'cpio' => 'application/x-cpio',
- 'cpp' => 'text/x-c',
- 'cpt' => 'application/mac-compactpro',
- 'crd' => 'application/x-mscardfile',
- 'crl' => 'application/pkix-crl',
- 'crt' => 'application/x-x509-ca-cert',
- 'cryptonote' => 'application/vnd.rig.cryptonote',
- 'cs' => 'text/plain',
- 'csh' => 'application/x-csh',
- 'csml' => 'chemical/x-csml',
- 'csp' => 'application/vnd.commonspace',
- 'css' => 'text/css',
- 'cst' => 'application/x-director',
- 'csv' => 'text/csv',
- 'cu' => 'application/cu-seeme',
- 'curl' => 'text/vnd.curl',
- 'cww' => 'application/prs.cww',
- 'cxt' => 'application/x-director',
- 'cxx' => 'text/x-c',
- 'dae' => 'model/vnd.collada+xml',
- 'daf' => 'application/vnd.mobius.daf',
- 'dataless' => 'application/vnd.fdsn.seed',
- 'davmount' => 'application/davmount+xml',
- 'dcr' => 'application/x-director',
- 'dcurl' => 'text/vnd.curl.dcurl',
- 'dd2' => 'application/vnd.oma.dd2+xml',
- 'ddd' => 'application/vnd.fujixerox.ddd',
- 'deb' => 'application/x-debian-package',
- 'def' => 'text/plain',
- 'deploy' => 'application/octet-stream',
- 'der' => 'application/x-x509-ca-cert',
- 'dfac' => 'application/vnd.dreamfactory',
- 'dic' => 'text/x-c',
- 'dir' => 'application/x-director',
- 'dis' => 'application/vnd.mobius.dis',
- 'dist' => 'application/octet-stream',
- 'distz' => 'application/octet-stream',
- 'djv' => 'image/vnd.djvu',
- 'djvu' => 'image/vnd.djvu',
- 'dll' => 'application/x-msdownload',
- 'dmg' => 'application/octet-stream',
- 'dms' => 'application/octet-stream',
- 'dna' => 'application/vnd.dna',
- 'doc' => 'application/msword',
- 'docm' => 'application/vnd.ms-word.document.macroenabled.12',
- 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
- 'dot' => 'application/msword',
- 'dotm' => 'application/vnd.ms-word.template.macroenabled.12',
- 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
- 'dp' => 'application/vnd.osgi.dp',
- 'dpg' => 'application/vnd.dpgraph',
- 'dra' => 'audio/vnd.dra',
- 'dsc' => 'text/prs.lines.tag',
- 'dssc' => 'application/dssc+der',
- 'dtb' => 'application/x-dtbook+xml',
- 'dtd' => 'application/xml-dtd',
- 'dts' => 'audio/vnd.dts',
- 'dtshd' => 'audio/vnd.dts.hd',
- 'dump' => 'application/octet-stream',
- 'dvi' => 'application/x-dvi',
- 'dwf' => 'model/vnd.dwf',
- 'dwg' => 'image/vnd.dwg',
- 'dxf' => 'image/vnd.dxf',
- 'dxp' => 'application/vnd.spotfire.dxp',
- 'dxr' => 'application/x-director',
- 'ecelp4800' => 'audio/vnd.nuera.ecelp4800',
- 'ecelp7470' => 'audio/vnd.nuera.ecelp7470',
- 'ecelp9600' => 'audio/vnd.nuera.ecelp9600',
- 'ecma' => 'application/ecmascript',
- 'edm' => 'application/vnd.novadigm.edm',
- 'edx' => 'application/vnd.novadigm.edx',
- 'efif' => 'application/vnd.picsel',
- 'ei6' => 'application/vnd.pg.osasli',
- 'elc' => 'application/octet-stream',
- 'eml' => 'message/rfc822',
- 'emma' => 'application/emma+xml',
- 'eol' => 'audio/vnd.digital-winds',
- 'eot' => 'application/vnd.ms-fontobject',
- 'eps' => 'application/postscript',
- 'epub' => 'application/epub+zip',
- 'es3' => 'application/vnd.eszigno3+xml',
- 'esf' => 'application/vnd.epson.esf',
- 'et3' => 'application/vnd.eszigno3+xml',
- 'etx' => 'text/x-setext',
- 'exe' => 'application/x-msdownload',
- 'exi' => 'application/exi',
- 'ext' => 'application/vnd.novadigm.ext',
- 'ez' => 'application/andrew-inset',
- 'ez2' => 'application/vnd.ezpix-album',
- 'ez3' => 'application/vnd.ezpix-package',
- 'f' => 'text/x-fortran',
- 'f4v' => 'video/x-f4v',
- 'f77' => 'text/x-fortran',
- 'f90' => 'text/x-fortran',
- 'fbs' => 'image/vnd.fastbidsheet',
- 'fcs' => 'application/vnd.isac.fcs',
- 'fdf' => 'application/vnd.fdf',
- 'fe_launch' => 'application/vnd.denovo.fcselayout-link',
- 'fg5' => 'application/vnd.fujitsu.oasysgp',
- 'fgd' => 'application/x-director',
- 'fh' => 'image/x-freehand',
- 'fh4' => 'image/x-freehand',
- 'fh5' => 'image/x-freehand',
- 'fh7' => 'image/x-freehand',
- 'fhc' => 'image/x-freehand',
- 'fig' => 'application/x-xfig',
- 'fli' => 'video/x-fli',
- 'flo' => 'application/vnd.micrografx.flo',
- 'flv' => 'video/x-flv',
- 'flw' => 'application/vnd.kde.kivio',
- 'flx' => 'text/vnd.fmi.flexstor',
- 'fly' => 'text/vnd.fly',
- 'fm' => 'application/vnd.framemaker',
- 'fnc' => 'application/vnd.frogans.fnc',
- 'for' => 'text/x-fortran',
- 'fpx' => 'image/vnd.fpx',
- 'frame' => 'application/vnd.framemaker',
- 'fsc' => 'application/vnd.fsc.weblaunch',
- 'fst' => 'image/vnd.fst',
- 'ftc' => 'application/vnd.fluxtime.clip',
- 'fti' => 'application/vnd.anser-web-funds-transfer-initiation',
- 'fvt' => 'video/vnd.fvt',
- 'fxp' => 'application/vnd.adobe.fxp',
- 'fxpl' => 'application/vnd.adobe.fxp',
- 'fzs' => 'application/vnd.fuzzysheet',
- 'g2w' => 'application/vnd.geoplan',
- 'g3' => 'image/g3fax',
- 'g3w' => 'application/vnd.geospace',
- 'gac' => 'application/vnd.groove-account',
- 'gdl' => 'model/vnd.gdl',
- 'geo' => 'application/vnd.dynageo',
- 'gex' => 'application/vnd.geometry-explorer',
- 'ggb' => 'application/vnd.geogebra.file',
- 'ggt' => 'application/vnd.geogebra.tool',
- 'ghf' => 'application/vnd.groove-help',
- 'gif' => 'image/gif',
- 'gim' => 'application/vnd.groove-identity-message',
- 'gmx' => 'application/vnd.gmx',
- 'gnumeric' => 'application/x-gnumeric',
- 'gph' => 'application/vnd.flographit',
- 'gqf' => 'application/vnd.grafeq',
- 'gqs' => 'application/vnd.grafeq',
- 'gram' => 'application/srgs',
- 'gre' => 'application/vnd.geometry-explorer',
- 'grv' => 'application/vnd.groove-injector',
- 'grxml' => 'application/srgs+xml',
- 'gsf' => 'application/x-font-ghostscript',
- 'gtar' => 'application/x-gtar',
- 'gtm' => 'application/vnd.groove-tool-message',
- 'gtw' => 'model/vnd.gtw',
- 'gv' => 'text/vnd.graphviz',
- 'gxt' => 'application/vnd.geonext',
- 'h' => 'text/x-c',
- 'h261' => 'video/h261',
- 'h263' => 'video/h263',
- 'h264' => 'video/h264',
- 'hal' => 'application/vnd.hal+xml',
- 'hbci' => 'application/vnd.hbci',
- 'hdf' => 'application/x-hdf',
- 'hh' => 'text/x-c',
- 'hlp' => 'application/winhlp',
- 'hpgl' => 'application/vnd.hp-hpgl',
- 'hpid' => 'application/vnd.hp-hpid',
- 'hps' => 'application/vnd.hp-hps',
- 'hqx' => 'application/mac-binhex40',
- 'hta' => 'application/octet-stream',
- 'htc' => 'text/html',
- 'htke' => 'application/vnd.kenameaapp',
- 'htm' => 'text/html',
- 'html' => 'text/html',
- 'hvd' => 'application/vnd.yamaha.hv-dic',
- 'hvp' => 'application/vnd.yamaha.hv-voice',
- 'hvs' => 'application/vnd.yamaha.hv-script',
- 'i2g' => 'application/vnd.intergeo',
- 'icc' => 'application/vnd.iccprofile',
- 'ice' => 'x-conference/x-cooltalk',
- 'icm' => 'application/vnd.iccprofile',
- 'ico' => 'image/x-icon',
- 'ics' => 'text/calendar',
- 'ief' => 'image/ief',
- 'ifb' => 'text/calendar',
- 'ifm' => 'application/vnd.shana.informed.formdata',
- 'iges' => 'model/iges',
- 'igl' => 'application/vnd.igloader',
- 'igm' => 'application/vnd.insors.igm',
- 'igs' => 'model/iges',
- 'igx' => 'application/vnd.micrografx.igx',
- 'iif' => 'application/vnd.shana.informed.interchange',
- 'imp' => 'application/vnd.accpac.simply.imp',
- 'ims' => 'application/vnd.ms-ims',
- 'in' => 'text/plain',
- 'ini' => 'text/plain',
- 'ipfix' => 'application/ipfix',
- 'ipk' => 'application/vnd.shana.informed.package',
- 'irm' => 'application/vnd.ibm.rights-management',
- 'irp' => 'application/vnd.irepository.package+xml',
- 'iso' => 'application/octet-stream',
- 'itp' => 'application/vnd.shana.informed.formtemplate',
- 'ivp' => 'application/vnd.immervision-ivp',
- 'ivu' => 'application/vnd.immervision-ivu',
- 'jad' => 'text/vnd.sun.j2me.app-descriptor',
- 'jam' => 'application/vnd.jam',
- 'jar' => 'application/java-archive',
- 'java' => 'text/x-java-source',
- 'jisp' => 'application/vnd.jisp',
- 'jlt' => 'application/vnd.hp-jlyt',
- 'jnlp' => 'application/x-java-jnlp-file',
- 'joda' => 'application/vnd.joost.joda-archive',
- 'jpe' => 'image/jpeg',
- 'jpeg' => 'image/jpeg',
- 'jpg' => 'image/jpeg',
- 'jpgm' => 'video/jpm',
- 'jpgv' => 'video/jpeg',
- 'jpm' => 'video/jpm',
- 'js' => 'text/javascript',
- 'json' => 'application/json',
- 'kar' => 'audio/midi',
- 'karbon' => 'application/vnd.kde.karbon',
- 'kfo' => 'application/vnd.kde.kformula',
- 'kia' => 'application/vnd.kidspiration',
- 'kml' => 'application/vnd.google-earth.kml+xml',
- 'kmz' => 'application/vnd.google-earth.kmz',
- 'kne' => 'application/vnd.kinar',
- 'knp' => 'application/vnd.kinar',
- 'kon' => 'application/vnd.kde.kontour',
- 'kpr' => 'application/vnd.kde.kpresenter',
- 'kpt' => 'application/vnd.kde.kpresenter',
- 'ksp' => 'application/vnd.kde.kspread',
- 'ktr' => 'application/vnd.kahootz',
- 'ktx' => 'image/ktx',
- 'ktz' => 'application/vnd.kahootz',
- 'kwd' => 'application/vnd.kde.kword',
- 'kwt' => 'application/vnd.kde.kword',
- 'lasxml' => 'application/vnd.las.las+xml',
- 'latex' => 'application/x-latex',
- 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop',
- 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml',
- 'les' => 'application/vnd.hhe.lesson-player',
- 'lha' => 'application/octet-stream',
- 'link66' => 'application/vnd.route66.link66+xml',
- 'list' => 'text/plain',
- 'list3820' => 'application/vnd.ibm.modcap',
- 'listafp' => 'application/vnd.ibm.modcap',
- 'log' => 'text/plain',
- 'lostxml' => 'application/lost+xml',
- 'lrf' => 'application/octet-stream',
- 'lrm' => 'application/vnd.ms-lrm',
- 'ltf' => 'application/vnd.frogans.ltf',
- 'lvp' => 'audio/vnd.lucent.voice',
- 'lwp' => 'application/vnd.lotus-wordpro',
- 'lzh' => 'application/octet-stream',
- 'm13' => 'application/x-msmediaview',
- 'm14' => 'application/x-msmediaview',
- 'm1v' => 'video/mpeg',
- 'm21' => 'application/mp21',
- 'm2a' => 'audio/mpeg',
- 'm2v' => 'video/mpeg',
- 'm3a' => 'audio/mpeg',
- 'm3u' => 'audio/x-mpegurl',
- 'm3u8' => 'application/vnd.apple.mpegurl',
- 'm4a' => 'audio/mp4',
- 'm4u' => 'video/vnd.mpegurl',
- 'm4v' => 'video/mp4',
- 'ma' => 'application/mathematica',
- 'mads' => 'application/mads+xml',
- 'mag' => 'application/vnd.ecowin.chart',
- 'maker' => 'application/vnd.framemaker',
- 'man' => 'text/troff',
- 'mathml' => 'application/mathml+xml',
- 'mb' => 'application/mathematica',
- 'mbk' => 'application/vnd.mobius.mbk',
- 'mbox' => 'application/mbox',
- 'mc1' => 'application/vnd.medcalcdata',
- 'mcd' => 'application/vnd.mcd',
- 'mcurl' => 'text/vnd.curl.mcurl',
- 'mdb' => 'application/x-msaccess',
- 'mdi' => 'image/vnd.ms-modi',
- 'me' => 'text/troff',
- 'mesh' => 'model/mesh',
- 'meta4' => 'application/metalink4+xml',
- 'mets' => 'application/mets+xml',
- 'mfm' => 'application/vnd.mfmp',
- 'mgp' => 'application/vnd.osgeo.mapguide.package',
- 'mgz' => 'application/vnd.proteus.magazine',
- 'mid' => 'audio/midi',
- 'midi' => 'audio/midi',
- 'mif' => 'application/vnd.mif',
- 'mime' => 'message/rfc822',
- 'mj2' => 'video/mj2',
- 'mjp2' => 'video/mj2',
- 'mlp' => 'application/vnd.dolby.mlp',
- 'mmd' => 'application/vnd.chipnuts.karaoke-mmd',
- 'mmf' => 'application/vnd.smaf',
- 'mmr' => 'image/vnd.fujixerox.edmics-mmr',
- 'mny' => 'application/x-msmoney',
- 'mobi' => 'application/x-mobipocket-ebook',
- 'mods' => 'application/mods+xml',
- 'mov' => 'video/quicktime',
- 'movie' => 'video/x-sgi-movie',
- 'mp2' => 'audio/mpeg',
- 'mp21' => 'application/mp21',
- 'mp2a' => 'audio/mpeg',
- 'mp3' => 'audio/mpeg',
- 'mp4' => 'video/mp4',
- 'mp4a' => 'audio/mp4',
- 'mp4s' => 'application/mp4',
- 'mp4v' => 'video/mp4',
- 'mpc' => 'application/vnd.mophun.certificate',
- 'mpe' => 'video/mpeg',
- 'mpeg' => 'video/mpeg',
- 'mpg' => 'video/mpeg',
- 'mpg4' => 'video/mp4',
- 'mpga' => 'audio/mpeg',
- 'mpkg' => 'application/vnd.apple.installer+xml',
- 'mpm' => 'application/vnd.blueice.multipass',
- 'mpn' => 'application/vnd.mophun.application',
- 'mpp' => 'application/vnd.ms-project',
- 'mpt' => 'application/vnd.ms-project',
- 'mpy' => 'application/vnd.ibm.minipay',
- 'mqy' => 'application/vnd.mobius.mqy',
- 'mrc' => 'application/marc',
- 'mrcx' => 'application/marcxml+xml',
- 'ms' => 'text/troff',
- 'mscml' => 'application/mediaservercontrol+xml',
- 'mseed' => 'application/vnd.fdsn.mseed',
- 'mseq' => 'application/vnd.mseq',
- 'msf' => 'application/vnd.epson.msf',
- 'msh' => 'model/mesh',
- 'msi' => 'application/x-msdownload',
- 'msl' => 'application/vnd.mobius.msl',
- 'msty' => 'application/vnd.muvee.style',
- 'mts' => 'model/vnd.mts',
- 'mus' => 'application/vnd.musician',
- 'musicxml' => 'application/vnd.recordare.musicxml+xml',
- 'mvb' => 'application/x-msmediaview',
- 'mwf' => 'application/vnd.mfer',
- 'mxf' => 'application/mxf',
- 'mxl' => 'application/vnd.recordare.musicxml',
- 'mxml' => 'application/xv+xml',
- 'mxs' => 'application/vnd.triscape.mxs',
- 'mxu' => 'video/vnd.mpegurl',
- 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install',
- 'n3' => 'text/n3',
- 'nb' => 'application/mathematica',
- 'nbp' => 'application/vnd.wolfram.player',
- 'nc' => 'application/x-netcdf',
- 'ncx' => 'application/x-dtbncx+xml',
- 'ngdat' => 'application/vnd.nokia.n-gage.data',
- 'nlu' => 'application/vnd.neurolanguage.nlu',
- 'nml' => 'application/vnd.enliven',
- 'nnd' => 'application/vnd.noblenet-directory',
- 'nns' => 'application/vnd.noblenet-sealer',
- 'nnw' => 'application/vnd.noblenet-web',
- 'npx' => 'image/vnd.net-fpx',
- 'nsf' => 'application/vnd.lotus-notes',
- 'oa2' => 'application/vnd.fujitsu.oasys2',
- 'oa3' => 'application/vnd.fujitsu.oasys3',
- 'oas' => 'application/vnd.fujitsu.oasys',
- 'obd' => 'application/x-msbinder',
- 'oda' => 'application/oda',
- 'odb' => 'application/vnd.oasis.opendocument.database',
- 'odc' => 'application/vnd.oasis.opendocument.chart',
- 'odf' => 'application/vnd.oasis.opendocument.formula',
- 'odft' => 'application/vnd.oasis.opendocument.formula-template',
- 'odg' => 'application/vnd.oasis.opendocument.graphics',
- 'odi' => 'application/vnd.oasis.opendocument.image',
- 'odm' => 'application/vnd.oasis.opendocument.text-master',
- 'odp' => 'application/vnd.oasis.opendocument.presentation',
- 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
- 'odt' => 'application/vnd.oasis.opendocument.text',
- 'oga' => 'audio/ogg',
- 'ogg' => 'audio/ogg',
- 'ogv' => 'video/ogg',
- 'ogx' => 'application/ogg',
- 'onepkg' => 'application/onenote',
- 'onetmp' => 'application/onenote',
- 'onetoc' => 'application/onenote',
- 'onetoc2' => 'application/onenote',
- 'opf' => 'application/oebps-package+xml',
- 'oprc' => 'application/vnd.palm',
- 'org' => 'application/vnd.lotus-organizer',
- 'osf' => 'application/vnd.yamaha.openscoreformat',
- 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml',
- 'otc' => 'application/vnd.oasis.opendocument.chart-template',
- 'otf' => 'application/x-font-otf',
- 'otg' => 'application/vnd.oasis.opendocument.graphics-template',
- 'oth' => 'application/vnd.oasis.opendocument.text-web',
- 'oti' => 'application/vnd.oasis.opendocument.image-template',
- 'otp' => 'application/vnd.oasis.opendocument.presentation-template',
- 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
- 'ott' => 'application/vnd.oasis.opendocument.text-template',
- 'oxt' => 'application/vnd.openofficeorg.extension',
- 'p' => 'text/x-pascal',
- 'p10' => 'application/pkcs10',
- 'p12' => 'application/x-pkcs12',
- 'p7b' => 'application/x-pkcs7-certificates',
- 'p7c' => 'application/pkcs7-mime',
- 'p7m' => 'application/pkcs7-mime',
- 'p7r' => 'application/x-pkcs7-certreqresp',
- 'p7s' => 'application/pkcs7-signature',
- 'p8' => 'application/pkcs8',
- 'pas' => 'text/x-pascal',
- 'paw' => 'application/vnd.pawaafile',
- 'pbd' => 'application/vnd.powerbuilder6',
- 'pbm' => 'image/x-portable-bitmap',
- 'pcf' => 'application/x-font-pcf',
- 'pcl' => 'application/vnd.hp-pcl',
- 'pclxl' => 'application/vnd.hp-pclxl',
- 'pct' => 'image/x-pict',
- 'pcurl' => 'application/vnd.curl.pcurl',
- 'pcx' => 'image/x-pcx',
- 'pdb' => 'application/vnd.palm',
- 'pdf' => 'application/pdf',
- 'pfa' => 'application/x-font-type1',
- 'pfb' => 'application/x-font-type1',
- 'pfm' => 'application/x-font-type1',
- 'pfr' => 'application/font-tdpfr',
- 'pfx' => 'application/x-pkcs12',
- 'pgm' => 'image/x-portable-graymap',
- 'pgn' => 'application/x-chess-pgn',
- 'pgp' => 'application/pgp-encrypted',
- 'php' => 'text/x-php',
- 'phps' => 'application/x-httpd-phps',
- 'pic' => 'image/x-pict',
- 'pkg' => 'application/octet-stream',
- 'pki' => 'application/pkixcmp',
- 'pkipath' => 'application/pkix-pkipath',
- 'plb' => 'application/vnd.3gpp.pic-bw-large',
- 'plc' => 'application/vnd.mobius.plc',
- 'plf' => 'application/vnd.pocketlearn',
- 'pls' => 'application/pls+xml',
- 'pml' => 'application/vnd.ctc-posml',
- 'png' => 'image/png',
- 'pnm' => 'image/x-portable-anymap',
- 'portpkg' => 'application/vnd.macports.portpkg',
- 'pot' => 'application/vnd.ms-powerpoint',
- 'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12',
- 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
- 'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12',
- 'ppd' => 'application/vnd.cups-ppd',
- 'ppm' => 'image/x-portable-pixmap',
- 'pps' => 'application/vnd.ms-powerpoint',
- 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12',
- 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
- 'ppt' => 'application/vnd.ms-powerpoint',
- 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12',
- 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
- 'pqa' => 'application/vnd.palm',
- 'prc' => 'application/x-mobipocket-ebook',
- 'pre' => 'application/vnd.lotus-freelance',
- 'prf' => 'application/pics-rules',
- 'ps' => 'application/postscript',
- 'psb' => 'application/vnd.3gpp.pic-bw-small',
- 'psd' => 'image/vnd.adobe.photoshop',
- 'psf' => 'application/x-font-linux-psf',
- 'pskcxml' => 'application/pskc+xml',
- 'ptid' => 'application/vnd.pvi.ptid1',
- 'pub' => 'application/x-mspublisher',
- 'pvb' => 'application/vnd.3gpp.pic-bw-var',
- 'pwn' => 'application/vnd.3m.post-it-notes',
- 'pya' => 'audio/vnd.ms-playready.media.pya',
- 'pyv' => 'video/vnd.ms-playready.media.pyv',
- 'qam' => 'application/vnd.epson.quickanime',
- 'qbo' => 'application/vnd.intu.qbo',
- 'qfx' => 'application/vnd.intu.qfx',
- 'qps' => 'application/vnd.publishare-delta-tree',
- 'qt' => 'video/quicktime',
- 'qwd' => 'application/vnd.quark.quarkxpress',
- 'qwt' => 'application/vnd.quark.quarkxpress',
- 'qxb' => 'application/vnd.quark.quarkxpress',
- 'qxd' => 'application/vnd.quark.quarkxpress',
- 'qxl' => 'application/vnd.quark.quarkxpress',
- 'qxt' => 'application/vnd.quark.quarkxpress',
- 'ra' => 'audio/x-pn-realaudio',
- 'ram' => 'audio/x-pn-realaudio',
- 'rar' => 'application/x-rar-compressed',
- 'ras' => 'image/x-cmu-raster',
- 'rb' => 'text/plain',
- 'rcprofile' => 'application/vnd.ipunplugged.rcprofile',
- 'rdf' => 'application/rdf+xml',
- 'rdz' => 'application/vnd.data-vision.rdz',
- 'rep' => 'application/vnd.businessobjects',
- 'res' => 'application/x-dtbresource+xml',
- 'resx' => 'text/xml',
- 'rgb' => 'image/x-rgb',
- 'rif' => 'application/reginfo+xml',
- 'rip' => 'audio/vnd.rip',
- 'rl' => 'application/resource-lists+xml',
- 'rlc' => 'image/vnd.fujixerox.edmics-rlc',
- 'rld' => 'application/resource-lists-diff+xml',
- 'rm' => 'application/vnd.rn-realmedia',
- 'rmi' => 'audio/midi',
- 'rmp' => 'audio/x-pn-realaudio-plugin',
- 'rms' => 'application/vnd.jcp.javame.midlet-rms',
- 'rnc' => 'application/relax-ng-compact-syntax',
- 'roff' => 'text/troff',
- 'rp9' => 'application/vnd.cloanto.rp9',
- 'rpss' => 'application/vnd.nokia.radio-presets',
- 'rpst' => 'application/vnd.nokia.radio-preset',
- 'rq' => 'application/sparql-query',
- 'rs' => 'application/rls-services+xml',
- 'rsd' => 'application/rsd+xml',
- 'rss' => 'application/rss+xml',
- 'rtf' => 'application/rtf',
- 'rtx' => 'text/richtext',
- 's' => 'text/x-asm',
- 'saf' => 'application/vnd.yamaha.smaf-audio',
- 'sbml' => 'application/sbml+xml',
- 'sc' => 'application/vnd.ibm.secure-container',
- 'scd' => 'application/x-msschedule',
- 'scm' => 'application/vnd.lotus-screencam',
- 'scq' => 'application/scvp-cv-request',
- 'scs' => 'application/scvp-cv-response',
- 'scurl' => 'text/vnd.curl.scurl',
- 'sda' => 'application/vnd.stardivision.draw',
- 'sdc' => 'application/vnd.stardivision.calc',
- 'sdd' => 'application/vnd.stardivision.impress',
- 'sdkd' => 'application/vnd.solent.sdkm+xml',
- 'sdkm' => 'application/vnd.solent.sdkm+xml',
- 'sdp' => 'application/sdp',
- 'sdw' => 'application/vnd.stardivision.writer',
- 'see' => 'application/vnd.seemail',
- 'seed' => 'application/vnd.fdsn.seed',
- 'sema' => 'application/vnd.sema',
- 'semd' => 'application/vnd.semd',
- 'semf' => 'application/vnd.semf',
- 'ser' => 'application/java-serialized-object',
- 'setpay' => 'application/set-payment-initiation',
- 'setreg' => 'application/set-registration-initiation',
- 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data',
- 'sfs' => 'application/vnd.spotfire.sfs',
- 'sgl' => 'application/vnd.stardivision.writer-global',
- 'sgm' => 'text/sgml',
- 'sgml' => 'text/sgml',
- 'sh' => 'application/x-sh',
- 'shar' => 'application/x-shar',
- 'shf' => 'application/shf+xml',
- 'sig' => 'application/pgp-signature',
- 'silo' => 'model/mesh',
- 'sis' => 'application/vnd.symbian.install',
- 'sisx' => 'application/vnd.symbian.install',
- 'sit' => 'application/x-stuffit',
- 'sitx' => 'application/x-stuffitx',
- 'skd' => 'application/vnd.koan',
- 'skm' => 'application/vnd.koan',
- 'skp' => 'application/vnd.koan',
- 'skt' => 'application/vnd.koan',
- 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12',
- 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
- 'slt' => 'application/vnd.epson.salt',
- 'sm' => 'application/vnd.stepmania.stepchart',
- 'smf' => 'application/vnd.stardivision.math',
- 'smi' => 'application/smil+xml',
- 'smil' => 'application/smil+xml',
- 'snd' => 'audio/basic',
- 'snf' => 'application/x-font-snf',
- 'so' => 'application/octet-stream',
- 'spc' => 'application/x-pkcs7-certificates',
- 'spf' => 'application/vnd.yamaha.smaf-phrase',
- 'spl' => 'application/x-futuresplash',
- 'spot' => 'text/vnd.in3d.spot',
- 'spp' => 'application/scvp-vp-response',
- 'spq' => 'application/scvp-vp-request',
- 'spx' => 'audio/ogg',
- 'src' => 'application/x-wais-source',
- 'sru' => 'application/sru+xml',
- 'srx' => 'application/sparql-results+xml',
- 'sse' => 'application/vnd.kodak-descriptor',
- 'ssf' => 'application/vnd.epson.ssf',
- 'ssml' => 'application/ssml+xml',
- 'st' => 'application/vnd.sailingtracker.track',
- 'stc' => 'application/vnd.sun.xml.calc.template',
- 'std' => 'application/vnd.sun.xml.draw.template',
- 'stf' => 'application/vnd.wt.stf',
- 'sti' => 'application/vnd.sun.xml.impress.template',
- 'stk' => 'application/hyperstudio',
- 'stl' => 'application/vnd.ms-pki.stl',
- 'str' => 'application/vnd.pg.format',
- 'stw' => 'application/vnd.sun.xml.writer.template',
- 'sub' => 'image/vnd.dvb.subtitle',
- 'sus' => 'application/vnd.sus-calendar',
- 'susp' => 'application/vnd.sus-calendar',
- 'sv4cpio' => 'application/x-sv4cpio',
- 'sv4crc' => 'application/x-sv4crc',
- 'svc' => 'application/vnd.dvb.service',
- 'svd' => 'application/vnd.svd',
- 'svg' => 'image/svg+xml',
- 'svgz' => 'image/svg+xml',
- 'swa' => 'application/x-director',
- 'swf' => 'application/x-shockwave-flash',
- 'swi' => 'application/vnd.aristanetworks.swi',
- 'sxc' => 'application/vnd.sun.xml.calc',
- 'sxd' => 'application/vnd.sun.xml.draw',
- 'sxg' => 'application/vnd.sun.xml.writer.global',
- 'sxi' => 'application/vnd.sun.xml.impress',
- 'sxm' => 'application/vnd.sun.xml.math',
- 'sxw' => 'application/vnd.sun.xml.writer',
- 't' => 'text/troff',
- 'tao' => 'application/vnd.tao.intent-module-archive',
- 'tar' => 'application/x-tar',
- 'tcap' => 'application/vnd.3gpp2.tcap',
- 'tcl' => 'application/x-tcl',
- 'teacher' => 'application/vnd.smart.teacher',
- 'tei' => 'application/tei+xml',
- 'teicorpus' => 'application/tei+xml',
- 'tex' => 'application/x-tex',
- 'texi' => 'application/x-texinfo',
- 'texinfo' => 'application/x-texinfo',
- 'text' => 'text/plain',
- 'tfi' => 'application/thraud+xml',
- 'tfm' => 'application/x-tex-tfm',
- 'thmx' => 'application/vnd.ms-officetheme',
- 'tif' => 'image/tiff',
- 'tiff' => 'image/tiff',
- 'tmo' => 'application/vnd.tmobile-livetv',
- 'torrent' => 'application/x-bittorrent',
- 'tpl' => 'application/vnd.groove-tool-template',
- 'tpt' => 'application/vnd.trid.tpt',
- 'tr' => 'text/troff',
- 'tra' => 'application/vnd.trueapp',
- 'trm' => 'application/x-msterminal',
- 'tsd' => 'application/timestamped-data',
- 'tsv' => 'text/tab-separated-values',
- 'ttc' => 'application/x-font-ttf',
- 'ttf' => 'application/x-font-ttf',
- 'ttl' => 'text/turtle',
- 'twd' => 'application/vnd.simtech-mindmapper',
- 'twds' => 'application/vnd.simtech-mindmapper',
- 'txd' => 'application/vnd.genomatix.tuxedo',
- 'txf' => 'application/vnd.mobius.txf',
- 'txt' => 'text/plain',
- 'u32' => 'application/x-authorware-bin',
- 'udeb' => 'application/x-debian-package',
- 'ufd' => 'application/vnd.ufdl',
- 'ufdl' => 'application/vnd.ufdl',
- 'umj' => 'application/vnd.umajin',
- 'unityweb' => 'application/vnd.unity',
- 'uoml' => 'application/vnd.uoml+xml',
- 'uri' => 'text/uri-list',
- 'uris' => 'text/uri-list',
- 'urls' => 'text/uri-list',
- 'ustar' => 'application/x-ustar',
- 'utz' => 'application/vnd.uiq.theme',
- 'uu' => 'text/x-uuencode',
- 'uva' => 'audio/vnd.dece.audio',
- 'uvd' => 'application/vnd.dece.data',
- 'uvf' => 'application/vnd.dece.data',
- 'uvg' => 'image/vnd.dece.graphic',
- 'uvh' => 'video/vnd.dece.hd',
- 'uvi' => 'image/vnd.dece.graphic',
- 'uvm' => 'video/vnd.dece.mobile',
- 'uvp' => 'video/vnd.dece.pd',
- 'uvs' => 'video/vnd.dece.sd',
- 'uvt' => 'application/vnd.dece.ttml+xml',
- 'uvu' => 'video/vnd.uvvu.mp4',
- 'uvv' => 'video/vnd.dece.video',
- 'uvva' => 'audio/vnd.dece.audio',
- 'uvvd' => 'application/vnd.dece.data',
- 'uvvf' => 'application/vnd.dece.data',
- 'uvvg' => 'image/vnd.dece.graphic',
- 'uvvh' => 'video/vnd.dece.hd',
- 'uvvi' => 'image/vnd.dece.graphic',
- 'uvvm' => 'video/vnd.dece.mobile',
- 'uvvp' => 'video/vnd.dece.pd',
- 'uvvs' => 'video/vnd.dece.sd',
- 'uvvt' => 'application/vnd.dece.ttml+xml',
- 'uvvu' => 'video/vnd.uvvu.mp4',
- 'uvvv' => 'video/vnd.dece.video',
- 'uvvx' => 'application/vnd.dece.unspecified',
- 'uvx' => 'application/vnd.dece.unspecified',
- 'vcd' => 'application/x-cdlink',
- 'vcf' => 'text/x-vcard',
- 'vcg' => 'application/vnd.groove-vcard',
- 'vcs' => 'text/x-vcalendar',
- 'vcx' => 'application/vnd.vcx',
- 'vis' => 'application/vnd.visionary',
- 'viv' => 'video/vnd.vivo',
- 'vor' => 'application/vnd.stardivision.writer',
- 'vox' => 'application/x-authorware-bin',
- 'vrml' => 'model/vrml',
- 'vsd' => 'application/vnd.visio',
- 'vsf' => 'application/vnd.vsf',
- 'vss' => 'application/vnd.visio',
- 'vst' => 'application/vnd.visio',
- 'vsw' => 'application/vnd.visio',
- 'vtu' => 'model/vnd.vtu',
- 'vxml' => 'application/voicexml+xml',
- 'w3d' => 'application/x-director',
- 'wad' => 'application/x-doom',
- 'wav' => 'audio/x-wav',
- 'wax' => 'audio/x-ms-wax',
- 'wbmp' => 'image/vnd.wap.wbmp',
- 'wbs' => 'application/vnd.criticaltools.wbs+xml',
- 'wbxml' => 'application/vnd.wap.wbxml',
- 'wcm' => 'application/vnd.ms-works',
- 'wdb' => 'application/vnd.ms-works',
- 'weba' => 'audio/webm',
- 'webm' => 'video/webm',
- 'webp' => 'image/webp',
- 'wg' => 'application/vnd.pmi.widget',
- 'wgt' => 'application/widget',
- 'wks' => 'application/vnd.ms-works',
- 'wm' => 'video/x-ms-wm',
- 'wma' => 'audio/x-ms-wma',
- 'wmd' => 'application/x-ms-wmd',
- 'wmf' => 'application/x-msmetafile',
- 'wml' => 'text/vnd.wap.wml',
- 'wmlc' => 'application/vnd.wap.wmlc',
- 'wmls' => 'text/vnd.wap.wmlscript',
- 'wmlsc' => 'application/vnd.wap.wmlscriptc',
- 'wmv' => 'video/x-ms-wmv',
- 'wmx' => 'video/x-ms-wmx',
- 'wmz' => 'application/x-ms-wmz',
- 'woff' => 'application/x-font-woff',
- 'wpd' => 'application/vnd.wordperfect',
- 'wpl' => 'application/vnd.ms-wpl',
- 'wps' => 'application/vnd.ms-works',
- 'wqd' => 'application/vnd.wqd',
- 'wri' => 'application/x-mswrite',
- 'wrl' => 'model/vrml',
- 'wsdl' => 'application/wsdl+xml',
- 'wspolicy' => 'application/wspolicy+xml',
- 'wtb' => 'application/vnd.webturbo',
- 'wvx' => 'video/x-ms-wvx',
- 'x32' => 'application/x-authorware-bin',
- 'x3d' => 'application/vnd.hzn-3d-crossword',
- 'xap' => 'application/x-silverlight-app',
- 'xar' => 'application/vnd.xara',
- 'xbap' => 'application/x-ms-xbap',
- 'xbd' => 'application/vnd.fujixerox.docuworks.binder',
- 'xbm' => 'image/x-xbitmap',
- 'xdf' => 'application/xcap-diff+xml',
- 'xdm' => 'application/vnd.syncml.dm+xml',
- 'xdp' => 'application/vnd.adobe.xdp+xml',
- 'xdssc' => 'application/dssc+xml',
- 'xdw' => 'application/vnd.fujixerox.docuworks',
- 'xenc' => 'application/xenc+xml',
- 'xer' => 'application/patch-ops-error+xml',
- 'xfdf' => 'application/vnd.adobe.xfdf',
- 'xfdl' => 'application/vnd.xfdl',
- 'xht' => 'application/xhtml+xml',
- 'xhtml' => 'application/xhtml+xml',
- 'xhvml' => 'application/xv+xml',
- 'xif' => 'image/vnd.xiff',
- 'xla' => 'application/vnd.ms-excel',
- 'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12',
- 'xlc' => 'application/vnd.ms-excel',
- 'xlm' => 'application/vnd.ms-excel',
- 'xls' => 'application/vnd.ms-excel',
- 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12',
- 'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12',
- 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
- 'xlt' => 'application/vnd.ms-excel',
- 'xltm' => 'application/vnd.ms-excel.template.macroenabled.12',
- 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
- 'xlw' => 'application/vnd.ms-excel',
- 'xml' => 'application/xml',
- 'xo' => 'application/vnd.olpc-sugar',
- 'xop' => 'application/xop+xml',
- 'xpi' => 'application/x-xpinstall',
- 'xpm' => 'image/x-xpixmap',
- 'xpr' => 'application/vnd.is-xpr',
- 'xps' => 'application/vnd.ms-xpsdocument',
- 'xpw' => 'application/vnd.intercon.formnet',
- 'xpx' => 'application/vnd.intercon.formnet',
- 'xsl' => 'application/xml',
- 'xslt' => 'application/xslt+xml',
- 'xsm' => 'application/vnd.syncml+xml',
- 'xspf' => 'application/xspf+xml',
- 'xul' => 'application/vnd.mozilla.xul+xml',
- 'xvm' => 'application/xv+xml',
- 'xvml' => 'application/xv+xml',
- 'xwd' => 'image/x-xwindowdump',
- 'xyz' => 'chemical/x-xyz',
- 'yaml' => 'text/yaml',
- 'yang' => 'application/yang',
- 'yin' => 'application/yin+xml',
- 'yml' => 'text/yaml',
- 'zaz' => 'application/vnd.zzazz.deck+xml',
- 'zip' => 'application/zip',
- 'zir' => 'application/vnd.zul',
- 'zirz' => 'application/vnd.zul',
- 'zmm' => 'application/vnd.handheld-entertainment+xml'
- );
-
- /**
- * Get a singleton instance of the class
- *
- * @return self
- * @codeCoverageIgnore
- */
- public static function getInstance()
- {
- if (!self::$instance) {
- self::$instance = new self();
- }
-
- return self::$instance;
- }
-
- /**
- * Get a mimetype value from a file extension
- *
- * @param string $extension File extension
- *
- * @return string|null
- *
- */
- public function fromExtension($extension)
- {
- $extension = strtolower($extension);
-
- return isset($this->mimetypes[$extension])
- ? $this->mimetypes[$extension]
- : null;
- }
-
- /**
- * Get a mimetype from a filename
- *
- * @param string $filename Filename to generate a mimetype from
- *
- * @return string|null
- */
- public function fromFilename($filename)
- {
- return $this->fromExtension(pathinfo($filename, PATHINFO_EXTENSION));
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Pool.php b/lib/gerencianet/guzzlehttp/guzzle/src/Pool.php
index 7b9d83a..6277c61 100644
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Pool.php
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Pool.php
@@ -1,333 +1,125 @@
client = $client;
- $this->iter = $this->coerceIterable($requests);
- $this->deferred = new Deferred();
- $this->promise = $this->deferred->promise();
- $this->poolSize = isset($options['pool_size'])
- ? $options['pool_size'] : 25;
- $this->eventListeners = $this->prepareListeners(
- $options,
- ['before', 'complete', 'error', 'end']
- );
- }
+ private $each;
/**
- * Sends multiple requests in parallel and returns an array of responses
- * and exceptions that uses the same ordering as the provided requests.
- *
- * IMPORTANT: This method keeps every request and response in memory, and
- * as such, is NOT recommended when sending a large number or an
- * indeterminate number of requests concurrently.
- *
- * @param ClientInterface $client Client used to send the requests
- * @param array|\Iterator $requests Requests to send in parallel
- * @param array $options Passes through the options available in
- * {@see GuzzleHttp\Pool::__construct}
- *
- * @return BatchResults Returns a container for the results.
- * @throws \InvalidArgumentException if the event format is incorrect.
- */
- public static function batch(
- ClientInterface $client,
- $requests,
- array $options = []
- ) {
- $hash = new \SplObjectStorage();
- foreach ($requests as $request) {
- $hash->attach($request);
- }
-
- // In addition to the normally run events when requests complete, add
- // and event to continuously track the results of transfers in the hash.
- (new self($client, $requests, RequestEvents::convertEventArray(
- $options,
- ['end'],
- [
- 'priority' => RequestEvents::LATE,
- 'fn' => function (EndEvent $e) use ($hash) {
- $hash[$e->getRequest()] = $e->getException()
- ? $e->getException()
- : $e->getResponse();
- }
- ]
- )))->wait();
-
- return new BatchResults($hash);
- }
-
- /**
- * Creates a Pool and immediately sends the requests.
- *
- * @param ClientInterface $client Client used to send the requests
- * @param array|\Iterator $requests Requests to send in parallel
- * @param array $options Passes through the options available in
- * {@see GuzzleHttp\Pool::__construct}
- */
- public static function send(
- ClientInterface $client,
- $requests,
- array $options = []
- ) {
- $pool = new self($client, $requests, $options);
- $pool->wait();
- }
-
- private function getPoolSize()
- {
- return is_callable($this->poolSize)
- ? call_user_func($this->poolSize, count($this->waitQueue))
- : $this->poolSize;
- }
-
- /**
- * Add as many requests as possible up to the current pool limit.
+ * @param ClientInterface $client Client used to send the requests.
+ * @param array|\Iterator $requests Requests or functions that return
+ * requests to send concurrently.
+ * @param array $config Associative array of options
+ * - concurrency: (int) Maximum number of requests to send concurrently
+ * - options: Array of request options to apply to each request.
+ * - fulfilled: (callable) Function to invoke when a request completes.
+ * - rejected: (callable) Function to invoke when a request is rejected.
*/
- private function addNextRequests()
+ public function __construct(ClientInterface $client, $requests, array $config = [])
{
- $limit = max($this->getPoolSize() - count($this->waitQueue), 0);
- while ($limit--) {
- if (!$this->addNextRequest()) {
- break;
- }
+ if (!isset($config['concurrency'])) {
+ $config['concurrency'] = 25;
}
- }
- public function wait()
- {
- if ($this->isRealized) {
- return false;
+ if (isset($config['options'])) {
+ $opts = $config['options'];
+ unset($config['options']);
+ } else {
+ $opts = [];
}
- // Seed the pool with N number of requests.
- $this->addNextRequests();
-
- // Stop if the pool was cancelled while transferring requests.
- if ($this->isRealized) {
- return false;
- }
-
- // Wait on any outstanding FutureResponse objects.
- while ($response = array_pop($this->waitQueue)) {
- try {
- $response->wait();
- } catch (\Exception $e) {
- // Eat exceptions because they should be handled asynchronously
+ $iterable = P\Create::iterFor($requests);
+ $requests = static function () use ($iterable, $client, $opts) {
+ foreach ($iterable as $key => $rfn) {
+ if ($rfn instanceof RequestInterface) {
+ yield $key => $client->sendAsync($rfn, $opts);
+ } elseif (\is_callable($rfn)) {
+ yield $key => $rfn($opts);
+ } else {
+ throw new \InvalidArgumentException('Each value yielded by the iterator must be a Psr7\Http\Message\RequestInterface or a callable that returns a promise that fulfills with a Psr7\Message\Http\ResponseInterface object.');
+ }
}
- $this->addNextRequests();
- }
-
- // Clean up no longer needed state.
- $this->isRealized = true;
- $this->waitQueue = $this->eventListeners = [];
- $this->client = $this->iter = null;
- $this->deferred->resolve(true);
+ };
- return true;
+ $this->each = new EachPromise($requests(), $config);
}
/**
- * {@inheritdoc}
- *
- * Attempt to cancel all outstanding requests (requests that are queued for
- * dereferencing). Returns true if all outstanding requests can be
- * cancelled.
- *
- * @return bool
+ * Get promise
*/
- public function cancel()
+ public function promise(): PromiseInterface
{
- if ($this->isRealized) {
- return false;
- }
-
- $success = $this->isRealized = true;
- foreach ($this->waitQueue as $response) {
- if (!$response->cancel()) {
- $success = false;
- }
- }
-
- return $success;
+ return $this->each->promise();
}
/**
- * Returns a promise that is invoked when the pool completed. There will be
- * no passed value.
+ * Sends multiple requests concurrently and returns an array of responses
+ * and exceptions that uses the same ordering as the provided requests.
*
- * {@inheritdoc}
+ * IMPORTANT: This method keeps every request and response in memory, and
+ * as such, is NOT recommended when sending a large number or an
+ * indeterminate number of requests concurrently.
+ *
+ * @param ClientInterface $client Client used to send the requests
+ * @param array|\Iterator $requests Requests to send concurrently.
+ * @param array $options Passes through the options available in
+ * {@see \GuzzleHttp\Pool::__construct}
+ *
+ * @return array Returns an array containing the response or an exception
+ * in the same order that the requests were sent.
+ *
+ * @throws \InvalidArgumentException if the event format is incorrect.
*/
- public function then(
- callable $onFulfilled = null,
- callable $onRejected = null,
- callable $onProgress = null
- ) {
- return $this->promise->then($onFulfilled, $onRejected, $onProgress);
- }
-
- public function promise()
- {
- return $this->promise;
- }
-
- private function coerceIterable($requests)
+ public static function batch(ClientInterface $client, $requests, array $options = []): array
{
- if ($requests instanceof \Iterator) {
- return $requests;
- } elseif (is_array($requests)) {
- return new \ArrayIterator($requests);
- }
-
- throw new \InvalidArgumentException('Expected Iterator or array. '
- . 'Found ' . Core::describeType($requests));
+ $res = [];
+ self::cmpCallback($options, 'fulfilled', $res);
+ self::cmpCallback($options, 'rejected', $res);
+ $pool = new static($client, $requests, $options);
+ $pool->promise()->wait();
+ \ksort($res);
+
+ return $res;
}
/**
- * Adds the next request to pool and tracks what requests need to be
- * dereferenced when completing the pool.
+ * Execute callback(s)
*/
- private function addNextRequest()
+ private static function cmpCallback(array &$options, string $name, array &$results): void
{
- add_next:
-
- if ($this->isRealized || !$this->iter || !$this->iter->valid()) {
- return false;
- }
-
- $request = $this->iter->current();
- $this->iter->next();
-
- if (!($request instanceof RequestInterface)) {
- throw new \InvalidArgumentException(sprintf(
- 'All requests in the provided iterator must implement '
- . 'RequestInterface. Found %s',
- Core::describeType($request)
- ));
- }
-
- // Be sure to use "lazy" futures, meaning they do not send right away.
- $request->getConfig()->set('future', 'lazy');
- $hash = spl_object_hash($request);
- $this->attachListeners($request, $this->eventListeners);
- $request->getEmitter()->on('before', [$this, '_trackRetries'], RequestEvents::EARLY);
- $response = $this->client->send($request);
- $this->waitQueue[$hash] = $response;
- $promise = $response->promise();
-
- // Don't recursively call itself for completed or rejected responses.
- if ($promise instanceof FulfilledPromise
- || $promise instanceof RejectedPromise
- ) {
- try {
- $this->finishResponse($request, $response->wait(), $hash);
- } catch (\Exception $e) {
- $this->finishResponse($request, $e, $hash);
- }
- goto add_next;
+ if (!isset($options[$name])) {
+ $options[$name] = static function ($v, $k) use (&$results) {
+ $results[$k] = $v;
+ };
+ } else {
+ $currentFn = $options[$name];
+ $options[$name] = static function ($v, $k) use (&$results, $currentFn) {
+ $currentFn($v, $k);
+ $results[$k] = $v;
+ };
}
-
- // Use this function for both resolution and rejection.
- $thenFn = function ($value) use ($request, $hash) {
- $this->finishResponse($request, $value, $hash);
- if (!$request->getConfig()->get('_pool_retries')) {
- $this->addNextRequests();
- }
- };
-
- $promise->then($thenFn, $thenFn);
-
- return true;
- }
-
- public function _trackRetries(BeforeEvent $e)
- {
- $e->getRequest()->getConfig()->set('_pool_retries', $e->getRetryCount());
- }
-
- private function finishResponse($request, $value, $hash)
- {
- unset($this->waitQueue[$hash]);
- $result = $value instanceof ResponseInterface
- ? ['request' => $request, 'response' => $value, 'error' => null]
- : ['request' => $request, 'response' => null, 'error' => $value];
- $this->deferred->notify($result);
}
}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Post/MultipartBody.php b/lib/gerencianet/guzzlehttp/guzzle/src/Post/MultipartBody.php
deleted file mode 100644
index 1149e62..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Post/MultipartBody.php
+++ /dev/null
@@ -1,109 +0,0 @@
-boundary = $boundary ?: uniqid();
- $this->stream = $this->createStream($fields, $files);
- }
-
- /**
- * Get the boundary
- *
- * @return string
- */
- public function getBoundary()
- {
- return $this->boundary;
- }
-
- public function isWritable()
- {
- return false;
- }
-
- /**
- * Get the string needed to transfer a POST field
- */
- private function getFieldString($name, $value)
- {
- return sprintf(
- "--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n%s\r\n",
- $this->boundary,
- $name,
- $value
- );
- }
-
- /**
- * Get the headers needed before transferring the content of a POST file
- */
- private function getFileHeaders(PostFileInterface $file)
- {
- $headers = '';
- foreach ($file->getHeaders() as $key => $value) {
- $headers .= "{$key}: {$value}\r\n";
- }
-
- return "--{$this->boundary}\r\n" . trim($headers) . "\r\n\r\n";
- }
-
- /**
- * Create the aggregate stream that will be used to upload the POST data
- */
- protected function createStream(array $fields, array $files)
- {
- $stream = new AppendStream();
-
- foreach ($fields as $name => $fieldValues) {
- foreach ((array) $fieldValues as $value) {
- $stream->addStream(
- Stream::factory($this->getFieldString($name, $value))
- );
- }
- }
-
- foreach ($files as $file) {
-
- if (!$file instanceof PostFileInterface) {
- throw new \InvalidArgumentException('All POST fields must '
- . 'implement PostFieldInterface');
- }
-
- $stream->addStream(
- Stream::factory($this->getFileHeaders($file))
- );
- $stream->addStream($file->getContent());
- $stream->addStream(Stream::factory("\r\n"));
- }
-
- // Add the trailing boundary with CRLF
- $stream->addStream(Stream::factory("--{$this->boundary}--\r\n"));
-
- return $stream;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Post/PostBody.php b/lib/gerencianet/guzzlehttp/guzzle/src/Post/PostBody.php
deleted file mode 100644
index ed14d1f..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Post/PostBody.php
+++ /dev/null
@@ -1,287 +0,0 @@
-files || $this->forceMultipart) {
- $request->setHeader(
- 'Content-Type',
- 'multipart/form-data; boundary=' . $this->getBody()->getBoundary()
- );
- } elseif ($this->fields && !$request->hasHeader('Content-Type')) {
- $request->setHeader(
- 'Content-Type',
- 'application/x-www-form-urlencoded'
- );
- }
-
- if ($size = $this->getSize()) {
- $request->setHeader('Content-Length', $size);
- }
- }
-
- public function forceMultipartUpload($force)
- {
- $this->forceMultipart = $force;
- }
-
- public function setAggregator(callable $aggregator)
- {
- $this->aggregator = $aggregator;
- }
-
- public function setField($name, $value)
- {
- $this->fields[$name] = $value;
- $this->mutate();
- }
-
- public function replaceFields(array $fields)
- {
- $this->fields = $fields;
- $this->mutate();
- }
-
- public function getField($name)
- {
- return isset($this->fields[$name]) ? $this->fields[$name] : null;
- }
-
- public function removeField($name)
- {
- unset($this->fields[$name]);
- $this->mutate();
- }
-
- public function getFields($asString = false)
- {
- if (!$asString) {
- return $this->fields;
- }
-
- $query = new Query($this->fields);
- $query->setEncodingType(Query::RFC1738);
- $query->setAggregator($this->getAggregator());
-
- return (string) $query;
- }
-
- public function hasField($name)
- {
- return isset($this->fields[$name]);
- }
-
- public function getFile($name)
- {
- foreach ($this->files as $file) {
- if ($file->getName() == $name) {
- return $file;
- }
- }
-
- return null;
- }
-
- public function getFiles()
- {
- return $this->files;
- }
-
- public function addFile(PostFileInterface $file)
- {
- $this->files[] = $file;
- $this->mutate();
- }
-
- public function clearFiles()
- {
- $this->files = [];
- $this->mutate();
- }
-
- /**
- * Returns the numbers of fields + files
- *
- * @return int
- */
- public function count()
- {
- return count($this->files) + count($this->fields);
- }
-
- public function __toString()
- {
- return (string) $this->getBody();
- }
-
- public function getContents($maxLength = -1)
- {
- return $this->getBody()->getContents();
- }
-
- public function close()
- {
- $this->detach();
- }
-
- public function detach()
- {
- $this->detached = true;
- $this->fields = $this->files = [];
-
- if ($this->body) {
- $this->body->close();
- $this->body = null;
- }
- }
-
- public function attach($stream)
- {
- throw new CannotAttachException();
- }
-
- public function eof()
- {
- return $this->getBody()->eof();
- }
-
- public function tell()
- {
- return $this->body ? $this->body->tell() : 0;
- }
-
- public function isSeekable()
- {
- return true;
- }
-
- public function isReadable()
- {
- return true;
- }
-
- public function isWritable()
- {
- return false;
- }
-
- public function getSize()
- {
- return $this->getBody()->getSize();
- }
-
- public function seek($offset, $whence = SEEK_SET)
- {
- return $this->getBody()->seek($offset, $whence);
- }
-
- public function read($length)
- {
- return $this->getBody()->read($length);
- }
-
- public function write($string)
- {
- return false;
- }
-
- public function getMetadata($key = null)
- {
- return $key ? null : [];
- }
-
- /**
- * Return a stream object that is built from the POST fields and files.
- *
- * If one has already been created, the previously created stream will be
- * returned.
- */
- private function getBody()
- {
- if ($this->body) {
- return $this->body;
- } elseif ($this->files || $this->forceMultipart) {
- return $this->body = $this->createMultipart();
- } elseif ($this->fields) {
- return $this->body = $this->createUrlEncoded();
- } else {
- return $this->body = Stream::factory();
- }
- }
-
- /**
- * Get the aggregator used to join multi-valued field parameters
- *
- * @return callable
- */
- final protected function getAggregator()
- {
- if (!$this->aggregator) {
- $this->aggregator = Query::phpAggregator();
- }
-
- return $this->aggregator;
- }
-
- /**
- * Creates a multipart/form-data body stream
- *
- * @return MultipartBody
- */
- private function createMultipart()
- {
- // Flatten the nested query string values using the correct aggregator
- return new MultipartBody(
- call_user_func($this->getAggregator(), $this->fields),
- $this->files
- );
- }
-
- /**
- * Creates an application/x-www-form-urlencoded stream body
- *
- * @return StreamInterface
- */
- private function createUrlEncoded()
- {
- return Stream::factory($this->getFields(true));
- }
-
- /**
- * Get rid of any cached data
- */
- private function mutate()
- {
- $this->body = null;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Post/PostBodyInterface.php b/lib/gerencianet/guzzlehttp/guzzle/src/Post/PostBodyInterface.php
deleted file mode 100644
index c2ec9a6..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Post/PostBodyInterface.php
+++ /dev/null
@@ -1,109 +0,0 @@
-headers = $headers;
- $this->name = $name;
- $this->prepareContent($content);
- $this->prepareFilename($filename);
- $this->prepareDefaultHeaders();
- }
-
- public function getName()
- {
- return $this->name;
- }
-
- public function getFilename()
- {
- return $this->filename;
- }
-
- public function getContent()
- {
- return $this->content;
- }
-
- public function getHeaders()
- {
- return $this->headers;
- }
-
- /**
- * Prepares the contents of a POST file.
- *
- * @param mixed $content Content of the POST file
- */
- private function prepareContent($content)
- {
- $this->content = $content;
-
- if (!($this->content instanceof StreamInterface)) {
- $this->content = Stream::factory($this->content);
- } elseif ($this->content instanceof MultipartBody) {
- if (!$this->hasHeader('Content-Disposition')) {
- $disposition = 'form-data; name="' . $this->name .'"';
- $this->headers['Content-Disposition'] = $disposition;
- }
-
- if (!$this->hasHeader('Content-Type')) {
- $this->headers['Content-Type'] = sprintf(
- "multipart/form-data; boundary=%s",
- $this->content->getBoundary()
- );
- }
- }
- }
-
- /**
- * Applies a file name to the POST file based on various checks.
- *
- * @param string|null $filename Filename to apply (or null to guess)
- */
- private function prepareFilename($filename)
- {
- $this->filename = $filename;
-
- if (!$this->filename) {
- $this->filename = $this->content->getMetadata('uri');
- }
-
- if (!$this->filename || substr($this->filename, 0, 6) === 'php://') {
- $this->filename = $this->name;
- }
- }
-
- /**
- * Applies default Content-Disposition and Content-Type headers if needed.
- */
- private function prepareDefaultHeaders()
- {
- // Set a default content-disposition header if one was no provided
- if (!$this->hasHeader('Content-Disposition')) {
- $this->headers['Content-Disposition'] = sprintf(
- 'form-data; name="%s"; filename="%s"',
- $this->name,
- basename($this->filename)
- );
- }
-
- // Set a default Content-Type if one was not supplied
- if (!$this->hasHeader('Content-Type')) {
- $this->headers['Content-Type'] = Mimetypes::getInstance()
- ->fromFilename($this->filename) ?: 'text/plain';
- }
- }
-
- /**
- * Check if a specific header exists on the POST file by name.
- *
- * @param string $name Case-insensitive header to check
- *
- * @return bool
- */
- private function hasHeader($name)
- {
- return isset(array_change_key_case($this->headers)[strtolower($name)]);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Post/PostFileInterface.php b/lib/gerencianet/guzzlehttp/guzzle/src/Post/PostFileInterface.php
deleted file mode 100644
index 2e816c0..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Post/PostFileInterface.php
+++ /dev/null
@@ -1,41 +0,0 @@
-nextHandler = $nextHandler;
+ }
+
+ public function __invoke(RequestInterface $request, array $options): PromiseInterface
+ {
+ $fn = $this->nextHandler;
+
+ // Don't do anything if the request has no body.
+ if ($request->getBody()->getSize() === 0) {
+ return $fn($request, $options);
+ }
+
+ $modify = [];
+
+ // Add a default content-type if possible.
+ if (!$request->hasHeader('Content-Type')) {
+ if ($uri = $request->getBody()->getMetadata('uri')) {
+ if (is_string($uri) && $type = Psr7\MimeType::fromFilename($uri)) {
+ $modify['set_headers']['Content-Type'] = $type;
+ }
+ }
+ }
+
+ // Add a default content-length or transfer-encoding header.
+ if (!$request->hasHeader('Content-Length')
+ && !$request->hasHeader('Transfer-Encoding')
+ ) {
+ $size = $request->getBody()->getSize();
+ if ($size !== null) {
+ $modify['set_headers']['Content-Length'] = $size;
+ } else {
+ $modify['set_headers']['Transfer-Encoding'] = 'chunked';
+ }
+ }
+
+ // Add the expect header if needed.
+ $this->addExpectHeader($request, $options, $modify);
+
+ return $fn(Psr7\Utils::modifyRequest($request, $modify), $options);
+ }
+
+ /**
+ * Add expect header
+ */
+ private function addExpectHeader(RequestInterface $request, array $options, array &$modify): void
+ {
+ // Determine if the Expect header should be used
+ if ($request->hasHeader('Expect')) {
+ return;
+ }
+
+ $expect = $options['expect'] ?? null;
+
+ // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0
+ if ($expect === false || $request->getProtocolVersion() < 1.1) {
+ return;
+ }
+
+ // The expect header is unconditionally enabled
+ if ($expect === true) {
+ $modify['set_headers']['Expect'] = '100-Continue';
+ return;
+ }
+
+ // By default, send the expect header when the payload is > 1mb
+ if ($expect === null) {
+ $expect = 1048576;
+ }
+
+ // Always add if the body cannot be rewound, the size cannot be
+ // determined, or the size is greater than the cutoff threshold
+ $body = $request->getBody();
+ $size = $body->getSize();
+
+ if ($size === null || $size >= (int) $expect || !$body->isSeekable()) {
+ $modify['set_headers']['Expect'] = '100-Continue';
+ }
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Query.php b/lib/gerencianet/guzzlehttp/guzzle/src/Query.php
deleted file mode 100644
index d053def..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Query.php
+++ /dev/null
@@ -1,204 +0,0 @@
-setEncodingType($urlEncoding);
- }
-
- $qp->parseInto($q, $query, $urlEncoding);
-
- return $q;
- }
-
- /**
- * Convert the query string parameters to a query string string
- *
- * @return string
- */
- public function __toString()
- {
- if (!$this->data) {
- return '';
- }
-
- // The default aggregator is statically cached
- static $defaultAggregator;
-
- if (!$this->aggregator) {
- if (!$defaultAggregator) {
- $defaultAggregator = self::phpAggregator();
- }
- $this->aggregator = $defaultAggregator;
- }
-
- $result = '';
- $aggregator = $this->aggregator;
- $encoder = $this->encoding;
-
- foreach ($aggregator($this->data) as $key => $values) {
- foreach ($values as $value) {
- if ($result) {
- $result .= '&';
- }
- $result .= $encoder($key);
- if ($value !== null) {
- $result .= '=' . $encoder($value);
- }
- }
- }
-
- return $result;
- }
-
- /**
- * Controls how multi-valued query string parameters are aggregated into a
- * string.
- *
- * $query->setAggregator($query::duplicateAggregator());
- *
- * @param callable $aggregator Callable used to convert a deeply nested
- * array of query string variables into a flattened array of key value
- * pairs. The callable accepts an array of query data and returns a
- * flattened array of key value pairs where each value is an array of
- * strings.
- */
- public function setAggregator(callable $aggregator)
- {
- $this->aggregator = $aggregator;
- }
-
- /**
- * Specify how values are URL encoded
- *
- * @param string|bool $type One of 'RFC1738', 'RFC3986', or false to disable encoding
- *
- * @throws \InvalidArgumentException
- */
- public function setEncodingType($type)
- {
- switch ($type) {
- case self::RFC3986:
- $this->encoding = 'rawurlencode';
- break;
- case self::RFC1738:
- $this->encoding = 'urlencode';
- break;
- case false:
- $this->encoding = function ($v) { return $v; };
- break;
- default:
- throw new \InvalidArgumentException('Invalid URL encoding type');
- }
- }
-
- /**
- * Query string aggregator that does not aggregate nested query string
- * values and allows duplicates in the resulting array.
- *
- * Example: http://test.com?q=1&q=2
- *
- * @return callable
- */
- public static function duplicateAggregator()
- {
- return function (array $data) {
- return self::walkQuery($data, '', function ($key, $prefix) {
- return is_int($key) ? $prefix : "{$prefix}[{$key}]";
- });
- };
- }
-
- /**
- * Aggregates nested query string variables using the same technique as
- * ``http_build_query()``.
- *
- * @param bool $numericIndices Pass false to not include numeric indices
- * when multi-values query string parameters are present.
- *
- * @return callable
- */
- public static function phpAggregator($numericIndices = true)
- {
- return function (array $data) use ($numericIndices) {
- return self::walkQuery(
- $data,
- '',
- function ($key, $prefix) use ($numericIndices) {
- return !$numericIndices && is_int($key)
- ? "{$prefix}[]"
- : "{$prefix}[{$key}]";
- }
- );
- };
- }
-
- /**
- * Easily create query aggregation functions by providing a key prefix
- * function to this query string array walker.
- *
- * @param array $query Query string to walk
- * @param string $keyPrefix Key prefix (start with '')
- * @param callable $prefixer Function used to create a key prefix
- *
- * @return array
- */
- public static function walkQuery(array $query, $keyPrefix, callable $prefixer)
- {
- $result = [];
- foreach ($query as $key => $value) {
- if ($keyPrefix) {
- $key = $prefixer($key, $keyPrefix);
- }
- if (is_array($value)) {
- $result += self::walkQuery($value, $key, $prefixer);
- } elseif (isset($result[$key])) {
- $result[$key][] = $value;
- } else {
- $result[$key] = array($value);
- }
- }
-
- return $result;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/QueryParser.php b/lib/gerencianet/guzzlehttp/guzzle/src/QueryParser.php
deleted file mode 100644
index 90727cc..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/QueryParser.php
+++ /dev/null
@@ -1,163 +0,0 @@
-duplicates = false;
- $this->numericIndices = true;
- $decoder = self::getDecoder($urlEncoding);
-
- foreach (explode('&', $str) as $kvp) {
-
- $parts = explode('=', $kvp, 2);
- $key = $decoder($parts[0]);
- $value = isset($parts[1]) ? $decoder($parts[1]) : null;
-
- // Special handling needs to be taken for PHP nested array syntax
- if (strpos($key, '[') !== false) {
- $this->parsePhpValue($key, $value, $result);
- continue;
- }
-
- if (!isset($result[$key])) {
- $result[$key] = $value;
- } else {
- $this->duplicates = true;
- if (!is_array($result[$key])) {
- $result[$key] = [$result[$key]];
- }
- $result[$key][] = $value;
- }
- }
-
- $query->replace($result);
-
- if (!$this->numericIndices) {
- $query->setAggregator(Query::phpAggregator(false));
- } elseif ($this->duplicates) {
- $query->setAggregator(Query::duplicateAggregator());
- }
- }
-
- /**
- * Returns a callable that is used to URL decode query keys and values.
- *
- * @param string|bool $type One of true, false, RFC3986, and RFC1738
- *
- * @return callable|string
- */
- private static function getDecoder($type)
- {
- if ($type === true) {
- return function ($value) {
- return rawurldecode(str_replace('+', ' ', $value));
- };
- } elseif ($type == Query::RFC3986) {
- return 'rawurldecode';
- } elseif ($type == Query::RFC1738) {
- return 'urldecode';
- } else {
- return function ($str) { return $str; };
- }
- }
-
- /**
- * Parses a PHP style key value pair.
- *
- * @param string $key Key to parse (e.g., "foo[a][b]")
- * @param string|null $value Value to set
- * @param array $result Result to modify by reference
- */
- private function parsePhpValue($key, $value, array &$result)
- {
- $node =& $result;
- $keyBuffer = '';
-
- for ($i = 0, $t = strlen($key); $i < $t; $i++) {
- switch ($key[$i]) {
- case '[':
- if ($keyBuffer) {
- $this->prepareNode($node, $keyBuffer);
- $node =& $node[$keyBuffer];
- $keyBuffer = '';
- }
- break;
- case ']':
- $k = $this->cleanKey($node, $keyBuffer);
- $this->prepareNode($node, $k);
- $node =& $node[$k];
- $keyBuffer = '';
- break;
- default:
- $keyBuffer .= $key[$i];
- break;
- }
- }
-
- if (isset($node)) {
- $this->duplicates = true;
- $node[] = $value;
- } else {
- $node = $value;
- }
- }
-
- /**
- * Prepares a value in the array at the given key.
- *
- * If the key already exists, the key value is converted into an array.
- *
- * @param array $node Result node to modify
- * @param string $key Key to add or modify in the node
- */
- private function prepareNode(&$node, $key)
- {
- if (!isset($node[$key])) {
- $node[$key] = null;
- } elseif (!is_array($node[$key])) {
- $node[$key] = [$node[$key]];
- }
- }
-
- /**
- * Returns the appropriate key based on the node and key.
- */
- private function cleanKey($node, $key)
- {
- if ($key === '') {
- $key = $node ? (string) count($node) : 0;
- // Found a [] key, so track this to ensure that we disable numeric
- // indexing of keys in the resolved query aggregator.
- $this->numericIndices = false;
- }
-
- return $key;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/RedirectMiddleware.php b/lib/gerencianet/guzzlehttp/guzzle/src/RedirectMiddleware.php
new file mode 100644
index 0000000..1dd3861
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/RedirectMiddleware.php
@@ -0,0 +1,216 @@
+ 5,
+ 'protocols' => ['http', 'https'],
+ 'strict' => false,
+ 'referer' => false,
+ 'track_redirects' => false,
+ ];
+
+ /**
+ * @var callable(RequestInterface, array): PromiseInterface
+ */
+ private $nextHandler;
+
+ /**
+ * @param callable(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke.
+ */
+ public function __construct(callable $nextHandler)
+ {
+ $this->nextHandler = $nextHandler;
+ }
+
+ public function __invoke(RequestInterface $request, array $options): PromiseInterface
+ {
+ $fn = $this->nextHandler;
+
+ if (empty($options['allow_redirects'])) {
+ return $fn($request, $options);
+ }
+
+ if ($options['allow_redirects'] === true) {
+ $options['allow_redirects'] = self::$defaultSettings;
+ } elseif (!\is_array($options['allow_redirects'])) {
+ throw new \InvalidArgumentException('allow_redirects must be true, false, or array');
+ } else {
+ // Merge the default settings with the provided settings
+ $options['allow_redirects'] += self::$defaultSettings;
+ }
+
+ if (empty($options['allow_redirects']['max'])) {
+ return $fn($request, $options);
+ }
+
+ return $fn($request, $options)
+ ->then(function (ResponseInterface $response) use ($request, $options) {
+ return $this->checkRedirect($request, $options, $response);
+ });
+ }
+
+ /**
+ * @return ResponseInterface|PromiseInterface
+ */
+ public function checkRedirect(RequestInterface $request, array $options, ResponseInterface $response)
+ {
+ if (\strpos((string) $response->getStatusCode(), '3') !== 0
+ || !$response->hasHeader('Location')
+ ) {
+ return $response;
+ }
+
+ $this->guardMax($request, $response, $options);
+ $nextRequest = $this->modifyRequest($request, $options, $response);
+
+ if (isset($options['allow_redirects']['on_redirect'])) {
+ ($options['allow_redirects']['on_redirect'])(
+ $request,
+ $response,
+ $nextRequest->getUri()
+ );
+ }
+
+ $promise = $this($nextRequest, $options);
+
+ // Add headers to be able to track history of redirects.
+ if (!empty($options['allow_redirects']['track_redirects'])) {
+ return $this->withTracking(
+ $promise,
+ (string) $nextRequest->getUri(),
+ $response->getStatusCode()
+ );
+ }
+
+ return $promise;
+ }
+
+ /**
+ * Enable tracking on promise.
+ */
+ private function withTracking(PromiseInterface $promise, string $uri, int $statusCode): PromiseInterface
+ {
+ return $promise->then(
+ static function (ResponseInterface $response) use ($uri, $statusCode) {
+ // Note that we are pushing to the front of the list as this
+ // would be an earlier response than what is currently present
+ // in the history header.
+ $historyHeader = $response->getHeader(self::HISTORY_HEADER);
+ $statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER);
+ \array_unshift($historyHeader, $uri);
+ \array_unshift($statusHeader, (string) $statusCode);
+
+ return $response->withHeader(self::HISTORY_HEADER, $historyHeader)
+ ->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader);
+ }
+ );
+ }
+
+ /**
+ * Check for too many redirects
+ *
+ * @throws TooManyRedirectsException Too many redirects.
+ */
+ private function guardMax(RequestInterface $request, ResponseInterface $response, array &$options): void
+ {
+ $current = $options['__redirect_count']
+ ?? 0;
+ $options['__redirect_count'] = $current + 1;
+ $max = $options['allow_redirects']['max'];
+
+ if ($options['__redirect_count'] > $max) {
+ throw new TooManyRedirectsException("Will not follow more than {$max} redirects", $request, $response);
+ }
+ }
+
+ public function modifyRequest(RequestInterface $request, array $options, ResponseInterface $response): RequestInterface
+ {
+ // Request modifications to apply.
+ $modify = [];
+ $protocols = $options['allow_redirects']['protocols'];
+
+ // Use a GET request if this is an entity enclosing request and we are
+ // not forcing RFC compliance, but rather emulating what all browsers
+ // would do.
+ $statusCode = $response->getStatusCode();
+ if ($statusCode == 303 ||
+ ($statusCode <= 302 && !$options['allow_redirects']['strict'])
+ ) {
+ $safeMethods = ['GET', 'HEAD', 'OPTIONS'];
+ $requestMethod = $request->getMethod();
+
+ $modify['method'] = in_array($requestMethod, $safeMethods) ? $requestMethod : 'GET';
+ $modify['body'] = '';
+ }
+
+ $uri = $this->redirectUri($request, $response, $protocols);
+ if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) {
+ $idnOptions = ($options['idn_conversion'] === true) ? \IDNA_DEFAULT : $options['idn_conversion'];
+ $uri = Utils::idnUriConvert($uri, $idnOptions);
+ }
+
+ $modify['uri'] = $uri;
+ Psr7\Message::rewindBody($request);
+
+ // Add the Referer header if it is told to do so and only
+ // add the header if we are not redirecting from https to http.
+ if ($options['allow_redirects']['referer']
+ && $modify['uri']->getScheme() === $request->getUri()->getScheme()
+ ) {
+ $uri = $request->getUri()->withUserInfo('');
+ $modify['set_headers']['Referer'] = (string) $uri;
+ } else {
+ $modify['remove_headers'][] = 'Referer';
+ }
+
+ // Remove Authorization header if host is different.
+ if ($request->getUri()->getHost() !== $modify['uri']->getHost()) {
+ $modify['remove_headers'][] = 'Authorization';
+ }
+
+ return Psr7\Utils::modifyRequest($request, $modify);
+ }
+
+ /**
+ * Set the appropriate URL on the request based on the location header
+ */
+ private function redirectUri(RequestInterface $request, ResponseInterface $response, array $protocols): UriInterface
+ {
+ $location = Psr7\UriResolver::resolve(
+ $request->getUri(),
+ new Psr7\Uri($response->getHeaderLine('Location'))
+ );
+
+ // Ensure that the redirect URI is allowed based on the protocols.
+ if (!\in_array($location->getScheme(), $protocols)) {
+ throw new BadResponseException(\sprintf('Redirect URI, %s, does not use one of the allowed redirect protocols: %s', $location, \implode(', ', $protocols)), $request, $response);
+ }
+
+ return $location;
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/RequestFsm.php b/lib/gerencianet/guzzlehttp/guzzle/src/RequestFsm.php
deleted file mode 100644
index b37c190..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/RequestFsm.php
+++ /dev/null
@@ -1,153 +0,0 @@
-mf = $messageFactory;
- $this->maxTransitions = $maxTransitions;
- $this->handler = $handler;
- }
-
- /**
- * Runs the state machine until a terminal state is entered or the
- * optionally supplied $finalState is entered.
- *
- * @param Transaction $trans Transaction being transitioned.
- *
- * @throws \Exception if a terminal state throws an exception.
- */
- public function __invoke(Transaction $trans)
- {
- $trans->_transitionCount = 0;
-
- if (!$trans->state) {
- $trans->state = 'before';
- }
-
- transition:
-
- if (++$trans->_transitionCount > $this->maxTransitions) {
- throw new StateException("Too many state transitions were "
- . "encountered ({$trans->_transitionCount}). This likely "
- . "means that a combination of event listeners are in an "
- . "infinite loop.");
- }
-
- switch ($trans->state) {
- case 'before': goto before;
- case 'complete': goto complete;
- case 'error': goto error;
- case 'retry': goto retry;
- case 'send': goto send;
- case 'end': goto end;
- default: throw new StateException("Invalid state: {$trans->state}");
- }
-
- before: {
- try {
- $trans->request->getEmitter()->emit('before', new BeforeEvent($trans));
- $trans->state = 'send';
- if ((bool) $trans->response) {
- $trans->state = 'complete';
- }
- } catch (\Exception $e) {
- $trans->state = 'error';
- $trans->exception = $e;
- }
- goto transition;
- }
-
- complete: {
- try {
- if ($trans->response instanceof FutureInterface) {
- // Futures will have their own end events emitted when
- // dereferenced.
- return;
- }
- $trans->state = 'end';
- $trans->response->setEffectiveUrl($trans->request->getUrl());
- $trans->request->getEmitter()->emit('complete', new CompleteEvent($trans));
- } catch (\Exception $e) {
- $trans->state = 'error';
- $trans->exception = $e;
- }
- goto transition;
- }
-
- error: {
- try {
- // Convert non-request exception to a wrapped exception
- $trans->exception = RequestException::wrapException(
- $trans->request, $trans->exception
- );
- $trans->state = 'end';
- $trans->request->getEmitter()->emit('error', new ErrorEvent($trans));
- // An intercepted request (not retried) transitions to complete
- if (!$trans->exception && $trans->state !== 'retry') {
- $trans->state = 'complete';
- }
- } catch (\Exception $e) {
- $trans->state = 'end';
- $trans->exception = $e;
- }
- goto transition;
- }
-
- retry: {
- $trans->retries++;
- $trans->response = null;
- $trans->exception = null;
- $trans->state = 'before';
- goto transition;
- }
-
- send: {
- $fn = $this->handler;
- $trans->response = FutureResponse::proxy(
- $fn(RingBridge::prepareRingRequest($trans)),
- function ($value) use ($trans) {
- RingBridge::completeRingResponse($trans, $value, $this->mf, $this);
- $this($trans);
- return $trans->response;
- }
- );
- return;
- }
-
- end: {
- $trans->request->getEmitter()->emit('end', new EndEvent($trans));
- // Throw exceptions in the terminal event if the exception
- // was not handled by an "end" event listener.
- if ($trans->exception) {
- if (!($trans->exception instanceof RequestException)) {
- $trans->exception = RequestException::wrapException(
- $trans->request, $trans->exception
- );
- }
- throw $trans->exception;
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/RequestOptions.php b/lib/gerencianet/guzzlehttp/guzzle/src/RequestOptions.php
new file mode 100644
index 0000000..20b31bc
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/RequestOptions.php
@@ -0,0 +1,264 @@
+decider = $decider;
+ $this->nextHandler = $nextHandler;
+ $this->delay = $delay ?: __CLASS__ . '::exponentialDelay';
+ }
+
+ /**
+ * Default exponential backoff delay function.
+ *
+ * @return int milliseconds.
+ */
+ public static function exponentialDelay(int $retries): int
+ {
+ return (int) \pow(2, $retries - 1) * 1000;
+ }
+
+ public function __invoke(RequestInterface $request, array $options): PromiseInterface
+ {
+ if (!isset($options['retries'])) {
+ $options['retries'] = 0;
+ }
+
+ $fn = $this->nextHandler;
+ return $fn($request, $options)
+ ->then(
+ $this->onFulfilled($request, $options),
+ $this->onRejected($request, $options)
+ );
+ }
+
+ /**
+ * Execute fulfilled closure
+ */
+ private function onFulfilled(RequestInterface $request, array $options): callable
+ {
+ return function ($value) use ($request, $options) {
+ if (!($this->decider)(
+ $options['retries'],
+ $request,
+ $value,
+ null
+ )) {
+ return $value;
+ }
+ return $this->doRetry($request, $options, $value);
+ };
+ }
+
+ /**
+ * Execute rejected closure
+ */
+ private function onRejected(RequestInterface $req, array $options): callable
+ {
+ return function ($reason) use ($req, $options) {
+ if (!($this->decider)(
+ $options['retries'],
+ $req,
+ null,
+ $reason
+ )) {
+ return P\Create::rejectionFor($reason);
+ }
+ return $this->doRetry($req, $options);
+ };
+ }
+
+ private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null): PromiseInterface
+ {
+ $options['delay'] = ($this->delay)(++$options['retries'], $response);
+
+ return $this($request, $options);
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/RingBridge.php b/lib/gerencianet/guzzlehttp/guzzle/src/RingBridge.php
deleted file mode 100644
index bc6841d..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/RingBridge.php
+++ /dev/null
@@ -1,165 +0,0 @@
-getConfig()->toArray();
- $url = $request->getUrl();
- // No need to calculate the query string twice (in URL and query).
- $qs = ($pos = strpos($url, '?')) ? substr($url, $pos + 1) : null;
-
- return [
- 'scheme' => $request->getScheme(),
- 'http_method' => $request->getMethod(),
- 'url' => $url,
- 'uri' => $request->getPath(),
- 'headers' => $request->getHeaders(),
- 'body' => $request->getBody(),
- 'version' => $request->getProtocolVersion(),
- 'client' => $options,
- 'query_string' => $qs,
- 'future' => isset($options['future']) ? $options['future'] : false
- ];
- }
-
- /**
- * Creates a Ring request from a request object AND prepares the callbacks.
- *
- * @param Transaction $trans Transaction to update.
- *
- * @return array Converted Guzzle Ring request.
- */
- public static function prepareRingRequest(Transaction $trans)
- {
- // Clear out the transaction state when initiating.
- $trans->exception = null;
- $request = self::createRingRequest($trans->request);
-
- // Emit progress events if any progress listeners are registered.
- if ($trans->request->getEmitter()->hasListeners('progress')) {
- $emitter = $trans->request->getEmitter();
- $request['client']['progress'] = function ($a, $b, $c, $d) use ($trans, $emitter) {
- $emitter->emit('progress', new ProgressEvent($trans, $a, $b, $c, $d));
- };
- }
-
- return $request;
- }
-
- /**
- * Handles the process of processing a response received from a ring
- * handler. The created response is added to the transaction, and the
- * transaction stat is set appropriately.
- *
- * @param Transaction $trans Owns request and response.
- * @param array $response Ring response array
- * @param MessageFactoryInterface $messageFactory Creates response objects.
- */
- public static function completeRingResponse(
- Transaction $trans,
- array $response,
- MessageFactoryInterface $messageFactory
- ) {
- $trans->state = 'complete';
- $trans->transferInfo = isset($response['transfer_stats'])
- ? $response['transfer_stats'] : [];
-
- if (!empty($response['status'])) {
- $options = [];
- if (isset($response['version'])) {
- $options['protocol_version'] = $response['version'];
- }
- if (isset($response['reason'])) {
- $options['reason_phrase'] = $response['reason'];
- }
- $trans->response = $messageFactory->createResponse(
- $response['status'],
- isset($response['headers']) ? $response['headers'] : [],
- isset($response['body']) ? $response['body'] : null,
- $options
- );
- if (isset($response['effective_url'])) {
- $trans->response->setEffectiveUrl($response['effective_url']);
- }
- } elseif (empty($response['error'])) {
- // When nothing was returned, then we need to add an error.
- $response['error'] = self::getNoRingResponseException($trans->request);
- }
-
- if (isset($response['error'])) {
- $trans->state = 'error';
- $trans->exception = $response['error'];
- }
- }
-
- /**
- * Creates a Guzzle request object using a ring request array.
- *
- * @param array $request Ring request
- *
- * @return Request
- * @throws \InvalidArgumentException for incomplete requests.
- */
- public static function fromRingRequest(array $request)
- {
- $options = [];
- if (isset($request['version'])) {
- $options['protocol_version'] = $request['version'];
- }
-
- if (!isset($request['http_method'])) {
- throw new \InvalidArgumentException('No http_method');
- }
-
- return new Request(
- $request['http_method'],
- Core::url($request),
- isset($request['headers']) ? $request['headers'] : [],
- isset($request['body']) ? Stream::factory($request['body']) : null,
- $options
- );
- }
-
- /**
- * Get an exception that can be used when a RingPHP handler does not
- * populate a response.
- *
- * @param RequestInterface $request
- *
- * @return RequestException
- */
- public static function getNoRingResponseException(RequestInterface $request)
- {
- $message = <<cookieJar = $cookieJar ?: new CookieJar();
- }
-
- public function getEvents()
- {
- // Fire the cookie plugin complete event before redirecting
- return [
- 'before' => ['onBefore'],
- 'complete' => ['onComplete', RequestEvents::REDIRECT_RESPONSE + 10]
- ];
- }
-
- /**
- * Get the cookie cookieJar
- *
- * @return CookieJarInterface
- */
- public function getCookieJar()
- {
- return $this->cookieJar;
- }
-
- public function onBefore(BeforeEvent $event)
- {
- $this->cookieJar->addCookieHeader($event->getRequest());
- }
-
- public function onComplete(CompleteEvent $event)
- {
- $this->cookieJar->extractCookies(
- $event->getRequest(),
- $event->getResponse()
- );
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Subscriber/History.php b/lib/gerencianet/guzzlehttp/guzzle/src/Subscriber/History.php
deleted file mode 100644
index 5cf0611..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Subscriber/History.php
+++ /dev/null
@@ -1,172 +0,0 @@
-limit = $limit;
- }
-
- public function getEvents()
- {
- return [
- 'complete' => ['onComplete', RequestEvents::EARLY],
- 'error' => ['onError', RequestEvents::EARLY],
- ];
- }
-
- /**
- * Convert to a string that contains all request and response headers
- *
- * @return string
- */
- public function __toString()
- {
- $lines = array();
- foreach ($this->transactions as $entry) {
- $response = isset($entry['response']) ? $entry['response'] : '';
- $lines[] = '> ' . trim($entry['sent_request'])
- . "\n\n< " . trim($response) . "\n";
- }
-
- return implode("\n", $lines);
- }
-
- public function onComplete(CompleteEvent $event)
- {
- $this->add($event->getRequest(), $event->getResponse());
- }
-
- public function onError(ErrorEvent $event)
- {
- // Only track when no response is present, meaning this didn't ever
- // emit a complete event
- if (!$event->getResponse()) {
- $this->add($event->getRequest());
- }
- }
-
- /**
- * Returns an Iterator that yields associative array values where each
- * associative array contains the following key value pairs:
- *
- * - request: Representing the actual request that was received.
- * - sent_request: A clone of the request that will not be mutated.
- * - response: The response that was received (if available).
- *
- * @return \Iterator
- */
- public function getIterator()
- {
- return new \ArrayIterator($this->transactions);
- }
-
- /**
- * Get all of the requests sent through the plugin.
- *
- * Requests can be modified after they are logged by the history
- * subscriber. By default this method will return the actual request
- * instances that were received. Pass true to this method if you wish to
- * get copies of the requests that represent the request state when it was
- * initially logged by the history subscriber.
- *
- * @param bool $asSent Set to true to get clones of the requests that have
- * not been mutated since the request was received by
- * the history subscriber.
- *
- * @return RequestInterface[]
- */
- public function getRequests($asSent = false)
- {
- return array_map(function ($t) use ($asSent) {
- return $asSent ? $t['sent_request'] : $t['request'];
- }, $this->transactions);
- }
-
- /**
- * Get the number of requests in the history
- *
- * @return int
- */
- public function count()
- {
- return count($this->transactions);
- }
-
- /**
- * Get the last request sent.
- *
- * Requests can be modified after they are logged by the history
- * subscriber. By default this method will return the actual request
- * instance that was received. Pass true to this method if you wish to get
- * a copy of the request that represents the request state when it was
- * initially logged by the history subscriber.
- *
- * @param bool $asSent Set to true to get a clone of the last request that
- * has not been mutated since the request was received
- * by the history subscriber.
- *
- * @return RequestInterface
- */
- public function getLastRequest($asSent = false)
- {
- return $asSent
- ? end($this->transactions)['sent_request']
- : end($this->transactions)['request'];
- }
-
- /**
- * Get the last response in the history
- *
- * @return ResponseInterface|null
- */
- public function getLastResponse()
- {
- return end($this->transactions)['response'];
- }
-
- /**
- * Clears the history
- */
- public function clear()
- {
- $this->transactions = array();
- }
-
- /**
- * Add a request to the history
- *
- * @param RequestInterface $request Request to add
- * @param ResponseInterface $response Response of the request
- */
- private function add(
- RequestInterface $request,
- ResponseInterface $response = null
- ) {
- $this->transactions[] = [
- 'request' => $request,
- 'sent_request' => clone $request,
- 'response' => $response
- ];
- if (count($this->transactions) > $this->limit) {
- array_shift($this->transactions);
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Subscriber/HttpError.php b/lib/gerencianet/guzzlehttp/guzzle/src/Subscriber/HttpError.php
deleted file mode 100644
index ed9de5b..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Subscriber/HttpError.php
+++ /dev/null
@@ -1,36 +0,0 @@
- ['onComplete', RequestEvents::VERIFY_RESPONSE]];
- }
-
- /**
- * Throw a RequestException on an HTTP protocol error
- *
- * @param CompleteEvent $event Emitted event
- * @throws RequestException
- */
- public function onComplete(CompleteEvent $event)
- {
- $code = (string) $event->getResponse()->getStatusCode();
- // Throw an exception for an unsuccessful response
- if ($code[0] >= 4) {
- throw RequestException::create(
- $event->getRequest(),
- $event->getResponse()
- );
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Subscriber/Mock.php b/lib/gerencianet/guzzlehttp/guzzle/src/Subscriber/Mock.php
deleted file mode 100644
index 2af4d37..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Subscriber/Mock.php
+++ /dev/null
@@ -1,147 +0,0 @@
-factory = new MessageFactory();
- $this->readBodies = $readBodies;
- $this->addMultiple($items);
- }
-
- public function getEvents()
- {
- // Fire the event last, after signing
- return ['before' => ['onBefore', RequestEvents::SIGN_REQUEST - 10]];
- }
-
- /**
- * @throws \OutOfBoundsException|\Exception
- */
- public function onBefore(BeforeEvent $event)
- {
- if (!$item = array_shift($this->queue)) {
- throw new \OutOfBoundsException('Mock queue is empty');
- } elseif ($item instanceof RequestException) {
- throw $item;
- }
-
- // Emulate reading a response body
- $request = $event->getRequest();
- if ($this->readBodies && $request->getBody()) {
- while (!$request->getBody()->eof()) {
- $request->getBody()->read(8096);
- }
- }
-
- $saveTo = $event->getRequest()->getConfig()->get('save_to');
-
- if (null !== $saveTo) {
- $body = $item->getBody();
-
- if (is_resource($saveTo)) {
- fwrite($saveTo, $body);
- } elseif (is_string($saveTo)) {
- file_put_contents($saveTo, $body);
- } elseif ($saveTo instanceof StreamInterface) {
- $saveTo->write($body);
- }
- }
-
- $event->intercept($item);
- }
-
- public function count()
- {
- return count($this->queue);
- }
-
- /**
- * Add a response to the end of the queue
- *
- * @param string|ResponseInterface $response Response or path to response file
- *
- * @return self
- * @throws \InvalidArgumentException if a string or Response is not passed
- */
- public function addResponse($response)
- {
- if (is_string($response)) {
- $response = file_exists($response)
- ? $this->factory->fromMessage(file_get_contents($response))
- : $this->factory->fromMessage($response);
- } elseif (!($response instanceof ResponseInterface)) {
- throw new \InvalidArgumentException('Response must a message '
- . 'string, response object, or path to a file');
- }
-
- $this->queue[] = $response;
-
- return $this;
- }
-
- /**
- * Add an exception to the end of the queue
- *
- * @param RequestException $e Exception to throw when the request is executed
- *
- * @return self
- */
- public function addException(RequestException $e)
- {
- $this->queue[] = $e;
-
- return $this;
- }
-
- /**
- * Add multiple items to the queue
- *
- * @param array $items Items to add
- */
- public function addMultiple(array $items)
- {
- foreach ($items as $item) {
- if ($item instanceof RequestException) {
- $this->addException($item);
- } else {
- $this->addResponse($item);
- }
- }
- }
-
- /**
- * Clear the queue
- */
- public function clearQueue()
- {
- $this->queue = [];
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Subscriber/Prepare.php b/lib/gerencianet/guzzlehttp/guzzle/src/Subscriber/Prepare.php
deleted file mode 100644
index b5ed4e2..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Subscriber/Prepare.php
+++ /dev/null
@@ -1,130 +0,0 @@
- ['onBefore', RequestEvents::PREPARE_REQUEST]];
- }
-
- public function onBefore(BeforeEvent $event)
- {
- $request = $event->getRequest();
-
- // Set the appropriate Content-Type for a request if one is not set and
- // there are form fields
- if (!($body = $request->getBody())) {
- return;
- }
-
- $this->addContentLength($request, $body);
-
- if ($body instanceof AppliesHeadersInterface) {
- // Synchronize the body with the request headers
- $body->applyRequestHeaders($request);
- } elseif (!$request->hasHeader('Content-Type')) {
- $this->addContentType($request, $body);
- }
-
- $this->addExpectHeader($request, $body);
- }
-
- private function addContentType(
- RequestInterface $request,
- StreamInterface $body
- ) {
- if (!($uri = $body->getMetadata('uri'))) {
- return;
- }
-
- // Guess the content-type based on the stream's "uri" metadata value.
- // The file extension is used to determine the appropriate mime-type.
- if ($contentType = Mimetypes::getInstance()->fromFilename($uri)) {
- $request->setHeader('Content-Type', $contentType);
- }
- }
-
- private function addContentLength(
- RequestInterface $request,
- StreamInterface $body
- ) {
- // Set the Content-Length header if it can be determined, and never
- // send a Transfer-Encoding: chunked and Content-Length header in
- // the same request.
- if ($request->hasHeader('Content-Length')) {
- // Remove transfer-encoding if content-length is set.
- $request->removeHeader('Transfer-Encoding');
- return;
- }
-
- if ($request->hasHeader('Transfer-Encoding')) {
- return;
- }
-
- if (null !== ($size = $body->getSize())) {
- $request->setHeader('Content-Length', $size);
- $request->removeHeader('Transfer-Encoding');
- } elseif ('1.1' == $request->getProtocolVersion()) {
- // Use chunked Transfer-Encoding if there is no determinable
- // content-length header and we're using HTTP/1.1.
- $request->setHeader('Transfer-Encoding', 'chunked');
- $request->removeHeader('Content-Length');
- }
- }
-
- private function addExpectHeader(
- RequestInterface $request,
- StreamInterface $body
- ) {
- // Determine if the Expect header should be used
- if ($request->hasHeader('Expect')) {
- return;
- }
-
- $expect = $request->getConfig()['expect'];
-
- // Return if disabled or if you're not using HTTP/1.1
- if ($expect === false || $request->getProtocolVersion() !== '1.1') {
- return;
- }
-
- // The expect header is unconditionally enabled
- if ($expect === true) {
- $request->setHeader('Expect', '100-Continue');
- return;
- }
-
- // By default, send the expect header when the payload is > 1mb
- if ($expect === null) {
- $expect = 1048576;
- }
-
- // Always add if the body cannot be rewound, the size cannot be
- // determined, or the size is greater than the cutoff threshold
- $size = $body->getSize();
- if ($size === null || $size >= (int) $expect || !$body->isSeekable()) {
- $request->setHeader('Expect', '100-Continue');
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Subscriber/Redirect.php b/lib/gerencianet/guzzlehttp/guzzle/src/Subscriber/Redirect.php
deleted file mode 100644
index ff99226..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Subscriber/Redirect.php
+++ /dev/null
@@ -1,176 +0,0 @@
- ['onComplete', RequestEvents::REDIRECT_RESPONSE]];
- }
-
- /**
- * Rewind the entity body of the request if needed
- *
- * @param RequestInterface $redirectRequest
- * @throws CouldNotRewindStreamException
- */
- public static function rewindEntityBody(RequestInterface $redirectRequest)
- {
- // Rewind the entity body of the request if needed
- if ($body = $redirectRequest->getBody()) {
- // Only rewind the body if some of it has been read already, and
- // throw an exception if the rewind fails
- if ($body->tell() && !$body->seek(0)) {
- throw new CouldNotRewindStreamException(
- 'Unable to rewind the non-seekable request body after redirecting',
- $redirectRequest
- );
- }
- }
- }
-
- /**
- * Called when a request receives a redirect response
- *
- * @param CompleteEvent $event Event emitted
- * @throws TooManyRedirectsException
- */
- public function onComplete(CompleteEvent $event)
- {
- $response = $event->getResponse();
-
- if (substr($response->getStatusCode(), 0, 1) != '3'
- || !$response->hasHeader('Location')
- ) {
- return;
- }
-
- $request = $event->getRequest();
- $config = $request->getConfig();
-
- // Increment the redirect and initialize the redirect state.
- if ($redirectCount = $config['redirect_count']) {
- $config['redirect_count'] = ++$redirectCount;
- } else {
- $config['redirect_scheme'] = $request->getScheme();
- $config['redirect_count'] = $redirectCount = 1;
- }
-
- $max = $config->getPath('redirect/max') ?: 5;
-
- if ($redirectCount > $max) {
- throw new TooManyRedirectsException(
- "Will not follow more than {$redirectCount} redirects",
- $request
- );
- }
-
- $this->modifyRedirectRequest($request, $response);
- $event->retry();
- }
-
- private function modifyRedirectRequest(
- RequestInterface $request,
- ResponseInterface $response
- ) {
- $config = $request->getConfig();
- $protocols = $config->getPath('redirect/protocols') ?: ['http', 'https'];
-
- // Use a GET request if this is an entity enclosing request and we are
- // not forcing RFC compliance, but rather emulating what all browsers
- // would do.
- $statusCode = $response->getStatusCode();
- if ($statusCode == 303 ||
- ($statusCode <= 302 && $request->getBody() && !$config->getPath('redirect/strict'))
- ) {
- $request->setMethod('GET');
- $request->setBody(null);
- }
-
- $previousUrl = $request->getUrl();
- $this->setRedirectUrl($request, $response, $protocols);
- $this->rewindEntityBody($request);
-
- // Add the Referer header if it is told to do so and only
- // add the header if we are not redirecting from https to http.
- if ($config->getPath('redirect/referer')
- && ($request->getScheme() == 'https' || $request->getScheme() == $config['redirect_scheme'])
- ) {
- $url = Url::fromString($previousUrl);
- $url->setUsername(null);
- $url->setPassword(null);
- $request->setHeader('Referer', (string) $url);
- } else {
- $request->removeHeader('Referer');
- }
- }
-
- /**
- * Set the appropriate URL on the request based on the location header
- *
- * @param RequestInterface $request
- * @param ResponseInterface $response
- * @param array $protocols
- */
- private function setRedirectUrl(
- RequestInterface $request,
- ResponseInterface $response,
- array $protocols
- ) {
- $location = $response->getHeader('Location');
- $location = Url::fromString($location);
-
- // Combine location with the original URL if it is not absolute.
- if (!$location->isAbsolute()) {
- $originalUrl = Url::fromString($request->getUrl());
- // Remove query string parameters and just take what is present on
- // the redirect Location header
- $originalUrl->getQuery()->clear();
- $location = $originalUrl->combine($location);
- }
-
- // Ensure that the redirect URL is allowed based on the protocols.
- if (!in_array($location->getScheme(), $protocols)) {
- throw new BadResponseException(
- sprintf(
- 'Redirect URL, %s, does not use one of the allowed redirect protocols: %s',
- $location,
- implode(', ', $protocols)
- ),
- $request,
- $response
- );
- }
-
- $request->setUrl($location);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/ToArrayInterface.php b/lib/gerencianet/guzzlehttp/guzzle/src/ToArrayInterface.php
deleted file mode 100644
index d57c022..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/ToArrayInterface.php
+++ /dev/null
@@ -1,15 +0,0 @@
-client = $client;
- $this->request = $request;
- $this->_future = $future;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/TransferStats.php b/lib/gerencianet/guzzlehttp/guzzle/src/TransferStats.php
new file mode 100644
index 0000000..93fa334
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/TransferStats.php
@@ -0,0 +1,133 @@
+request = $request;
+ $this->response = $response;
+ $this->transferTime = $transferTime;
+ $this->handlerErrorData = $handlerErrorData;
+ $this->handlerStats = $handlerStats;
+ }
+
+ public function getRequest(): RequestInterface
+ {
+ return $this->request;
+ }
+
+ /**
+ * Returns the response that was received (if any).
+ */
+ public function getResponse(): ?ResponseInterface
+ {
+ return $this->response;
+ }
+
+ /**
+ * Returns true if a response was received.
+ */
+ public function hasResponse(): bool
+ {
+ return $this->response !== null;
+ }
+
+ /**
+ * Gets handler specific error data.
+ *
+ * This might be an exception, a integer representing an error code, or
+ * anything else. Relying on this value assumes that you know what handler
+ * you are using.
+ *
+ * @return mixed
+ */
+ public function getHandlerErrorData()
+ {
+ return $this->handlerErrorData;
+ }
+
+ /**
+ * Get the effective URI the request was sent to.
+ */
+ public function getEffectiveUri(): UriInterface
+ {
+ return $this->request->getUri();
+ }
+
+ /**
+ * Get the estimated time the request was being transferred by the handler.
+ *
+ * @return float|null Time in seconds.
+ */
+ public function getTransferTime(): ?float
+ {
+ return $this->transferTime;
+ }
+
+ /**
+ * Gets an array of all of the handler specific transfer data.
+ */
+ public function getHandlerStats(): array
+ {
+ return $this->handlerStats;
+ }
+
+ /**
+ * Get a specific handler statistic from the handler by name.
+ *
+ * @param string $stat Handler specific transfer stat to retrieve.
+ *
+ * @return mixed|null
+ */
+ public function getHandlerStat(string $stat)
+ {
+ return $this->handlerStats[$stat] ?? null;
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/UriTemplate.php b/lib/gerencianet/guzzlehttp/guzzle/src/UriTemplate.php
deleted file mode 100644
index 55dfeb5..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/UriTemplate.php
+++ /dev/null
@@ -1,241 +0,0 @@
- array('prefix' => '', 'joiner' => ',', 'query' => false),
- '+' => array('prefix' => '', 'joiner' => ',', 'query' => false),
- '#' => array('prefix' => '#', 'joiner' => ',', 'query' => false),
- '.' => array('prefix' => '.', 'joiner' => '.', 'query' => false),
- '/' => array('prefix' => '/', 'joiner' => '/', 'query' => false),
- ';' => array('prefix' => ';', 'joiner' => ';', 'query' => true),
- '?' => array('prefix' => '?', 'joiner' => '&', 'query' => true),
- '&' => array('prefix' => '&', 'joiner' => '&', 'query' => true)
- );
-
- /** @var array Delimiters */
- private static $delims = array(':', '/', '?', '#', '[', ']', '@', '!', '$',
- '&', '\'', '(', ')', '*', '+', ',', ';', '=');
-
- /** @var array Percent encoded delimiters */
- private static $delimsPct = array('%3A', '%2F', '%3F', '%23', '%5B', '%5D',
- '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C',
- '%3B', '%3D');
-
- public function expand($template, array $variables)
- {
- if (false === strpos($template, '{')) {
- return $template;
- }
-
- $this->template = $template;
- $this->variables = $variables;
-
- return preg_replace_callback(
- '/\{([^\}]+)\}/',
- [$this, 'expandMatch'],
- $this->template
- );
- }
-
- /**
- * Parse an expression into parts
- *
- * @param string $expression Expression to parse
- *
- * @return array Returns an associative array of parts
- */
- private function parseExpression($expression)
- {
- $result = array();
-
- if (isset(self::$operatorHash[$expression[0]])) {
- $result['operator'] = $expression[0];
- $expression = substr($expression, 1);
- } else {
- $result['operator'] = '';
- }
-
- foreach (explode(',', $expression) as $value) {
- $value = trim($value);
- $varspec = array();
- if ($colonPos = strpos($value, ':')) {
- $varspec['value'] = substr($value, 0, $colonPos);
- $varspec['modifier'] = ':';
- $varspec['position'] = (int) substr($value, $colonPos + 1);
- } elseif (substr($value, -1) == '*') {
- $varspec['modifier'] = '*';
- $varspec['value'] = substr($value, 0, -1);
- } else {
- $varspec['value'] = (string) $value;
- $varspec['modifier'] = '';
- }
- $result['values'][] = $varspec;
- }
-
- return $result;
- }
-
- /**
- * Process an expansion
- *
- * @param array $matches Matches met in the preg_replace_callback
- *
- * @return string Returns the replacement string
- */
- private function expandMatch(array $matches)
- {
- static $rfc1738to3986 = array('+' => '%20', '%7e' => '~');
-
- $replacements = array();
- $parsed = self::parseExpression($matches[1]);
- $prefix = self::$operatorHash[$parsed['operator']]['prefix'];
- $joiner = self::$operatorHash[$parsed['operator']]['joiner'];
- $useQuery = self::$operatorHash[$parsed['operator']]['query'];
-
- foreach ($parsed['values'] as $value) {
-
- if (!isset($this->variables[$value['value']])) {
- continue;
- }
-
- $variable = $this->variables[$value['value']];
- $actuallyUseQuery = $useQuery;
- $expanded = '';
-
- if (is_array($variable)) {
-
- $isAssoc = $this->isAssoc($variable);
- $kvp = array();
- foreach ($variable as $key => $var) {
-
- if ($isAssoc) {
- $key = rawurlencode($key);
- $isNestedArray = is_array($var);
- } else {
- $isNestedArray = false;
- }
-
- if (!$isNestedArray) {
- $var = rawurlencode($var);
- if ($parsed['operator'] == '+' ||
- $parsed['operator'] == '#'
- ) {
- $var = $this->decodeReserved($var);
- }
- }
-
- if ($value['modifier'] == '*') {
- if ($isAssoc) {
- if ($isNestedArray) {
- // Nested arrays must allow for deeply nested
- // structures.
- $var = strtr(
- http_build_query([$key => $var]),
- $rfc1738to3986
- );
- } else {
- $var = $key . '=' . $var;
- }
- } elseif ($key > 0 && $actuallyUseQuery) {
- $var = $value['value'] . '=' . $var;
- }
- }
-
- $kvp[$key] = $var;
- }
-
- if (empty($variable)) {
- $actuallyUseQuery = false;
- } elseif ($value['modifier'] == '*') {
- $expanded = implode($joiner, $kvp);
- if ($isAssoc) {
- // Don't prepend the value name when using the explode
- // modifier with an associative array.
- $actuallyUseQuery = false;
- }
- } else {
- if ($isAssoc) {
- // When an associative array is encountered and the
- // explode modifier is not set, then the result must be
- // a comma separated list of keys followed by their
- // respective values.
- foreach ($kvp as $k => &$v) {
- $v = $k . ',' . $v;
- }
- }
- $expanded = implode(',', $kvp);
- }
-
- } else {
- if ($value['modifier'] == ':') {
- $variable = substr($variable, 0, $value['position']);
- }
- $expanded = rawurlencode($variable);
- if ($parsed['operator'] == '+' || $parsed['operator'] == '#') {
- $expanded = $this->decodeReserved($expanded);
- }
- }
-
- if ($actuallyUseQuery) {
- if (!$expanded && $joiner != '&') {
- $expanded = $value['value'];
- } else {
- $expanded = $value['value'] . '=' . $expanded;
- }
- }
-
- $replacements[] = $expanded;
- }
-
- $ret = implode($joiner, $replacements);
- if ($ret && $prefix) {
- return $prefix . $ret;
- }
-
- return $ret;
- }
-
- /**
- * Determines if an array is associative.
- *
- * This makes the assumption that input arrays are sequences or hashes.
- * This assumption is a tradeoff for accuracy in favor of speed, but it
- * should work in almost every case where input is supplied for a URI
- * template.
- *
- * @param array $array Array to check
- *
- * @return bool
- */
- private function isAssoc(array $array)
- {
- return $array && array_keys($array)[0] !== 0;
- }
-
- /**
- * Removes percent encoding on reserved characters (used with + and #
- * modifiers).
- *
- * @param string $string String to fix
- *
- * @return string
- */
- private function decodeReserved($string)
- {
- return str_replace(self::$delimsPct, self::$delims, $string);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Url.php b/lib/gerencianet/guzzlehttp/guzzle/src/Url.php
deleted file mode 100644
index 637f60c..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Url.php
+++ /dev/null
@@ -1,595 +0,0 @@
- 80, 'https' => 443, 'ftp' => 21];
- private static $pathPattern = '/[^a-zA-Z0-9\-\._~!\$&\'\(\)\*\+,;=%:@\/]+|%(?![A-Fa-f0-9]{2})/';
- private static $queryPattern = '/[^a-zA-Z0-9\-\._~!\$\'\(\)\*\+,;%:@\/\?=&]+|%(?![A-Fa-f0-9]{2})/';
- /** @var Query|string Query part of the URL */
- private $query;
-
- /**
- * Factory method to create a new URL from a URL string
- *
- * @param string $url Full URL used to create a Url object
- *
- * @return Url
- * @throws \InvalidArgumentException
- */
- public static function fromString($url)
- {
- static $defaults = ['scheme' => null, 'host' => null,
- 'path' => null, 'port' => null, 'query' => null,
- 'user' => null, 'pass' => null, 'fragment' => null];
-
- if (false === ($parts = parse_url($url))) {
- throw new \InvalidArgumentException('Unable to parse malformed '
- . 'url: ' . $url);
- }
-
- $parts += $defaults;
-
- // Convert the query string into a Query object
- if ($parts['query'] || 0 !== strlen($parts['query'])) {
- $parts['query'] = Query::fromString($parts['query']);
- }
-
- return new static($parts['scheme'], $parts['host'], $parts['user'],
- $parts['pass'], $parts['port'], $parts['path'], $parts['query'],
- $parts['fragment']);
- }
-
- /**
- * Build a URL from parse_url parts. The generated URL will be a relative
- * URL if a scheme or host are not provided.
- *
- * @param array $parts Array of parse_url parts
- *
- * @return string
- */
- public static function buildUrl(array $parts)
- {
- $url = $scheme = '';
-
- if (!empty($parts['scheme'])) {
- $scheme = $parts['scheme'];
- $url .= $scheme . ':';
- }
-
- if (!empty($parts['host'])) {
- $url .= '//';
- if (isset($parts['user'])) {
- $url .= $parts['user'];
- if (isset($parts['pass'])) {
- $url .= ':' . $parts['pass'];
- }
- $url .= '@';
- }
-
- $url .= $parts['host'];
-
- // Only include the port if it is not the default port of the scheme
- if (isset($parts['port']) &&
- (!isset(self::$defaultPorts[$scheme]) ||
- $parts['port'] != self::$defaultPorts[$scheme])
- ) {
- $url .= ':' . $parts['port'];
- }
- }
-
- // Add the path component if present
- if (isset($parts['path']) && strlen($parts['path'])) {
- // Always ensure that the path begins with '/' if set and something
- // is before the path
- if (!empty($parts['host']) && $parts['path'][0] != '/') {
- $url .= '/';
- }
- $url .= $parts['path'];
- }
-
- // Add the query string if present
- if (isset($parts['query'])) {
- $queryStr = (string) $parts['query'];
- if ($queryStr || $queryStr === '0') {
- $url .= '?' . $queryStr;
- }
- }
-
- // Ensure that # is only added to the url if fragment contains anything.
- if (isset($parts['fragment'])) {
- $url .= '#' . $parts['fragment'];
- }
-
- return $url;
- }
-
- /**
- * Create a new URL from URL parts
- *
- * @param string $scheme Scheme of the URL
- * @param string $host Host of the URL
- * @param string $username Username of the URL
- * @param string $password Password of the URL
- * @param int $port Port of the URL
- * @param string $path Path of the URL
- * @param Query|array|string $query Query string of the URL
- * @param string $fragment Fragment of the URL
- */
- public function __construct(
- $scheme,
- $host,
- $username = null,
- $password = null,
- $port = null,
- $path = null,
- $query = null,
- $fragment = null
- ) {
- $this->scheme = strtolower($scheme);
- $this->host = $host;
- $this->port = $port;
- $this->username = $username;
- $this->password = $password;
- $this->fragment = $fragment;
-
- if ($query) {
- $this->setQuery($query);
- }
-
- $this->setPath($path);
- }
-
- /**
- * Clone the URL
- */
- public function __clone()
- {
- if ($this->query instanceof Query) {
- $this->query = clone $this->query;
- }
- }
-
- /**
- * Returns the URL as a URL string
- *
- * @return string
- */
- public function __toString()
- {
- return static::buildUrl($this->getParts());
- }
-
- /**
- * Get the parts of the URL as an array
- *
- * @return array
- */
- public function getParts()
- {
- return array(
- 'scheme' => $this->scheme,
- 'user' => $this->username,
- 'pass' => $this->password,
- 'host' => $this->host,
- 'port' => $this->port,
- 'path' => $this->path,
- 'query' => $this->query,
- 'fragment' => $this->fragment,
- );
- }
-
- /**
- * Set the host of the request.
- *
- * @param string $host Host to set (e.g. www.yahoo.com, yahoo.com)
- *
- * @return Url
- */
- public function setHost($host)
- {
- if (strpos($host, ':') === false) {
- $this->host = $host;
- } else {
- list($host, $port) = explode(':', $host);
- $this->host = $host;
- $this->setPort($port);
- }
- }
-
- /**
- * Get the host part of the URL
- *
- * @return string
- */
- public function getHost()
- {
- return $this->host;
- }
-
- /**
- * Set the scheme part of the URL (http, https, ftp, etc.)
- *
- * @param string $scheme Scheme to set
- */
- public function setScheme($scheme)
- {
- // Remove the default port if one is specified
- if ($this->port
- && isset(self::$defaultPorts[$this->scheme])
- && self::$defaultPorts[$this->scheme] == $this->port
- ) {
- $this->port = null;
- }
-
- $this->scheme = strtolower($scheme);
- }
-
- /**
- * Get the scheme part of the URL
- *
- * @return string
- */
- public function getScheme()
- {
- return $this->scheme;
- }
-
- /**
- * Set the port part of the URL
- *
- * @param int $port Port to set
- */
- public function setPort($port)
- {
- $this->port = $port;
- }
-
- /**
- * Get the port part of the URl.
- *
- * If no port was set, this method will return the default port for the
- * scheme of the URI.
- *
- * @return int|null
- */
- public function getPort()
- {
- if ($this->port) {
- return $this->port;
- } elseif (isset(self::$defaultPorts[$this->scheme])) {
- return self::$defaultPorts[$this->scheme];
- }
-
- return null;
- }
-
- /**
- * Set the path part of the URL.
- *
- * The provided URL is URL encoded as necessary.
- *
- * @param string $path Path string to set
- */
- public function setPath($path)
- {
- $this->path = self::encodePath($path);
- }
-
- /**
- * Removes dot segments from a URL
- * @link http://tools.ietf.org/html/rfc3986#section-5.2.4
- */
- public function removeDotSegments()
- {
- static $noopPaths = ['' => true, '/' => true, '*' => true];
- static $ignoreSegments = ['.' => true, '..' => true];
-
- if (isset($noopPaths[$this->path])) {
- return;
- }
-
- $results = [];
- $segments = $this->getPathSegments();
- foreach ($segments as $segment) {
- if ($segment == '..') {
- array_pop($results);
- } elseif (!isset($ignoreSegments[$segment])) {
- $results[] = $segment;
- }
- }
-
- $newPath = implode('/', $results);
-
- // Add the leading slash if necessary
- if (substr($this->path, 0, 1) === '/' &&
- substr($newPath, 0, 1) !== '/'
- ) {
- $newPath = '/' . $newPath;
- }
-
- // Add the trailing slash if necessary
- if ($newPath != '/' && isset($ignoreSegments[end($segments)])) {
- $newPath .= '/';
- }
-
- $this->path = $newPath;
- }
-
- /**
- * Add a relative path to the currently set path.
- *
- * @param string $relativePath Relative path to add
- */
- public function addPath($relativePath)
- {
- if ($relativePath != '/' &&
- is_string($relativePath) &&
- strlen($relativePath) > 0
- ) {
- // Add a leading slash if needed
- if ($relativePath[0] !== '/' &&
- substr($this->path, -1, 1) !== '/'
- ) {
- $relativePath = '/' . $relativePath;
- }
-
- $this->setPath($this->path . $relativePath);
- }
- }
-
- /**
- * Get the path part of the URL
- *
- * @return string
- */
- public function getPath()
- {
- return $this->path;
- }
-
- /**
- * Get the path segments of the URL as an array
- *
- * @return array
- */
- public function getPathSegments()
- {
- return explode('/', $this->path);
- }
-
- /**
- * Set the password part of the URL
- *
- * @param string $password Password to set
- */
- public function setPassword($password)
- {
- $this->password = $password;
- }
-
- /**
- * Get the password part of the URL
- *
- * @return null|string
- */
- public function getPassword()
- {
- return $this->password;
- }
-
- /**
- * Set the username part of the URL
- *
- * @param string $username Username to set
- */
- public function setUsername($username)
- {
- $this->username = $username;
- }
-
- /**
- * Get the username part of the URl
- *
- * @return null|string
- */
- public function getUsername()
- {
- return $this->username;
- }
-
- /**
- * Get the query part of the URL as a Query object
- *
- * @return Query
- */
- public function getQuery()
- {
- // Convert the query string to a query object if not already done.
- if (!$this->query instanceof Query) {
- $this->query = $this->query === null
- ? new Query()
- : Query::fromString($this->query);
- }
-
- return $this->query;
- }
-
- /**
- * Set the query part of the URL.
- *
- * You may provide a query string as a string and pass $rawString as true
- * to provide a query string that is not parsed until a call to getQuery()
- * is made. Setting a raw query string will still encode invalid characters
- * in a query string.
- *
- * @param Query|string|array $query Query string value to set. Can
- * be a string that will be parsed into a Query object, an array
- * of key value pairs, or a Query object.
- * @param bool $rawString Set to true when providing a raw query string.
- *
- * @throws \InvalidArgumentException
- */
- public function setQuery($query, $rawString = false)
- {
- if ($query instanceof Query) {
- $this->query = $query;
- } elseif (is_string($query)) {
- if (!$rawString) {
- $this->query = Query::fromString($query);
- } else {
- // Ensure the query does not have illegal characters.
- $this->query = preg_replace_callback(
- self::$queryPattern,
- [__CLASS__, 'encodeMatch'],
- $query
- );
- }
-
- } elseif (is_array($query)) {
- $this->query = new Query($query);
- } else {
- throw new \InvalidArgumentException('Query must be a Query, '
- . 'array, or string. Got ' . Core::describeType($query));
- }
- }
-
- /**
- * Get the fragment part of the URL
- *
- * @return null|string
- */
- public function getFragment()
- {
- return $this->fragment;
- }
-
- /**
- * Set the fragment part of the URL
- *
- * @param string $fragment Fragment to set
- */
- public function setFragment($fragment)
- {
- $this->fragment = $fragment;
- }
-
- /**
- * Check if this is an absolute URL
- *
- * @return bool
- */
- public function isAbsolute()
- {
- return $this->scheme && $this->host;
- }
-
- /**
- * Combine the URL with another URL and return a new URL instance.
- *
- * Follows the rules specific in RFC 3986 section 5.4.
- *
- * @param string $url Relative URL to combine with
- *
- * @return Url
- * @throws \InvalidArgumentException
- * @link http://tools.ietf.org/html/rfc3986#section-5.4
- */
- public function combine($url)
- {
- $url = static::fromString($url);
-
- // Use the more absolute URL as the base URL
- if (!$this->isAbsolute() && $url->isAbsolute()) {
- $url = $url->combine($this);
- }
-
- $parts = $url->getParts();
-
- // Passing a URL with a scheme overrides everything
- if ($parts['scheme']) {
- return clone $url;
- }
-
- // Setting a host overrides the entire rest of the URL
- if ($parts['host']) {
- return new static(
- $this->scheme,
- $parts['host'],
- $parts['user'],
- $parts['pass'],
- $parts['port'],
- $parts['path'],
- $parts['query'] instanceof Query
- ? clone $parts['query']
- : $parts['query'],
- $parts['fragment']
- );
- }
-
- if (!$parts['path'] && $parts['path'] !== '0') {
- // The relative URL has no path, so check if it is just a query
- $path = $this->path ?: '';
- $query = $parts['query'] ?: $this->query;
- } else {
- $query = $parts['query'];
- if ($parts['path'][0] == '/' || !$this->path) {
- // Overwrite the existing path if the rel path starts with "/"
- $path = $parts['path'];
- } else {
- // If the relative URL does not have a path or the base URL
- // path does not end in a "/" then overwrite the existing path
- // up to the last "/"
- $path = substr($this->path, 0, strrpos($this->path, '/') + 1) . $parts['path'];
- }
- }
-
- $result = new self(
- $this->scheme,
- $this->host,
- $this->username,
- $this->password,
- $this->port,
- $path,
- $query instanceof Query ? clone $query : $query,
- $parts['fragment']
- );
-
- if ($path) {
- $result->removeDotSegments();
- }
-
- return $result;
- }
-
- /**
- * Encodes the path part of a URL without double-encoding percent-encoded
- * key value pairs.
- *
- * @param string $path Path to encode
- *
- * @return string
- */
- public static function encodePath($path)
- {
- static $cb = [__CLASS__, 'encodeMatch'];
- return preg_replace_callback(self::$pathPattern, $cb, $path);
- }
-
- private static function encodeMatch(array $match)
- {
- return rawurlencode($match[0]);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/Utils.php b/lib/gerencianet/guzzlehttp/guzzle/src/Utils.php
index 1c89661..1e4e704 100644
--- a/lib/gerencianet/guzzlehttp/guzzle/src/Utils.php
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/Utils.php
@@ -1,211 +1,382 @@
expand($template, $variables);
+ foreach ($noProxyArray as $area) {
+ // Always match on wildcards.
+ if ($area === '*') {
+ return true;
+ } elseif (empty($area)) {
+ // Don't match on empty values.
+ continue;
+ } elseif ($area === $host) {
+ // Exact matches.
+ return true;
+ }
+ // Special match if the area when prefixed with ".". Remove any
+ // existing leading "." and add a new leading ".".
+ $area = '.' . \ltrim($area, '.');
+ if (\substr($host, -(\strlen($area))) === $area) {
+ return true;
+ }
+ }
+
+ return false;
}
/**
- * Wrapper for JSON decode that implements error detection with helpful
- * error messages.
+ * Wrapper for json_decode that throws when an error occurs.
*
* @param string $json JSON data to parse
- * @param bool $assoc When true, returned objects will be converted
+ * @param bool $assoc When true, returned objects will be converted
* into associative arrays.
* @param int $depth User specified recursion depth.
* @param int $options Bitmask of JSON decode options.
*
- * @return mixed
- * @throws \InvalidArgumentException if the JSON cannot be parsed.
- * @link http://www.php.net/manual/en/function.json-decode.php
+ * @return object|array|string|int|float|bool|null
+ *
+ * @throws InvalidArgumentException if the JSON cannot be decoded.
+ *
+ * @link https://www.php.net/manual/en/function.json-decode.php
*/
- public static function jsonDecode($json, $assoc = false, $depth = 512, $options = 0)
+ public static function jsonDecode(string $json, bool $assoc = false, int $depth = 512, int $options = 0)
{
- static $jsonErrors = [
- JSON_ERROR_DEPTH => 'JSON_ERROR_DEPTH - Maximum stack depth exceeded',
- JSON_ERROR_STATE_MISMATCH => 'JSON_ERROR_STATE_MISMATCH - Underflow or the modes mismatch',
- JSON_ERROR_CTRL_CHAR => 'JSON_ERROR_CTRL_CHAR - Unexpected control character found',
- JSON_ERROR_SYNTAX => 'JSON_ERROR_SYNTAX - Syntax error, malformed JSON',
- JSON_ERROR_UTF8 => 'JSON_ERROR_UTF8 - Malformed UTF-8 characters, possibly incorrectly encoded'
- ];
-
$data = \json_decode($json, $assoc, $depth, $options);
-
- if (JSON_ERROR_NONE !== json_last_error()) {
- $last = json_last_error();
- throw new \InvalidArgumentException(
- 'Unable to parse JSON data: '
- . (isset($jsonErrors[$last])
- ? $jsonErrors[$last]
- : 'Unknown error')
- );
+ if (\JSON_ERROR_NONE !== \json_last_error()) {
+ throw new InvalidArgumentException('json_decode error: ' . \json_last_error_msg());
}
return $data;
}
/**
- * Get the default User-Agent string to use with Guzzle
+ * Wrapper for JSON encoding that throws when an error occurs.
*
- * @return string
+ * @param mixed $value The value being encoded
+ * @param int $options JSON encode option bitmask
+ * @param int $depth Set the maximum depth. Must be greater than zero.
+ *
+ * @throws InvalidArgumentException if the JSON cannot be encoded.
+ *
+ * @link https://www.php.net/manual/en/function.json-encode.php
*/
- public static function getDefaultUserAgent()
+ public static function jsonEncode($value, int $options = 0, int $depth = 512): string
{
- static $defaultAgent = '';
- if (!$defaultAgent) {
- $defaultAgent = 'Guzzle/' . ClientInterface::VERSION;
- if (extension_loaded('curl')) {
- $defaultAgent .= ' curl/' . curl_version()['version'];
- }
- $defaultAgent .= ' PHP/' . PHP_VERSION;
+ $json = \json_encode($value, $options, $depth);
+ if (\JSON_ERROR_NONE !== \json_last_error()) {
+ throw new InvalidArgumentException('json_encode error: ' . \json_last_error_msg());
}
- return $defaultAgent;
+ /** @var string */
+ return $json;
}
/**
- * Create a default handler to use based on the environment
+ * Wrapper for the hrtime() or microtime() functions
+ * (depending on the PHP version, one of the two is used)
*
- * @throws \RuntimeException if no viable Handler is available.
+ * @return float UNIX timestamp
+ *
+ * @internal
+ */
+ public static function currentTime(): float
+ {
+ return (float) \function_exists('hrtime') ? \hrtime(true) / 1e9 : \microtime(true);
+ }
+
+ /**
+ * @throws InvalidArgumentException
+ *
+ * @internal
*/
- public static function getDefaultHandler()
+ public static function idnUriConvert(UriInterface $uri, int $options = 0): UriInterface
{
- $default = $future = null;
-
- if (extension_loaded('curl')) {
- $config = [
- 'select_timeout' => getenv('GUZZLE_CURL_SELECT_TIMEOUT') ?: 1
- ];
- if ($maxHandles = getenv('GUZZLE_CURL_MAX_HANDLES')) {
- $config['max_handles'] = $maxHandles;
+ if ($uri->getHost()) {
+ $asciiHost = self::idnToAsci($uri->getHost(), $options, $info);
+ if ($asciiHost === false) {
+ $errorBitSet = $info['errors'] ?? 0;
+
+ $errorConstants = array_filter(array_keys(get_defined_constants()), static function ($name) {
+ return substr($name, 0, 11) === 'IDNA_ERROR_';
+ });
+
+ $errors = [];
+ foreach ($errorConstants as $errorConstant) {
+ if ($errorBitSet & constant($errorConstant)) {
+ $errors[] = $errorConstant;
+ }
+ }
+
+ $errorMessage = 'IDN conversion failed';
+ if ($errors) {
+ $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')';
+ }
+
+ throw new InvalidArgumentException($errorMessage);
}
- if (function_exists('curl_reset')) {
- $default = new CurlHandler();
- $future = new CurlMultiHandler($config);
- } else {
- $default = new CurlMultiHandler($config);
+ if ($uri->getHost() !== $asciiHost) {
+ // Replace URI only if the ASCII version is different
+ $uri = $uri->withHost($asciiHost);
}
}
- if (ini_get('allow_url_fopen')) {
- $default = !$default
- ? new StreamHandler()
- : Middleware::wrapStreaming($default, new StreamHandler());
- } elseif (!$default) {
- throw new \RuntimeException('Guzzle requires cURL, the '
- . 'allow_url_fopen ini setting, or a custom HTTP handler.');
+ return $uri;
+ }
+
+ /**
+ * @internal
+ */
+ public static function getenv(string $name): ?string
+ {
+ if (isset($_SERVER[$name])) {
+ return (string) $_SERVER[$name];
+ }
+
+ if (\PHP_SAPI === 'cli' && ($value = \getenv($name)) !== false && $value !== null) {
+ return (string) $value;
+ }
+
+ return null;
+ }
+
+ /**
+ * @return string|false
+ */
+ private static function idnToAsci(string $domain, int $options, ?array &$info = [])
+ {
+ if (\function_exists('idn_to_ascii') && \defined('INTL_IDNA_VARIANT_UTS46')) {
+ return \idn_to_ascii($domain, $options, \INTL_IDNA_VARIANT_UTS46, $info);
}
- return $future ? Middleware::wrapFuture($default, $future) : $default;
+ throw new \Error('ext-idn or symfony/polyfill-intl-idn not loaded or too old');
}
}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/src/functions.php b/lib/gerencianet/guzzlehttp/guzzle/src/functions.php
new file mode 100644
index 0000000..a70d2cb
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/src/functions.php
@@ -0,0 +1,167 @@
+assertCount(3, $batch);
- $this->assertEquals([$a, $b, $c], $batch->getKeys());
- $this->assertEquals([$hash[$c]], $batch->getFailures());
- $this->assertEquals(['1', '2'], $batch->getSuccessful());
- $this->assertEquals('1', $batch->getResult($a));
- $this->assertNull($batch->getResult(new \stdClass()));
- $this->assertTrue(isset($batch[0]));
- $this->assertFalse(isset($batch[10]));
- $this->assertEquals('1', $batch[0]);
- $this->assertEquals('2', $batch[1]);
- $this->assertNull($batch[100]);
- $this->assertInstanceOf('Exception', $batch[2]);
-
- $results = iterator_to_array($batch);
- $this->assertEquals(['1', '2', $hash[$c]], $results);
- }
-
- /**
- * @expectedException \RuntimeException
- */
- public function testCannotSetByIndex()
- {
- $hash = new \SplObjectStorage();
- $batch = new BatchResults($hash);
- $batch[10] = 'foo';
- }
-
- /**
- * @expectedException \RuntimeException
- */
- public function testCannotUnsetByIndex()
- {
- $hash = new \SplObjectStorage();
- $batch = new BatchResults($hash);
- unset($batch[10]);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/ClientTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/ClientTest.php
deleted file mode 100644
index 02db3eb..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/ClientTest.php
+++ /dev/null
@@ -1,647 +0,0 @@
-ma = function () {
- throw new \RuntimeException('Should not have been called.');
- };
- }
-
- public function testUsesDefaultDefaultOptions()
- {
- $client = new Client();
- $this->assertTrue($client->getDefaultOption('allow_redirects'));
- $this->assertTrue($client->getDefaultOption('exceptions'));
- $this->assertTrue($client->getDefaultOption('verify'));
- }
-
- public function testUsesProvidedDefaultOptions()
- {
- $client = new Client([
- 'defaults' => [
- 'allow_redirects' => false,
- 'query' => ['foo' => 'bar']
- ]
- ]);
- $this->assertFalse($client->getDefaultOption('allow_redirects'));
- $this->assertTrue($client->getDefaultOption('exceptions'));
- $this->assertTrue($client->getDefaultOption('verify'));
- $this->assertEquals(['foo' => 'bar'], $client->getDefaultOption('query'));
- }
-
- public function testCanSpecifyBaseUrl()
- {
- $this->assertSame('', (new Client())->getBaseUrl());
- $this->assertEquals('http://foo', (new Client([
- 'base_url' => 'http://foo'
- ]))->getBaseUrl());
- }
-
- public function testCanSpecifyBaseUrlUriTemplate()
- {
- $client = new Client(['base_url' => ['http://foo.com/{var}/', ['var' => 'baz']]]);
- $this->assertEquals('http://foo.com/baz/', $client->getBaseUrl());
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesUriTemplateValue()
- {
- new Client(['base_url' => ['http://foo.com/']]);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Foo
- */
- public function testCanSpecifyHandler()
- {
- $client = new Client(['handler' => function () {
- throw new \Exception('Foo');
- }]);
- $client->get('http://httpbin.org');
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Foo
- */
- public function testCanSpecifyHandlerAsAdapter()
- {
- $client = new Client(['adapter' => function () {
- throw new \Exception('Foo');
- }]);
- $client->get('http://httpbin.org');
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Foo
- */
- public function testCanSpecifyMessageFactory()
- {
- $factory = $this->getMockBuilder('GuzzleHttp\Message\MessageFactoryInterface')
- ->setMethods(['createRequest'])
- ->getMockForAbstractClass();
- $factory->expects($this->once())
- ->method('createRequest')
- ->will($this->throwException(new \Exception('Foo')));
- $client = new Client(['message_factory' => $factory]);
- $client->get();
- }
-
- public function testCanSpecifyEmitter()
- {
- $emitter = $this->getMockBuilder('GuzzleHttp\Event\EmitterInterface')
- ->setMethods(['listeners'])
- ->getMockForAbstractClass();
- $emitter->expects($this->once())
- ->method('listeners')
- ->will($this->returnValue('foo'));
-
- $client = new Client(['emitter' => $emitter]);
- $this->assertEquals('foo', $client->getEmitter()->listeners());
- }
-
- public function testAddsDefaultUserAgentHeaderWithDefaultOptions()
- {
- $client = new Client(['defaults' => ['allow_redirects' => false]]);
- $this->assertFalse($client->getDefaultOption('allow_redirects'));
- $this->assertEquals(
- ['User-Agent' => Utils::getDefaultUserAgent()],
- $client->getDefaultOption('headers')
- );
- }
-
- public function testAddsDefaultUserAgentHeaderWithoutDefaultOptions()
- {
- $client = new Client();
- $this->assertEquals(
- ['User-Agent' => Utils::getDefaultUserAgent()],
- $client->getDefaultOption('headers')
- );
- }
-
- private function getRequestClient()
- {
- $client = $this->getMockBuilder('GuzzleHttp\Client')
- ->setMethods(['send'])
- ->getMock();
- $client->expects($this->once())
- ->method('send')
- ->will($this->returnArgument(0));
-
- return $client;
- }
-
- public function requestMethodProvider()
- {
- return [
- ['GET', false],
- ['HEAD', false],
- ['DELETE', false],
- ['OPTIONS', false],
- ['POST', 'foo'],
- ['PUT', 'foo'],
- ['PATCH', 'foo']
- ];
- }
-
- /**
- * @dataProvider requestMethodProvider
- */
- public function testClientProvidesMethodShortcut($method, $body)
- {
- $client = $this->getRequestClient();
- if ($body) {
- $request = $client->{$method}('http://foo.com', [
- 'headers' => ['X-Baz' => 'Bar'],
- 'body' => $body,
- 'query' => ['a' => 'b']
- ]);
- } else {
- $request = $client->{$method}('http://foo.com', [
- 'headers' => ['X-Baz' => 'Bar'],
- 'query' => ['a' => 'b']
- ]);
- }
- $this->assertEquals($method, $request->getMethod());
- $this->assertEquals('Bar', $request->getHeader('X-Baz'));
- $this->assertEquals('a=b', $request->getQuery());
- if ($body) {
- $this->assertEquals($body, $request->getBody());
- }
- }
-
- public function testClientMergesDefaultOptionsWithRequestOptions()
- {
- $f = $this->getMockBuilder('GuzzleHttp\Message\MessageFactoryInterface')
- ->setMethods(array('createRequest'))
- ->getMockForAbstractClass();
-
- $o = null;
- // Intercept the creation
- $f->expects($this->once())
- ->method('createRequest')
- ->will($this->returnCallback(
- function ($method, $url, array $options = []) use (&$o) {
- $o = $options;
- return (new MessageFactory())->createRequest($method, $url, $options);
- }
- ));
-
- $client = new Client([
- 'message_factory' => $f,
- 'defaults' => [
- 'headers' => ['Foo' => 'Bar'],
- 'query' => ['baz' => 'bam'],
- 'exceptions' => false
- ]
- ]);
-
- $request = $client->createRequest('GET', 'http://foo.com?a=b', [
- 'headers' => ['Hi' => 'there', '1' => 'one'],
- 'allow_redirects' => false,
- 'query' => ['t' => 1]
- ]);
-
- $this->assertFalse($o['allow_redirects']);
- $this->assertFalse($o['exceptions']);
- $this->assertEquals('Bar', $request->getHeader('Foo'));
- $this->assertEquals('there', $request->getHeader('Hi'));
- $this->assertEquals('one', $request->getHeader('1'));
- $this->assertEquals('a=b&baz=bam&t=1', $request->getQuery());
- }
-
- public function testClientMergesDefaultHeadersCaseInsensitively()
- {
- $client = new Client(['defaults' => ['headers' => ['Foo' => 'Bar']]]);
- $request = $client->createRequest('GET', 'http://foo.com?a=b', [
- 'headers' => ['foo' => 'custom', 'user-agent' => 'test']
- ]);
- $this->assertEquals('test', $request->getHeader('User-Agent'));
- $this->assertEquals('custom', $request->getHeader('Foo'));
- }
-
- public function testCanOverrideDefaultOptionWithNull()
- {
- $client = new Client(['defaults' => ['proxy' => 'invalid!']]);
- $request = $client->createRequest('GET', 'http://foo.com?a=b', [
- 'proxy' => null
- ]);
- $this->assertFalse($request->getConfig()->hasKey('proxy'));
- }
-
- public function testDoesNotOverwriteExistingUA()
- {
- $client = new Client(['defaults' => [
- 'headers' => ['User-Agent' => 'test']
- ]]);
- $this->assertEquals(
- ['User-Agent' => 'test'],
- $client->getDefaultOption('headers')
- );
- }
-
- public function testUsesBaseUrlWhenNoUrlIsSet()
- {
- $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']);
- $this->assertEquals(
- 'http://www.foo.com/baz?bam=bar',
- $client->createRequest('GET')->getUrl()
- );
- }
-
- public function testUsesBaseUrlCombinedWithProvidedUrl()
- {
- $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']);
- $this->assertEquals(
- 'http://www.foo.com/bar/bam',
- $client->createRequest('GET', 'bar/bam')->getUrl()
- );
- }
-
- public function testFalsyPathsAreCombinedWithBaseUrl()
- {
- $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']);
- $this->assertEquals(
- 'http://www.foo.com/0',
- $client->createRequest('GET', '0')->getUrl()
- );
- }
-
- public function testUsesBaseUrlCombinedWithProvidedUrlViaUriTemplate()
- {
- $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']);
- $this->assertEquals(
- 'http://www.foo.com/bar/123',
- $client->createRequest('GET', ['bar/{bam}', ['bam' => '123']])->getUrl()
- );
- }
-
- public function testSettingAbsoluteUrlOverridesBaseUrl()
- {
- $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']);
- $this->assertEquals(
- 'http://www.foo.com/foo',
- $client->createRequest('GET', '/foo')->getUrl()
- );
- }
-
- public function testSettingAbsoluteUriTemplateOverridesBaseUrl()
- {
- $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']);
- $this->assertEquals(
- 'http://goo.com/1',
- $client->createRequest(
- 'GET',
- ['http://goo.com/{bar}', ['bar' => '1']]
- )->getUrl()
- );
- }
-
- public function testCanSetRelativeUrlStartingWithHttp()
- {
- $client = new Client(['base_url' => 'http://www.foo.com']);
- $this->assertEquals(
- 'http://www.foo.com/httpfoo',
- $client->createRequest('GET', 'httpfoo')->getUrl()
- );
- }
-
- /**
- * Test that base URLs ending with a slash are resolved as per RFC3986.
- *
- * @link http://tools.ietf.org/html/rfc3986#section-5.2.3
- */
- public function testMultipleSubdirectoryWithSlash()
- {
- $client = new Client(['base_url' => 'http://www.foo.com/bar/bam/']);
- $this->assertEquals(
- 'http://www.foo.com/bar/bam/httpfoo',
- $client->createRequest('GET', 'httpfoo')->getUrl()
- );
- }
-
- /**
- * Test that base URLs ending without a slash are resolved as per RFC3986.
- *
- * @link http://tools.ietf.org/html/rfc3986#section-5.2.3
- */
- public function testMultipleSubdirectoryNoSlash()
- {
- $client = new Client(['base_url' => 'http://www.foo.com/bar/bam']);
- $this->assertEquals(
- 'http://www.foo.com/bar/httpfoo',
- $client->createRequest('GET', 'httpfoo')->getUrl()
- );
- }
-
- public function testClientSendsRequests()
- {
- $mock = new MockHandler(['status' => 200, 'headers' => []]);
- $client = new Client(['handler' => $mock]);
- $response = $client->get('http://test.com');
- $this->assertEquals(200, $response->getStatusCode());
- $this->assertEquals('http://test.com', $response->getEffectiveUrl());
- }
-
- public function testSendingRequestCanBeIntercepted()
- {
- $response = new Response(200);
- $client = new Client(['handler' => $this->ma]);
- $client->getEmitter()->on(
- 'before',
- function (BeforeEvent $e) use ($response) {
- $e->intercept($response);
- }
- );
- $this->assertSame($response, $client->get('http://test.com'));
- $this->assertEquals('http://test.com', $response->getEffectiveUrl());
- }
-
- /**
- * @expectedException \GuzzleHttp\Exception\RequestException
- * @expectedExceptionMessage Argument 1 passed to GuzzleHttp\Message\FutureResponse::proxy() must implement interface GuzzleHttp\Ring\Future\FutureInterface
- */
- public function testEnsuresResponseIsPresentAfterSending()
- {
- $handler = function () {};
- $client = new Client(['handler' => $handler]);
- $client->get('http://httpbin.org');
- }
-
- /**
- * @expectedException \GuzzleHttp\Exception\RequestException
- * @expectedExceptionMessage Waiting did not resolve future
- */
- public function testEnsuresResponseIsPresentAfterDereferencing()
- {
- $deferred = new Deferred();
- $handler = new MockHandler(function () use ($deferred) {
- return new FutureArray(
- $deferred->promise(),
- function () {}
- );
- });
- $client = new Client(['handler' => $handler]);
- $response = $client->get('http://httpbin.org');
- $response->wait();
- }
-
- public function testClientHandlesErrorsDuringBeforeSend()
- {
- $client = new Client();
- $client->getEmitter()->on('before', function ($e) {
- throw new \Exception('foo');
- });
- $client->getEmitter()->on('error', function (ErrorEvent $e) {
- $e->intercept(new Response(200));
- });
- $this->assertEquals(
- 200,
- $client->get('http://test.com')->getStatusCode()
- );
- }
-
- /**
- * @expectedException \GuzzleHttp\Exception\RequestException
- * @expectedExceptionMessage foo
- */
- public function testClientHandlesErrorsDuringBeforeSendAndThrowsIfUnhandled()
- {
- $client = new Client();
- $client->getEmitter()->on('before', function (BeforeEvent $e) {
- throw new RequestException('foo', $e->getRequest());
- });
- $client->get('http://httpbin.org');
- }
-
- /**
- * @expectedException \GuzzleHttp\Exception\RequestException
- * @expectedExceptionMessage foo
- */
- public function testClientWrapsExceptions()
- {
- $client = new Client();
- $client->getEmitter()->on('before', function (BeforeEvent $e) {
- throw new \Exception('foo');
- });
- $client->get('http://httpbin.org');
- }
-
- public function testCanInjectResponseForFutureError()
- {
- $calledFuture = false;
- $deferred = new Deferred();
- $future = new FutureArray(
- $deferred->promise(),
- function () use ($deferred, &$calledFuture) {
- $calledFuture = true;
- $deferred->resolve(['error' => new \Exception('Noo!')]);
- }
- );
- $mock = new MockHandler($future);
- $client = new Client(['handler' => $mock]);
- $called = 0;
- $response = $client->get('http://localhost:123/foo', [
- 'future' => true,
- 'events' => [
- 'error' => function (ErrorEvent $e) use (&$called) {
- $called++;
- $e->intercept(new Response(200));
- }
- ]
- ]);
- $this->assertEquals(0, $called);
- $this->assertInstanceOf('GuzzleHttp\Message\FutureResponse', $response);
- $this->assertEquals(200, $response->getStatusCode());
- $this->assertTrue($calledFuture);
- $this->assertEquals(1, $called);
- }
-
- public function testCanReturnFutureResults()
- {
- $called = false;
- $deferred = new Deferred();
- $future = new FutureArray(
- $deferred->promise(),
- function () use ($deferred, &$called) {
- $called = true;
- $deferred->resolve(['status' => 201, 'headers' => []]);
- }
- );
- $mock = new MockHandler($future);
- $client = new Client(['handler' => $mock]);
- $response = $client->get('http://localhost:123/foo', ['future' => true]);
- $this->assertFalse($called);
- $this->assertInstanceOf('GuzzleHttp\Message\FutureResponse', $response);
- $this->assertEquals(201, $response->getStatusCode());
- $this->assertTrue($called);
- }
-
- public function testThrowsExceptionsWhenDereferenced()
- {
- $calledFuture = false;
- $deferred = new Deferred();
- $future = new FutureArray(
- $deferred->promise(),
- function () use ($deferred, &$calledFuture) {
- $calledFuture = true;
- $deferred->resolve(['error' => new \Exception('Noop!')]);
- }
- );
- $client = new Client(['handler' => new MockHandler($future)]);
- try {
- $res = $client->get('http://localhost:123/foo', ['future' => true]);
- $res->wait();
- $this->fail('Did not throw');
- } catch (RequestException $e) {
- $this->assertEquals(1, $calledFuture);
- }
- }
-
- /**
- * @expectedExceptionMessage Noo!
- * @expectedException \GuzzleHttp\Exception\RequestException
- */
- public function testThrowsExceptionsSynchronously()
- {
- $client = new Client([
- 'handler' => new MockHandler(['error' => new \Exception('Noo!')])
- ]);
- $client->get('http://localhost:123/foo');
- }
-
- public function testCanSetDefaultValues()
- {
- $client = new Client(['foo' => 'bar']);
- $client->setDefaultOption('headers/foo', 'bar');
- $this->assertNull($client->getDefaultOption('foo'));
- $this->assertEquals('bar', $client->getDefaultOption('headers/foo'));
- }
-
- public function testSendsAllInParallel()
- {
- $client = new Client();
- $client->getEmitter()->attach(new Mock([
- new Response(200),
- new Response(201),
- new Response(202),
- ]));
- $history = new History();
- $client->getEmitter()->attach($history);
-
- $requests = [
- $client->createRequest('GET', 'http://test.com'),
- $client->createRequest('POST', 'http://test.com'),
- $client->createRequest('PUT', 'http://test.com')
- ];
-
- $client->sendAll($requests);
- $requests = array_map(function($r) {
- return $r->getMethod();
- }, $history->getRequests());
- $this->assertContains('GET', $requests);
- $this->assertContains('POST', $requests);
- $this->assertContains('PUT', $requests);
- }
-
- public function testCanDisableAuthPerRequest()
- {
- $client = new Client(['defaults' => ['auth' => 'foo']]);
- $request = $client->createRequest('GET', 'http://test.com');
- $this->assertEquals('foo', $request->getConfig()['auth']);
- $request = $client->createRequest('GET', 'http://test.com', ['auth' => null]);
- $this->assertFalse($request->getConfig()->hasKey('auth'));
- }
-
- public function testUsesProxyEnvironmentVariables()
- {
- $http = getenv('HTTP_PROXY');
- $https = getenv('HTTPS_PROXY');
-
- $client = new Client();
- $this->assertNull($client->getDefaultOption('proxy'));
-
- putenv('HTTP_PROXY=127.0.0.1');
- $client = new Client();
- $this->assertEquals(
- ['http' => '127.0.0.1'],
- $client->getDefaultOption('proxy')
- );
-
- putenv('HTTPS_PROXY=127.0.0.2');
- $client = new Client();
- $this->assertEquals(
- ['http' => '127.0.0.1', 'https' => '127.0.0.2'],
- $client->getDefaultOption('proxy')
- );
-
- putenv("HTTP_PROXY=$http");
- putenv("HTTPS_PROXY=$https");
- }
-
- public function testReturnsFutureForErrorWhenRequested()
- {
- $client = new Client(['handler' => new MockHandler(['status' => 404])]);
- $request = $client->createRequest('GET', 'http://localhost:123/foo', [
- 'future' => true
- ]);
- $res = $client->send($request);
- $this->assertInstanceOf('GuzzleHttp\Message\FutureResponse', $res);
- try {
- $res->wait();
- $this->fail('did not throw');
- } catch (RequestException $e) {
- $this->assertContains('404', $e->getMessage());
- }
- }
-
- public function testReturnsFutureForResponseWhenRequested()
- {
- $client = new Client(['handler' => new MockHandler(['status' => 200])]);
- $request = $client->createRequest('GET', 'http://localhost:123/foo', [
- 'future' => true
- ]);
- $res = $client->send($request);
- $this->assertInstanceOf('GuzzleHttp\Message\FutureResponse', $res);
- $this->assertEquals(200, $res->getStatusCode());
- }
-
- public function testCanUseUrlWithCustomQuery()
- {
- $client = new Client();
- $url = Url::fromString('http://foo.com/bar');
- $query = new Query(['baz' => '123%20']);
- $query->setEncodingType(false);
- $url->setQuery($query);
- $r = $client->createRequest('GET', $url);
- $this->assertEquals('http://foo.com/bar?baz=123%20', $r->getUrl());
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/CollectionTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/CollectionTest.php
deleted file mode 100644
index 8c532aa..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/CollectionTest.php
+++ /dev/null
@@ -1,416 +0,0 @@
-coll = new Collection();
- }
-
- public function testConstructorCanBeCalledWithNoParams()
- {
- $this->coll = new Collection();
- $p = $this->coll->toArray();
- $this->assertEmpty($p, '-> Collection must be empty when no data is passed');
- }
-
- public function testConstructorCanBeCalledWithParams()
- {
- $testData = array(
- 'test' => 'value',
- 'test_2' => 'value2'
- );
- $this->coll = new Collection($testData);
- $this->assertEquals($this->coll->toArray(), $testData);
- $this->assertEquals($this->coll->toArray(), $this->coll->toArray());
- }
-
- public function testImplementsIteratorAggregate()
- {
- $this->coll->set('key', 'value');
- $this->assertInstanceOf('ArrayIterator', $this->coll->getIterator());
- $this->assertEquals(1, count($this->coll));
- $total = 0;
- foreach ($this->coll as $key => $value) {
- $this->assertEquals('key', $key);
- $this->assertEquals('value', $value);
- $total++;
- }
- $this->assertEquals(1, $total);
- }
-
- public function testCanAddValuesToExistingKeysByUsingArray()
- {
- $this->coll->add('test', 'value1');
- $this->assertEquals($this->coll->toArray(), array('test' => 'value1'));
- $this->coll->add('test', 'value2');
- $this->assertEquals($this->coll->toArray(), array('test' => array('value1', 'value2')));
- $this->coll->add('test', 'value3');
- $this->assertEquals($this->coll->toArray(), array('test' => array('value1', 'value2', 'value3')));
- }
-
- public function testHandlesMergingInDisparateDataSources()
- {
- $params = array(
- 'test' => 'value1',
- 'test2' => 'value2',
- 'test3' => array('value3', 'value4')
- );
- $this->coll->merge($params);
- $this->assertEquals($this->coll->toArray(), $params);
- $this->coll->merge(new Collection(['test4' => 'hi']));
- $this->assertEquals(
- $this->coll->toArray(),
- $params + ['test4' => 'hi']
- );
- }
-
- public function testCanClearAllDataOrSpecificKeys()
- {
- $this->coll->merge(array(
- 'test' => 'value1',
- 'test2' => 'value2'
- ));
-
- // Clear a specific parameter by name
- $this->coll->remove('test');
-
- $this->assertEquals($this->coll->toArray(), array(
- 'test2' => 'value2'
- ));
-
- // Clear all parameters
- $this->coll->clear();
-
- $this->assertEquals($this->coll->toArray(), array());
- }
-
- public function testProvidesKeys()
- {
- $this->assertEquals(array(), $this->coll->getKeys());
- $this->coll->merge(array(
- 'test1' => 'value1',
- 'test2' => 'value2'
- ));
- $this->assertEquals(array('test1', 'test2'), $this->coll->getKeys());
- // Returns the cached array previously returned
- $this->assertEquals(array('test1', 'test2'), $this->coll->getKeys());
- $this->coll->remove('test1');
- $this->assertEquals(array('test2'), $this->coll->getKeys());
- $this->coll->add('test3', 'value3');
- $this->assertEquals(array('test2', 'test3'), $this->coll->getKeys());
- }
-
- public function testChecksIfHasKey()
- {
- $this->assertFalse($this->coll->hasKey('test'));
- $this->coll->add('test', 'value');
- $this->assertEquals(true, $this->coll->hasKey('test'));
- $this->coll->add('test2', 'value2');
- $this->assertEquals(true, $this->coll->hasKey('test'));
- $this->assertEquals(true, $this->coll->hasKey('test2'));
- $this->assertFalse($this->coll->hasKey('testing'));
- $this->assertEquals(false, $this->coll->hasKey('AB-C', 'junk'));
- }
-
- public function testChecksIfHasValue()
- {
- $this->assertFalse($this->coll->hasValue('value'));
- $this->coll->add('test', 'value');
- $this->assertEquals('test', $this->coll->hasValue('value'));
- $this->coll->add('test2', 'value2');
- $this->assertEquals('test', $this->coll->hasValue('value'));
- $this->assertEquals('test2', $this->coll->hasValue('value2'));
- $this->assertFalse($this->coll->hasValue('val'));
- }
-
- public function testImplementsCount()
- {
- $data = new Collection();
- $this->assertEquals(0, $data->count());
- $data->add('key', 'value');
- $this->assertEquals(1, count($data));
- $data->add('key', 'value2');
- $this->assertEquals(1, count($data));
- $data->add('key_2', 'value3');
- $this->assertEquals(2, count($data));
- }
-
- public function testAddParamsByMerging()
- {
- $params = array(
- 'test' => 'value1',
- 'test2' => 'value2',
- 'test3' => array('value3', 'value4')
- );
-
- // Add some parameters
- $this->coll->merge($params);
-
- // Add more parameters by merging them in
- $this->coll->merge(array(
- 'test' => 'another',
- 'different_key' => 'new value'
- ));
-
- $this->assertEquals(array(
- 'test' => array('value1', 'another'),
- 'test2' => 'value2',
- 'test3' => array('value3', 'value4'),
- 'different_key' => 'new value'
- ), $this->coll->toArray());
- }
-
- public function testAllowsFunctionalFilter()
- {
- $this->coll->merge(array(
- 'fruit' => 'apple',
- 'number' => 'ten',
- 'prepositions' => array('about', 'above', 'across', 'after'),
- 'same_number' => 'ten'
- ));
-
- $filtered = $this->coll->filter(function ($key, $value) {
- return $value == 'ten';
- });
-
- $this->assertNotSame($filtered, $this->coll);
-
- $this->assertEquals(array(
- 'number' => 'ten',
- 'same_number' => 'ten'
- ), $filtered->toArray());
- }
-
- public function testAllowsFunctionalMapping()
- {
- $this->coll->merge(array(
- 'number_1' => 1,
- 'number_2' => 2,
- 'number_3' => 3
- ));
-
- $mapped = $this->coll->map(function ($key, $value) {
- return $value * $value;
- });
-
- $this->assertNotSame($mapped, $this->coll);
-
- $this->assertEquals(array(
- 'number_1' => 1,
- 'number_2' => 4,
- 'number_3' => 9
- ), $mapped->toArray());
- }
-
- public function testImplementsArrayAccess()
- {
- $this->coll->merge(array(
- 'k1' => 'v1',
- 'k2' => 'v2'
- ));
-
- $this->assertTrue($this->coll->offsetExists('k1'));
- $this->assertFalse($this->coll->offsetExists('Krull'));
-
- $this->coll->offsetSet('k3', 'v3');
- $this->assertEquals('v3', $this->coll->offsetGet('k3'));
- $this->assertEquals('v3', $this->coll->get('k3'));
-
- $this->coll->offsetUnset('k1');
- $this->assertFalse($this->coll->offsetExists('k1'));
- }
-
- public function testCanReplaceAllData()
- {
- $this->coll->replace(array('a' => '123'));
- $this->assertEquals(array('a' => '123'), $this->coll->toArray());
- }
-
- public function testPreparesFromConfig()
- {
- $c = Collection::fromConfig(array(
- 'a' => '123',
- 'base_url' => 'http://www.test.com/'
- ), array(
- 'a' => 'xyz',
- 'b' => 'lol'
- ), array('a'));
-
- $this->assertInstanceOf('GuzzleHttp\Collection', $c);
- $this->assertEquals(array(
- 'a' => '123',
- 'b' => 'lol',
- 'base_url' => 'http://www.test.com/'
- ), $c->toArray());
-
- try {
- Collection::fromConfig(array(), array(), array('a'));
- $this->fail('Exception not throw when missing config');
- } catch (\InvalidArgumentException $e) {
- }
- }
-
- function falseyDataProvider()
- {
- return array(
- array(false, false),
- array(null, null),
- array('', ''),
- array(array(), array()),
- array(0, 0),
- );
- }
-
- /**
- * @dataProvider falseyDataProvider
- */
- public function testReturnsCorrectData($a, $b)
- {
- $c = new Collection(array('value' => $a));
- $this->assertSame($b, $c->get('value'));
- }
-
- public function testRetrievesNestedKeysUsingPath()
- {
- $data = array(
- 'foo' => 'bar',
- 'baz' => array(
- 'mesa' => array(
- 'jar' => 'jar'
- )
- )
- );
- $collection = new Collection($data);
- $this->assertEquals('bar', $collection->getPath('foo'));
- $this->assertEquals('jar', $collection->getPath('baz/mesa/jar'));
- $this->assertNull($collection->getPath('wewewf'));
- $this->assertNull($collection->getPath('baz/mesa/jar/jar'));
- }
-
- public function testFalseyKeysStillDescend()
- {
- $collection = new Collection(array(
- '0' => array(
- 'a' => 'jar'
- ),
- 1 => 'other'
- ));
- $this->assertEquals('jar', $collection->getPath('0/a'));
- $this->assertEquals('other', $collection->getPath('1'));
- }
-
- public function getPathProvider()
- {
- $data = array(
- 'foo' => 'bar',
- 'baz' => array(
- 'mesa' => array(
- 'jar' => 'jar',
- 'array' => array('a', 'b', 'c')
- ),
- 'bar' => array(
- 'baz' => 'bam',
- 'array' => array('d', 'e', 'f')
- )
- ),
- 'bam' => array(
- array('foo' => 1),
- array('foo' => 2),
- array('array' => array('h', 'i'))
- )
- );
- $c = new Collection($data);
-
- return array(
- // Simple path selectors
- array($c, 'foo', 'bar'),
- array($c, 'baz', $data['baz']),
- array($c, 'bam', $data['bam']),
- array($c, 'baz/mesa', $data['baz']['mesa']),
- array($c, 'baz/mesa/jar', 'jar'),
- // Does not barf on missing keys
- array($c, 'fefwfw', null),
- array($c, 'baz/mesa/array', $data['baz']['mesa']['array'])
- );
- }
-
- /**
- * @dataProvider getPathProvider
- */
- public function testGetPath(Collection $c, $path, $expected, $separator = '/')
- {
- $this->assertEquals($expected, $c->getPath($path, $separator));
- }
-
- public function testOverridesSettings()
- {
- $c = new Collection(array('foo' => 1, 'baz' => 2, 'bar' => 3));
- $c->overwriteWith(array('foo' => 10, 'bar' => 300));
- $this->assertEquals(array('foo' => 10, 'baz' => 2, 'bar' => 300), $c->toArray());
- }
-
- public function testOverwriteWithCollection()
- {
- $c = new Collection(array('foo' => 1, 'baz' => 2, 'bar' => 3));
- $b = new Collection(array('foo' => 10, 'bar' => 300));
- $c->overwriteWith($b);
- $this->assertEquals(array('foo' => 10, 'baz' => 2, 'bar' => 300), $c->toArray());
- }
-
- public function testOverwriteWithTraversable()
- {
- $c = new Collection(array('foo' => 1, 'baz' => 2, 'bar' => 3));
- $b = new Collection(array('foo' => 10, 'bar' => 300));
- $c->overwriteWith($b->getIterator());
- $this->assertEquals(array('foo' => 10, 'baz' => 2, 'bar' => 300), $c->toArray());
- }
-
- public function testCanSetNestedPathValueThatDoesNotExist()
- {
- $c = new Collection(array());
- $c->setPath('foo/bar/baz/123', 'hi');
- $this->assertEquals('hi', $c['foo']['bar']['baz']['123']);
- }
-
- public function testCanSetNestedPathValueThatExists()
- {
- $c = new Collection(array('foo' => array('bar' => 'test')));
- $c->setPath('foo/bar', 'hi');
- $this->assertEquals('hi', $c['foo']['bar']);
- }
-
- /**
- * @expectedException \RuntimeException
- */
- public function testVerifiesNestedPathIsValidAtExactLevel()
- {
- $c = new Collection(array('foo' => 'bar'));
- $c->setPath('foo/bar', 'hi');
- $this->assertEquals('hi', $c['foo']['bar']);
- }
-
- /**
- * @expectedException \RuntimeException
- */
- public function testVerifiesThatNestedPathIsValidAtAnyLevel()
- {
- $c = new Collection(array('foo' => 'bar'));
- $c->setPath('foo/bar/baz', 'test');
- }
-
- public function testCanAppendToNestedPathValues()
- {
- $c = new Collection();
- $c->setPath('foo/bar/[]', 'a');
- $c->setPath('foo/bar/[]', 'b');
- $this->assertEquals(['a', 'b'], $c['foo']['bar']);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Cookie/CookieJarTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Cookie/CookieJarTest.php
deleted file mode 100644
index 1360419..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Cookie/CookieJarTest.php
+++ /dev/null
@@ -1,339 +0,0 @@
-jar = new CookieJar();
- }
-
- protected function getTestCookies()
- {
- return [
- new SetCookie(['Name' => 'foo', 'Value' => 'bar', 'Domain' => 'foo.com', 'Path' => '/', 'Discard' => true]),
- new SetCookie(['Name' => 'test', 'Value' => '123', 'Domain' => 'baz.com', 'Path' => '/foo', 'Expires' => 2]),
- new SetCookie(['Name' => 'you', 'Value' => '123', 'Domain' => 'bar.com', 'Path' => '/boo', 'Expires' => time() + 1000])
- ];
- }
-
- public function testQuotesBadCookieValues()
- {
- $this->assertEquals('foo', CookieJar::getCookieValue('foo'));
- $this->assertEquals('"foo,bar"', CookieJar::getCookieValue('foo,bar'));
- }
-
- public function testCreatesFromArray()
- {
- $jar = CookieJar::fromArray([
- 'foo' => 'bar',
- 'baz' => 'bam'
- ], 'example.com');
- $this->assertCount(2, $jar);
- }
-
- /**
- * Provides test data for cookie cookieJar retrieval
- */
- public function getCookiesDataProvider()
- {
- return [
- [['foo', 'baz', 'test', 'muppet', 'googoo'], '', '', '', false],
- [['foo', 'baz', 'muppet', 'googoo'], '', '', '', true],
- [['googoo'], 'www.example.com', '', '', false],
- [['muppet', 'googoo'], 'test.y.example.com', '', '', false],
- [['foo', 'baz'], 'example.com', '', '', false],
- [['muppet'], 'x.y.example.com', '/acme/', '', false],
- [['muppet'], 'x.y.example.com', '/acme/test/', '', false],
- [['googoo'], 'x.y.example.com', '/test/acme/test/', '', false],
- [['foo', 'baz'], 'example.com', '', '', false],
- [['baz'], 'example.com', '', 'baz', false],
- ];
- }
-
- public function testStoresAndRetrievesCookies()
- {
- $cookies = $this->getTestCookies();
- foreach ($cookies as $cookie) {
- $this->assertTrue($this->jar->setCookie($cookie));
- }
-
- $this->assertEquals(3, count($this->jar));
- $this->assertEquals(3, count($this->jar->getIterator()));
- $this->assertEquals($cookies, $this->jar->getIterator()->getArrayCopy());
- }
-
- public function testRemovesTemporaryCookies()
- {
- $cookies = $this->getTestCookies();
- foreach ($this->getTestCookies() as $cookie) {
- $this->jar->setCookie($cookie);
- }
- $this->jar->clearSessionCookies();
- $this->assertEquals(
- [$cookies[1], $cookies[2]],
- $this->jar->getIterator()->getArrayCopy()
- );
- }
-
- public function testRemovesSelectively()
- {
- foreach ($this->getTestCookies() as $cookie) {
- $this->jar->setCookie($cookie);
- }
-
- // Remove foo.com cookies
- $this->jar->clear('foo.com');
- $this->assertEquals(2, count($this->jar));
- // Try again, removing no further cookies
- $this->jar->clear('foo.com');
- $this->assertEquals(2, count($this->jar));
-
- // Remove bar.com cookies with path of /boo
- $this->jar->clear('bar.com', '/boo');
- $this->assertEquals(1, count($this->jar));
-
- // Remove cookie by name
- $this->jar->clear(null, null, 'test');
- $this->assertEquals(0, count($this->jar));
- }
-
- public function testDoesNotAddIncompleteCookies()
- {
- $this->assertEquals(false, $this->jar->setCookie(new SetCookie()));
- $this->assertFalse($this->jar->setCookie(new SetCookie(array(
- 'Name' => 'foo'
- ))));
- $this->assertFalse($this->jar->setCookie(new SetCookie(array(
- 'Name' => false
- ))));
- $this->assertFalse($this->jar->setCookie(new SetCookie(array(
- 'Name' => true
- ))));
- $this->assertFalse($this->jar->setCookie(new SetCookie(array(
- 'Name' => 'foo',
- 'Domain' => 'foo.com'
- ))));
- }
-
- public function testDoesAddValidCookies()
- {
- $this->assertTrue($this->jar->setCookie(new SetCookie(array(
- 'Name' => 'foo',
- 'Domain' => 'foo.com',
- 'Value' => 0
- ))));
- $this->assertTrue($this->jar->setCookie(new SetCookie(array(
- 'Name' => 'foo',
- 'Domain' => 'foo.com',
- 'Value' => 0.0
- ))));
- $this->assertTrue($this->jar->setCookie(new SetCookie(array(
- 'Name' => 'foo',
- 'Domain' => 'foo.com',
- 'Value' => '0'
- ))));
- }
-
- public function testOverwritesCookiesThatAreOlderOrDiscardable()
- {
- $t = time() + 1000;
- $data = array(
- 'Name' => 'foo',
- 'Value' => 'bar',
- 'Domain' => '.example.com',
- 'Path' => '/',
- 'Max-Age' => '86400',
- 'Secure' => true,
- 'Discard' => true,
- 'Expires' => $t
- );
-
- // Make sure that the discard cookie is overridden with the non-discard
- $this->assertTrue($this->jar->setCookie(new SetCookie($data)));
- $this->assertEquals(1, count($this->jar));
-
- $data['Discard'] = false;
- $this->assertTrue($this->jar->setCookie(new SetCookie($data)));
- $this->assertEquals(1, count($this->jar));
-
- $c = $this->jar->getIterator()->getArrayCopy();
- $this->assertEquals(false, $c[0]->getDiscard());
-
- // Make sure it doesn't duplicate the cookie
- $this->jar->setCookie(new SetCookie($data));
- $this->assertEquals(1, count($this->jar));
-
- // Make sure the more future-ful expiration date supersede the other
- $data['Expires'] = time() + 2000;
- $this->assertTrue($this->jar->setCookie(new SetCookie($data)));
- $this->assertEquals(1, count($this->jar));
- $c = $this->jar->getIterator()->getArrayCopy();
- $this->assertNotEquals($t, $c[0]->getExpires());
- }
-
- public function testOverwritesCookiesThatHaveChanged()
- {
- $t = time() + 1000;
- $data = array(
- 'Name' => 'foo',
- 'Value' => 'bar',
- 'Domain' => '.example.com',
- 'Path' => '/',
- 'Max-Age' => '86400',
- 'Secure' => true,
- 'Discard' => true,
- 'Expires' => $t
- );
-
- // Make sure that the discard cookie is overridden with the non-discard
- $this->assertTrue($this->jar->setCookie(new SetCookie($data)));
-
- $data['Value'] = 'boo';
- $this->assertTrue($this->jar->setCookie(new SetCookie($data)));
- $this->assertEquals(1, count($this->jar));
-
- // Changing the value plus a parameter also must overwrite the existing one
- $data['Value'] = 'zoo';
- $data['Secure'] = false;
- $this->assertTrue($this->jar->setCookie(new SetCookie($data)));
- $this->assertEquals(1, count($this->jar));
-
- $c = $this->jar->getIterator()->getArrayCopy();
- $this->assertEquals('zoo', $c[0]->getValue());
- }
-
- public function testAddsCookiesFromResponseWithRequest()
- {
- $response = new Response(200, array(
- 'Set-Cookie' => "fpc=d=.Hm.yh4.1XmJWjJfs4orLQzKzPImxklQoxXSHOZATHUSEFciRueW_7704iYUtsXNEXq0M92Px2glMdWypmJ7HIQl6XIUvrZimWjQ3vIdeuRbI.FNQMAfcxu_XN1zSx7l.AcPdKL6guHc2V7hIQFhnjRW0rxm2oHY1P4bGQxFNz7f.tHm12ZD3DbdMDiDy7TBXsuP4DM-&v=2; expires=Fri, 02-Mar-2019 02:17:40 GMT;"
- ));
- $request = new Request('GET', 'http://www.example.com');
- $this->jar->extractCookies($request, $response);
- $this->assertEquals(1, count($this->jar));
- }
-
- public function getMatchingCookiesDataProvider()
- {
- return array(
- array('https://example.com', 'foo=bar; baz=foobar'),
- array('http://example.com', ''),
- array('https://example.com:8912', 'foo=bar; baz=foobar'),
- array('https://foo.example.com', 'foo=bar; baz=foobar'),
- array('http://foo.example.com/test/acme/', 'googoo=gaga')
- );
- }
-
- /**
- * @dataProvider getMatchingCookiesDataProvider
- */
- public function testReturnsCookiesMatchingRequests($url, $cookies)
- {
- $bag = [
- new SetCookie([
- 'Name' => 'foo',
- 'Value' => 'bar',
- 'Domain' => 'example.com',
- 'Path' => '/',
- 'Max-Age' => '86400',
- 'Secure' => true
- ]),
- new SetCookie([
- 'Name' => 'baz',
- 'Value' => 'foobar',
- 'Domain' => 'example.com',
- 'Path' => '/',
- 'Max-Age' => '86400',
- 'Secure' => true
- ]),
- new SetCookie([
- 'Name' => 'test',
- 'Value' => '123',
- 'Domain' => 'www.foobar.com',
- 'Path' => '/path/',
- 'Discard' => true
- ]),
- new SetCookie([
- 'Name' => 'muppet',
- 'Value' => 'cookie_monster',
- 'Domain' => '.y.example.com',
- 'Path' => '/acme/',
- 'Expires' => time() + 86400
- ]),
- new SetCookie([
- 'Name' => 'googoo',
- 'Value' => 'gaga',
- 'Domain' => '.example.com',
- 'Path' => '/test/acme/',
- 'Max-Age' => 1500
- ])
- ];
-
- foreach ($bag as $cookie) {
- $this->jar->setCookie($cookie);
- }
-
- $request = new Request('GET', $url);
- $this->jar->addCookieHeader($request);
- $this->assertEquals($cookies, $request->getHeader('Cookie'));
- }
-
- /**
- * @expectedException \RuntimeException
- * @expectedExceptionMessage Invalid cookie: Cookie name must not cannot invalid characters:
- */
- public function testThrowsExceptionWithStrictMode()
- {
- $a = new CookieJar(true);
- $a->setCookie(new SetCookie(['Name' => "abc\n", 'Value' => 'foo', 'Domain' => 'bar']));
- }
-
- public function testDeletesCookiesByName()
- {
- $cookies = $this->getTestCookies();
- $cookies[] = new SetCookie([
- 'Name' => 'other',
- 'Value' => '123',
- 'Domain' => 'bar.com',
- 'Path' => '/boo',
- 'Expires' => time() + 1000
- ]);
- $jar = new CookieJar();
- foreach ($cookies as $cookie) {
- $jar->setCookie($cookie);
- }
- $this->assertCount(4, $jar);
- $jar->clear('bar.com', '/boo', 'other');
- $this->assertCount(3, $jar);
- $names = array_map(function (SetCookie $c) {
- return $c->getName();
- }, $jar->getIterator()->getArrayCopy());
- $this->assertEquals(['foo', 'test', 'you'], $names);
- }
-
- public function testCanConvertToAndLoadFromArray()
- {
- $jar = new CookieJar(true);
- foreach ($this->getTestCookies() as $cookie) {
- $jar->setCookie($cookie);
- }
- $this->assertCount(3, $jar);
- $arr = $jar->toArray();
- $this->assertCount(3, $arr);
- $newCookieJar = new CookieJar(false, $arr);
- $this->assertCount(3, $newCookieJar);
- $this->assertSame($jar->toArray(), $newCookieJar->toArray());
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Cookie/FileCookieJarTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Cookie/FileCookieJarTest.php
deleted file mode 100644
index 1d11337..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Cookie/FileCookieJarTest.php
+++ /dev/null
@@ -1,71 +0,0 @@
-file = tempnam('/tmp', 'file-cookies');
- }
-
- /**
- * @expectedException \RuntimeException
- */
- public function testValidatesCookieFile()
- {
- file_put_contents($this->file, 'true');
- new FileCookieJar($this->file);
- }
-
- public function testLoadsFromFileFile()
- {
- $jar = new FileCookieJar($this->file);
- $this->assertEquals([], $jar->getIterator()->getArrayCopy());
- unlink($this->file);
- }
-
- public function testPersistsToFileFile()
- {
- $jar = new FileCookieJar($this->file);
- $jar->setCookie(new SetCookie([
- 'Name' => 'foo',
- 'Value' => 'bar',
- 'Domain' => 'foo.com',
- 'Expires' => time() + 1000
- ]));
- $jar->setCookie(new SetCookie([
- 'Name' => 'baz',
- 'Value' => 'bar',
- 'Domain' => 'foo.com',
- 'Expires' => time() + 1000
- ]));
- $jar->setCookie(new SetCookie([
- 'Name' => 'boo',
- 'Value' => 'bar',
- 'Domain' => 'foo.com',
- ]));
-
- $this->assertEquals(3, count($jar));
- unset($jar);
-
- // Make sure it wrote to the file
- $contents = file_get_contents($this->file);
- $this->assertNotEmpty($contents);
-
- // Load the cookieJar from the file
- $jar = new FileCookieJar($this->file);
-
- // Weeds out temporary and session cookies
- $this->assertEquals(2, count($jar));
- unset($jar);
- unlink($this->file);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Cookie/SessionCookieJarTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Cookie/SessionCookieJarTest.php
deleted file mode 100644
index ccc6d4e..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Cookie/SessionCookieJarTest.php
+++ /dev/null
@@ -1,76 +0,0 @@
-sessionVar = 'sessionKey';
-
- if (!isset($_SESSION)) {
- $_SESSION = array();
- }
- }
-
- /**
- * @expectedException \RuntimeException
- */
- public function testValidatesCookieSession()
- {
- $_SESSION[$this->sessionVar] = 'true';
- new SessionCookieJar($this->sessionVar);
- }
-
- public function testLoadsFromSession()
- {
- $jar = new SessionCookieJar($this->sessionVar);
- $this->assertEquals([], $jar->getIterator()->getArrayCopy());
- unset($_SESSION[$this->sessionVar]);
- }
-
- public function testPersistsToSession()
- {
- $jar = new SessionCookieJar($this->sessionVar);
- $jar->setCookie(new SetCookie([
- 'Name' => 'foo',
- 'Value' => 'bar',
- 'Domain' => 'foo.com',
- 'Expires' => time() + 1000
- ]));
- $jar->setCookie(new SetCookie([
- 'Name' => 'baz',
- 'Value' => 'bar',
- 'Domain' => 'foo.com',
- 'Expires' => time() + 1000
- ]));
- $jar->setCookie(new SetCookie([
- 'Name' => 'boo',
- 'Value' => 'bar',
- 'Domain' => 'foo.com',
- ]));
-
- $this->assertEquals(3, count($jar));
- unset($jar);
-
- // Make sure it wrote to the sessionVar in $_SESSION
- $contents = $_SESSION[$this->sessionVar];
- $this->assertNotEmpty($contents);
-
- // Load the cookieJar from the file
- $jar = new SessionCookieJar($this->sessionVar);
-
- // Weeds out temporary and session cookies
- $this->assertEquals(2, count($jar));
- unset($jar);
- unset($_SESSION[$this->sessionVar]);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Cookie/SetCookieTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Cookie/SetCookieTest.php
deleted file mode 100644
index 3ddd082..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Cookie/SetCookieTest.php
+++ /dev/null
@@ -1,364 +0,0 @@
-assertEquals('/', $cookie->getPath());
- }
-
- public function testConvertsDateTimeMaxAgeToUnixTimestamp()
- {
- $cookie = new SetCookie(['Expires' => 'November 20, 1984']);
- $this->assertInternalType('integer', $cookie->getExpires());
- }
-
- public function testAddsExpiresBasedOnMaxAge()
- {
- $t = time();
- $cookie = new SetCookie(['Max-Age' => 100]);
- $this->assertEquals($t + 100, $cookie->getExpires());
- }
-
- public function testHoldsValues()
- {
- $t = time();
- $data = array(
- 'Name' => 'foo',
- 'Value' => 'baz',
- 'Path' => '/bar',
- 'Domain' => 'baz.com',
- 'Expires' => $t,
- 'Max-Age' => 100,
- 'Secure' => true,
- 'Discard' => true,
- 'HttpOnly' => true,
- 'foo' => 'baz',
- 'bar' => 'bam'
- );
-
- $cookie = new SetCookie($data);
- $this->assertEquals($data, $cookie->toArray());
-
- $this->assertEquals('foo', $cookie->getName());
- $this->assertEquals('baz', $cookie->getValue());
- $this->assertEquals('baz.com', $cookie->getDomain());
- $this->assertEquals('/bar', $cookie->getPath());
- $this->assertEquals($t, $cookie->getExpires());
- $this->assertEquals(100, $cookie->getMaxAge());
- $this->assertTrue($cookie->getSecure());
- $this->assertTrue($cookie->getDiscard());
- $this->assertTrue($cookie->getHttpOnly());
- $this->assertEquals('baz', $cookie->toArray()['foo']);
- $this->assertEquals('bam', $cookie->toArray()['bar']);
-
- $cookie->setName('a');
- $cookie->setValue('b');
- $cookie->setPath('c');
- $cookie->setDomain('bar.com');
- $cookie->setExpires(10);
- $cookie->setMaxAge(200);
- $cookie->setSecure(false);
- $cookie->setHttpOnly(false);
- $cookie->setDiscard(false);
-
- $this->assertEquals('a', $cookie->getName());
- $this->assertEquals('b', $cookie->getValue());
- $this->assertEquals('c', $cookie->getPath());
- $this->assertEquals('bar.com', $cookie->getDomain());
- $this->assertEquals(10, $cookie->getExpires());
- $this->assertEquals(200, $cookie->getMaxAge());
- $this->assertFalse($cookie->getSecure());
- $this->assertFalse($cookie->getDiscard());
- $this->assertFalse($cookie->getHttpOnly());
- }
-
- public function testDeterminesIfExpired()
- {
- $c = new SetCookie();
- $c->setExpires(10);
- $this->assertTrue($c->isExpired());
- $c->setExpires(time() + 10000);
- $this->assertFalse($c->isExpired());
- }
-
- public function testMatchesDomain()
- {
- $cookie = new SetCookie();
- $this->assertTrue($cookie->matchesDomain('baz.com'));
-
- $cookie->setDomain('baz.com');
- $this->assertTrue($cookie->matchesDomain('baz.com'));
- $this->assertFalse($cookie->matchesDomain('bar.com'));
-
- $cookie->setDomain('.baz.com');
- $this->assertTrue($cookie->matchesDomain('.baz.com'));
- $this->assertTrue($cookie->matchesDomain('foo.baz.com'));
- $this->assertFalse($cookie->matchesDomain('baz.bar.com'));
- $this->assertTrue($cookie->matchesDomain('baz.com'));
-
- $cookie->setDomain('.127.0.0.1');
- $this->assertTrue($cookie->matchesDomain('127.0.0.1'));
-
- $cookie->setDomain('127.0.0.1');
- $this->assertTrue($cookie->matchesDomain('127.0.0.1'));
-
- $cookie->setDomain('.com.');
- $this->assertFalse($cookie->matchesDomain('baz.com'));
-
- $cookie->setDomain('.local');
- $this->assertTrue($cookie->matchesDomain('example.local'));
- }
-
- public function testMatchesPath()
- {
- $cookie = new SetCookie();
- $this->assertTrue($cookie->matchesPath('/foo'));
-
- $cookie->setPath('/foo');
- $this->assertTrue($cookie->matchesPath('/foo'));
- $this->assertTrue($cookie->matchesPath('/foo/bar'));
- $this->assertFalse($cookie->matchesPath('/bar'));
- }
-
- public function cookieValidateProvider()
- {
- return array(
- array('foo', 'baz', 'bar', true),
- array('0', '0', '0', true),
- array('', 'baz', 'bar', 'The cookie name must not be empty'),
- array('foo', '', 'bar', 'The cookie value must not be empty'),
- array('foo', 'baz', '', 'The cookie domain must not be empty'),
- array("foo\r", 'baz', '0', 'Cookie name must not cannot invalid characters: =,; \t\r\n\013\014'),
- );
- }
-
- /**
- * @dataProvider cookieValidateProvider
- */
- public function testValidatesCookies($name, $value, $domain, $result)
- {
- $cookie = new SetCookie(array(
- 'Name' => $name,
- 'Value' => $value,
- 'Domain' => $domain
- ));
- $this->assertSame($result, $cookie->validate());
- }
-
- public function testDoesNotMatchIp()
- {
- $cookie = new SetCookie(['Domain' => '192.168.16.']);
- $this->assertFalse($cookie->matchesDomain('192.168.16.121'));
- }
-
- public function testConvertsToString()
- {
- $t = 1382916008;
- $cookie = new SetCookie([
- 'Name' => 'test',
- 'Value' => '123',
- 'Domain' => 'foo.com',
- 'Expires' => $t,
- 'Path' => '/abc',
- 'HttpOnly' => true,
- 'Secure' => true
- ]);
- $this->assertEquals(
- 'test=123; Domain=foo.com; Path=/abc; Expires=Sun, 27 Oct 2013 23:20:08 GMT; Secure; HttpOnly',
- (string) $cookie
- );
- }
-
- /**
- * Provides the parsed information from a cookie
- *
- * @return array
- */
- public function cookieParserDataProvider()
- {
- return array(
- array(
- 'ASIHTTPRequestTestCookie=This+is+the+value; expires=Sat, 26-Jul-2008 17:00:42 GMT; path=/tests; domain=allseeing-i.com; PHPSESSID=6c951590e7a9359bcedde25cda73e43c; path=/";',
- array(
- 'Domain' => 'allseeing-i.com',
- 'Path' => '/',
- 'PHPSESSID' => '6c951590e7a9359bcedde25cda73e43c',
- 'Max-Age' => NULL,
- 'Expires' => 'Sat, 26-Jul-2008 17:00:42 GMT',
- 'Secure' => NULL,
- 'Discard' => NULL,
- 'Name' => 'ASIHTTPRequestTestCookie',
- 'Value' => 'This+is+the+value',
- 'HttpOnly' => false
- )
- ),
- array('', []),
- array('foo', []),
- // Test setting a blank value for a cookie
- array(array(
- 'foo=', 'foo =', 'foo =;', 'foo= ;', 'foo =', 'foo= '),
- array(
- 'Name' => 'foo',
- 'Value' => '',
- 'Discard' => null,
- 'Domain' => null,
- 'Expires' => null,
- 'Max-Age' => null,
- 'Path' => '/',
- 'Secure' => null,
- 'HttpOnly' => false
- )
- ),
- // Test setting a value and removing quotes
- array(array(
- 'foo=1', 'foo =1', 'foo =1;', 'foo=1 ;', 'foo =1', 'foo= 1', 'foo = 1 ;', 'foo="1"', 'foo="1";', 'foo= "1";'),
- array(
- 'Name' => 'foo',
- 'Value' => '1',
- 'Discard' => null,
- 'Domain' => null,
- 'Expires' => null,
- 'Max-Age' => null,
- 'Path' => '/',
- 'Secure' => null,
- 'HttpOnly' => false
- )
- ),
- // Some of the following tests are based on http://framework.zend.com/svn/framework/standard/trunk/tests/Zend/Http/CookieTest.php
- array(
- 'justacookie=foo; domain=example.com',
- array(
- 'Name' => 'justacookie',
- 'Value' => 'foo',
- 'Domain' => 'example.com',
- 'Discard' => null,
- 'Expires' => null,
- 'Max-Age' => null,
- 'Path' => '/',
- 'Secure' => null,
- 'HttpOnly' => false
- )
- ),
- array(
- 'expires=tomorrow; secure; path=/Space Out/; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=.example.com',
- array(
- 'Name' => 'expires',
- 'Value' => 'tomorrow',
- 'Domain' => '.example.com',
- 'Path' => '/Space Out/',
- 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT',
- 'Discard' => null,
- 'Secure' => true,
- 'Max-Age' => null,
- 'HttpOnly' => false
- )
- ),
- array(
- 'domain=unittests; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=example.com; path=/some value/',
- array(
- 'Name' => 'domain',
- 'Value' => 'unittests',
- 'Domain' => 'example.com',
- 'Path' => '/some value/',
- 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT',
- 'Secure' => false,
- 'Discard' => null,
- 'Max-Age' => null,
- 'HttpOnly' => false
- )
- ),
- array(
- 'path=indexAction; path=/; domain=.foo.com; expires=Tue, 21-Nov-2006 08:33:44 GMT',
- array(
- 'Name' => 'path',
- 'Value' => 'indexAction',
- 'Domain' => '.foo.com',
- 'Path' => '/',
- 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT',
- 'Secure' => false,
- 'Discard' => null,
- 'Max-Age' => null,
- 'HttpOnly' => false
- )
- ),
- array(
- 'secure=sha1; secure; SECURE; domain=some.really.deep.domain.com; version=1; Max-Age=86400',
- array(
- 'Name' => 'secure',
- 'Value' => 'sha1',
- 'Domain' => 'some.really.deep.domain.com',
- 'Path' => '/',
- 'Secure' => true,
- 'Discard' => null,
- 'Expires' => time() + 86400,
- 'Max-Age' => 86400,
- 'HttpOnly' => false,
- 'version' => '1'
- )
- ),
- array(
- 'PHPSESSID=123456789+abcd%2Cef; secure; discard; domain=.localdomain; path=/foo/baz; expires=Tue, 21-Nov-2006 08:33:44 GMT;',
- array(
- 'Name' => 'PHPSESSID',
- 'Value' => '123456789+abcd%2Cef',
- 'Domain' => '.localdomain',
- 'Path' => '/foo/baz',
- 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT',
- 'Secure' => true,
- 'Discard' => true,
- 'Max-Age' => null,
- 'HttpOnly' => false
- )
- ),
- );
- }
-
- /**
- * @dataProvider cookieParserDataProvider
- */
- public function testParseCookie($cookie, $parsed)
- {
- foreach ((array) $cookie as $v) {
- $c = SetCookie::fromString($v);
- $p = $c->toArray();
-
- if (isset($p['Expires'])) {
- // Remove expires values from the assertion if they are relatively equal
- if (abs($p['Expires'] != strtotime($parsed['Expires'])) < 40) {
- unset($p['Expires']);
- unset($parsed['Expires']);
- }
- }
-
- if (!empty($parsed)) {
- foreach ($parsed as $key => $value) {
- $this->assertEquals($parsed[$key], $p[$key], 'Comparing ' . $key . ' ' . var_export($value, true) . ' : ' . var_export($parsed, true) . ' | ' . var_export($p, true));
- }
- foreach ($p as $key => $value) {
- $this->assertEquals($p[$key], $parsed[$key], 'Comparing ' . $key . ' ' . var_export($value, true) . ' : ' . var_export($parsed, true) . ' | ' . var_export($p, true));
- }
- } else {
- $this->assertEquals([
- 'Name' => null,
- 'Value' => null,
- 'Domain' => null,
- 'Path' => '/',
- 'Max-Age' => null,
- 'Expires' => null,
- 'Secure' => false,
- 'Discard' => false,
- 'HttpOnly' => false,
- ], $p);
- }
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/AbstractEventTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Event/AbstractEventTest.php
deleted file mode 100644
index b8c06f1..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/AbstractEventTest.php
+++ /dev/null
@@ -1,14 +0,0 @@
-getMockBuilder('GuzzleHttp\Event\AbstractEvent')
- ->getMockForAbstractClass();
- $this->assertFalse($e->isPropagationStopped());
- $e->stopPropagation();
- $this->assertTrue($e->isPropagationStopped());
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/AbstractRequestEventTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Event/AbstractRequestEventTest.php
deleted file mode 100644
index 50536c5..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/AbstractRequestEventTest.php
+++ /dev/null
@@ -1,33 +0,0 @@
-getMockBuilder('GuzzleHttp\Event\AbstractRequestEvent')
- ->setConstructorArgs([$t])
- ->getMockForAbstractClass();
- $this->assertSame($t->client, $e->getClient());
- $this->assertSame($t->request, $e->getRequest());
- }
-
- public function testHasTransaction()
- {
- $t = new Transaction(new Client(), new Request('GET', '/'));
- $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractRequestEvent')
- ->setConstructorArgs([$t])
- ->getMockForAbstractClass();
- $r = new \ReflectionMethod($e, 'getTransaction');
- $r->setAccessible(true);
- $this->assertSame($t, $r->invoke($e));
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/AbstractRetryableEventTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Event/AbstractRetryableEventTest.php
deleted file mode 100644
index 6a39d8b..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/AbstractRetryableEventTest.php
+++ /dev/null
@@ -1,37 +0,0 @@
-transferInfo = ['foo' => 'bar'];
- $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractRetryableEvent')
- ->setConstructorArgs([$t])
- ->getMockForAbstractClass();
- $e->retry();
- $this->assertTrue($e->isPropagationStopped());
- $this->assertEquals('retry', $t->state);
- }
-
- public function testCanRetryAfterDelay()
- {
- $t = new Transaction(new Client(), new Request('GET', '/'));
- $t->transferInfo = ['foo' => 'bar'];
- $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractRetryableEvent')
- ->setConstructorArgs([$t])
- ->getMockForAbstractClass();
- $e->retry(10);
- $this->assertTrue($e->isPropagationStopped());
- $this->assertEquals('retry', $t->state);
- $this->assertEquals(10, $t->request->getConfig()->get('delay'));
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/AbstractTransferEventTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Event/AbstractTransferEventTest.php
deleted file mode 100644
index 5313c8e..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/AbstractTransferEventTest.php
+++ /dev/null
@@ -1,59 +0,0 @@
-transferInfo = ['foo' => 'bar'];
- $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractTransferEvent')
- ->setConstructorArgs([$t])
- ->getMockForAbstractClass();
- $this->assertNull($e->getTransferInfo('baz'));
- $this->assertEquals('bar', $e->getTransferInfo('foo'));
- $this->assertEquals($t->transferInfo, $e->getTransferInfo());
- }
-
- public function testHasResponse()
- {
- $t = new Transaction(new Client(), new Request('GET', '/'));
- $t->response = new Response(200);
- $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractTransferEvent')
- ->setConstructorArgs([$t])
- ->getMockForAbstractClass();
- $this->assertTrue($e->hasResponse());
- $this->assertSame($t->response, $e->getResponse());
- }
-
- public function testCanInterceptWithResponse()
- {
- $t = new Transaction(new Client(), new Request('GET', '/'));
- $r = new Response(200);
- $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractTransferEvent')
- ->setConstructorArgs([$t])
- ->getMockForAbstractClass();
- $e->intercept($r);
- $this->assertSame($t->response, $r);
- $this->assertSame($t->response, $e->getResponse());
- $this->assertTrue($e->isPropagationStopped());
- }
-
- public function testReturnsNumberOfRetries()
- {
- $t = new Transaction(new Client(), new Request('GET', '/'));
- $t->retries = 2;
- $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractTransferEvent')
- ->setConstructorArgs([$t])
- ->getMockForAbstractClass();
- $this->assertEquals(2, $e->getRetryCount());
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/BeforeEventTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Event/BeforeEventTest.php
deleted file mode 100644
index 469e4e2..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/BeforeEventTest.php
+++ /dev/null
@@ -1,26 +0,0 @@
-exception = new \Exception('foo');
- $e = new BeforeEvent($t);
- $response = new Response(200);
- $e->intercept($response);
- $this->assertTrue($e->isPropagationStopped());
- $this->assertSame($t->response, $response);
- $this->assertNull($t->exception);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/EmitterTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Event/EmitterTest.php
deleted file mode 100644
index 5b7061b..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/EmitterTest.php
+++ /dev/null
@@ -1,363 +0,0 @@
-emitter = new Emitter();
- $this->listener = new TestEventListener();
- }
-
- protected function tearDown()
- {
- $this->emitter = null;
- $this->listener = null;
- }
-
- public function testInitialState()
- {
- $this->assertEquals(array(), $this->emitter->listeners());
- }
-
- public function testAddListener()
- {
- $this->emitter->on('pre.foo', array($this->listener, 'preFoo'));
- $this->emitter->on('post.foo', array($this->listener, 'postFoo'));
- $this->assertTrue($this->emitter->hasListeners(self::preFoo));
- $this->assertTrue($this->emitter->hasListeners(self::preFoo));
- $this->assertCount(1, $this->emitter->listeners(self::postFoo));
- $this->assertCount(1, $this->emitter->listeners(self::postFoo));
- $this->assertCount(2, $this->emitter->listeners());
- }
-
- public function testGetListenersSortsByPriority()
- {
- $listener1 = new TestEventListener();
- $listener2 = new TestEventListener();
- $listener3 = new TestEventListener();
- $listener1->name = '1';
- $listener2->name = '2';
- $listener3->name = '3';
-
- $this->emitter->on('pre.foo', array($listener1, 'preFoo'), -10);
- $this->emitter->on('pre.foo', array($listener2, 'preFoo'), 10);
- $this->emitter->on('pre.foo', array($listener3, 'preFoo'));
-
- $expected = array(
- array($listener2, 'preFoo'),
- array($listener3, 'preFoo'),
- array($listener1, 'preFoo'),
- );
-
- $this->assertSame($expected, $this->emitter->listeners('pre.foo'));
- }
-
- public function testGetAllListenersSortsByPriority()
- {
- $listener1 = new TestEventListener();
- $listener2 = new TestEventListener();
- $listener3 = new TestEventListener();
- $listener4 = new TestEventListener();
- $listener5 = new TestEventListener();
- $listener6 = new TestEventListener();
-
- $this->emitter->on('pre.foo', [$listener1, 'preFoo'], -10);
- $this->emitter->on('pre.foo', [$listener2, 'preFoo']);
- $this->emitter->on('pre.foo', [$listener3, 'preFoo'], 10);
- $this->emitter->on('post.foo', [$listener4, 'preFoo'], -10);
- $this->emitter->on('post.foo', [$listener5, 'preFoo']);
- $this->emitter->on('post.foo', [$listener6, 'preFoo'], 10);
-
- $expected = [
- 'pre.foo' => [[$listener3, 'preFoo'], [$listener2, 'preFoo'], [$listener1, 'preFoo']],
- 'post.foo' => [[$listener6, 'preFoo'], [$listener5, 'preFoo'], [$listener4, 'preFoo']],
- ];
-
- $this->assertSame($expected, $this->emitter->listeners());
- }
-
- public function testDispatch()
- {
- $this->emitter->on('pre.foo', array($this->listener, 'preFoo'));
- $this->emitter->on('post.foo', array($this->listener, 'postFoo'));
- $this->emitter->emit(self::preFoo, $this->getEvent());
- $this->assertTrue($this->listener->preFooInvoked);
- $this->assertFalse($this->listener->postFooInvoked);
- $this->assertInstanceOf('GuzzleHttp\Event\EventInterface', $this->emitter->emit(self::preFoo, $this->getEvent()));
- $event = $this->getEvent();
- $return = $this->emitter->emit(self::preFoo, $event);
- $this->assertSame($event, $return);
- }
-
- public function testDispatchForClosure()
- {
- $invoked = 0;
- $listener = function () use (&$invoked) {
- $invoked++;
- };
- $this->emitter->on('pre.foo', $listener);
- $this->emitter->on('post.foo', $listener);
- $this->emitter->emit(self::preFoo, $this->getEvent());
- $this->assertEquals(1, $invoked);
- }
-
- public function testStopEventPropagation()
- {
- $otherListener = new TestEventListener();
-
- // postFoo() stops the propagation, so only one listener should
- // be executed
- // Manually set priority to enforce $this->listener to be called first
- $this->emitter->on('post.foo', array($this->listener, 'postFoo'), 10);
- $this->emitter->on('post.foo', array($otherListener, 'preFoo'));
- $this->emitter->emit(self::postFoo, $this->getEvent());
- $this->assertTrue($this->listener->postFooInvoked);
- $this->assertFalse($otherListener->postFooInvoked);
- }
-
- public function testDispatchByPriority()
- {
- $invoked = array();
- $listener1 = function () use (&$invoked) {
- $invoked[] = '1';
- };
- $listener2 = function () use (&$invoked) {
- $invoked[] = '2';
- };
- $listener3 = function () use (&$invoked) {
- $invoked[] = '3';
- };
- $this->emitter->on('pre.foo', $listener1, -10);
- $this->emitter->on('pre.foo', $listener2);
- $this->emitter->on('pre.foo', $listener3, 10);
- $this->emitter->emit(self::preFoo, $this->getEvent());
- $this->assertEquals(array('3', '2', '1'), $invoked);
- }
-
- public function testRemoveListener()
- {
- $this->emitter->on('pre.bar', [$this->listener, 'preFoo']);
- $this->assertNotEmpty($this->emitter->listeners(self::preBar));
- $this->emitter->removeListener('pre.bar', [$this->listener, 'preFoo']);
- $this->assertEmpty($this->emitter->listeners(self::preBar));
- $this->emitter->removeListener('notExists', [$this->listener, 'preFoo']);
- }
-
- public function testAddSubscriber()
- {
- $eventSubscriber = new TestEventSubscriber();
- $this->emitter->attach($eventSubscriber);
- $this->assertNotEmpty($this->emitter->listeners(self::preFoo));
- $this->assertNotEmpty($this->emitter->listeners(self::postFoo));
- }
-
- public function testAddSubscriberWithMultiple()
- {
- $eventSubscriber = new TestEventSubscriberWithMultiple();
- $this->emitter->attach($eventSubscriber);
- $listeners = $this->emitter->listeners('pre.foo');
- $this->assertNotEmpty($this->emitter->listeners(self::preFoo));
- $this->assertCount(2, $listeners);
- }
-
- public function testAddSubscriberWithPriorities()
- {
- $eventSubscriber = new TestEventSubscriber();
- $this->emitter->attach($eventSubscriber);
-
- $eventSubscriber = new TestEventSubscriberWithPriorities();
- $this->emitter->attach($eventSubscriber);
-
- $listeners = $this->emitter->listeners('pre.foo');
- $this->assertNotEmpty($this->emitter->listeners(self::preFoo));
- $this->assertCount(2, $listeners);
- $this->assertInstanceOf('GuzzleHttp\Tests\Event\TestEventSubscriberWithPriorities', $listeners[0][0]);
- }
-
- public function testdetach()
- {
- $eventSubscriber = new TestEventSubscriber();
- $this->emitter->attach($eventSubscriber);
- $this->assertNotEmpty($this->emitter->listeners(self::preFoo));
- $this->assertNotEmpty($this->emitter->listeners(self::postFoo));
- $this->emitter->detach($eventSubscriber);
- $this->assertEmpty($this->emitter->listeners(self::preFoo));
- $this->assertEmpty($this->emitter->listeners(self::postFoo));
- }
-
- public function testdetachWithPriorities()
- {
- $eventSubscriber = new TestEventSubscriberWithPriorities();
- $this->emitter->attach($eventSubscriber);
- $this->assertNotEmpty($this->emitter->listeners(self::preFoo));
- $this->assertNotEmpty($this->emitter->listeners(self::postFoo));
- $this->emitter->detach($eventSubscriber);
- $this->assertEmpty($this->emitter->listeners(self::preFoo));
- $this->assertEmpty($this->emitter->listeners(self::postFoo));
- }
-
- public function testEventReceivesEventNameAsArgument()
- {
- $listener = new TestWithDispatcher();
- $this->emitter->on('test', array($listener, 'foo'));
- $this->assertNull($listener->name);
- $this->emitter->emit('test', $this->getEvent());
- $this->assertEquals('test', $listener->name);
- }
-
- /**
- * @see https://bugs.php.net/bug.php?id=62976
- *
- * This bug affects:
- * - The PHP 5.3 branch for versions < 5.3.18
- * - The PHP 5.4 branch for versions < 5.4.8
- * - The PHP 5.5 branch is not affected
- */
- public function testWorkaroundForPhpBug62976()
- {
- $dispatcher = new Emitter();
- $dispatcher->on('bug.62976', new CallableClass());
- $dispatcher->removeListener('bug.62976', function () {});
- $this->assertNotEmpty($dispatcher->listeners('bug.62976'));
- }
-
- public function testRegistersEventsOnce()
- {
- $this->emitter->once('pre.foo', array($this->listener, 'preFoo'));
- $this->emitter->on('pre.foo', array($this->listener, 'preFoo'));
- $this->assertCount(2, $this->emitter->listeners(self::preFoo));
- $this->emitter->emit(self::preFoo, $this->getEvent());
- $this->assertTrue($this->listener->preFooInvoked);
- $this->assertCount(1, $this->emitter->listeners(self::preFoo));
- }
-
- public function testReturnsEmptyArrayForNonExistentEvent()
- {
- $this->assertEquals([], $this->emitter->listeners('doesnotexist'));
- }
-
- public function testCanAddFirstAndLastListeners()
- {
- $b = '';
- $this->emitter->on('foo', function () use (&$b) { $b .= 'a'; }, 'first'); // 1
- $this->emitter->on('foo', function () use (&$b) { $b .= 'b'; }, 'last'); // 0
- $this->emitter->on('foo', function () use (&$b) { $b .= 'c'; }, 'first'); // 2
- $this->emitter->on('foo', function () use (&$b) { $b .= 'd'; }, 'first'); // 3
- $this->emitter->on('foo', function () use (&$b) { $b .= 'e'; }, 'first'); // 4
- $this->emitter->on('foo', function () use (&$b) { $b .= 'f'; }); // 0
- $this->emitter->emit('foo', $this->getEvent());
- $this->assertEquals('edcabf', $b);
- }
-
- /**
- * @return \GuzzleHttp\Event\EventInterface
- */
- private function getEvent()
- {
- return $this->getMockBuilder('GuzzleHttp\Event\AbstractEvent')
- ->getMockForAbstractClass();
- }
-}
-
-class CallableClass
-{
- public function __invoke()
- {
- }
-}
-
-class TestEventListener
-{
- public $preFooInvoked = false;
- public $postFooInvoked = false;
-
- /* Listener methods */
-
- public function preFoo(EventInterface $e)
- {
- $this->preFooInvoked = true;
- }
-
- public function postFoo(EventInterface $e)
- {
- $this->postFooInvoked = true;
-
- $e->stopPropagation();
- }
-
- /**
- * @expectedException \PHPUnit_Framework_Error_Deprecated
- */
- public function testHasDeprecatedAddListener()
- {
- $emitter = new Emitter();
- $emitter->addListener('foo', function () {});
- }
-
- /**
- * @expectedException \PHPUnit_Framework_Error_Deprecated
- */
- public function testHasDeprecatedAddSubscriber()
- {
- $emitter = new Emitter();
- $emitter->addSubscriber('foo', new TestEventSubscriber());
- }
-}
-
-class TestWithDispatcher
-{
- public $name;
-
- public function foo(EventInterface $e, $name)
- {
- $this->name = $name;
- }
-}
-
-class TestEventSubscriber extends TestEventListener implements SubscriberInterface
-{
- public function getEvents()
- {
- return [
- 'pre.foo' => ['preFoo'],
- 'post.foo' => ['postFoo']
- ];
- }
-}
-
-class TestEventSubscriberWithPriorities extends TestEventListener implements SubscriberInterface
-{
- public function getEvents()
- {
- return [
- 'pre.foo' => ['preFoo', 10],
- 'post.foo' => ['postFoo']
- ];
- }
-}
-
-class TestEventSubscriberWithMultiple extends TestEventListener implements SubscriberInterface
-{
- public function getEvents()
- {
- return ['pre.foo' => [['preFoo', 10],['preFoo', 20]]];
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/ErrorEventTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Event/ErrorEventTest.php
deleted file mode 100644
index e91b7f0..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/ErrorEventTest.php
+++ /dev/null
@@ -1,23 +0,0 @@
-request);
- $t->exception = $except;
- $e = new ErrorEvent($t);
- $this->assertSame($e->getException(), $t->exception);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/HasEmitterTraitTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Event/HasEmitterTraitTest.php
deleted file mode 100644
index 4709918..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/HasEmitterTraitTest.php
+++ /dev/null
@@ -1,27 +0,0 @@
-getMockBuilder('GuzzleHttp\Tests\Event\AbstractHasEmitter')
- ->getMockForAbstractClass();
-
- $result = $mock->getEmitter();
- $this->assertInstanceOf('GuzzleHttp\Event\EmitterInterface', $result);
- $result2 = $mock->getEmitter();
- $this->assertSame($result, $result2);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/ListenerAttacherTraitTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Event/ListenerAttacherTraitTest.php
deleted file mode 100644
index 0b5d348..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/ListenerAttacherTraitTest.php
+++ /dev/null
@@ -1,92 +0,0 @@
-listeners = $this->prepareListeners($args, ['foo', 'bar']);
- $this->attachListeners($this, $this->listeners);
- }
-}
-
-class ListenerAttacherTraitTest extends \PHPUnit_Framework_TestCase
-{
- public function testRegistersEvents()
- {
- $fn = function () {};
- $o = new ObjectWithEvents([
- 'foo' => $fn,
- 'bar' => $fn,
- ]);
-
- $this->assertEquals([
- ['name' => 'foo', 'fn' => $fn, 'priority' => 0, 'once' => false],
- ['name' => 'bar', 'fn' => $fn, 'priority' => 0, 'once' => false],
- ], $o->listeners);
-
- $this->assertCount(1, $o->getEmitter()->listeners('foo'));
- $this->assertCount(1, $o->getEmitter()->listeners('bar'));
- }
-
- public function testRegistersEventsWithPriorities()
- {
- $fn = function () {};
- $o = new ObjectWithEvents([
- 'foo' => ['fn' => $fn, 'priority' => 99, 'once' => true],
- 'bar' => ['fn' => $fn, 'priority' => 50],
- ]);
-
- $this->assertEquals([
- ['name' => 'foo', 'fn' => $fn, 'priority' => 99, 'once' => true],
- ['name' => 'bar', 'fn' => $fn, 'priority' => 50, 'once' => false],
- ], $o->listeners);
- }
-
- public function testRegistersMultipleEvents()
- {
- $fn = function () {};
- $eventArray = [['fn' => $fn], ['fn' => $fn]];
- $o = new ObjectWithEvents([
- 'foo' => $eventArray,
- 'bar' => $eventArray,
- ]);
-
- $this->assertEquals([
- ['name' => 'foo', 'fn' => $fn, 'priority' => 0, 'once' => false],
- ['name' => 'foo', 'fn' => $fn, 'priority' => 0, 'once' => false],
- ['name' => 'bar', 'fn' => $fn, 'priority' => 0, 'once' => false],
- ['name' => 'bar', 'fn' => $fn, 'priority' => 0, 'once' => false],
- ], $o->listeners);
-
- $this->assertCount(2, $o->getEmitter()->listeners('foo'));
- $this->assertCount(2, $o->getEmitter()->listeners('bar'));
- }
-
- public function testRegistersEventsWithOnce()
- {
- $called = 0;
- $fn = function () use (&$called) { $called++; };
- $o = new ObjectWithEvents(['foo' => ['fn' => $fn, 'once' => true]]);
- $ev = $this->getMock('GuzzleHttp\Event\EventInterface');
- $o->getEmitter()->emit('foo', $ev);
- $o->getEmitter()->emit('foo', $ev);
- $this->assertEquals(1, $called);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesEvents()
- {
- new ObjectWithEvents(['foo' => 'bar']);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/ProgressEventTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Event/ProgressEventTest.php
deleted file mode 100644
index 664f8b6..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/ProgressEventTest.php
+++ /dev/null
@@ -1,25 +0,0 @@
-assertSame($t->request, $p->getRequest());
- $this->assertSame($t->client, $p->getClient());
- $this->assertEquals(2, $p->downloadSize);
- $this->assertEquals(1, $p->downloaded);
- $this->assertEquals(3, $p->uploadSize);
- $this->assertEquals(0, $p->uploaded);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/RequestEventsTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Event/RequestEventsTest.php
deleted file mode 100644
index b3b9666..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Event/RequestEventsTest.php
+++ /dev/null
@@ -1,74 +0,0 @@
- [$cb]]],
- [
- ['complete' => $cb],
- ['complete'],
- $cb,
- ['complete' => [$cb, $cb]]
- ],
- [
- ['prepare' => []],
- ['error', 'foo'],
- $cb,
- [
- 'prepare' => [],
- 'error' => [$cb],
- 'foo' => [$cb]
- ]
- ],
- [
- ['prepare' => []],
- ['prepare'],
- $cb,
- [
- 'prepare' => [$cb]
- ]
- ],
- [
- ['prepare' => ['fn' => $cb]],
- ['prepare'], $cb,
- [
- 'prepare' => [
- ['fn' => $cb],
- $cb
- ]
- ]
- ],
- ];
- }
-
- /**
- * @dataProvider prepareEventProvider
- */
- public function testConvertsEventArrays(
- array $in,
- array $events,
- $add,
- array $out
- ) {
- $result = RequestEvents::convertEventArray($in, $events, $add);
- $this->assertEquals($out, $result);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesEventFormat()
- {
- RequestEvents::convertEventArray(['foo' => false], ['foo'], []);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Exception/ParseExceptionTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Exception/ParseExceptionTest.php
deleted file mode 100644
index 4ff9bfb..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Exception/ParseExceptionTest.php
+++ /dev/null
@@ -1,20 +0,0 @@
-assertSame($res, $e->getResponse());
- $this->assertEquals('foo', $e->getMessage());
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Exception/RequestExceptionTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Exception/RequestExceptionTest.php
deleted file mode 100644
index bea9077..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Exception/RequestExceptionTest.php
+++ /dev/null
@@ -1,83 +0,0 @@
-assertSame($req, $e->getRequest());
- $this->assertSame($res, $e->getResponse());
- $this->assertTrue($e->hasResponse());
- $this->assertEquals('foo', $e->getMessage());
- }
-
- public function testCreatesGenerateException()
- {
- $e = RequestException::create(new Request('GET', '/'));
- $this->assertEquals('Error completing request', $e->getMessage());
- $this->assertInstanceOf('GuzzleHttp\Exception\RequestException', $e);
- }
-
- public function testCreatesClientErrorResponseException()
- {
- $e = RequestException::create(new Request('GET', '/'), new Response(400));
- $this->assertEquals(
- 'Client error response [url] / [status code] 400 [reason phrase] Bad Request',
- $e->getMessage()
- );
- $this->assertInstanceOf('GuzzleHttp\Exception\ClientException', $e);
- }
-
- public function testCreatesServerErrorResponseException()
- {
- $e = RequestException::create(new Request('GET', '/'), new Response(500));
- $this->assertEquals(
- 'Server error response [url] / [status code] 500 [reason phrase] Internal Server Error',
- $e->getMessage()
- );
- $this->assertInstanceOf('GuzzleHttp\Exception\ServerException', $e);
- }
-
- public function testCreatesGenericErrorResponseException()
- {
- $e = RequestException::create(new Request('GET', '/'), new Response(600));
- $this->assertEquals(
- 'Unsuccessful response [url] / [status code] 600 [reason phrase] ',
- $e->getMessage()
- );
- $this->assertInstanceOf('GuzzleHttp\Exception\RequestException', $e);
- }
-
- public function testHasStatusCodeAsExceptionCode() {
- $e = RequestException::create(new Request('GET', '/'), new Response(442));
- $this->assertEquals(442, $e->getCode());
- }
-
- public function testWrapsRequestExceptions()
- {
- $e = new \Exception('foo');
- $r = new Request('GET', 'http://www.oo.com');
- $ex = RequestException::wrapException($r, $e);
- $this->assertInstanceOf('GuzzleHttp\Exception\RequestException', $ex);
- $this->assertSame($e, $ex->getPrevious());
- }
-
- public function testWrapsConnectExceptions()
- {
- $e = new ConnectException('foo');
- $r = new Request('GET', 'http://www.oo.com');
- $ex = RequestException::wrapException($r, $e);
- $this->assertInstanceOf('GuzzleHttp\Exception\ConnectException', $ex);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Exception/XmlParseExceptionTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Exception/XmlParseExceptionTest.php
deleted file mode 100644
index 51b9742..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Exception/XmlParseExceptionTest.php
+++ /dev/null
@@ -1,19 +0,0 @@
-assertSame($error, $e->getError());
- $this->assertEquals('foo', $e->getMessage());
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/IntegrationTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/IntegrationTest.php
deleted file mode 100644
index e26c64d..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/IntegrationTest.php
+++ /dev/null
@@ -1,123 +0,0 @@
-createRequest(
- 'GET',
- Server::$url,
- [
- 'timeout' => 1,
- 'connect_timeout' => 1,
- 'proxy' => 'http://127.0.0.1:123/foo'
- ]
- );
-
- $events = [];
- $fn = function(AbstractTransferEvent $event) use (&$events) {
- $events[] = [
- get_class($event),
- $event->hasResponse(),
- $event->getResponse()
- ];
- };
-
- $pool = new Pool($c, [$r], [
- 'error' => $fn,
- 'end' => $fn
- ]);
-
- $pool->wait();
-
- $this->assertCount(2, $events);
- $this->assertEquals('GuzzleHttp\Event\ErrorEvent', $events[0][0]);
- $this->assertFalse($events[0][1]);
- $this->assertNull($events[0][2]);
-
- $this->assertEquals('GuzzleHttp\Event\EndEvent', $events[1][0]);
- $this->assertFalse($events[1][1]);
- $this->assertNull($events[1][2]);
- }
-
- /**
- * @issue https://github.com/guzzle/guzzle/issues/866
- */
- public function testProperyGetsTransferStats()
- {
- $transfer = [];
- Server::enqueue([new Response(200)]);
- $c = new Client();
- $response = $c->get(Server::$url . '/foo', [
- 'events' => [
- 'end' => function (EndEvent $e) use (&$transfer) {
- $transfer = $e->getTransferInfo();
- }
- ]
- ]);
- $this->assertEquals(Server::$url . '/foo', $response->getEffectiveUrl());
- $this->assertNotEmpty($transfer);
- $this->assertArrayHasKey('url', $transfer);
- }
-
- public function testNestedFutureResponsesAreResolvedWhenSending()
- {
- $c = new Client();
- $total = 3;
- Server::enqueue([
- new Response(200),
- new Response(201),
- new Response(202)
- ]);
- $c->getEmitter()->on(
- 'complete',
- function (CompleteEvent $e) use (&$total) {
- if (--$total) {
- $e->retry();
- }
- }
- );
- $response = $c->get(Server::$url);
- $this->assertEquals(202, $response->getStatusCode());
- $this->assertEquals('GuzzleHttp\Message\Response', get_class($response));
- }
-
- public function testNestedFutureErrorsAreResolvedWhenSending()
- {
- $c = new Client();
- $total = 3;
- Server::enqueue([
- new Response(500),
- new Response(501),
- new Response(502)
- ]);
- $c->getEmitter()->on(
- 'error',
- function (ErrorEvent $e) use (&$total) {
- if (--$total) {
- $e->retry();
- }
- }
- );
- try {
- $c->get(Server::$url);
- $this->fail('Did not throw!');
- } catch (RequestException $e) {
- $this->assertEquals(502, $e->getResponse()->getStatusCode());
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Message/AbstractMessageTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Message/AbstractMessageTest.php
deleted file mode 100644
index f02a576..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Message/AbstractMessageTest.php
+++ /dev/null
@@ -1,269 +0,0 @@
-assertEquals(1.1, $m->getProtocolVersion());
- }
-
- public function testHasHeaders()
- {
- $m = new Request('GET', 'http://foo.com');
- $this->assertFalse($m->hasHeader('foo'));
- $m->addHeader('foo', 'bar');
- $this->assertTrue($m->hasHeader('foo'));
- }
-
- public function testInitializesMessageWithProtocolVersionOption()
- {
- $m = new Request('GET', '/', [], null, [
- 'protocol_version' => '10'
- ]);
- $this->assertEquals(10, $m->getProtocolVersion());
- }
-
- public function testHasBody()
- {
- $m = new Request('GET', 'http://foo.com');
- $this->assertNull($m->getBody());
- $s = Stream::factory('test');
- $m->setBody($s);
- $this->assertSame($s, $m->getBody());
- $this->assertFalse($m->hasHeader('Content-Length'));
- }
-
- public function testCanRemoveBodyBySettingToNullAndRemovesCommonBodyHeaders()
- {
- $m = new Request('GET', 'http://foo.com');
- $m->setBody(Stream::factory('foo'));
- $m->setHeader('Content-Length', 3);
- $m->setHeader('Transfer-Encoding', 'chunked');
- $m->setBody(null);
- $this->assertNull($m->getBody());
- $this->assertFalse($m->hasHeader('Content-Length'));
- $this->assertFalse($m->hasHeader('Transfer-Encoding'));
- }
-
- public function testCastsToString()
- {
- $m = new Request('GET', 'http://foo.com');
- $m->setHeader('foo', 'bar');
- $m->setBody(Stream::factory('baz'));
- $this->assertEquals("GET / HTTP/1.1\r\nHost: foo.com\r\nfoo: bar\r\n\r\nbaz", (string) $m);
- }
-
- public function parseParamsProvider()
- {
- $res1 = array(
- array(
- '',
- 'rel' => 'front',
- 'type' => 'image/jpeg',
- ),
- array(
- '',
- 'rel' => 'back',
- 'type' => 'image/jpeg',
- ),
- );
-
- return array(
- array(
- '; rel="front"; type="image/jpeg", ; rel=back; type="image/jpeg"',
- $res1
- ),
- array(
- '; rel="front"; type="image/jpeg",; rel=back; type="image/jpeg"',
- $res1
- ),
- array(
- 'foo="baz"; bar=123, boo, test="123", foobar="foo;bar"',
- array(
- array('foo' => 'baz', 'bar' => '123'),
- array('boo'),
- array('test' => '123'),
- array('foobar' => 'foo;bar')
- )
- ),
- array(
- '; rel="side"; type="image/jpeg",; rel=side; type="image/jpeg"',
- array(
- array('', 'rel' => 'side', 'type' => 'image/jpeg'),
- array('', 'rel' => 'side', 'type' => 'image/jpeg')
- )
- ),
- array(
- '',
- array()
- )
- );
- }
-
- /**
- * @dataProvider parseParamsProvider
- */
- public function testParseParams($header, $result)
- {
- $request = new Request('GET', '/', ['foo' => $header]);
- $this->assertEquals($result, Request::parseHeader($request, 'foo'));
- }
-
- public function testAddsHeadersWhenNotPresent()
- {
- $h = new Request('GET', 'http://foo.com');
- $h->addHeader('foo', 'bar');
- $this->assertInternalType('string', $h->getHeader('foo'));
- $this->assertEquals('bar', $h->getHeader('foo'));
- }
-
- public function testAddsHeadersWhenPresentSameCase()
- {
- $h = new Request('GET', 'http://foo.com');
- $h->addHeader('foo', 'bar');
- $h->addHeader('foo', 'baz');
- $this->assertEquals('bar, baz', $h->getHeader('foo'));
- $this->assertEquals(['bar', 'baz'], $h->getHeaderAsArray('foo'));
- }
-
- public function testAddsMultipleHeaders()
- {
- $h = new Request('GET', 'http://foo.com');
- $h->addHeaders([
- 'foo' => ' bar',
- 'baz' => [' bam ', 'boo']
- ]);
- $this->assertEquals([
- 'foo' => ['bar'],
- 'baz' => ['bam', 'boo'],
- 'Host' => ['foo.com']
- ], $h->getHeaders());
- }
-
- public function testAddsHeadersWhenPresentDifferentCase()
- {
- $h = new Request('GET', 'http://foo.com');
- $h->addHeader('Foo', 'bar');
- $h->addHeader('fOO', 'baz');
- $this->assertEquals('bar, baz', $h->getHeader('foo'));
- }
-
- public function testAddsHeadersWithArray()
- {
- $h = new Request('GET', 'http://foo.com');
- $h->addHeader('Foo', ['bar', 'baz']);
- $this->assertEquals('bar, baz', $h->getHeader('foo'));
- }
-
- public function testGetHeadersReturnsAnArrayOfOverTheWireHeaderValues()
- {
- $h = new Request('GET', 'http://foo.com');
- $h->addHeader('foo', 'bar');
- $h->addHeader('Foo', 'baz');
- $h->addHeader('boO', 'test');
- $result = $h->getHeaders();
- $this->assertInternalType('array', $result);
- $this->assertArrayHasKey('Foo', $result);
- $this->assertArrayNotHasKey('foo', $result);
- $this->assertArrayHasKey('boO', $result);
- $this->assertEquals(['bar', 'baz'], $result['Foo']);
- $this->assertEquals(['test'], $result['boO']);
- }
-
- public function testSetHeaderOverwritesExistingValues()
- {
- $h = new Request('GET', 'http://foo.com');
- $h->setHeader('foo', 'bar');
- $this->assertEquals('bar', $h->getHeader('foo'));
- $h->setHeader('Foo', 'baz');
- $this->assertEquals('baz', $h->getHeader('foo'));
- $this->assertArrayHasKey('Foo', $h->getHeaders());
- }
-
- public function testSetHeaderOverwritesExistingValuesUsingHeaderArray()
- {
- $h = new Request('GET', 'http://foo.com');
- $h->setHeader('foo', ['bar']);
- $this->assertEquals('bar', $h->getHeader('foo'));
- }
-
- public function testSetHeaderOverwritesExistingValuesUsingArray()
- {
- $h = new Request('GET', 'http://foo.com');
- $h->setHeader('foo', ['bar']);
- $this->assertEquals('bar', $h->getHeader('foo'));
- }
-
- public function testSetHeadersOverwritesAllHeaders()
- {
- $h = new Request('GET', 'http://foo.com');
- $h->setHeader('foo', 'bar');
- $h->setHeaders(['foo' => 'a', 'boo' => 'b']);
- $this->assertEquals(['foo' => ['a'], 'boo' => ['b']], $h->getHeaders());
- }
-
- public function testChecksIfCaseInsensitiveHeaderIsPresent()
- {
- $h = new Request('GET', 'http://foo.com');
- $h->setHeader('foo', 'bar');
- $this->assertTrue($h->hasHeader('foo'));
- $this->assertTrue($h->hasHeader('Foo'));
- $h->setHeader('fOo', 'bar');
- $this->assertTrue($h->hasHeader('Foo'));
- }
-
- public function testRemovesHeaders()
- {
- $h = new Request('GET', 'http://foo.com');
- $h->setHeader('foo', 'bar');
- $h->removeHeader('foo');
- $this->assertFalse($h->hasHeader('foo'));
- $h->setHeader('Foo', 'bar');
- $h->removeHeader('FOO');
- $this->assertFalse($h->hasHeader('foo'));
- }
-
- public function testReturnsCorrectTypeWhenMissing()
- {
- $h = new Request('GET', 'http://foo.com');
- $this->assertInternalType('string', $h->getHeader('foo'));
- $this->assertInternalType('array', $h->getHeaderAsArray('foo'));
- }
-
- public function testSetsIntegersAndFloatsAsHeaders()
- {
- $h = new Request('GET', 'http://foo.com');
- $h->setHeader('foo', 10);
- $h->setHeader('bar', 10.5);
- $h->addHeader('foo', 10);
- $h->addHeader('bar', 10.5);
- $this->assertSame('10, 10', $h->getHeader('foo'));
- $this->assertSame('10.5, 10.5', $h->getHeader('bar'));
- }
-
- public function testGetsResponseStartLine()
- {
- $m = new Response(200);
- $this->assertEquals('HTTP/1.1 200 OK', Response::getStartLine($m));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testThrowsWhenMessageIsUnknown()
- {
- $m = $this->getMockBuilder('GuzzleHttp\Message\AbstractMessage')
- ->getMockForAbstractClass();
- AbstractMessage::getStartLine($m);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Message/FutureResponseTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Message/FutureResponseTest.php
deleted file mode 100644
index 771631d..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Message/FutureResponseTest.php
+++ /dev/null
@@ -1,160 +0,0 @@
-foo;
- }
-
- public function testDoesTheSameAsResponseWhenDereferenced()
- {
- $str = Stream::factory('foo');
- $response = new Response(200, ['Foo' => 'bar'], $str);
- $future = MockTest::createFuture(function () use ($response) {
- return $response;
- });
- $this->assertFalse($this->readAttribute($future, 'isRealized'));
- $this->assertEquals(200, $future->getStatusCode());
- $this->assertTrue($this->readAttribute($future, 'isRealized'));
- // Deref again does nothing.
- $future->wait();
- $this->assertTrue($this->readAttribute($future, 'isRealized'));
- $this->assertEquals('bar', $future->getHeader('Foo'));
- $this->assertEquals(['bar'], $future->getHeaderAsarray('Foo'));
- $this->assertSame($response->getHeaders(), $future->getHeaders());
- $this->assertSame(
- $response->getBody(),
- $future->getBody()
- );
- $this->assertSame(
- $response->getProtocolVersion(),
- $future->getProtocolVersion()
- );
- $this->assertSame(
- $response->getEffectiveUrl(),
- $future->getEffectiveUrl()
- );
- $future->setEffectiveUrl('foo');
- $this->assertEquals('foo', $response->getEffectiveUrl());
- $this->assertSame(
- $response->getReasonPhrase(),
- $future->getReasonPhrase()
- );
-
- $this->assertTrue($future->hasHeader('foo'));
-
- $future->removeHeader('Foo');
- $this->assertFalse($future->hasHeader('foo'));
- $this->assertFalse($response->hasHeader('foo'));
-
- $future->setBody(Stream::factory('true'));
- $this->assertEquals('true', (string) $response->getBody());
- $this->assertTrue($future->json());
- $this->assertSame((string) $response, (string) $future);
-
- $future->setBody(Stream::factory('c '));
- $this->assertEquals('c', (string) $future->xml()->b);
-
- $future->addHeader('a', 'b');
- $this->assertEquals('b', $future->getHeader('a'));
-
- $future->addHeaders(['a' => '2']);
- $this->assertEquals('b, 2', $future->getHeader('a'));
-
- $future->setHeader('a', '2');
- $this->assertEquals('2', $future->getHeader('a'));
-
- $future->setHeaders(['a' => '3']);
- $this->assertEquals(['a' => ['3']], $future->getHeaders());
- }
-
- public function testCanDereferenceManually()
- {
- $response = new Response(200, ['Foo' => 'bar']);
- $future = MockTest::createFuture(function () use ($response) {
- return $response;
- });
- $this->assertSame($response, $future->wait());
- $this->assertTrue($this->readAttribute($future, 'isRealized'));
- }
-
- public function testCanCancel()
- {
- $c = false;
- $deferred = new Deferred();
- $future = new FutureResponse(
- $deferred->promise(),
- function () {},
- function () use (&$c) {
- $c = true;
- return true;
- }
- );
-
- $this->assertFalse($this->readAttribute($future, 'isRealized'));
- $future->cancel();
- $this->assertTrue($this->readAttribute($future, 'isRealized'));
- $future->cancel();
- }
-
- public function testCanCancelButReturnsFalseForNoCancelFunction()
- {
- $future = MockTest::createFuture(function () {});
- $future->cancel();
- $this->assertTrue($this->readAttribute($future, 'isRealized'));
- }
-
- /**
- * @expectedException \GuzzleHttp\Ring\Exception\CancelledFutureAccessException
- */
- public function testAccessingCancelledResponseThrows()
- {
- $future = MockTest::createFuture(function () {});
- $future->cancel();
- $future->getStatusCode();
- }
-
- public function testExceptionInToStringTriggersError()
- {
- $future = MockTest::createFuture(function () {
- throw new \Exception('foo');
- });
- $err = '';
- set_error_handler(function () use (&$err) {
- $err = func_get_args()[1];
- });
- echo $future;
- restore_error_handler();
- $this->assertContains('foo', $err);
- }
-
- public function testProxiesSetters()
- {
- $str = Stream::factory('foo');
- $response = new Response(200, ['Foo' => 'bar'], $str);
- $future = MockTest::createFuture(function () use ($response) {
- return $response;
- });
-
- $future->setStatusCode(202);
- $this->assertEquals(202, $future->getStatusCode());
- $this->assertEquals(202, $response->getStatusCode());
-
- $future->setReasonPhrase('foo');
- $this->assertEquals('foo', $future->getReasonPhrase());
- $this->assertEquals('foo', $response->getReasonPhrase());
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Message/MessageFactoryTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Message/MessageFactoryTest.php
deleted file mode 100644
index 390f010..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Message/MessageFactoryTest.php
+++ /dev/null
@@ -1,601 +0,0 @@
-createResponse(200, ['foo' => 'bar'], 'test', [
- 'protocol_version' => 1.0
- ]);
- $this->assertEquals(200, $response->getStatusCode());
- $this->assertEquals(['foo' => ['bar']], $response->getHeaders());
- $this->assertEquals('test', $response->getBody());
- $this->assertEquals(1.0, $response->getProtocolVersion());
- }
-
- public function testCreatesRequestFromMessage()
- {
- $f = new MessageFactory();
- $req = $f->fromMessage("GET / HTTP/1.1\r\nBaz: foo\r\n\r\n");
- $this->assertEquals('GET', $req->getMethod());
- $this->assertEquals('/', $req->getPath());
- $this->assertEquals('foo', $req->getHeader('Baz'));
- $this->assertNull($req->getBody());
- }
-
- public function testCreatesRequestFromMessageWithBody()
- {
- $req = (new MessageFactory())->fromMessage("GET / HTTP/1.1\r\nBaz: foo\r\n\r\ntest");
- $this->assertEquals('test', $req->getBody());
- }
-
- public function testCreatesRequestWithPostBody()
- {
- $req = (new MessageFactory())->createRequest('GET', 'http://www.foo.com', ['body' => ['abc' => '123']]);
- $this->assertEquals('abc=123', $req->getBody());
- }
-
- public function testCreatesRequestWithPostBodyScalars()
- {
- $req = (new MessageFactory())->createRequest(
- 'GET',
- 'http://www.foo.com',
- ['body' => [
- 'abc' => true,
- '123' => false,
- 'foo' => null,
- 'baz' => 10,
- 'bam' => 1.5,
- 'boo' => [1]]
- ]
- );
- $this->assertEquals(
- 'abc=1&123=&foo&baz=10&bam=1.5&boo%5B0%5D=1',
- (string) $req->getBody()
- );
- }
-
- public function testCreatesRequestWithPostBodyAndPostFiles()
- {
- $pf = fopen(__FILE__, 'r');
- $pfi = new PostFile('ghi', 'abc', __FILE__);
- $req = (new MessageFactory())->createRequest('GET', 'http://www.foo.com', [
- 'body' => [
- 'abc' => '123',
- 'def' => $pf,
- 'ghi' => $pfi
- ]
- ]);
- $this->assertInstanceOf('GuzzleHttp\Post\PostBody', $req->getBody());
- $s = (string) $req;
- $this->assertContains('testCreatesRequestWithPostBodyAndPostFiles', $s);
- $this->assertContains('multipart/form-data', $s);
- $this->assertTrue(in_array($pfi, $req->getBody()->getFiles(), true));
- }
-
- public function testCreatesResponseFromMessage()
- {
- $response = (new MessageFactory())->fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest");
- $this->assertEquals(200, $response->getStatusCode());
- $this->assertEquals('OK', $response->getReasonPhrase());
- $this->assertEquals('4', $response->getHeader('Content-Length'));
- $this->assertEquals('test', $response->getBody(true));
- }
-
- public function testCanCreateHeadResponses()
- {
- $response = (new MessageFactory())->fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\n");
- $this->assertEquals(200, $response->getStatusCode());
- $this->assertEquals('OK', $response->getReasonPhrase());
- $this->assertEquals(null, $response->getBody());
- $this->assertEquals('4', $response->getHeader('Content-Length'));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testFactoryRequiresMessageForRequest()
- {
- (new MessageFactory())->fromMessage('');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage foo
- */
- public function testValidatesOptionsAreImplemented()
- {
- (new MessageFactory())->createRequest('GET', 'http://test.com', ['foo' => 'bar']);
- }
-
- public function testOptionsAddsRequestOptions()
- {
- $request = (new MessageFactory())->createRequest(
- 'GET', 'http://test.com', ['config' => ['baz' => 'bar']]
- );
- $this->assertEquals('bar', $request->getConfig()->get('baz'));
- }
-
- public function testCanDisableRedirects()
- {
- $request = (new MessageFactory())->createRequest('GET', '/', ['allow_redirects' => false]);
- $this->assertEmpty($request->getEmitter()->listeners('complete'));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesRedirects()
- {
- (new MessageFactory())->createRequest('GET', '/', ['allow_redirects' => 'foo']);
- }
-
- public function testCanEnableStrictRedirectsAndSpecifyMax()
- {
- $request = (new MessageFactory())->createRequest('GET', '/', [
- 'allow_redirects' => ['max' => 10, 'strict' => true]
- ]);
- $this->assertTrue($request->getConfig()['redirect']['strict']);
- $this->assertEquals(10, $request->getConfig()['redirect']['max']);
- }
-
- public function testCanAddCookiesFromHash()
- {
- $request = (new MessageFactory())->createRequest('GET', 'http://www.test.com/', [
- 'cookies' => ['Foo' => 'Bar']
- ]);
- $cookies = null;
- foreach ($request->getEmitter()->listeners('before') as $l) {
- if ($l[0] instanceof Cookie) {
- $cookies = $l[0];
- break;
- }
- }
- if (!$cookies) {
- $this->fail('Did not add cookie listener');
- } else {
- $this->assertCount(1, $cookies->getCookieJar());
- }
- }
-
- public function testAddsCookieUsingTrue()
- {
- $factory = new MessageFactory();
- $request1 = $factory->createRequest('GET', '/', ['cookies' => true]);
- $request2 = $factory->createRequest('GET', '/', ['cookies' => true]);
- $listeners = function ($r) {
- return array_filter($r->getEmitter()->listeners('before'), function ($l) {
- return $l[0] instanceof Cookie;
- });
- };
- $this->assertSame($listeners($request1), $listeners($request2));
- }
-
- public function testAddsCookieFromCookieJar()
- {
- $jar = new CookieJar();
- $request = (new MessageFactory())->createRequest('GET', '/', ['cookies' => $jar]);
- foreach ($request->getEmitter()->listeners('before') as $l) {
- if ($l[0] instanceof Cookie) {
- $this->assertSame($jar, $l[0]->getCookieJar());
- }
- }
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesCookies()
- {
- (new MessageFactory())->createRequest('GET', '/', ['cookies' => 'baz']);
- }
-
- public function testCanAddQuery()
- {
- $request = (new MessageFactory())->createRequest('GET', 'http://foo.com', [
- 'query' => ['Foo' => 'Bar']
- ]);
- $this->assertEquals('Bar', $request->getQuery()->get('Foo'));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesQuery()
- {
- (new MessageFactory())->createRequest('GET', 'http://foo.com', [
- 'query' => 'foo'
- ]);
- }
-
- public function testCanSetDefaultQuery()
- {
- $request = (new MessageFactory())->createRequest('GET', 'http://foo.com?test=abc', [
- 'query' => ['Foo' => 'Bar', 'test' => 'def']
- ]);
- $this->assertEquals('Bar', $request->getQuery()->get('Foo'));
- $this->assertEquals('abc', $request->getQuery()->get('test'));
- }
-
- public function testCanSetDefaultQueryWithObject()
- {
- $request = (new MessageFactory)->createRequest(
- 'GET',
- 'http://foo.com?test=abc', [
- 'query' => new Query(['Foo' => 'Bar', 'test' => 'def'])
- ]
- );
- $this->assertEquals('Bar', $request->getQuery()->get('Foo'));
- $this->assertEquals('abc', $request->getQuery()->get('test'));
- }
-
- public function testCanAddBasicAuth()
- {
- $request = (new MessageFactory())->createRequest('GET', 'http://foo.com', [
- 'auth' => ['michael', 'test']
- ]);
- $this->assertTrue($request->hasHeader('Authorization'));
- }
-
- public function testCanAddDigestAuth()
- {
- $request = (new MessageFactory())->createRequest('GET', 'http://foo.com', [
- 'auth' => ['michael', 'test', 'digest']
- ]);
- $this->assertEquals('michael:test', $request->getConfig()->getPath('curl/' . CURLOPT_USERPWD));
- $this->assertEquals(CURLAUTH_DIGEST, $request->getConfig()->getPath('curl/' . CURLOPT_HTTPAUTH));
- }
-
- public function testCanDisableAuth()
- {
- $request = (new MessageFactory())->createRequest('GET', 'http://foo.com', [
- 'auth' => false
- ]);
- $this->assertFalse($request->hasHeader('Authorization'));
- }
-
- public function testCanSetCustomAuth()
- {
- $request = (new MessageFactory())->createRequest('GET', 'http://foo.com', [
- 'auth' => 'foo'
- ]);
- $this->assertEquals('foo', $request->getConfig()['auth']);
- }
-
- public function testCanAddEvents()
- {
- $foo = null;
- $client = new Client();
- $client->getEmitter()->attach(new Mock([new Response(200)]));
- $client->get('http://test.com', [
- 'events' => [
- 'before' => function () use (&$foo) { $foo = true; }
- ]
- ]);
- $this->assertTrue($foo);
- }
-
- public function testCanAddEventsWithPriority()
- {
- $foo = null;
- $client = new Client();
- $client->getEmitter()->attach(new Mock(array(new Response(200))));
- $request = $client->createRequest('GET', 'http://test.com', [
- 'events' => [
- 'before' => [
- 'fn' => function () use (&$foo) { $foo = true; },
- 'priority' => 123
- ]
- ]
- ]);
- $client->send($request);
- $this->assertTrue($foo);
- $l = $this->readAttribute($request->getEmitter(), 'listeners');
- $this->assertArrayHasKey(123, $l['before']);
- }
-
- public function testCanAddEventsOnce()
- {
- $foo = 0;
- $client = new Client();
- $client->getEmitter()->attach(new Mock([
- new Response(200),
- new Response(200),
- ]));
- $fn = function () use (&$foo) { ++$foo; };
- $request = $client->createRequest('GET', 'http://test.com', [
- 'events' => ['before' => ['fn' => $fn, 'once' => true]]
- ]);
- $client->send($request);
- $this->assertEquals(1, $foo);
- $client->send($request);
- $this->assertEquals(1, $foo);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesEventContainsFn()
- {
- $client = new Client(['base_url' => 'http://test.com']);
- $client->createRequest('GET', '/', ['events' => ['before' => ['foo' => 'bar']]]);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesEventIsArray()
- {
- $client = new Client(['base_url' => 'http://test.com']);
- $client->createRequest('GET', '/', ['events' => ['before' => '123']]);
- }
-
- public function testCanAddSubscribers()
- {
- $mock = new Mock([new Response(200)]);
- $client = new Client();
- $client->getEmitter()->attach($mock);
- $client->get('http://test.com', ['subscribers' => [$mock]]);
- }
-
- public function testCanDisableExceptions()
- {
- $client = new Client();
- $this->assertEquals(500, $client->get('http://test.com', [
- 'subscribers' => [new Mock([new Response(500)])],
- 'exceptions' => false
- ])->getStatusCode());
- }
-
- public function testCanChangeSaveToLocation()
- {
- $saveTo = Stream::factory();
- $request = (new MessageFactory())->createRequest('GET', '/', ['save_to' => $saveTo]);
- $this->assertSame($saveTo, $request->getConfig()->get('save_to'));
- }
-
- public function testCanSetProxy()
- {
- $request = (new MessageFactory())->createRequest('GET', '/', ['proxy' => '192.168.16.121']);
- $this->assertEquals('192.168.16.121', $request->getConfig()->get('proxy'));
- }
-
- public function testCanSetHeadersOption()
- {
- $request = (new MessageFactory())->createRequest('GET', '/', ['headers' => ['Foo' => 'Bar']]);
- $this->assertEquals('Bar', (string) $request->getHeader('Foo'));
- }
-
- public function testCanSetHeaders()
- {
- $request = (new MessageFactory())->createRequest('GET', '/', [
- 'headers' => ['Foo' => ['Baz', 'Bar'], 'Test' => '123']
- ]);
- $this->assertEquals('Baz, Bar', $request->getHeader('Foo'));
- $this->assertEquals('123', $request->getHeader('Test'));
- }
-
- public function testCanSetTimeoutOption()
- {
- $request = (new MessageFactory())->createRequest('GET', '/', ['timeout' => 1.5]);
- $this->assertEquals(1.5, $request->getConfig()->get('timeout'));
- }
-
- public function testCanSetConnectTimeoutOption()
- {
- $request = (new MessageFactory())->createRequest('GET', '/', ['connect_timeout' => 1.5]);
- $this->assertEquals(1.5, $request->getConfig()->get('connect_timeout'));
- }
-
- public function testCanSetDebug()
- {
- $request = (new MessageFactory())->createRequest('GET', '/', ['debug' => true]);
- $this->assertTrue($request->getConfig()->get('debug'));
- }
-
- public function testCanSetVerifyToOff()
- {
- $request = (new MessageFactory())->createRequest('GET', '/', ['verify' => false]);
- $this->assertFalse($request->getConfig()->get('verify'));
- }
-
- public function testCanSetVerifyToOn()
- {
- $request = (new MessageFactory())->createRequest('GET', '/', ['verify' => true]);
- $this->assertTrue($request->getConfig()->get('verify'));
- }
-
- public function testCanSetVerifyToPath()
- {
- $request = (new MessageFactory())->createRequest('GET', '/', ['verify' => '/foo.pem']);
- $this->assertEquals('/foo.pem', $request->getConfig()->get('verify'));
- }
-
- public function inputValidation()
- {
- return array_map(function ($option) { return array($option); }, array(
- 'headers', 'events', 'subscribers', 'params'
- ));
- }
-
- /**
- * @dataProvider inputValidation
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesInput($option)
- {
- (new MessageFactory())->createRequest('GET', '/', [$option => 'foo']);
- }
-
- public function testCanAddSslKey()
- {
- $request = (new MessageFactory())->createRequest('GET', '/', ['ssl_key' => '/foo.pem']);
- $this->assertEquals('/foo.pem', $request->getConfig()->get('ssl_key'));
- }
-
- public function testCanAddSslKeyPassword()
- {
- $request = (new MessageFactory())->createRequest('GET', '/', ['ssl_key' => ['/foo.pem', 'bar']]);
- $this->assertEquals(['/foo.pem', 'bar'], $request->getConfig()->get('ssl_key'));
- }
-
- public function testCanAddSslCert()
- {
- $request = (new MessageFactory())->createRequest('GET', '/', ['cert' => '/foo.pem']);
- $this->assertEquals('/foo.pem', $request->getConfig()->get('cert'));
- }
-
- public function testCanAddSslCertPassword()
- {
- $request = (new MessageFactory())->createRequest('GET', '/', ['cert' => ['/foo.pem', 'bar']]);
- $this->assertEquals(['/foo.pem', 'bar'], $request->getConfig()->get('cert'));
- }
-
- public function testCreatesBodyWithoutZeroString()
- {
- $request = (new MessageFactory())->createRequest('PUT', 'http://test.com', ['body' => '0']);
- $this->assertSame('0', (string) $request->getBody());
- }
-
- public function testCanSetProtocolVersion()
- {
- $request = (new MessageFactory())->createRequest('GET', 'http://t.com', ['version' => 1.0]);
- $this->assertEquals(1.0, $request->getProtocolVersion());
- }
-
- public function testCanAddJsonData()
- {
- $request = (new MessageFactory())->createRequest('PUT', 'http://f.com', [
- 'json' => ['foo' => 'bar']
- ]);
- $this->assertEquals(
- 'application/json',
- $request->getHeader('Content-Type')
- );
- $this->assertEquals('{"foo":"bar"}', (string) $request->getBody());
- }
-
- public function testCanAddJsonDataToAPostRequest()
- {
- $request = (new MessageFactory())->createRequest('POST', 'http://f.com', [
- 'json' => ['foo' => 'bar']
- ]);
- $this->assertEquals(
- 'application/json',
- $request->getHeader('Content-Type')
- );
- $this->assertEquals('{"foo":"bar"}', (string) $request->getBody());
- }
-
- public function testCanAddJsonDataAndNotOverwriteContentType()
- {
- $request = (new MessageFactory())->createRequest('PUT', 'http://f.com', [
- 'headers' => ['Content-Type' => 'foo'],
- 'json' => null
- ]);
- $this->assertEquals('foo', $request->getHeader('Content-Type'));
- $this->assertEquals('null', (string) $request->getBody());
- }
-
- public function testCanUseCustomRequestOptions()
- {
- $c = false;
- $f = new MessageFactory([
- 'foo' => function (RequestInterface $request, $value) use (&$c) {
- $c = true;
- $this->assertEquals('bar', $value);
- }
- ]);
-
- $f->createRequest('PUT', 'http://f.com', [
- 'headers' => ['Content-Type' => 'foo'],
- 'foo' => 'bar'
- ]);
-
- $this->assertTrue($c);
- }
-
- /**
- * @ticket https://github.com/guzzle/guzzle/issues/706
- */
- public function testDoesNotApplyPostBodyRightAway()
- {
- $request = (new MessageFactory())->createRequest('POST', 'http://f.cn', [
- 'body' => ['foo' => ['bar', 'baz']]
- ]);
- $this->assertEquals('', $request->getHeader('Content-Type'));
- $this->assertEquals('', $request->getHeader('Content-Length'));
- $request->getBody()->setAggregator(Query::duplicateAggregator());
- $request->getBody()->applyRequestHeaders($request);
- $this->assertEquals('foo=bar&foo=baz', $request->getBody());
- }
-
- public function testCanForceMultipartUploadWithContentType()
- {
- $client = new Client();
- $client->getEmitter()->attach(new Mock([new Response(200)]));
- $history = new History();
- $client->getEmitter()->attach($history);
- $client->post('http://foo.com', [
- 'headers' => ['Content-Type' => 'multipart/form-data'],
- 'body' => ['foo' => 'bar']
- ]);
- $this->assertContains(
- 'multipart/form-data; boundary=',
- $history->getLastRequest()->getHeader('Content-Type')
- );
- $this->assertContains(
- "Content-Disposition: form-data; name=\"foo\"\r\n\r\nbar",
- (string) $history->getLastRequest()->getBody()
- );
- }
-
- public function testDecodeDoesNotForceAcceptHeader()
- {
- $request = (new MessageFactory())->createRequest('POST', 'http://f.cn', [
- 'decode_content' => true
- ]);
- $this->assertEquals('', $request->getHeader('Accept-Encoding'));
- $this->assertTrue($request->getConfig()->get('decode_content'));
- }
-
- public function testDecodeCanAddAcceptHeader()
- {
- $request = (new MessageFactory())->createRequest('POST', 'http://f.cn', [
- 'decode_content' => 'gzip'
- ]);
- $this->assertEquals('gzip', $request->getHeader('Accept-Encoding'));
- $this->assertTrue($request->getConfig()->get('decode_content'));
- }
-
- public function testCanDisableDecoding()
- {
- $request = (new MessageFactory())->createRequest('POST', 'http://f.cn', [
- 'decode_content' => false
- ]);
- $this->assertEquals('', $request->getHeader('Accept-Encoding'));
- $this->assertNull($request->getConfig()->get('decode_content'));
- }
-}
-
-class ExtendedFactory extends MessageFactory
-{
- protected function add_foo() {}
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Message/MessageParserTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Message/MessageParserTest.php
deleted file mode 100644
index 0bcc943..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Message/MessageParserTest.php
+++ /dev/null
@@ -1,276 +0,0 @@
-compareRequestResults($parts, $parser->parseRequest($message));
- }
-
- /**
- * @dataProvider responseProvider
- */
- public function testParsesResponses($message, $parts)
- {
- $parser = new MessageParser();
- $this->compareResponseResults($parts, $parser->parseResponse($message));
- }
-
- public function testParsesRequestsWithMissingProtocol()
- {
- $parser = new MessageParser();
- $parts = $parser->parseRequest("GET /\r\nHost: Foo.com\r\n\r\n");
- $this->assertEquals('GET', $parts['method']);
- $this->assertEquals('HTTP', $parts['protocol']);
- $this->assertEquals('1.1', $parts['protocol_version']);
- }
-
- public function testParsesRequestsWithMissingVersion()
- {
- $parser = new MessageParser();
- $parts = $parser->parseRequest("GET / HTTP\r\nHost: Foo.com\r\n\r\n");
- $this->assertEquals('GET', $parts['method']);
- $this->assertEquals('HTTP', $parts['protocol']);
- $this->assertEquals('1.1', $parts['protocol_version']);
- }
-
- public function testParsesResponsesWithMissingReasonPhrase()
- {
- $parser = new MessageParser();
- $parts = $parser->parseResponse("HTTP/1.1 200\r\n\r\n");
- $this->assertEquals('200', $parts['code']);
- $this->assertEquals('', $parts['reason_phrase']);
- $this->assertEquals('HTTP', $parts['protocol']);
- $this->assertEquals('1.1', $parts['protocol_version']);
- }
-
- public function requestProvider()
- {
- $auth = base64_encode('michael:foo');
-
- return array(
-
- // Empty request
- array('', false),
-
- // Converts casing of request. Does not require host header.
- array("GET / HTTP/1.1\r\n\r\n", array(
- 'method' => 'GET',
- 'protocol' => 'HTTP',
- 'protocol_version' => '1.1',
- 'request_url' => array(
- 'scheme' => 'http',
- 'host' => '',
- 'port' => '',
- 'path' => '/',
- 'query' => ''
- ),
- 'headers' => array(),
- 'body' => ''
- )),
- // Path and query string, multiple header values per header and case sensitive storage
- array("HEAD /path?query=foo HTTP/1.0\r\nHost: example.com\r\nX-Foo: foo\r\nx-foo: Bar\r\nX-Foo: foo\r\nX-Foo: Baz\r\n\r\n", array(
- 'method' => 'HEAD',
- 'protocol' => 'HTTP',
- 'protocol_version' => '1.0',
- 'request_url' => array(
- 'scheme' => 'http',
- 'host' => 'example.com',
- 'port' => '',
- 'path' => '/path',
- 'query' => 'query=foo'
- ),
- 'headers' => array(
- 'Host' => 'example.com',
- 'X-Foo' => array('foo', 'foo', 'Baz'),
- 'x-foo' => 'Bar'
- ),
- 'body' => ''
- )),
- // Includes a body
- array("PUT / HTTP/1.0\r\nhost: example.com:443\r\nContent-Length: 4\r\n\r\ntest", array(
- 'method' => 'PUT',
- 'protocol' => 'HTTP',
- 'protocol_version' => '1.0',
- 'request_url' => array(
- 'scheme' => 'https',
- 'host' => 'example.com',
- 'port' => '443',
- 'path' => '/',
- 'query' => ''
- ),
- 'headers' => array(
- 'host' => 'example.com:443',
- 'Content-Length' => '4'
- ),
- 'body' => 'test'
- )),
- // Includes Authorization headers
- array("GET / HTTP/1.1\r\nHost: example.com:8080\r\nAuthorization: Basic {$auth}\r\n\r\n", array(
- 'method' => 'GET',
- 'protocol' => 'HTTP',
- 'protocol_version' => '1.1',
- 'request_url' => array(
- 'scheme' => 'http',
- 'host' => 'example.com',
- 'port' => '8080',
- 'path' => '/',
- 'query' => ''
- ),
- 'headers' => array(
- 'Host' => 'example.com:8080',
- 'Authorization' => "Basic {$auth}"
- ),
- 'body' => ''
- )),
- // Include authorization header
- array("GET / HTTP/1.1\r\nHost: example.com:8080\r\nauthorization: Basic {$auth}\r\n\r\n", array(
- 'method' => 'GET',
- 'protocol' => 'HTTP',
- 'protocol_version' => '1.1',
- 'request_url' => array(
- 'scheme' => 'http',
- 'host' => 'example.com',
- 'port' => '8080',
- 'path' => '/',
- 'query' => ''
- ),
- 'headers' => array(
- 'Host' => 'example.com:8080',
- 'authorization' => "Basic {$auth}"
- ),
- 'body' => ''
- )),
- );
- }
-
- public function responseProvider()
- {
- return array(
- // Empty request
- array('', false),
-
- array("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", array(
- 'protocol' => 'HTTP',
- 'protocol_version' => '1.1',
- 'code' => '200',
- 'reason_phrase' => 'OK',
- 'headers' => array(
- 'Content-Length' => 0
- ),
- 'body' => ''
- )),
- array("HTTP/1.0 400 Bad Request\r\nContent-Length: 0\r\n\r\n", array(
- 'protocol' => 'HTTP',
- 'protocol_version' => '1.0',
- 'code' => '400',
- 'reason_phrase' => 'Bad Request',
- 'headers' => array(
- 'Content-Length' => 0
- ),
- 'body' => ''
- )),
- array("HTTP/1.0 100 Continue\r\n\r\n", array(
- 'protocol' => 'HTTP',
- 'protocol_version' => '1.0',
- 'code' => '100',
- 'reason_phrase' => 'Continue',
- 'headers' => array(),
- 'body' => ''
- )),
- array("HTTP/1.1 204 No Content\r\nX-Foo: foo\r\nx-foo: Bar\r\nX-Foo: foo\r\n\r\n", array(
- 'protocol' => 'HTTP',
- 'protocol_version' => '1.1',
- 'code' => '204',
- 'reason_phrase' => 'No Content',
- 'headers' => array(
- 'X-Foo' => array('foo', 'foo'),
- 'x-foo' => 'Bar'
- ),
- 'body' => ''
- )),
- array("HTTP/1.1 200 Ok that is great!\r\nContent-Length: 4\r\n\r\nTest", array(
- 'protocol' => 'HTTP',
- 'protocol_version' => '1.1',
- 'code' => '200',
- 'reason_phrase' => 'Ok that is great!',
- 'headers' => array(
- 'Content-Length' => 4
- ),
- 'body' => 'Test'
- )),
- );
- }
-
- public function compareRequestResults($result, $expected)
- {
- if (!$result) {
- $this->assertFalse($expected);
- return;
- }
-
- $this->assertEquals($result['method'], $expected['method']);
- $this->assertEquals($result['protocol'], $expected['protocol']);
- $this->assertEquals($result['protocol_version'], $expected['protocol_version']);
- $this->assertEquals($result['request_url'], $expected['request_url']);
- $this->assertEquals($result['body'], $expected['body']);
- $this->compareHttpHeaders($result['headers'], $expected['headers']);
- }
-
- public function compareResponseResults($result, $expected)
- {
- if (!$result) {
- $this->assertFalse($expected);
- return;
- }
-
- $this->assertEquals($result['protocol'], $expected['protocol']);
- $this->assertEquals($result['protocol_version'], $expected['protocol_version']);
- $this->assertEquals($result['code'], $expected['code']);
- $this->assertEquals($result['reason_phrase'], $expected['reason_phrase']);
- $this->assertEquals($result['body'], $expected['body']);
- $this->compareHttpHeaders($result['headers'], $expected['headers']);
- }
-
- protected function normalizeHeaders($headers)
- {
- $normalized = array();
- foreach ($headers as $key => $value) {
- $key = strtolower($key);
- if (!isset($normalized[$key])) {
- $normalized[$key] = $value;
- } elseif (!is_array($normalized[$key])) {
- $normalized[$key] = array($value);
- } else {
- $normalized[$key][] = $value;
- }
- }
-
- foreach ($normalized as $key => &$value) {
- if (is_array($value)) {
- sort($value);
- }
- }
-
- return $normalized;
- }
-
- public function compareHttpHeaders($result, $expected)
- {
- // Aggregate all headers case-insensitively
- $result = $this->normalizeHeaders($result);
- $expected = $this->normalizeHeaders($expected);
- $this->assertEquals($result, $expected);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Message/RequestTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Message/RequestTest.php
deleted file mode 100644
index 4e670a4..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Message/RequestTest.php
+++ /dev/null
@@ -1,144 +0,0 @@
- '123'], Stream::factory('foo'));
- $this->assertEquals('PUT', $r->getMethod());
- $this->assertEquals('/test', $r->getUrl());
- $this->assertEquals('123', $r->getHeader('test'));
- $this->assertEquals('foo', $r->getBody());
- }
-
- public function testConstructorInitializesMessageWithMixedCaseHeaders()
- {
- $r = new Request('GET', '/test', [
- 'Set-Cookie' => 'foo=bar, baz=bam',
- 'Set-cookie' => 'hi=there',
- 'other' => ['1', '2']
- ]);
-
- $this->assertEquals('foo=bar, baz=bam, hi=there', $r->getHeader('Set-Cookie'));
- $this->assertEquals('1, 2', $r->getHeader('other'));
- }
-
- public function testConstructorInitializesMessageWithProtocolVersion()
- {
- $r = new Request('GET', '', [], null, ['protocol_version' => 10]);
- $this->assertEquals(10, $r->getProtocolVersion());
- }
-
- public function testConstructorInitializesMessageWithEmitter()
- {
- $e = new Emitter();
- $r = new Request('GET', '', [], null, ['emitter' => $e]);
- $this->assertSame($r->getEmitter(), $e);
- }
-
- public function testCloneIsDeep()
- {
- $r = new Request('GET', '/test', ['foo' => 'baz'], Stream::factory('foo'));
- $r2 = clone $r;
-
- $this->assertNotSame($r->getEmitter(), $r2->getEmitter());
- $this->assertEquals('foo', $r2->getBody());
-
- $r->getConfig()->set('test', 123);
- $this->assertFalse($r2->getConfig()->hasKey('test'));
-
- $r->setPath('/abc');
- $this->assertEquals('/test', $r2->getPath());
- }
-
- public function testCastsToString()
- {
- $r = new Request('GET', 'http://test.com/test', ['foo' => 'baz'], Stream::factory('body'));
- $s = explode("\r\n", (string) $r);
- $this->assertEquals("GET /test HTTP/1.1", $s[0]);
- $this->assertContains('Host: test.com', $s);
- $this->assertContains('foo: baz', $s);
- $this->assertContains('', $s);
- $this->assertContains('body', $s);
- }
-
- public function testSettingUrlOverridesHostHeaders()
- {
- $r = new Request('GET', 'http://test.com/test');
- $r->setUrl('https://baz.com/bar');
- $this->assertEquals('baz.com', $r->getHost());
- $this->assertEquals('baz.com', $r->getHeader('Host'));
- $this->assertEquals('/bar', $r->getPath());
- $this->assertEquals('https', $r->getScheme());
- }
-
- public function testQueryIsMutable()
- {
- $r = new Request('GET', 'http://www.foo.com?baz=bar');
- $this->assertEquals('baz=bar', $r->getQuery());
- $this->assertInstanceOf('GuzzleHttp\Query', $r->getQuery());
- $r->getQuery()->set('hi', 'there');
- $this->assertEquals('/?baz=bar&hi=there', $r->getResource());
- }
-
- public function testQueryCanChange()
- {
- $r = new Request('GET', 'http://www.foo.com?baz=bar');
- $r->setQuery(new Query(['foo' => 'bar']));
- $this->assertEquals('foo=bar', $r->getQuery());
- }
-
- public function testCanChangeMethod()
- {
- $r = new Request('GET', 'http://www.foo.com');
- $r->setMethod('put');
- $this->assertEquals('PUT', $r->getMethod());
- }
-
- public function testCanChangeSchemeWithPort()
- {
- $r = new Request('GET', 'http://www.foo.com:80');
- $r->setScheme('https');
- $this->assertEquals('https://www.foo.com', $r->getUrl());
- }
-
- public function testCanChangeScheme()
- {
- $r = new Request('GET', 'http://www.foo.com');
- $r->setScheme('https');
- $this->assertEquals('https://www.foo.com', $r->getUrl());
- }
-
- public function testCanChangeHost()
- {
- $r = new Request('GET', 'http://www.foo.com:222');
- $r->setHost('goo');
- $this->assertEquals('http://goo:222', $r->getUrl());
- $this->assertEquals('goo:222', $r->getHeader('host'));
- $r->setHost('goo:80');
- $this->assertEquals('http://goo', $r->getUrl());
- $this->assertEquals('goo', $r->getHeader('host'));
- }
-
- public function testCanChangePort()
- {
- $r = new Request('GET', 'http://www.foo.com:222');
- $this->assertSame(222, $r->getPort());
- $this->assertEquals('www.foo.com', $r->getHost());
- $this->assertEquals('www.foo.com:222', $r->getHeader('host'));
- $r->setPort(80);
- $this->assertSame(80, $r->getPort());
- $this->assertEquals('www.foo.com', $r->getHost());
- $this->assertEquals('www.foo.com', $r->getHeader('host'));
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Message/ResponseTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Message/ResponseTest.php
deleted file mode 100644
index bbae24a..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Message/ResponseTest.php
+++ /dev/null
@@ -1,120 +0,0 @@
- 'hi!']);
- $this->assertEquals(999, $response->getStatusCode());
- $this->assertEquals('hi!', $response->getReasonPhrase());
- }
-
- public function testConvertsToString()
- {
- $response = new Response(200);
- $this->assertEquals("HTTP/1.1 200 OK\r\n\r\n", (string) $response);
- // Add another header
- $response = new Response(200, ['X-Test' => 'Guzzle']);
- $this->assertEquals("HTTP/1.1 200 OK\r\nX-Test: Guzzle\r\n\r\n", (string) $response);
- $response = new Response(200, ['Content-Length' => 4], Stream::factory('test'));
- $this->assertEquals("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest", (string) $response);
- }
-
- public function testConvertsToStringAndSeeksToByteZero()
- {
- $response = new Response(200);
- $s = Stream::factory('foo');
- $s->read(1);
- $response->setBody($s);
- $this->assertEquals("HTTP/1.1 200 OK\r\n\r\nfoo", (string) $response);
- }
-
- public function testParsesJsonResponses()
- {
- $json = '{"foo": "bar"}';
- $response = new Response(200, [], Stream::factory($json));
- $this->assertEquals(['foo' => 'bar'], $response->json());
- $this->assertEquals(json_decode($json), $response->json(['object' => true]));
-
- $response = new Response(200);
- $this->assertEquals(null, $response->json());
- }
-
- /**
- * @expectedException \GuzzleHttp\Exception\ParseException
- * @expectedExceptionMessage Unable to parse JSON data: JSON_ERROR_SYNTAX - Syntax error, malformed JSON
- */
- public function testThrowsExceptionWhenFailsToParseJsonResponse()
- {
- $response = new Response(200, [], Stream::factory('{"foo": "'));
- $response->json();
- }
-
- public function testParsesXmlResponses()
- {
- $response = new Response(200, [], Stream::factory('bar '));
- $this->assertEquals('bar', (string) $response->xml()->foo);
- // Always return a SimpleXMLElement from the xml method
- $response = new Response(200);
- $this->assertEmpty((string) $response->xml()->foo);
- }
-
- /**
- * @expectedException \GuzzleHttp\Exception\XmlParseException
- * @expectedExceptionMessage Unable to parse response body into XML: String could not be parsed as XML
- */
- public function testThrowsExceptionWhenFailsToParseXmlResponse()
- {
- $response = new Response(200, [], Stream::factory('xml();
- } catch (XmlParseException $e) {
- $xmlParseError = $e->getError();
- $this->assertInstanceOf('\LibXMLError', $xmlParseError);
- $this->assertContains("Couldn't find end of Start Tag abc line 1", $xmlParseError->message);
- throw $e;
- }
- }
-
- public function testHasEffectiveUrl()
- {
- $r = new Response(200);
- $this->assertNull($r->getEffectiveUrl());
- $r->setEffectiveUrl('http://www.test.com');
- $this->assertEquals('http://www.test.com', $r->getEffectiveUrl());
- }
-
- public function testPreventsComplexExternalEntities()
- {
- $xml = ']>&test; ';
- $response = new Response(200, [], Stream::factory($xml));
-
- $oldCwd = getcwd();
- chdir(__DIR__);
- try {
- $xml = $response->xml();
- chdir($oldCwd);
- $this->markTestIncomplete('Did not throw the expected exception! XML resolved as: ' . $xml->asXML());
- } catch (\Exception $e) {
- chdir($oldCwd);
- }
- }
-
- public function testStatusAndReasonAreMutable()
- {
- $response = new Response(200);
- $response->setStatusCode(201);
- $this->assertEquals(201, $response->getStatusCode());
- $response->setReasonPhrase('Foo');
- $this->assertEquals('Foo', $response->getReasonPhrase());
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/MimetypesTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/MimetypesTest.php
deleted file mode 100644
index a18ec38..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/MimetypesTest.php
+++ /dev/null
@@ -1,31 +0,0 @@
-assertEquals('text/x-php', Mimetypes::getInstance()->fromExtension('php'));
- }
-
- public function testGetsFromFilename()
- {
- $this->assertEquals('text/x-php', Mimetypes::getInstance()->fromFilename(__FILE__));
- }
-
- public function testGetsFromCaseInsensitiveFilename()
- {
- $this->assertEquals('text/x-php', Mimetypes::getInstance()->fromFilename(strtoupper(__FILE__)));
- }
-
- public function testReturnsNullWhenNoMatchFound()
- {
- $this->assertNull(Mimetypes::getInstance()->fromExtension('foobar'));
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/PoolTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/PoolTest.php
deleted file mode 100644
index b5f02ad..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/PoolTest.php
+++ /dev/null
@@ -1,319 +0,0 @@
- 10]);
- $this->assertSame($c, $this->readAttribute($p, 'client'));
- $this->assertEquals(10, $this->readAttribute($p, 'poolSize'));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesEachElement()
- {
- $c = new Client();
- $requests = ['foo'];
- $p = new Pool($c, new \ArrayIterator($requests));
- $p->wait();
- }
-
- public function testSendsAndRealizesFuture()
- {
- $c = $this->getClient();
- $p = new Pool($c, [$c->createRequest('GET', 'http://foo.com')]);
- $this->assertTrue($p->wait());
- $this->assertFalse($p->wait());
- $this->assertTrue($this->readAttribute($p, 'isRealized'));
- $this->assertFalse($p->cancel());
- }
-
- public function testSendsManyRequestsInCappedPool()
- {
- $c = $this->getClient();
- $p = new Pool($c, [$c->createRequest('GET', 'http://foo.com')]);
- $this->assertTrue($p->wait());
- $this->assertFalse($p->wait());
- }
-
- public function testSendsRequestsThatHaveNotBeenRealized()
- {
- $c = $this->getClient();
- $p = new Pool($c, [$c->createRequest('GET', 'http://foo.com')]);
- $this->assertTrue($p->wait());
- $this->assertFalse($p->wait());
- $this->assertFalse($p->cancel());
- }
-
- public function testCancelsInFlightRequests()
- {
- $c = $this->getClient();
- $h = new History();
- $c->getEmitter()->attach($h);
- $p = new Pool($c, [
- $c->createRequest('GET', 'http://foo.com'),
- $c->createRequest('GET', 'http://foo.com', [
- 'events' => [
- 'before' => [
- 'fn' => function () use (&$p) {
- $this->assertTrue($p->cancel());
- },
- 'priority' => RequestEvents::EARLY
- ]
- ]
- ])
- ]);
- ob_start();
- $p->wait();
- $contents = ob_get_clean();
- $this->assertEquals(1, count($h));
- $this->assertEquals('Cancelling', $contents);
- }
-
- private function getClient()
- {
- $deferred = new Deferred();
- $future = new FutureArray(
- $deferred->promise(),
- function() use ($deferred) {
- $deferred->resolve(['status' => 200, 'headers' => []]);
- }, function () {
- echo 'Cancelling';
- }
- );
-
- return new Client(['handler' => new MockHandler($future)]);
- }
-
- public function testBatchesRequests()
- {
- $client = new Client(['handler' => function () {
- throw new \RuntimeException('No network access');
- }]);
-
- $responses = [
- new Response(301, ['Location' => 'http://foo.com/bar']),
- new Response(200),
- new Response(200),
- new Response(404)
- ];
-
- $client->getEmitter()->attach(new Mock($responses));
- $requests = [
- $client->createRequest('GET', 'http://foo.com/baz'),
- $client->createRequest('HEAD', 'http://httpbin.org/get'),
- $client->createRequest('PUT', 'http://httpbin.org/put'),
- ];
-
- $a = $b = $c = $d = 0;
- $result = Pool::batch($client, $requests, [
- 'before' => function (BeforeEvent $e) use (&$a) { $a++; },
- 'complete' => function (CompleteEvent $e) use (&$b) { $b++; },
- 'error' => function (ErrorEvent $e) use (&$c) { $c++; },
- 'end' => function (EndEvent $e) use (&$d) { $d++; }
- ]);
-
- $this->assertEquals(4, $a);
- $this->assertEquals(2, $b);
- $this->assertEquals(1, $c);
- $this->assertEquals(3, $d);
- $this->assertCount(3, $result);
- $this->assertInstanceOf('GuzzleHttp\BatchResults', $result);
-
- // The first result is actually the second (redirect) response.
- $this->assertSame($responses[1], $result[0]);
- // The second result is a 1:1 request:response map
- $this->assertSame($responses[2], $result[1]);
- // The third entry is the 404 RequestException
- $this->assertSame($responses[3], $result[2]->getResponse());
- }
-
- public function testBatchesRequestsWithDynamicPoolSize()
- {
- $client = new Client(['handler' => function () {
- throw new \RuntimeException('No network access');
- }]);
-
- $responses = [
- new Response(301, ['Location' => 'http://foo.com/bar']),
- new Response(200),
- new Response(200),
- new Response(404)
- ];
-
- $client->getEmitter()->attach(new Mock($responses));
- $requests = [
- $client->createRequest('GET', 'http://foo.com/baz'),
- $client->createRequest('HEAD', 'http://httpbin.org/get'),
- $client->createRequest('PUT', 'http://httpbin.org/put'),
- ];
-
- $a = $b = $c = $d = 0;
- $result = Pool::batch($client, $requests, [
- 'before' => function (BeforeEvent $e) use (&$a) { $a++; },
- 'complete' => function (CompleteEvent $e) use (&$b) { $b++; },
- 'error' => function (ErrorEvent $e) use (&$c) { $c++; },
- 'end' => function (EndEvent $e) use (&$d) { $d++; },
- 'pool_size' => function ($queueSize) {
- static $options = [1, 2, 1];
- static $queued = 0;
-
- $this->assertEquals(
- $queued,
- $queueSize,
- 'The number of queued requests should be equal to the sum of pool sizes so far.'
- );
-
- $next = array_shift($options);
- $queued += $next;
-
- return $next;
- }
- ]);
-
- $this->assertEquals(4, $a);
- $this->assertEquals(2, $b);
- $this->assertEquals(1, $c);
- $this->assertEquals(3, $d);
- $this->assertCount(3, $result);
- $this->assertInstanceOf('GuzzleHttp\BatchResults', $result);
-
- // The first result is actually the second (redirect) response.
- $this->assertSame($responses[1], $result[0]);
- // The second result is a 1:1 request:response map
- $this->assertSame($responses[2], $result[1]);
- // The third entry is the 404 RequestException
- $this->assertSame($responses[3], $result[2]->getResponse());
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Each event listener must be a callable or
- */
- public function testBatchValidatesTheEventFormat()
- {
- $client = new Client();
- $requests = [$client->createRequest('GET', 'http://foo.com/baz')];
- Pool::batch($client, $requests, ['complete' => 'foo']);
- }
-
- public function testEmitsProgress()
- {
- $client = new Client(['handler' => function () {
- throw new \RuntimeException('No network access');
- }]);
-
- $responses = [new Response(200), new Response(404)];
- $client->getEmitter()->attach(new Mock($responses));
- $requests = [
- $client->createRequest('GET', 'http://foo.com/baz'),
- $client->createRequest('HEAD', 'http://httpbin.org/get')
- ];
-
- $pool = new Pool($client, $requests);
- $count = 0;
- $thenned = null;
- $pool->then(
- function ($value) use (&$thenned) {
- $thenned = $value;
- },
- null,
- function ($result) use (&$count, $requests) {
- $this->assertSame($requests[$count], $result['request']);
- if ($count == 0) {
- $this->assertNull($result['error']);
- $this->assertEquals(200, $result['response']->getStatusCode());
- } else {
- $this->assertInstanceOf(
- 'GuzzleHttp\Exception\ClientException',
- $result['error']
- );
- }
- $count++;
- }
- );
-
- $pool->wait();
- $this->assertEquals(2, $count);
- $this->assertEquals(true, $thenned);
- }
-
- public function testDoesNotThrowInErrorEvent()
- {
- $client = new Client();
- $responses = [new Response(404)];
- $client->getEmitter()->attach(new Mock($responses));
- $requests = [$client->createRequest('GET', 'http://foo.com/baz')];
- $result = Pool::batch($client, $requests);
- $this->assertCount(1, $result);
- $this->assertInstanceOf('GuzzleHttp\Exception\ClientException', $result[0]);
- }
-
- public function testHasSendMethod()
- {
- $client = new Client();
- $responses = [new Response(404)];
- $history = new History();
- $client->getEmitter()->attach($history);
- $client->getEmitter()->attach(new Mock($responses));
- $requests = [$client->createRequest('GET', 'http://foo.com/baz')];
- Pool::send($client, $requests);
- $this->assertCount(1, $history);
- }
-
- public function testDoesNotInfinitelyRecurse()
- {
- $client = new Client(['handler' => function () {
- throw new \RuntimeException('No network access');
- }]);
-
- $last = null;
- $client->getEmitter()->on(
- 'before',
- function (BeforeEvent $e) use (&$last) {
- $e->intercept(new Response(200));
- if (function_exists('xdebug_get_stack_depth')) {
- if ($last) {
- $this->assertEquals($last, xdebug_get_stack_depth());
- } else {
- $last = xdebug_get_stack_depth();
- }
- }
- }
- );
-
- $requests = [];
- for ($i = 0; $i < 100; $i++) {
- $requests[] = $client->createRequest('GET', 'http://foo.com');
- }
-
- $pool = new Pool($client, $requests);
- $pool->wait();
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Post/MultipartBodyTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Post/MultipartBodyTest.php
deleted file mode 100644
index 4b3b391..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Post/MultipartBodyTest.php
+++ /dev/null
@@ -1,120 +0,0 @@
- 'bar'], [
- new PostFile('foo', 'abc', 'foo.txt')
- ], 'abcdef');
- }
-
- public function testConstructorAddsFieldsAndFiles()
- {
- $b = $this->getTestBody();
- $this->assertEquals('abcdef', $b->getBoundary());
- $c = (string) $b;
- $this->assertContains("--abcdef\r\nContent-Disposition: form-data; name=\"foo\"\r\n\r\nbar\r\n", $c);
- $this->assertContains("--abcdef\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"foo.txt\"\r\n"
- . "Content-Type: text/plain\r\n\r\nabc\r\n--abcdef--", $c);
- }
-
- public function testDoesNotModifyFieldFormat()
- {
- $m = new MultipartBody(['foo+baz' => 'bar+bam %20 boo'], [
- new PostFile('foo+bar', 'abc %20 123', 'foo.txt')
- ], 'abcdef');
- $this->assertContains('name="foo+baz"', (string) $m);
- $this->assertContains('name="foo+bar"', (string) $m);
- $this->assertContains('bar+bam %20 boo', (string) $m);
- $this->assertContains('abc %20 123', (string) $m);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testConstructorValidatesFiles()
- {
- new MultipartBody([], ['bar']);
- }
-
- public function testConstructorCanCreateBoundary()
- {
- $b = new MultipartBody();
- $this->assertNotNull($b->getBoundary());
- }
-
- public function testWrapsStreamMethods()
- {
- $b = $this->getTestBody();
- $this->assertFalse($b->write('foo'));
- $this->assertFalse($b->isWritable());
- $this->assertTrue($b->isReadable());
- $this->assertTrue($b->isSeekable());
- $this->assertEquals(0, $b->tell());
- }
-
- public function testCanDetachFieldsAndFiles()
- {
- $b = $this->getTestBody();
- $b->detach();
- $b->close();
- $this->assertEquals('', (string) $b);
- }
-
- public function testIsSeekableReturnsTrueIfAllAreSeekable()
- {
- $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface')
- ->setMethods(['isSeekable', 'isReadable'])
- ->getMockForAbstractClass();
- $s->expects($this->once())
- ->method('isSeekable')
- ->will($this->returnValue(false));
- $s->expects($this->once())
- ->method('isReadable')
- ->will($this->returnValue(true));
- $p = new PostFile('foo', $s, 'foo.php');
- $b = new MultipartBody([], [$p]);
- $this->assertFalse($b->isSeekable());
- $this->assertFalse($b->seek(10));
- }
-
- public function testReadsFromBuffer()
- {
- $b = $this->getTestBody();
- $c = $b->read(1);
- $c .= $b->read(1);
- $c .= $b->read(1);
- $c .= $b->read(1);
- $c .= $b->read(1);
- $this->assertEquals('--abc', $c);
- }
-
- public function testCalculatesSize()
- {
- $b = $this->getTestBody();
- $this->assertEquals(strlen($b), $b->getSize());
- }
-
- public function testCalculatesSizeAndReturnsNullForUnknown()
- {
- $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface')
- ->setMethods(['getSize', 'isReadable'])
- ->getMockForAbstractClass();
- $s->expects($this->once())
- ->method('getSize')
- ->will($this->returnValue(null));
- $s->expects($this->once())
- ->method('isReadable')
- ->will($this->returnValue(true));
- $b = new MultipartBody([], [new PostFile('foo', $s, 'foo.php')]);
- $this->assertNull($b->getSize());
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Post/PostBodyTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Post/PostBodyTest.php
deleted file mode 100644
index 0283a5e..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Post/PostBodyTest.php
+++ /dev/null
@@ -1,255 +0,0 @@
-assertTrue($b->isSeekable());
- $this->assertTrue($b->isReadable());
- $this->assertFalse($b->isWritable());
- $this->assertFalse($b->write('foo'));
- }
-
- public function testApplyingWithNothingDoesNothing()
- {
- $b = new PostBody();
- $m = new Request('POST', '/');
- $b->applyRequestHeaders($m);
- $this->assertFalse($m->hasHeader('Content-Length'));
- $this->assertFalse($m->hasHeader('Content-Type'));
- }
-
- public function testCanForceMultipartUploadsWhenApplying()
- {
- $b = new PostBody();
- $b->forceMultipartUpload(true);
- $m = new Request('POST', '/');
- $b->applyRequestHeaders($m);
- $this->assertContains(
- 'multipart/form-data',
- $m->getHeader('Content-Type')
- );
- }
-
- public function testApplyingWithFilesAddsMultipartUpload()
- {
- $b = new PostBody();
- $p = new PostFile('foo', fopen(__FILE__, 'r'));
- $b->addFile($p);
- $this->assertEquals([$p], $b->getFiles());
- $this->assertNull($b->getFile('missing'));
- $this->assertSame($p, $b->getFile('foo'));
- $m = new Request('POST', '/');
- $b->applyRequestHeaders($m);
- $this->assertContains(
- 'multipart/form-data',
- $m->getHeader('Content-Type')
- );
- $this->assertTrue($m->hasHeader('Content-Length'));
- }
-
- public function testApplyingWithFieldsAddsMultipartUpload()
- {
- $b = new PostBody();
- $b->setField('foo', 'bar');
- $this->assertEquals(['foo' => 'bar'], $b->getFields());
- $m = new Request('POST', '/');
- $b->applyRequestHeaders($m);
- $this->assertContains(
- 'application/x-www-form',
- $m->getHeader('Content-Type')
- );
- $this->assertTrue($m->hasHeader('Content-Length'));
- }
-
- public function testMultipartWithNestedFields()
- {
- $b = new PostBody();
- $b->setField('foo', ['bar' => 'baz']);
- $b->forceMultipartUpload(true);
- $this->assertEquals(['foo' => ['bar' => 'baz']], $b->getFields());
- $m = new Request('POST', '/');
- $b->applyRequestHeaders($m);
- $this->assertContains(
- 'multipart/form-data',
- $m->getHeader('Content-Type')
- );
- $this->assertTrue($m->hasHeader('Content-Length'));
- $contents = $b->getContents();
- $this->assertContains('name="foo[bar]"', $contents);
- $this->assertNotContains('name="foo"', $contents);
- }
-
- public function testCountProvidesFieldsAndFiles()
- {
- $b = new PostBody();
- $b->setField('foo', 'bar');
- $b->addFile(new PostFile('foo', fopen(__FILE__, 'r')));
- $this->assertEquals(2, count($b));
- $b->clearFiles();
- $b->removeField('foo');
- $this->assertEquals(0, count($b));
- $this->assertEquals([], $b->getFiles());
- $this->assertEquals([], $b->getFields());
- }
-
- public function testHasFields()
- {
- $b = new PostBody();
- $b->setField('foo', 'bar');
- $b->setField('baz', '123');
- $this->assertEquals('bar', $b->getField('foo'));
- $this->assertEquals('123', $b->getField('baz'));
- $this->assertNull($b->getField('ahh'));
- $this->assertTrue($b->hasField('foo'));
- $this->assertFalse($b->hasField('test'));
- $b->replaceFields(['abc' => '123']);
- $this->assertFalse($b->hasField('foo'));
- $this->assertTrue($b->hasField('abc'));
- }
-
- public function testConvertsFieldsToQueryStyleBody()
- {
- $b = new PostBody();
- $b->setField('foo', 'bar');
- $b->setField('baz', '123');
- $this->assertEquals('foo=bar&baz=123', $b);
- $this->assertEquals(15, $b->getSize());
- $b->seek(0);
- $this->assertEquals('foo=bar&baz=123', $b->getContents());
- $b->seek(0);
- $this->assertEquals('foo=bar&baz=123', $b->read(1000));
- $this->assertEquals(15, $b->tell());
- }
-
- public function testCanSpecifyQueryAggregator()
- {
- $b = new PostBody();
- $b->setField('foo', ['baz', 'bar']);
- $this->assertEquals('foo%5B0%5D=baz&foo%5B1%5D=bar', (string) $b);
- $b = new PostBody();
- $b->setField('foo', ['baz', 'bar']);
- $agg = Query::duplicateAggregator();
- $b->setAggregator($agg);
- $this->assertEquals('foo=baz&foo=bar', (string) $b);
- }
-
- public function testDetachesAndCloses()
- {
- $b = new PostBody();
- $b->setField('foo', 'bar');
- $b->detach();
- $b->close();
- $this->assertEquals('', $b->read(10));
- }
-
- public function testDetachesWhenBodyIsPresent()
- {
- $b = new PostBody();
- $b->setField('foo', 'bar');
- $b->getContents();
- $b->detach();
- }
-
- public function testFlushAndMetadataPlaceholders()
- {
- $b = new PostBody();
- $this->assertEquals([], $b->getMetadata());
- $this->assertNull($b->getMetadata('foo'));
- }
-
- public function testCreatesMultipartUploadWithMultiFields()
- {
- $b = new PostBody();
- $b->setField('testing', ['baz', 'bar']);
- $b->setField('other', 'hi');
- $b->setField('third', 'there');
- $b->addFile(new PostFile('foo', fopen(__FILE__, 'r')));
- $s = (string) $b;
- $this->assertContains(file_get_contents(__FILE__), $s);
- $this->assertContains('testing=bar', $s);
- $this->assertContains(
- 'Content-Disposition: form-data; name="third"',
- $s
- );
- $this->assertContains(
- 'Content-Disposition: form-data; name="other"',
- $s
- );
- }
-
- public function testMultipartWithBase64Fields()
- {
- $b = new PostBody();
- $b->setField('foo64', '/xA2JhWEqPcgyLRDdir9WSRi/khpb2Lh3ooqv+5VYoc=');
- $b->forceMultipartUpload(true);
- $this->assertEquals(
- ['foo64' => '/xA2JhWEqPcgyLRDdir9WSRi/khpb2Lh3ooqv+5VYoc='],
- $b->getFields()
- );
- $m = new Request('POST', '/');
- $b->applyRequestHeaders($m);
- $this->assertContains(
- 'multipart/form-data',
- $m->getHeader('Content-Type')
- );
- $this->assertTrue($m->hasHeader('Content-Length'));
- $contents = $b->getContents();
- $this->assertContains('name="foo64"', $contents);
- $this->assertContains(
- '/xA2JhWEqPcgyLRDdir9WSRi/khpb2Lh3ooqv+5VYoc=',
- $contents
- );
- }
-
- public function testMultipartWithAmpersandInValue()
- {
- $b = new PostBody();
- $b->setField('a', 'b&c=d');
- $b->forceMultipartUpload(true);
- $this->assertEquals(['a' => 'b&c=d'], $b->getFields());
- $m = new Request('POST', '/');
- $b->applyRequestHeaders($m);
- $this->assertContains(
- 'multipart/form-data',
- $m->getHeader('Content-Type')
- );
- $this->assertTrue($m->hasHeader('Content-Length'));
- $contents = $b->getContents();
- $this->assertContains('name="a"', $contents);
- $this->assertContains('b&c=d', $contents);
- }
-
- /**
- * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException
- */
- public function testCannotAttach()
- {
- $b = new PostBody();
- $b->attach('foo');
- }
-
- public function testDoesNotOverwriteExistingHeaderForUrlencoded()
- {
- $m = new Request('POST', 'http://foo.com', [
- 'content-type' => 'application/x-www-form-urlencoded; charset=utf-8'
- ]);
- $b = new PostBody();
- $b->setField('foo', 'bar');
- $b->applyRequestHeaders($m);
- $this->assertEquals(
- 'application/x-www-form-urlencoded; charset=utf-8',
- $m->getHeader('Content-Type')
- );
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Post/PostFileTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Post/PostFileTest.php
deleted file mode 100644
index 800cee5..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Post/PostFileTest.php
+++ /dev/null
@@ -1,61 +0,0 @@
-assertInstanceOf('GuzzleHttp\Post\PostFileInterface', $p);
- $this->assertEquals('hi', $p->getContent());
- $this->assertEquals('foo', $p->getName());
- $this->assertEquals('/path/to/test.php', $p->getFilename());
- $this->assertEquals(
- 'form-data; name="foo"; filename="test.php"',
- $p->getHeaders()['Content-Disposition']
- );
- }
-
- public function testGetsFilenameFromMetadata()
- {
- $p = new PostFile('foo', fopen(__FILE__, 'r'));
- $this->assertEquals(__FILE__, $p->getFilename());
- }
-
- public function testDefaultsToNameWhenNoFilenameExists()
- {
- $p = new PostFile('foo', 'bar');
- $this->assertEquals('foo', $p->getFilename());
- }
-
- public function testCreatesFromMultipartFormData()
- {
- $mp = new MultipartBody([], [], 'baz');
- $p = new PostFile('foo', $mp);
- $this->assertEquals(
- 'form-data; name="foo"',
- $p->getHeaders()['Content-Disposition']
- );
- $this->assertEquals(
- 'multipart/form-data; boundary=baz',
- $p->getHeaders()['Content-Type']
- );
- }
-
- public function testCanAddHeaders()
- {
- $p = new PostFile('foo', Stream::factory('hi'), 'test.php', [
- 'X-Foo' => '123',
- 'Content-Disposition' => 'bar'
- ]);
- $this->assertEquals('bar', $p->getHeaders()['Content-Disposition']);
- $this->assertEquals('123', $p->getHeaders()['X-Foo']);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/QueryParserTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/QueryParserTest.php
deleted file mode 100644
index e9075a8..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/QueryParserTest.php
+++ /dev/null
@@ -1,80 +0,0 @@
- ['a', 'b']]],
- // Can parse multi-valued items that use numeric indices
- ['q[0]=a&q[1]=b', ['q' => ['a', 'b']]],
- // Can parse duplicates and does not include numeric indices
- ['q[]=a&q[]=b', ['q' => ['a', 'b']]],
- // Ensures that the value of "q" is an array even though one value
- ['q[]=a', ['q' => ['a']]],
- // Does not modify "." to "_" like PHP's parse_str()
- ['q.a=a&q.b=b', ['q.a' => 'a', 'q.b' => 'b']],
- // Can decode %20 to " "
- ['q%20a=a%20b', ['q a' => 'a b']],
- // Can parse funky strings with no values by assigning each to null
- ['q&a', ['q' => null, 'a' => null]],
- // Does not strip trailing equal signs
- ['data=abc=', ['data' => 'abc=']],
- // Can store duplicates without affecting other values
- ['foo=a&foo=b&?µ=c', ['foo' => ['a', 'b'], '?µ' => 'c']],
- // Sets value to null when no "=" is present
- ['foo', ['foo' => null]],
- // Preserves "0" keys.
- ['0', ['0' => null]],
- // Sets the value to an empty string when "=" is present
- ['0=', ['0' => '']],
- // Preserves falsey keys
- ['var=0', ['var' => '0']],
- // Can deeply nest and store duplicate PHP values
- ['a[b][c]=1&a[b][c]=2', [
- 'a' => ['b' => ['c' => ['1', '2']]]
- ]],
- // Can parse PHP style arrays
- ['a[b]=c&a[d]=e', ['a' => ['b' => 'c', 'd' => 'e']]],
- // Ensure it doesn't leave things behind with repeated values
- // Can parse mult-values items
- ['q=a&q=b&q=c', ['q' => ['a', 'b', 'c']]],
- ];
- }
-
- /**
- * @dataProvider parseQueryProvider
- */
- public function testParsesQueries($input, $output)
- {
- $query = Query::fromString($input);
- $this->assertEquals($output, $query->toArray());
- // Normalize the input and output
- $query->setEncodingType(false);
- $this->assertEquals(rawurldecode($input), (string) $query);
- }
-
- public function testConvertsPlusSymbolsToSpacesByDefault()
- {
- $query = Query::fromString('var=foo+bar', true);
- $this->assertEquals('foo bar', $query->get('var'));
- }
-
- public function testCanControlDecodingType()
- {
- $qp = new QueryParser();
- $q = new Query();
- $qp->parseInto($q, 'var=foo+bar', Query::RFC3986);
- $this->assertEquals('foo+bar', $q->get('var'));
- $qp->parseInto($q, 'var=foo+bar', Query::RFC1738);
- $this->assertEquals('foo bar', $q->get('var'));
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/QueryTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/QueryTest.php
deleted file mode 100644
index 8b9d344..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/QueryTest.php
+++ /dev/null
@@ -1,171 +0,0 @@
- 'baz', 'bar' => 'bam boozle']);
- $this->assertEquals('foo=baz&bar=bam%20boozle', (string) $q);
- }
-
- public function testCanDisableUrlEncoding()
- {
- $q = new Query(['bar' => 'bam boozle']);
- $q->setEncodingType(false);
- $this->assertEquals('bar=bam boozle', (string) $q);
- }
-
- public function testCanSpecifyRfc1783UrlEncodingType()
- {
- $q = new Query(['bar abc' => 'bam boozle']);
- $q->setEncodingType(Query::RFC1738);
- $this->assertEquals('bar+abc=bam+boozle', (string) $q);
- }
-
- public function testCanSpecifyRfc3986UrlEncodingType()
- {
- $q = new Query(['bar abc' => 'bam boozle', 'ሴ' => 'hi']);
- $q->setEncodingType(Query::RFC3986);
- $this->assertEquals('bar%20abc=bam%20boozle&%E1%88%B4=hi', (string) $q);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesEncodingType()
- {
- (new Query(['bar' => 'bam boozle']))->setEncodingType('foo');
- }
-
- public function testAggregatesMultipleValues()
- {
- $q = new Query(['foo' => ['bar', 'baz']]);
- $this->assertEquals('foo%5B0%5D=bar&foo%5B1%5D=baz', (string) $q);
- }
-
- public function testCanSetAggregator()
- {
- $q = new Query(['foo' => ['bar', 'baz']]);
- $q->setAggregator(function (array $data) {
- return ['foo' => ['barANDbaz']];
- });
- $this->assertEquals('foo=barANDbaz', (string) $q);
- }
-
- public function testAllowsMultipleValuesPerKey()
- {
- $q = new Query();
- $q->add('facet', 'size');
- $q->add('facet', 'width');
- $q->add('facet.field', 'foo');
- // Use the duplicate aggregator
- $q->setAggregator($q::duplicateAggregator());
- $this->assertEquals('facet=size&facet=width&facet.field=foo', (string) $q);
- }
-
- public function testAllowsZeroValues()
- {
- $query = new Query(array(
- 'foo' => 0,
- 'baz' => '0',
- 'bar' => null,
- 'boo' => false
- ));
- $this->assertEquals('foo=0&baz=0&bar&boo=', (string) $query);
- }
-
- private $encodeData = [
- 't' => [
- 'v1' => ['a', '1'],
- 'v2' => 'b',
- 'v3' => ['v4' => 'c', 'v5' => 'd']
- ]
- ];
-
- public function testEncodesDuplicateAggregator()
- {
- $agg = Query::duplicateAggregator();
- $result = $agg($this->encodeData);
- $this->assertEquals(array(
- 't[v1]' => ['a', '1'],
- 't[v2]' => ['b'],
- 't[v3][v4]' => ['c'],
- 't[v3][v5]' => ['d'],
- ), $result);
- }
-
- public function testDuplicateEncodesNoNumericIndices()
- {
- $agg = Query::duplicateAggregator();
- $result = $agg($this->encodeData);
- $this->assertEquals(array(
- 't[v1]' => ['a', '1'],
- 't[v2]' => ['b'],
- 't[v3][v4]' => ['c'],
- 't[v3][v5]' => ['d'],
- ), $result);
- }
-
- public function testEncodesPhpAggregator()
- {
- $agg = Query::phpAggregator();
- $result = $agg($this->encodeData);
- $this->assertEquals(array(
- 't[v1][0]' => ['a'],
- 't[v1][1]' => ['1'],
- 't[v2]' => ['b'],
- 't[v3][v4]' => ['c'],
- 't[v3][v5]' => ['d'],
- ), $result);
- }
-
- public function testPhpEncodesNoNumericIndices()
- {
- $agg = Query::phpAggregator(false);
- $result = $agg($this->encodeData);
- $this->assertEquals(array(
- 't[v1][]' => ['a', '1'],
- 't[v2]' => ['b'],
- 't[v3][v4]' => ['c'],
- 't[v3][v5]' => ['d'],
- ), $result);
- }
-
- public function testCanDisableUrlEncodingDecoding()
- {
- $q = Query::fromString('foo=bar+baz boo%20', false);
- $this->assertEquals('bar+baz boo%20', $q['foo']);
- $this->assertEquals('foo=bar+baz boo%20', (string) $q);
- }
-
- public function testCanChangeUrlEncodingDecodingToRfc1738()
- {
- $q = Query::fromString('foo=bar+baz', Query::RFC1738);
- $this->assertEquals('bar baz', $q['foo']);
- $this->assertEquals('foo=bar+baz', (string) $q);
- }
-
- public function testCanChangeUrlEncodingDecodingToRfc3986()
- {
- $q = Query::fromString('foo=bar%20baz', Query::RFC3986);
- $this->assertEquals('bar baz', $q['foo']);
- $this->assertEquals('foo=bar%20baz', (string) $q);
- }
-
- public function testQueryStringsAllowSlashButDoesNotDecodeWhenDisable()
- {
- $q = Query::fromString('foo=bar%2Fbaz&bam=boo%20boo', Query::RFC3986);
- $q->setEncodingType(false);
- $this->assertEquals('foo=bar/baz&bam=boo boo', (string) $q);
- }
-
- public function testQueryStringsAllowDecodingEncodingCompletelyDisabled()
- {
- $q = Query::fromString('foo=bar%2Fbaz&bam=boo boo!', false);
- $this->assertEquals('foo=bar%2Fbaz&bam=boo boo!', (string) $q);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/RequestFsmTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/RequestFsmTest.php
deleted file mode 100644
index dd67684..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/RequestFsmTest.php
+++ /dev/null
@@ -1,187 +0,0 @@
-mf = new MessageFactory();
- }
-
- public function testEmitsBeforeEventInTransition()
- {
- $fsm = new RequestFsm(function () {
- return new CompletedFutureArray(['status' => 200]);
- }, $this->mf);
- $t = new Transaction(new Client(), new Request('GET', 'http://foo.com'));
- $c = false;
- $t->request->getEmitter()->on('before', function (BeforeEvent $e) use (&$c) {
- $c = true;
- });
- $fsm($t);
- $this->assertTrue($c);
- }
-
- public function testEmitsCompleteEventInTransition()
- {
- $fsm = new RequestFsm(function () {
- return new CompletedFutureArray(['status' => 200]);
- }, $this->mf);
- $t = new Transaction(new Client(), new Request('GET', 'http://foo.com'));
- $t->response = new Response(200);
- $t->state = 'complete';
- $c = false;
- $t->request->getEmitter()->on('complete', function (CompleteEvent $e) use (&$c) {
- $c = true;
- });
- $fsm($t);
- $this->assertTrue($c);
- }
-
- public function testDoesNotEmitCompleteForFuture()
- {
- $fsm = new RequestFsm(function () {
- return new CompletedFutureArray(['status' => 200]);
- }, $this->mf);
- $t = new Transaction(new Client(), new Request('GET', 'http://foo.com'));
- $deferred = new Deferred();
- $t->response = new FutureResponse($deferred->promise());
- $t->state = 'complete';
- $c = false;
- $t->request->getEmitter()->on('complete', function (CompleteEvent $e) use (&$c) {
- $c = true;
- });
- $fsm($t);
- $this->assertFalse($c);
- }
-
- public function testTransitionsThroughSuccessfulTransfer()
- {
- $client = new Client();
- $client->getEmitter()->attach(new Mock([new Response(200)]));
- $request = $client->createRequest('GET', 'http://ewfewwef.com');
- $this->addListeners($request, $calls);
- $client->send($request);
- $this->assertEquals(['before', 'complete', 'end'], $calls);
- }
-
- public function testTransitionsThroughErrorsInBefore()
- {
- $fsm = new RequestFsm(function () {
- return new CompletedFutureArray(['status' => 200]);
- }, $this->mf);
- $client = new Client();
- $request = $client->createRequest('GET', 'http://ewfewwef.com');
- $t = new Transaction($client, $request);
- $calls = [];
- $this->addListeners($t->request, $calls);
- $t->request->getEmitter()->on('before', function (BeforeEvent $e) {
- throw new \Exception('foo');
- });
- try {
- $fsm($t);
- $this->fail('did not throw');
- } catch (RequestException $e) {
- $this->assertContains('foo', $t->exception->getMessage());
- $this->assertEquals(['before', 'error', 'end'], $calls);
- }
- }
-
- public function testTransitionsThroughErrorsInComplete()
- {
- $client = new Client();
- $client->getEmitter()->attach(new Mock([new Response(200)]));
- $request = $client->createRequest('GET', 'http://ewfewwef.com');
- $this->addListeners($request, $calls);
- $request->getEmitter()->once('complete', function (CompleteEvent $e) {
- throw new \Exception('foo');
- });
- try {
- $client->send($request);
- $this->fail('did not throw');
- } catch (RequestException $e) {
- $this->assertContains('foo', $e->getMessage());
- $this->assertEquals(['before', 'complete', 'error', 'end'], $calls);
- }
- }
-
- public function testTransitionsThroughErrorInterception()
- {
- $fsm = new RequestFsm(function () {
- return new CompletedFutureArray(['status' => 404]);
- }, $this->mf);
- $client = new Client();
- $request = $client->createRequest('GET', 'http://ewfewwef.com');
- $t = new Transaction($client, $request);
- $calls = [];
- $this->addListeners($t->request, $calls);
- $t->request->getEmitter()->on('error', function (ErrorEvent $e) {
- $e->intercept(new Response(200));
- });
- $fsm($t);
- $this->assertEquals(200, $t->response->getStatusCode());
- $this->assertNull($t->exception);
- $this->assertEquals(['before', 'complete', 'error', 'complete', 'end'], $calls);
- }
-
- private function addListeners(RequestInterface $request, &$calls)
- {
- $request->getEmitter()->on('before', function (BeforeEvent $e) use (&$calls) {
- $calls[] = 'before';
- }, RequestEvents::EARLY);
- $request->getEmitter()->on('complete', function (CompleteEvent $e) use (&$calls) {
- $calls[] = 'complete';
- }, RequestEvents::EARLY);
- $request->getEmitter()->on('error', function (ErrorEvent $e) use (&$calls) {
- $calls[] = 'error';
- }, RequestEvents::EARLY);
- $request->getEmitter()->on('end', function (EndEvent $e) use (&$calls) {
- $calls[] = 'end';
- }, RequestEvents::EARLY);
- }
-
- /**
- * @expectedException \GuzzleHttp\Exception\RequestException
- * @expectedExceptionMessage Too many state transitions
- */
- public function testDetectsInfiniteLoops()
- {
- $client = new Client([
- 'fsm' => $fsm = new RequestFsm(
- function () {
- return new CompletedFutureArray(['status' => 200]);
- },
- new MessageFactory(),
- 3
- )
- ]);
- $request = $client->createRequest('GET', 'http://foo.com:123');
- $request->getEmitter()->on('before', function () {
- throw new \Exception('foo');
- });
- $request->getEmitter()->on('error', function ($e) {
- $e->retry();
- });
- $client->send($request);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/RingBridgeTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/RingBridgeTest.php
deleted file mode 100644
index dc26a42..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/RingBridgeTest.php
+++ /dev/null
@@ -1,195 +0,0 @@
- 'hello'
- ], $stream);
- $request->getConfig()->set('foo', 'bar');
- $trans = new Transaction(new Client(), $request);
- $factory = new MessageFactory();
- $fsm = new RequestFsm(function () {}, new MessageFactory());
- $r = RingBridge::prepareRingRequest($trans, $factory, $fsm);
- $this->assertEquals('http', $r['scheme']);
- $this->assertEquals('1.1', $r['version']);
- $this->assertEquals('GET', $r['http_method']);
- $this->assertEquals('http://httpbin.org/get?a=b', $r['url']);
- $this->assertEquals('/get', $r['uri']);
- $this->assertEquals('a=b', $r['query_string']);
- $this->assertEquals([
- 'Host' => ['httpbin.org'],
- 'test' => ['hello']
- ], $r['headers']);
- $this->assertSame($stream, $r['body']);
- $this->assertEquals(['foo' => 'bar'], $r['client']);
- $this->assertFalse($r['future']);
- }
-
- public function testCreatesRingRequestsWithNullQueryString()
- {
- $request = new Request('GET', 'http://httpbin.org');
- $trans = new Transaction(new Client(), $request);
- $factory = new MessageFactory();
- $fsm = new RequestFsm(function () {}, new MessageFactory());
- $r = RingBridge::prepareRingRequest($trans, $factory, $fsm);
- $this->assertNull($r['query_string']);
- $this->assertEquals('/', $r['uri']);
- $this->assertEquals(['Host' => ['httpbin.org']], $r['headers']);
- $this->assertNull($r['body']);
- $this->assertEquals([], $r['client']);
- }
-
- public function testAddsProgress()
- {
- Server::enqueue([new Response(200)]);
- $client = new Client(['base_url' => Server::$url]);
- $request = $client->createRequest('GET');
- $called = false;
- $request->getEmitter()->on(
- 'progress',
- function (ProgressEvent $e) use (&$called) {
- $called = true;
- }
- );
- $this->assertEquals(200, $client->send($request)->getStatusCode());
- $this->assertTrue($called);
- }
-
- public function testGetsResponseProtocolVersionAndEffectiveUrlAndReason()
- {
- $client = new Client([
- 'handler' => new MockHandler([
- 'status' => 200,
- 'reason' => 'test',
- 'headers' => [],
- 'version' => '1.0',
- 'effective_url' => 'http://foo.com'
- ])
- ]);
- $request = $client->createRequest('GET', 'http://foo.com');
- $response = $client->send($request);
- $this->assertEquals('1.0', $response->getProtocolVersion());
- $this->assertEquals('http://foo.com', $response->getEffectiveUrl());
- $this->assertEquals('test', $response->getReasonPhrase());
- }
-
- public function testGetsStreamFromResponse()
- {
- $res = fopen('php://temp', 'r+');
- fwrite($res, 'foo');
- rewind($res);
- $client = new Client([
- 'handler' => new MockHandler([
- 'status' => 200,
- 'headers' => [],
- 'body' => $res
- ])
- ]);
- $request = $client->createRequest('GET', 'http://foo.com');
- $response = $client->send($request);
- $this->assertEquals('foo', (string) $response->getBody());
- }
-
- public function testEmitsErrorEventOnError()
- {
- $client = new Client(['base_url' => 'http://127.0.0.1:123']);
- $request = $client->createRequest('GET');
- $called = false;
- $request->getEmitter()->on('error', function () use (&$called) {
- $called = true;
- });
- $request->getConfig()['timeout'] = 0.001;
- $request->getConfig()['connect_timeout'] = 0.001;
- try {
- $client->send($request);
- $this->fail('did not throw');
- } catch (RequestException $e) {
- $this->assertSame($request, $e->getRequest());
- $this->assertContains('cURL error', $e->getMessage());
- $this->assertTrue($called);
- }
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesRingRequest()
- {
- RingBridge::fromRingRequest([]);
- }
-
- public function testCreatesRequestFromRing()
- {
- $request = RingBridge::fromRingRequest([
- 'http_method' => 'GET',
- 'uri' => '/',
- 'headers' => [
- 'foo' => ['bar'],
- 'host' => ['foo.com']
- ],
- 'body' => 'test',
- 'version' => '1.0'
- ]);
- $this->assertEquals('GET', $request->getMethod());
- $this->assertEquals('http://foo.com/', $request->getUrl());
- $this->assertEquals('1.0', $request->getProtocolVersion());
- $this->assertEquals('test', (string) $request->getBody());
- $this->assertEquals('bar', $request->getHeader('foo'));
- }
-
- public function testCanInterceptException()
- {
- $client = new Client(['base_url' => 'http://127.0.0.1:123']);
- $request = $client->createRequest('GET');
- $called = false;
- $request->getEmitter()->on(
- 'error',
- function (ErrorEvent $e) use (&$called) {
- $called = true;
- $e->intercept(new Response(200));
- }
- );
- $request->getConfig()['timeout'] = 0.001;
- $request->getConfig()['connect_timeout'] = 0.001;
- $this->assertEquals(200, $client->send($request)->getStatusCode());
- $this->assertTrue($called);
- }
-
- public function testCreatesLongException()
- {
- $r = new Request('GET', 'http://www.google.com');
- $e = RingBridge::getNoRingResponseException($r);
- $this->assertInstanceOf('GuzzleHttp\Exception\RequestException', $e);
- $this->assertSame($r, $e->getRequest());
- }
-
- public function testEnsuresResponseOrExceptionWhenCompletingResponse()
- {
- $trans = new Transaction(new Client(), new Request('GET', 'http://f.co'));
- $f = new MessageFactory();
- $fsm = new RequestFsm(function () {}, new MessageFactory());
- try {
- RingBridge::completeRingResponse($trans, [], $f, $fsm);
- } catch (RequestException $e) {
- $this->assertSame($trans->request, $e->getRequest());
- $this->assertContains('RingPHP', $e->getMessage());
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Server.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Server.php
deleted file mode 100644
index 1de20e3..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Server.php
+++ /dev/null
@@ -1,107 +0,0 @@
-fromMessage($response);
- } elseif (!($response instanceof ResponseInterface)) {
- throw new \Exception('Responses must be strings or Responses');
- }
- $data[] = self::convertResponse($response);
- }
-
- TestServer::enqueue($data);
- }
-
- /**
- * Get all of the received requests
- *
- * @param bool $hydrate Set to TRUE to turn the messages into
- * actual {@see RequestInterface} objects. If $hydrate is FALSE,
- * requests will be returned as strings.
- *
- * @return array
- * @throws \RuntimeException
- */
- public static function received($hydrate = false)
- {
- $response = TestServer::received();
-
- if ($hydrate) {
- $c = new Client();
- $factory = new MessageFactory();
- $response = array_map(function($message) use ($factory, $c) {
- return RingBridge::fromRingRequest($message);
- }, $response);
- }
-
- return $response;
- }
-
- public static function flush()
- {
- TestServer::flush();
- }
-
- public static function stop()
- {
- TestServer::stop();
- }
-
- public static function wait($maxTries = 5)
- {
- TestServer::wait($maxTries);
- }
-
- public static function start()
- {
- TestServer::start();
- }
-
- private static function convertResponse(Response $response)
- {
- $headers = array_map(function ($h) {
- return implode(', ', $h);
- }, $response->getHeaders());
-
- return [
- 'status' => $response->getStatusCode(),
- 'reason' => $response->getReasonPhrase(),
- 'headers' => $headers,
- 'body' => base64_encode((string) $response->getBody())
- ];
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/CookieTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/CookieTest.php
deleted file mode 100644
index bc17e2d..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/CookieTest.php
+++ /dev/null
@@ -1,74 +0,0 @@
-getMockBuilder('GuzzleHttp\Cookie\CookieJar')
- ->setMethods(array('extractCookies'))
- ->getMock();
-
- $mock->expects($this->exactly(1))
- ->method('extractCookies')
- ->with($request, $response);
-
- $plugin = new Cookie($mock);
- $t = new Transaction(new Client(), $request);
- $t->response = $response;
- $plugin->onComplete(new CompleteEvent($t));
- }
-
- public function testProvidesCookieJar()
- {
- $jar = new CookieJar();
- $plugin = new Cookie($jar);
- $this->assertSame($jar, $plugin->getCookieJar());
- }
-
- public function testCookiesAreExtractedFromRedirectResponses()
- {
- $jar = new CookieJar();
- $cookie = new Cookie($jar);
- $history = new History();
- $mock = new Mock([
- "HTTP/1.1 302 Moved Temporarily\r\n" .
- "Set-Cookie: test=583551; Domain=www.foo.com; Expires=Wednesday, 23-Mar-2050 19:49:45 GMT; Path=/\r\n" .
- "Location: /redirect\r\n\r\n",
- "HTTP/1.1 200 OK\r\n" .
- "Content-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\n" .
- "Content-Length: 0\r\n\r\n"
- ]);
- $client = new Client(['base_url' => 'http://www.foo.com']);
- $client->getEmitter()->attach($cookie);
- $client->getEmitter()->attach($mock);
- $client->getEmitter()->attach($history);
-
- $client->get();
- $request = $client->createRequest('GET', '/');
- $client->send($request);
-
- $this->assertEquals('test=583551', $request->getHeader('Cookie'));
- $requests = $history->getRequests();
- // Confirm subsequent requests have the cookie.
- $this->assertEquals('test=583551', $requests[2]->getHeader('Cookie'));
- // Confirm the redirected request has the cookie.
- $this->assertEquals('test=583551', $requests[1]->getHeader('Cookie'));
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/HistoryTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/HistoryTest.php
deleted file mode 100644
index d28e301..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/HistoryTest.php
+++ /dev/null
@@ -1,140 +0,0 @@
-response = $response;
- $e = new RequestException('foo', $request, $response);
- $ev = new ErrorEvent($t, $e);
- $h = new History(2);
- $h->onError($ev);
- // Only tracks when no response is present
- $this->assertEquals([], $h->getRequests());
- }
-
- public function testLogsConnectionErrors()
- {
- $request = new Request('GET', '/');
- $t = new Transaction(new Client(), $request);
- $e = new RequestException('foo', $request);
- $ev = new ErrorEvent($t, $e);
- $h = new History();
- $h->onError($ev);
- $this->assertEquals([$request], $h->getRequests());
- }
-
- public function testMaintainsLimitValue()
- {
- $request = new Request('GET', '/');
- $response = new Response(200);
- $t = new Transaction(new Client(), $request);
- $t->response = $response;
- $ev = new CompleteEvent($t);
- $h = new History(2);
- $h->onComplete($ev);
- $h->onComplete($ev);
- $h->onComplete($ev);
- $this->assertEquals(2, count($h));
- $this->assertSame($request, $h->getLastRequest());
- $this->assertSame($response, $h->getLastResponse());
- foreach ($h as $trans) {
- $this->assertInstanceOf('GuzzleHttp\Message\RequestInterface', $trans['request']);
- $this->assertInstanceOf('GuzzleHttp\Message\ResponseInterface', $trans['response']);
- }
- return $h;
- }
-
- /**
- * @depends testMaintainsLimitValue
- */
- public function testClearsHistory($h)
- {
- $this->assertEquals(2, count($h));
- $h->clear();
- $this->assertEquals(0, count($h));
- }
-
- public function testWorksWithMock()
- {
- $client = new Client(['base_url' => 'http://localhost/']);
- $h = new History();
- $client->getEmitter()->attach($h);
- $mock = new Mock([new Response(200), new Response(201), new Response(202)]);
- $client->getEmitter()->attach($mock);
- $request = $client->createRequest('GET', '/');
- $client->send($request);
- $request->setMethod('PUT');
- $client->send($request);
- $request->setMethod('POST');
- $client->send($request);
- $this->assertEquals(3, count($h));
-
- $result = implode("\n", array_map(function ($line) {
- return strpos($line, 'User-Agent') === 0
- ? 'User-Agent:'
- : trim($line);
- }, explode("\n", $h)));
-
- $this->assertEquals("> GET / HTTP/1.1
-Host: localhost
-User-Agent:
-
-< HTTP/1.1 200 OK
-
-> PUT / HTTP/1.1
-Host: localhost
-User-Agent:
-
-< HTTP/1.1 201 Created
-
-> POST / HTTP/1.1
-Host: localhost
-User-Agent:
-
-< HTTP/1.1 202 Accepted
-", $result);
- }
-
- public function testCanCastToString()
- {
- $client = new Client(['base_url' => 'http://localhost/']);
- $h = new History();
- $client->getEmitter()->attach($h);
-
- $mock = new Mock(array(
- new Response(301, array('Location' => '/redirect1', 'Content-Length' => 0)),
- new Response(307, array('Location' => '/redirect2', 'Content-Length' => 0)),
- new Response(200, array('Content-Length' => '2'), Stream::factory('HI'))
- ));
-
- $client->getEmitter()->attach($mock);
- $request = $client->createRequest('GET', '/');
- $client->send($request);
- $this->assertEquals(3, count($h));
-
- $h = str_replace("\r", '', $h);
- $this->assertContains("> GET / HTTP/1.1\nHost: localhost\nUser-Agent:", $h);
- $this->assertContains("< HTTP/1.1 301 Moved Permanently\nLocation: /redirect1", $h);
- $this->assertContains("< HTTP/1.1 307 Temporary Redirect\nLocation: /redirect2", $h);
- $this->assertContains("< HTTP/1.1 200 OK\nContent-Length: 2\n\nHI", $h);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/HttpErrorTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/HttpErrorTest.php
deleted file mode 100644
index b026634..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/HttpErrorTest.php
+++ /dev/null
@@ -1,60 +0,0 @@
-getEvent();
- $event->intercept(new Response(200));
- (new HttpError())->onComplete($event);
- }
-
- /**
- * @expectedException \GuzzleHttp\Exception\ClientException
- */
- public function testThrowsClientExceptionOnFailure()
- {
- $event = $this->getEvent();
- $event->intercept(new Response(403));
- (new HttpError())->onComplete($event);
- }
-
- /**
- * @expectedException \GuzzleHttp\Exception\ServerException
- */
- public function testThrowsServerExceptionOnFailure()
- {
- $event = $this->getEvent();
- $event->intercept(new Response(500));
- (new HttpError())->onComplete($event);
- }
-
- private function getEvent()
- {
- return new CompleteEvent(new Transaction(new Client(), new Request('PUT', '/')));
- }
-
- /**
- * @expectedException \GuzzleHttp\Exception\ClientException
- */
- public function testFullTransaction()
- {
- $client = new Client();
- $client->getEmitter()->attach(new Mock([
- new Response(403)
- ]));
- $client->get('http://httpbin.org');
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/MockTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/MockTest.php
deleted file mode 100644
index 936edf2..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/MockTest.php
+++ /dev/null
@@ -1,225 +0,0 @@
-promise(),
- function () use ($deferred, $wait) {
- $deferred->resolve($wait());
- },
- $cancel
- );
- }
-
- public function testDescribesSubscribedEvents()
- {
- $mock = new Mock();
- $this->assertInternalType('array', $mock->getEvents());
- }
-
- public function testIsCountable()
- {
- $plugin = new Mock();
- $plugin->addResponse((new MessageFactory())->fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"));
- $this->assertEquals(1, count($plugin));
- }
-
- public function testCanClearQueue()
- {
- $plugin = new Mock();
- $plugin->addResponse((new MessageFactory())->fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"));
- $plugin->clearQueue();
- $this->assertEquals(0, count($plugin));
- }
-
- public function testRetrievesResponsesFromFiles()
- {
- $tmp = tempnam('/tmp', 'tfile');
- file_put_contents($tmp, "HTTP/1.1 201 OK\r\nContent-Length: 0\r\n\r\n");
- $plugin = new Mock();
- $plugin->addResponse($tmp);
- unlink($tmp);
- $this->assertEquals(1, count($plugin));
- $q = $this->readAttribute($plugin, 'queue');
- $this->assertEquals(201, $q[0]->getStatusCode());
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testThrowsExceptionWhenInvalidResponse()
- {
- (new Mock())->addResponse(false);
- }
-
- public function testAddsMockResponseToRequestFromClient()
- {
- $response = new Response(200);
- $t = new Transaction(new Client(), new Request('GET', '/'));
- $m = new Mock([$response]);
- $ev = new BeforeEvent($t);
- $m->onBefore($ev);
- $this->assertSame($response, $t->response);
- }
-
- /**
- * @expectedException \OutOfBoundsException
- */
- public function testUpdateThrowsExceptionWhenEmpty()
- {
- $p = new Mock();
- $ev = new BeforeEvent(new Transaction(new Client(), new Request('GET', '/')));
- $p->onBefore($ev);
- }
-
- public function testReadsBodiesFromMockedRequests()
- {
- $m = new Mock([new Response(200)]);
- $client = new Client(['base_url' => 'http://test.com']);
- $client->getEmitter()->attach($m);
- $body = Stream::factory('foo');
- $client->put('/', ['body' => $body]);
- $this->assertEquals(3, $body->tell());
- }
-
- public function testCanMockBadRequestExceptions()
- {
- $client = new Client(['base_url' => 'http://test.com']);
- $request = $client->createRequest('GET', '/');
- $ex = new RequestException('foo', $request);
- $mock = new Mock([$ex]);
- $this->assertCount(1, $mock);
- $request->getEmitter()->attach($mock);
-
- try {
- $client->send($request);
- $this->fail('Did not dequeue an exception');
- } catch (RequestException $e) {
- $this->assertSame($e, $ex);
- $this->assertSame($request, $ex->getRequest());
- }
- }
-
- public function testCanMockFutureResponses()
- {
- $client = new Client(['base_url' => 'http://test.com']);
- $request = $client->createRequest('GET', '/', ['future' => true]);
- $response = new Response(200);
- $future = self::createFuture(function () use ($response) {
- return $response;
- });
- $mock = new Mock([$future]);
- $this->assertCount(1, $mock);
- $request->getEmitter()->attach($mock);
- $res = $client->send($request);
- $this->assertSame($future, $res);
- $this->assertFalse($this->readAttribute($res, 'isRealized'));
- $this->assertSame($response, $res->wait());
- }
-
- public function testCanMockExceptionFutureResponses()
- {
- $client = new Client(['base_url' => 'http://test.com']);
- $request = $client->createRequest('GET', '/', ['future' => true]);
- $future = self::createFuture(function () use ($request) {
- throw new RequestException('foo', $request);
- });
-
- $mock = new Mock([$future]);
- $request->getEmitter()->attach($mock);
- $response = $client->send($request);
- $this->assertSame($future, $response);
- $this->assertFalse($this->readAttribute($response, 'isRealized'));
-
- try {
- $response->wait();
- $this->fail('Did not throw');
- } catch (RequestException $e) {
- $this->assertContains('foo', $e->getMessage());
- }
- }
-
- public function testSaveToFile()
- {
- $filename = sys_get_temp_dir().'/mock_test_'.uniqid();
- $file = tmpfile();
- $stream = new Stream(tmpfile());
-
- $m = new Mock([
- new Response(200, [], Stream::factory('TEST FILENAME')),
- new Response(200, [], Stream::factory('TEST FILE')),
- new Response(200, [], Stream::factory('TEST STREAM')),
- ]);
-
- $client = new Client();
- $client->getEmitter()->attach($m);
-
- $client->get('/', ['save_to' => $filename]);
- $client->get('/', ['save_to' => $file]);
- $client->get('/', ['save_to' => $stream]);
-
- $this->assertFileExists($filename);
- $this->assertEquals('TEST FILENAME', file_get_contents($filename));
-
- $meta = stream_get_meta_data($file);
-
- $this->assertFileExists($meta['uri']);
- $this->assertEquals('TEST FILE', file_get_contents($meta['uri']));
-
- $this->assertFileExists($stream->getMetadata('uri'));
- $this->assertEquals('TEST STREAM', file_get_contents($stream->getMetadata('uri')));
-
- unlink($filename);
- }
-
- public function testCanMockFailedFutureResponses()
- {
- $client = new Client(['base_url' => 'http://test.com']);
- $request = $client->createRequest('GET', '/', ['future' => true]);
-
- // The first mock will be a mocked future response.
- $future = self::createFuture(function () use ($client) {
- // When dereferenced, we will set a mocked response and send
- // another request.
- $client->get('http://httpbin.org', ['events' => [
- 'before' => function (BeforeEvent $e) {
- $e->intercept(new Response(404));
- }
- ]]);
- });
-
- $mock = new Mock([$future]);
- $request->getEmitter()->attach($mock);
- $response = $client->send($request);
- $this->assertSame($future, $response);
- $this->assertFalse($this->readAttribute($response, 'isRealized'));
-
- try {
- $response->wait();
- $this->fail('Did not throw');
- } catch (RequestException $e) {
- $this->assertEquals(404, $e->getResponse()->getStatusCode());
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/PrepareTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/PrepareTest.php
deleted file mode 100644
index d07fdb4..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/PrepareTest.php
+++ /dev/null
@@ -1,213 +0,0 @@
-getTrans();
- $s->onBefore(new BeforeEvent($t));
- $this->assertFalse($t->request->hasHeader('Expect'));
- }
-
- public function testAppliesPostBody()
- {
- $s = new Prepare();
- $t = $this->getTrans();
- $p = $this->getMockBuilder('GuzzleHttp\Post\PostBody')
- ->setMethods(['applyRequestHeaders'])
- ->getMockForAbstractClass();
- $p->expects($this->once())
- ->method('applyRequestHeaders');
- $t->request->setBody($p);
- $s->onBefore(new BeforeEvent($t));
- }
-
- public function testAddsExpectHeaderWithTrue()
- {
- $s = new Prepare();
- $t = $this->getTrans();
- $t->request->getConfig()->set('expect', true);
- $t->request->setBody(Stream::factory('foo'));
- $s->onBefore(new BeforeEvent($t));
- $this->assertEquals('100-Continue', $t->request->getHeader('Expect'));
- }
-
- public function testAddsExpectHeaderBySize()
- {
- $s = new Prepare();
- $t = $this->getTrans();
- $t->request->getConfig()->set('expect', 2);
- $t->request->setBody(Stream::factory('foo'));
- $s->onBefore(new BeforeEvent($t));
- $this->assertTrue($t->request->hasHeader('Expect'));
- }
-
- public function testDoesNotModifyExpectHeaderIfPresent()
- {
- $s = new Prepare();
- $t = $this->getTrans();
- $t->request->setHeader('Expect', 'foo');
- $t->request->setBody(Stream::factory('foo'));
- $s->onBefore(new BeforeEvent($t));
- $this->assertEquals('foo', $t->request->getHeader('Expect'));
- }
-
- public function testDoesAddExpectHeaderWhenSetToFalse()
- {
- $s = new Prepare();
- $t = $this->getTrans();
- $t->request->getConfig()->set('expect', false);
- $t->request->setBody(Stream::factory('foo'));
- $s->onBefore(new BeforeEvent($t));
- $this->assertFalse($t->request->hasHeader('Expect'));
- }
-
- public function testDoesNotAddExpectHeaderBySize()
- {
- $s = new Prepare();
- $t = $this->getTrans();
- $t->request->getConfig()->set('expect', 10);
- $t->request->setBody(Stream::factory('foo'));
- $s->onBefore(new BeforeEvent($t));
- $this->assertFalse($t->request->hasHeader('Expect'));
- }
-
- public function testAddsExpectHeaderForNonSeekable()
- {
- $s = new Prepare();
- $t = $this->getTrans();
- $t->request->setBody(new NoSeekStream(Stream::factory('foo')));
- $s->onBefore(new BeforeEvent($t));
- $this->assertTrue($t->request->hasHeader('Expect'));
- }
-
- public function testRemovesContentLengthWhenSendingWithChunked()
- {
- $s = new Prepare();
- $t = $this->getTrans();
- $t->request->setBody(Stream::factory('foo'));
- $t->request->setHeader('Transfer-Encoding', 'chunked');
- $s->onBefore(new BeforeEvent($t));
- $this->assertFalse($t->request->hasHeader('Content-Length'));
- }
-
- public function testUsesProvidedContentLengthAndRemovesXferEncoding()
- {
- $s = new Prepare();
- $t = $this->getTrans();
- $t->request->setBody(Stream::factory('foo'));
- $t->request->setHeader('Content-Length', '3');
- $t->request->setHeader('Transfer-Encoding', 'chunked');
- $s->onBefore(new BeforeEvent($t));
- $this->assertEquals(3, $t->request->getHeader('Content-Length'));
- $this->assertFalse($t->request->hasHeader('Transfer-Encoding'));
- }
-
- public function testSetsContentTypeIfPossibleFromStream()
- {
- $body = $this->getMockBody();
- $sub = new Prepare();
- $t = $this->getTrans();
- $t->request->setBody($body);
- $sub->onBefore(new BeforeEvent($t));
- $this->assertEquals(
- 'image/jpeg',
- $t->request->getHeader('Content-Type')
- );
- $this->assertEquals(4, $t->request->getHeader('Content-Length'));
- }
-
- public function testDoesNotOverwriteExistingContentType()
- {
- $s = new Prepare();
- $t = $this->getTrans();
- $t->request->setBody($this->getMockBody());
- $t->request->setHeader('Content-Type', 'foo/baz');
- $s->onBefore(new BeforeEvent($t));
- $this->assertEquals(
- 'foo/baz',
- $t->request->getHeader('Content-Type')
- );
- }
-
- public function testSetsContentLengthIfPossible()
- {
- $s = new Prepare();
- $t = $this->getTrans();
- $t->request->setBody($this->getMockBody());
- $s->onBefore(new BeforeEvent($t));
- $this->assertEquals(4, $t->request->getHeader('Content-Length'));
- }
-
- public function testSetsTransferEncodingChunkedIfNeeded()
- {
- $r = new Request('PUT', '/');
- $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface')
- ->setMethods(['getSize'])
- ->getMockForAbstractClass();
- $s->expects($this->exactly(2))
- ->method('getSize')
- ->will($this->returnValue(null));
- $r->setBody($s);
- $t = $this->getTrans($r);
- $s = new Prepare();
- $s->onBefore(new BeforeEvent($t));
- $this->assertEquals('chunked', $r->getHeader('Transfer-Encoding'));
- }
-
- public function testContentLengthIntegrationTest()
- {
- Server::flush();
- Server::enqueue([new Response(200)]);
- $client = new Client(['base_url' => Server::$url]);
- $this->assertEquals(200, $client->put('/', [
- 'body' => 'test'
- ])->getStatusCode());
- $request = Server::received(true)[0];
- $this->assertEquals('PUT', $request->getMethod());
- $this->assertEquals('4', $request->getHeader('Content-Length'));
- $this->assertEquals('test', (string) $request->getBody());
- }
-
- private function getTrans($request = null)
- {
- return new Transaction(
- new Client(),
- $request ?: new Request('PUT', '/')
- );
- }
-
- /**
- * @return \GuzzleHttp\Stream\StreamInterface
- */
- private function getMockBody()
- {
- $s = $this->getMockBuilder('GuzzleHttp\Stream\MetadataStreamInterface')
- ->setMethods(['getMetadata', 'getSize'])
- ->getMockForAbstractClass();
- $s->expects($this->any())
- ->method('getMetadata')
- ->with('uri')
- ->will($this->returnValue('/foo/baz/bar.jpg'));
- $s->expects($this->exactly(2))
- ->method('getSize')
- ->will($this->returnValue(4));
-
- return $s;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/RedirectTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/RedirectTest.php
deleted file mode 100644
index bd12af7..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/Subscriber/RedirectTest.php
+++ /dev/null
@@ -1,302 +0,0 @@
-addMultiple([
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect1\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect2\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- ]);
-
- $client = new Client(['base_url' => 'http://test.com']);
- $client->getEmitter()->attach($history);
- $client->getEmitter()->attach($mock);
-
- $request = $client->createRequest('GET', '/foo');
- // Ensure "end" is called only once
- $called = 0;
- $request->getEmitter()->on('end', function () use (&$called) {
- $called++;
- });
- $response = $client->send($request);
-
- $this->assertEquals(200, $response->getStatusCode());
- $this->assertContains('/redirect2', $response->getEffectiveUrl());
-
- // Ensure that two requests were sent
- $requests = $history->getRequests(true);
-
- $this->assertEquals('/foo', $requests[0]->getPath());
- $this->assertEquals('GET', $requests[0]->getMethod());
- $this->assertEquals('/redirect1', $requests[1]->getPath());
- $this->assertEquals('GET', $requests[1]->getMethod());
- $this->assertEquals('/redirect2', $requests[2]->getPath());
- $this->assertEquals('GET', $requests[2]->getMethod());
-
- $this->assertEquals(1, $called);
- }
-
- /**
- * @expectedException \GuzzleHttp\Exception\TooManyRedirectsException
- * @expectedExceptionMessage Will not follow more than
- */
- public function testCanLimitNumberOfRedirects()
- {
- $mock = new Mock([
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect1\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect2\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect3\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect4\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect5\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect6\r\nContent-Length: 0\r\n\r\n"
- ]);
- $client = new Client();
- $client->getEmitter()->attach($mock);
- $client->get('http://www.example.com/foo');
- }
-
- public function testDefaultBehaviorIsToRedirectWithGetForEntityEnclosingRequests()
- {
- $h = new History();
- $mock = new Mock([
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- ]);
- $client = new Client();
- $client->getEmitter()->attach($mock);
- $client->getEmitter()->attach($h);
- $client->post('http://test.com/foo', [
- 'headers' => ['X-Baz' => 'bar'],
- 'body' => 'testing'
- ]);
-
- $requests = $h->getRequests(true);
- $this->assertEquals('POST', $requests[0]->getMethod());
- $this->assertEquals('GET', $requests[1]->getMethod());
- $this->assertEquals('bar', (string) $requests[1]->getHeader('X-Baz'));
- $this->assertEquals('GET', $requests[2]->getMethod());
- }
-
- public function testCanRedirectWithStrictRfcCompliance()
- {
- $h = new History();
- $mock = new Mock([
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- ]);
- $client = new Client(['base_url' => 'http://test.com']);
- $client->getEmitter()->attach($mock);
- $client->getEmitter()->attach($h);
- $client->post('/foo', [
- 'headers' => ['X-Baz' => 'bar'],
- 'body' => 'testing',
- 'allow_redirects' => ['max' => 10, 'strict' => true]
- ]);
-
- $requests = $h->getRequests(true);
- $this->assertEquals('POST', $requests[0]->getMethod());
- $this->assertEquals('POST', $requests[1]->getMethod());
- $this->assertEquals('bar', (string) $requests[1]->getHeader('X-Baz'));
- $this->assertEquals('POST', $requests[2]->getMethod());
- }
-
- public function testRewindsStreamWhenRedirectingIfNeeded()
- {
- $h = new History();
- $mock = new Mock([
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- ]);
- $client = new Client(['base_url' => 'http://test.com']);
- $client->getEmitter()->attach($mock);
- $client->getEmitter()->attach($h);
-
- $body = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface')
- ->setMethods(['seek', 'read', 'eof', 'tell'])
- ->getMockForAbstractClass();
- $body->expects($this->once())->method('tell')->will($this->returnValue(1));
- $body->expects($this->once())->method('seek')->will($this->returnValue(true));
- $body->expects($this->any())->method('eof')->will($this->returnValue(true));
- $body->expects($this->any())->method('read')->will($this->returnValue('foo'));
- $client->post('/foo', [
- 'body' => $body,
- 'allow_redirects' => ['max' => 5, 'strict' => true]
- ]);
- }
-
- /**
- * @expectedException \GuzzleHttp\Exception\CouldNotRewindStreamException
- * @expectedExceptionMessage Unable to rewind the non-seekable request body after redirecting
- */
- public function testThrowsExceptionWhenStreamCannotBeRewound()
- {
- $h = new History();
- $mock = new Mock([
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- ]);
- $client = new Client();
- $client->getEmitter()->attach($mock);
- $client->getEmitter()->attach($h);
-
- $body = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface')
- ->setMethods(['seek', 'read', 'eof', 'tell'])
- ->getMockForAbstractClass();
- $body->expects($this->once())->method('tell')->will($this->returnValue(1));
- $body->expects($this->once())->method('seek')->will($this->returnValue(false));
- $body->expects($this->any())->method('eof')->will($this->returnValue(true));
- $body->expects($this->any())->method('read')->will($this->returnValue('foo'));
- $client->post('http://example.com/foo', [
- 'body' => $body,
- 'allow_redirects' => ['max' => 10, 'strict' => true]
- ]);
- }
-
- public function testRedirectsCanBeDisabledPerRequest()
- {
- $client = new Client(['base_url' => 'http://test.com']);
- $client->getEmitter()->attach(new Mock([
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- ]));
- $response = $client->put('/', ['body' => 'test', 'allow_redirects' => false]);
- $this->assertEquals(301, $response->getStatusCode());
- }
-
- public function testCanRedirectWithNoLeadingSlashAndQuery()
- {
- $h = new History();
- $client = new Client(['base_url' => 'http://www.foo.com']);
- $client->getEmitter()->attach(new Mock([
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect?foo=bar\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- ]));
- $client->getEmitter()->attach($h);
- $client->get('?foo=bar');
- $requests = $h->getRequests(true);
- $this->assertEquals('http://www.foo.com?foo=bar', $requests[0]->getUrl());
- $this->assertEquals('http://www.foo.com/redirect?foo=bar', $requests[1]->getUrl());
- }
-
- public function testHandlesRedirectsWithSpacesProperly()
- {
- $client = new Client(['base_url' => 'http://www.foo.com']);
- $client->getEmitter()->attach(new Mock([
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect 1\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"
- ]));
- $h = new History();
- $client->getEmitter()->attach($h);
- $client->get('/foo');
- $reqs = $h->getRequests(true);
- $this->assertEquals('/redirect%201', $reqs[1]->getResource());
- }
-
- public function testAddsRefererWhenPossible()
- {
- $client = new Client(['base_url' => 'http://www.foo.com']);
- $client->getEmitter()->attach(new Mock([
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /bar\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"
- ]));
- $h = new History();
- $client->getEmitter()->attach($h);
- $client->get('/foo', ['allow_redirects' => ['max' => 5, 'referer' => true]]);
- $reqs = $h->getRequests(true);
- $this->assertEquals('http://www.foo.com/foo', $reqs[1]->getHeader('Referer'));
- }
-
- public function testDoesNotAddRefererWhenChangingProtocols()
- {
- $client = new Client(['base_url' => 'https://www.foo.com']);
- $client->getEmitter()->attach(new Mock([
- "HTTP/1.1 301 Moved Permanently\r\n"
- . "Location: http://www.foo.com/foo\r\n"
- . "Content-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"
- ]));
- $h = new History();
- $client->getEmitter()->attach($h);
- $client->get('/foo', ['allow_redirects' => ['max' => 5, 'referer' => true]]);
- $reqs = $h->getRequests(true);
- $this->assertFalse($reqs[1]->hasHeader('Referer'));
- }
-
- public function testRedirectsWithGetOn303()
- {
- $h = new History();
- $mock = new Mock([
- "HTTP/1.1 303 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n",
- ]);
- $client = new Client();
- $client->getEmitter()->attach($mock);
- $client->getEmitter()->attach($h);
- $client->post('http://test.com/foo', ['body' => 'testing']);
- $requests = $h->getRequests(true);
- $this->assertEquals('POST', $requests[0]->getMethod());
- $this->assertEquals('GET', $requests[1]->getMethod());
- }
-
- public function testRelativeLinkBasedLatestRequest()
- {
- $client = new Client(['base_url' => 'http://www.foo.com']);
- $client->getEmitter()->attach(new Mock([
- "HTTP/1.1 301 Moved Permanently\r\nLocation: http://www.bar.com\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"
- ]));
- $response = $client->get('/');
- $this->assertEquals(
- 'http://www.bar.com/redirect',
- $response->getEffectiveUrl()
- );
- }
-
- public function testUpperCaseScheme()
- {
- $client = new Client(['base_url' => 'http://www.foo.com']);
- $client->getEmitter()->attach(new Mock([
- "HTTP/1.1 301 Moved Permanently\r\nLocation: HTTP://www.bar.com\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"
- ]));
- $response = $client->get('/');
- $this->assertEquals(
- 'http://www.bar.com',
- $response->getEffectiveUrl()
- );
- }
-
- /**
- * @expectedException \GuzzleHttp\Exception\BadResponseException
- * @expectedExceptionMessage Redirect URL, https://foo.com/redirect2, does not use one of the allowed redirect protocols: http
- */
- public function testThrowsWhenRedirectingToInvalidUrlProtocol()
- {
- $mock = new Mock([
- "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect1\r\nContent-Length: 0\r\n\r\n",
- "HTTP/1.1 301 Moved Permanently\r\nLocation: https://foo.com/redirect2\r\nContent-Length: 0\r\n\r\n"
- ]);
- $client = new Client();
- $client->getEmitter()->attach($mock);
- $client->get('http://www.example.com/foo', [
- 'allow_redirects' => [
- 'protocols' => ['http']
- ]
- ]);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/TransactionTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/TransactionTest.php
deleted file mode 100644
index 42965b1..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/TransactionTest.php
+++ /dev/null
@@ -1,22 +0,0 @@
-assertSame($client, $t->client);
- $this->assertSame($request, $t->request);
- $response = new Response(200);
- $t->response = $response;
- $this->assertSame($response, $t->response);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/UriTemplateTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/UriTemplateTest.php
deleted file mode 100644
index 3f7a7f0..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/UriTemplateTest.php
+++ /dev/null
@@ -1,202 +0,0 @@
- 'value',
- 'hello' => 'Hello World!',
- 'empty' => '',
- 'path' => '/foo/bar',
- 'x' => '1024',
- 'y' => '768',
- 'null' => null,
- 'list' => array('red', 'green', 'blue'),
- 'keys' => array(
- "semi" => ';',
- "dot" => '.',
- "comma" => ','
- ),
- 'empty_keys' => array(),
- );
-
- return array_map(function ($t) use ($params) {
- $t[] = $params;
- return $t;
- }, array(
- array('foo', 'foo'),
- array('{var}', 'value'),
- array('{hello}', 'Hello%20World%21'),
- array('{+var}', 'value'),
- array('{+hello}', 'Hello%20World!'),
- array('{+path}/here', '/foo/bar/here'),
- array('here?ref={+path}', 'here?ref=/foo/bar'),
- array('X{#var}', 'X#value'),
- array('X{#hello}', 'X#Hello%20World!'),
- array('map?{x,y}', 'map?1024,768'),
- array('{x,hello,y}', '1024,Hello%20World%21,768'),
- array('{+x,hello,y}', '1024,Hello%20World!,768'),
- array('{+path,x}/here', '/foo/bar,1024/here'),
- array('{#x,hello,y}', '#1024,Hello%20World!,768'),
- array('{#path,x}/here', '#/foo/bar,1024/here'),
- array('X{.var}', 'X.value'),
- array('X{.x,y}', 'X.1024.768'),
- array('{/var}', '/value'),
- array('{/var,x}/here', '/value/1024/here'),
- array('{;x,y}', ';x=1024;y=768'),
- array('{;x,y,empty}', ';x=1024;y=768;empty'),
- array('{?x,y}', '?x=1024&y=768'),
- array('{?x,y,empty}', '?x=1024&y=768&empty='),
- array('?fixed=yes{&x}', '?fixed=yes&x=1024'),
- array('{&x,y,empty}', '&x=1024&y=768&empty='),
- array('{var:3}', 'val'),
- array('{var:30}', 'value'),
- array('{list}', 'red,green,blue'),
- array('{list*}', 'red,green,blue'),
- array('{keys}', 'semi,%3B,dot,.,comma,%2C'),
- array('{keys*}', 'semi=%3B,dot=.,comma=%2C'),
- array('{+path:6}/here', '/foo/b/here'),
- array('{+list}', 'red,green,blue'),
- array('{+list*}', 'red,green,blue'),
- array('{+keys}', 'semi,;,dot,.,comma,,'),
- array('{+keys*}', 'semi=;,dot=.,comma=,'),
- array('{#path:6}/here', '#/foo/b/here'),
- array('{#list}', '#red,green,blue'),
- array('{#list*}', '#red,green,blue'),
- array('{#keys}', '#semi,;,dot,.,comma,,'),
- array('{#keys*}', '#semi=;,dot=.,comma=,'),
- array('X{.var:3}', 'X.val'),
- array('X{.list}', 'X.red,green,blue'),
- array('X{.list*}', 'X.red.green.blue'),
- array('X{.keys}', 'X.semi,%3B,dot,.,comma,%2C'),
- array('X{.keys*}', 'X.semi=%3B.dot=..comma=%2C'),
- array('{/var:1,var}', '/v/value'),
- array('{/list}', '/red,green,blue'),
- array('{/list*}', '/red/green/blue'),
- array('{/list*,path:4}', '/red/green/blue/%2Ffoo'),
- array('{/keys}', '/semi,%3B,dot,.,comma,%2C'),
- array('{/keys*}', '/semi=%3B/dot=./comma=%2C'),
- array('{;hello:5}', ';hello=Hello'),
- array('{;list}', ';list=red,green,blue'),
- array('{;list*}', ';list=red;list=green;list=blue'),
- array('{;keys}', ';keys=semi,%3B,dot,.,comma,%2C'),
- array('{;keys*}', ';semi=%3B;dot=.;comma=%2C'),
- array('{?var:3}', '?var=val'),
- array('{?list}', '?list=red,green,blue'),
- array('{?list*}', '?list=red&list=green&list=blue'),
- array('{?keys}', '?keys=semi,%3B,dot,.,comma,%2C'),
- array('{?keys*}', '?semi=%3B&dot=.&comma=%2C'),
- array('{&var:3}', '&var=val'),
- array('{&list}', '&list=red,green,blue'),
- array('{&list*}', '&list=red&list=green&list=blue'),
- array('{&keys}', '&keys=semi,%3B,dot,.,comma,%2C'),
- array('{&keys*}', '&semi=%3B&dot=.&comma=%2C'),
- array('{.null}', ''),
- array('{.null,var}', '.value'),
- array('X{.empty_keys*}', 'X'),
- array('X{.empty_keys}', 'X'),
- // Test that missing expansions are skipped
- array('test{&missing*}', 'test'),
- // Test that multiple expansions can be set
- array('http://{var}/{var:2}{?keys*}', 'http://value/va?semi=%3B&dot=.&comma=%2C'),
- // Test more complex query string stuff
- array('http://www.test.com{+path}{?var,keys*}', 'http://www.test.com/foo/bar?var=value&semi=%3B&dot=.&comma=%2C')
- ));
- }
-
- /**
- * @dataProvider templateProvider
- */
- public function testExpandsUriTemplates($template, $expansion, $params)
- {
- $uri = new UriTemplate($template);
- $this->assertEquals($expansion, $uri->expand($template, $params));
- }
-
- public function expressionProvider()
- {
- return array(
- array(
- '{+var*}', array(
- 'operator' => '+',
- 'values' => array(
- array('value' => 'var', 'modifier' => '*')
- )
- ),
- ),
- array(
- '{?keys,var,val}', array(
- 'operator' => '?',
- 'values' => array(
- array('value' => 'keys', 'modifier' => ''),
- array('value' => 'var', 'modifier' => ''),
- array('value' => 'val', 'modifier' => '')
- )
- ),
- ),
- array(
- '{+x,hello,y}', array(
- 'operator' => '+',
- 'values' => array(
- array('value' => 'x', 'modifier' => ''),
- array('value' => 'hello', 'modifier' => ''),
- array('value' => 'y', 'modifier' => '')
- )
- )
- )
- );
- }
-
- /**
- * @dataProvider expressionProvider
- */
- public function testParsesExpressions($exp, $data)
- {
- $template = new UriTemplate($exp);
-
- // Access the config object
- $class = new \ReflectionClass($template);
- $method = $class->getMethod('parseExpression');
- $method->setAccessible(true);
-
- $exp = substr($exp, 1, -1);
- $this->assertEquals($data, $method->invokeArgs($template, array($exp)));
- }
-
- /**
- * @ticket https://github.com/guzzle/guzzle/issues/90
- */
- public function testAllowsNestedArrayExpansion()
- {
- $template = new UriTemplate();
-
- $result = $template->expand('http://example.com{+path}{/segments}{?query,data*,foo*}', array(
- 'path' => '/foo/bar',
- 'segments' => array('one', 'two'),
- 'query' => 'test',
- 'data' => array(
- 'more' => array('fun', 'ice cream')
- ),
- 'foo' => array(
- 'baz' => array(
- 'bar' => 'fizz',
- 'test' => 'buzz'
- ),
- 'bam' => 'boo'
- )
- ));
-
- $this->assertEquals('http://example.com/foo/bar/one,two?query=test&more%5B0%5D=fun&more%5B1%5D=ice%20cream&baz%5Bbar%5D=fizz&baz%5Btest%5D=buzz&bam=boo', $result);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/UrlTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/UrlTest.php
deleted file mode 100644
index 22bf7e4..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/UrlTest.php
+++ /dev/null
@@ -1,364 +0,0 @@
-assertEquals('', (string) $url);
- }
-
- public function testPortIsDeterminedFromScheme()
- {
- $this->assertEquals(80, Url::fromString('http://www.test.com/')->getPort());
- $this->assertEquals(443, Url::fromString('https://www.test.com/')->getPort());
- $this->assertEquals(21, Url::fromString('ftp://www.test.com/')->getPort());
- $this->assertEquals(8192, Url::fromString('http://www.test.com:8192/')->getPort());
- $this->assertEquals(null, Url::fromString('foo://www.test.com/')->getPort());
- }
-
- public function testRemovesDefaultPortWhenSettingScheme()
- {
- $url = Url::fromString('http://www.test.com/');
- $url->setPort(80);
- $url->setScheme('https');
- $this->assertEquals(443, $url->getPort());
- }
-
- public function testCloneCreatesNewInternalObjects()
- {
- $u1 = Url::fromString('http://www.test.com/');
- $u2 = clone $u1;
- $this->assertNotSame($u1->getQuery(), $u2->getQuery());
- }
-
- public function testValidatesUrlPartsInFactory()
- {
- $url = Url::fromString('/index.php');
- $this->assertEquals('/index.php', (string) $url);
- $this->assertFalse($url->isAbsolute());
-
- $url = 'http://michael:test@test.com:80/path/123?q=abc#test';
- $u = Url::fromString($url);
- $this->assertEquals('http://michael:test@test.com/path/123?q=abc#test', (string) $u);
- $this->assertTrue($u->isAbsolute());
- }
-
- public function testAllowsFalsyUrlParts()
- {
- $url = Url::fromString('http://a:50/0?0#0');
- $this->assertSame('a', $url->getHost());
- $this->assertEquals(50, $url->getPort());
- $this->assertSame('/0', $url->getPath());
- $this->assertEquals('0', (string) $url->getQuery());
- $this->assertSame('0', $url->getFragment());
- $this->assertEquals('http://a:50/0?0#0', (string) $url);
-
- $url = Url::fromString('');
- $this->assertSame('', (string) $url);
-
- $url = Url::fromString('0');
- $this->assertSame('0', (string) $url);
- }
-
- public function testBuildsRelativeUrlsWithFalsyParts()
- {
- $url = Url::buildUrl(['path' => '/0']);
- $this->assertSame('/0', $url);
-
- $url = Url::buildUrl(['path' => '0']);
- $this->assertSame('0', $url);
-
- $url = Url::buildUrl(['host' => '', 'path' => '0']);
- $this->assertSame('0', $url);
- }
-
- public function testUrlStoresParts()
- {
- $url = Url::fromString('http://test:pass@www.test.com:8081/path/path2/?a=1&b=2#fragment');
- $this->assertEquals('http', $url->getScheme());
- $this->assertEquals('test', $url->getUsername());
- $this->assertEquals('pass', $url->getPassword());
- $this->assertEquals('www.test.com', $url->getHost());
- $this->assertEquals(8081, $url->getPort());
- $this->assertEquals('/path/path2/', $url->getPath());
- $this->assertEquals('fragment', $url->getFragment());
- $this->assertEquals('a=1&b=2', (string) $url->getQuery());
-
- $this->assertEquals(array(
- 'fragment' => 'fragment',
- 'host' => 'www.test.com',
- 'pass' => 'pass',
- 'path' => '/path/path2/',
- 'port' => 8081,
- 'query' => 'a=1&b=2',
- 'scheme' => 'http',
- 'user' => 'test'
- ), $url->getParts());
- }
-
- public function testHandlesPathsCorrectly()
- {
- $url = Url::fromString('http://www.test.com');
- $this->assertEquals('', $url->getPath());
- $url->setPath('test');
- $this->assertEquals('test', $url->getPath());
-
- $url->setPath('/test/123/abc');
- $this->assertEquals(array('', 'test', '123', 'abc'), $url->getPathSegments());
-
- $parts = parse_url('http://www.test.com/test');
- $parts['path'] = '';
- $this->assertEquals('http://www.test.com', Url::buildUrl($parts));
- $parts['path'] = 'test';
- $this->assertEquals('http://www.test.com/test', Url::buildUrl($parts));
- }
-
- public function testAddsQueryIfPresent()
- {
- $this->assertEquals('?foo=bar', Url::buildUrl(array(
- 'query' => 'foo=bar'
- )));
- }
-
- public function testAddsToPath()
- {
- // Does nothing here
- $url = Url::fromString('http://e.com/base?a=1');
- $url->addPath(false);
- $this->assertEquals('http://e.com/base?a=1', $url);
- $url = Url::fromString('http://e.com/base?a=1');
- $url->addPath('');
- $this->assertEquals('http://e.com/base?a=1', $url);
- $url = Url::fromString('http://e.com/base?a=1');
- $url->addPath('/');
- $this->assertEquals('http://e.com/base?a=1', $url);
- $url = Url::fromString('http://e.com/base');
- $url->addPath('0');
- $this->assertEquals('http://e.com/base/0', $url);
-
- $url = Url::fromString('http://e.com/base?a=1');
- $url->addPath('relative');
- $this->assertEquals('http://e.com/base/relative?a=1', $url);
- $url = Url::fromString('http://e.com/base?a=1');
- $url->addPath('/relative');
- $this->assertEquals('http://e.com/base/relative?a=1', $url);
- }
-
- /**
- * URL combination data provider
- *
- * @return array
- */
- public function urlCombineDataProvider()
- {
- return [
- // Specific test cases
- ['http://www.example.com/', 'http://www.example.com/', 'http://www.example.com/'],
- ['http://www.example.com/path', '/absolute', 'http://www.example.com/absolute'],
- ['http://www.example.com/path', '/absolute?q=2', 'http://www.example.com/absolute?q=2'],
- ['http://www.example.com/', '?q=1', 'http://www.example.com/?q=1'],
- ['http://www.example.com/path', 'http://test.com', 'http://test.com'],
- ['http://www.example.com:8080/path', 'http://test.com', 'http://test.com'],
- ['http://www.example.com:8080/path', '?q=2#abc', 'http://www.example.com:8080/path?q=2#abc'],
- ['http://www.example.com/path', 'http://u:a@www.example.com/', 'http://u:a@www.example.com/'],
- ['/path?q=2', 'http://www.test.com/', 'http://www.test.com/path?q=2'],
- ['http://api.flickr.com/services/', 'http://www.flickr.com/services/oauth/access_token', 'http://www.flickr.com/services/oauth/access_token'],
- ['https://www.example.com/path', '//foo.com/abc', 'https://foo.com/abc'],
- ['https://www.example.com/0/', 'relative/foo', 'https://www.example.com/0/relative/foo'],
- ['', '0', '0'],
- // RFC 3986 test cases
- [self::RFC3986_BASE, 'g:h', 'g:h'],
- [self::RFC3986_BASE, 'g', 'http://a/b/c/g'],
- [self::RFC3986_BASE, './g', 'http://a/b/c/g'],
- [self::RFC3986_BASE, 'g/', 'http://a/b/c/g/'],
- [self::RFC3986_BASE, '/g', 'http://a/g'],
- [self::RFC3986_BASE, '//g', 'http://g'],
- [self::RFC3986_BASE, '?y', 'http://a/b/c/d;p?y'],
- [self::RFC3986_BASE, 'g?y', 'http://a/b/c/g?y'],
- [self::RFC3986_BASE, '#s', 'http://a/b/c/d;p?q#s'],
- [self::RFC3986_BASE, 'g#s', 'http://a/b/c/g#s'],
- [self::RFC3986_BASE, 'g?y#s', 'http://a/b/c/g?y#s'],
- [self::RFC3986_BASE, ';x', 'http://a/b/c/;x'],
- [self::RFC3986_BASE, 'g;x', 'http://a/b/c/g;x'],
- [self::RFC3986_BASE, 'g;x?y#s', 'http://a/b/c/g;x?y#s'],
- [self::RFC3986_BASE, '', self::RFC3986_BASE],
- [self::RFC3986_BASE, '.', 'http://a/b/c/'],
- [self::RFC3986_BASE, './', 'http://a/b/c/'],
- [self::RFC3986_BASE, '..', 'http://a/b/'],
- [self::RFC3986_BASE, '../', 'http://a/b/'],
- [self::RFC3986_BASE, '../g', 'http://a/b/g'],
- [self::RFC3986_BASE, '../..', 'http://a/'],
- [self::RFC3986_BASE, '../../', 'http://a/'],
- [self::RFC3986_BASE, '../../g', 'http://a/g'],
- [self::RFC3986_BASE, '../../../g', 'http://a/g'],
- [self::RFC3986_BASE, '../../../../g', 'http://a/g'],
- [self::RFC3986_BASE, '/./g', 'http://a/g'],
- [self::RFC3986_BASE, '/../g', 'http://a/g'],
- [self::RFC3986_BASE, 'g.', 'http://a/b/c/g.'],
- [self::RFC3986_BASE, '.g', 'http://a/b/c/.g'],
- [self::RFC3986_BASE, 'g..', 'http://a/b/c/g..'],
- [self::RFC3986_BASE, '..g', 'http://a/b/c/..g'],
- [self::RFC3986_BASE, './../g', 'http://a/b/g'],
- [self::RFC3986_BASE, 'foo////g', 'http://a/b/c/foo////g'],
- [self::RFC3986_BASE, './g/.', 'http://a/b/c/g/'],
- [self::RFC3986_BASE, 'g/./h', 'http://a/b/c/g/h'],
- [self::RFC3986_BASE, 'g/../h', 'http://a/b/c/h'],
- [self::RFC3986_BASE, 'g;x=1/./y', 'http://a/b/c/g;x=1/y'],
- [self::RFC3986_BASE, 'g;x=1/../y', 'http://a/b/c/y'],
- [self::RFC3986_BASE, 'http:g', 'http:g'],
- ];
- }
-
- /**
- * @dataProvider urlCombineDataProvider
- */
- public function testCombinesUrls($a, $b, $c)
- {
- $this->assertEquals($c, (string) Url::fromString($a)->combine($b));
- }
-
- public function testHasGettersAndSetters()
- {
- $url = Url::fromString('http://www.test.com/');
- $url->setHost('example.com');
- $this->assertEquals('example.com', $url->getHost());
- $url->setPort(8080);
- $this->assertEquals('8080', $url->getPort());
- $url->setPath('/foo/bar');
- $this->assertEquals('/foo/bar', $url->getPath());
- $url->setPassword('a');
- $this->assertEquals('a', $url->getPassword());
- $url->setUsername('b');
- $this->assertEquals('b', $url->getUsername());
- $url->setFragment('abc');
- $this->assertEquals('abc', $url->getFragment());
- $url->setScheme('https');
- $this->assertEquals('https', $url->getScheme());
- $url->setQuery('a=123');
- $this->assertEquals('a=123', (string) $url->getQuery());
- $this->assertEquals(
- 'https://b:a@example.com:8080/foo/bar?a=123#abc',
- (string) $url
- );
- $url->setQuery(new Query(['b' => 'boo']));
- $this->assertEquals('b=boo', $url->getQuery());
- $this->assertEquals(
- 'https://b:a@example.com:8080/foo/bar?b=boo#abc',
- (string) $url
- );
-
- $url->setQuery('a%20=bar!', true);
- $this->assertEquals(
- 'https://b:a@example.com:8080/foo/bar?a%20=bar!#abc',
- (string) $url
- );
- }
-
- public function testSetQueryAcceptsArray()
- {
- $url = Url::fromString('http://www.test.com');
- $url->setQuery(array('a' => 'b'));
- $this->assertEquals('http://www.test.com?a=b', (string) $url);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testQueryMustBeValid()
- {
- $url = Url::fromString('http://www.test.com');
- $url->setQuery(false);
- }
-
- public function testDefersParsingAndEncodingQueryUntilNecessary()
- {
- $url = Url::fromString('http://www.test.com');
- // Note that invalid characters are encoded.
- $url->setQuery('foo#bar/', true);
- $this->assertEquals('http://www.test.com?foo%23bar/', (string) $url);
- $this->assertInternalType('string', $this->readAttribute($url, 'query'));
- $this->assertEquals('foo%23bar%2F', (string) $url->getQuery());
- $this->assertInstanceOf('GuzzleHttp\Query', $this->readAttribute($url, 'query'));
- }
-
- public function urlProvider()
- {
- return array(
- array('/foo/..', '/'),
- array('//foo//..', '//foo/'),
- array('/foo//', '/foo//'),
- array('/foo/../..', '/'),
- array('/foo/../.', '/'),
- array('/./foo/..', '/'),
- array('/./foo', '/foo'),
- array('/./foo/', '/foo/'),
- array('*', '*'),
- array('/foo', '/foo'),
- array('/abc/123/../foo/', '/abc/foo/'),
- array('/a/b/c/./../../g', '/a/g'),
- array('/b/c/./../../g', '/g'),
- array('/b/c/./../../g', '/g'),
- array('/c/./../../g', '/g'),
- array('/./../../g', '/g'),
- array('foo', 'foo'),
- );
- }
-
- /**
- * @dataProvider urlProvider
- */
- public function testRemoveDotSegments($path, $result)
- {
- $url = Url::fromString('http://www.example.com');
- $url->setPath($path);
- $url->removeDotSegments();
- $this->assertEquals($result, $url->getPath());
- }
-
- public function testSettingHostWithPortModifiesPort()
- {
- $url = Url::fromString('http://www.example.com');
- $url->setHost('foo:8983');
- $this->assertEquals('foo', $url->getHost());
- $this->assertEquals(8983, $url->getPort());
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesUrlCanBeParsed()
- {
- Url::fromString('foo:////');
- }
-
- public function testConvertsSpecialCharsInPathWhenCastingToString()
- {
- $url = Url::fromString('http://foo.com/baz bar?a=b');
- $url->addPath('?');
- $this->assertEquals('http://foo.com/baz%20bar/%3F?a=b', (string) $url);
- }
-
- public function testCorrectlyEncodesPathWithoutDoubleEncoding()
- {
- $url = Url::fromString('http://foo.com/baz%20 bar:boo/baz!');
- $this->assertEquals('/baz%20%20bar:boo/baz!', $url->getPath());
- }
-
- public function testLowercaseScheme()
- {
- $url = Url::fromString('HTTP://foo.com/');
- $this->assertEquals('http', $url->getScheme());
- $url->setScheme('HTTPS');
- $this->assertEquals('https', $url->getScheme());
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/UtilsTest.php b/lib/gerencianet/guzzlehttp/guzzle/tests/UtilsTest.php
deleted file mode 100644
index 10bdc54..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/UtilsTest.php
+++ /dev/null
@@ -1,40 +0,0 @@
-assertEquals(
- 'foo/123',
- Utils::uriTemplate('foo/{bar}', ['bar' => '123'])
- );
- }
-
- public function noBodyProvider()
- {
- return [['get'], ['head'], ['delete']];
- }
-
- public function testJsonDecodes()
- {
- $this->assertTrue(Utils::jsonDecode('true'));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Unable to parse JSON data: JSON_ERROR_SYNTAX - Syntax error, malformed JSON
- */
- public function testJsonDecodesWithErrorMessages()
- {
- Utils::jsonDecode('!narf!');
- }
-
- public function testProvidesDefaultUserAgent()
- {
- $ua = Utils::getDefaultUserAgent();
- $this->assertEquals(1, preg_match('#^Guzzle/.+ curl/.+ PHP/.+$#', $ua));
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/tests/bootstrap.php b/lib/gerencianet/guzzlehttp/guzzle/tests/bootstrap.php
deleted file mode 100644
index 8713f96..0000000
--- a/lib/gerencianet/guzzlehttp/guzzle/tests/bootstrap.php
+++ /dev/null
@@ -1,11 +0,0 @@
- Server::$url]);
-
-$t = microtime(true);
-for ($i = 0; $i < $total; $i++) {
- $client->get('/guzzle-server/perf');
-}
-$totalTime = microtime(true) - $t;
-$perRequest = ($totalTime / $total) * 1000;
-printf("Serial: %f (%f ms / request) %d total\n",
- $totalTime, $perRequest, $total);
-
-// Create a generator used to yield batches of requests
-$reqs = function () use ($client, $total) {
- for ($i = 0; $i < $total; $i++) {
- yield $client->createRequest('GET', '/guzzle-server/perf');
- }
-};
-
-$t = microtime(true);
-Pool::send($client, $reqs(), ['parallel' => $parallel]);
-$totalTime = microtime(true) - $t;
-$perRequest = ($totalTime / $total) * 1000;
-printf("Batch: %f (%f ms / request) %d total with %d in parallel\n",
- $totalTime, $perRequest, $total, $parallel);
-
-$handler = new CurlMultiHandler(['max_handles' => $parallel]);
-$client = new Client(['handler' => $handler, 'base_url' => Server::$url]);
-$t = microtime(true);
-for ($i = 0; $i < $total; $i++) {
- $client->get('/guzzle-server/perf');
-}
-unset($client);
-$totalTime = microtime(true) - $t;
-$perRequest = ($totalTime / $total) * 1000;
-printf("Future: %f (%f ms / request) %d total\n",
- $totalTime, $perRequest, $total);
diff --git a/lib/gerencianet/guzzlehttp/guzzle/vendor-bin/php-cs-fixer/composer.json b/lib/gerencianet/guzzlehttp/guzzle/vendor-bin/php-cs-fixer/composer.json
new file mode 100644
index 0000000..3adf5f5
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/vendor-bin/php-cs-fixer/composer.json
@@ -0,0 +1,9 @@
+{
+ "require": {
+ "php": "^7.2.5 || ^8.0",
+ "friendsofphp/php-cs-fixer": "2.18.3"
+ },
+ "config": {
+ "preferred-install": "dist"
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/vendor-bin/phpstan/composer.json b/lib/gerencianet/guzzlehttp/guzzle/vendor-bin/phpstan/composer.json
new file mode 100644
index 0000000..bfbc727
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/vendor-bin/phpstan/composer.json
@@ -0,0 +1,10 @@
+{
+ "require": {
+ "php": "^7.2.5 || ^8.0",
+ "phpstan/phpstan": "0.12.81",
+ "phpstan/phpstan-deprecation-rules": "0.12.6"
+ },
+ "config": {
+ "preferred-install": "dist"
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/guzzle/vendor-bin/psalm/composer.json b/lib/gerencianet/guzzlehttp/guzzle/vendor-bin/psalm/composer.json
new file mode 100644
index 0000000..535a079
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/guzzle/vendor-bin/psalm/composer.json
@@ -0,0 +1,9 @@
+{
+ "require": {
+ "php": "^7.2.5 || ^8.0",
+ "psalm/phar": "4.6.2"
+ },
+ "config": {
+ "preferred-install": "dist"
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/promises/CHANGELOG.md b/lib/gerencianet/guzzlehttp/promises/CHANGELOG.md
new file mode 100644
index 0000000..14796c4
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/CHANGELOG.md
@@ -0,0 +1,84 @@
+# CHANGELOG
+
+## 1.4.1 - 2021-02-18
+
+- Fixed `each_limit` skipping promises and failing
+
+## 1.4.0 - 2020-09-30
+
+### Added
+
+- Support for PHP 8
+- Optional `$recursive` flag to `all`
+- Replaced functions by static methods
+
+### Fixed
+
+- Fix empty `each` processing
+- Fix promise handling for Iterators of non-unique keys
+- Fixed `method_exists` crashes on PHP 8
+- Memory leak on exceptions
+
+
+## 1.3.1 - 2016-12-20
+
+### Fixed
+
+- `wait()` foreign promise compatibility
+
+
+## 1.3.0 - 2016-11-18
+
+### Added
+
+- Adds support for custom task queues.
+
+### Fixed
+
+- Fixed coroutine promise memory leak.
+
+
+## 1.2.0 - 2016-05-18
+
+### Changed
+
+- Update to now catch `\Throwable` on PHP 7+
+
+
+## 1.1.0 - 2016-03-07
+
+### Changed
+
+- Update EachPromise to prevent recurring on a iterator when advancing, as this
+ could trigger fatal generator errors.
+- Update Promise to allow recursive waiting without unwrapping exceptions.
+
+
+## 1.0.3 - 2015-10-15
+
+### Changed
+
+- Update EachPromise to immediately resolve when the underlying promise iterator
+ is empty. Previously, such a promise would throw an exception when its `wait`
+ function was called.
+
+
+## 1.0.2 - 2015-05-15
+
+### Changed
+
+- Conditionally require functions.php.
+
+
+## 1.0.1 - 2015-06-24
+
+### Changed
+
+- Updating EachPromise to call next on the underlying promise iterator as late
+ as possible to ensure that generators that generate new requests based on
+ callbacks are not iterated until after callbacks are invoked.
+
+
+## 1.0.0 - 2015-05-12
+
+- Initial release
diff --git a/lib/gerencianet/guzzlehttp/promises/LICENSE b/lib/gerencianet/guzzlehttp/promises/LICENSE
new file mode 100644
index 0000000..67f91a1
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2015-2016 Michael Dowling, https://github.com/mtdowling
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/lib/gerencianet/guzzlehttp/promises/Makefile b/lib/gerencianet/guzzlehttp/promises/Makefile
new file mode 100644
index 0000000..8d5b3ef
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/Makefile
@@ -0,0 +1,13 @@
+all: clean test
+
+test:
+ vendor/bin/phpunit
+
+coverage:
+ vendor/bin/phpunit --coverage-html=artifacts/coverage
+
+view-coverage:
+ open artifacts/coverage/index.html
+
+clean:
+ rm -rf artifacts/*
diff --git a/lib/gerencianet/guzzlehttp/promises/README.md b/lib/gerencianet/guzzlehttp/promises/README.md
new file mode 100644
index 0000000..a95c605
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/README.md
@@ -0,0 +1,532 @@
+# Guzzle Promises
+
+[Promises/A+](https://promisesaplus.com/) implementation that handles promise
+chaining and resolution iteratively, allowing for "infinite" promise chaining
+while keeping the stack size constant. Read [this blog post](https://blog.domenic.me/youre-missing-the-point-of-promises/)
+for a general introduction to promises.
+
+- [Features](#features)
+- [Quick start](#quick-start)
+- [Synchronous wait](#synchronous-wait)
+- [Cancellation](#cancellation)
+- [API](#api)
+ - [Promise](#promise)
+ - [FulfilledPromise](#fulfilledpromise)
+ - [RejectedPromise](#rejectedpromise)
+- [Promise interop](#promise-interop)
+- [Implementation notes](#implementation-notes)
+
+
+# Features
+
+- [Promises/A+](https://promisesaplus.com/) implementation.
+- Promise resolution and chaining is handled iteratively, allowing for
+ "infinite" promise chaining.
+- Promises have a synchronous `wait` method.
+- Promises can be cancelled.
+- Works with any object that has a `then` function.
+- C# style async/await coroutine promises using
+ `GuzzleHttp\Promise\Coroutine::of()`.
+
+
+# Quick start
+
+A *promise* represents the eventual result of an asynchronous operation. The
+primary way of interacting with a promise is through its `then` method, which
+registers callbacks to receive either a promise's eventual value or the reason
+why the promise cannot be fulfilled.
+
+
+## Callbacks
+
+Callbacks are registered with the `then` method by providing an optional
+`$onFulfilled` followed by an optional `$onRejected` function.
+
+
+```php
+use GuzzleHttp\Promise\Promise;
+
+$promise = new Promise();
+$promise->then(
+ // $onFulfilled
+ function ($value) {
+ echo 'The promise was fulfilled.';
+ },
+ // $onRejected
+ function ($reason) {
+ echo 'The promise was rejected.';
+ }
+);
+```
+
+*Resolving* a promise means that you either fulfill a promise with a *value* or
+reject a promise with a *reason*. Resolving a promises triggers callbacks
+registered with the promises's `then` method. These callbacks are triggered
+only once and in the order in which they were added.
+
+
+## Resolving a promise
+
+Promises are fulfilled using the `resolve($value)` method. Resolving a promise
+with any value other than a `GuzzleHttp\Promise\RejectedPromise` will trigger
+all of the onFulfilled callbacks (resolving a promise with a rejected promise
+will reject the promise and trigger the `$onRejected` callbacks).
+
+```php
+use GuzzleHttp\Promise\Promise;
+
+$promise = new Promise();
+$promise
+ ->then(function ($value) {
+ // Return a value and don't break the chain
+ return "Hello, " . $value;
+ })
+ // This then is executed after the first then and receives the value
+ // returned from the first then.
+ ->then(function ($value) {
+ echo $value;
+ });
+
+// Resolving the promise triggers the $onFulfilled callbacks and outputs
+// "Hello, reader."
+$promise->resolve('reader.');
+```
+
+
+## Promise forwarding
+
+Promises can be chained one after the other. Each then in the chain is a new
+promise. The return value of a promise is what's forwarded to the next
+promise in the chain. Returning a promise in a `then` callback will cause the
+subsequent promises in the chain to only be fulfilled when the returned promise
+has been fulfilled. The next promise in the chain will be invoked with the
+resolved value of the promise.
+
+```php
+use GuzzleHttp\Promise\Promise;
+
+$promise = new Promise();
+$nextPromise = new Promise();
+
+$promise
+ ->then(function ($value) use ($nextPromise) {
+ echo $value;
+ return $nextPromise;
+ })
+ ->then(function ($value) {
+ echo $value;
+ });
+
+// Triggers the first callback and outputs "A"
+$promise->resolve('A');
+// Triggers the second callback and outputs "B"
+$nextPromise->resolve('B');
+```
+
+## Promise rejection
+
+When a promise is rejected, the `$onRejected` callbacks are invoked with the
+rejection reason.
+
+```php
+use GuzzleHttp\Promise\Promise;
+
+$promise = new Promise();
+$promise->then(null, function ($reason) {
+ echo $reason;
+});
+
+$promise->reject('Error!');
+// Outputs "Error!"
+```
+
+## Rejection forwarding
+
+If an exception is thrown in an `$onRejected` callback, subsequent
+`$onRejected` callbacks are invoked with the thrown exception as the reason.
+
+```php
+use GuzzleHttp\Promise\Promise;
+
+$promise = new Promise();
+$promise->then(null, function ($reason) {
+ throw new Exception($reason);
+})->then(null, function ($reason) {
+ assert($reason->getMessage() === 'Error!');
+});
+
+$promise->reject('Error!');
+```
+
+You can also forward a rejection down the promise chain by returning a
+`GuzzleHttp\Promise\RejectedPromise` in either an `$onFulfilled` or
+`$onRejected` callback.
+
+```php
+use GuzzleHttp\Promise\Promise;
+use GuzzleHttp\Promise\RejectedPromise;
+
+$promise = new Promise();
+$promise->then(null, function ($reason) {
+ return new RejectedPromise($reason);
+})->then(null, function ($reason) {
+ assert($reason === 'Error!');
+});
+
+$promise->reject('Error!');
+```
+
+If an exception is not thrown in a `$onRejected` callback and the callback
+does not return a rejected promise, downstream `$onFulfilled` callbacks are
+invoked using the value returned from the `$onRejected` callback.
+
+```php
+use GuzzleHttp\Promise\Promise;
+
+$promise = new Promise();
+$promise
+ ->then(null, function ($reason) {
+ return "It's ok";
+ })
+ ->then(function ($value) {
+ assert($value === "It's ok");
+ });
+
+$promise->reject('Error!');
+```
+
+# Synchronous wait
+
+You can synchronously force promises to complete using a promise's `wait`
+method. When creating a promise, you can provide a wait function that is used
+to synchronously force a promise to complete. When a wait function is invoked
+it is expected to deliver a value to the promise or reject the promise. If the
+wait function does not deliver a value, then an exception is thrown. The wait
+function provided to a promise constructor is invoked when the `wait` function
+of the promise is called.
+
+```php
+$promise = new Promise(function () use (&$promise) {
+ $promise->resolve('foo');
+});
+
+// Calling wait will return the value of the promise.
+echo $promise->wait(); // outputs "foo"
+```
+
+If an exception is encountered while invoking the wait function of a promise,
+the promise is rejected with the exception and the exception is thrown.
+
+```php
+$promise = new Promise(function () use (&$promise) {
+ throw new Exception('foo');
+});
+
+$promise->wait(); // throws the exception.
+```
+
+Calling `wait` on a promise that has been fulfilled will not trigger the wait
+function. It will simply return the previously resolved value.
+
+```php
+$promise = new Promise(function () { die('this is not called!'); });
+$promise->resolve('foo');
+echo $promise->wait(); // outputs "foo"
+```
+
+Calling `wait` on a promise that has been rejected will throw an exception. If
+the rejection reason is an instance of `\Exception` the reason is thrown.
+Otherwise, a `GuzzleHttp\Promise\RejectionException` is thrown and the reason
+can be obtained by calling the `getReason` method of the exception.
+
+```php
+$promise = new Promise();
+$promise->reject('foo');
+$promise->wait();
+```
+
+> PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo'
+
+
+## Unwrapping a promise
+
+When synchronously waiting on a promise, you are joining the state of the
+promise into the current state of execution (i.e., return the value of the
+promise if it was fulfilled or throw an exception if it was rejected). This is
+called "unwrapping" the promise. Waiting on a promise will by default unwrap
+the promise state.
+
+You can force a promise to resolve and *not* unwrap the state of the promise
+by passing `false` to the first argument of the `wait` function:
+
+```php
+$promise = new Promise();
+$promise->reject('foo');
+// This will not throw an exception. It simply ensures the promise has
+// been resolved.
+$promise->wait(false);
+```
+
+When unwrapping a promise, the resolved value of the promise will be waited
+upon until the unwrapped value is not a promise. This means that if you resolve
+promise A with a promise B and unwrap promise A, the value returned by the
+wait function will be the value delivered to promise B.
+
+**Note**: when you do not unwrap the promise, no value is returned.
+
+
+# Cancellation
+
+You can cancel a promise that has not yet been fulfilled using the `cancel()`
+method of a promise. When creating a promise you can provide an optional
+cancel function that when invoked cancels the action of computing a resolution
+of the promise.
+
+
+# API
+
+
+## Promise
+
+When creating a promise object, you can provide an optional `$waitFn` and
+`$cancelFn`. `$waitFn` is a function that is invoked with no arguments and is
+expected to resolve the promise. `$cancelFn` is a function with no arguments
+that is expected to cancel the computation of a promise. It is invoked when the
+`cancel()` method of a promise is called.
+
+```php
+use GuzzleHttp\Promise\Promise;
+
+$promise = new Promise(
+ function () use (&$promise) {
+ $promise->resolve('waited');
+ },
+ function () {
+ // do something that will cancel the promise computation (e.g., close
+ // a socket, cancel a database query, etc...)
+ }
+);
+
+assert('waited' === $promise->wait());
+```
+
+A promise has the following methods:
+
+- `then(callable $onFulfilled, callable $onRejected) : PromiseInterface`
+
+ Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler.
+
+- `otherwise(callable $onRejected) : PromiseInterface`
+
+ Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled.
+
+- `wait($unwrap = true) : mixed`
+
+ Synchronously waits on the promise to complete.
+
+ `$unwrap` controls whether or not the value of the promise is returned for a
+ fulfilled promise or if an exception is thrown if the promise is rejected.
+ This is set to `true` by default.
+
+- `cancel()`
+
+ Attempts to cancel the promise if possible. The promise being cancelled and
+ the parent most ancestor that has not yet been resolved will also be
+ cancelled. Any promises waiting on the cancelled promise to resolve will also
+ be cancelled.
+
+- `getState() : string`
+
+ Returns the state of the promise. One of `pending`, `fulfilled`, or
+ `rejected`.
+
+- `resolve($value)`
+
+ Fulfills the promise with the given `$value`.
+
+- `reject($reason)`
+
+ Rejects the promise with the given `$reason`.
+
+
+## FulfilledPromise
+
+A fulfilled promise can be created to represent a promise that has been
+fulfilled.
+
+```php
+use GuzzleHttp\Promise\FulfilledPromise;
+
+$promise = new FulfilledPromise('value');
+
+// Fulfilled callbacks are immediately invoked.
+$promise->then(function ($value) {
+ echo $value;
+});
+```
+
+
+## RejectedPromise
+
+A rejected promise can be created to represent a promise that has been
+rejected.
+
+```php
+use GuzzleHttp\Promise\RejectedPromise;
+
+$promise = new RejectedPromise('Error');
+
+// Rejected callbacks are immediately invoked.
+$promise->then(null, function ($reason) {
+ echo $reason;
+});
+```
+
+
+# Promise interop
+
+This library works with foreign promises that have a `then` method. This means
+you can use Guzzle promises with [React promises](https://github.com/reactphp/promise)
+for example. When a foreign promise is returned inside of a then method
+callback, promise resolution will occur recursively.
+
+```php
+// Create a React promise
+$deferred = new React\Promise\Deferred();
+$reactPromise = $deferred->promise();
+
+// Create a Guzzle promise that is fulfilled with a React promise.
+$guzzlePromise = new GuzzleHttp\Promise\Promise();
+$guzzlePromise->then(function ($value) use ($reactPromise) {
+ // Do something something with the value...
+ // Return the React promise
+ return $reactPromise;
+});
+```
+
+Please note that wait and cancel chaining is no longer possible when forwarding
+a foreign promise. You will need to wrap a third-party promise with a Guzzle
+promise in order to utilize wait and cancel functions with foreign promises.
+
+
+## Event Loop Integration
+
+In order to keep the stack size constant, Guzzle promises are resolved
+asynchronously using a task queue. When waiting on promises synchronously, the
+task queue will be automatically run to ensure that the blocking promise and
+any forwarded promises are resolved. When using promises asynchronously in an
+event loop, you will need to run the task queue on each tick of the loop. If
+you do not run the task queue, then promises will not be resolved.
+
+You can run the task queue using the `run()` method of the global task queue
+instance.
+
+```php
+// Get the global task queue
+$queue = GuzzleHttp\Promise\Utils::queue();
+$queue->run();
+```
+
+For example, you could use Guzzle promises with React using a periodic timer:
+
+```php
+$loop = React\EventLoop\Factory::create();
+$loop->addPeriodicTimer(0, [$queue, 'run']);
+```
+
+*TODO*: Perhaps adding a `futureTick()` on each tick would be faster?
+
+
+# Implementation notes
+
+
+## Promise resolution and chaining is handled iteratively
+
+By shuffling pending handlers from one owner to another, promises are
+resolved iteratively, allowing for "infinite" then chaining.
+
+```php
+then(function ($v) {
+ // The stack size remains constant (a good thing)
+ echo xdebug_get_stack_depth() . ', ';
+ return $v + 1;
+ });
+}
+
+$parent->resolve(0);
+var_dump($p->wait()); // int(1000)
+
+```
+
+When a promise is fulfilled or rejected with a non-promise value, the promise
+then takes ownership of the handlers of each child promise and delivers values
+down the chain without using recursion.
+
+When a promise is resolved with another promise, the original promise transfers
+all of its pending handlers to the new promise. When the new promise is
+eventually resolved, all of the pending handlers are delivered the forwarded
+value.
+
+
+## A promise is the deferred.
+
+Some promise libraries implement promises using a deferred object to represent
+a computation and a promise object to represent the delivery of the result of
+the computation. This is a nice separation of computation and delivery because
+consumers of the promise cannot modify the value that will be eventually
+delivered.
+
+One side effect of being able to implement promise resolution and chaining
+iteratively is that you need to be able for one promise to reach into the state
+of another promise to shuffle around ownership of handlers. In order to achieve
+this without making the handlers of a promise publicly mutable, a promise is
+also the deferred value, allowing promises of the same parent class to reach
+into and modify the private properties of promises of the same type. While this
+does allow consumers of the value to modify the resolution or rejection of the
+deferred, it is a small price to pay for keeping the stack size constant.
+
+```php
+$promise = new Promise();
+$promise->then(function ($value) { echo $value; });
+// The promise is the deferred value, so you can deliver a value to it.
+$promise->resolve('foo');
+// prints "foo"
+```
+
+
+## Upgrading from Function API
+
+A static API was first introduced in 1.4.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API will be removed in 2.0.0. A migration table has been provided here for your convenience:
+
+| Original Function | Replacement Method |
+|----------------|----------------|
+| `queue` | `Utils::queue` |
+| `task` | `Utils::task` |
+| `promise_for` | `Create::promiseFor` |
+| `rejection_for` | `Create::rejectionFor` |
+| `exception_for` | `Create::exceptionFor` |
+| `iter_for` | `Create::iterFor` |
+| `inspect` | `Utils::inspect` |
+| `inspect_all` | `Utils::inspectAll` |
+| `unwrap` | `Utils::unwrap` |
+| `all` | `Utils::all` |
+| `some` | `Utils::some` |
+| `any` | `Utils::any` |
+| `settle` | `Utils::settle` |
+| `each` | `Each::of` |
+| `each_limit` | `Each::ofLimit` |
+| `each_limit_all` | `Each::ofLimitAll` |
+| `!is_fulfilled` | `Is::pending` |
+| `is_fulfilled` | `Is::fulfilled` |
+| `is_rejected` | `Is::rejected` |
+| `is_settled` | `Is::settled` |
+| `coroutine` | `Coroutine::of` |
diff --git a/lib/gerencianet/guzzlehttp/promises/composer.json b/lib/gerencianet/guzzlehttp/promises/composer.json
new file mode 100644
index 0000000..db44d9e
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/composer.json
@@ -0,0 +1,39 @@
+{
+ "name": "guzzlehttp/promises",
+ "description": "Guzzle promises library",
+ "keywords": ["promise"],
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+ "require": {
+ "php": ">=5.5"
+ },
+ "require-dev": {
+ "symfony/phpunit-bridge": "^4.4 || ^5.1"
+ },
+ "autoload": {
+ "psr-4": {
+ "GuzzleHttp\\Promise\\": "src/"
+ },
+ "files": ["src/functions_include.php"]
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "GuzzleHttp\\Promise\\Tests\\": "tests/"
+ }
+ },
+ "scripts": {
+ "test": "vendor/bin/simple-phpunit",
+ "test-ci": "vendor/bin/simple-phpunit --coverage-text"
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4-dev"
+ }
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/promises/src/AggregateException.php b/lib/gerencianet/guzzlehttp/promises/src/AggregateException.php
new file mode 100644
index 0000000..d2b5712
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/src/AggregateException.php
@@ -0,0 +1,17 @@
+then(function ($v) { echo $v; });
+ *
+ * @param callable $generatorFn Generator function to wrap into a promise.
+ *
+ * @return Promise
+ *
+ * @link https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration
+ */
+final class Coroutine implements PromiseInterface
+{
+ /**
+ * @var PromiseInterface|null
+ */
+ private $currentPromise;
+
+ /**
+ * @var Generator
+ */
+ private $generator;
+
+ /**
+ * @var Promise
+ */
+ private $result;
+
+ public function __construct(callable $generatorFn)
+ {
+ $this->generator = $generatorFn();
+ $this->result = new Promise(function () {
+ while (isset($this->currentPromise)) {
+ $this->currentPromise->wait();
+ }
+ });
+ try {
+ $this->nextCoroutine($this->generator->current());
+ } catch (\Exception $exception) {
+ $this->result->reject($exception);
+ } catch (Throwable $throwable) {
+ $this->result->reject($throwable);
+ }
+ }
+
+ /**
+ * Create a new coroutine.
+ *
+ * @return self
+ */
+ public static function of(callable $generatorFn)
+ {
+ return new self($generatorFn);
+ }
+
+ public function then(
+ callable $onFulfilled = null,
+ callable $onRejected = null
+ ) {
+ return $this->result->then($onFulfilled, $onRejected);
+ }
+
+ public function otherwise(callable $onRejected)
+ {
+ return $this->result->otherwise($onRejected);
+ }
+
+ public function wait($unwrap = true)
+ {
+ return $this->result->wait($unwrap);
+ }
+
+ public function getState()
+ {
+ return $this->result->getState();
+ }
+
+ public function resolve($value)
+ {
+ $this->result->resolve($value);
+ }
+
+ public function reject($reason)
+ {
+ $this->result->reject($reason);
+ }
+
+ public function cancel()
+ {
+ $this->currentPromise->cancel();
+ $this->result->cancel();
+ }
+
+ private function nextCoroutine($yielded)
+ {
+ $this->currentPromise = Create::promiseFor($yielded)
+ ->then([$this, '_handleSuccess'], [$this, '_handleFailure']);
+ }
+
+ /**
+ * @internal
+ */
+ public function _handleSuccess($value)
+ {
+ unset($this->currentPromise);
+ try {
+ $next = $this->generator->send($value);
+ if ($this->generator->valid()) {
+ $this->nextCoroutine($next);
+ } else {
+ $this->result->resolve($value);
+ }
+ } catch (Exception $exception) {
+ $this->result->reject($exception);
+ } catch (Throwable $throwable) {
+ $this->result->reject($throwable);
+ }
+ }
+
+ /**
+ * @internal
+ */
+ public function _handleFailure($reason)
+ {
+ unset($this->currentPromise);
+ try {
+ $nextYield = $this->generator->throw(Create::exceptionFor($reason));
+ // The throw was caught, so keep iterating on the coroutine
+ $this->nextCoroutine($nextYield);
+ } catch (Exception $exception) {
+ $this->result->reject($exception);
+ } catch (Throwable $throwable) {
+ $this->result->reject($throwable);
+ }
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/promises/src/Create.php b/lib/gerencianet/guzzlehttp/promises/src/Create.php
new file mode 100644
index 0000000..8d038e9
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/src/Create.php
@@ -0,0 +1,84 @@
+then([$promise, 'resolve'], [$promise, 'reject']);
+ return $promise;
+ }
+
+ return new FulfilledPromise($value);
+ }
+
+ /**
+ * Creates a rejected promise for a reason if the reason is not a promise.
+ * If the provided reason is a promise, then it is returned as-is.
+ *
+ * @param mixed $reason Promise or reason.
+ *
+ * @return PromiseInterface
+ */
+ public static function rejectionFor($reason)
+ {
+ if ($reason instanceof PromiseInterface) {
+ return $reason;
+ }
+
+ return new RejectedPromise($reason);
+ }
+
+ /**
+ * Create an exception for a rejected promise value.
+ *
+ * @param mixed $reason
+ *
+ * @return \Exception|\Throwable
+ */
+ public static function exceptionFor($reason)
+ {
+ if ($reason instanceof \Exception || $reason instanceof \Throwable) {
+ return $reason;
+ }
+
+ return new RejectionException($reason);
+ }
+
+ /**
+ * Returns an iterator for the given value.
+ *
+ * @param mixed $value
+ *
+ * @return \Iterator
+ */
+ public static function iterFor($value)
+ {
+ if ($value instanceof \Iterator) {
+ return $value;
+ }
+
+ if (is_array($value)) {
+ return new \ArrayIterator($value);
+ }
+
+ return new \ArrayIterator([$value]);
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/promises/src/Each.php b/lib/gerencianet/guzzlehttp/promises/src/Each.php
new file mode 100644
index 0000000..1dda354
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/src/Each.php
@@ -0,0 +1,90 @@
+ $onFulfilled,
+ 'rejected' => $onRejected
+ ]))->promise();
+ }
+
+ /**
+ * Like of, but only allows a certain number of outstanding promises at any
+ * given time.
+ *
+ * $concurrency may be an integer or a function that accepts the number of
+ * pending promises and returns a numeric concurrency limit value to allow
+ * for dynamic a concurrency size.
+ *
+ * @param mixed $iterable
+ * @param int|callable $concurrency
+ * @param callable $onFulfilled
+ * @param callable $onRejected
+ *
+ * @return PromiseInterface
+ */
+ public static function ofLimit(
+ $iterable,
+ $concurrency,
+ callable $onFulfilled = null,
+ callable $onRejected = null
+ ) {
+ return (new EachPromise($iterable, [
+ 'fulfilled' => $onFulfilled,
+ 'rejected' => $onRejected,
+ 'concurrency' => $concurrency
+ ]))->promise();
+ }
+
+ /**
+ * Like limit, but ensures that no promise in the given $iterable argument
+ * is rejected. If any promise is rejected, then the aggregate promise is
+ * rejected with the encountered rejection.
+ *
+ * @param mixed $iterable
+ * @param int|callable $concurrency
+ * @param callable $onFulfilled
+ *
+ * @return PromiseInterface
+ */
+ public static function ofLimitAll(
+ $iterable,
+ $concurrency,
+ callable $onFulfilled = null
+ ) {
+ return each_limit(
+ $iterable,
+ $concurrency,
+ $onFulfilled,
+ function ($reason, $idx, PromiseInterface $aggregate) {
+ $aggregate->reject($reason);
+ }
+ );
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/promises/src/EachPromise.php b/lib/gerencianet/guzzlehttp/promises/src/EachPromise.php
new file mode 100644
index 0000000..748f471
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/src/EachPromise.php
@@ -0,0 +1,254 @@
+iterable = Create::iterFor($iterable);
+
+ if (isset($config['concurrency'])) {
+ $this->concurrency = $config['concurrency'];
+ }
+
+ if (isset($config['fulfilled'])) {
+ $this->onFulfilled = $config['fulfilled'];
+ }
+
+ if (isset($config['rejected'])) {
+ $this->onRejected = $config['rejected'];
+ }
+ }
+
+ /** @psalm-suppress InvalidNullableReturnType */
+ public function promise()
+ {
+ if ($this->aggregate) {
+ return $this->aggregate;
+ }
+
+ try {
+ $this->createPromise();
+ /** @psalm-assert Promise $this->aggregate */
+ $this->iterable->rewind();
+ if (!$this->checkIfFinished()) {
+ $this->refillPending();
+ }
+ } catch (\Throwable $e) {
+ /**
+ * @psalm-suppress NullReference
+ * @phpstan-ignore-next-line
+ */
+ $this->aggregate->reject($e);
+ } catch (\Exception $e) {
+ /**
+ * @psalm-suppress NullReference
+ * @phpstan-ignore-next-line
+ */
+ $this->aggregate->reject($e);
+ }
+
+ /**
+ * @psalm-suppress NullableReturnStatement
+ * @phpstan-ignore-next-line
+ */
+ return $this->aggregate;
+ }
+
+ private function createPromise()
+ {
+ $this->mutex = false;
+ $this->aggregate = new Promise(function () {
+ reset($this->pending);
+ // Consume a potentially fluctuating list of promises while
+ // ensuring that indexes are maintained (precluding array_shift).
+ while ($promise = current($this->pending)) {
+ next($this->pending);
+ $promise->wait();
+ if (Is::settled($this->aggregate)) {
+ return;
+ }
+ }
+ });
+
+ // Clear the references when the promise is resolved.
+ $clearFn = function () {
+ $this->iterable = $this->concurrency = $this->pending = null;
+ $this->onFulfilled = $this->onRejected = null;
+ $this->nextPendingIndex = 0;
+ };
+
+ $this->aggregate->then($clearFn, $clearFn);
+ }
+
+ private function refillPending()
+ {
+ if (!$this->concurrency) {
+ // Add all pending promises.
+ while ($this->addPending() && $this->advanceIterator());
+ return;
+ }
+
+ // Add only up to N pending promises.
+ $concurrency = is_callable($this->concurrency)
+ ? call_user_func($this->concurrency, count($this->pending))
+ : $this->concurrency;
+ $concurrency = max($concurrency - count($this->pending), 0);
+ // Concurrency may be set to 0 to disallow new promises.
+ if (!$concurrency) {
+ return;
+ }
+ // Add the first pending promise.
+ $this->addPending();
+ // Note this is special handling for concurrency=1 so that we do
+ // not advance the iterator after adding the first promise. This
+ // helps work around issues with generators that might not have the
+ // next value to yield until promise callbacks are called.
+ while (--$concurrency
+ && $this->advanceIterator()
+ && $this->addPending());
+ }
+
+ private function addPending()
+ {
+ if (!$this->iterable || !$this->iterable->valid()) {
+ return false;
+ }
+
+ $promise = Create::promiseFor($this->iterable->current());
+ $key = $this->iterable->key();
+
+ // Iterable keys may not be unique, so we use a counter to
+ // guarantee uniqueness
+ $idx = $this->nextPendingIndex++;
+
+ $this->pending[$idx] = $promise->then(
+ function ($value) use ($idx, $key) {
+ if ($this->onFulfilled) {
+ call_user_func(
+ $this->onFulfilled,
+ $value,
+ $key,
+ $this->aggregate
+ );
+ }
+ $this->step($idx);
+ },
+ function ($reason) use ($idx, $key) {
+ if ($this->onRejected) {
+ call_user_func(
+ $this->onRejected,
+ $reason,
+ $key,
+ $this->aggregate
+ );
+ }
+ $this->step($idx);
+ }
+ );
+
+ return true;
+ }
+
+ private function advanceIterator()
+ {
+ // Place a lock on the iterator so that we ensure to not recurse,
+ // preventing fatal generator errors.
+ if ($this->mutex) {
+ return false;
+ }
+
+ $this->mutex = true;
+
+ try {
+ $this->iterable->next();
+ $this->mutex = false;
+ return true;
+ } catch (\Throwable $e) {
+ $this->aggregate->reject($e);
+ $this->mutex = false;
+ return false;
+ } catch (\Exception $e) {
+ $this->aggregate->reject($e);
+ $this->mutex = false;
+ return false;
+ }
+ }
+
+ private function step($idx)
+ {
+ // If the promise was already resolved, then ignore this step.
+ if (Is::settled($this->aggregate)) {
+ return;
+ }
+
+ unset($this->pending[$idx]);
+
+ // Only refill pending promises if we are not locked, preventing the
+ // EachPromise to recursively invoke the provided iterator, which
+ // cause a fatal error: "Cannot resume an already running generator"
+ if ($this->advanceIterator() && !$this->checkIfFinished()) {
+ // Add more pending promises if possible.
+ $this->refillPending();
+ }
+ }
+
+ private function checkIfFinished()
+ {
+ if (!$this->pending && !$this->iterable->valid()) {
+ // Resolve the promise if there's nothing left to do.
+ $this->aggregate->resolve(null);
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/promises/src/FulfilledPromise.php b/lib/gerencianet/guzzlehttp/promises/src/FulfilledPromise.php
new file mode 100644
index 0000000..98f72a6
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/src/FulfilledPromise.php
@@ -0,0 +1,84 @@
+value = $value;
+ }
+
+ public function then(
+ callable $onFulfilled = null,
+ callable $onRejected = null
+ ) {
+ // Return itself if there is no onFulfilled function.
+ if (!$onFulfilled) {
+ return $this;
+ }
+
+ $queue = Utils::queue();
+ $p = new Promise([$queue, 'run']);
+ $value = $this->value;
+ $queue->add(static function () use ($p, $value, $onFulfilled) {
+ if (Is::pending($p)) {
+ try {
+ $p->resolve($onFulfilled($value));
+ } catch (\Throwable $e) {
+ $p->reject($e);
+ } catch (\Exception $e) {
+ $p->reject($e);
+ }
+ }
+ });
+
+ return $p;
+ }
+
+ public function otherwise(callable $onRejected)
+ {
+ return $this->then(null, $onRejected);
+ }
+
+ public function wait($unwrap = true, $defaultDelivery = null)
+ {
+ return $unwrap ? $this->value : null;
+ }
+
+ public function getState()
+ {
+ return self::FULFILLED;
+ }
+
+ public function resolve($value)
+ {
+ if ($value !== $this->value) {
+ throw new \LogicException("Cannot resolve a fulfilled promise");
+ }
+ }
+
+ public function reject($reason)
+ {
+ throw new \LogicException("Cannot reject a fulfilled promise");
+ }
+
+ public function cancel()
+ {
+ // pass
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/promises/src/Is.php b/lib/gerencianet/guzzlehttp/promises/src/Is.php
new file mode 100644
index 0000000..c3ed8d0
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/src/Is.php
@@ -0,0 +1,46 @@
+getState() === PromiseInterface::PENDING;
+ }
+
+ /**
+ * Returns true if a promise is fulfilled or rejected.
+ *
+ * @return bool
+ */
+ public static function settled(PromiseInterface $promise)
+ {
+ return $promise->getState() !== PromiseInterface::PENDING;
+ }
+
+ /**
+ * Returns true if a promise is fulfilled.
+ *
+ * @return bool
+ */
+ public static function fulfilled(PromiseInterface $promise)
+ {
+ return $promise->getState() === PromiseInterface::FULFILLED;
+ }
+
+ /**
+ * Returns true if a promise is rejected.
+ *
+ * @return bool
+ */
+ public static function rejected(PromiseInterface $promise)
+ {
+ return $promise->getState() === PromiseInterface::REJECTED;
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/promises/src/Promise.php b/lib/gerencianet/guzzlehttp/promises/src/Promise.php
new file mode 100644
index 0000000..7593905
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/src/Promise.php
@@ -0,0 +1,278 @@
+waitFn = $waitFn;
+ $this->cancelFn = $cancelFn;
+ }
+
+ public function then(
+ callable $onFulfilled = null,
+ callable $onRejected = null
+ ) {
+ if ($this->state === self::PENDING) {
+ $p = new Promise(null, [$this, 'cancel']);
+ $this->handlers[] = [$p, $onFulfilled, $onRejected];
+ $p->waitList = $this->waitList;
+ $p->waitList[] = $this;
+ return $p;
+ }
+
+ // Return a fulfilled promise and immediately invoke any callbacks.
+ if ($this->state === self::FULFILLED) {
+ $promise = Create::promiseFor($this->result);
+ return $onFulfilled ? $promise->then($onFulfilled) : $promise;
+ }
+
+ // It's either cancelled or rejected, so return a rejected promise
+ // and immediately invoke any callbacks.
+ $rejection = Create::rejectionFor($this->result);
+ return $onRejected ? $rejection->then(null, $onRejected) : $rejection;
+ }
+
+ public function otherwise(callable $onRejected)
+ {
+ return $this->then(null, $onRejected);
+ }
+
+ public function wait($unwrap = true)
+ {
+ $this->waitIfPending();
+
+ if ($this->result instanceof PromiseInterface) {
+ return $this->result->wait($unwrap);
+ }
+ if ($unwrap) {
+ if ($this->state === self::FULFILLED) {
+ return $this->result;
+ }
+ // It's rejected so "unwrap" and throw an exception.
+ throw Create::exceptionFor($this->result);
+ }
+ }
+
+ public function getState()
+ {
+ return $this->state;
+ }
+
+ public function cancel()
+ {
+ if ($this->state !== self::PENDING) {
+ return;
+ }
+
+ $this->waitFn = $this->waitList = null;
+
+ if ($this->cancelFn) {
+ $fn = $this->cancelFn;
+ $this->cancelFn = null;
+ try {
+ $fn();
+ } catch (\Throwable $e) {
+ $this->reject($e);
+ } catch (\Exception $e) {
+ $this->reject($e);
+ }
+ }
+
+ // Reject the promise only if it wasn't rejected in a then callback.
+ /** @psalm-suppress RedundantCondition */
+ if ($this->state === self::PENDING) {
+ $this->reject(new CancellationException('Promise has been cancelled'));
+ }
+ }
+
+ public function resolve($value)
+ {
+ $this->settle(self::FULFILLED, $value);
+ }
+
+ public function reject($reason)
+ {
+ $this->settle(self::REJECTED, $reason);
+ }
+
+ private function settle($state, $value)
+ {
+ if ($this->state !== self::PENDING) {
+ // Ignore calls with the same resolution.
+ if ($state === $this->state && $value === $this->result) {
+ return;
+ }
+ throw $this->state === $state
+ ? new \LogicException("The promise is already {$state}.")
+ : new \LogicException("Cannot change a {$this->state} promise to {$state}");
+ }
+
+ if ($value === $this) {
+ throw new \LogicException('Cannot fulfill or reject a promise with itself');
+ }
+
+ // Clear out the state of the promise but stash the handlers.
+ $this->state = $state;
+ $this->result = $value;
+ $handlers = $this->handlers;
+ $this->handlers = null;
+ $this->waitList = $this->waitFn = null;
+ $this->cancelFn = null;
+
+ if (!$handlers) {
+ return;
+ }
+
+ // If the value was not a settled promise or a thenable, then resolve
+ // it in the task queue using the correct ID.
+ if (!is_object($value) || !method_exists($value, 'then')) {
+ $id = $state === self::FULFILLED ? 1 : 2;
+ // It's a success, so resolve the handlers in the queue.
+ Utils::queue()->add(static function () use ($id, $value, $handlers) {
+ foreach ($handlers as $handler) {
+ self::callHandler($id, $value, $handler);
+ }
+ });
+ } elseif ($value instanceof Promise && Is::pending($value)) {
+ // We can just merge our handlers onto the next promise.
+ $value->handlers = array_merge($value->handlers, $handlers);
+ } else {
+ // Resolve the handlers when the forwarded promise is resolved.
+ $value->then(
+ static function ($value) use ($handlers) {
+ foreach ($handlers as $handler) {
+ self::callHandler(1, $value, $handler);
+ }
+ },
+ static function ($reason) use ($handlers) {
+ foreach ($handlers as $handler) {
+ self::callHandler(2, $reason, $handler);
+ }
+ }
+ );
+ }
+ }
+
+ /**
+ * Call a stack of handlers using a specific callback index and value.
+ *
+ * @param int $index 1 (resolve) or 2 (reject).
+ * @param mixed $value Value to pass to the callback.
+ * @param array $handler Array of handler data (promise and callbacks).
+ */
+ private static function callHandler($index, $value, array $handler)
+ {
+ /** @var PromiseInterface $promise */
+ $promise = $handler[0];
+
+ // The promise may have been cancelled or resolved before placing
+ // this thunk in the queue.
+ if (Is::settled($promise)) {
+ return;
+ }
+
+ try {
+ if (isset($handler[$index])) {
+ /*
+ * If $f throws an exception, then $handler will be in the exception
+ * stack trace. Since $handler contains a reference to the callable
+ * itself we get a circular reference. We clear the $handler
+ * here to avoid that memory leak.
+ */
+ $f = $handler[$index];
+ unset($handler);
+ $promise->resolve($f($value));
+ } elseif ($index === 1) {
+ // Forward resolution values as-is.
+ $promise->resolve($value);
+ } else {
+ // Forward rejections down the chain.
+ $promise->reject($value);
+ }
+ } catch (\Throwable $reason) {
+ $promise->reject($reason);
+ } catch (\Exception $reason) {
+ $promise->reject($reason);
+ }
+ }
+
+ private function waitIfPending()
+ {
+ if ($this->state !== self::PENDING) {
+ return;
+ } elseif ($this->waitFn) {
+ $this->invokeWaitFn();
+ } elseif ($this->waitList) {
+ $this->invokeWaitList();
+ } else {
+ // If there's no wait function, then reject the promise.
+ $this->reject('Cannot wait on a promise that has '
+ . 'no internal wait function. You must provide a wait '
+ . 'function when constructing the promise to be able to '
+ . 'wait on a promise.');
+ }
+
+ Utils::queue()->run();
+
+ /** @psalm-suppress RedundantCondition */
+ if ($this->state === self::PENDING) {
+ $this->reject('Invoking the wait callback did not resolve the promise');
+ }
+ }
+
+ private function invokeWaitFn()
+ {
+ try {
+ $wfn = $this->waitFn;
+ $this->waitFn = null;
+ $wfn(true);
+ } catch (\Exception $reason) {
+ if ($this->state === self::PENDING) {
+ // The promise has not been resolved yet, so reject the promise
+ // with the exception.
+ $this->reject($reason);
+ } else {
+ // The promise was already resolved, so there's a problem in
+ // the application.
+ throw $reason;
+ }
+ }
+ }
+
+ private function invokeWaitList()
+ {
+ $waitList = $this->waitList;
+ $this->waitList = null;
+
+ foreach ($waitList as $result) {
+ do {
+ $result->waitIfPending();
+ $result = $result->result;
+ } while ($result instanceof Promise);
+
+ if ($result instanceof PromiseInterface) {
+ $result->wait(false);
+ }
+ }
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/promises/src/PromiseInterface.php b/lib/gerencianet/guzzlehttp/promises/src/PromiseInterface.php
new file mode 100644
index 0000000..e598331
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/src/PromiseInterface.php
@@ -0,0 +1,97 @@
+reason = $reason;
+ }
+
+ public function then(
+ callable $onFulfilled = null,
+ callable $onRejected = null
+ ) {
+ // If there's no onRejected callback then just return self.
+ if (!$onRejected) {
+ return $this;
+ }
+
+ $queue = Utils::queue();
+ $reason = $this->reason;
+ $p = new Promise([$queue, 'run']);
+ $queue->add(static function () use ($p, $reason, $onRejected) {
+ if (Is::pending($p)) {
+ try {
+ // Return a resolved promise if onRejected does not throw.
+ $p->resolve($onRejected($reason));
+ } catch (\Throwable $e) {
+ // onRejected threw, so return a rejected promise.
+ $p->reject($e);
+ } catch (\Exception $e) {
+ // onRejected threw, so return a rejected promise.
+ $p->reject($e);
+ }
+ }
+ });
+
+ return $p;
+ }
+
+ public function otherwise(callable $onRejected)
+ {
+ return $this->then(null, $onRejected);
+ }
+
+ public function wait($unwrap = true, $defaultDelivery = null)
+ {
+ if ($unwrap) {
+ throw Create::exceptionFor($this->reason);
+ }
+
+ return null;
+ }
+
+ public function getState()
+ {
+ return self::REJECTED;
+ }
+
+ public function resolve($value)
+ {
+ throw new \LogicException("Cannot resolve a rejected promise");
+ }
+
+ public function reject($reason)
+ {
+ if ($reason !== $this->reason) {
+ throw new \LogicException("Cannot reject a rejected promise");
+ }
+ }
+
+ public function cancel()
+ {
+ // pass
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/promises/src/RejectionException.php b/lib/gerencianet/guzzlehttp/promises/src/RejectionException.php
new file mode 100644
index 0000000..e2f1377
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/src/RejectionException.php
@@ -0,0 +1,48 @@
+reason = $reason;
+
+ $message = 'The promise was rejected';
+
+ if ($description) {
+ $message .= ' with reason: ' . $description;
+ } elseif (is_string($reason)
+ || (is_object($reason) && method_exists($reason, '__toString'))
+ ) {
+ $message .= ' with reason: ' . $this->reason;
+ } elseif ($reason instanceof \JsonSerializable) {
+ $message .= ' with reason: '
+ . json_encode($this->reason, JSON_PRETTY_PRINT);
+ }
+
+ parent::__construct($message);
+ }
+
+ /**
+ * Returns the rejection reason.
+ *
+ * @return mixed
+ */
+ public function getReason()
+ {
+ return $this->reason;
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/promises/src/TaskQueue.php b/lib/gerencianet/guzzlehttp/promises/src/TaskQueue.php
new file mode 100644
index 0000000..f0fba2c
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/src/TaskQueue.php
@@ -0,0 +1,67 @@
+run();
+ */
+class TaskQueue implements TaskQueueInterface
+{
+ private $enableShutdown = true;
+ private $queue = [];
+
+ public function __construct($withShutdown = true)
+ {
+ if ($withShutdown) {
+ register_shutdown_function(function () {
+ if ($this->enableShutdown) {
+ // Only run the tasks if an E_ERROR didn't occur.
+ $err = error_get_last();
+ if (!$err || ($err['type'] ^ E_ERROR)) {
+ $this->run();
+ }
+ }
+ });
+ }
+ }
+
+ public function isEmpty()
+ {
+ return !$this->queue;
+ }
+
+ public function add(callable $task)
+ {
+ $this->queue[] = $task;
+ }
+
+ public function run()
+ {
+ while ($task = array_shift($this->queue)) {
+ /** @var callable $task */
+ $task();
+ }
+ }
+
+ /**
+ * The task queue will be run and exhausted by default when the process
+ * exits IFF the exit is not the result of a PHP E_ERROR error.
+ *
+ * You can disable running the automatic shutdown of the queue by calling
+ * this function. If you disable the task queue shutdown process, then you
+ * MUST either run the task queue (as a result of running your event loop
+ * or manually using the run() method) or wait on each outstanding promise.
+ *
+ * Note: This shutdown will occur before any destructors are triggered.
+ */
+ public function disableShutdown()
+ {
+ $this->enableShutdown = false;
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/promises/src/TaskQueueInterface.php b/lib/gerencianet/guzzlehttp/promises/src/TaskQueueInterface.php
new file mode 100644
index 0000000..723d4d5
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/src/TaskQueueInterface.php
@@ -0,0 +1,24 @@
+
+ * while ($eventLoop->isRunning()) {
+ * GuzzleHttp\Promise\Utils::queue()->run();
+ * }
+ *
+ *
+ * @param TaskQueueInterface $assign Optionally specify a new queue instance.
+ *
+ * @return TaskQueueInterface
+ */
+ public static function queue(TaskQueueInterface $assign = null)
+ {
+ static $queue;
+
+ if ($assign) {
+ $queue = $assign;
+ } elseif (!$queue) {
+ $queue = new TaskQueue();
+ }
+
+ return $queue;
+ }
+
+ /**
+ * Adds a function to run in the task queue when it is next `run()` and
+ * returns a promise that is fulfilled or rejected with the result.
+ *
+ * @param callable $task Task function to run.
+ *
+ * @return PromiseInterface
+ */
+ public static function task(callable $task)
+ {
+ $queue = self::queue();
+ $promise = new Promise([$queue, 'run']);
+ $queue->add(function () use ($task, $promise) {
+ try {
+ $promise->resolve($task());
+ } catch (\Throwable $e) {
+ $promise->reject($e);
+ } catch (\Exception $e) {
+ $promise->reject($e);
+ }
+ });
+
+ return $promise;
+ }
+
+ /**
+ * Synchronously waits on a promise to resolve and returns an inspection
+ * state array.
+ *
+ * Returns a state associative array containing a "state" key mapping to a
+ * valid promise state. If the state of the promise is "fulfilled", the
+ * array will contain a "value" key mapping to the fulfilled value of the
+ * promise. If the promise is rejected, the array will contain a "reason"
+ * key mapping to the rejection reason of the promise.
+ *
+ * @param PromiseInterface $promise Promise or value.
+ *
+ * @return array
+ */
+ public static function inspect(PromiseInterface $promise)
+ {
+ try {
+ return [
+ 'state' => PromiseInterface::FULFILLED,
+ 'value' => $promise->wait()
+ ];
+ } catch (RejectionException $e) {
+ return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()];
+ } catch (\Throwable $e) {
+ return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
+ } catch (\Exception $e) {
+ return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
+ }
+ }
+
+ /**
+ * Waits on all of the provided promises, but does not unwrap rejected
+ * promises as thrown exception.
+ *
+ * Returns an array of inspection state arrays.
+ *
+ * @see inspect for the inspection state array format.
+ *
+ * @param PromiseInterface[] $promises Traversable of promises to wait upon.
+ *
+ * @return array
+ */
+ public static function inspectAll($promises)
+ {
+ $results = [];
+ foreach ($promises as $key => $promise) {
+ $results[$key] = inspect($promise);
+ }
+
+ return $results;
+ }
+
+ /**
+ * Waits on all of the provided promises and returns the fulfilled values.
+ *
+ * Returns an array that contains the value of each promise (in the same
+ * order the promises were provided). An exception is thrown if any of the
+ * promises are rejected.
+ *
+ * @param iterable $promises Iterable of PromiseInterface objects to wait on.
+ *
+ * @return array
+ *
+ * @throws \Exception on error
+ * @throws \Throwable on error in PHP >=7
+ */
+ public static function unwrap($promises)
+ {
+ $results = [];
+ foreach ($promises as $key => $promise) {
+ $results[$key] = $promise->wait();
+ }
+
+ return $results;
+ }
+
+ /**
+ * Given an array of promises, return a promise that is fulfilled when all
+ * the items in the array are fulfilled.
+ *
+ * The promise's fulfillment value is an array with fulfillment values at
+ * respective positions to the original array. If any promise in the array
+ * rejects, the returned promise is rejected with the rejection reason.
+ *
+ * @param mixed $promises Promises or values.
+ * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution.
+ *
+ * @return PromiseInterface
+ */
+ public static function all($promises, $recursive = false)
+ {
+ $results = [];
+ $promise = Each::of(
+ $promises,
+ function ($value, $idx) use (&$results) {
+ $results[$idx] = $value;
+ },
+ function ($reason, $idx, Promise $aggregate) {
+ $aggregate->reject($reason);
+ }
+ )->then(function () use (&$results) {
+ ksort($results);
+ return $results;
+ });
+
+ if (true === $recursive) {
+ $promise = $promise->then(function ($results) use ($recursive, &$promises) {
+ foreach ($promises as $promise) {
+ if (Is::pending($promise)) {
+ return self::all($promises, $recursive);
+ }
+ }
+ return $results;
+ });
+ }
+
+ return $promise;
+ }
+
+ /**
+ * Initiate a competitive race between multiple promises or values (values
+ * will become immediately fulfilled promises).
+ *
+ * When count amount of promises have been fulfilled, the returned promise
+ * is fulfilled with an array that contains the fulfillment values of the
+ * winners in order of resolution.
+ *
+ * This promise is rejected with a {@see AggregateException} if the number
+ * of fulfilled promises is less than the desired $count.
+ *
+ * @param int $count Total number of promises.
+ * @param mixed $promises Promises or values.
+ *
+ * @return PromiseInterface
+ */
+ public static function some($count, $promises)
+ {
+ $results = [];
+ $rejections = [];
+
+ return Each::of(
+ $promises,
+ function ($value, $idx, PromiseInterface $p) use (&$results, $count) {
+ if (Is::settled($p)) {
+ return;
+ }
+ $results[$idx] = $value;
+ if (count($results) >= $count) {
+ $p->resolve(null);
+ }
+ },
+ function ($reason) use (&$rejections) {
+ $rejections[] = $reason;
+ }
+ )->then(
+ function () use (&$results, &$rejections, $count) {
+ if (count($results) !== $count) {
+ throw new AggregateException(
+ 'Not enough promises to fulfill count',
+ $rejections
+ );
+ }
+ ksort($results);
+ return array_values($results);
+ }
+ );
+ }
+
+ /**
+ * Like some(), with 1 as count. However, if the promise fulfills, the
+ * fulfillment value is not an array of 1 but the value directly.
+ *
+ * @param mixed $promises Promises or values.
+ *
+ * @return PromiseInterface
+ */
+ public static function any($promises)
+ {
+ return self::some(1, $promises)->then(function ($values) {
+ return $values[0];
+ });
+ }
+
+ /**
+ * Returns a promise that is fulfilled when all of the provided promises have
+ * been fulfilled or rejected.
+ *
+ * The returned promise is fulfilled with an array of inspection state arrays.
+ *
+ * @see inspect for the inspection state array format.
+ *
+ * @param mixed $promises Promises or values.
+ *
+ * @return PromiseInterface
+ */
+ public static function settle($promises)
+ {
+ $results = [];
+
+ return Each::of(
+ $promises,
+ function ($value, $idx) use (&$results) {
+ $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value];
+ },
+ function ($reason, $idx) use (&$results) {
+ $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason];
+ }
+ )->then(function () use (&$results) {
+ ksort($results);
+ return $results;
+ });
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/promises/src/functions.php b/lib/gerencianet/guzzlehttp/promises/src/functions.php
new file mode 100644
index 0000000..c03d39d
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/src/functions.php
@@ -0,0 +1,363 @@
+
+ * while ($eventLoop->isRunning()) {
+ * GuzzleHttp\Promise\queue()->run();
+ * }
+ *
+ *
+ * @param TaskQueueInterface $assign Optionally specify a new queue instance.
+ *
+ * @return TaskQueueInterface
+ *
+ * @deprecated queue will be removed in guzzlehttp/promises:2.0. Use Utils::queue instead.
+ */
+function queue(TaskQueueInterface $assign = null)
+{
+ return Utils::queue($assign);
+}
+
+/**
+ * Adds a function to run in the task queue when it is next `run()` and returns
+ * a promise that is fulfilled or rejected with the result.
+ *
+ * @param callable $task Task function to run.
+ *
+ * @return PromiseInterface
+ *
+ * @deprecated task will be removed in guzzlehttp/promises:2.0. Use Utils::task instead.
+ */
+function task(callable $task)
+{
+ return Utils::task($task);
+}
+
+/**
+ * Creates a promise for a value if the value is not a promise.
+ *
+ * @param mixed $value Promise or value.
+ *
+ * @return PromiseInterface
+ *
+ * @deprecated promise_for will be removed in guzzlehttp/promises:2.0. Use Create::promiseFor instead.
+ */
+function promise_for($value)
+{
+ return Create::promiseFor($value);
+}
+
+/**
+ * Creates a rejected promise for a reason if the reason is not a promise. If
+ * the provided reason is a promise, then it is returned as-is.
+ *
+ * @param mixed $reason Promise or reason.
+ *
+ * @return PromiseInterface
+ *
+ * @deprecated rejection_for will be removed in guzzlehttp/promises:2.0. Use Create::rejectionFor instead.
+ */
+function rejection_for($reason)
+{
+ return Create::rejectionFor($reason);
+}
+
+/**
+ * Create an exception for a rejected promise value.
+ *
+ * @param mixed $reason
+ *
+ * @return \Exception|\Throwable
+ *
+ * @deprecated exception_for will be removed in guzzlehttp/promises:2.0. Use Create::exceptionFor instead.
+ */
+function exception_for($reason)
+{
+ return Create::exceptionFor($reason);
+}
+
+/**
+ * Returns an iterator for the given value.
+ *
+ * @param mixed $value
+ *
+ * @return \Iterator
+ *
+ * @deprecated iter_for will be removed in guzzlehttp/promises:2.0. Use Create::iterFor instead.
+ */
+function iter_for($value)
+{
+ return Create::iterFor($value);
+}
+
+/**
+ * Synchronously waits on a promise to resolve and returns an inspection state
+ * array.
+ *
+ * Returns a state associative array containing a "state" key mapping to a
+ * valid promise state. If the state of the promise is "fulfilled", the array
+ * will contain a "value" key mapping to the fulfilled value of the promise. If
+ * the promise is rejected, the array will contain a "reason" key mapping to
+ * the rejection reason of the promise.
+ *
+ * @param PromiseInterface $promise Promise or value.
+ *
+ * @return array
+ *
+ * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspect instead.
+ */
+function inspect(PromiseInterface $promise)
+{
+ return Utils::inspect($promise);
+}
+
+/**
+ * Waits on all of the provided promises, but does not unwrap rejected promises
+ * as thrown exception.
+ *
+ * Returns an array of inspection state arrays.
+ *
+ * @see inspect for the inspection state array format.
+ *
+ * @param PromiseInterface[] $promises Traversable of promises to wait upon.
+ *
+ * @return array
+ *
+ * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspectAll instead.
+ */
+function inspect_all($promises)
+{
+ return Utils::inspectAll($promises);
+}
+
+/**
+ * Waits on all of the provided promises and returns the fulfilled values.
+ *
+ * Returns an array that contains the value of each promise (in the same order
+ * the promises were provided). An exception is thrown if any of the promises
+ * are rejected.
+ *
+ * @param iterable $promises Iterable of PromiseInterface objects to wait on.
+ *
+ * @return array
+ *
+ * @throws \Exception on error
+ * @throws \Throwable on error in PHP >=7
+ *
+ * @deprecated unwrap will be removed in guzzlehttp/promises:2.0. Use Utils::unwrap instead.
+ */
+function unwrap($promises)
+{
+ return Utils::unwrap($promises);
+}
+
+/**
+ * Given an array of promises, return a promise that is fulfilled when all the
+ * items in the array are fulfilled.
+ *
+ * The promise's fulfillment value is an array with fulfillment values at
+ * respective positions to the original array. If any promise in the array
+ * rejects, the returned promise is rejected with the rejection reason.
+ *
+ * @param mixed $promises Promises or values.
+ * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution.
+ *
+ * @return PromiseInterface
+ *
+ * @deprecated all will be removed in guzzlehttp/promises:2.0. Use Utils::all instead.
+ */
+function all($promises, $recursive = false)
+{
+ return Utils::all($promises, $recursive);
+}
+
+/**
+ * Initiate a competitive race between multiple promises or values (values will
+ * become immediately fulfilled promises).
+ *
+ * When count amount of promises have been fulfilled, the returned promise is
+ * fulfilled with an array that contains the fulfillment values of the winners
+ * in order of resolution.
+ *
+ * This promise is rejected with a {@see AggregateException} if the number of
+ * fulfilled promises is less than the desired $count.
+ *
+ * @param int $count Total number of promises.
+ * @param mixed $promises Promises or values.
+ *
+ * @return PromiseInterface
+ *
+ * @deprecated some will be removed in guzzlehttp/promises:2.0. Use Utils::some instead.
+ */
+function some($count, $promises)
+{
+ return Utils::some($count, $promises);
+}
+
+/**
+ * Like some(), with 1 as count. However, if the promise fulfills, the
+ * fulfillment value is not an array of 1 but the value directly.
+ *
+ * @param mixed $promises Promises or values.
+ *
+ * @return PromiseInterface
+ *
+ * @deprecated any will be removed in guzzlehttp/promises:2.0. Use Utils::any instead.
+ */
+function any($promises)
+{
+ return Utils::any($promises);
+}
+
+/**
+ * Returns a promise that is fulfilled when all of the provided promises have
+ * been fulfilled or rejected.
+ *
+ * The returned promise is fulfilled with an array of inspection state arrays.
+ *
+ * @see inspect for the inspection state array format.
+ *
+ * @param mixed $promises Promises or values.
+ *
+ * @return PromiseInterface
+ *
+ * @deprecated settle will be removed in guzzlehttp/promises:2.0. Use Utils::settle instead.
+ */
+function settle($promises)
+{
+ return Utils::settle($promises);
+}
+
+/**
+ * Given an iterator that yields promises or values, returns a promise that is
+ * fulfilled with a null value when the iterator has been consumed or the
+ * aggregate promise has been fulfilled or rejected.
+ *
+ * $onFulfilled is a function that accepts the fulfilled value, iterator index,
+ * and the aggregate promise. The callback can invoke any necessary side
+ * effects and choose to resolve or reject the aggregate if needed.
+ *
+ * $onRejected is a function that accepts the rejection reason, iterator index,
+ * and the aggregate promise. The callback can invoke any necessary side
+ * effects and choose to resolve or reject the aggregate if needed.
+ *
+ * @param mixed $iterable Iterator or array to iterate over.
+ * @param callable $onFulfilled
+ * @param callable $onRejected
+ *
+ * @return PromiseInterface
+ *
+ * @deprecated each will be removed in guzzlehttp/promises:2.0. Use Each::of instead.
+ */
+function each(
+ $iterable,
+ callable $onFulfilled = null,
+ callable $onRejected = null
+) {
+ return Each::of($iterable, $onFulfilled, $onRejected);
+}
+
+/**
+ * Like each, but only allows a certain number of outstanding promises at any
+ * given time.
+ *
+ * $concurrency may be an integer or a function that accepts the number of
+ * pending promises and returns a numeric concurrency limit value to allow for
+ * dynamic a concurrency size.
+ *
+ * @param mixed $iterable
+ * @param int|callable $concurrency
+ * @param callable $onFulfilled
+ * @param callable $onRejected
+ *
+ * @return PromiseInterface
+ *
+ * @deprecated each_limit will be removed in guzzlehttp/promises:2.0. Use Each::ofLimit instead.
+ */
+function each_limit(
+ $iterable,
+ $concurrency,
+ callable $onFulfilled = null,
+ callable $onRejected = null
+) {
+ return Each::ofLimit($iterable, $concurrency, $onFulfilled, $onRejected);
+}
+
+/**
+ * Like each_limit, but ensures that no promise in the given $iterable argument
+ * is rejected. If any promise is rejected, then the aggregate promise is
+ * rejected with the encountered rejection.
+ *
+ * @param mixed $iterable
+ * @param int|callable $concurrency
+ * @param callable $onFulfilled
+ *
+ * @return PromiseInterface
+ *
+ * @deprecated each_limit_all will be removed in guzzlehttp/promises:2.0. Use Each::ofLimitAll instead.
+ */
+function each_limit_all(
+ $iterable,
+ $concurrency,
+ callable $onFulfilled = null
+) {
+ return Each::ofLimitAll($iterable, $concurrency, $onFulfilled);
+}
+
+/**
+ * Returns true if a promise is fulfilled.
+ *
+ * @return bool
+ *
+ * @deprecated is_fulfilled will be removed in guzzlehttp/promises:2.0. Use Is::fulfilled instead.
+ */
+function is_fulfilled(PromiseInterface $promise)
+{
+ return Is::fulfilled($promise);
+}
+
+/**
+ * Returns true if a promise is rejected.
+ *
+ * @return bool
+ *
+ * @deprecated is_rejected will be removed in guzzlehttp/promises:2.0. Use Is::rejected instead.
+ */
+function is_rejected(PromiseInterface $promise)
+{
+ return Is::rejected($promise);
+}
+
+/**
+ * Returns true if a promise is fulfilled or rejected.
+ *
+ * @return bool
+ *
+ * @deprecated is_settled will be removed in guzzlehttp/promises:2.0. Use Is::settled instead.
+ */
+function is_settled(PromiseInterface $promise)
+{
+ return Is::settled($promise);
+}
+
+/**
+ * Create a new coroutine.
+ *
+ * @see Coroutine
+ *
+ * @return PromiseInterface
+ *
+ * @deprecated coroutine will be removed in guzzlehttp/promises:2.0. Use Coroutine::of instead.
+ */
+function coroutine(callable $generatorFn)
+{
+ return Coroutine::of($generatorFn);
+}
diff --git a/lib/gerencianet/guzzlehttp/promises/src/functions_include.php b/lib/gerencianet/guzzlehttp/promises/src/functions_include.php
new file mode 100644
index 0000000..34cd171
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/promises/src/functions_include.php
@@ -0,0 +1,6 @@
+setRiskyAllowed(true)
+ ->setRules([
+ '@PSR2' => true,
+ 'array_syntax' => ['syntax' => 'short'],
+ 'concat_space' => ['spacing' => 'one'],
+ 'declare_strict_types' => false,
+ 'final_static_access' => true,
+ 'fully_qualified_strict_types' => true,
+ 'header_comment' => false,
+ 'is_null' => ['use_yoda_style' => true],
+ 'list_syntax' => ['syntax' => 'long'],
+ 'lowercase_cast' => true,
+ 'magic_method_casing' => true,
+ 'modernize_types_casting' => true,
+ 'multiline_comment_opening_closing' => true,
+ 'no_alias_functions' => true,
+ 'no_alternative_syntax' => true,
+ 'no_blank_lines_after_phpdoc' => true,
+ 'no_empty_comment' => true,
+ 'no_empty_phpdoc' => true,
+ 'no_empty_statement' => true,
+ 'no_extra_blank_lines' => true,
+ 'no_leading_import_slash' => true,
+ 'no_trailing_comma_in_singleline_array' => true,
+ 'no_unset_cast' => true,
+ 'no_unused_imports' => true,
+ 'no_whitespace_in_blank_line' => true,
+ 'ordered_imports' => true,
+ 'php_unit_ordered_covers' => true,
+ 'php_unit_test_annotation' => ['style' => 'prefix'],
+ 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
+ 'phpdoc_align' => ['align' => 'vertical'],
+ 'phpdoc_no_useless_inheritdoc' => true,
+ 'phpdoc_scalar' => true,
+ 'phpdoc_separation' => true,
+ 'phpdoc_single_line_var_spacing' => true,
+ 'phpdoc_trim' => true,
+ 'phpdoc_trim_consecutive_blank_line_separation' => true,
+ 'phpdoc_types' => true,
+ 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
+ 'phpdoc_var_without_name' => true,
+ 'single_trait_insert_per_statement' => true,
+ 'standardize_not_equals' => true,
+ ])
+ ->setFinder(
+ PhpCsFixer\Finder::create()
+ ->in(__DIR__.'/src')
+ ->in(__DIR__.'/tests')
+ ->name('*.php')
+ )
+;
+
+return $config;
diff --git a/lib/gerencianet/guzzlehttp/psr7/CHANGELOG.md b/lib/gerencianet/guzzlehttp/psr7/CHANGELOG.md
new file mode 100644
index 0000000..6a6b7bf
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/CHANGELOG.md
@@ -0,0 +1,294 @@
+# Change Log
+
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+
+
+## Unreleased
+
+## 1.8.2 - 2021-04-26
+
+### Fixed
+
+- Handle possibly unset `url` in `stream_get_meta_data`
+
+## 1.8.1 - 2021-03-21
+
+### Fixed
+
+- Issue parsing IPv6 URLs
+- Issue modifying ServerRequest lost all its attributes
+
+## 1.8.0 - 2021-03-21
+
+### Added
+
+- Locale independent URL parsing
+- Most classes got a `@final` annotation to prepare for 2.0
+
+### Fixed
+
+- Issue when creating stream from `php://input` and curl-ext is not installed
+- Broken `Utils::tryFopen()` on PHP 8
+
+## 1.7.0 - 2020-09-30
+
+### Added
+
+- Replaced functions by static methods
+
+### Fixed
+
+- Converting a non-seekable stream to a string
+- Handle multiple Set-Cookie correctly
+- Ignore array keys in header values when merging
+- Allow multibyte characters to be parsed in `Message:bodySummary()`
+
+### Changed
+
+- Restored partial HHVM 3 support
+
+
+## [1.6.1] - 2019-07-02
+
+### Fixed
+
+- Accept null and bool header values again
+
+
+## [1.6.0] - 2019-06-30
+
+### Added
+
+- Allowed version `^3.0` of `ralouphie/getallheaders` dependency (#244)
+- Added MIME type for WEBP image format (#246)
+- Added more validation of values according to PSR-7 and RFC standards, e.g. status code range (#250, #272)
+
+### Changed
+
+- Tests don't pass with HHVM 4.0, so HHVM support got dropped. Other libraries like composer have done the same. (#262)
+- Accept port number 0 to be valid (#270)
+
+### Fixed
+
+- Fixed subsequent reads from `php://input` in ServerRequest (#247)
+- Fixed readable/writable detection for certain stream modes (#248)
+- Fixed encoding of special characters in the `userInfo` component of an URI (#253)
+
+
+## [1.5.2] - 2018-12-04
+
+### Fixed
+
+- Check body size when getting the message summary
+
+
+## [1.5.1] - 2018-12-04
+
+### Fixed
+
+- Get the summary of a body only if it is readable
+
+
+## [1.5.0] - 2018-12-03
+
+### Added
+
+- Response first-line to response string exception (fixes #145)
+- A test for #129 behavior
+- `get_message_body_summary` function in order to get the message summary
+- `3gp` and `mkv` mime types
+
+### Changed
+
+- Clarify exception message when stream is detached
+
+### Deprecated
+
+- Deprecated parsing folded header lines as per RFC 7230
+
+### Fixed
+
+- Fix `AppendStream::detach` to not close streams
+- `InflateStream` preserves `isSeekable` attribute of the underlying stream
+- `ServerRequest::getUriFromGlobals` to support URLs in query parameters
+
+
+Several other fixes and improvements.
+
+
+## [1.4.2] - 2017-03-20
+
+### Fixed
+
+- Reverted BC break to `Uri::resolve` and `Uri::removeDotSegments` by removing
+ calls to `trigger_error` when deprecated methods are invoked.
+
+
+## [1.4.1] - 2017-02-27
+
+### Added
+
+- Rriggering of silenced deprecation warnings.
+
+### Fixed
+
+- Reverted BC break by reintroducing behavior to automagically fix a URI with a
+ relative path and an authority by adding a leading slash to the path. It's only
+ deprecated now.
+
+
+## [1.4.0] - 2017-02-21
+
+### Added
+
+- Added common URI utility methods based on RFC 3986 (see documentation in the readme):
+ - `Uri::isDefaultPort`
+ - `Uri::isAbsolute`
+ - `Uri::isNetworkPathReference`
+ - `Uri::isAbsolutePathReference`
+ - `Uri::isRelativePathReference`
+ - `Uri::isSameDocumentReference`
+ - `Uri::composeComponents`
+ - `UriNormalizer::normalize`
+ - `UriNormalizer::isEquivalent`
+ - `UriResolver::relativize`
+
+### Changed
+
+- Ensure `ServerRequest::getUriFromGlobals` returns a URI in absolute form.
+- Allow `parse_response` to parse a response without delimiting space and reason.
+- Ensure each URI modification results in a valid URI according to PSR-7 discussions.
+ Invalid modifications will throw an exception instead of returning a wrong URI or
+ doing some magic.
+ - `(new Uri)->withPath('foo')->withHost('example.com')` will throw an exception
+ because the path of a URI with an authority must start with a slash "/" or be empty
+ - `(new Uri())->withScheme('http')` will return `'http://localhost'`
+
+### Deprecated
+
+- `Uri::resolve` in favor of `UriResolver::resolve`
+- `Uri::removeDotSegments` in favor of `UriResolver::removeDotSegments`
+
+### Fixed
+
+- `Stream::read` when length parameter <= 0.
+- `copy_to_stream` reads bytes in chunks instead of `maxLen` into memory.
+- `ServerRequest::getUriFromGlobals` when `Host` header contains port.
+- Compatibility of URIs with `file` scheme and empty host.
+
+
+## [1.3.1] - 2016-06-25
+
+### Fixed
+
+- `Uri::__toString` for network path references, e.g. `//example.org`.
+- Missing lowercase normalization for host.
+- Handling of URI components in case they are `'0'` in a lot of places,
+ e.g. as a user info password.
+- `Uri::withAddedHeader` to correctly merge headers with different case.
+- Trimming of header values in `Uri::withAddedHeader`. Header values may
+ be surrounded by whitespace which should be ignored according to RFC 7230
+ Section 3.2.4. This does not apply to header names.
+- `Uri::withAddedHeader` with an array of header values.
+- `Uri::resolve` when base path has no slash and handling of fragment.
+- Handling of encoding in `Uri::with(out)QueryValue` so one can pass the
+ key/value both in encoded as well as decoded form to those methods. This is
+ consistent with withPath, withQuery etc.
+- `ServerRequest::withoutAttribute` when attribute value is null.
+
+
+## [1.3.0] - 2016-04-13
+
+### Added
+
+- Remaining interfaces needed for full PSR7 compatibility
+ (ServerRequestInterface, UploadedFileInterface, etc.).
+- Support for stream_for from scalars.
+
+### Changed
+
+- Can now extend Uri.
+
+### Fixed
+- A bug in validating request methods by making it more permissive.
+
+
+## [1.2.3] - 2016-02-18
+
+### Fixed
+
+- Support in `GuzzleHttp\Psr7\CachingStream` for seeking forward on remote
+ streams, which can sometimes return fewer bytes than requested with `fread`.
+- Handling of gzipped responses with FNAME headers.
+
+
+## [1.2.2] - 2016-01-22
+
+### Added
+
+- Support for URIs without any authority.
+- Support for HTTP 451 'Unavailable For Legal Reasons.'
+- Support for using '0' as a filename.
+- Support for including non-standard ports in Host headers.
+
+
+## [1.2.1] - 2015-11-02
+
+### Changes
+
+- Now supporting negative offsets when seeking to SEEK_END.
+
+
+## [1.2.0] - 2015-08-15
+
+### Changed
+
+- Body as `"0"` is now properly added to a response.
+- Now allowing forward seeking in CachingStream.
+- Now properly parsing HTTP requests that contain proxy targets in
+ `parse_request`.
+- functions.php is now conditionally required.
+- user-info is no longer dropped when resolving URIs.
+
+
+## [1.1.0] - 2015-06-24
+
+### Changed
+
+- URIs can now be relative.
+- `multipart/form-data` headers are now overridden case-insensitively.
+- URI paths no longer encode the following characters because they are allowed
+ in URIs: "(", ")", "*", "!", "'"
+- A port is no longer added to a URI when the scheme is missing and no port is
+ present.
+
+
+## 1.0.0 - 2015-05-19
+
+Initial release.
+
+Currently unsupported:
+
+- `Psr\Http\Message\ServerRequestInterface`
+- `Psr\Http\Message\UploadedFileInterface`
+
+
+
+[1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0
+[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2
+[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1
+[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0
+[1.4.2]: https://github.com/guzzle/psr7/compare/1.4.1...1.4.2
+[1.4.1]: https://github.com/guzzle/psr7/compare/1.4.0...1.4.1
+[1.4.0]: https://github.com/guzzle/psr7/compare/1.3.1...1.4.0
+[1.3.1]: https://github.com/guzzle/psr7/compare/1.3.0...1.3.1
+[1.3.0]: https://github.com/guzzle/psr7/compare/1.2.3...1.3.0
+[1.2.3]: https://github.com/guzzle/psr7/compare/1.2.2...1.2.3
+[1.2.2]: https://github.com/guzzle/psr7/compare/1.2.1...1.2.2
+[1.2.1]: https://github.com/guzzle/psr7/compare/1.2.0...1.2.1
+[1.2.0]: https://github.com/guzzle/psr7/compare/1.1.0...1.2.0
+[1.1.0]: https://github.com/guzzle/psr7/compare/1.0.0...1.1.0
diff --git a/lib/gerencianet/guzzlehttp/psr7/LICENSE b/lib/gerencianet/guzzlehttp/psr7/LICENSE
new file mode 100644
index 0000000..581d95f
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2015 Michael Dowling, https://github.com/mtdowling
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/lib/gerencianet/guzzlehttp/psr7/README.md b/lib/gerencianet/guzzlehttp/psr7/README.md
new file mode 100644
index 0000000..acfabfd
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/README.md
@@ -0,0 +1,809 @@
+# PSR-7 Message Implementation
+
+This repository contains a full [PSR-7](http://www.php-fig.org/psr/psr-7/)
+message implementation, several stream decorators, and some helpful
+functionality like query string parsing.
+
+
+[](https://travis-ci.org/guzzle/psr7)
+
+
+# Stream implementation
+
+This package comes with a number of stream implementations and stream
+decorators.
+
+
+## AppendStream
+
+`GuzzleHttp\Psr7\AppendStream`
+
+Reads from multiple streams, one after the other.
+
+```php
+use GuzzleHttp\Psr7;
+
+$a = Psr7\Utils::streamFor('abc, ');
+$b = Psr7\Utils::streamFor('123.');
+$composed = new Psr7\AppendStream([$a, $b]);
+
+$composed->addStream(Psr7\Utils::streamFor(' Above all listen to me'));
+
+echo $composed; // abc, 123. Above all listen to me.
+```
+
+
+## BufferStream
+
+`GuzzleHttp\Psr7\BufferStream`
+
+Provides a buffer stream that can be written to fill a buffer, and read
+from to remove bytes from the buffer.
+
+This stream returns a "hwm" metadata value that tells upstream consumers
+what the configured high water mark of the stream is, or the maximum
+preferred size of the buffer.
+
+```php
+use GuzzleHttp\Psr7;
+
+// When more than 1024 bytes are in the buffer, it will begin returning
+// false to writes. This is an indication that writers should slow down.
+$buffer = new Psr7\BufferStream(1024);
+```
+
+
+## CachingStream
+
+The CachingStream is used to allow seeking over previously read bytes on
+non-seekable streams. This can be useful when transferring a non-seekable
+entity body fails due to needing to rewind the stream (for example, resulting
+from a redirect). Data that is read from the remote stream will be buffered in
+a PHP temp stream so that previously read bytes are cached first in memory,
+then on disk.
+
+```php
+use GuzzleHttp\Psr7;
+
+$original = Psr7\Utils::streamFor(fopen('http://www.google.com', 'r'));
+$stream = new Psr7\CachingStream($original);
+
+$stream->read(1024);
+echo $stream->tell();
+// 1024
+
+$stream->seek(0);
+echo $stream->tell();
+// 0
+```
+
+
+## DroppingStream
+
+`GuzzleHttp\Psr7\DroppingStream`
+
+Stream decorator that begins dropping data once the size of the underlying
+stream becomes too full.
+
+```php
+use GuzzleHttp\Psr7;
+
+// Create an empty stream
+$stream = Psr7\Utils::streamFor();
+
+// Start dropping data when the stream has more than 10 bytes
+$dropping = new Psr7\DroppingStream($stream, 10);
+
+$dropping->write('01234567890123456789');
+echo $stream; // 0123456789
+```
+
+
+## FnStream
+
+`GuzzleHttp\Psr7\FnStream`
+
+Compose stream implementations based on a hash of functions.
+
+Allows for easy testing and extension of a provided stream without needing
+to create a concrete class for a simple extension point.
+
+```php
+
+use GuzzleHttp\Psr7;
+
+$stream = Psr7\Utils::streamFor('hi');
+$fnStream = Psr7\FnStream::decorate($stream, [
+ 'rewind' => function () use ($stream) {
+ echo 'About to rewind - ';
+ $stream->rewind();
+ echo 'rewound!';
+ }
+]);
+
+$fnStream->rewind();
+// Outputs: About to rewind - rewound!
+```
+
+
+## InflateStream
+
+`GuzzleHttp\Psr7\InflateStream`
+
+Uses PHP's zlib.inflate filter to inflate deflate or gzipped content.
+
+This stream decorator skips the first 10 bytes of the given stream to remove
+the gzip header, converts the provided stream to a PHP stream resource,
+then appends the zlib.inflate filter. The stream is then converted back
+to a Guzzle stream resource to be used as a Guzzle stream.
+
+
+## LazyOpenStream
+
+`GuzzleHttp\Psr7\LazyOpenStream`
+
+Lazily reads or writes to a file that is opened only after an IO operation
+take place on the stream.
+
+```php
+use GuzzleHttp\Psr7;
+
+$stream = new Psr7\LazyOpenStream('/path/to/file', 'r');
+// The file has not yet been opened...
+
+echo $stream->read(10);
+// The file is opened and read from only when needed.
+```
+
+
+## LimitStream
+
+`GuzzleHttp\Psr7\LimitStream`
+
+LimitStream can be used to read a subset or slice of an existing stream object.
+This can be useful for breaking a large file into smaller pieces to be sent in
+chunks (e.g. Amazon S3's multipart upload API).
+
+```php
+use GuzzleHttp\Psr7;
+
+$original = Psr7\Utils::streamFor(fopen('/tmp/test.txt', 'r+'));
+echo $original->getSize();
+// >>> 1048576
+
+// Limit the size of the body to 1024 bytes and start reading from byte 2048
+$stream = new Psr7\LimitStream($original, 1024, 2048);
+echo $stream->getSize();
+// >>> 1024
+echo $stream->tell();
+// >>> 0
+```
+
+
+## MultipartStream
+
+`GuzzleHttp\Psr7\MultipartStream`
+
+Stream that when read returns bytes for a streaming multipart or
+multipart/form-data stream.
+
+
+## NoSeekStream
+
+`GuzzleHttp\Psr7\NoSeekStream`
+
+NoSeekStream wraps a stream and does not allow seeking.
+
+```php
+use GuzzleHttp\Psr7;
+
+$original = Psr7\Utils::streamFor('foo');
+$noSeek = new Psr7\NoSeekStream($original);
+
+echo $noSeek->read(3);
+// foo
+var_export($noSeek->isSeekable());
+// false
+$noSeek->seek(0);
+var_export($noSeek->read(3));
+// NULL
+```
+
+
+## PumpStream
+
+`GuzzleHttp\Psr7\PumpStream`
+
+Provides a read only stream that pumps data from a PHP callable.
+
+When invoking the provided callable, the PumpStream will pass the amount of
+data requested to read to the callable. The callable can choose to ignore
+this value and return fewer or more bytes than requested. Any extra data
+returned by the provided callable is buffered internally until drained using
+the read() function of the PumpStream. The provided callable MUST return
+false when there is no more data to read.
+
+
+## Implementing stream decorators
+
+Creating a stream decorator is very easy thanks to the
+`GuzzleHttp\Psr7\StreamDecoratorTrait`. This trait provides methods that
+implement `Psr\Http\Message\StreamInterface` by proxying to an underlying
+stream. Just `use` the `StreamDecoratorTrait` and implement your custom
+methods.
+
+For example, let's say we wanted to call a specific function each time the last
+byte is read from a stream. This could be implemented by overriding the
+`read()` method.
+
+```php
+use Psr\Http\Message\StreamInterface;
+use GuzzleHttp\Psr7\StreamDecoratorTrait;
+
+class EofCallbackStream implements StreamInterface
+{
+ use StreamDecoratorTrait;
+
+ private $callback;
+
+ public function __construct(StreamInterface $stream, callable $cb)
+ {
+ $this->stream = $stream;
+ $this->callback = $cb;
+ }
+
+ public function read($length)
+ {
+ $result = $this->stream->read($length);
+
+ // Invoke the callback when EOF is hit.
+ if ($this->eof()) {
+ call_user_func($this->callback);
+ }
+
+ return $result;
+ }
+}
+```
+
+This decorator could be added to any existing stream and used like so:
+
+```php
+use GuzzleHttp\Psr7;
+
+$original = Psr7\Utils::streamFor('foo');
+
+$eofStream = new EofCallbackStream($original, function () {
+ echo 'EOF!';
+});
+
+$eofStream->read(2);
+$eofStream->read(1);
+// echoes "EOF!"
+$eofStream->seek(0);
+$eofStream->read(3);
+// echoes "EOF!"
+```
+
+
+## PHP StreamWrapper
+
+You can use the `GuzzleHttp\Psr7\StreamWrapper` class if you need to use a
+PSR-7 stream as a PHP stream resource.
+
+Use the `GuzzleHttp\Psr7\StreamWrapper::getResource()` method to create a PHP
+stream from a PSR-7 stream.
+
+```php
+use GuzzleHttp\Psr7\StreamWrapper;
+
+$stream = GuzzleHttp\Psr7\Utils::streamFor('hello!');
+$resource = StreamWrapper::getResource($stream);
+echo fread($resource, 6); // outputs hello!
+```
+
+
+# Static API
+
+There are various static methods available under the `GuzzleHttp\Psr7` namespace.
+
+
+## `GuzzleHttp\Psr7\Message::toString`
+
+`public static function toString(MessageInterface $message): string`
+
+Returns the string representation of an HTTP message.
+
+```php
+$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com');
+echo GuzzleHttp\Psr7\Message::toString($request);
+```
+
+
+## `GuzzleHttp\Psr7\Message::bodySummary`
+
+`public static function bodySummary(MessageInterface $message, int $truncateAt = 120): string|null`
+
+Get a short summary of the message body.
+
+Will return `null` if the response is not printable.
+
+
+## `GuzzleHttp\Psr7\Message::rewindBody`
+
+`public static function rewindBody(MessageInterface $message): void`
+
+Attempts to rewind a message body and throws an exception on failure.
+
+The body of the message will only be rewound if a call to `tell()`
+returns a value other than `0`.
+
+
+## `GuzzleHttp\Psr7\Message::parseMessage`
+
+`public static function parseMessage(string $message): array`
+
+Parses an HTTP message into an associative array.
+
+The array contains the "start-line" key containing the start line of
+the message, "headers" key containing an associative array of header
+array values, and a "body" key containing the body of the message.
+
+
+## `GuzzleHttp\Psr7\Message::parseRequestUri`
+
+`public static function parseRequestUri(string $path, array $headers): string`
+
+Constructs a URI for an HTTP request message.
+
+
+## `GuzzleHttp\Psr7\Message::parseRequest`
+
+`public static function parseRequest(string $message): Request`
+
+Parses a request message string into a request object.
+
+
+## `GuzzleHttp\Psr7\Message::parseResponse`
+
+`public static function parseResponse(string $message): Response`
+
+Parses a response message string into a response object.
+
+
+## `GuzzleHttp\Psr7\Header::parse`
+
+`public static function parse(string|array $header): array`
+
+Parse an array of header values containing ";" separated data into an
+array of associative arrays representing the header key value pair data
+of the header. When a parameter does not contain a value, but just
+contains a key, this function will inject a key with a '' string value.
+
+
+## `GuzzleHttp\Psr7\Header::normalize`
+
+`public static function normalize(string|array $header): array`
+
+Converts an array of header values that may contain comma separated
+headers into an array of headers with no comma separated values.
+
+
+## `GuzzleHttp\Psr7\Query::parse`
+
+`public static function parse(string $str, int|bool $urlEncoding = true): array`
+
+Parse a query string into an associative array.
+
+If multiple values are found for the same key, the value of that key
+value pair will become an array. This function does not parse nested
+PHP style arrays into an associative array (e.g., `foo[a]=1&foo[b]=2`
+will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`.
+
+
+## `GuzzleHttp\Psr7\Query::build`
+
+`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986): string`
+
+Build a query string from an array of key value pairs.
+
+This function can use the return value of `parse()` to build a query
+string. This function does not modify the provided keys when an array is
+encountered (like `http_build_query()` would).
+
+
+## `GuzzleHttp\Psr7\Utils::caselessRemove`
+
+`public static function caselessRemove(iterable $keys, $keys, array $data): array`
+
+Remove the items given by the keys, case insensitively from the data.
+
+
+## `GuzzleHttp\Psr7\Utils::copyToStream`
+
+`public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void`
+
+Copy the contents of a stream into another stream until the given number
+of bytes have been read.
+
+
+## `GuzzleHttp\Psr7\Utils::copyToString`
+
+`public static function copyToString(StreamInterface $stream, int $maxLen = -1): string`
+
+Copy the contents of a stream into a string until the given number of
+bytes have been read.
+
+
+## `GuzzleHttp\Psr7\Utils::hash`
+
+`public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string`
+
+Calculate a hash of a stream.
+
+This method reads the entire stream to calculate a rolling hash, based on
+PHP's `hash_init` functions.
+
+
+## `GuzzleHttp\Psr7\Utils::modifyRequest`
+
+`public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface`
+
+Clone and modify a request with the given changes.
+
+This method is useful for reducing the number of clones needed to mutate
+a message.
+
+- method: (string) Changes the HTTP method.
+- set_headers: (array) Sets the given headers.
+- remove_headers: (array) Remove the given headers.
+- body: (mixed) Sets the given body.
+- uri: (UriInterface) Set the URI.
+- query: (string) Set the query string value of the URI.
+- version: (string) Set the protocol version.
+
+
+## `GuzzleHttp\Psr7\Utils::readLine`
+
+`public static function readLine(StreamInterface $stream, int $maxLength = null): string`
+
+Read a line from the stream up to the maximum allowed buffer length.
+
+
+## `GuzzleHttp\Psr7\Utils::streamFor`
+
+`public static function streamFor(resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource = '', array $options = []): StreamInterface`
+
+Create a new stream based on the input type.
+
+Options is an associative array that can contain the following keys:
+
+- metadata: Array of custom metadata.
+- size: Size of the stream.
+
+This method accepts the following `$resource` types:
+
+- `Psr\Http\Message\StreamInterface`: Returns the value as-is.
+- `string`: Creates a stream object that uses the given string as the contents.
+- `resource`: Creates a stream object that wraps the given PHP stream resource.
+- `Iterator`: If the provided value implements `Iterator`, then a read-only
+ stream object will be created that wraps the given iterable. Each time the
+ stream is read from, data from the iterator will fill a buffer and will be
+ continuously called until the buffer is equal to the requested read size.
+ Subsequent read calls will first read from the buffer and then call `next`
+ on the underlying iterator until it is exhausted.
+- `object` with `__toString()`: If the object has the `__toString()` method,
+ the object will be cast to a string and then a stream will be returned that
+ uses the string value.
+- `NULL`: When `null` is passed, an empty stream object is returned.
+- `callable` When a callable is passed, a read-only stream object will be
+ created that invokes the given callable. The callable is invoked with the
+ number of suggested bytes to read. The callable can return any number of
+ bytes, but MUST return `false` when there is no more data to return. The
+ stream object that wraps the callable will invoke the callable until the
+ number of requested bytes are available. Any additional bytes will be
+ buffered and used in subsequent reads.
+
+```php
+$stream = GuzzleHttp\Psr7\Utils::streamFor('foo');
+$stream = GuzzleHttp\Psr7\Utils::streamFor(fopen('/path/to/file', 'r'));
+
+$generator = function ($bytes) {
+ for ($i = 0; $i < $bytes; $i++) {
+ yield ' ';
+ }
+}
+
+$stream = GuzzleHttp\Psr7\Utils::streamFor($generator(100));
+```
+
+
+## `GuzzleHttp\Psr7\Utils::tryFopen`
+
+`public static function tryFopen(string $filename, string $mode): resource`
+
+Safely opens a PHP stream resource using a filename.
+
+When fopen fails, PHP normally raises a warning. This function adds an
+error handler that checks for errors and throws an exception instead.
+
+
+## `GuzzleHttp\Psr7\Utils::uriFor`
+
+`public static function uriFor(string|UriInterface $uri): UriInterface`
+
+Returns a UriInterface for the given value.
+
+This function accepts a string or UriInterface and returns a
+UriInterface for the given value. If the value is already a
+UriInterface, it is returned as-is.
+
+
+## `GuzzleHttp\Psr7\MimeType::fromFilename`
+
+`public static function fromFilename(string $filename): string|null`
+
+Determines the mimetype of a file by looking at its extension.
+
+
+## `GuzzleHttp\Psr7\MimeType::fromExtension`
+
+`public static function fromExtension(string $extension): string|null`
+
+Maps a file extensions to a mimetype.
+
+
+## Upgrading from Function API
+
+The static API was first introduced in 1.7.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API will be removed in 2.0.0. A migration table has been provided here for your convenience:
+
+| Original Function | Replacement Method |
+|----------------|----------------|
+| `str` | `Message::toString` |
+| `uri_for` | `Utils::uriFor` |
+| `stream_for` | `Utils::streamFor` |
+| `parse_header` | `Header::parse` |
+| `normalize_header` | `Header::normalize` |
+| `modify_request` | `Utils::modifyRequest` |
+| `rewind_body` | `Message::rewindBody` |
+| `try_fopen` | `Utils::tryFopen` |
+| `copy_to_string` | `Utils::copyToString` |
+| `copy_to_stream` | `Utils::copyToStream` |
+| `hash` | `Utils::hash` |
+| `readline` | `Utils::readLine` |
+| `parse_request` | `Message::parseRequest` |
+| `parse_response` | `Message::parseResponse` |
+| `parse_query` | `Query::parse` |
+| `build_query` | `Query::build` |
+| `mimetype_from_filename` | `MimeType::fromFilename` |
+| `mimetype_from_extension` | `MimeType::fromExtension` |
+| `_parse_message` | `Message::parseMessage` |
+| `_parse_request_uri` | `Message::parseRequestUri` |
+| `get_message_body_summary` | `Message::bodySummary` |
+| `_caseless_remove` | `Utils::caselessRemove` |
+
+
+# Additional URI Methods
+
+Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class,
+this library also provides additional functionality when working with URIs as static methods.
+
+## URI Types
+
+An instance of `Psr\Http\Message\UriInterface` can either be an absolute URI or a relative reference.
+An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI,
+the base URI. Relative references can be divided into several forms according to
+[RFC 3986 Section 4.2](https://tools.ietf.org/html/rfc3986#section-4.2):
+
+- network-path references, e.g. `//example.com/path`
+- absolute-path references, e.g. `/path`
+- relative-path references, e.g. `subpath`
+
+The following methods can be used to identify the type of the URI.
+
+### `GuzzleHttp\Psr7\Uri::isAbsolute`
+
+`public static function isAbsolute(UriInterface $uri): bool`
+
+Whether the URI is absolute, i.e. it has a scheme.
+
+### `GuzzleHttp\Psr7\Uri::isNetworkPathReference`
+
+`public static function isNetworkPathReference(UriInterface $uri): bool`
+
+Whether the URI is a network-path reference. A relative reference that begins with two slash characters is
+termed an network-path reference.
+
+### `GuzzleHttp\Psr7\Uri::isAbsolutePathReference`
+
+`public static function isAbsolutePathReference(UriInterface $uri): bool`
+
+Whether the URI is a absolute-path reference. A relative reference that begins with a single slash character is
+termed an absolute-path reference.
+
+### `GuzzleHttp\Psr7\Uri::isRelativePathReference`
+
+`public static function isRelativePathReference(UriInterface $uri): bool`
+
+Whether the URI is a relative-path reference. A relative reference that does not begin with a slash character is
+termed a relative-path reference.
+
+### `GuzzleHttp\Psr7\Uri::isSameDocumentReference`
+
+`public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool`
+
+Whether the URI is a same-document reference. A same-document reference refers to a URI that is, aside from its
+fragment component, identical to the base URI. When no base URI is given, only an empty URI reference
+(apart from its fragment) is considered a same-document reference.
+
+## URI Components
+
+Additional methods to work with URI components.
+
+### `GuzzleHttp\Psr7\Uri::isDefaultPort`
+
+`public static function isDefaultPort(UriInterface $uri): bool`
+
+Whether the URI has the default port of the current scheme. `Psr\Http\Message\UriInterface::getPort` may return null
+or the standard port. This method can be used independently of the implementation.
+
+### `GuzzleHttp\Psr7\Uri::composeComponents`
+
+`public static function composeComponents($scheme, $authority, $path, $query, $fragment): string`
+
+Composes a URI reference string from its various components according to
+[RFC 3986 Section 5.3](https://tools.ietf.org/html/rfc3986#section-5.3). Usually this method does not need to be called
+manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`.
+
+### `GuzzleHttp\Psr7\Uri::fromParts`
+
+`public static function fromParts(array $parts): UriInterface`
+
+Creates a URI from a hash of [`parse_url`](http://php.net/manual/en/function.parse-url.php) components.
+
+
+### `GuzzleHttp\Psr7\Uri::withQueryValue`
+
+`public static function withQueryValue(UriInterface $uri, $key, $value): UriInterface`
+
+Creates a new URI with a specific query string value. Any existing query string values that exactly match the
+provided key are removed and replaced with the given key value pair. A value of null will set the query string
+key without a value, e.g. "key" instead of "key=value".
+
+### `GuzzleHttp\Psr7\Uri::withQueryValues`
+
+`public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface`
+
+Creates a new URI with multiple query string values. It has the same behavior as `withQueryValue()` but for an
+associative array of key => value.
+
+### `GuzzleHttp\Psr7\Uri::withoutQueryValue`
+
+`public static function withoutQueryValue(UriInterface $uri, $key): UriInterface`
+
+Creates a new URI with a specific query string value removed. Any existing query string values that exactly match the
+provided key are removed.
+
+## Reference Resolution
+
+`GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according
+to [RFC 3986 Section 5](https://tools.ietf.org/html/rfc3986#section-5). This is for example also what web browsers
+do when resolving a link in a website based on the current request URI.
+
+### `GuzzleHttp\Psr7\UriResolver::resolve`
+
+`public static function resolve(UriInterface $base, UriInterface $rel): UriInterface`
+
+Converts the relative URI into a new URI that is resolved against the base URI.
+
+### `GuzzleHttp\Psr7\UriResolver::removeDotSegments`
+
+`public static function removeDotSegments(string $path): string`
+
+Removes dot segments from a path and returns the new path according to
+[RFC 3986 Section 5.2.4](https://tools.ietf.org/html/rfc3986#section-5.2.4).
+
+### `GuzzleHttp\Psr7\UriResolver::relativize`
+
+`public static function relativize(UriInterface $base, UriInterface $target): UriInterface`
+
+Returns the target URI as a relative reference from the base URI. This method is the counterpart to resolve():
+
+```php
+(string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target))
+```
+
+One use-case is to use the current request URI as base URI and then generate relative links in your documents
+to reduce the document size or offer self-contained downloadable document archives.
+
+```php
+$base = new Uri('http://example.com/a/b/');
+echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'.
+echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'.
+echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'.
+echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'.
+```
+
+## Normalization and Comparison
+
+`GuzzleHttp\Psr7\UriNormalizer` provides methods to normalize and compare URIs according to
+[RFC 3986 Section 6](https://tools.ietf.org/html/rfc3986#section-6).
+
+### `GuzzleHttp\Psr7\UriNormalizer::normalize`
+
+`public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS): UriInterface`
+
+Returns a normalized URI. The scheme and host component are already normalized to lowercase per PSR-7 UriInterface.
+This methods adds additional normalizations that can be configured with the `$flags` parameter which is a bitmask
+of normalizations to apply. The following normalizations are available:
+
+- `UriNormalizer::PRESERVING_NORMALIZATIONS`
+
+ Default normalizations which only include the ones that preserve semantics.
+
+- `UriNormalizer::CAPITALIZE_PERCENT_ENCODING`
+
+ All letters within a percent-encoding triplet (e.g., "%3A") are case-insensitive, and should be capitalized.
+
+ Example: `http://example.org/a%c2%b1b` → `http://example.org/a%C2%B1b`
+
+- `UriNormalizer::DECODE_UNRESERVED_CHARACTERS`
+
+ Decodes percent-encoded octets of unreserved characters. For consistency, percent-encoded octets in the ranges of
+ ALPHA (%41–%5A and %61–%7A), DIGIT (%30–%39), hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E) should
+ not be created by URI producers and, when found in a URI, should be decoded to their corresponding unreserved
+ characters by URI normalizers.
+
+ Example: `http://example.org/%7Eusern%61me/` → `http://example.org/~username/`
+
+- `UriNormalizer::CONVERT_EMPTY_PATH`
+
+ Converts the empty path to "/" for http and https URIs.
+
+ Example: `http://example.org` → `http://example.org/`
+
+- `UriNormalizer::REMOVE_DEFAULT_HOST`
+
+ Removes the default host of the given URI scheme from the URI. Only the "file" scheme defines the default host
+ "localhost". All of `file:/myfile`, `file:///myfile`, and `file://localhost/myfile` are equivalent according to
+ RFC 3986.
+
+ Example: `file://localhost/myfile` → `file:///myfile`
+
+- `UriNormalizer::REMOVE_DEFAULT_PORT`
+
+ Removes the default port of the given URI scheme from the URI.
+
+ Example: `http://example.org:80/` → `http://example.org/`
+
+- `UriNormalizer::REMOVE_DOT_SEGMENTS`
+
+ Removes unnecessary dot-segments. Dot-segments in relative-path references are not removed as it would
+ change the semantics of the URI reference.
+
+ Example: `http://example.org/../a/b/../c/./d.html` → `http://example.org/a/c/d.html`
+
+- `UriNormalizer::REMOVE_DUPLICATE_SLASHES`
+
+ Paths which include two or more adjacent slashes are converted to one. Webservers usually ignore duplicate slashes
+ and treat those URIs equivalent. But in theory those URIs do not need to be equivalent. So this normalization
+ may change the semantics. Encoded slashes (%2F) are not removed.
+
+ Example: `http://example.org//foo///bar.html` → `http://example.org/foo/bar.html`
+
+- `UriNormalizer::SORT_QUERY_PARAMETERS`
+
+ Sort query parameters with their values in alphabetical order. However, the order of parameters in a URI may be
+ significant (this is not defined by the standard). So this normalization is not safe and may change the semantics
+ of the URI.
+
+ Example: `?lang=en&article=fred` → `?article=fred&lang=en`
+
+### `GuzzleHttp\Psr7\UriNormalizer::isEquivalent`
+
+`public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS): bool`
+
+Whether two URIs can be considered equivalent. Both URIs are normalized automatically before comparison with the given
+`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent.
+This of course assumes they will be resolved against the same base URI. If this is not the case, determination of
+equivalence or difference of relative references does not mean anything.
diff --git a/lib/gerencianet/guzzlehttp/psr7/composer.json b/lib/gerencianet/guzzlehttp/psr7/composer.json
new file mode 100644
index 0000000..58dcb07
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/composer.json
@@ -0,0 +1,49 @@
+{
+ "name": "guzzlehttp/psr7",
+ "type": "library",
+ "description": "PSR-7 message implementation that also provides common utility methods",
+ "keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"],
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Tobias Schultze",
+ "homepage": "https://github.com/Tobion"
+ }
+ ],
+ "require": {
+ "php": ">=5.4.0",
+ "psr/http-message": "~1.0",
+ "ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10",
+ "ext-zlib": "*"
+ },
+ "provide": {
+ "psr/http-message-implementation": "1.0"
+ },
+ "suggest": {
+ "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
+ },
+ "autoload": {
+ "psr-4": {
+ "GuzzleHttp\\Psr7\\": "src/"
+ },
+ "files": ["src/functions_include.php"]
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "GuzzleHttp\\Tests\\Psr7\\": "tests/"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.7-dev"
+ }
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/AppendStream.php b/lib/gerencianet/guzzlehttp/psr7/src/AppendStream.php
new file mode 100644
index 0000000..fa9153d
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/AppendStream.php
@@ -0,0 +1,246 @@
+addStream($stream);
+ }
+ }
+
+ public function __toString()
+ {
+ try {
+ $this->rewind();
+ return $this->getContents();
+ } catch (\Exception $e) {
+ return '';
+ }
+ }
+
+ /**
+ * Add a stream to the AppendStream
+ *
+ * @param StreamInterface $stream Stream to append. Must be readable.
+ *
+ * @throws \InvalidArgumentException if the stream is not readable
+ */
+ public function addStream(StreamInterface $stream)
+ {
+ if (!$stream->isReadable()) {
+ throw new \InvalidArgumentException('Each stream must be readable');
+ }
+
+ // The stream is only seekable if all streams are seekable
+ if (!$stream->isSeekable()) {
+ $this->seekable = false;
+ }
+
+ $this->streams[] = $stream;
+ }
+
+ public function getContents()
+ {
+ return Utils::copyToString($this);
+ }
+
+ /**
+ * Closes each attached stream.
+ *
+ * {@inheritdoc}
+ */
+ public function close()
+ {
+ $this->pos = $this->current = 0;
+ $this->seekable = true;
+
+ foreach ($this->streams as $stream) {
+ $stream->close();
+ }
+
+ $this->streams = [];
+ }
+
+ /**
+ * Detaches each attached stream.
+ *
+ * Returns null as it's not clear which underlying stream resource to return.
+ *
+ * {@inheritdoc}
+ */
+ public function detach()
+ {
+ $this->pos = $this->current = 0;
+ $this->seekable = true;
+
+ foreach ($this->streams as $stream) {
+ $stream->detach();
+ }
+
+ $this->streams = [];
+
+ return null;
+ }
+
+ public function tell()
+ {
+ return $this->pos;
+ }
+
+ /**
+ * Tries to calculate the size by adding the size of each stream.
+ *
+ * If any of the streams do not return a valid number, then the size of the
+ * append stream cannot be determined and null is returned.
+ *
+ * {@inheritdoc}
+ */
+ public function getSize()
+ {
+ $size = 0;
+
+ foreach ($this->streams as $stream) {
+ $s = $stream->getSize();
+ if ($s === null) {
+ return null;
+ }
+ $size += $s;
+ }
+
+ return $size;
+ }
+
+ public function eof()
+ {
+ return !$this->streams ||
+ ($this->current >= count($this->streams) - 1 &&
+ $this->streams[$this->current]->eof());
+ }
+
+ public function rewind()
+ {
+ $this->seek(0);
+ }
+
+ /**
+ * Attempts to seek to the given position. Only supports SEEK_SET.
+ *
+ * {@inheritdoc}
+ */
+ public function seek($offset, $whence = SEEK_SET)
+ {
+ if (!$this->seekable) {
+ throw new \RuntimeException('This AppendStream is not seekable');
+ } elseif ($whence !== SEEK_SET) {
+ throw new \RuntimeException('The AppendStream can only seek with SEEK_SET');
+ }
+
+ $this->pos = $this->current = 0;
+
+ // Rewind each stream
+ foreach ($this->streams as $i => $stream) {
+ try {
+ $stream->rewind();
+ } catch (\Exception $e) {
+ throw new \RuntimeException('Unable to seek stream '
+ . $i . ' of the AppendStream', 0, $e);
+ }
+ }
+
+ // Seek to the actual position by reading from each stream
+ while ($this->pos < $offset && !$this->eof()) {
+ $result = $this->read(min(8096, $offset - $this->pos));
+ if ($result === '') {
+ break;
+ }
+ }
+ }
+
+ /**
+ * Reads from all of the appended streams until the length is met or EOF.
+ *
+ * {@inheritdoc}
+ */
+ public function read($length)
+ {
+ $buffer = '';
+ $total = count($this->streams) - 1;
+ $remaining = $length;
+ $progressToNext = false;
+
+ while ($remaining > 0) {
+
+ // Progress to the next stream if needed.
+ if ($progressToNext || $this->streams[$this->current]->eof()) {
+ $progressToNext = false;
+ if ($this->current === $total) {
+ break;
+ }
+ $this->current++;
+ }
+
+ $result = $this->streams[$this->current]->read($remaining);
+
+ // Using a loose comparison here to match on '', false, and null
+ if ($result == null) {
+ $progressToNext = true;
+ continue;
+ }
+
+ $buffer .= $result;
+ $remaining = $length - strlen($buffer);
+ }
+
+ $this->pos += strlen($buffer);
+
+ return $buffer;
+ }
+
+ public function isReadable()
+ {
+ return true;
+ }
+
+ public function isWritable()
+ {
+ return false;
+ }
+
+ public function isSeekable()
+ {
+ return $this->seekable;
+ }
+
+ public function write($string)
+ {
+ throw new \RuntimeException('Cannot write to an AppendStream');
+ }
+
+ public function getMetadata($key = null)
+ {
+ return $key ? null : [];
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/streams/src/BufferStream.php b/lib/gerencianet/guzzlehttp/psr7/src/BufferStream.php
similarity index 88%
rename from lib/gerencianet/guzzlehttp/streams/src/BufferStream.php
rename to lib/gerencianet/guzzlehttp/psr7/src/BufferStream.php
index 0fffbd6..783859c 100644
--- a/lib/gerencianet/guzzlehttp/streams/src/BufferStream.php
+++ b/lib/gerencianet/guzzlehttp/psr7/src/BufferStream.php
@@ -1,7 +1,8 @@
close();
- }
- public function attach($stream)
- {
- throw new CannotAttachException();
+ return null;
}
public function getSize()
@@ -78,9 +76,14 @@ public function isSeekable()
return false;
}
+ public function rewind()
+ {
+ $this->seek(0);
+ }
+
public function seek($offset, $whence = SEEK_SET)
{
- return false;
+ throw new \RuntimeException('Cannot seek a BufferStream');
}
public function eof()
@@ -90,7 +93,7 @@ public function eof()
public function tell()
{
- return false;
+ throw new \RuntimeException('Cannot determine the position of a BufferStream');
}
/**
@@ -120,6 +123,7 @@ public function write($string)
{
$this->buffer .= $string;
+ // TODO: What should happen here?
if (strlen($this->buffer) >= $this->hwm) {
return false;
}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/CachingStream.php b/lib/gerencianet/guzzlehttp/psr7/src/CachingStream.php
new file mode 100644
index 0000000..fe749e9
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/CachingStream.php
@@ -0,0 +1,141 @@
+remoteStream = $stream;
+ $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+'));
+ }
+
+ public function getSize()
+ {
+ return max($this->stream->getSize(), $this->remoteStream->getSize());
+ }
+
+ public function rewind()
+ {
+ $this->seek(0);
+ }
+
+ public function seek($offset, $whence = SEEK_SET)
+ {
+ if ($whence == SEEK_SET) {
+ $byte = $offset;
+ } elseif ($whence == SEEK_CUR) {
+ $byte = $offset + $this->tell();
+ } elseif ($whence == SEEK_END) {
+ $size = $this->remoteStream->getSize();
+ if ($size === null) {
+ $size = $this->cacheEntireStream();
+ }
+ $byte = $size + $offset;
+ } else {
+ throw new \InvalidArgumentException('Invalid whence');
+ }
+
+ $diff = $byte - $this->stream->getSize();
+
+ if ($diff > 0) {
+ // Read the remoteStream until we have read in at least the amount
+ // of bytes requested, or we reach the end of the file.
+ while ($diff > 0 && !$this->remoteStream->eof()) {
+ $this->read($diff);
+ $diff = $byte - $this->stream->getSize();
+ }
+ } else {
+ // We can just do a normal seek since we've already seen this byte.
+ $this->stream->seek($byte);
+ }
+ }
+
+ public function read($length)
+ {
+ // Perform a regular read on any previously read data from the buffer
+ $data = $this->stream->read($length);
+ $remaining = $length - strlen($data);
+
+ // More data was requested so read from the remote stream
+ if ($remaining) {
+ // If data was written to the buffer in a position that would have
+ // been filled from the remote stream, then we must skip bytes on
+ // the remote stream to emulate overwriting bytes from that
+ // position. This mimics the behavior of other PHP stream wrappers.
+ $remoteData = $this->remoteStream->read(
+ $remaining + $this->skipReadBytes
+ );
+
+ if ($this->skipReadBytes) {
+ $len = strlen($remoteData);
+ $remoteData = substr($remoteData, $this->skipReadBytes);
+ $this->skipReadBytes = max(0, $this->skipReadBytes - $len);
+ }
+
+ $data .= $remoteData;
+ $this->stream->write($remoteData);
+ }
+
+ return $data;
+ }
+
+ public function write($string)
+ {
+ // When appending to the end of the currently read stream, you'll want
+ // to skip bytes from being read from the remote stream to emulate
+ // other stream wrappers. Basically replacing bytes of data of a fixed
+ // length.
+ $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell();
+ if ($overflow > 0) {
+ $this->skipReadBytes += $overflow;
+ }
+
+ return $this->stream->write($string);
+ }
+
+ public function eof()
+ {
+ return $this->stream->eof() && $this->remoteStream->eof();
+ }
+
+ /**
+ * Close both the remote stream and buffer stream
+ */
+ public function close()
+ {
+ $this->remoteStream->close() && $this->stream->close();
+ }
+
+ private function cacheEntireStream()
+ {
+ $target = new FnStream(['write' => 'strlen']);
+ Utils::copyToStream($this, $target);
+
+ return $this->tell();
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/streams/src/DroppingStream.php b/lib/gerencianet/guzzlehttp/psr7/src/DroppingStream.php
similarity index 78%
rename from lib/gerencianet/guzzlehttp/streams/src/DroppingStream.php
rename to lib/gerencianet/guzzlehttp/psr7/src/DroppingStream.php
index 56ee80c..9f7420c 100644
--- a/lib/gerencianet/guzzlehttp/streams/src/DroppingStream.php
+++ b/lib/gerencianet/guzzlehttp/psr7/src/DroppingStream.php
@@ -1,9 +1,14 @@
maxLength - $this->stream->getSize();
- // Begin returning false when the underlying stream is too large.
+ // Begin returning 0 when the underlying stream is too large.
if ($diff <= 0) {
- return false;
+ return 0;
}
// Write the stream or a subset of the stream if needed.
@@ -35,8 +40,6 @@ public function write($string)
return $this->stream->write($string);
}
- $this->stream->write(substr($string, 0, $diff));
-
- return false;
+ return $this->stream->write(substr($string, 0, $diff));
}
}
diff --git a/lib/gerencianet/guzzlehttp/streams/src/FnStream.php b/lib/gerencianet/guzzlehttp/psr7/src/FnStream.php
similarity index 85%
rename from lib/gerencianet/guzzlehttp/streams/src/FnStream.php
rename to lib/gerencianet/guzzlehttp/psr7/src/FnStream.php
index 6b5872d..76a8cc7 100644
--- a/lib/gerencianet/guzzlehttp/streams/src/FnStream.php
+++ b/lib/gerencianet/guzzlehttp/psr7/src/FnStream.php
@@ -1,11 +1,16 @@
_fn_detach);
}
- public function attach($stream)
- {
- return call_user_func($this->_fn_attach, $stream);
- }
-
public function getSize()
{
return call_user_func($this->_fn_getSize);
@@ -110,9 +121,14 @@ public function isSeekable()
return call_user_func($this->_fn_isSeekable);
}
+ public function rewind()
+ {
+ call_user_func($this->_fn_rewind);
+ }
+
public function seek($offset, $whence = SEEK_SET)
{
- return call_user_func($this->_fn_seek, $offset, $whence);
+ call_user_func($this->_fn_seek, $offset, $whence);
}
public function isWritable()
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/Header.php b/lib/gerencianet/guzzlehttp/psr7/src/Header.php
new file mode 100644
index 0000000..865d742
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/Header.php
@@ -0,0 +1,71 @@
+]+>|[^=]+/', $kvp, $matches)) {
+ $m = $matches[0];
+ if (isset($m[1])) {
+ $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed);
+ } else {
+ $part[] = trim($m[0], $trimmed);
+ }
+ }
+ }
+ if ($part) {
+ $params[] = $part;
+ }
+ }
+
+ return $params;
+ }
+
+ /**
+ * Converts an array of header values that may contain comma separated
+ * headers into an array of headers with no comma separated values.
+ *
+ * @param string|array $header Header to normalize.
+ *
+ * @return array Returns the normalized header field values.
+ */
+ public static function normalize($header)
+ {
+ if (!is_array($header)) {
+ return array_map('trim', explode(',', $header));
+ }
+
+ $result = [];
+ foreach ($header as $value) {
+ foreach ((array) $value as $v) {
+ if (strpos($v, ',') === false) {
+ $result[] = $v;
+ continue;
+ }
+ foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) {
+ $result[] = trim($vv);
+ }
+ }
+ }
+
+ return $result;
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/InflateStream.php b/lib/gerencianet/guzzlehttp/psr7/src/InflateStream.php
new file mode 100644
index 0000000..0cbd2cc
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/InflateStream.php
@@ -0,0 +1,56 @@
+read(10);
+ $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header);
+ // Skip the header, that is 10 + length of filename + 1 (nil) bytes
+ $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength);
+ $resource = StreamWrapper::getResource($stream);
+ stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ);
+ $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource));
+ }
+
+ /**
+ * @param StreamInterface $stream
+ * @param $header
+ *
+ * @return int
+ */
+ private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header)
+ {
+ $filename_header_length = 0;
+
+ if (substr(bin2hex($header), 6, 2) === '08') {
+ // we have a filename, read until nil
+ $filename_header_length = 1;
+ while ($stream->read(1) !== chr(0)) {
+ $filename_header_length++;
+ }
+ }
+
+ return $filename_header_length;
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/streams/src/LazyOpenStream.php b/lib/gerencianet/guzzlehttp/psr7/src/LazyOpenStream.php
similarity index 79%
rename from lib/gerencianet/guzzlehttp/streams/src/LazyOpenStream.php
rename to lib/gerencianet/guzzlehttp/psr7/src/LazyOpenStream.php
index 6242ee7..911e127 100644
--- a/lib/gerencianet/guzzlehttp/streams/src/LazyOpenStream.php
+++ b/lib/gerencianet/guzzlehttp/psr7/src/LazyOpenStream.php
@@ -1,9 +1,14 @@
filename, $this->mode));
+ return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode));
}
}
diff --git a/lib/gerencianet/guzzlehttp/streams/src/LimitStream.php b/lib/gerencianet/guzzlehttp/psr7/src/LimitStream.php
similarity index 79%
rename from lib/gerencianet/guzzlehttp/streams/src/LimitStream.php
rename to lib/gerencianet/guzzlehttp/psr7/src/LimitStream.php
index e9fad98..1173ec4 100644
--- a/lib/gerencianet/guzzlehttp/streams/src/LimitStream.php
+++ b/lib/gerencianet/guzzlehttp/psr7/src/LimitStream.php
@@ -1,10 +1,13 @@
stream->tell();
- if ($tell === false) {
- return false;
- }
-
- return $tell >= $this->offset + $this->limit;
+ return $this->stream->tell() >= $this->offset + $this->limit;
}
/**
@@ -75,7 +73,11 @@ public function getSize()
public function seek($offset, $whence = SEEK_SET)
{
if ($whence !== SEEK_SET || $offset < 0) {
- return false;
+ throw new \RuntimeException(sprintf(
+ 'Cannot seek to offset %s with whence %s',
+ $offset,
+ $whence
+ ));
}
$offset += $this->offset;
@@ -86,7 +88,7 @@ public function seek($offset, $whence = SEEK_SET)
}
}
- return $this->stream->seek($offset);
+ $this->stream->seek($offset);
}
/**
@@ -103,8 +105,7 @@ public function tell()
*
* @param int $offset Offset to seek to and begin byte limiting from
*
- * @return self
- * @throws SeekException
+ * @throws \RuntimeException if the stream cannot be seeked.
*/
public function setOffset($offset)
{
@@ -112,18 +113,16 @@ public function setOffset($offset)
if ($current !== $offset) {
// If the stream cannot seek to the offset position, then read to it
- if (!$this->stream->seek($offset)) {
- if ($current > $offset) {
- throw new SeekException($this, $offset);
- } else {
- $this->stream->read($offset - $current);
- }
+ if ($this->stream->isSeekable()) {
+ $this->stream->seek($offset);
+ } elseif ($current > $offset) {
+ throw new \RuntimeException("Could not seek to stream offset $offset");
+ } else {
+ $this->stream->read($offset - $current);
}
}
$this->offset = $offset;
-
- return $this;
}
/**
@@ -132,13 +131,10 @@ public function setOffset($offset)
*
* @param int $limit Number of bytes to allow to be read from the stream.
* Use -1 for no limit.
- * @return self
*/
public function setLimit($limit)
{
$this->limit = $limit;
-
- return $this;
}
public function read($length)
@@ -154,8 +150,8 @@ public function read($length)
// Only return the amount of requested data, ensuring that the byte
// limit is not exceeded
return $this->stream->read(min($remaining, $length));
- } else {
- return false;
}
+
+ return '';
}
}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/Message.php b/lib/gerencianet/guzzlehttp/psr7/src/Message.php
new file mode 100644
index 0000000..516d1cb
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/Message.php
@@ -0,0 +1,252 @@
+getMethod() . ' '
+ . $message->getRequestTarget())
+ . ' HTTP/' . $message->getProtocolVersion();
+ if (!$message->hasHeader('host')) {
+ $msg .= "\r\nHost: " . $message->getUri()->getHost();
+ }
+ } elseif ($message instanceof ResponseInterface) {
+ $msg = 'HTTP/' . $message->getProtocolVersion() . ' '
+ . $message->getStatusCode() . ' '
+ . $message->getReasonPhrase();
+ } else {
+ throw new \InvalidArgumentException('Unknown message type');
+ }
+
+ foreach ($message->getHeaders() as $name => $values) {
+ if (strtolower($name) === 'set-cookie') {
+ foreach ($values as $value) {
+ $msg .= "\r\n{$name}: " . $value;
+ }
+ } else {
+ $msg .= "\r\n{$name}: " . implode(', ', $values);
+ }
+ }
+
+ return "{$msg}\r\n\r\n" . $message->getBody();
+ }
+
+ /**
+ * Get a short summary of the message body.
+ *
+ * Will return `null` if the response is not printable.
+ *
+ * @param MessageInterface $message The message to get the body summary
+ * @param int $truncateAt The maximum allowed size of the summary
+ *
+ * @return string|null
+ */
+ public static function bodySummary(MessageInterface $message, $truncateAt = 120)
+ {
+ $body = $message->getBody();
+
+ if (!$body->isSeekable() || !$body->isReadable()) {
+ return null;
+ }
+
+ $size = $body->getSize();
+
+ if ($size === 0) {
+ return null;
+ }
+
+ $summary = $body->read($truncateAt);
+ $body->rewind();
+
+ if ($size > $truncateAt) {
+ $summary .= ' (truncated...)';
+ }
+
+ // Matches any printable character, including unicode characters:
+ // letters, marks, numbers, punctuation, spacing, and separators.
+ if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary)) {
+ return null;
+ }
+
+ return $summary;
+ }
+
+ /**
+ * Attempts to rewind a message body and throws an exception on failure.
+ *
+ * The body of the message will only be rewound if a call to `tell()`
+ * returns a value other than `0`.
+ *
+ * @param MessageInterface $message Message to rewind
+ *
+ * @throws \RuntimeException
+ */
+ public static function rewindBody(MessageInterface $message)
+ {
+ $body = $message->getBody();
+
+ if ($body->tell()) {
+ $body->rewind();
+ }
+ }
+
+ /**
+ * Parses an HTTP message into an associative array.
+ *
+ * The array contains the "start-line" key containing the start line of
+ * the message, "headers" key containing an associative array of header
+ * array values, and a "body" key containing the body of the message.
+ *
+ * @param string $message HTTP request or response to parse.
+ *
+ * @return array
+ */
+ public static function parseMessage($message)
+ {
+ if (!$message) {
+ throw new \InvalidArgumentException('Invalid message');
+ }
+
+ $message = ltrim($message, "\r\n");
+
+ $messageParts = preg_split("/\r?\n\r?\n/", $message, 2);
+
+ if ($messageParts === false || count($messageParts) !== 2) {
+ throw new \InvalidArgumentException('Invalid message: Missing header delimiter');
+ }
+
+ list($rawHeaders, $body) = $messageParts;
+ $rawHeaders .= "\r\n"; // Put back the delimiter we split previously
+ $headerParts = preg_split("/\r?\n/", $rawHeaders, 2);
+
+ if ($headerParts === false || count($headerParts) !== 2) {
+ throw new \InvalidArgumentException('Invalid message: Missing status line');
+ }
+
+ list($startLine, $rawHeaders) = $headerParts;
+
+ if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') {
+ // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0
+ $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders);
+ }
+
+ /** @var array[] $headerLines */
+ $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER);
+
+ // If these aren't the same, then one line didn't match and there's an invalid header.
+ if ($count !== substr_count($rawHeaders, "\n")) {
+ // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4
+ if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) {
+ throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding');
+ }
+
+ throw new \InvalidArgumentException('Invalid header syntax');
+ }
+
+ $headers = [];
+
+ foreach ($headerLines as $headerLine) {
+ $headers[$headerLine[1]][] = $headerLine[2];
+ }
+
+ return [
+ 'start-line' => $startLine,
+ 'headers' => $headers,
+ 'body' => $body,
+ ];
+ }
+
+ /**
+ * Constructs a URI for an HTTP request message.
+ *
+ * @param string $path Path from the start-line
+ * @param array $headers Array of headers (each value an array).
+ *
+ * @return string
+ */
+ public static function parseRequestUri($path, array $headers)
+ {
+ $hostKey = array_filter(array_keys($headers), function ($k) {
+ return strtolower($k) === 'host';
+ });
+
+ // If no host is found, then a full URI cannot be constructed.
+ if (!$hostKey) {
+ return $path;
+ }
+
+ $host = $headers[reset($hostKey)][0];
+ $scheme = substr($host, -4) === ':443' ? 'https' : 'http';
+
+ return $scheme . '://' . $host . '/' . ltrim($path, '/');
+ }
+
+ /**
+ * Parses a request message string into a request object.
+ *
+ * @param string $message Request message string.
+ *
+ * @return Request
+ */
+ public static function parseRequest($message)
+ {
+ $data = self::parseMessage($message);
+ $matches = [];
+ if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) {
+ throw new \InvalidArgumentException('Invalid request string');
+ }
+ $parts = explode(' ', $data['start-line'], 3);
+ $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1';
+
+ $request = new Request(
+ $parts[0],
+ $matches[1] === '/' ? self::parseRequestUri($parts[1], $data['headers']) : $parts[1],
+ $data['headers'],
+ $data['body'],
+ $version
+ );
+
+ return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]);
+ }
+
+ /**
+ * Parses a response message string into a response object.
+ *
+ * @param string $message Response message string.
+ *
+ * @return Response
+ */
+ public static function parseResponse($message)
+ {
+ $data = self::parseMessage($message);
+ // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space
+ // between status-code and reason-phrase is required. But browsers accept
+ // responses without space and reason as well.
+ if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) {
+ throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']);
+ }
+ $parts = explode(' ', $data['start-line'], 3);
+
+ return new Response(
+ (int) $parts[1],
+ $data['headers'],
+ $data['body'],
+ explode('/', $parts[0])[1],
+ isset($parts[2]) ? $parts[2] : null
+ );
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/MessageTrait.php b/lib/gerencianet/guzzlehttp/psr7/src/MessageTrait.php
new file mode 100644
index 0000000..99203bb
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/MessageTrait.php
@@ -0,0 +1,214 @@
+ array of values */
+ private $headers = [];
+
+ /** @var array Map of lowercase header name => original name at registration */
+ private $headerNames = [];
+
+ /** @var string */
+ private $protocol = '1.1';
+
+ /** @var StreamInterface|null */
+ private $stream;
+
+ public function getProtocolVersion()
+ {
+ return $this->protocol;
+ }
+
+ public function withProtocolVersion($version)
+ {
+ if ($this->protocol === $version) {
+ return $this;
+ }
+
+ $new = clone $this;
+ $new->protocol = $version;
+ return $new;
+ }
+
+ public function getHeaders()
+ {
+ return $this->headers;
+ }
+
+ public function hasHeader($header)
+ {
+ return isset($this->headerNames[strtolower($header)]);
+ }
+
+ public function getHeader($header)
+ {
+ $header = strtolower($header);
+
+ if (!isset($this->headerNames[$header])) {
+ return [];
+ }
+
+ $header = $this->headerNames[$header];
+
+ return $this->headers[$header];
+ }
+
+ public function getHeaderLine($header)
+ {
+ return implode(', ', $this->getHeader($header));
+ }
+
+ public function withHeader($header, $value)
+ {
+ $this->assertHeader($header);
+ $value = $this->normalizeHeaderValue($value);
+ $normalized = strtolower($header);
+
+ $new = clone $this;
+ if (isset($new->headerNames[$normalized])) {
+ unset($new->headers[$new->headerNames[$normalized]]);
+ }
+ $new->headerNames[$normalized] = $header;
+ $new->headers[$header] = $value;
+
+ return $new;
+ }
+
+ public function withAddedHeader($header, $value)
+ {
+ $this->assertHeader($header);
+ $value = $this->normalizeHeaderValue($value);
+ $normalized = strtolower($header);
+
+ $new = clone $this;
+ if (isset($new->headerNames[$normalized])) {
+ $header = $this->headerNames[$normalized];
+ $new->headers[$header] = array_merge($this->headers[$header], $value);
+ } else {
+ $new->headerNames[$normalized] = $header;
+ $new->headers[$header] = $value;
+ }
+
+ return $new;
+ }
+
+ public function withoutHeader($header)
+ {
+ $normalized = strtolower($header);
+
+ if (!isset($this->headerNames[$normalized])) {
+ return $this;
+ }
+
+ $header = $this->headerNames[$normalized];
+
+ $new = clone $this;
+ unset($new->headers[$header], $new->headerNames[$normalized]);
+
+ return $new;
+ }
+
+ public function getBody()
+ {
+ if (!$this->stream) {
+ $this->stream = Utils::streamFor('');
+ }
+
+ return $this->stream;
+ }
+
+ public function withBody(StreamInterface $body)
+ {
+ if ($body === $this->stream) {
+ return $this;
+ }
+
+ $new = clone $this;
+ $new->stream = $body;
+ return $new;
+ }
+
+ private function setHeaders(array $headers)
+ {
+ $this->headerNames = $this->headers = [];
+ foreach ($headers as $header => $value) {
+ if (is_int($header)) {
+ // Numeric array keys are converted to int by PHP but having a header name '123' is not forbidden by the spec
+ // and also allowed in withHeader(). So we need to cast it to string again for the following assertion to pass.
+ $header = (string) $header;
+ }
+ $this->assertHeader($header);
+ $value = $this->normalizeHeaderValue($value);
+ $normalized = strtolower($header);
+ if (isset($this->headerNames[$normalized])) {
+ $header = $this->headerNames[$normalized];
+ $this->headers[$header] = array_merge($this->headers[$header], $value);
+ } else {
+ $this->headerNames[$normalized] = $header;
+ $this->headers[$header] = $value;
+ }
+ }
+ }
+
+ private function normalizeHeaderValue($value)
+ {
+ if (!is_array($value)) {
+ return $this->trimHeaderValues([$value]);
+ }
+
+ if (count($value) === 0) {
+ throw new \InvalidArgumentException('Header value can not be an empty array.');
+ }
+
+ return $this->trimHeaderValues($value);
+ }
+
+ /**
+ * Trims whitespace from the header values.
+ *
+ * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field.
+ *
+ * header-field = field-name ":" OWS field-value OWS
+ * OWS = *( SP / HTAB )
+ *
+ * @param string[] $values Header values
+ *
+ * @return string[] Trimmed header values
+ *
+ * @see https://tools.ietf.org/html/rfc7230#section-3.2.4
+ */
+ private function trimHeaderValues(array $values)
+ {
+ return array_map(function ($value) {
+ if (!is_scalar($value) && null !== $value) {
+ throw new \InvalidArgumentException(sprintf(
+ 'Header value must be scalar or null but %s provided.',
+ is_object($value) ? get_class($value) : gettype($value)
+ ));
+ }
+
+ return trim((string) $value, " \t");
+ }, array_values($values));
+ }
+
+ private function assertHeader($header)
+ {
+ if (!is_string($header)) {
+ throw new \InvalidArgumentException(sprintf(
+ 'Header name must be a string but %s provided.',
+ is_object($header) ? get_class($header) : gettype($header)
+ ));
+ }
+
+ if ($header === '') {
+ throw new \InvalidArgumentException('Header name can not be empty.');
+ }
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/MimeType.php b/lib/gerencianet/guzzlehttp/psr7/src/MimeType.php
new file mode 100644
index 0000000..205c7b1
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/MimeType.php
@@ -0,0 +1,140 @@
+ 'video/3gpp',
+ '7z' => 'application/x-7z-compressed',
+ 'aac' => 'audio/x-aac',
+ 'ai' => 'application/postscript',
+ 'aif' => 'audio/x-aiff',
+ 'asc' => 'text/plain',
+ 'asf' => 'video/x-ms-asf',
+ 'atom' => 'application/atom+xml',
+ 'avi' => 'video/x-msvideo',
+ 'bmp' => 'image/bmp',
+ 'bz2' => 'application/x-bzip2',
+ 'cer' => 'application/pkix-cert',
+ 'crl' => 'application/pkix-crl',
+ 'crt' => 'application/x-x509-ca-cert',
+ 'css' => 'text/css',
+ 'csv' => 'text/csv',
+ 'cu' => 'application/cu-seeme',
+ 'deb' => 'application/x-debian-package',
+ 'doc' => 'application/msword',
+ 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+ 'dvi' => 'application/x-dvi',
+ 'eot' => 'application/vnd.ms-fontobject',
+ 'eps' => 'application/postscript',
+ 'epub' => 'application/epub+zip',
+ 'etx' => 'text/x-setext',
+ 'flac' => 'audio/flac',
+ 'flv' => 'video/x-flv',
+ 'gif' => 'image/gif',
+ 'gz' => 'application/gzip',
+ 'htm' => 'text/html',
+ 'html' => 'text/html',
+ 'ico' => 'image/x-icon',
+ 'ics' => 'text/calendar',
+ 'ini' => 'text/plain',
+ 'iso' => 'application/x-iso9660-image',
+ 'jar' => 'application/java-archive',
+ 'jpe' => 'image/jpeg',
+ 'jpeg' => 'image/jpeg',
+ 'jpg' => 'image/jpeg',
+ 'js' => 'text/javascript',
+ 'json' => 'application/json',
+ 'latex' => 'application/x-latex',
+ 'log' => 'text/plain',
+ 'm4a' => 'audio/mp4',
+ 'm4v' => 'video/mp4',
+ 'mid' => 'audio/midi',
+ 'midi' => 'audio/midi',
+ 'mov' => 'video/quicktime',
+ 'mkv' => 'video/x-matroska',
+ 'mp3' => 'audio/mpeg',
+ 'mp4' => 'video/mp4',
+ 'mp4a' => 'audio/mp4',
+ 'mp4v' => 'video/mp4',
+ 'mpe' => 'video/mpeg',
+ 'mpeg' => 'video/mpeg',
+ 'mpg' => 'video/mpeg',
+ 'mpg4' => 'video/mp4',
+ 'oga' => 'audio/ogg',
+ 'ogg' => 'audio/ogg',
+ 'ogv' => 'video/ogg',
+ 'ogx' => 'application/ogg',
+ 'pbm' => 'image/x-portable-bitmap',
+ 'pdf' => 'application/pdf',
+ 'pgm' => 'image/x-portable-graymap',
+ 'png' => 'image/png',
+ 'pnm' => 'image/x-portable-anymap',
+ 'ppm' => 'image/x-portable-pixmap',
+ 'ppt' => 'application/vnd.ms-powerpoint',
+ 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+ 'ps' => 'application/postscript',
+ 'qt' => 'video/quicktime',
+ 'rar' => 'application/x-rar-compressed',
+ 'ras' => 'image/x-cmu-raster',
+ 'rss' => 'application/rss+xml',
+ 'rtf' => 'application/rtf',
+ 'sgm' => 'text/sgml',
+ 'sgml' => 'text/sgml',
+ 'svg' => 'image/svg+xml',
+ 'swf' => 'application/x-shockwave-flash',
+ 'tar' => 'application/x-tar',
+ 'tif' => 'image/tiff',
+ 'tiff' => 'image/tiff',
+ 'torrent' => 'application/x-bittorrent',
+ 'ttf' => 'application/x-font-ttf',
+ 'txt' => 'text/plain',
+ 'wav' => 'audio/x-wav',
+ 'webm' => 'video/webm',
+ 'webp' => 'image/webp',
+ 'wma' => 'audio/x-ms-wma',
+ 'wmv' => 'video/x-ms-wmv',
+ 'woff' => 'application/x-font-woff',
+ 'wsdl' => 'application/wsdl+xml',
+ 'xbm' => 'image/x-xbitmap',
+ 'xls' => 'application/vnd.ms-excel',
+ 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ 'xml' => 'application/xml',
+ 'xpm' => 'image/x-xpixmap',
+ 'xwd' => 'image/x-xwindowdump',
+ 'yaml' => 'text/yaml',
+ 'yml' => 'text/yaml',
+ 'zip' => 'application/zip',
+ ];
+
+ $extension = strtolower($extension);
+
+ return isset($mimetypes[$extension])
+ ? $mimetypes[$extension]
+ : null;
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/MultipartStream.php b/lib/gerencianet/guzzlehttp/psr7/src/MultipartStream.php
new file mode 100644
index 0000000..5a6079a
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/MultipartStream.php
@@ -0,0 +1,158 @@
+boundary = $boundary ?: sha1(uniqid('', true));
+ $this->stream = $this->createStream($elements);
+ }
+
+ /**
+ * Get the boundary
+ *
+ * @return string
+ */
+ public function getBoundary()
+ {
+ return $this->boundary;
+ }
+
+ public function isWritable()
+ {
+ return false;
+ }
+
+ /**
+ * Get the headers needed before transferring the content of a POST file
+ */
+ private function getHeaders(array $headers)
+ {
+ $str = '';
+ foreach ($headers as $key => $value) {
+ $str .= "{$key}: {$value}\r\n";
+ }
+
+ return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n";
+ }
+
+ /**
+ * Create the aggregate stream that will be used to upload the POST data
+ */
+ protected function createStream(array $elements)
+ {
+ $stream = new AppendStream();
+
+ foreach ($elements as $element) {
+ $this->addElement($stream, $element);
+ }
+
+ // Add the trailing boundary with CRLF
+ $stream->addStream(Utils::streamFor("--{$this->boundary}--\r\n"));
+
+ return $stream;
+ }
+
+ private function addElement(AppendStream $stream, array $element)
+ {
+ foreach (['contents', 'name'] as $key) {
+ if (!array_key_exists($key, $element)) {
+ throw new \InvalidArgumentException("A '{$key}' key is required");
+ }
+ }
+
+ $element['contents'] = Utils::streamFor($element['contents']);
+
+ if (empty($element['filename'])) {
+ $uri = $element['contents']->getMetadata('uri');
+ if (substr($uri, 0, 6) !== 'php://') {
+ $element['filename'] = $uri;
+ }
+ }
+
+ list($body, $headers) = $this->createElement(
+ $element['name'],
+ $element['contents'],
+ isset($element['filename']) ? $element['filename'] : null,
+ isset($element['headers']) ? $element['headers'] : []
+ );
+
+ $stream->addStream(Utils::streamFor($this->getHeaders($headers)));
+ $stream->addStream($body);
+ $stream->addStream(Utils::streamFor("\r\n"));
+ }
+
+ /**
+ * @return array
+ */
+ private function createElement($name, StreamInterface $stream, $filename, array $headers)
+ {
+ // Set a default content-disposition header if one was no provided
+ $disposition = $this->getHeader($headers, 'content-disposition');
+ if (!$disposition) {
+ $headers['Content-Disposition'] = ($filename === '0' || $filename)
+ ? sprintf(
+ 'form-data; name="%s"; filename="%s"',
+ $name,
+ basename($filename)
+ )
+ : "form-data; name=\"{$name}\"";
+ }
+
+ // Set a default content-length header if one was no provided
+ $length = $this->getHeader($headers, 'content-length');
+ if (!$length) {
+ if ($length = $stream->getSize()) {
+ $headers['Content-Length'] = (string) $length;
+ }
+ }
+
+ // Set a default Content-Type if one was not supplied
+ $type = $this->getHeader($headers, 'content-type');
+ if (!$type && ($filename === '0' || $filename)) {
+ if ($type = MimeType::fromFilename($filename)) {
+ $headers['Content-Type'] = $type;
+ }
+ }
+
+ return [$stream, $headers];
+ }
+
+ private function getHeader(array $headers, $key)
+ {
+ $lowercaseHeader = strtolower($key);
+ foreach ($headers as $k => $v) {
+ if (strtolower($k) === $lowercaseHeader) {
+ return $v;
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/NoSeekStream.php b/lib/gerencianet/guzzlehttp/psr7/src/NoSeekStream.php
new file mode 100644
index 0000000..d66bdde
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/NoSeekStream.php
@@ -0,0 +1,25 @@
+tellPos = false;
$this->source = null;
- }
- public function attach($stream)
- {
- throw new CannotAttachException();
+ return null;
}
public function getSize()
@@ -89,9 +93,14 @@ public function isSeekable()
return false;
}
+ public function rewind()
+ {
+ $this->seek(0);
+ }
+
public function seek($offset, $whence = SEEK_SET)
{
- return false;
+ throw new \RuntimeException('Cannot seek a PumpStream');
}
public function isWritable()
@@ -101,7 +110,7 @@ public function isWritable()
public function write($string)
{
- return false;
+ throw new \RuntimeException('Cannot write to a PumpStream');
}
public function isReadable()
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/Query.php b/lib/gerencianet/guzzlehttp/psr7/src/Query.php
new file mode 100644
index 0000000..5a7cc03
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/Query.php
@@ -0,0 +1,113 @@
+ '1', 'foo[b]' => '2'])`.
+ *
+ * @param string $str Query string to parse
+ * @param int|bool $urlEncoding How the query string is encoded
+ *
+ * @return array
+ */
+ public static function parse($str, $urlEncoding = true)
+ {
+ $result = [];
+
+ if ($str === '') {
+ return $result;
+ }
+
+ if ($urlEncoding === true) {
+ $decoder = function ($value) {
+ return rawurldecode(str_replace('+', ' ', $value));
+ };
+ } elseif ($urlEncoding === PHP_QUERY_RFC3986) {
+ $decoder = 'rawurldecode';
+ } elseif ($urlEncoding === PHP_QUERY_RFC1738) {
+ $decoder = 'urldecode';
+ } else {
+ $decoder = function ($str) {
+ return $str;
+ };
+ }
+
+ foreach (explode('&', $str) as $kvp) {
+ $parts = explode('=', $kvp, 2);
+ $key = $decoder($parts[0]);
+ $value = isset($parts[1]) ? $decoder($parts[1]) : null;
+ if (!isset($result[$key])) {
+ $result[$key] = $value;
+ } else {
+ if (!is_array($result[$key])) {
+ $result[$key] = [$result[$key]];
+ }
+ $result[$key][] = $value;
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Build a query string from an array of key value pairs.
+ *
+ * This function can use the return value of `parse()` to build a query
+ * string. This function does not modify the provided keys when an array is
+ * encountered (like `http_build_query()` would).
+ *
+ * @param array $params Query string parameters.
+ * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986
+ * to encode using RFC3986, or PHP_QUERY_RFC1738
+ * to encode using RFC1738.
+ *
+ * @return string
+ */
+ public static function build(array $params, $encoding = PHP_QUERY_RFC3986)
+ {
+ if (!$params) {
+ return '';
+ }
+
+ if ($encoding === false) {
+ $encoder = function ($str) {
+ return $str;
+ };
+ } elseif ($encoding === PHP_QUERY_RFC3986) {
+ $encoder = 'rawurlencode';
+ } elseif ($encoding === PHP_QUERY_RFC1738) {
+ $encoder = 'urlencode';
+ } else {
+ throw new \InvalidArgumentException('Invalid type');
+ }
+
+ $qs = '';
+ foreach ($params as $k => $v) {
+ $k = $encoder($k);
+ if (!is_array($v)) {
+ $qs .= $k;
+ if ($v !== null) {
+ $qs .= '=' . $encoder($v);
+ }
+ $qs .= '&';
+ } else {
+ foreach ($v as $vv) {
+ $qs .= $k;
+ if ($vv !== null) {
+ $qs .= '=' . $encoder($vv);
+ }
+ $qs .= '&';
+ }
+ }
+ }
+
+ return $qs ? (string) substr($qs, 0, -1) : '';
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/Request.php b/lib/gerencianet/guzzlehttp/psr7/src/Request.php
new file mode 100644
index 0000000..c1cdaeb
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/Request.php
@@ -0,0 +1,152 @@
+assertMethod($method);
+ if (!($uri instanceof UriInterface)) {
+ $uri = new Uri($uri);
+ }
+
+ $this->method = strtoupper($method);
+ $this->uri = $uri;
+ $this->setHeaders($headers);
+ $this->protocol = $version;
+
+ if (!isset($this->headerNames['host'])) {
+ $this->updateHostFromUri();
+ }
+
+ if ($body !== '' && $body !== null) {
+ $this->stream = Utils::streamFor($body);
+ }
+ }
+
+ public function getRequestTarget()
+ {
+ if ($this->requestTarget !== null) {
+ return $this->requestTarget;
+ }
+
+ $target = $this->uri->getPath();
+ if ($target == '') {
+ $target = '/';
+ }
+ if ($this->uri->getQuery() != '') {
+ $target .= '?' . $this->uri->getQuery();
+ }
+
+ return $target;
+ }
+
+ public function withRequestTarget($requestTarget)
+ {
+ if (preg_match('#\s#', $requestTarget)) {
+ throw new InvalidArgumentException(
+ 'Invalid request target provided; cannot contain whitespace'
+ );
+ }
+
+ $new = clone $this;
+ $new->requestTarget = $requestTarget;
+ return $new;
+ }
+
+ public function getMethod()
+ {
+ return $this->method;
+ }
+
+ public function withMethod($method)
+ {
+ $this->assertMethod($method);
+ $new = clone $this;
+ $new->method = strtoupper($method);
+ return $new;
+ }
+
+ public function getUri()
+ {
+ return $this->uri;
+ }
+
+ public function withUri(UriInterface $uri, $preserveHost = false)
+ {
+ if ($uri === $this->uri) {
+ return $this;
+ }
+
+ $new = clone $this;
+ $new->uri = $uri;
+
+ if (!$preserveHost || !isset($this->headerNames['host'])) {
+ $new->updateHostFromUri();
+ }
+
+ return $new;
+ }
+
+ private function updateHostFromUri()
+ {
+ $host = $this->uri->getHost();
+
+ if ($host == '') {
+ return;
+ }
+
+ if (($port = $this->uri->getPort()) !== null) {
+ $host .= ':' . $port;
+ }
+
+ if (isset($this->headerNames['host'])) {
+ $header = $this->headerNames['host'];
+ } else {
+ $header = 'Host';
+ $this->headerNames['host'] = 'Host';
+ }
+ // Ensure Host is the first header.
+ // See: http://tools.ietf.org/html/rfc7230#section-5.4
+ $this->headers = [$header => [$host]] + $this->headers;
+ }
+
+ private function assertMethod($method)
+ {
+ if (!is_string($method) || $method === '') {
+ throw new \InvalidArgumentException('Method must be a non-empty string.');
+ }
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/Response.php b/lib/gerencianet/guzzlehttp/psr7/src/Response.php
new file mode 100644
index 0000000..8c01a0f
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/Response.php
@@ -0,0 +1,155 @@
+ 'Continue',
+ 101 => 'Switching Protocols',
+ 102 => 'Processing',
+ 200 => 'OK',
+ 201 => 'Created',
+ 202 => 'Accepted',
+ 203 => 'Non-Authoritative Information',
+ 204 => 'No Content',
+ 205 => 'Reset Content',
+ 206 => 'Partial Content',
+ 207 => 'Multi-status',
+ 208 => 'Already Reported',
+ 300 => 'Multiple Choices',
+ 301 => 'Moved Permanently',
+ 302 => 'Found',
+ 303 => 'See Other',
+ 304 => 'Not Modified',
+ 305 => 'Use Proxy',
+ 306 => 'Switch Proxy',
+ 307 => 'Temporary Redirect',
+ 400 => 'Bad Request',
+ 401 => 'Unauthorized',
+ 402 => 'Payment Required',
+ 403 => 'Forbidden',
+ 404 => 'Not Found',
+ 405 => 'Method Not Allowed',
+ 406 => 'Not Acceptable',
+ 407 => 'Proxy Authentication Required',
+ 408 => 'Request Time-out',
+ 409 => 'Conflict',
+ 410 => 'Gone',
+ 411 => 'Length Required',
+ 412 => 'Precondition Failed',
+ 413 => 'Request Entity Too Large',
+ 414 => 'Request-URI Too Large',
+ 415 => 'Unsupported Media Type',
+ 416 => 'Requested range not satisfiable',
+ 417 => 'Expectation Failed',
+ 418 => 'I\'m a teapot',
+ 422 => 'Unprocessable Entity',
+ 423 => 'Locked',
+ 424 => 'Failed Dependency',
+ 425 => 'Unordered Collection',
+ 426 => 'Upgrade Required',
+ 428 => 'Precondition Required',
+ 429 => 'Too Many Requests',
+ 431 => 'Request Header Fields Too Large',
+ 451 => 'Unavailable For Legal Reasons',
+ 500 => 'Internal Server Error',
+ 501 => 'Not Implemented',
+ 502 => 'Bad Gateway',
+ 503 => 'Service Unavailable',
+ 504 => 'Gateway Time-out',
+ 505 => 'HTTP Version not supported',
+ 506 => 'Variant Also Negotiates',
+ 507 => 'Insufficient Storage',
+ 508 => 'Loop Detected',
+ 511 => 'Network Authentication Required',
+ ];
+
+ /** @var string */
+ private $reasonPhrase = '';
+
+ /** @var int */
+ private $statusCode = 200;
+
+ /**
+ * @param int $status Status code
+ * @param array $headers Response headers
+ * @param string|resource|StreamInterface|null $body Response body
+ * @param string $version Protocol version
+ * @param string|null $reason Reason phrase (when empty a default will be used based on the status code)
+ */
+ public function __construct(
+ $status = 200,
+ array $headers = [],
+ $body = null,
+ $version = '1.1',
+ $reason = null
+ ) {
+ $this->assertStatusCodeIsInteger($status);
+ $status = (int) $status;
+ $this->assertStatusCodeRange($status);
+
+ $this->statusCode = $status;
+
+ if ($body !== '' && $body !== null) {
+ $this->stream = Utils::streamFor($body);
+ }
+
+ $this->setHeaders($headers);
+ if ($reason == '' && isset(self::$phrases[$this->statusCode])) {
+ $this->reasonPhrase = self::$phrases[$this->statusCode];
+ } else {
+ $this->reasonPhrase = (string) $reason;
+ }
+
+ $this->protocol = $version;
+ }
+
+ public function getStatusCode()
+ {
+ return $this->statusCode;
+ }
+
+ public function getReasonPhrase()
+ {
+ return $this->reasonPhrase;
+ }
+
+ public function withStatus($code, $reasonPhrase = '')
+ {
+ $this->assertStatusCodeIsInteger($code);
+ $code = (int) $code;
+ $this->assertStatusCodeRange($code);
+
+ $new = clone $this;
+ $new->statusCode = $code;
+ if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) {
+ $reasonPhrase = self::$phrases[$new->statusCode];
+ }
+ $new->reasonPhrase = (string) $reasonPhrase;
+ return $new;
+ }
+
+ private function assertStatusCodeIsInteger($statusCode)
+ {
+ if (filter_var($statusCode, FILTER_VALIDATE_INT) === false) {
+ throw new \InvalidArgumentException('Status code must be an integer value.');
+ }
+ }
+
+ private function assertStatusCodeRange($statusCode)
+ {
+ if ($statusCode < 100 || $statusCode >= 600) {
+ throw new \InvalidArgumentException('Status code must be an integer value between 1xx and 5xx.');
+ }
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/Rfc7230.php b/lib/gerencianet/guzzlehttp/psr7/src/Rfc7230.php
new file mode 100644
index 0000000..51b571f
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/Rfc7230.php
@@ -0,0 +1,19 @@
+@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m";
+ const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)";
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/ServerRequest.php b/lib/gerencianet/guzzlehttp/psr7/src/ServerRequest.php
new file mode 100644
index 0000000..e6d26f5
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/ServerRequest.php
@@ -0,0 +1,379 @@
+serverParams = $serverParams;
+
+ parent::__construct($method, $uri, $headers, $body, $version);
+ }
+
+ /**
+ * Return an UploadedFile instance array.
+ *
+ * @param array $files A array which respect $_FILES structure
+ *
+ * @return array
+ *
+ * @throws InvalidArgumentException for unrecognized values
+ */
+ public static function normalizeFiles(array $files)
+ {
+ $normalized = [];
+
+ foreach ($files as $key => $value) {
+ if ($value instanceof UploadedFileInterface) {
+ $normalized[$key] = $value;
+ } elseif (is_array($value) && isset($value['tmp_name'])) {
+ $normalized[$key] = self::createUploadedFileFromSpec($value);
+ } elseif (is_array($value)) {
+ $normalized[$key] = self::normalizeFiles($value);
+ continue;
+ } else {
+ throw new InvalidArgumentException('Invalid value in files specification');
+ }
+ }
+
+ return $normalized;
+ }
+
+ /**
+ * Create and return an UploadedFile instance from a $_FILES specification.
+ *
+ * If the specification represents an array of values, this method will
+ * delegate to normalizeNestedFileSpec() and return that return value.
+ *
+ * @param array $value $_FILES struct
+ *
+ * @return array|UploadedFileInterface
+ */
+ private static function createUploadedFileFromSpec(array $value)
+ {
+ if (is_array($value['tmp_name'])) {
+ return self::normalizeNestedFileSpec($value);
+ }
+
+ return new UploadedFile(
+ $value['tmp_name'],
+ (int) $value['size'],
+ (int) $value['error'],
+ $value['name'],
+ $value['type']
+ );
+ }
+
+ /**
+ * Normalize an array of file specifications.
+ *
+ * Loops through all nested files and returns a normalized array of
+ * UploadedFileInterface instances.
+ *
+ * @param array $files
+ *
+ * @return UploadedFileInterface[]
+ */
+ private static function normalizeNestedFileSpec(array $files = [])
+ {
+ $normalizedFiles = [];
+
+ foreach (array_keys($files['tmp_name']) as $key) {
+ $spec = [
+ 'tmp_name' => $files['tmp_name'][$key],
+ 'size' => $files['size'][$key],
+ 'error' => $files['error'][$key],
+ 'name' => $files['name'][$key],
+ 'type' => $files['type'][$key],
+ ];
+ $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec);
+ }
+
+ return $normalizedFiles;
+ }
+
+ /**
+ * Return a ServerRequest populated with superglobals:
+ * $_GET
+ * $_POST
+ * $_COOKIE
+ * $_FILES
+ * $_SERVER
+ *
+ * @return ServerRequestInterface
+ */
+ public static function fromGlobals()
+ {
+ $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
+ $headers = getallheaders();
+ $uri = self::getUriFromGlobals();
+ $body = new CachingStream(new LazyOpenStream('php://input', 'r+'));
+ $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1';
+
+ $serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER);
+
+ return $serverRequest
+ ->withCookieParams($_COOKIE)
+ ->withQueryParams($_GET)
+ ->withParsedBody($_POST)
+ ->withUploadedFiles(self::normalizeFiles($_FILES));
+ }
+
+ private static function extractHostAndPortFromAuthority($authority)
+ {
+ $uri = 'http://' . $authority;
+ $parts = parse_url($uri);
+ if (false === $parts) {
+ return [null, null];
+ }
+
+ $host = isset($parts['host']) ? $parts['host'] : null;
+ $port = isset($parts['port']) ? $parts['port'] : null;
+
+ return [$host, $port];
+ }
+
+ /**
+ * Get a Uri populated with values from $_SERVER.
+ *
+ * @return UriInterface
+ */
+ public static function getUriFromGlobals()
+ {
+ $uri = new Uri('');
+
+ $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http');
+
+ $hasPort = false;
+ if (isset($_SERVER['HTTP_HOST'])) {
+ list($host, $port) = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']);
+ if ($host !== null) {
+ $uri = $uri->withHost($host);
+ }
+
+ if ($port !== null) {
+ $hasPort = true;
+ $uri = $uri->withPort($port);
+ }
+ } elseif (isset($_SERVER['SERVER_NAME'])) {
+ $uri = $uri->withHost($_SERVER['SERVER_NAME']);
+ } elseif (isset($_SERVER['SERVER_ADDR'])) {
+ $uri = $uri->withHost($_SERVER['SERVER_ADDR']);
+ }
+
+ if (!$hasPort && isset($_SERVER['SERVER_PORT'])) {
+ $uri = $uri->withPort($_SERVER['SERVER_PORT']);
+ }
+
+ $hasQuery = false;
+ if (isset($_SERVER['REQUEST_URI'])) {
+ $requestUriParts = explode('?', $_SERVER['REQUEST_URI'], 2);
+ $uri = $uri->withPath($requestUriParts[0]);
+ if (isset($requestUriParts[1])) {
+ $hasQuery = true;
+ $uri = $uri->withQuery($requestUriParts[1]);
+ }
+ }
+
+ if (!$hasQuery && isset($_SERVER['QUERY_STRING'])) {
+ $uri = $uri->withQuery($_SERVER['QUERY_STRING']);
+ }
+
+ return $uri;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getServerParams()
+ {
+ return $this->serverParams;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getUploadedFiles()
+ {
+ return $this->uploadedFiles;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function withUploadedFiles(array $uploadedFiles)
+ {
+ $new = clone $this;
+ $new->uploadedFiles = $uploadedFiles;
+
+ return $new;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getCookieParams()
+ {
+ return $this->cookieParams;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function withCookieParams(array $cookies)
+ {
+ $new = clone $this;
+ $new->cookieParams = $cookies;
+
+ return $new;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getQueryParams()
+ {
+ return $this->queryParams;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function withQueryParams(array $query)
+ {
+ $new = clone $this;
+ $new->queryParams = $query;
+
+ return $new;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getParsedBody()
+ {
+ return $this->parsedBody;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function withParsedBody($data)
+ {
+ $new = clone $this;
+ $new->parsedBody = $data;
+
+ return $new;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getAttributes()
+ {
+ return $this->attributes;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getAttribute($attribute, $default = null)
+ {
+ if (false === array_key_exists($attribute, $this->attributes)) {
+ return $default;
+ }
+
+ return $this->attributes[$attribute];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function withAttribute($attribute, $value)
+ {
+ $new = clone $this;
+ $new->attributes[$attribute] = $value;
+
+ return $new;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function withoutAttribute($attribute)
+ {
+ if (false === array_key_exists($attribute, $this->attributes)) {
+ return $this;
+ }
+
+ $new = clone $this;
+ unset($new->attributes[$attribute]);
+
+ return $new;
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/Stream.php b/lib/gerencianet/guzzlehttp/psr7/src/Stream.php
new file mode 100644
index 0000000..3865d6d
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/Stream.php
@@ -0,0 +1,270 @@
+size = $options['size'];
+ }
+
+ $this->customMetadata = isset($options['metadata'])
+ ? $options['metadata']
+ : [];
+
+ $this->stream = $stream;
+ $meta = stream_get_meta_data($this->stream);
+ $this->seekable = $meta['seekable'];
+ $this->readable = (bool)preg_match(self::READABLE_MODES, $meta['mode']);
+ $this->writable = (bool)preg_match(self::WRITABLE_MODES, $meta['mode']);
+ $this->uri = $this->getMetadata('uri');
+ }
+
+ /**
+ * Closes the stream when the destructed
+ */
+ public function __destruct()
+ {
+ $this->close();
+ }
+
+ public function __toString()
+ {
+ try {
+ if ($this->isSeekable()) {
+ $this->seek(0);
+ }
+ return $this->getContents();
+ } catch (\Exception $e) {
+ return '';
+ }
+ }
+
+ public function getContents()
+ {
+ if (!isset($this->stream)) {
+ throw new \RuntimeException('Stream is detached');
+ }
+
+ $contents = stream_get_contents($this->stream);
+
+ if ($contents === false) {
+ throw new \RuntimeException('Unable to read stream contents');
+ }
+
+ return $contents;
+ }
+
+ public function close()
+ {
+ if (isset($this->stream)) {
+ if (is_resource($this->stream)) {
+ fclose($this->stream);
+ }
+ $this->detach();
+ }
+ }
+
+ public function detach()
+ {
+ if (!isset($this->stream)) {
+ return null;
+ }
+
+ $result = $this->stream;
+ unset($this->stream);
+ $this->size = $this->uri = null;
+ $this->readable = $this->writable = $this->seekable = false;
+
+ return $result;
+ }
+
+ public function getSize()
+ {
+ if ($this->size !== null) {
+ return $this->size;
+ }
+
+ if (!isset($this->stream)) {
+ return null;
+ }
+
+ // Clear the stat cache if the stream has a URI
+ if ($this->uri) {
+ clearstatcache(true, $this->uri);
+ }
+
+ $stats = fstat($this->stream);
+ if (isset($stats['size'])) {
+ $this->size = $stats['size'];
+ return $this->size;
+ }
+
+ return null;
+ }
+
+ public function isReadable()
+ {
+ return $this->readable;
+ }
+
+ public function isWritable()
+ {
+ return $this->writable;
+ }
+
+ public function isSeekable()
+ {
+ return $this->seekable;
+ }
+
+ public function eof()
+ {
+ if (!isset($this->stream)) {
+ throw new \RuntimeException('Stream is detached');
+ }
+
+ return feof($this->stream);
+ }
+
+ public function tell()
+ {
+ if (!isset($this->stream)) {
+ throw new \RuntimeException('Stream is detached');
+ }
+
+ $result = ftell($this->stream);
+
+ if ($result === false) {
+ throw new \RuntimeException('Unable to determine stream position');
+ }
+
+ return $result;
+ }
+
+ public function rewind()
+ {
+ $this->seek(0);
+ }
+
+ public function seek($offset, $whence = SEEK_SET)
+ {
+ $whence = (int) $whence;
+
+ if (!isset($this->stream)) {
+ throw new \RuntimeException('Stream is detached');
+ }
+ if (!$this->seekable) {
+ throw new \RuntimeException('Stream is not seekable');
+ }
+ if (fseek($this->stream, $offset, $whence) === -1) {
+ throw new \RuntimeException('Unable to seek to stream position '
+ . $offset . ' with whence ' . var_export($whence, true));
+ }
+ }
+
+ public function read($length)
+ {
+ if (!isset($this->stream)) {
+ throw new \RuntimeException('Stream is detached');
+ }
+ if (!$this->readable) {
+ throw new \RuntimeException('Cannot read from non-readable stream');
+ }
+ if ($length < 0) {
+ throw new \RuntimeException('Length parameter cannot be negative');
+ }
+
+ if (0 === $length) {
+ return '';
+ }
+
+ $string = fread($this->stream, $length);
+ if (false === $string) {
+ throw new \RuntimeException('Unable to read from stream');
+ }
+
+ return $string;
+ }
+
+ public function write($string)
+ {
+ if (!isset($this->stream)) {
+ throw new \RuntimeException('Stream is detached');
+ }
+ if (!$this->writable) {
+ throw new \RuntimeException('Cannot write to a non-writable stream');
+ }
+
+ // We can't know the size after writing anything
+ $this->size = null;
+ $result = fwrite($this->stream, $string);
+
+ if ($result === false) {
+ throw new \RuntimeException('Unable to write to stream');
+ }
+
+ return $result;
+ }
+
+ public function getMetadata($key = null)
+ {
+ if (!isset($this->stream)) {
+ return $key ? null : [];
+ } elseif (!$key) {
+ return $this->customMetadata + stream_get_meta_data($this->stream);
+ } elseif (isset($this->customMetadata[$key])) {
+ return $this->customMetadata[$key];
+ }
+
+ $meta = stream_get_meta_data($this->stream);
+
+ return isset($meta[$key]) ? $meta[$key] : null;
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/streams/src/StreamDecoratorTrait.php b/lib/gerencianet/guzzlehttp/psr7/src/StreamDecoratorTrait.php
similarity index 84%
rename from lib/gerencianet/guzzlehttp/streams/src/StreamDecoratorTrait.php
rename to lib/gerencianet/guzzlehttp/psr7/src/StreamDecoratorTrait.php
index 39c19c5..5025dd6 100644
--- a/lib/gerencianet/guzzlehttp/streams/src/StreamDecoratorTrait.php
+++ b/lib/gerencianet/guzzlehttp/psr7/src/StreamDecoratorTrait.php
@@ -1,9 +1,12 @@
seek(0);
+ if ($this->isSeekable()) {
+ $this->seek(0);
+ }
return $this->getContents();
} catch (\Exception $e) {
// Really, PHP? https://bugs.php.net/bug.php?id=53648
@@ -58,7 +67,7 @@ public function getContents()
*/
public function __call($method, array $args)
{
- $result = call_user_func_array(array($this->stream, $method), $args);
+ $result = call_user_func_array([$this->stream, $method], $args);
// Always return the wrapped object if the result is a return $this
return $result === $this->stream ? $this : $result;
@@ -79,11 +88,6 @@ public function detach()
return $this->stream->detach();
}
- public function attach($stream)
- {
- throw new CannotAttachException();
- }
-
public function getSize()
{
return $this->stream->getSize();
@@ -114,9 +118,14 @@ public function isSeekable()
return $this->stream->isSeekable();
}
+ public function rewind()
+ {
+ $this->seek(0);
+ }
+
public function seek($offset, $whence = SEEK_SET)
{
- return $this->stream->seek($offset, $whence);
+ $this->stream->seek($offset, $whence);
}
public function read($length)
@@ -133,11 +142,11 @@ public function write($string)
* Implement in subclasses to dynamically create streams when requested.
*
* @return StreamInterface
+ *
* @throws \BadMethodCallException
*/
protected function createStream()
{
- throw new \BadMethodCallException('createStream() not implemented in '
- . get_class($this));
+ throw new \BadMethodCallException('Not implemented');
}
}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/StreamWrapper.php b/lib/gerencianet/guzzlehttp/psr7/src/StreamWrapper.php
new file mode 100644
index 0000000..fc7cb96
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/StreamWrapper.php
@@ -0,0 +1,165 @@
+isReadable()) {
+ $mode = $stream->isWritable() ? 'r+' : 'r';
+ } elseif ($stream->isWritable()) {
+ $mode = 'w';
+ } else {
+ throw new \InvalidArgumentException('The stream must be readable, '
+ . 'writable, or both.');
+ }
+
+ return fopen('guzzle://stream', $mode, null, self::createStreamContext($stream));
+ }
+
+ /**
+ * Creates a stream context that can be used to open a stream as a php stream resource.
+ *
+ * @param StreamInterface $stream
+ *
+ * @return resource
+ */
+ public static function createStreamContext(StreamInterface $stream)
+ {
+ return stream_context_create([
+ 'guzzle' => ['stream' => $stream]
+ ]);
+ }
+
+ /**
+ * Registers the stream wrapper if needed
+ */
+ public static function register()
+ {
+ if (!in_array('guzzle', stream_get_wrappers())) {
+ stream_wrapper_register('guzzle', __CLASS__);
+ }
+ }
+
+ public function stream_open($path, $mode, $options, &$opened_path)
+ {
+ $options = stream_context_get_options($this->context);
+
+ if (!isset($options['guzzle']['stream'])) {
+ return false;
+ }
+
+ $this->mode = $mode;
+ $this->stream = $options['guzzle']['stream'];
+
+ return true;
+ }
+
+ public function stream_read($count)
+ {
+ return $this->stream->read($count);
+ }
+
+ public function stream_write($data)
+ {
+ return (int) $this->stream->write($data);
+ }
+
+ public function stream_tell()
+ {
+ return $this->stream->tell();
+ }
+
+ public function stream_eof()
+ {
+ return $this->stream->eof();
+ }
+
+ public function stream_seek($offset, $whence)
+ {
+ $this->stream->seek($offset, $whence);
+
+ return true;
+ }
+
+ public function stream_cast($cast_as)
+ {
+ $stream = clone($this->stream);
+
+ return $stream->detach();
+ }
+
+ public function stream_stat()
+ {
+ static $modeMap = [
+ 'r' => 33060,
+ 'rb' => 33060,
+ 'r+' => 33206,
+ 'w' => 33188,
+ 'wb' => 33188
+ ];
+
+ return [
+ 'dev' => 0,
+ 'ino' => 0,
+ 'mode' => $modeMap[$this->mode],
+ 'nlink' => 0,
+ 'uid' => 0,
+ 'gid' => 0,
+ 'rdev' => 0,
+ 'size' => $this->stream->getSize() ?: 0,
+ 'atime' => 0,
+ 'mtime' => 0,
+ 'ctime' => 0,
+ 'blksize' => 0,
+ 'blocks' => 0
+ ];
+ }
+
+ public function url_stat($path, $flags)
+ {
+ return [
+ 'dev' => 0,
+ 'ino' => 0,
+ 'mode' => 0,
+ 'nlink' => 0,
+ 'uid' => 0,
+ 'gid' => 0,
+ 'rdev' => 0,
+ 'size' => 0,
+ 'atime' => 0,
+ 'mtime' => 0,
+ 'ctime' => 0,
+ 'blksize' => 0,
+ 'blocks' => 0
+ ];
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/UploadedFile.php b/lib/gerencianet/guzzlehttp/psr7/src/UploadedFile.php
new file mode 100644
index 0000000..bf342c4
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/UploadedFile.php
@@ -0,0 +1,328 @@
+setError($errorStatus);
+ $this->setSize($size);
+ $this->setClientFilename($clientFilename);
+ $this->setClientMediaType($clientMediaType);
+
+ if ($this->isOk()) {
+ $this->setStreamOrFile($streamOrFile);
+ }
+ }
+
+ /**
+ * Depending on the value set file or stream variable
+ *
+ * @param mixed $streamOrFile
+ *
+ * @throws InvalidArgumentException
+ */
+ private function setStreamOrFile($streamOrFile)
+ {
+ if (is_string($streamOrFile)) {
+ $this->file = $streamOrFile;
+ } elseif (is_resource($streamOrFile)) {
+ $this->stream = new Stream($streamOrFile);
+ } elseif ($streamOrFile instanceof StreamInterface) {
+ $this->stream = $streamOrFile;
+ } else {
+ throw new InvalidArgumentException(
+ 'Invalid stream or file provided for UploadedFile'
+ );
+ }
+ }
+
+ /**
+ * @param int $error
+ *
+ * @throws InvalidArgumentException
+ */
+ private function setError($error)
+ {
+ if (false === is_int($error)) {
+ throw new InvalidArgumentException(
+ 'Upload file error status must be an integer'
+ );
+ }
+
+ if (false === in_array($error, UploadedFile::$errors)) {
+ throw new InvalidArgumentException(
+ 'Invalid error status for UploadedFile'
+ );
+ }
+
+ $this->error = $error;
+ }
+
+ /**
+ * @param int $size
+ *
+ * @throws InvalidArgumentException
+ */
+ private function setSize($size)
+ {
+ if (false === is_int($size)) {
+ throw new InvalidArgumentException(
+ 'Upload file size must be an integer'
+ );
+ }
+
+ $this->size = $size;
+ }
+
+ /**
+ * @param mixed $param
+ *
+ * @return bool
+ */
+ private function isStringOrNull($param)
+ {
+ return in_array(gettype($param), ['string', 'NULL']);
+ }
+
+ /**
+ * @param mixed $param
+ *
+ * @return bool
+ */
+ private function isStringNotEmpty($param)
+ {
+ return is_string($param) && false === empty($param);
+ }
+
+ /**
+ * @param string|null $clientFilename
+ *
+ * @throws InvalidArgumentException
+ */
+ private function setClientFilename($clientFilename)
+ {
+ if (false === $this->isStringOrNull($clientFilename)) {
+ throw new InvalidArgumentException(
+ 'Upload file client filename must be a string or null'
+ );
+ }
+
+ $this->clientFilename = $clientFilename;
+ }
+
+ /**
+ * @param string|null $clientMediaType
+ *
+ * @throws InvalidArgumentException
+ */
+ private function setClientMediaType($clientMediaType)
+ {
+ if (false === $this->isStringOrNull($clientMediaType)) {
+ throw new InvalidArgumentException(
+ 'Upload file client media type must be a string or null'
+ );
+ }
+
+ $this->clientMediaType = $clientMediaType;
+ }
+
+ /**
+ * Return true if there is no upload error
+ *
+ * @return bool
+ */
+ private function isOk()
+ {
+ return $this->error === UPLOAD_ERR_OK;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isMoved()
+ {
+ return $this->moved;
+ }
+
+ /**
+ * @throws RuntimeException if is moved or not ok
+ */
+ private function validateActive()
+ {
+ if (false === $this->isOk()) {
+ throw new RuntimeException('Cannot retrieve stream due to upload error');
+ }
+
+ if ($this->isMoved()) {
+ throw new RuntimeException('Cannot retrieve stream after it has already been moved');
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @throws RuntimeException if the upload was not successful.
+ */
+ public function getStream()
+ {
+ $this->validateActive();
+
+ if ($this->stream instanceof StreamInterface) {
+ return $this->stream;
+ }
+
+ return new LazyOpenStream($this->file, 'r+');
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @see http://php.net/is_uploaded_file
+ * @see http://php.net/move_uploaded_file
+ *
+ * @param string $targetPath Path to which to move the uploaded file.
+ *
+ * @throws RuntimeException if the upload was not successful.
+ * @throws InvalidArgumentException if the $path specified is invalid.
+ * @throws RuntimeException on any error during the move operation, or on
+ * the second or subsequent call to the method.
+ */
+ public function moveTo($targetPath)
+ {
+ $this->validateActive();
+
+ if (false === $this->isStringNotEmpty($targetPath)) {
+ throw new InvalidArgumentException(
+ 'Invalid path provided for move operation; must be a non-empty string'
+ );
+ }
+
+ if ($this->file) {
+ $this->moved = php_sapi_name() == 'cli'
+ ? rename($this->file, $targetPath)
+ : move_uploaded_file($this->file, $targetPath);
+ } else {
+ Utils::copyToStream(
+ $this->getStream(),
+ new LazyOpenStream($targetPath, 'w')
+ );
+
+ $this->moved = true;
+ }
+
+ if (false === $this->moved) {
+ throw new RuntimeException(
+ sprintf('Uploaded file could not be moved to %s', $targetPath)
+ );
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @return int|null The file size in bytes or null if unknown.
+ */
+ public function getSize()
+ {
+ return $this->size;
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @see http://php.net/manual/en/features.file-upload.errors.php
+ *
+ * @return int One of PHP's UPLOAD_ERR_XXX constants.
+ */
+ public function getError()
+ {
+ return $this->error;
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @return string|null The filename sent by the client or null if none
+ * was provided.
+ */
+ public function getClientFilename()
+ {
+ return $this->clientFilename;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getClientMediaType()
+ {
+ return $this->clientMediaType;
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/Uri.php b/lib/gerencianet/guzzlehttp/psr7/src/Uri.php
new file mode 100644
index 0000000..0f9f020
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/Uri.php
@@ -0,0 +1,810 @@
+ 80,
+ 'https' => 443,
+ 'ftp' => 21,
+ 'gopher' => 70,
+ 'nntp' => 119,
+ 'news' => 119,
+ 'telnet' => 23,
+ 'tn3270' => 23,
+ 'imap' => 143,
+ 'pop' => 110,
+ 'ldap' => 389,
+ ];
+
+ private static $charUnreserved = 'a-zA-Z0-9_\-\.~';
+ private static $charSubDelims = '!\$&\'\(\)\*\+,;=';
+ private static $replaceQuery = ['=' => '%3D', '&' => '%26'];
+
+ /** @var string Uri scheme. */
+ private $scheme = '';
+
+ /** @var string Uri user info. */
+ private $userInfo = '';
+
+ /** @var string Uri host. */
+ private $host = '';
+
+ /** @var int|null Uri port. */
+ private $port;
+
+ /** @var string Uri path. */
+ private $path = '';
+
+ /** @var string Uri query string. */
+ private $query = '';
+
+ /** @var string Uri fragment. */
+ private $fragment = '';
+
+ /**
+ * @param string $uri URI to parse
+ */
+ public function __construct($uri = '')
+ {
+ // weak type check to also accept null until we can add scalar type hints
+ if ($uri != '') {
+ $parts = self::parse($uri);
+ if ($parts === false) {
+ throw new \InvalidArgumentException("Unable to parse URI: $uri");
+ }
+ $this->applyParts($parts);
+ }
+ }
+
+ /**
+ * UTF-8 aware \parse_url() replacement.
+ *
+ * The internal function produces broken output for non ASCII domain names
+ * (IDN) when used with locales other than "C".
+ *
+ * On the other hand, cURL understands IDN correctly only when UTF-8 locale
+ * is configured ("C.UTF-8", "en_US.UTF-8", etc.).
+ *
+ * @see https://bugs.php.net/bug.php?id=52923
+ * @see https://www.php.net/manual/en/function.parse-url.php#114817
+ * @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING
+ *
+ * @param string $url
+ *
+ * @return array|false
+ */
+ private static function parse($url)
+ {
+ // If IPv6
+ $prefix = '';
+ if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) {
+ $prefix = $matches[1];
+ $url = $matches[2];
+ }
+
+ $encodedUrl = preg_replace_callback(
+ '%[^:/@?&=#]+%usD',
+ static function ($matches) {
+ return urlencode($matches[0]);
+ },
+ $url
+ );
+
+ $result = parse_url($prefix . $encodedUrl);
+
+ if ($result === false) {
+ return false;
+ }
+
+ return array_map('urldecode', $result);
+ }
+
+ public function __toString()
+ {
+ return self::composeComponents(
+ $this->scheme,
+ $this->getAuthority(),
+ $this->path,
+ $this->query,
+ $this->fragment
+ );
+ }
+
+ /**
+ * Composes a URI reference string from its various components.
+ *
+ * Usually this method does not need to be called manually but instead is used indirectly via
+ * `Psr\Http\Message\UriInterface::__toString`.
+ *
+ * PSR-7 UriInterface treats an empty component the same as a missing component as
+ * getQuery(), getFragment() etc. always return a string. This explains the slight
+ * difference to RFC 3986 Section 5.3.
+ *
+ * Another adjustment is that the authority separator is added even when the authority is missing/empty
+ * for the "file" scheme. This is because PHP stream functions like `file_get_contents` only work with
+ * `file:///myfile` but not with `file:/myfile` although they are equivalent according to RFC 3986. But
+ * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to
+ * that format).
+ *
+ * @param string $scheme
+ * @param string $authority
+ * @param string $path
+ * @param string $query
+ * @param string $fragment
+ *
+ * @return string
+ *
+ * @link https://tools.ietf.org/html/rfc3986#section-5.3
+ */
+ public static function composeComponents($scheme, $authority, $path, $query, $fragment)
+ {
+ $uri = '';
+
+ // weak type checks to also accept null until we can add scalar type hints
+ if ($scheme != '') {
+ $uri .= $scheme . ':';
+ }
+
+ if ($authority != ''|| $scheme === 'file') {
+ $uri .= '//' . $authority;
+ }
+
+ $uri .= $path;
+
+ if ($query != '') {
+ $uri .= '?' . $query;
+ }
+
+ if ($fragment != '') {
+ $uri .= '#' . $fragment;
+ }
+
+ return $uri;
+ }
+
+ /**
+ * Whether the URI has the default port of the current scheme.
+ *
+ * `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used
+ * independently of the implementation.
+ *
+ * @param UriInterface $uri
+ *
+ * @return bool
+ */
+ public static function isDefaultPort(UriInterface $uri)
+ {
+ return $uri->getPort() === null
+ || (isset(self::$defaultPorts[$uri->getScheme()]) && $uri->getPort() === self::$defaultPorts[$uri->getScheme()]);
+ }
+
+ /**
+ * Whether the URI is absolute, i.e. it has a scheme.
+ *
+ * An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true
+ * if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative
+ * to another URI, the base URI. Relative references can be divided into several forms:
+ * - network-path references, e.g. '//example.com/path'
+ * - absolute-path references, e.g. '/path'
+ * - relative-path references, e.g. 'subpath'
+ *
+ * @param UriInterface $uri
+ *
+ * @return bool
+ *
+ * @see Uri::isNetworkPathReference
+ * @see Uri::isAbsolutePathReference
+ * @see Uri::isRelativePathReference
+ * @link https://tools.ietf.org/html/rfc3986#section-4
+ */
+ public static function isAbsolute(UriInterface $uri)
+ {
+ return $uri->getScheme() !== '';
+ }
+
+ /**
+ * Whether the URI is a network-path reference.
+ *
+ * A relative reference that begins with two slash characters is termed an network-path reference.
+ *
+ * @param UriInterface $uri
+ *
+ * @return bool
+ *
+ * @link https://tools.ietf.org/html/rfc3986#section-4.2
+ */
+ public static function isNetworkPathReference(UriInterface $uri)
+ {
+ return $uri->getScheme() === '' && $uri->getAuthority() !== '';
+ }
+
+ /**
+ * Whether the URI is a absolute-path reference.
+ *
+ * A relative reference that begins with a single slash character is termed an absolute-path reference.
+ *
+ * @param UriInterface $uri
+ *
+ * @return bool
+ *
+ * @link https://tools.ietf.org/html/rfc3986#section-4.2
+ */
+ public static function isAbsolutePathReference(UriInterface $uri)
+ {
+ return $uri->getScheme() === ''
+ && $uri->getAuthority() === ''
+ && isset($uri->getPath()[0])
+ && $uri->getPath()[0] === '/';
+ }
+
+ /**
+ * Whether the URI is a relative-path reference.
+ *
+ * A relative reference that does not begin with a slash character is termed a relative-path reference.
+ *
+ * @param UriInterface $uri
+ *
+ * @return bool
+ *
+ * @link https://tools.ietf.org/html/rfc3986#section-4.2
+ */
+ public static function isRelativePathReference(UriInterface $uri)
+ {
+ return $uri->getScheme() === ''
+ && $uri->getAuthority() === ''
+ && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/');
+ }
+
+ /**
+ * Whether the URI is a same-document reference.
+ *
+ * A same-document reference refers to a URI that is, aside from its fragment
+ * component, identical to the base URI. When no base URI is given, only an empty
+ * URI reference (apart from its fragment) is considered a same-document reference.
+ *
+ * @param UriInterface $uri The URI to check
+ * @param UriInterface|null $base An optional base URI to compare against
+ *
+ * @return bool
+ *
+ * @link https://tools.ietf.org/html/rfc3986#section-4.4
+ */
+ public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null)
+ {
+ if ($base !== null) {
+ $uri = UriResolver::resolve($base, $uri);
+
+ return ($uri->getScheme() === $base->getScheme())
+ && ($uri->getAuthority() === $base->getAuthority())
+ && ($uri->getPath() === $base->getPath())
+ && ($uri->getQuery() === $base->getQuery());
+ }
+
+ return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === '';
+ }
+
+ /**
+ * Removes dot segments from a path and returns the new path.
+ *
+ * @param string $path
+ *
+ * @return string
+ *
+ * @deprecated since version 1.4. Use UriResolver::removeDotSegments instead.
+ * @see UriResolver::removeDotSegments
+ */
+ public static function removeDotSegments($path)
+ {
+ return UriResolver::removeDotSegments($path);
+ }
+
+ /**
+ * Converts the relative URI into a new URI that is resolved against the base URI.
+ *
+ * @param UriInterface $base Base URI
+ * @param string|UriInterface $rel Relative URI
+ *
+ * @return UriInterface
+ *
+ * @deprecated since version 1.4. Use UriResolver::resolve instead.
+ * @see UriResolver::resolve
+ */
+ public static function resolve(UriInterface $base, $rel)
+ {
+ if (!($rel instanceof UriInterface)) {
+ $rel = new self($rel);
+ }
+
+ return UriResolver::resolve($base, $rel);
+ }
+
+ /**
+ * Creates a new URI with a specific query string value removed.
+ *
+ * Any existing query string values that exactly match the provided key are
+ * removed.
+ *
+ * @param UriInterface $uri URI to use as a base.
+ * @param string $key Query string key to remove.
+ *
+ * @return UriInterface
+ */
+ public static function withoutQueryValue(UriInterface $uri, $key)
+ {
+ $result = self::getFilteredQueryString($uri, [$key]);
+
+ return $uri->withQuery(implode('&', $result));
+ }
+
+ /**
+ * Creates a new URI with a specific query string value.
+ *
+ * Any existing query string values that exactly match the provided key are
+ * removed and replaced with the given key value pair.
+ *
+ * A value of null will set the query string key without a value, e.g. "key"
+ * instead of "key=value".
+ *
+ * @param UriInterface $uri URI to use as a base.
+ * @param string $key Key to set.
+ * @param string|null $value Value to set
+ *
+ * @return UriInterface
+ */
+ public static function withQueryValue(UriInterface $uri, $key, $value)
+ {
+ $result = self::getFilteredQueryString($uri, [$key]);
+
+ $result[] = self::generateQueryString($key, $value);
+
+ return $uri->withQuery(implode('&', $result));
+ }
+
+ /**
+ * Creates a new URI with multiple specific query string values.
+ *
+ * It has the same behavior as withQueryValue() but for an associative array of key => value.
+ *
+ * @param UriInterface $uri URI to use as a base.
+ * @param array $keyValueArray Associative array of key and values
+ *
+ * @return UriInterface
+ */
+ public static function withQueryValues(UriInterface $uri, array $keyValueArray)
+ {
+ $result = self::getFilteredQueryString($uri, array_keys($keyValueArray));
+
+ foreach ($keyValueArray as $key => $value) {
+ $result[] = self::generateQueryString($key, $value);
+ }
+
+ return $uri->withQuery(implode('&', $result));
+ }
+
+ /**
+ * Creates a URI from a hash of `parse_url` components.
+ *
+ * @param array $parts
+ *
+ * @return UriInterface
+ *
+ * @link http://php.net/manual/en/function.parse-url.php
+ *
+ * @throws \InvalidArgumentException If the components do not form a valid URI.
+ */
+ public static function fromParts(array $parts)
+ {
+ $uri = new self();
+ $uri->applyParts($parts);
+ $uri->validateState();
+
+ return $uri;
+ }
+
+ public function getScheme()
+ {
+ return $this->scheme;
+ }
+
+ public function getAuthority()
+ {
+ $authority = $this->host;
+ if ($this->userInfo !== '') {
+ $authority = $this->userInfo . '@' . $authority;
+ }
+
+ if ($this->port !== null) {
+ $authority .= ':' . $this->port;
+ }
+
+ return $authority;
+ }
+
+ public function getUserInfo()
+ {
+ return $this->userInfo;
+ }
+
+ public function getHost()
+ {
+ return $this->host;
+ }
+
+ public function getPort()
+ {
+ return $this->port;
+ }
+
+ public function getPath()
+ {
+ return $this->path;
+ }
+
+ public function getQuery()
+ {
+ return $this->query;
+ }
+
+ public function getFragment()
+ {
+ return $this->fragment;
+ }
+
+ public function withScheme($scheme)
+ {
+ $scheme = $this->filterScheme($scheme);
+
+ if ($this->scheme === $scheme) {
+ return $this;
+ }
+
+ $new = clone $this;
+ $new->scheme = $scheme;
+ $new->removeDefaultPort();
+ $new->validateState();
+
+ return $new;
+ }
+
+ public function withUserInfo($user, $password = null)
+ {
+ $info = $this->filterUserInfoComponent($user);
+ if ($password !== null) {
+ $info .= ':' . $this->filterUserInfoComponent($password);
+ }
+
+ if ($this->userInfo === $info) {
+ return $this;
+ }
+
+ $new = clone $this;
+ $new->userInfo = $info;
+ $new->validateState();
+
+ return $new;
+ }
+
+ public function withHost($host)
+ {
+ $host = $this->filterHost($host);
+
+ if ($this->host === $host) {
+ return $this;
+ }
+
+ $new = clone $this;
+ $new->host = $host;
+ $new->validateState();
+
+ return $new;
+ }
+
+ public function withPort($port)
+ {
+ $port = $this->filterPort($port);
+
+ if ($this->port === $port) {
+ return $this;
+ }
+
+ $new = clone $this;
+ $new->port = $port;
+ $new->removeDefaultPort();
+ $new->validateState();
+
+ return $new;
+ }
+
+ public function withPath($path)
+ {
+ $path = $this->filterPath($path);
+
+ if ($this->path === $path) {
+ return $this;
+ }
+
+ $new = clone $this;
+ $new->path = $path;
+ $new->validateState();
+
+ return $new;
+ }
+
+ public function withQuery($query)
+ {
+ $query = $this->filterQueryAndFragment($query);
+
+ if ($this->query === $query) {
+ return $this;
+ }
+
+ $new = clone $this;
+ $new->query = $query;
+
+ return $new;
+ }
+
+ public function withFragment($fragment)
+ {
+ $fragment = $this->filterQueryAndFragment($fragment);
+
+ if ($this->fragment === $fragment) {
+ return $this;
+ }
+
+ $new = clone $this;
+ $new->fragment = $fragment;
+
+ return $new;
+ }
+
+ /**
+ * Apply parse_url parts to a URI.
+ *
+ * @param array $parts Array of parse_url parts to apply.
+ */
+ private function applyParts(array $parts)
+ {
+ $this->scheme = isset($parts['scheme'])
+ ? $this->filterScheme($parts['scheme'])
+ : '';
+ $this->userInfo = isset($parts['user'])
+ ? $this->filterUserInfoComponent($parts['user'])
+ : '';
+ $this->host = isset($parts['host'])
+ ? $this->filterHost($parts['host'])
+ : '';
+ $this->port = isset($parts['port'])
+ ? $this->filterPort($parts['port'])
+ : null;
+ $this->path = isset($parts['path'])
+ ? $this->filterPath($parts['path'])
+ : '';
+ $this->query = isset($parts['query'])
+ ? $this->filterQueryAndFragment($parts['query'])
+ : '';
+ $this->fragment = isset($parts['fragment'])
+ ? $this->filterQueryAndFragment($parts['fragment'])
+ : '';
+ if (isset($parts['pass'])) {
+ $this->userInfo .= ':' . $this->filterUserInfoComponent($parts['pass']);
+ }
+
+ $this->removeDefaultPort();
+ }
+
+ /**
+ * @param string $scheme
+ *
+ * @return string
+ *
+ * @throws \InvalidArgumentException If the scheme is invalid.
+ */
+ private function filterScheme($scheme)
+ {
+ if (!is_string($scheme)) {
+ throw new \InvalidArgumentException('Scheme must be a string');
+ }
+
+ return \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');
+ }
+
+ /**
+ * @param string $component
+ *
+ * @return string
+ *
+ * @throws \InvalidArgumentException If the user info is invalid.
+ */
+ private function filterUserInfoComponent($component)
+ {
+ if (!is_string($component)) {
+ throw new \InvalidArgumentException('User info must be a string');
+ }
+
+ return preg_replace_callback(
+ '/(?:[^%' . self::$charUnreserved . self::$charSubDelims . ']+|%(?![A-Fa-f0-9]{2}))/',
+ [$this, 'rawurlencodeMatchZero'],
+ $component
+ );
+ }
+
+ /**
+ * @param string $host
+ *
+ * @return string
+ *
+ * @throws \InvalidArgumentException If the host is invalid.
+ */
+ private function filterHost($host)
+ {
+ if (!is_string($host)) {
+ throw new \InvalidArgumentException('Host must be a string');
+ }
+
+ return \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');
+ }
+
+ /**
+ * @param int|null $port
+ *
+ * @return int|null
+ *
+ * @throws \InvalidArgumentException If the port is invalid.
+ */
+ private function filterPort($port)
+ {
+ if ($port === null) {
+ return null;
+ }
+
+ $port = (int) $port;
+ if (0 > $port || 0xffff < $port) {
+ throw new \InvalidArgumentException(
+ sprintf('Invalid port: %d. Must be between 0 and 65535', $port)
+ );
+ }
+
+ return $port;
+ }
+
+ /**
+ * @param UriInterface $uri
+ * @param array $keys
+ *
+ * @return array
+ */
+ private static function getFilteredQueryString(UriInterface $uri, array $keys)
+ {
+ $current = $uri->getQuery();
+
+ if ($current === '') {
+ return [];
+ }
+
+ $decodedKeys = array_map('rawurldecode', $keys);
+
+ return array_filter(explode('&', $current), function ($part) use ($decodedKeys) {
+ return !in_array(rawurldecode(explode('=', $part)[0]), $decodedKeys, true);
+ });
+ }
+
+ /**
+ * @param string $key
+ * @param string|null $value
+ *
+ * @return string
+ */
+ private static function generateQueryString($key, $value)
+ {
+ // Query string separators ("=", "&") within the key or value need to be encoded
+ // (while preventing double-encoding) before setting the query string. All other
+ // chars that need percent-encoding will be encoded by withQuery().
+ $queryString = strtr($key, self::$replaceQuery);
+
+ if ($value !== null) {
+ $queryString .= '=' . strtr($value, self::$replaceQuery);
+ }
+
+ return $queryString;
+ }
+
+ private function removeDefaultPort()
+ {
+ if ($this->port !== null && self::isDefaultPort($this)) {
+ $this->port = null;
+ }
+ }
+
+ /**
+ * Filters the path of a URI
+ *
+ * @param string $path
+ *
+ * @return string
+ *
+ * @throws \InvalidArgumentException If the path is invalid.
+ */
+ private function filterPath($path)
+ {
+ if (!is_string($path)) {
+ throw new \InvalidArgumentException('Path must be a string');
+ }
+
+ return preg_replace_callback(
+ '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/',
+ [$this, 'rawurlencodeMatchZero'],
+ $path
+ );
+ }
+
+ /**
+ * Filters the query string or fragment of a URI.
+ *
+ * @param string $str
+ *
+ * @return string
+ *
+ * @throws \InvalidArgumentException If the query or fragment is invalid.
+ */
+ private function filterQueryAndFragment($str)
+ {
+ if (!is_string($str)) {
+ throw new \InvalidArgumentException('Query and fragment must be a string');
+ }
+
+ return preg_replace_callback(
+ '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/',
+ [$this, 'rawurlencodeMatchZero'],
+ $str
+ );
+ }
+
+ private function rawurlencodeMatchZero(array $match)
+ {
+ return rawurlencode($match[0]);
+ }
+
+ private function validateState()
+ {
+ if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) {
+ $this->host = self::HTTP_DEFAULT_HOST;
+ }
+
+ if ($this->getAuthority() === '') {
+ if (0 === strpos($this->path, '//')) {
+ throw new \InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"');
+ }
+ if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) {
+ throw new \InvalidArgumentException('A relative URI must not have a path beginning with a segment containing a colon');
+ }
+ } elseif (isset($this->path[0]) && $this->path[0] !== '/') {
+ @trigger_error(
+ 'The path of a URI with an authority must start with a slash "/" or be empty. Automagically fixing the URI ' .
+ 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.',
+ E_USER_DEPRECATED
+ );
+ $this->path = '/' . $this->path;
+ //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty');
+ }
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/UriNormalizer.php b/lib/gerencianet/guzzlehttp/psr7/src/UriNormalizer.php
new file mode 100644
index 0000000..81419ea
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/UriNormalizer.php
@@ -0,0 +1,219 @@
+getPath() === '' &&
+ ($uri->getScheme() === 'http' || $uri->getScheme() === 'https')
+ ) {
+ $uri = $uri->withPath('/');
+ }
+
+ if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') {
+ $uri = $uri->withHost('');
+ }
+
+ if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) {
+ $uri = $uri->withPort(null);
+ }
+
+ if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) {
+ $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath()));
+ }
+
+ if ($flags & self::REMOVE_DUPLICATE_SLASHES) {
+ $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath()));
+ }
+
+ if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') {
+ $queryKeyValues = explode('&', $uri->getQuery());
+ sort($queryKeyValues);
+ $uri = $uri->withQuery(implode('&', $queryKeyValues));
+ }
+
+ return $uri;
+ }
+
+ /**
+ * Whether two URIs can be considered equivalent.
+ *
+ * Both URIs are normalized automatically before comparison with the given $normalizations bitmask. The method also
+ * accepts relative URI references and returns true when they are equivalent. This of course assumes they will be
+ * resolved against the same base URI. If this is not the case, determination of equivalence or difference of
+ * relative references does not mean anything.
+ *
+ * @param UriInterface $uri1 An URI to compare
+ * @param UriInterface $uri2 An URI to compare
+ * @param int $normalizations A bitmask of normalizations to apply, see constants
+ *
+ * @return bool
+ *
+ * @link https://tools.ietf.org/html/rfc3986#section-6.1
+ */
+ public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS)
+ {
+ return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations);
+ }
+
+ private static function capitalizePercentEncoding(UriInterface $uri)
+ {
+ $regex = '/(?:%[A-Fa-f0-9]{2})++/';
+
+ $callback = function (array $match) {
+ return strtoupper($match[0]);
+ };
+
+ return
+ $uri->withPath(
+ preg_replace_callback($regex, $callback, $uri->getPath())
+ )->withQuery(
+ preg_replace_callback($regex, $callback, $uri->getQuery())
+ );
+ }
+
+ private static function decodeUnreservedCharacters(UriInterface $uri)
+ {
+ $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i';
+
+ $callback = function (array $match) {
+ return rawurldecode($match[0]);
+ };
+
+ return
+ $uri->withPath(
+ preg_replace_callback($regex, $callback, $uri->getPath())
+ )->withQuery(
+ preg_replace_callback($regex, $callback, $uri->getQuery())
+ );
+ }
+
+ private function __construct()
+ {
+ // cannot be instantiated
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/UriResolver.php b/lib/gerencianet/guzzlehttp/psr7/src/UriResolver.php
new file mode 100644
index 0000000..a3cb15d
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/UriResolver.php
@@ -0,0 +1,222 @@
+getScheme() != '') {
+ return $rel->withPath(self::removeDotSegments($rel->getPath()));
+ }
+
+ if ($rel->getAuthority() != '') {
+ $targetAuthority = $rel->getAuthority();
+ $targetPath = self::removeDotSegments($rel->getPath());
+ $targetQuery = $rel->getQuery();
+ } else {
+ $targetAuthority = $base->getAuthority();
+ if ($rel->getPath() === '') {
+ $targetPath = $base->getPath();
+ $targetQuery = $rel->getQuery() != '' ? $rel->getQuery() : $base->getQuery();
+ } else {
+ if ($rel->getPath()[0] === '/') {
+ $targetPath = $rel->getPath();
+ } else {
+ if ($targetAuthority != '' && $base->getPath() === '') {
+ $targetPath = '/' . $rel->getPath();
+ } else {
+ $lastSlashPos = strrpos($base->getPath(), '/');
+ if ($lastSlashPos === false) {
+ $targetPath = $rel->getPath();
+ } else {
+ $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1) . $rel->getPath();
+ }
+ }
+ }
+ $targetPath = self::removeDotSegments($targetPath);
+ $targetQuery = $rel->getQuery();
+ }
+ }
+
+ return new Uri(Uri::composeComponents(
+ $base->getScheme(),
+ $targetAuthority,
+ $targetPath,
+ $targetQuery,
+ $rel->getFragment()
+ ));
+ }
+
+ /**
+ * Returns the target URI as a relative reference from the base URI.
+ *
+ * This method is the counterpart to resolve():
+ *
+ * (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target))
+ *
+ * One use-case is to use the current request URI as base URI and then generate relative links in your documents
+ * to reduce the document size or offer self-contained downloadable document archives.
+ *
+ * $base = new Uri('http://example.com/a/b/');
+ * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'.
+ * echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'.
+ * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'.
+ * echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'.
+ *
+ * This method also accepts a target that is already relative and will try to relativize it further. Only a
+ * relative-path reference will be returned as-is.
+ *
+ * echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well
+ *
+ * @param UriInterface $base Base URI
+ * @param UriInterface $target Target URI
+ *
+ * @return UriInterface The relative URI reference
+ */
+ public static function relativize(UriInterface $base, UriInterface $target)
+ {
+ if ($target->getScheme() !== '' &&
+ ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '')
+ ) {
+ return $target;
+ }
+
+ if (Uri::isRelativePathReference($target)) {
+ // As the target is already highly relative we return it as-is. It would be possible to resolve
+ // the target with `$target = self::resolve($base, $target);` and then try make it more relative
+ // by removing a duplicate query. But let's not do that automatically.
+ return $target;
+ }
+
+ if ($target->getAuthority() !== '' && $base->getAuthority() !== $target->getAuthority()) {
+ return $target->withScheme('');
+ }
+
+ // We must remove the path before removing the authority because if the path starts with two slashes, the URI
+ // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also
+ // invalid.
+ $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost('');
+
+ if ($base->getPath() !== $target->getPath()) {
+ return $emptyPathUri->withPath(self::getRelativePath($base, $target));
+ }
+
+ if ($base->getQuery() === $target->getQuery()) {
+ // Only the target fragment is left. And it must be returned even if base and target fragment are the same.
+ return $emptyPathUri->withQuery('');
+ }
+
+ // If the base URI has a query but the target has none, we cannot return an empty path reference as it would
+ // inherit the base query component when resolving.
+ if ($target->getQuery() === '') {
+ $segments = explode('/', $target->getPath());
+ $lastSegment = end($segments);
+
+ return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment);
+ }
+
+ return $emptyPathUri;
+ }
+
+ private static function getRelativePath(UriInterface $base, UriInterface $target)
+ {
+ $sourceSegments = explode('/', $base->getPath());
+ $targetSegments = explode('/', $target->getPath());
+ array_pop($sourceSegments);
+ $targetLastSegment = array_pop($targetSegments);
+ foreach ($sourceSegments as $i => $segment) {
+ if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) {
+ unset($sourceSegments[$i], $targetSegments[$i]);
+ } else {
+ break;
+ }
+ }
+ $targetSegments[] = $targetLastSegment;
+ $relativePath = str_repeat('../', count($sourceSegments)) . implode('/', $targetSegments);
+
+ // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./".
+ // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used
+ // as the first segment of a relative-path reference, as it would be mistaken for a scheme name.
+ if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) {
+ $relativePath = "./$relativePath";
+ } elseif ('/' === $relativePath[0]) {
+ if ($base->getAuthority() != '' && $base->getPath() === '') {
+ // In this case an extra slash is added by resolve() automatically. So we must not add one here.
+ $relativePath = ".$relativePath";
+ } else {
+ $relativePath = "./$relativePath";
+ }
+ }
+
+ return $relativePath;
+ }
+
+ private function __construct()
+ {
+ // cannot be instantiated
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/Utils.php b/lib/gerencianet/guzzlehttp/psr7/src/Utils.php
new file mode 100644
index 0000000..6b6c8cc
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/Utils.php
@@ -0,0 +1,428 @@
+ $keys
+ *
+ * @return array
+ */
+ public static function caselessRemove($keys, array $data)
+ {
+ $result = [];
+
+ foreach ($keys as &$key) {
+ $key = strtolower($key);
+ }
+
+ foreach ($data as $k => $v) {
+ if (!in_array(strtolower($k), $keys)) {
+ $result[$k] = $v;
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Copy the contents of a stream into another stream until the given number
+ * of bytes have been read.
+ *
+ * @param StreamInterface $source Stream to read from
+ * @param StreamInterface $dest Stream to write to
+ * @param int $maxLen Maximum number of bytes to read. Pass -1
+ * to read the entire stream.
+ *
+ * @throws \RuntimeException on error.
+ */
+ public static function copyToStream(StreamInterface $source, StreamInterface $dest, $maxLen = -1)
+ {
+ $bufferSize = 8192;
+
+ if ($maxLen === -1) {
+ while (!$source->eof()) {
+ if (!$dest->write($source->read($bufferSize))) {
+ break;
+ }
+ }
+ } else {
+ $remaining = $maxLen;
+ while ($remaining > 0 && !$source->eof()) {
+ $buf = $source->read(min($bufferSize, $remaining));
+ $len = strlen($buf);
+ if (!$len) {
+ break;
+ }
+ $remaining -= $len;
+ $dest->write($buf);
+ }
+ }
+ }
+
+ /**
+ * Copy the contents of a stream into a string until the given number of
+ * bytes have been read.
+ *
+ * @param StreamInterface $stream Stream to read
+ * @param int $maxLen Maximum number of bytes to read. Pass -1
+ * to read the entire stream.
+ *
+ * @return string
+ *
+ * @throws \RuntimeException on error.
+ */
+ public static function copyToString(StreamInterface $stream, $maxLen = -1)
+ {
+ $buffer = '';
+
+ if ($maxLen === -1) {
+ while (!$stream->eof()) {
+ $buf = $stream->read(1048576);
+ // Using a loose equality here to match on '' and false.
+ if ($buf == null) {
+ break;
+ }
+ $buffer .= $buf;
+ }
+ return $buffer;
+ }
+
+ $len = 0;
+ while (!$stream->eof() && $len < $maxLen) {
+ $buf = $stream->read($maxLen - $len);
+ // Using a loose equality here to match on '' and false.
+ if ($buf == null) {
+ break;
+ }
+ $buffer .= $buf;
+ $len = strlen($buffer);
+ }
+
+ return $buffer;
+ }
+
+ /**
+ * Calculate a hash of a stream.
+ *
+ * This method reads the entire stream to calculate a rolling hash, based
+ * on PHP's `hash_init` functions.
+ *
+ * @param StreamInterface $stream Stream to calculate the hash for
+ * @param string $algo Hash algorithm (e.g. md5, crc32, etc)
+ * @param bool $rawOutput Whether or not to use raw output
+ *
+ * @return string Returns the hash of the stream
+ *
+ * @throws \RuntimeException on error.
+ */
+ public static function hash(StreamInterface $stream, $algo, $rawOutput = false)
+ {
+ $pos = $stream->tell();
+
+ if ($pos > 0) {
+ $stream->rewind();
+ }
+
+ $ctx = hash_init($algo);
+ while (!$stream->eof()) {
+ hash_update($ctx, $stream->read(1048576));
+ }
+
+ $out = hash_final($ctx, (bool) $rawOutput);
+ $stream->seek($pos);
+
+ return $out;
+ }
+
+ /**
+ * Clone and modify a request with the given changes.
+ *
+ * This method is useful for reducing the number of clones needed to mutate
+ * a message.
+ *
+ * The changes can be one of:
+ * - method: (string) Changes the HTTP method.
+ * - set_headers: (array) Sets the given headers.
+ * - remove_headers: (array) Remove the given headers.
+ * - body: (mixed) Sets the given body.
+ * - uri: (UriInterface) Set the URI.
+ * - query: (string) Set the query string value of the URI.
+ * - version: (string) Set the protocol version.
+ *
+ * @param RequestInterface $request Request to clone and modify.
+ * @param array $changes Changes to apply.
+ *
+ * @return RequestInterface
+ */
+ public static function modifyRequest(RequestInterface $request, array $changes)
+ {
+ if (!$changes) {
+ return $request;
+ }
+
+ $headers = $request->getHeaders();
+
+ if (!isset($changes['uri'])) {
+ $uri = $request->getUri();
+ } else {
+ // Remove the host header if one is on the URI
+ if ($host = $changes['uri']->getHost()) {
+ $changes['set_headers']['Host'] = $host;
+
+ if ($port = $changes['uri']->getPort()) {
+ $standardPorts = ['http' => 80, 'https' => 443];
+ $scheme = $changes['uri']->getScheme();
+ if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) {
+ $changes['set_headers']['Host'] .= ':' . $port;
+ }
+ }
+ }
+ $uri = $changes['uri'];
+ }
+
+ if (!empty($changes['remove_headers'])) {
+ $headers = self::caselessRemove($changes['remove_headers'], $headers);
+ }
+
+ if (!empty($changes['set_headers'])) {
+ $headers = self::caselessRemove(array_keys($changes['set_headers']), $headers);
+ $headers = $changes['set_headers'] + $headers;
+ }
+
+ if (isset($changes['query'])) {
+ $uri = $uri->withQuery($changes['query']);
+ }
+
+ if ($request instanceof ServerRequestInterface) {
+ $new = (new ServerRequest(
+ isset($changes['method']) ? $changes['method'] : $request->getMethod(),
+ $uri,
+ $headers,
+ isset($changes['body']) ? $changes['body'] : $request->getBody(),
+ isset($changes['version'])
+ ? $changes['version']
+ : $request->getProtocolVersion(),
+ $request->getServerParams()
+ ))
+ ->withParsedBody($request->getParsedBody())
+ ->withQueryParams($request->getQueryParams())
+ ->withCookieParams($request->getCookieParams())
+ ->withUploadedFiles($request->getUploadedFiles());
+
+ foreach ($request->getAttributes() as $key => $value) {
+ $new = $new->withAttribute($key, $value);
+ }
+
+ return $new;
+ }
+
+ return new Request(
+ isset($changes['method']) ? $changes['method'] : $request->getMethod(),
+ $uri,
+ $headers,
+ isset($changes['body']) ? $changes['body'] : $request->getBody(),
+ isset($changes['version'])
+ ? $changes['version']
+ : $request->getProtocolVersion()
+ );
+ }
+
+ /**
+ * Read a line from the stream up to the maximum allowed buffer length.
+ *
+ * @param StreamInterface $stream Stream to read from
+ * @param int|null $maxLength Maximum buffer length
+ *
+ * @return string
+ */
+ public static function readLine(StreamInterface $stream, $maxLength = null)
+ {
+ $buffer = '';
+ $size = 0;
+
+ while (!$stream->eof()) {
+ // Using a loose equality here to match on '' and false.
+ if (null == ($byte = $stream->read(1))) {
+ return $buffer;
+ }
+ $buffer .= $byte;
+ // Break when a new line is found or the max length - 1 is reached
+ if ($byte === "\n" || ++$size === $maxLength - 1) {
+ break;
+ }
+ }
+
+ return $buffer;
+ }
+
+ /**
+ * Create a new stream based on the input type.
+ *
+ * Options is an associative array that can contain the following keys:
+ * - metadata: Array of custom metadata.
+ * - size: Size of the stream.
+ *
+ * This method accepts the following `$resource` types:
+ * - `Psr\Http\Message\StreamInterface`: Returns the value as-is.
+ * - `string`: Creates a stream object that uses the given string as the contents.
+ * - `resource`: Creates a stream object that wraps the given PHP stream resource.
+ * - `Iterator`: If the provided value implements `Iterator`, then a read-only
+ * stream object will be created that wraps the given iterable. Each time the
+ * stream is read from, data from the iterator will fill a buffer and will be
+ * continuously called until the buffer is equal to the requested read size.
+ * Subsequent read calls will first read from the buffer and then call `next`
+ * on the underlying iterator until it is exhausted.
+ * - `object` with `__toString()`: If the object has the `__toString()` method,
+ * the object will be cast to a string and then a stream will be returned that
+ * uses the string value.
+ * - `NULL`: When `null` is passed, an empty stream object is returned.
+ * - `callable` When a callable is passed, a read-only stream object will be
+ * created that invokes the given callable. The callable is invoked with the
+ * number of suggested bytes to read. The callable can return any number of
+ * bytes, but MUST return `false` when there is no more data to return. The
+ * stream object that wraps the callable will invoke the callable until the
+ * number of requested bytes are available. Any additional bytes will be
+ * buffered and used in subsequent reads.
+ *
+ * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data
+ * @param array $options Additional options
+ *
+ * @return StreamInterface
+ *
+ * @throws \InvalidArgumentException if the $resource arg is not valid.
+ */
+ public static function streamFor($resource = '', array $options = [])
+ {
+ if (is_scalar($resource)) {
+ $stream = self::tryFopen('php://temp', 'r+');
+ if ($resource !== '') {
+ fwrite($stream, $resource);
+ fseek($stream, 0);
+ }
+ return new Stream($stream, $options);
+ }
+
+ switch (gettype($resource)) {
+ case 'resource':
+ /*
+ * The 'php://input' is a special stream with quirks and inconsistencies.
+ * We avoid using that stream by reading it into php://temp
+ */
+ $metaData = \stream_get_meta_data($resource);
+ if (isset($metaData['uri']) && $metaData['uri'] === 'php://input') {
+ $stream = self::tryFopen('php://temp', 'w+');
+ fwrite($stream, stream_get_contents($resource));
+ fseek($stream, 0);
+ $resource = $stream;
+ }
+ return new Stream($resource, $options);
+ case 'object':
+ if ($resource instanceof StreamInterface) {
+ return $resource;
+ } elseif ($resource instanceof \Iterator) {
+ return new PumpStream(function () use ($resource) {
+ if (!$resource->valid()) {
+ return false;
+ }
+ $result = $resource->current();
+ $resource->next();
+ return $result;
+ }, $options);
+ } elseif (method_exists($resource, '__toString')) {
+ return Utils::streamFor((string) $resource, $options);
+ }
+ break;
+ case 'NULL':
+ return new Stream(self::tryFopen('php://temp', 'r+'), $options);
+ }
+
+ if (is_callable($resource)) {
+ return new PumpStream($resource, $options);
+ }
+
+ throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource));
+ }
+
+ /**
+ * Safely opens a PHP stream resource using a filename.
+ *
+ * When fopen fails, PHP normally raises a warning. This function adds an
+ * error handler that checks for errors and throws an exception instead.
+ *
+ * @param string $filename File to open
+ * @param string $mode Mode used to open the file
+ *
+ * @return resource
+ *
+ * @throws \RuntimeException if the file cannot be opened
+ */
+ public static function tryFopen($filename, $mode)
+ {
+ $ex = null;
+ set_error_handler(function () use ($filename, $mode, &$ex) {
+ $ex = new \RuntimeException(sprintf(
+ 'Unable to open "%s" using mode "%s": %s',
+ $filename,
+ $mode,
+ func_get_args()[1]
+ ));
+
+ return true;
+ });
+
+ try {
+ $handle = fopen($filename, $mode);
+ } catch (\Throwable $e) {
+ $ex = new \RuntimeException(sprintf(
+ 'Unable to open "%s" using mode "%s": %s',
+ $filename,
+ $mode,
+ $e->getMessage()
+ ), 0, $e);
+ }
+
+ restore_error_handler();
+
+ if ($ex) {
+ /** @var $ex \RuntimeException */
+ throw $ex;
+ }
+
+ return $handle;
+ }
+
+ /**
+ * Returns a UriInterface for the given value.
+ *
+ * This function accepts a string or UriInterface and returns a
+ * UriInterface for the given value. If the value is already a
+ * UriInterface, it is returned as-is.
+ *
+ * @param string|UriInterface $uri
+ *
+ * @return UriInterface
+ *
+ * @throws \InvalidArgumentException
+ */
+ public static function uriFor($uri)
+ {
+ if ($uri instanceof UriInterface) {
+ return $uri;
+ }
+
+ if (is_string($uri)) {
+ return new Uri($uri);
+ }
+
+ throw new \InvalidArgumentException('URI must be a string or UriInterface');
+ }
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/functions.php b/lib/gerencianet/guzzlehttp/psr7/src/functions.php
new file mode 100644
index 0000000..b0901fa
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/functions.php
@@ -0,0 +1,422 @@
+ '1', 'foo[b]' => '2'])`.
+ *
+ * @param string $str Query string to parse
+ * @param int|bool $urlEncoding How the query string is encoded
+ *
+ * @return array
+ *
+ * @deprecated parse_query will be removed in guzzlehttp/psr7:2.0. Use Query::parse instead.
+ */
+function parse_query($str, $urlEncoding = true)
+{
+ return Query::parse($str, $urlEncoding);
+}
+
+/**
+ * Build a query string from an array of key value pairs.
+ *
+ * This function can use the return value of `parse_query()` to build a query
+ * string. This function does not modify the provided keys when an array is
+ * encountered (like `http_build_query()` would).
+ *
+ * @param array $params Query string parameters.
+ * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986
+ * to encode using RFC3986, or PHP_QUERY_RFC1738
+ * to encode using RFC1738.
+ *
+ * @return string
+ *
+ * @deprecated build_query will be removed in guzzlehttp/psr7:2.0. Use Query::build instead.
+ */
+function build_query(array $params, $encoding = PHP_QUERY_RFC3986)
+{
+ return Query::build($params, $encoding);
+}
+
+/**
+ * Determines the mimetype of a file by looking at its extension.
+ *
+ * @param string $filename
+ *
+ * @return string|null
+ *
+ * @deprecated mimetype_from_filename will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromFilename instead.
+ */
+function mimetype_from_filename($filename)
+{
+ return MimeType::fromFilename($filename);
+}
+
+/**
+ * Maps a file extensions to a mimetype.
+ *
+ * @param $extension string The file extension.
+ *
+ * @return string|null
+ *
+ * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types
+ * @deprecated mimetype_from_extension will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromExtension instead.
+ */
+function mimetype_from_extension($extension)
+{
+ return MimeType::fromExtension($extension);
+}
+
+/**
+ * Parses an HTTP message into an associative array.
+ *
+ * The array contains the "start-line" key containing the start line of
+ * the message, "headers" key containing an associative array of header
+ * array values, and a "body" key containing the body of the message.
+ *
+ * @param string $message HTTP request or response to parse.
+ *
+ * @return array
+ *
+ * @internal
+ *
+ * @deprecated _parse_message will be removed in guzzlehttp/psr7:2.0. Use Message::parseMessage instead.
+ */
+function _parse_message($message)
+{
+ return Message::parseMessage($message);
+}
+
+/**
+ * Constructs a URI for an HTTP request message.
+ *
+ * @param string $path Path from the start-line
+ * @param array $headers Array of headers (each value an array).
+ *
+ * @return string
+ *
+ * @internal
+ *
+ * @deprecated _parse_request_uri will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequestUri instead.
+ */
+function _parse_request_uri($path, array $headers)
+{
+ return Message::parseRequestUri($path, $headers);
+}
+
+/**
+ * Get a short summary of the message body.
+ *
+ * Will return `null` if the response is not printable.
+ *
+ * @param MessageInterface $message The message to get the body summary
+ * @param int $truncateAt The maximum allowed size of the summary
+ *
+ * @return string|null
+ *
+ * @deprecated get_message_body_summary will be removed in guzzlehttp/psr7:2.0. Use Message::bodySummary instead.
+ */
+function get_message_body_summary(MessageInterface $message, $truncateAt = 120)
+{
+ return Message::bodySummary($message, $truncateAt);
+}
+
+/**
+ * Remove the items given by the keys, case insensitively from the data.
+ *
+ * @param iterable $keys
+ *
+ * @return array
+ *
+ * @internal
+ *
+ * @deprecated _caseless_remove will be removed in guzzlehttp/psr7:2.0. Use Utils::caselessRemove instead.
+ */
+function _caseless_remove($keys, array $data)
+{
+ return Utils::caselessRemove($keys, $data);
+}
diff --git a/lib/gerencianet/guzzlehttp/psr7/src/functions_include.php b/lib/gerencianet/guzzlehttp/psr7/src/functions_include.php
new file mode 100644
index 0000000..96a4a83
--- /dev/null
+++ b/lib/gerencianet/guzzlehttp/psr7/src/functions_include.php
@@ -0,0 +1,6 @@
+
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/lib/gerencianet/guzzlehttp/ringphp/Makefile b/lib/gerencianet/guzzlehttp/ringphp/Makefile
deleted file mode 100644
index 21c812e..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/Makefile
+++ /dev/null
@@ -1,46 +0,0 @@
-all: clean coverage docs
-
-docs:
- cd docs && make html
-
-view-docs:
- open docs/_build/html/index.html
-
-start-server: stop-server
- node tests/Client/server.js &> /dev/null &
-
-stop-server:
- @PID=$(shell ps axo pid,command \
- | grep 'tests/Client/server.js' \
- | grep -v grep \
- | cut -f 1 -d " "\
- ) && [ -n "$$PID" ] && kill $$PID || true
-
-test: start-server
- vendor/bin/phpunit $(TEST)
- $(MAKE) stop-server
-
-coverage: start-server
- vendor/bin/phpunit --coverage-html=build/artifacts/coverage $(TEST)
- $(MAKE) stop-server
-
-view-coverage:
- open build/artifacts/coverage/index.html
-
-clean:
- rm -rf build/artifacts/*
- cd docs && make clean
-
-tag:
- $(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=4.2.1"))
- @echo Tagging $(TAG)
- chag update -m '$(TAG) ()'
- git add -A
- git commit -m '$(TAG) release'
- chag tag
-
-perf: start-server
- php tests/perf.php
- $(MAKE) stop-server
-
-.PHONY: docs
diff --git a/lib/gerencianet/guzzlehttp/ringphp/README.rst b/lib/gerencianet/guzzlehttp/ringphp/README.rst
deleted file mode 100644
index 10374e8..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/README.rst
+++ /dev/null
@@ -1,46 +0,0 @@
-=======
-RingPHP
-=======
-
-Provides a simple API and specification that abstracts away the details of HTTP
-into a single PHP function. RingPHP be used to power HTTP clients and servers
-through a PHP function that accepts a request hash and returns a response hash
-that is fulfilled using a `promise `_,
-allowing RingPHP to support both synchronous and asynchronous workflows.
-
-By abstracting the implementation details of different HTTP clients and
-servers, RingPHP allows you to utilize pluggable HTTP clients and servers
-without tying your application to a specific implementation.
-
-.. code-block:: php
-
- 'GET',
- 'uri' => '/',
- 'headers' => [
- 'host' => ['www.google.com'],
- 'x-foo' => ['baz']
- ]
- ]);
-
- $response->then(function (array $response) {
- echo $response['status'];
- });
-
- $response->wait();
-
-RingPHP is inspired by Clojure's `Ring `_,
-which, in turn, was inspired by Python's WSGI and Ruby's Rack. RingPHP is
-utilized as the handler layer in `Guzzle `_ 5.0+ to send
-HTTP requests.
-
-Documentation
--------------
-
-See http://ringphp.readthedocs.org/ for the full online documentation.
diff --git a/lib/gerencianet/guzzlehttp/ringphp/composer.json b/lib/gerencianet/guzzlehttp/ringphp/composer.json
deleted file mode 100644
index 22002ef..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/composer.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "name": "guzzlehttp/ringphp",
- "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.",
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.4.0",
- "guzzlehttp/streams": "~3.0",
- "react/promise": "~2.0"
- },
- "require-dev": {
- "ext-curl": "*",
- "phpunit/phpunit": "~4.0"
- },
- "suggest": {
- "ext-curl": "Guzzle will use specific adapters if cURL is present"
- },
- "autoload": {
- "psr-4": {
- "GuzzleHttp\\Ring\\": "src/"
- }
- },
- "autoload-dev": {
- "psr-4": {
- "GuzzleHttp\\Tests\\Ring\\": "tests/"
- }
- },
- "extra": {
- "branch-alias": {
- "dev-master": "1.1-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/docs/Makefile b/lib/gerencianet/guzzlehttp/ringphp/docs/Makefile
deleted file mode 100644
index 51270aa..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/docs/Makefile
+++ /dev/null
@@ -1,153 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = sphinx-build
-PAPER =
-BUILDDIR = _build
-
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-# the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
-
-help:
- @echo "Please use \`make ' where is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " texinfo to make Texinfo files"
- @echo " info to make Texinfo files and run them through makeinfo"
- @echo " gettext to make PO message catalogs"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
-
-clean:
- -rm -rf $(BUILDDIR)/*
-
-html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-dirhtml:
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-singlehtml:
- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
-
-pickle:
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
- @echo
- @echo "Build finished; now you can process the pickle files."
-
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-htmlhelp:
- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
- @echo
- @echo "Build finished; now you can run HTML Help Workshop with the" \
- ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-qthelp:
- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
- @echo
- @echo "Build finished; now you can run "qcollectiongenerator" with the" \
- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/GuzzleRing.qhcp"
- @echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/GuzzleRing.qhc"
-
-devhelp:
- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
- @echo
- @echo "Build finished."
- @echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/GuzzleRing"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/GuzzleRing"
- @echo "# devhelp"
-
-epub:
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
- "(use \`make latexpdf' here to do that automatically)."
-
-latexpdf:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through pdflatex..."
- $(MAKE) -C $(BUILDDIR)/latex all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-text:
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-man:
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-texinfo:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo
- @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
- @echo "Run \`make' in that directory to run these through makeinfo" \
- "(use \`make info' here to do that automatically)."
-
-info:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo "Running Texinfo files through makeinfo..."
- make -C $(BUILDDIR)/texinfo info
- @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
-
-gettext:
- $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
- @echo
- @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
-
-changes:
- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
- @echo
- @echo "The overview file is in $(BUILDDIR)/changes."
-
-linkcheck:
- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
- @echo
- @echo "Link check complete; look for any errors in the above output " \
- "or in $(BUILDDIR)/linkcheck/output.txt."
-
-doctest:
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/lib/gerencianet/guzzlehttp/ringphp/docs/client_handlers.rst b/lib/gerencianet/guzzlehttp/ringphp/docs/client_handlers.rst
deleted file mode 100644
index 3151f00..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/docs/client_handlers.rst
+++ /dev/null
@@ -1,173 +0,0 @@
-===============
-Client Handlers
-===============
-
-Client handlers accept a request array and return a future response array that
-can be used synchronously as an array or asynchronously using a promise.
-
-Built-In Handlers
------------------
-
-RingPHP comes with three built-in client handlers.
-
-Stream Handler
-~~~~~~~~~~~~~~
-
-The ``GuzzleHttp\Ring\Client\StreamHandler`` uses PHP's
-`http stream wrapper `_ to send
-requests.
-
-.. note::
-
- This handler cannot send requests concurrently.
-
-You can provide an associative array of custom stream context options to the
-StreamHandler using the ``stream_context`` key of the ``client`` request
-option.
-
-.. code-block:: php
-
- use GuzzleHttp\Ring\Client\StreamHandler;
-
- $response = $handler([
- 'http_method' => 'GET',
- 'uri' => '/',
- 'headers' => ['host' => ['httpbin.org']],
- 'client' => [
- 'stream_context' => [
- 'http' => [
- 'request_fulluri' => true,
- 'method' => 'HEAD'
- ],
- 'socket' => [
- 'bindto' => '127.0.0.1:0'
- ],
- 'ssl' => [
- 'verify_peer' => false
- ]
- ]
- ]
- ]);
-
- // Even though it's already completed, you can still use a promise
- $response->then(function ($response) {
- echo $response['status']; // 200
- });
-
- // Or access the response using the future interface
- echo $response['status']; // 200
-
-cURL Handler
-~~~~~~~~~~~~
-
-The ``GuzzleHttp\Ring\Client\CurlHandler`` can be used with PHP 5.5+ to send
-requests using cURL easy handles. This handler is great for sending requests
-one at a time because the execute and select loop is implemented in C code
-which executes faster and consumes less memory than using PHP's
-``curl_multi_*`` interface.
-
-.. note::
-
- This handler cannot send requests concurrently.
-
-When using the CurlHandler, custom curl options can be specified as an
-associative array of `cURL option constants `_
-mapping to values in the ``client`` option of a requst using the **curl** key.
-
-.. code-block:: php
-
- use GuzzleHttp\Ring\Client\CurlHandler;
-
- $handler = new CurlHandler();
-
- $request = [
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'client' => ['curl' => [CURLOPT_LOW_SPEED_LIMIT => 10]]
- ];
-
- $response = $handler($request);
-
- // The response can be used directly as an array.
- echo $response['status']; // 200
-
- // Or, it can be used as a promise (that has already fulfilled).
- $response->then(function ($response) {
- echo $response['status']; // 200
- });
-
-cURL Multi Handler
-~~~~~~~~~~~~~~~~~~
-
-The ``GuzzleHttp\Ring\Client\CurlMultiHandler`` transfers requests using
-cURL's `multi API `_. The
-``CurlMultiHandler`` is great for sending requests concurrently.
-
-.. code-block:: php
-
- use GuzzleHttp\Ring\Client\CurlMultiHandler;
-
- $handler = new CurlMultiHandler();
-
- $request = [
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]]
- ];
-
- // this call returns a future array immediately.
- $response = $handler($request);
-
- // Ideally, you should use the promise API to not block.
- $response
- ->then(function ($response) {
- // Got the response at some point in the future
- echo $response['status']; // 200
- // Don't break the chain
- return $response;
- })->then(function ($response) {
- // ...
- });
-
- // If you really need to block, then you can use the response as an
- // associative array. This will block until it has completed.
- echo $response['status']; // 200
-
-Just like the ``CurlHandler``, the ``CurlMultiHandler`` accepts custom curl
-option in the ``curl`` key of the ``client`` request option.
-
-Mock Handler
-~~~~~~~~~~~~
-
-The ``GuzzleHttp\Ring\Client\MockHandler`` is used to return mock responses.
-When constructed, the handler can be configured to return the same response
-array over and over, a future response, or a the evaluation of a callback
-function.
-
-.. code-block:: php
-
- use GuzzleHttp\Ring\Client\MockHandler;
-
- // Return a canned response.
- $mock = new MockHandler(['status' => 200]);
- $response = $mock([]);
- assert(200 == $response['status']);
- assert([] == $response['headers']);
-
-Implementing Handlers
----------------------
-
-Client handlers are just PHP callables (functions or classes that have the
-``__invoke`` magic method). The callable accepts a request array and MUST
-return an instance of ``GuzzleHttp\Ring\Future\FutureArrayInterface`` so that
-the response can be used by both blocking and non-blocking consumers.
-
-Handlers need to follow a few simple rules:
-
-1. Do not throw exceptions. If an error is encountered, return an array that
- contains the ``error`` key that maps to an ``\Exception`` value.
-2. If the request has a ``delay`` client option, then the handler should only
- send the request after the specified delay time in seconds. Blocking
- handlers may find it convenient to just let the
- ``GuzzleHttp\Ring\Core::doSleep($request)`` function handle this for them.
-3. Always return an instance of ``GuzzleHttp\Ring\Future\FutureArrayInterface``.
-4. Complete any outstanding requests when the handler is destructed.
diff --git a/lib/gerencianet/guzzlehttp/ringphp/docs/client_middleware.rst b/lib/gerencianet/guzzlehttp/ringphp/docs/client_middleware.rst
deleted file mode 100644
index 5a2c1a8..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/docs/client_middleware.rst
+++ /dev/null
@@ -1,165 +0,0 @@
-=================
-Client Middleware
-=================
-
-Middleware intercepts requests before they are sent over the wire and can be
-used to add functionality to handlers.
-
-Modifying Requests
-------------------
-
-Let's say you wanted to modify requests before they are sent over the wire
-so that they always add specific headers. This can be accomplished by creating
-a function that accepts a handler and returns a new function that adds the
-composed behavior.
-
-.. code-block:: php
-
- use GuzzleHttp\Ring\Client\CurlHandler;
-
- $handler = new CurlHandler();
-
- $addHeaderHandler = function (callable $handler, array $headers = []) {
- return function (array $request) use ($handler, $headers) {
- // Add our custom headers
- foreach ($headers as $key => $value) {
- $request['headers'][$key] = $value;
- }
-
- // Send the request using the handler and return the response.
- return $handler($request);
- }
- };
-
- // Create a new handler that adds headers to each request.
- $handler = $addHeaderHandler($handler, [
- 'X-AddMe' => 'hello',
- 'Authorization' => 'Basic xyz'
- ]);
-
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => ['Host' => ['httpbin.org']]
- ]);
-
-Modifying Responses
--------------------
-
-You can change a response as it's returned from a middleware. Remember that
-responses returned from an handler (including middleware) must implement
-``GuzzleHttp\Ring\Future\FutureArrayInterface``. In order to be a good citizen,
-you should not expect that the responses returned through your middleware will
-be completed synchronously. Instead, you should use the
-``GuzzleHttp\Ring\Core::proxy()`` function to modify the response when the
-underlying promise is resolved. This function is a helper function that makes it
-easy to create a new instance of ``FutureArrayInterface`` that wraps an existing
-``FutureArrayInterface`` object.
-
-Let's say you wanted to add headers to a response as they are returned from
-your middleware, but you want to make sure you aren't causing future
-responses to be dereferenced right away. You can achieve this by modifying the
-incoming request and using the ``Core::proxy`` function.
-
-.. code-block:: php
-
- use GuzzleHttp\Ring\Core;
- use GuzzleHttp\Ring\Client\CurlHandler;
-
- $handler = new CurlHandler();
-
- $responseHeaderHandler = function (callable $handler, array $headers) {
- return function (array $request) use ($handler, $headers) {
- // Send the request using the wrapped handler.
- return Core::proxy($handler($request), function ($response) use ($headers) {
- // Add the headers to the response when it is available.
- foreach ($headers as $key => $value) {
- $response['headers'][$key] = (array) $value;
- }
- // Note that you can return a regular response array when using
- // the proxy method.
- return $response;
- });
- }
- };
-
- // Create a new handler that adds headers to each response.
- $handler = $responseHeaderHandler($handler, ['X-Header' => 'hello!']);
-
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => ['Host' => ['httpbin.org']]
- ]);
-
- assert($response['headers']['X-Header'] == 'hello!');
-
-Built-In Middleware
--------------------
-
-RingPHP comes with a few basic client middlewares that modify requests
-and responses.
-
-Streaming Middleware
-~~~~~~~~~~~~~~~~~~~~
-
-If you want to send all requests with the ``streaming`` option to a specific
-handler but other requests to a different handler, then use the streaming
-middleware.
-
-.. code-block:: php
-
- use GuzzleHttp\Ring\Client\CurlHandler;
- use GuzzleHttp\Ring\Client\StreamHandler;
- use GuzzleHttp\Ring\Client\Middleware;
-
- $defaultHandler = new CurlHandler();
- $streamingHandler = new StreamHandler();
- $streamingHandler = Middleware::wrapStreaming(
- $defaultHandler,
- $streamingHandler
- );
-
- // Send the request using the streaming handler.
- $response = $streamingHandler([
- 'http_method' => 'GET',
- 'headers' => ['Host' => ['www.google.com']],
- 'stream' => true
- ]);
-
- // Send the request using the default handler.
- $response = $streamingHandler([
- 'http_method' => 'GET',
- 'headers' => ['Host' => ['www.google.com']]
- ]);
-
-Future Middleware
-~~~~~~~~~~~~~~~~~
-
-If you want to send all requests with the ``future`` option to a specific
-handler but other requests to a different handler, then use the future
-middleware.
-
-.. code-block:: php
-
- use GuzzleHttp\Ring\Client\CurlHandler;
- use GuzzleHttp\Ring\Client\CurlMultiHandler;
- use GuzzleHttp\Ring\Client\Middleware;
-
- $defaultHandler = new CurlHandler();
- $futureHandler = new CurlMultiHandler();
- $futureHandler = Middleware::wrapFuture(
- $defaultHandler,
- $futureHandler
- );
-
- // Send the request using the blocking CurlHandler.
- $response = $futureHandler([
- 'http_method' => 'GET',
- 'headers' => ['Host' => ['www.google.com']]
- ]);
-
- // Send the request using the non-blocking CurlMultiHandler.
- $response = $futureHandler([
- 'http_method' => 'GET',
- 'headers' => ['Host' => ['www.google.com']],
- 'future' => true
- ]);
diff --git a/lib/gerencianet/guzzlehttp/ringphp/docs/conf.py b/lib/gerencianet/guzzlehttp/ringphp/docs/conf.py
deleted file mode 100644
index c6404aa..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/docs/conf.py
+++ /dev/null
@@ -1,23 +0,0 @@
-import sys, os
-import sphinx_rtd_theme
-from sphinx.highlighting import lexers
-from pygments.lexers.web import PhpLexer
-
-
-lexers['php'] = PhpLexer(startinline=True, linenos=1)
-lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1)
-primary_domain = 'php'
-
-extensions = []
-templates_path = ['_templates']
-source_suffix = '.rst'
-master_doc = 'index'
-project = u'RingPHP'
-copyright = u'2014, Michael Dowling'
-version = '1.0.0-alpha'
-exclude_patterns = ['_build']
-
-html_title = "RingPHP"
-html_short_title = "RingPHP"
-html_theme = "sphinx_rtd_theme"
-html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
diff --git a/lib/gerencianet/guzzlehttp/ringphp/docs/futures.rst b/lib/gerencianet/guzzlehttp/ringphp/docs/futures.rst
deleted file mode 100644
index af29cb3..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/docs/futures.rst
+++ /dev/null
@@ -1,164 +0,0 @@
-=======
-Futures
-=======
-
-Futures represent a computation that may have not yet completed. RingPHP
-uses hybrid of futures and promises to provide a consistent API that can be
-used for both blocking and non-blocking consumers.
-
-Promises
---------
-
-You can get the result of a future when it is ready using the promise interface
-of a future. Futures expose a promise API via a ``then()`` method that utilizes
-`React's promise library `_. You should
-use this API when you do not wish to block.
-
-.. code-block:: php
-
- use GuzzleHttp\Ring\Client\CurlMultiHandler;
-
- $request = [
- 'http_method' => 'GET',
- 'uri' => '/',
- 'headers' => ['host' => ['httpbin.org']]
- ];
-
- $response = $handler($request);
-
- // Use the then() method to use the promise API of the future.
- $response->then(function ($response) {
- echo $response['status'];
- });
-
-You can get the promise used by a future, an instance of
-``React\Promise\PromiseInterface``, by calling the ``promise()`` method.
-
-.. code-block:: php
-
- $response = $handler($request);
- $promise = $response->promise();
- $promise->then(function ($response) {
- echo $response['status'];
- });
-
-This promise value can be used with React's
-`aggregate promise functions `_.
-
-Waiting
--------
-
-You can wait on a future to complete and retrieve the value, or *dereference*
-the future, using the ``wait()`` method. Calling the ``wait()`` method of a
-future will block until the result is available. The result is then returned or
-an exception is thrown if and exception was encountered while waiting on the
-the result. Subsequent calls to dereference a future will return the previously
-completed result or throw the previously encountered exception. Futures can be
-cancelled, which stops the computation if possible.
-
-.. code-block:: php
-
- use GuzzleHttp\Ring\Client\CurlMultiHandler;
-
- $response = $handler([
- 'http_method' => 'GET',
- 'uri' => '/',
- 'headers' => ['host' => ['httpbin.org']]
- ]);
-
- // You can explicitly call block to wait on a result.
- $realizedResponse = $response->wait();
-
- // Future responses can be used like a regular PHP array.
- echo $response['status'];
-
-In addition to explicitly calling the ``wait()`` function, using a future like
-a normal value will implicitly trigger the ``wait()`` function.
-
-Future Responses
-----------------
-
-RingPHP uses futures to return asynchronous responses immediately. Client
-handlers always return future responses that implement
-``GuzzleHttp\Ring\Future\ArrayFutureInterface``. These future responses act
-just like normal PHP associative arrays for blocking access and provide a
-promise interface for non-blocking access.
-
-.. code-block:: php
-
- use GuzzleHttp\Ring\Client\CurlMultiHandler;
-
- $handler = new CurlMultiHandler();
-
- $request = [
- 'http_method' => 'GET',
- 'uri' => '/',
- 'headers' => ['Host' => ['www.google.com']]
- ];
-
- $response = $handler($request);
-
- // Use the promise API for non-blocking access to the response. The actual
- // response value will be delivered to the promise.
- $response->then(function ($response) {
- echo $response['status'];
- });
-
- // You can wait (block) until the future is completed.
- $response->wait();
-
- // This will implicitly call wait(), and will block too!
- $response['status'];
-
-.. important::
-
- Futures that are not completed by the time the underlying handler is
- destructed will be completed when the handler is shutting down.
-
-Cancelling
-----------
-
-Futures can be cancelled if they have not already been dereferenced.
-
-RingPHP futures are typically implemented with the
-``GuzzleHttp\Ring\Future\BaseFutureTrait``. This trait provides the cancellation
-functionality that should be common to most implementations. Cancelling a
-future response will try to prevent the request from sending over the wire.
-
-When a future is cancelled, the cancellation function is invoked and performs
-the actual work needed to cancel the request from sending if possible
-(e.g., telling an event loop to stop sending a request or to close a socket).
-If no cancellation function is provided, then a request cannot be cancelled. If
-a cancel function is provided, then it should accept the future as an argument
-and return true if the future was successfully cancelled or false if it could
-not be cancelled.
-
-Wrapping an existing Promise
-----------------------------
-
-You can easily create a future from any existing promise using the
-``GuzzleHttp\Ring\Future\FutureValue`` class. This class's constructor
-accepts a promise as the first argument, a wait function as the second
-argument, and a cancellation function as the third argument. The dereference
-function is used to force the promise to resolve (for example, manually ticking
-an event loop). The cancel function is optional and is used to tell the thing
-that created the promise that it can stop computing the result (for example,
-telling an event loop to stop transferring a request).
-
-.. code-block:: php
-
- use GuzzleHttp\Ring\Future\FutureValue;
- use React\Promise\Deferred;
-
- $deferred = new Deferred();
- $promise = $deferred->promise();
-
- $f = new FutureValue(
- $promise,
- function () use ($deferred) {
- // This function is responsible for blocking and resolving the
- // promise. Here we pass in a reference to the deferred so that
- // it can be resolved or rejected.
- $deferred->resolve('foo');
- }
- );
diff --git a/lib/gerencianet/guzzlehttp/ringphp/docs/index.rst b/lib/gerencianet/guzzlehttp/ringphp/docs/index.rst
deleted file mode 100644
index 4bbce63..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/docs/index.rst
+++ /dev/null
@@ -1,50 +0,0 @@
-=======
-RingPHP
-=======
-
-Provides a simple API and specification that abstracts away the details of HTTP
-into a single PHP function. RingPHP be used to power HTTP clients and servers
-through a PHP function that accepts a request hash and returns a response hash
-that is fulfilled using a `promise `_,
-allowing RingPHP to support both synchronous and asynchronous workflows.
-
-By abstracting the implementation details of different HTTP clients and
-servers, RingPHP allows you to utilize pluggable HTTP clients and servers
-without tying your application to a specific implementation.
-
-.. toctree::
- :maxdepth: 2
-
- spec
- futures
- client_middleware
- client_handlers
- testing
-
-.. code-block:: php
-
- 'GET',
- 'uri' => '/',
- 'headers' => [
- 'host' => ['www.google.com'],
- 'x-foo' => ['baz']
- ]
- ]);
-
- $response->then(function (array $response) {
- echo $response['status'];
- });
-
- $response->wait();
-
-RingPHP is inspired by Clojure's `Ring `_,
-which, in turn, was inspired by Python's WSGI and Ruby's Rack. RingPHP is
-utilized as the handler layer in `Guzzle `_ 5.0+ to send
-HTTP requests.
diff --git a/lib/gerencianet/guzzlehttp/ringphp/docs/requirements.txt b/lib/gerencianet/guzzlehttp/ringphp/docs/requirements.txt
deleted file mode 100644
index 483a4e9..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/docs/requirements.txt
+++ /dev/null
@@ -1 +0,0 @@
-sphinx_rtd_theme
diff --git a/lib/gerencianet/guzzlehttp/ringphp/docs/spec.rst b/lib/gerencianet/guzzlehttp/ringphp/docs/spec.rst
deleted file mode 100644
index bc91078..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/docs/spec.rst
+++ /dev/null
@@ -1,311 +0,0 @@
-=============
-Specification
-=============
-
-RingPHP applications consist of handlers, requests, responses, and
-middleware.
-
-Handlers
---------
-
-Handlers are implemented as a PHP ``callable`` that accept a request array
-and return a response array (``GuzzleHttp\Ring\Future\FutureArrayInterface``).
-
-For example:
-
-.. code-block:: php
-
- use GuzzleHttp\Ring\Future\CompletedFutureArray;
-
- $mockHandler = function (array $request) {
- return new CompletedFutureArray([
- 'status' => 200,
- 'headers' => ['X-Foo' => ['Bar']],
- 'body' => 'Hello!'
- ]);
- };
-
-This handler returns the same response each time it is invoked. All RingPHP
-handlers must return a ``GuzzleHttp\Ring\Future\FutureArrayInterface``. Use
-``GuzzleHttp\Ring\Future\CompletedFutureArray`` when returning a response that
-has already completed.
-
-Requests
---------
-
-A request array is a PHP associative array that contains the configuration
-settings need to send a request.
-
-.. code-block:: php
-
- $request = [
- 'http_method' => 'GET',
- 'scheme' => 'http',
- 'uri' => '/',
- 'body' => 'hello!',
- 'client' => ['timeout' => 1.0],
- 'headers' => [
- 'host' => ['httpbin.org'],
- 'X-Foo' => ['baz', 'bar']
- ]
- ];
-
-The request array contains the following key value pairs:
-
-request_method
- (string, required) The HTTP request method, must be all caps corresponding
- to a HTTP request method, such as ``GET`` or ``POST``.
-
-scheme
- (string) The transport protocol, must be one of ``http`` or ``https``.
- Defaults to ``http``.
-
-uri
- (string, required) The request URI excluding the query string. Must
- start with "/".
-
-query_string
- (string) The query string, if present (e.g., ``foo=bar``).
-
-version
- (string) HTTP protocol version. Defaults to ``1.1``.
-
-headers
- (required, array) Associative array of headers. Each key represents the
- header name. Each value contains an array of strings where each entry of
- the array SHOULD be sent over the wire on a separate header line.
-
-body
- (string, fopen resource, ``Iterator``, ``GuzzleHttp\Stream\StreamInterface``)
- The body of the request, if present. Can be a string, resource returned
- from fopen, an ``Iterator`` that yields chunks of data, an object that
- implemented ``__toString``, or a ``GuzzleHttp\Stream\StreamInterface``.
-
-future
- (bool, string) Controls the asynchronous behavior of a response.
-
- Set to ``true`` or omit the ``future`` option to *request* that a request
- will be completed asynchronously. Keep in mind that your request might not
- necessarily be completed asynchronously based on the handler you are using.
- Set the ``future`` option to ``false`` to request that a synchronous
- response be provided.
-
- You can provide a string value to specify fine-tuned future behaviors that
- may be specific to the underlying handlers you are using. There are,
- however, some common future options that handlers should implement if
- possible.
-
- lazy
- Requests that the handler does not open and send the request
- immediately, but rather only opens and sends the request once the
- future is dereferenced. This option is often useful for sending a large
- number of requests concurrently to allow handlers to take better
- advantage of non-blocking transfers by first building up a pool of
- requests.
-
- If an handler does not implement or understand a provided string value,
- then the request MUST be treated as if the user provided ``true`` rather
- than the string value.
-
- Future responses created by asynchronous handlers MUST attempt to complete
- any outstanding future responses when they are destructed. Asynchronous
- handlers MAY choose to automatically complete responses when the number
- of outstanding requests reaches an handler-specific threshold.
-
-Client Specific Options
-~~~~~~~~~~~~~~~~~~~~~~~
-
-The following options are only used in ring client handlers.
-
-.. _client-options:
-
-client
- (array) Associative array of client specific transfer options. The
- ``client`` request key value pair can contain the following keys:
-
- cert
- (string, array) Set to a string to specify the path to a file
- containing a PEM formatted SSL client side certificate. If a password
- is required, then set ``cert`` to an array containing the path to the
- PEM file in the first array element followed by the certificate
- password in the second array element.
-
- connect_timeout
- (float) Float describing the number of seconds to wait while trying to
- connect to a server. Use ``0`` to wait indefinitely (the default
- behavior).
-
- debug
- (bool, fopen() resource) Set to true or set to a PHP stream returned by
- fopen() to enable debug output with the handler used to send a request.
- If set to ``true``, the output is written to PHP's STDOUT. If a PHP
- ``fopen`` resource handle is provided, the output is written to the
- stream.
-
- "Debug output" is handler specific: different handlers will yield
- different output and various various level of detail. For example, when
- using cURL to transfer requests, cURL's `CURLOPT_VERBOSE `_
- will be used. When using the PHP stream wrapper, `stream notifications `_
- will be emitted.
-
- decode_content
- (bool) Specify whether or not ``Content-Encoding`` responses
- (gzip, deflate, etc.) are automatically decoded. Set to ``true`` to
- automatically decode encoded responses. Set to ``false`` to not decode
- responses. By default, content is *not* decoded automatically.
-
- delay
- (int) The number of milliseconds to delay before sending the request.
- This is often used for delaying before retrying a request. Handlers
- SHOULD implement this if possible, but it is not a strict requirement.
-
- progress
- (function) Defines a function to invoke when transfer progress is made.
- The function accepts the following arguments:
-
- 1. The total number of bytes expected to be downloaded
- 2. The number of bytes downloaded so far
- 3. The number of bytes expected to be uploaded
- 4. The number of bytes uploaded so far
-
- proxy
- (string, array) Pass a string to specify an HTTP proxy, or an
- associative array to specify different proxies for different protocols
- where the scheme is the key and the value is the proxy address.
-
- .. code-block:: php
-
- $request = [
- 'http_method' => 'GET',
- 'headers' => ['host' => ['httpbin.org']],
- 'client' => [
- // Use different proxies for different URI schemes.
- 'proxy' => [
- 'http' => 'http://proxy.example.com:5100',
- 'https' => 'https://proxy.example.com:6100'
- ]
- ]
- ];
-
- ssl_key
- (string, array) Specify the path to a file containing a private SSL key
- in PEM format. If a password is required, then set to an array
- containing the path to the SSL key in the first array element followed
- by the password required for the certificate in the second element.
-
- save_to
- (string, fopen resource, ``GuzzleHttp\Stream\StreamInterface``)
- Specifies where the body of the response is downloaded. Pass a string to
- open a local file on disk and save the output to the file. Pass an fopen
- resource to save the output to a PHP stream resource. Pass a
- ``GuzzleHttp\Stream\StreamInterface`` to save the output to a Guzzle
- StreamInterface. Omitting this option will typically save the body of a
- response to a PHP temp stream.
-
- stream
- (bool) Set to true to stream a response rather than download it all
- up-front. This option will only be utilized when the corresponding
- handler supports it.
-
- timeout
- (float) Float describing the timeout of the request in seconds. Use 0 to
- wait indefinitely (the default behavior).
-
- verify
- (bool, string) Describes the SSL certificate verification behavior of a
- request. Set to true to enable SSL certificate verification using the
- system CA bundle when available (the default). Set to false to disable
- certificate verification (this is insecure!). Set to a string to provide
- the path to a CA bundle on disk to enable verification using a custom
- certificate.
-
- version
- (string) HTTP protocol version to use with the request.
-
-Server Specific Options
-~~~~~~~~~~~~~~~~~~~~~~~
-
-The following options are only used in ring server handlers.
-
-server_port
- (integer) The port on which the request is being handled. This is only
- used with ring servers, and is required.
-
-server_name
- (string) The resolved server name, or the server IP address. Required when
- using a Ring server.
-
-remote_addr
- (string) The IP address of the client or the last proxy that sent the
- request. Required when using a Ring server.
-
-Responses
----------
-
-A response is an array-like object that implements
-``GuzzleHttp\Ring\Future\FutureArrayInterface``. Responses contain the
-following key value pairs:
-
-body
- (string, fopen resource, ``Iterator``, ``GuzzleHttp\Stream\StreamInterface``)
- The body of the response, if present. Can be a string, resource returned
- from fopen, an ``Iterator`` that yields chunks of data, an object that
- implemented ``__toString``, or a ``GuzzleHttp\Stream\StreamInterface``.
-
-effective_url
- (string) The URL that returned the resulting response.
-
-error
- (``\Exception``) Contains an exception describing any errors that were
- encountered during the transfer.
-
-headers
- (Required, array) Associative array of headers. Each key represents the
- header name. Each value contains an array of strings where each entry of
- the array is a header line. The headers array MAY be an empty array in the
- event an error occurred before a response was received.
-
-reason
- (string) Optional reason phrase. This option should be provided when the
- reason phrase does not match the typical reason phrase associated with the
- ``status`` code. See `RFC 7231 `_
- for a list of HTTP reason phrases mapped to status codes.
-
-status
- (Required, integer) The HTTP status code. The status code MAY be set to
- ``null`` in the event an error occurred before a response was received
- (e.g., a networking error).
-
-transfer_stats
- (array) Provides an associative array of arbitrary transfer statistics if
- provided by the underlying handler.
-
-version
- (string) HTTP protocol version. Defaults to ``1.1``.
-
-Middleware
-----------
-
-Ring middleware augments the functionality of handlers by invoking them in the
-process of generating responses. Middleware is typically implemented as a
-higher-order function that takes one or more handlers as arguments followed by
-an optional associative array of options as the last argument, returning a new
-handler with the desired compound behavior.
-
-Here's an example of a middleware that adds a Content-Type header to each
-request.
-
-.. code-block:: php
-
- use GuzzleHttp\Ring\Client\CurlHandler;
- use GuzzleHttp\Ring\Core;
-
- $contentTypeHandler = function(callable $handler, $contentType) {
- return function (array $request) use ($handler, $contentType) {
- return $handler(Core::setHeader('Content-Type', $contentType));
- };
- };
-
- $baseHandler = new CurlHandler();
- $wrappedHandler = $contentTypeHandler($baseHandler, 'text/html');
- $response = $wrappedHandler([/** request hash **/]);
diff --git a/lib/gerencianet/guzzlehttp/ringphp/docs/testing.rst b/lib/gerencianet/guzzlehttp/ringphp/docs/testing.rst
deleted file mode 100644
index 9df2562..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/docs/testing.rst
+++ /dev/null
@@ -1,74 +0,0 @@
-=======
-Testing
-=======
-
-RingPHP tests client handlers using `PHPUnit `_ and a
-built-in node.js web server.
-
-Running Tests
--------------
-
-First, install the dependencies using `Composer `_.
-
- composer.phar install
-
-Next, run the unit tests using ``Make``.
-
- make test
-
-The tests are also run on Travis-CI on each commit: https://travis-ci.org/guzzle/guzzle-ring
-
-Test Server
------------
-
-Testing client handlers usually involves actually sending HTTP requests.
-RingPHP provides a node.js web server that returns canned responses and
-keep a list of the requests that have been received. The server can then
-be queried to get a list of the requests that were sent by the client so that
-you can ensure that the client serialized and transferred requests as intended.
-
-The server keeps a list of queued responses and returns responses that are
-popped off of the queue as HTTP requests are received. When there are not
-more responses to serve, the server returns a 500 error response.
-
-The test server uses the ``GuzzleHttp\Tests\Ring\Client\Server`` class to
-control the server.
-
-.. code-block:: php
-
- use GuzzleHttp\Ring\Client\StreamHandler;
- use GuzzleHttp\Tests\Ring\Client\Server;
-
- // First return a 200 followed by a 404 response.
- Server::enqueue([
- ['status' => 200],
- ['status' => 404]
- ]);
-
- $handler = new StreamHandler();
-
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'uri' => '/'
- ]);
-
- assert(200 == $response['status']);
-
- $response = $handler([
- 'http_method' => 'HEAD',
- 'headers' => ['host' => [Server::$host]],
- 'uri' => '/'
- ]);
-
- assert(404 == $response['status']);
-
-After requests have been sent, you can get a list of the requests as they
-were sent over the wire to ensure they were sent correctly.
-
-.. code-block:: php
-
- $received = Server::received();
-
- assert('GET' == $received[0]['http_method']);
- assert('HEAD' == $received[1]['http_method']);
diff --git a/lib/gerencianet/guzzlehttp/ringphp/phpunit.xml.dist b/lib/gerencianet/guzzlehttp/ringphp/phpunit.xml.dist
deleted file mode 100644
index 1d19290..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/phpunit.xml.dist
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- tests
-
-
-
-
- src
-
-
-
diff --git a/lib/gerencianet/guzzlehttp/ringphp/src/Client/ClientUtils.php b/lib/gerencianet/guzzlehttp/ringphp/src/Client/ClientUtils.php
deleted file mode 100644
index 2acf92e..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/src/Client/ClientUtils.php
+++ /dev/null
@@ -1,74 +0,0 @@
-getDefaultOptions($request, $headers);
- $this->applyMethod($request, $options);
-
- if (isset($request['client'])) {
- $this->applyHandlerOptions($request, $options);
- }
-
- $this->applyHeaders($request, $options);
- unset($options['_headers']);
-
- // Add handler options from the request's configuration options
- if (isset($request['client']['curl'])) {
- $options = $this->applyCustomCurlOptions(
- $request['client']['curl'],
- $options
- );
- }
-
- if (!$handle) {
- $handle = curl_init();
- }
-
- $body = $this->getOutputBody($request, $options);
- curl_setopt_array($handle, $options);
-
- return [$handle, &$headers, $body];
- }
-
- /**
- * Creates a response hash from a cURL result.
- *
- * @param callable $handler Handler that was used.
- * @param array $request Request that sent.
- * @param array $response Response hash to update.
- * @param array $headers Headers received during transfer.
- * @param resource $body Body fopen response.
- *
- * @return array
- */
- public static function createResponse(
- callable $handler,
- array $request,
- array $response,
- array $headers,
- $body
- ) {
- if (isset($response['transfer_stats']['url'])) {
- $response['effective_url'] = $response['transfer_stats']['url'];
- }
-
- if (!empty($headers)) {
- $startLine = explode(' ', array_shift($headers), 3);
- $headerList = Core::headersFromLines($headers);
- $response['headers'] = $headerList;
- $response['version'] = isset($startLine[0]) ? substr($startLine[0], 5) : null;
- $response['status'] = isset($startLine[1]) ? (int) $startLine[1] : null;
- $response['reason'] = isset($startLine[2]) ? $startLine[2] : null;
- $response['body'] = $body;
- Core::rewindBody($response);
- }
-
- return !empty($response['curl']['errno']) || !isset($response['status'])
- ? self::createErrorResponse($handler, $request, $response)
- : $response;
- }
-
- private static function createErrorResponse(
- callable $handler,
- array $request,
- array $response
- ) {
- static $connectionErrors = [
- CURLE_OPERATION_TIMEOUTED => true,
- CURLE_COULDNT_RESOLVE_HOST => true,
- CURLE_COULDNT_CONNECT => true,
- CURLE_SSL_CONNECT_ERROR => true,
- CURLE_GOT_NOTHING => true,
- ];
-
- // Retry when nothing is present or when curl failed to rewind.
- if (!isset($response['err_message'])
- && (empty($response['curl']['errno'])
- || $response['curl']['errno'] == 65)
- ) {
- return self::retryFailedRewind($handler, $request, $response);
- }
-
- $message = isset($response['err_message'])
- ? $response['err_message']
- : sprintf('cURL error %s: %s',
- $response['curl']['errno'],
- isset($response['curl']['error'])
- ? $response['curl']['error']
- : 'See http://curl.haxx.se/libcurl/c/libcurl-errors.html');
-
- $error = isset($response['curl']['errno'])
- && isset($connectionErrors[$response['curl']['errno']])
- ? new ConnectException($message)
- : new RingException($message);
-
- return $response + [
- 'status' => null,
- 'reason' => null,
- 'body' => null,
- 'headers' => [],
- 'error' => $error,
- ];
- }
-
- private function getOutputBody(array $request, array &$options)
- {
- // Determine where the body of the response (if any) will be streamed.
- if (isset($options[CURLOPT_WRITEFUNCTION])) {
- return $request['client']['save_to'];
- }
-
- if (isset($options[CURLOPT_FILE])) {
- return $options[CURLOPT_FILE];
- }
-
- if ($request['http_method'] != 'HEAD') {
- // Create a default body if one was not provided
- return $options[CURLOPT_FILE] = fopen('php://temp', 'w+');
- }
-
- return null;
- }
-
- private function getDefaultOptions(array $request, array &$headers)
- {
- $url = Core::url($request);
- $startingResponse = false;
-
- $options = [
- '_headers' => $request['headers'],
- CURLOPT_CUSTOMREQUEST => $request['http_method'],
- CURLOPT_URL => $url,
- CURLOPT_RETURNTRANSFER => false,
- CURLOPT_HEADER => false,
- CURLOPT_CONNECTTIMEOUT => 150,
- CURLOPT_HEADERFUNCTION => function ($ch, $h) use (&$headers, &$startingResponse) {
- $value = trim($h);
- if ($value === '') {
- $startingResponse = true;
- } elseif ($startingResponse) {
- $startingResponse = false;
- $headers = [$value];
- } else {
- $headers[] = $value;
- }
- return strlen($h);
- },
- ];
-
- if (isset($request['version'])) {
- if ($request['version'] == 2.0) {
- $options[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0;
- } else if ($request['version'] == 1.1) {
- $options[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1;
- } else {
- $options[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0;
- }
- }
-
- if (defined('CURLOPT_PROTOCOLS')) {
- $options[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;
- }
-
- return $options;
- }
-
- private function applyMethod(array $request, array &$options)
- {
- if (isset($request['body'])) {
- $this->applyBody($request, $options);
- return;
- }
-
- switch ($request['http_method']) {
- case 'PUT':
- case 'POST':
- // See http://tools.ietf.org/html/rfc7230#section-3.3.2
- if (!Core::hasHeader($request, 'Content-Length')) {
- $options[CURLOPT_HTTPHEADER][] = 'Content-Length: 0';
- }
- break;
- case 'HEAD':
- $options[CURLOPT_NOBODY] = true;
- unset(
- $options[CURLOPT_WRITEFUNCTION],
- $options[CURLOPT_READFUNCTION],
- $options[CURLOPT_FILE],
- $options[CURLOPT_INFILE]
- );
- }
- }
-
- private function applyBody(array $request, array &$options)
- {
- $contentLength = Core::firstHeader($request, 'Content-Length');
- $size = $contentLength !== null ? (int) $contentLength : null;
-
- // Send the body as a string if the size is less than 1MB OR if the
- // [client][curl][body_as_string] request value is set.
- if (($size !== null && $size < 1000000) ||
- isset($request['client']['curl']['body_as_string']) ||
- is_string($request['body'])
- ) {
- $options[CURLOPT_POSTFIELDS] = Core::body($request);
- // Don't duplicate the Content-Length header
- $this->removeHeader('Content-Length', $options);
- $this->removeHeader('Transfer-Encoding', $options);
- } else {
- $options[CURLOPT_UPLOAD] = true;
- if ($size !== null) {
- // Let cURL handle setting the Content-Length header
- $options[CURLOPT_INFILESIZE] = $size;
- $this->removeHeader('Content-Length', $options);
- }
- $this->addStreamingBody($request, $options);
- }
-
- // If the Expect header is not present, prevent curl from adding it
- if (!Core::hasHeader($request, 'Expect')) {
- $options[CURLOPT_HTTPHEADER][] = 'Expect:';
- }
-
- // cURL sometimes adds a content-type by default. Prevent this.
- if (!Core::hasHeader($request, 'Content-Type')) {
- $options[CURLOPT_HTTPHEADER][] = 'Content-Type:';
- }
- }
-
- private function addStreamingBody(array $request, array &$options)
- {
- $body = $request['body'];
-
- if ($body instanceof StreamInterface) {
- $options[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) {
- return (string) $body->read($length);
- };
- if (!isset($options[CURLOPT_INFILESIZE])) {
- if ($size = $body->getSize()) {
- $options[CURLOPT_INFILESIZE] = $size;
- }
- }
- } elseif (is_resource($body)) {
- $options[CURLOPT_INFILE] = $body;
- } elseif ($body instanceof \Iterator) {
- $buf = '';
- $options[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body, &$buf) {
- if ($body->valid()) {
- $buf .= $body->current();
- $body->next();
- }
- $result = (string) substr($buf, 0, $length);
- $buf = substr($buf, $length);
- return $result;
- };
- } else {
- throw new \InvalidArgumentException('Invalid request body provided');
- }
- }
-
- private function applyHeaders(array $request, array &$options)
- {
- foreach ($options['_headers'] as $name => $values) {
- foreach ($values as $value) {
- $options[CURLOPT_HTTPHEADER][] = "$name: $value";
- }
- }
-
- // Remove the Accept header if one was not set
- if (!Core::hasHeader($request, 'Accept')) {
- $options[CURLOPT_HTTPHEADER][] = 'Accept:';
- }
- }
-
- /**
- * Takes an array of curl options specified in the 'curl' option of a
- * request's configuration array and maps them to CURLOPT_* options.
- *
- * This method is only called when a request has a 'curl' config setting.
- *
- * @param array $config Configuration array of custom curl option
- * @param array $options Array of existing curl options
- *
- * @return array Returns a new array of curl options
- */
- private function applyCustomCurlOptions(array $config, array $options)
- {
- $curlOptions = [];
- foreach ($config as $key => $value) {
- if (is_int($key)) {
- $curlOptions[$key] = $value;
- }
- }
-
- return $curlOptions + $options;
- }
-
- /**
- * Remove a header from the options array.
- *
- * @param string $name Case-insensitive header to remove
- * @param array $options Array of options to modify
- */
- private function removeHeader($name, array &$options)
- {
- foreach (array_keys($options['_headers']) as $key) {
- if (!strcasecmp($key, $name)) {
- unset($options['_headers'][$key]);
- return;
- }
- }
- }
-
- /**
- * Applies an array of request client options to a the options array.
- *
- * This method uses a large switch rather than double-dispatch to save on
- * high overhead of calling functions in PHP.
- */
- private function applyHandlerOptions(array $request, array &$options)
- {
- foreach ($request['client'] as $key => $value) {
- switch ($key) {
- // Violating PSR-4 to provide more room.
- case 'verify':
-
- if ($value === false) {
- unset($options[CURLOPT_CAINFO]);
- $options[CURLOPT_SSL_VERIFYHOST] = 0;
- $options[CURLOPT_SSL_VERIFYPEER] = false;
- continue;
- }
-
- $options[CURLOPT_SSL_VERIFYHOST] = 2;
- $options[CURLOPT_SSL_VERIFYPEER] = true;
-
- if (is_string($value)) {
- $options[CURLOPT_CAINFO] = $value;
- if (!file_exists($value)) {
- throw new \InvalidArgumentException(
- "SSL CA bundle not found: $value"
- );
- }
- }
- break;
-
- case 'decode_content':
-
- if ($value === false) {
- continue;
- }
-
- $accept = Core::firstHeader($request, 'Accept-Encoding');
- if ($accept) {
- $options[CURLOPT_ENCODING] = $accept;
- } else {
- $options[CURLOPT_ENCODING] = '';
- // Don't let curl send the header over the wire
- $options[CURLOPT_HTTPHEADER][] = 'Accept-Encoding:';
- }
- break;
-
- case 'save_to':
-
- if (is_string($value)) {
- if (!is_dir(dirname($value))) {
- throw new \RuntimeException(sprintf(
- 'Directory %s does not exist for save_to value of %s',
- dirname($value),
- $value
- ));
- }
- $value = new LazyOpenStream($value, 'w+');
- }
-
- if ($value instanceof StreamInterface) {
- $options[CURLOPT_WRITEFUNCTION] =
- function ($ch, $write) use ($value) {
- return $value->write($write);
- };
- } elseif (is_resource($value)) {
- $options[CURLOPT_FILE] = $value;
- } else {
- throw new \InvalidArgumentException('save_to must be a '
- . 'GuzzleHttp\Stream\StreamInterface or resource');
- }
- break;
-
- case 'timeout':
-
- if (defined('CURLOPT_TIMEOUT_MS')) {
- $options[CURLOPT_TIMEOUT_MS] = $value * 1000;
- } else {
- $options[CURLOPT_TIMEOUT] = $value;
- }
- break;
-
- case 'connect_timeout':
-
- if (defined('CURLOPT_CONNECTTIMEOUT_MS')) {
- $options[CURLOPT_CONNECTTIMEOUT_MS] = $value * 1000;
- } else {
- $options[CURLOPT_CONNECTTIMEOUT] = $value;
- }
- break;
-
- case 'proxy':
-
- if (!is_array($value)) {
- $options[CURLOPT_PROXY] = $value;
- } elseif (isset($request['scheme'])) {
- $scheme = $request['scheme'];
- if (isset($value[$scheme])) {
- $options[CURLOPT_PROXY] = $value[$scheme];
- }
- }
- break;
-
- case 'cert':
-
- if (is_array($value)) {
- $options[CURLOPT_SSLCERTPASSWD] = $value[1];
- $value = $value[0];
- }
-
- if (!file_exists($value)) {
- throw new \InvalidArgumentException(
- "SSL certificate not found: {$value}"
- );
- }
-
- $options[CURLOPT_SSLCERT] = $value;
- break;
-
- case 'ssl_key':
-
- if (is_array($value)) {
- $options[CURLOPT_SSLKEYPASSWD] = $value[1];
- $value = $value[0];
- }
-
- if (!file_exists($value)) {
- throw new \InvalidArgumentException(
- "SSL private key not found: {$value}"
- );
- }
-
- $options[CURLOPT_SSLKEY] = $value;
- break;
-
- case 'progress':
-
- if (!is_callable($value)) {
- throw new \InvalidArgumentException(
- 'progress client option must be callable'
- );
- }
-
- $options[CURLOPT_NOPROGRESS] = false;
- $options[CURLOPT_PROGRESSFUNCTION] =
- function () use ($value) {
- $args = func_get_args();
- // PHP 5.5 pushed the handle onto the start of the args
- if (is_resource($args[0])) {
- array_shift($args);
- }
- call_user_func_array($value, $args);
- };
- break;
-
- case 'debug':
-
- if ($value) {
- $options[CURLOPT_STDERR] = Core::getDebugResource($value);
- $options[CURLOPT_VERBOSE] = true;
- }
- break;
- }
- }
- }
-
- /**
- * This function ensures that a response was set on a transaction. If one
- * was not set, then the request is retried if possible. This error
- * typically means you are sending a payload, curl encountered a
- * "Connection died, retrying a fresh connect" error, tried to rewind the
- * stream, and then encountered a "necessary data rewind wasn't possible"
- * error, causing the request to be sent through curl_multi_info_read()
- * without an error status.
- */
- private static function retryFailedRewind(
- callable $handler,
- array $request,
- array $response
- ) {
- // If there is no body, then there is some other kind of issue. This
- // is weird and should probably never happen.
- if (!isset($request['body'])) {
- $response['err_message'] = 'No response was received for a request '
- . 'with no body. This could mean that you are saturating your '
- . 'network.';
- return self::createErrorResponse($handler, $request, $response);
- }
-
- if (!Core::rewindBody($request)) {
- $response['err_message'] = 'The connection unexpectedly failed '
- . 'without providing an error. The request would have been '
- . 'retried, but attempting to rewind the request body failed.';
- return self::createErrorResponse($handler, $request, $response);
- }
-
- // Retry no more than 3 times before giving up.
- if (!isset($request['curl']['retries'])) {
- $request['curl']['retries'] = 1;
- } elseif ($request['curl']['retries'] == 2) {
- $response['err_message'] = 'The cURL request was retried 3 times '
- . 'and did no succeed. cURL was unable to rewind the body of '
- . 'the request and subsequent retries resulted in the same '
- . 'error. Turn on the debug option to see what went wrong. '
- . 'See https://bugs.php.net/bug.php?id=47204 for more information.';
- return self::createErrorResponse($handler, $request, $response);
- } else {
- $request['curl']['retries']++;
- }
-
- return $handler($request);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/src/Client/CurlHandler.php b/lib/gerencianet/guzzlehttp/ringphp/src/Client/CurlHandler.php
deleted file mode 100644
index e00aa4e..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/src/Client/CurlHandler.php
+++ /dev/null
@@ -1,135 +0,0 @@
-handles = $this->ownedHandles = [];
- $this->factory = isset($options['handle_factory'])
- ? $options['handle_factory']
- : new CurlFactory();
- $this->maxHandles = isset($options['max_handles'])
- ? $options['max_handles']
- : 5;
- }
-
- public function __destruct()
- {
- foreach ($this->handles as $handle) {
- if (is_resource($handle)) {
- curl_close($handle);
- }
- }
- }
-
- /**
- * @param array $request
- *
- * @return CompletedFutureArray
- */
- public function __invoke(array $request)
- {
- return new CompletedFutureArray(
- $this->_invokeAsArray($request)
- );
- }
-
- /**
- * @internal
- *
- * @param array $request
- *
- * @return array
- */
- public function _invokeAsArray(array $request)
- {
- $factory = $this->factory;
-
- // Ensure headers are by reference. They're updated elsewhere.
- $result = $factory($request, $this->checkoutEasyHandle());
- $h = $result[0];
- $hd =& $result[1];
- $bd = $result[2];
- Core::doSleep($request);
- curl_exec($h);
- $response = ['transfer_stats' => curl_getinfo($h)];
- $response['curl']['error'] = curl_error($h);
- $response['curl']['errno'] = curl_errno($h);
- $response['transfer_stats'] = array_merge($response['transfer_stats'], $response['curl']);
- $this->releaseEasyHandle($h);
-
- return CurlFactory::createResponse([$this, '_invokeAsArray'], $request, $response, $hd, $bd);
- }
-
- private function checkoutEasyHandle()
- {
- // Find an unused handle in the cache
- if (false !== ($key = array_search(false, $this->ownedHandles, true))) {
- $this->ownedHandles[$key] = true;
- return $this->handles[$key];
- }
-
- // Add a new handle
- $handle = curl_init();
- $id = (int) $handle;
- $this->handles[$id] = $handle;
- $this->ownedHandles[$id] = true;
-
- return $handle;
- }
-
- private function releaseEasyHandle($handle)
- {
- $id = (int) $handle;
- if (count($this->ownedHandles) > $this->maxHandles) {
- curl_close($this->handles[$id]);
- unset($this->handles[$id], $this->ownedHandles[$id]);
- } else {
- // curl_reset doesn't clear these out for some reason
- static $unsetValues = [
- CURLOPT_HEADERFUNCTION => null,
- CURLOPT_WRITEFUNCTION => null,
- CURLOPT_READFUNCTION => null,
- CURLOPT_PROGRESSFUNCTION => null,
- ];
- curl_setopt_array($handle, $unsetValues);
- curl_reset($handle);
- $this->ownedHandles[$id] = false;
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/src/Client/CurlMultiHandler.php b/lib/gerencianet/guzzlehttp/ringphp/src/Client/CurlMultiHandler.php
deleted file mode 100644
index b45f6c3..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/src/Client/CurlMultiHandler.php
+++ /dev/null
@@ -1,250 +0,0 @@
-_mh = $options['mh'];
- }
- $this->factory = isset($options['handle_factory'])
- ? $options['handle_factory'] : new CurlFactory();
- $this->selectTimeout = isset($options['select_timeout'])
- ? $options['select_timeout'] : 1;
- $this->maxHandles = isset($options['max_handles'])
- ? $options['max_handles'] : 100;
- }
-
- public function __get($name)
- {
- if ($name === '_mh') {
- return $this->_mh = curl_multi_init();
- }
-
- throw new \BadMethodCallException();
- }
-
- public function __destruct()
- {
- // Finish any open connections before terminating the script.
- if ($this->handles) {
- $this->execute();
- }
-
- if (isset($this->_mh)) {
- curl_multi_close($this->_mh);
- unset($this->_mh);
- }
- }
-
- public function __invoke(array $request)
- {
- $factory = $this->factory;
- $result = $factory($request);
- $entry = [
- 'request' => $request,
- 'response' => [],
- 'handle' => $result[0],
- 'headers' => &$result[1],
- 'body' => $result[2],
- 'deferred' => new Deferred(),
- ];
-
- $id = (int) $result[0];
-
- $future = new FutureArray(
- $entry['deferred']->promise(),
- [$this, 'execute'],
- function () use ($id) {
- return $this->cancel($id);
- }
- );
-
- $this->addRequest($entry);
-
- // Transfer outstanding requests if there are too many open handles.
- if (count($this->handles) >= $this->maxHandles) {
- $this->execute();
- }
-
- return $future;
- }
-
- /**
- * Runs until all outstanding connections have completed.
- */
- public function execute()
- {
- do {
-
- if ($this->active &&
- curl_multi_select($this->_mh, $this->selectTimeout) === -1
- ) {
- // Perform a usleep if a select returns -1.
- // See: https://bugs.php.net/bug.php?id=61141
- usleep(250);
- }
-
- // Add any delayed futures if needed.
- if ($this->delays) {
- $this->addDelays();
- }
-
- do {
- $mrc = curl_multi_exec($this->_mh, $this->active);
- } while ($mrc === CURLM_CALL_MULTI_PERFORM);
-
- $this->processMessages();
-
- // If there are delays but no transfers, then sleep for a bit.
- if (!$this->active && $this->delays) {
- usleep(500);
- }
-
- } while ($this->active || $this->handles);
- }
-
- private function addRequest(array &$entry)
- {
- $id = (int) $entry['handle'];
- $this->handles[$id] = $entry;
-
- // If the request is a delay, then add the reques to the curl multi
- // pool only after the specified delay.
- if (isset($entry['request']['client']['delay'])) {
- $this->delays[$id] = microtime(true) + ($entry['request']['client']['delay'] / 1000);
- } elseif (empty($entry['request']['future'])) {
- curl_multi_add_handle($this->_mh, $entry['handle']);
- } else {
- curl_multi_add_handle($this->_mh, $entry['handle']);
- // "lazy" futures are only sent once the pool has many requests.
- if ($entry['request']['future'] !== 'lazy') {
- do {
- $mrc = curl_multi_exec($this->_mh, $this->active);
- } while ($mrc === CURLM_CALL_MULTI_PERFORM);
- $this->processMessages();
- }
- }
- }
-
- private function removeProcessed($id)
- {
- if (isset($this->handles[$id])) {
- curl_multi_remove_handle(
- $this->_mh,
- $this->handles[$id]['handle']
- );
- curl_close($this->handles[$id]['handle']);
- unset($this->handles[$id], $this->delays[$id]);
- }
- }
-
- /**
- * Cancels a handle from sending and removes references to it.
- *
- * @param int $id Handle ID to cancel and remove.
- *
- * @return bool True on success, false on failure.
- */
- private function cancel($id)
- {
- // Cannot cancel if it has been processed.
- if (!isset($this->handles[$id])) {
- return false;
- }
-
- $handle = $this->handles[$id]['handle'];
- unset($this->delays[$id], $this->handles[$id]);
- curl_multi_remove_handle($this->_mh, $handle);
- curl_close($handle);
-
- return true;
- }
-
- private function addDelays()
- {
- $currentTime = microtime(true);
-
- foreach ($this->delays as $id => $delay) {
- if ($currentTime >= $delay) {
- unset($this->delays[$id]);
- curl_multi_add_handle(
- $this->_mh,
- $this->handles[$id]['handle']
- );
- }
- }
- }
-
- private function processMessages()
- {
- while ($done = curl_multi_info_read($this->_mh)) {
- $id = (int) $done['handle'];
-
- if (!isset($this->handles[$id])) {
- // Probably was cancelled.
- continue;
- }
-
- $entry = $this->handles[$id];
- $entry['response']['transfer_stats'] = curl_getinfo($done['handle']);
-
- if ($done['result'] !== CURLM_OK) {
- $entry['response']['curl']['errno'] = $done['result'];
- if (function_exists('curl_strerror')) {
- $entry['response']['curl']['error'] = curl_strerror($done['result']);
- }
- }
-
- $result = CurlFactory::createResponse(
- $this,
- $entry['request'],
- $entry['response'],
- $entry['headers'],
- $entry['body']
- );
-
- $this->removeProcessed($id);
- $entry['deferred']->resolve($result);
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/src/Client/Middleware.php b/lib/gerencianet/guzzlehttp/ringphp/src/Client/Middleware.php
deleted file mode 100644
index 6fa7318..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/src/Client/Middleware.php
+++ /dev/null
@@ -1,58 +0,0 @@
-result = $result;
- }
-
- public function __invoke(array $request)
- {
- Core::doSleep($request);
- $response = is_callable($this->result)
- ? call_user_func($this->result, $request)
- : $this->result;
-
- if (is_array($response)) {
- $response = new CompletedFutureArray($response + [
- 'status' => null,
- 'body' => null,
- 'headers' => [],
- 'reason' => null,
- 'effective_url' => null,
- ]);
- } elseif (!$response instanceof FutureArrayInterface) {
- throw new \InvalidArgumentException(
- 'Response must be an array or FutureArrayInterface. Found '
- . Core::describeType($request)
- );
- }
-
- return $response;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/src/Client/StreamHandler.php b/lib/gerencianet/guzzlehttp/ringphp/src/Client/StreamHandler.php
deleted file mode 100644
index 4bacec1..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/src/Client/StreamHandler.php
+++ /dev/null
@@ -1,414 +0,0 @@
-options = $options;
- }
-
- public function __invoke(array $request)
- {
- $url = Core::url($request);
- Core::doSleep($request);
-
- try {
- // Does not support the expect header.
- $request = Core::removeHeader($request, 'Expect');
- $stream = $this->createStream($url, $request);
- return $this->createResponse($request, $url, $stream);
- } catch (RingException $e) {
- return $this->createErrorResponse($url, $e);
- }
- }
-
- private function createResponse(array $request, $url, $stream)
- {
- $hdrs = $this->lastHeaders;
- $this->lastHeaders = null;
- $parts = explode(' ', array_shift($hdrs), 3);
- $response = [
- 'version' => substr($parts[0], 5),
- 'status' => $parts[1],
- 'reason' => isset($parts[2]) ? $parts[2] : null,
- 'headers' => Core::headersFromLines($hdrs),
- 'effective_url' => $url,
- ];
-
- $stream = $this->checkDecode($request, $response, $stream);
-
- // If not streaming, then drain the response into a stream.
- if (empty($request['client']['stream'])) {
- $dest = isset($request['client']['save_to'])
- ? $request['client']['save_to']
- : fopen('php://temp', 'r+');
- $stream = $this->drain($stream, $dest);
- }
-
- $response['body'] = $stream;
-
- return new CompletedFutureArray($response);
- }
-
- private function checkDecode(array $request, array $response, $stream)
- {
- // Automatically decode responses when instructed.
- if (!empty($request['client']['decode_content'])) {
- switch (Core::firstHeader($response, 'Content-Encoding', true)) {
- case 'gzip':
- case 'deflate':
- $stream = new InflateStream(Stream::factory($stream));
- break;
- }
- }
-
- return $stream;
- }
-
- /**
- * Drains the stream into the "save_to" client option.
- *
- * @param resource $stream
- * @param string|resource|StreamInterface $dest
- *
- * @return Stream
- * @throws \RuntimeException when the save_to option is invalid.
- */
- private function drain($stream, $dest)
- {
- if (is_resource($stream)) {
- if (!is_resource($dest)) {
- $stream = Stream::factory($stream);
- } else {
- stream_copy_to_stream($stream, $dest);
- fclose($stream);
- rewind($dest);
- return $dest;
- }
- }
-
- // Stream the response into the destination stream
- $dest = is_string($dest)
- ? new Stream(Utils::open($dest, 'r+'))
- : Stream::factory($dest);
-
- Utils::copyToStream($stream, $dest);
- $dest->seek(0);
- $stream->close();
-
- return $dest;
- }
-
- /**
- * Creates an error response for the given stream.
- *
- * @param string $url
- * @param RingException $e
- *
- * @return array
- */
- private function createErrorResponse($url, RingException $e)
- {
- // Determine if the error was a networking error.
- $message = $e->getMessage();
-
- // This list can probably get more comprehensive.
- if (strpos($message, 'getaddrinfo') // DNS lookup failed
- || strpos($message, 'Connection refused')
- ) {
- $e = new ConnectException($e->getMessage(), 0, $e);
- }
-
- return new CompletedFutureArray([
- 'status' => null,
- 'body' => null,
- 'headers' => [],
- 'effective_url' => $url,
- 'error' => $e
- ]);
- }
-
- /**
- * Create a resource and check to ensure it was created successfully
- *
- * @param callable $callback Callable that returns stream resource
- *
- * @return resource
- * @throws \RuntimeException on error
- */
- private function createResource(callable $callback)
- {
- $errors = null;
- set_error_handler(function ($_, $msg, $file, $line) use (&$errors) {
- $errors[] = [
- 'message' => $msg,
- 'file' => $file,
- 'line' => $line
- ];
- return true;
- });
-
- $resource = $callback();
- restore_error_handler();
-
- if (!$resource) {
- $message = 'Error creating resource: ';
- foreach ($errors as $err) {
- foreach ($err as $key => $value) {
- $message .= "[$key] $value" . PHP_EOL;
- }
- }
- throw new RingException(trim($message));
- }
-
- return $resource;
- }
-
- private function createStream($url, array $request)
- {
- static $methods;
- if (!$methods) {
- $methods = array_flip(get_class_methods(__CLASS__));
- }
-
- // HTTP/1.1 streams using the PHP stream wrapper require a
- // Connection: close header
- if ((!isset($request['version']) || $request['version'] == '1.1')
- && !Core::hasHeader($request, 'Connection')
- ) {
- $request['headers']['Connection'] = ['close'];
- }
-
- // Ensure SSL is verified by default
- if (!isset($request['client']['verify'])) {
- $request['client']['verify'] = true;
- }
-
- $params = [];
- $options = $this->getDefaultOptions($request);
-
- if (isset($request['client'])) {
- foreach ($request['client'] as $key => $value) {
- $method = "add_{$key}";
- if (isset($methods[$method])) {
- $this->{$method}($request, $options, $value, $params);
- }
- }
- }
-
- return $this->createStreamResource(
- $url,
- $request,
- $options,
- $this->createContext($request, $options, $params)
- );
- }
-
- private function getDefaultOptions(array $request)
- {
- $headers = "";
- foreach ($request['headers'] as $name => $value) {
- foreach ((array) $value as $val) {
- $headers .= "$name: $val\r\n";
- }
- }
-
- $context = [
- 'http' => [
- 'method' => $request['http_method'],
- 'header' => $headers,
- 'protocol_version' => isset($request['version']) ? $request['version'] : 1.1,
- 'ignore_errors' => true,
- 'follow_location' => 0,
- ],
- ];
-
- $body = Core::body($request);
- if (isset($body)) {
- $context['http']['content'] = $body;
- // Prevent the HTTP handler from adding a Content-Type header.
- if (!Core::hasHeader($request, 'Content-Type')) {
- $context['http']['header'] .= "Content-Type:\r\n";
- }
- }
-
- $context['http']['header'] = rtrim($context['http']['header']);
-
- return $context;
- }
-
- private function add_proxy(array $request, &$options, $value, &$params)
- {
- if (!is_array($value)) {
- $options['http']['proxy'] = $value;
- } else {
- $scheme = isset($request['scheme']) ? $request['scheme'] : 'http';
- if (isset($value[$scheme])) {
- $options['http']['proxy'] = $value[$scheme];
- }
- }
- }
-
- private function add_timeout(array $request, &$options, $value, &$params)
- {
- $options['http']['timeout'] = $value;
- }
-
- private function add_verify(array $request, &$options, $value, &$params)
- {
- if ($value === true) {
- // PHP 5.6 or greater will find the system cert by default. When
- // < 5.6, use the Guzzle bundled cacert.
- if (PHP_VERSION_ID < 50600) {
- $options['ssl']['cafile'] = ClientUtils::getDefaultCaBundle();
- }
- } elseif (is_string($value)) {
- $options['ssl']['cafile'] = $value;
- if (!file_exists($value)) {
- throw new RingException("SSL CA bundle not found: $value");
- }
- } elseif ($value === false) {
- $options['ssl']['verify_peer'] = false;
- $options['ssl']['allow_self_signed'] = true;
- return;
- } else {
- throw new RingException('Invalid verify request option');
- }
-
- $options['ssl']['verify_peer'] = true;
- $options['ssl']['allow_self_signed'] = false;
- }
-
- private function add_cert(array $request, &$options, $value, &$params)
- {
- if (is_array($value)) {
- $options['ssl']['passphrase'] = $value[1];
- $value = $value[0];
- }
-
- if (!file_exists($value)) {
- throw new RingException("SSL certificate not found: {$value}");
- }
-
- $options['ssl']['local_cert'] = $value;
- }
-
- private function add_progress(array $request, &$options, $value, &$params)
- {
- $fn = function ($code, $_1, $_2, $_3, $transferred, $total) use ($value) {
- if ($code == STREAM_NOTIFY_PROGRESS) {
- $value($total, $transferred, null, null);
- }
- };
-
- // Wrap the existing function if needed.
- $params['notification'] = isset($params['notification'])
- ? Core::callArray([$params['notification'], $fn])
- : $fn;
- }
-
- private function add_debug(array $request, &$options, $value, &$params)
- {
- if ($value === false) {
- return;
- }
-
- static $map = [
- STREAM_NOTIFY_CONNECT => 'CONNECT',
- STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED',
- STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT',
- STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS',
- STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS',
- STREAM_NOTIFY_REDIRECTED => 'REDIRECTED',
- STREAM_NOTIFY_PROGRESS => 'PROGRESS',
- STREAM_NOTIFY_FAILURE => 'FAILURE',
- STREAM_NOTIFY_COMPLETED => 'COMPLETED',
- STREAM_NOTIFY_RESOLVE => 'RESOLVE',
- ];
-
- static $args = ['severity', 'message', 'message_code',
- 'bytes_transferred', 'bytes_max'];
-
- $value = Core::getDebugResource($value);
- $ident = $request['http_method'] . ' ' . Core::url($request);
- $fn = function () use ($ident, $value, $map, $args) {
- $passed = func_get_args();
- $code = array_shift($passed);
- fprintf($value, '<%s> [%s] ', $ident, $map[$code]);
- foreach (array_filter($passed) as $i => $v) {
- fwrite($value, $args[$i] . ': "' . $v . '" ');
- }
- fwrite($value, "\n");
- };
-
- // Wrap the existing function if needed.
- $params['notification'] = isset($params['notification'])
- ? Core::callArray([$params['notification'], $fn])
- : $fn;
- }
-
- private function applyCustomOptions(array $request, array &$options)
- {
- if (!isset($request['client']['stream_context'])) {
- return;
- }
-
- if (!is_array($request['client']['stream_context'])) {
- throw new RingException('stream_context must be an array');
- }
-
- $options = array_replace_recursive(
- $options,
- $request['client']['stream_context']
- );
- }
-
- private function createContext(array $request, array $options, array $params)
- {
- $this->applyCustomOptions($request, $options);
- return $this->createResource(
- function () use ($request, $options, $params) {
- return stream_context_create($options, $params);
- },
- $request,
- $options
- );
- }
-
- private function createStreamResource(
- $url,
- array $request,
- array $options,
- $context
- ) {
- return $this->createResource(
- function () use ($url, $context) {
- if (false === strpos($url, 'http')) {
- trigger_error("URL is invalid: {$url}", E_USER_WARNING);
- return null;
- }
- $resource = fopen($url, 'r', null, $context);
- $this->lastHeaders = $http_response_header;
- return $resource;
- },
- $request,
- $options
- );
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/src/Core.php b/lib/gerencianet/guzzlehttp/ringphp/src/Core.php
deleted file mode 100644
index dd7d1a0..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/src/Core.php
+++ /dev/null
@@ -1,364 +0,0 @@
- $value) {
- if (!strcasecmp($name, $header)) {
- $result = array_merge($result, $value);
- }
- }
- }
-
- return $result;
- }
-
- /**
- * Gets a header value from a message as a string or null
- *
- * This method searches through the "headers" key of a message for a header
- * using a case-insensitive search. The lines of the header are imploded
- * using commas into a single string return value.
- *
- * @param array $message Request or response hash.
- * @param string $header Header to retrieve
- *
- * @return string|null Returns the header string if found, or null if not.
- */
- public static function header($message, $header)
- {
- $match = self::headerLines($message, $header);
- return $match ? implode(', ', $match) : null;
- }
-
- /**
- * Returns the first header value from a message as a string or null. If
- * a header line contains multiple values separated by a comma, then this
- * function will return the first value in the list.
- *
- * @param array $message Request or response hash.
- * @param string $header Header to retrieve
- *
- * @return string|null Returns the value as a string if found.
- */
- public static function firstHeader($message, $header)
- {
- if (!empty($message['headers'])) {
- foreach ($message['headers'] as $name => $value) {
- if (!strcasecmp($name, $header)) {
- // Return the match itself if it is a single value.
- $pos = strpos($value[0], ',');
- return $pos ? substr($value[0], 0, $pos) : $value[0];
- }
- }
- }
-
- return null;
- }
-
- /**
- * Returns true if a message has the provided case-insensitive header.
- *
- * @param array $message Request or response hash.
- * @param string $header Header to check
- *
- * @return bool
- */
- public static function hasHeader($message, $header)
- {
- if (!empty($message['headers'])) {
- foreach ($message['headers'] as $name => $value) {
- if (!strcasecmp($name, $header)) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * Parses an array of header lines into an associative array of headers.
- *
- * @param array $lines Header lines array of strings in the following
- * format: "Name: Value"
- * @return array
- */
- public static function headersFromLines($lines)
- {
- $headers = [];
-
- foreach ($lines as $line) {
- $parts = explode(':', $line, 2);
- $headers[trim($parts[0])][] = isset($parts[1])
- ? trim($parts[1])
- : null;
- }
-
- return $headers;
- }
-
- /**
- * Removes a header from a message using a case-insensitive comparison.
- *
- * @param array $message Message that contains 'headers'
- * @param string $header Header to remove
- *
- * @return array
- */
- public static function removeHeader(array $message, $header)
- {
- if (isset($message['headers'])) {
- foreach (array_keys($message['headers']) as $key) {
- if (!strcasecmp($header, $key)) {
- unset($message['headers'][$key]);
- }
- }
- }
-
- return $message;
- }
-
- /**
- * Replaces any existing case insensitive headers with the given value.
- *
- * @param array $message Message that contains 'headers'
- * @param string $header Header to set.
- * @param array $value Value to set.
- *
- * @return array
- */
- public static function setHeader(array $message, $header, array $value)
- {
- $message = self::removeHeader($message, $header);
- $message['headers'][$header] = $value;
-
- return $message;
- }
-
- /**
- * Creates a URL string from a request.
- *
- * If the "url" key is present on the request, it is returned, otherwise
- * the url is built up based on the scheme, host, uri, and query_string
- * request values.
- *
- * @param array $request Request to get the URL from
- *
- * @return string Returns the request URL as a string.
- * @throws \InvalidArgumentException if no Host header is present.
- */
- public static function url(array $request)
- {
- if (isset($request['url'])) {
- return $request['url'];
- }
-
- $uri = (isset($request['scheme'])
- ? $request['scheme'] : 'http') . '://';
-
- if ($host = self::header($request, 'host')) {
- $uri .= $host;
- } else {
- throw new \InvalidArgumentException('No Host header was provided');
- }
-
- if (isset($request['uri'])) {
- $uri .= $request['uri'];
- }
-
- if (isset($request['query_string'])) {
- $uri .= '?' . $request['query_string'];
- }
-
- return $uri;
- }
-
- /**
- * Reads the body of a message into a string.
- *
- * @param array|FutureArrayInterface $message Array containing a "body" key
- *
- * @return null|string Returns the body as a string or null if not set.
- * @throws \InvalidArgumentException if a request body is invalid.
- */
- public static function body($message)
- {
- if (!isset($message['body'])) {
- return null;
- }
-
- if ($message['body'] instanceof StreamInterface) {
- return (string) $message['body'];
- }
-
- switch (gettype($message['body'])) {
- case 'string':
- return $message['body'];
- case 'resource':
- return stream_get_contents($message['body']);
- case 'object':
- if ($message['body'] instanceof \Iterator) {
- return implode('', iterator_to_array($message['body']));
- } elseif (method_exists($message['body'], '__toString')) {
- return (string) $message['body'];
- }
- default:
- throw new \InvalidArgumentException('Invalid request body: '
- . self::describeType($message['body']));
- }
- }
-
- /**
- * Rewind the body of the provided message if possible.
- *
- * @param array $message Message that contains a 'body' field.
- *
- * @return bool Returns true on success, false on failure
- */
- public static function rewindBody($message)
- {
- if ($message['body'] instanceof StreamInterface) {
- return $message['body']->seek(0);
- }
-
- if ($message['body'] instanceof \Generator) {
- return false;
- }
-
- if ($message['body'] instanceof \Iterator) {
- $message['body']->rewind();
- return true;
- }
-
- if (is_resource($message['body'])) {
- return rewind($message['body']);
- }
-
- return is_string($message['body'])
- || (is_object($message['body'])
- && method_exists($message['body'], '__toString'));
- }
-
- /**
- * Debug function used to describe the provided value type and class.
- *
- * @param mixed $input
- *
- * @return string Returns a string containing the type of the variable and
- * if a class is provided, the class name.
- */
- public static function describeType($input)
- {
- switch (gettype($input)) {
- case 'object':
- return 'object(' . get_class($input) . ')';
- case 'array':
- return 'array(' . count($input) . ')';
- default:
- ob_start();
- var_dump($input);
- // normalize float vs double
- return str_replace('double(', 'float(', rtrim(ob_get_clean()));
- }
- }
-
- /**
- * Sleep for the specified amount of time specified in the request's
- * ['client']['delay'] option if present.
- *
- * This function should only be used when a non-blocking sleep is not
- * possible.
- *
- * @param array $request Request to sleep
- */
- public static function doSleep(array $request)
- {
- if (isset($request['client']['delay'])) {
- usleep($request['client']['delay'] * 1000);
- }
- }
-
- /**
- * Returns a proxied future that modifies the dereferenced value of another
- * future using a promise.
- *
- * @param FutureArrayInterface $future Future to wrap with a new future
- * @param callable $onFulfilled Invoked when the future fulfilled
- * @param callable $onRejected Invoked when the future rejected
- * @param callable $onProgress Invoked when the future progresses
- *
- * @return FutureArray
- */
- public static function proxy(
- FutureArrayInterface $future,
- callable $onFulfilled = null,
- callable $onRejected = null,
- callable $onProgress = null
- ) {
- return new FutureArray(
- $future->then($onFulfilled, $onRejected, $onProgress),
- [$future, 'wait'],
- [$future, 'cancel']
- );
- }
-
- /**
- * Returns a debug stream based on the provided variable.
- *
- * @param mixed $value Optional value
- *
- * @return resource
- */
- public static function getDebugResource($value = null)
- {
- if (is_resource($value)) {
- return $value;
- } elseif (defined('STDOUT')) {
- return STDOUT;
- } else {
- return fopen('php://output', 'w');
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/src/Exception/CancelledException.php b/lib/gerencianet/guzzlehttp/ringphp/src/Exception/CancelledException.php
deleted file mode 100644
index 95b353a..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/src/Exception/CancelledException.php
+++ /dev/null
@@ -1,7 +0,0 @@
-wrappedPromise = $promise;
- $this->waitfn = $wait;
- $this->cancelfn = $cancel;
- }
-
- public function wait()
- {
- if (!$this->isRealized) {
- $this->addShadow();
- if (!$this->isRealized && $this->waitfn) {
- $this->invokeWait();
- }
- if (!$this->isRealized) {
- $this->error = new RingException('Waiting did not resolve future');
- }
- }
-
- if ($this->error) {
- throw $this->error;
- }
-
- return $this->result;
- }
-
- public function promise()
- {
- return $this->wrappedPromise;
- }
-
- public function then(
- callable $onFulfilled = null,
- callable $onRejected = null,
- callable $onProgress = null
- ) {
- return $this->wrappedPromise->then($onFulfilled, $onRejected, $onProgress);
- }
-
- public function cancel()
- {
- if (!$this->isRealized) {
- $cancelfn = $this->cancelfn;
- $this->waitfn = $this->cancelfn = null;
- $this->isRealized = true;
- $this->error = new CancelledFutureAccessException();
- if ($cancelfn) {
- $cancelfn($this);
- }
- }
- }
-
- private function addShadow()
- {
- // Get the result and error when the promise is resolved. Note that
- // calling this function might trigger the resolution immediately.
- $this->wrappedPromise->then(
- function ($value) {
- $this->isRealized = true;
- $this->result = $value;
- $this->waitfn = $this->cancelfn = null;
- },
- function ($error) {
- $this->isRealized = true;
- $this->error = $error;
- $this->waitfn = $this->cancelfn = null;
- }
- );
- }
-
- private function invokeWait()
- {
- try {
- $wait = $this->waitfn;
- $this->waitfn = null;
- $wait();
- } catch (\Exception $e) {
- // Defer can throw to reject.
- $this->error = $e;
- $this->isRealized = true;
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/src/Future/CompletedFutureArray.php b/lib/gerencianet/guzzlehttp/ringphp/src/Future/CompletedFutureArray.php
deleted file mode 100644
index 0a90c93..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/src/Future/CompletedFutureArray.php
+++ /dev/null
@@ -1,43 +0,0 @@
-result[$offset]);
- }
-
- public function offsetGet($offset)
- {
- return $this->result[$offset];
- }
-
- public function offsetSet($offset, $value)
- {
- $this->result[$offset] = $value;
- }
-
- public function offsetUnset($offset)
- {
- unset($this->result[$offset]);
- }
-
- public function count()
- {
- return count($this->result);
- }
-
- public function getIterator()
- {
- return new \ArrayIterator($this->result);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php b/lib/gerencianet/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php
deleted file mode 100644
index 0d25af7..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php
+++ /dev/null
@@ -1,57 +0,0 @@
-result = $result;
- $this->error = $e;
- }
-
- public function wait()
- {
- if ($this->error) {
- throw $this->error;
- }
-
- return $this->result;
- }
-
- public function cancel() {}
-
- public function promise()
- {
- if (!$this->cachedPromise) {
- $this->cachedPromise = $this->error
- ? new RejectedPromise($this->error)
- : new FulfilledPromise($this->result);
- }
-
- return $this->cachedPromise;
- }
-
- public function then(
- callable $onFulfilled = null,
- callable $onRejected = null,
- callable $onProgress = null
- ) {
- return $this->promise()->then($onFulfilled, $onRejected, $onProgress);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/src/Future/FutureArray.php b/lib/gerencianet/guzzlehttp/ringphp/src/Future/FutureArray.php
deleted file mode 100644
index 3d64c96..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/src/Future/FutureArray.php
+++ /dev/null
@@ -1,40 +0,0 @@
-_value[$offset]);
- }
-
- public function offsetGet($offset)
- {
- return $this->_value[$offset];
- }
-
- public function offsetSet($offset, $value)
- {
- $this->_value[$offset] = $value;
- }
-
- public function offsetUnset($offset)
- {
- unset($this->_value[$offset]);
- }
-
- public function count()
- {
- return count($this->_value);
- }
-
- public function getIterator()
- {
- return new \ArrayIterator($this->_value);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/src/Future/FutureArrayInterface.php b/lib/gerencianet/guzzlehttp/ringphp/src/Future/FutureArrayInterface.php
deleted file mode 100644
index 58f5f73..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/src/Future/FutureArrayInterface.php
+++ /dev/null
@@ -1,11 +0,0 @@
-_value = $this->wait();
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/CurlFactoryTest.php b/lib/gerencianet/guzzlehttp/ringphp/tests/Client/CurlFactoryTest.php
deleted file mode 100644
index ebde187..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/CurlFactoryTest.php
+++ /dev/null
@@ -1,821 +0,0 @@
- 200,
- 'headers' => [
- 'Foo' => ['Bar'],
- 'Baz' => ['bam'],
- 'Content-Length' => [2],
- ],
- 'body' => 'hi',
- ]]);
-
- $stream = Stream::factory();
-
- $request = [
- 'http_method' => 'PUT',
- 'headers' => [
- 'host' => [Server::$url],
- 'Hi' => [' 123'],
- ],
- 'body' => 'testing',
- 'client' => ['save_to' => $stream],
- ];
-
- $f = new CurlFactory();
- $result = $f($request);
- $this->assertInternalType('array', $result);
- $this->assertCount(3, $result);
- $this->assertInternalType('resource', $result[0]);
- $this->assertInternalType('array', $result[1]);
- $this->assertSame($stream, $result[2]);
- curl_close($result[0]);
-
- $this->assertEquals('PUT', $_SERVER['_curl'][CURLOPT_CUSTOMREQUEST]);
- $this->assertEquals(
- 'http://http://127.0.0.1:8125/',
- $_SERVER['_curl'][CURLOPT_URL]
- );
- // Sends via post fields when the request is small enough
- $this->assertEquals('testing', $_SERVER['_curl'][CURLOPT_POSTFIELDS]);
- $this->assertEquals(0, $_SERVER['_curl'][CURLOPT_RETURNTRANSFER]);
- $this->assertEquals(0, $_SERVER['_curl'][CURLOPT_HEADER]);
- $this->assertEquals(150, $_SERVER['_curl'][CURLOPT_CONNECTTIMEOUT]);
- $this->assertInstanceOf('Closure', $_SERVER['_curl'][CURLOPT_HEADERFUNCTION]);
-
- if (defined('CURLOPT_PROTOCOLS')) {
- $this->assertEquals(
- CURLPROTO_HTTP | CURLPROTO_HTTPS,
- $_SERVER['_curl'][CURLOPT_PROTOCOLS]
- );
- }
-
- $this->assertContains('Expect:', $_SERVER['_curl'][CURLOPT_HTTPHEADER]);
- $this->assertContains('Accept:', $_SERVER['_curl'][CURLOPT_HTTPHEADER]);
- $this->assertContains('Content-Type:', $_SERVER['_curl'][CURLOPT_HTTPHEADER]);
- $this->assertContains('Hi: 123', $_SERVER['_curl'][CURLOPT_HTTPHEADER]);
- $this->assertContains('host: http://127.0.0.1:8125/', $_SERVER['_curl'][CURLOPT_HTTPHEADER]);
- }
-
- public function testSendsHeadRequests()
- {
- Server::flush();
- Server::enqueue([['status' => 200]]);
- $a = new CurlMultiHandler();
- $response = $a([
- 'http_method' => 'HEAD',
- 'headers' => ['host' => [Server::$host]],
- ]);
- $response->wait();
- $this->assertEquals(true, $_SERVER['_curl'][CURLOPT_NOBODY]);
- $checks = [CURLOPT_WRITEFUNCTION, CURLOPT_READFUNCTION, CURLOPT_FILE, CURLOPT_INFILE];
- foreach ($checks as $check) {
- $this->assertArrayNotHasKey($check, $_SERVER['_curl']);
- }
- $this->assertEquals('HEAD', Server::received()[0]['http_method']);
- }
-
- public function testCanAddCustomCurlOptions()
- {
- Server::flush();
- Server::enqueue([['status' => 200]]);
- $a = new CurlMultiHandler();
- $a([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'client' => ['curl' => [CURLOPT_LOW_SPEED_LIMIT => 10]],
- ]);
- $this->assertEquals(10, $_SERVER['_curl'][CURLOPT_LOW_SPEED_LIMIT]);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage SSL CA bundle not found: /does/not/exist
- */
- public function testValidatesVerify()
- {
- $f = new CurlFactory();
- $f([
- 'http_method' => 'GET',
- 'headers' => ['host' => ['foo.com']],
- 'client' => ['verify' => '/does/not/exist'],
- ]);
- }
-
- public function testCanSetVerifyToFile()
- {
- $f = new CurlFactory();
- $f([
- 'http_method' => 'GET',
- 'headers' => ['host' => ['foo.com']],
- 'client' => ['verify' => __FILE__],
- ]);
- $this->assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_CAINFO]);
- $this->assertEquals(2, $_SERVER['_curl'][CURLOPT_SSL_VERIFYHOST]);
- $this->assertEquals(true, $_SERVER['_curl'][CURLOPT_SSL_VERIFYPEER]);
- }
-
- public function testAddsVerifyAsTrue()
- {
- $f = new CurlFactory();
- $f([
- 'http_method' => 'GET',
- 'headers' => ['host' => ['foo.com']],
- 'client' => ['verify' => true],
- ]);
- $this->assertEquals(2, $_SERVER['_curl'][CURLOPT_SSL_VERIFYHOST]);
- $this->assertEquals(true, $_SERVER['_curl'][CURLOPT_SSL_VERIFYPEER]);
- $this->assertArrayNotHasKey(CURLOPT_CAINFO, $_SERVER['_curl']);
- }
-
- public function testCanDisableVerify()
- {
- $f = new CurlFactory();
- $f([
- 'http_method' => 'GET',
- 'headers' => ['host' => ['foo.com']],
- 'client' => ['verify' => false],
- ]);
- $this->assertEquals(0, $_SERVER['_curl'][CURLOPT_SSL_VERIFYHOST]);
- $this->assertEquals(false, $_SERVER['_curl'][CURLOPT_SSL_VERIFYPEER]);
- }
-
- public function testAddsProxy()
- {
- $f = new CurlFactory();
- $f([
- 'http_method' => 'GET',
- 'headers' => ['host' => ['foo.com']],
- 'client' => ['proxy' => 'http://bar.com'],
- ]);
- $this->assertEquals('http://bar.com', $_SERVER['_curl'][CURLOPT_PROXY]);
- }
-
- public function testAddsViaScheme()
- {
- $f = new CurlFactory();
- $f([
- 'http_method' => 'GET',
- 'scheme' => 'http',
- 'headers' => ['host' => ['foo.com']],
- 'client' => [
- 'proxy' => ['http' => 'http://bar.com', 'https' => 'https://t'],
- ],
- ]);
- $this->assertEquals('http://bar.com', $_SERVER['_curl'][CURLOPT_PROXY]);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage SSL private key not found: /does/not/exist
- */
- public function testValidatesSslKey()
- {
- $f = new CurlFactory();
- $f([
- 'http_method' => 'GET',
- 'headers' => ['host' => ['foo.com']],
- 'client' => ['ssl_key' => '/does/not/exist'],
- ]);
- }
-
- public function testAddsSslKey()
- {
- $f = new CurlFactory();
- $f([
- 'http_method' => 'GET',
- 'headers' => ['host' => ['foo.com']],
- 'client' => ['ssl_key' => __FILE__],
- ]);
- $this->assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLKEY]);
- }
-
- public function testAddsSslKeyWithPassword()
- {
- $f = new CurlFactory();
- $f([
- 'http_method' => 'GET',
- 'headers' => ['host' => ['foo.com']],
- 'client' => ['ssl_key' => [__FILE__, 'test']],
- ]);
- $this->assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLKEY]);
- $this->assertEquals('test', $_SERVER['_curl'][CURLOPT_SSLKEYPASSWD]);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage SSL certificate not found: /does/not/exist
- */
- public function testValidatesCert()
- {
- $f = new CurlFactory();
- $f([
- 'http_method' => 'GET',
- 'headers' => ['host' => ['foo.com']],
- 'client' => ['cert' => '/does/not/exist'],
- ]);
- }
-
- public function testAddsCert()
- {
- $f = new CurlFactory();
- $f([
- 'http_method' => 'GET',
- 'headers' => ['host' => ['foo.com']],
- 'client' => ['cert' => __FILE__],
- ]);
- $this->assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLCERT]);
- }
-
- public function testAddsCertWithPassword()
- {
- $f = new CurlFactory();
- $f([
- 'http_method' => 'GET',
- 'headers' => ['host' => ['foo.com']],
- 'client' => ['cert' => [__FILE__, 'test']],
- ]);
- $this->assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLCERT]);
- $this->assertEquals('test', $_SERVER['_curl'][CURLOPT_SSLCERTPASSWD]);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage progress client option must be callable
- */
- public function testValidatesProgress()
- {
- $f = new CurlFactory();
- $f([
- 'http_method' => 'GET',
- 'headers' => ['host' => ['foo.com']],
- 'client' => ['progress' => 'foo'],
- ]);
- }
-
- public function testEmitsDebugInfoToStream()
- {
- $res = fopen('php://memory', 'r+');
- Server::flush();
- Server::enqueue([['status' => 200]]);
- $a = new CurlMultiHandler();
- $response = $a([
- 'http_method' => 'HEAD',
- 'headers' => ['host' => [Server::$host]],
- 'client' => ['debug' => $res],
- ]);
- $response->wait();
- rewind($res);
- $output = str_replace("\r", '', stream_get_contents($res));
- $this->assertContains(
- "> HEAD / HTTP/1.1\nhost: 127.0.0.1:8125\n\n",
- $output
- );
- $this->assertContains("< HTTP/1.1 200", $output);
- fclose($res);
- }
-
- public function testEmitsProgressToFunction()
- {
- Server::flush();
- Server::enqueue([['status' => 200]]);
- $a = new CurlMultiHandler();
- $called = [];
- $response = $a([
- 'http_method' => 'HEAD',
- 'headers' => ['host' => [Server::$host]],
- 'client' => [
- 'progress' => function () use (&$called) {
- $called[] = func_get_args();
- },
- ],
- ]);
- $response->wait();
- $this->assertNotEmpty($called);
- foreach ($called as $call) {
- $this->assertCount(4, $call);
- }
- }
-
- private function addDecodeResponse($withEncoding = true)
- {
- $content = gzencode('test');
- $response = [
- 'status' => 200,
- 'reason' => 'OK',
- 'headers' => ['Content-Length' => [strlen($content)]],
- 'body' => $content,
- ];
-
- if ($withEncoding) {
- $response['headers']['Content-Encoding'] = ['gzip'];
- }
-
- Server::flush();
- Server::enqueue([$response]);
-
- return $content;
- }
-
- public function testDecodesGzippedResponses()
- {
- $this->addDecodeResponse();
- $handler = new CurlMultiHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'client' => ['decode_content' => true],
- ]);
- $response->wait();
- $this->assertEquals('test', Core::body($response));
- $this->assertEquals('', $_SERVER['_curl'][CURLOPT_ENCODING]);
- $sent = Server::received()[0];
- $this->assertNull(Core::header($sent, 'Accept-Encoding'));
- }
-
- public function testDecodesGzippedResponsesWithHeader()
- {
- $this->addDecodeResponse();
- $handler = new CurlMultiHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => [
- 'host' => [Server::$host],
- 'Accept-Encoding' => ['gzip'],
- ],
- 'client' => ['decode_content' => true],
- ]);
- $response->wait();
- $this->assertEquals('gzip', $_SERVER['_curl'][CURLOPT_ENCODING]);
- $sent = Server::received()[0];
- $this->assertEquals('gzip', Core::header($sent, 'Accept-Encoding'));
- $this->assertEquals('test', Core::body($response));
- }
-
- public function testDoesNotForceDecode()
- {
- $content = $this->addDecodeResponse();
- $handler = new CurlMultiHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'client' => ['decode_content' => false],
- ]);
- $response->wait();
- $sent = Server::received()[0];
- $this->assertNull(Core::header($sent, 'Accept-Encoding'));
- $this->assertEquals($content, Core::body($response));
- }
-
- public function testProtocolVersion()
- {
- Server::flush();
- Server::enqueue([['status' => 200]]);
- $a = new CurlMultiHandler();
- $a([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'version' => 1.0,
- ]);
- $this->assertEquals(CURL_HTTP_VERSION_1_0, $_SERVER['_curl'][CURLOPT_HTTP_VERSION]);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesSaveTo()
- {
- $handler = new CurlMultiHandler();
- $handler([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'client' => ['save_to' => true],
- ]);
- }
-
- public function testSavesToStream()
- {
- $stream = fopen('php://memory', 'r+');
- $this->addDecodeResponse();
- $handler = new CurlMultiHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'client' => [
- 'decode_content' => true,
- 'save_to' => $stream,
- ],
- ]);
- $response->wait();
- rewind($stream);
- $this->assertEquals('test', stream_get_contents($stream));
- }
-
- public function testSavesToGuzzleStream()
- {
- $stream = Stream::factory();
- $this->addDecodeResponse();
- $handler = new CurlMultiHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'client' => [
- 'decode_content' => true,
- 'save_to' => $stream,
- ],
- ]);
- $response->wait();
- $this->assertEquals('test', (string) $stream);
- }
-
- public function testSavesToFileOnDisk()
- {
- $tmpfile = tempnam(sys_get_temp_dir(), 'testfile');
- $this->addDecodeResponse();
- $handler = new CurlMultiHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'client' => [
- 'decode_content' => true,
- 'save_to' => $tmpfile,
- ],
- ]);
- $response->wait();
- $this->assertEquals('test', file_get_contents($tmpfile));
- unlink($tmpfile);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesBody()
- {
- $handler = new CurlMultiHandler();
- $handler([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'body' => false,
- ]);
- }
-
- public function testAddsLargePayloadFromStreamWithNoSizeUsingChunked()
- {
- $stream = Stream::factory('foo');
- $stream = FnStream::decorate($stream, [
- 'getSize' => function () {
- return null;
- }
- ]);
- $this->addDecodeResponse();
- $handler = new CurlMultiHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'body' => $stream,
- ]);
- $response->wait();
- $sent = Server::received()[0];
- $this->assertEquals('chunked', Core::header($sent, 'Transfer-Encoding'));
- $this->assertNull(Core::header($sent, 'Content-Length'));
- $this->assertEquals('foo', $sent['body']);
- }
-
- public function testAddsPayloadFromIterator()
- {
- $iter = new \ArrayIterator(['f', 'o', 'o']);
- $this->addDecodeResponse();
- $handler = new CurlMultiHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'body' => $iter,
- ]);
- $response->wait();
- $sent = Server::received()[0];
- $this->assertEquals('chunked', Core::header($sent, 'Transfer-Encoding'));
- $this->assertNull(Core::header($sent, 'Content-Length'));
- $this->assertEquals('foo', $sent['body']);
- }
-
- public function testAddsPayloadFromResource()
- {
- $res = fopen('php://memory', 'r+');
- $data = str_repeat('.', 1000000);
- fwrite($res, $data);
- rewind($res);
- $this->addDecodeResponse();
- $handler = new CurlMultiHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => [
- 'host' => [Server::$host],
- 'content-length' => [1000000],
- ],
- 'body' => $res,
- ]);
- $response->wait();
- $sent = Server::received()[0];
- $this->assertNull(Core::header($sent, 'Transfer-Encoding'));
- $this->assertEquals(1000000, Core::header($sent, 'Content-Length'));
- $this->assertEquals($data, $sent['body']);
- }
-
- public function testAddsContentLengthFromStream()
- {
- $stream = Stream::factory('foo');
- $this->addDecodeResponse();
- $handler = new CurlMultiHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'body' => $stream,
- ]);
- $response->wait();
- $sent = Server::received()[0];
- $this->assertEquals(3, Core::header($sent, 'Content-Length'));
- $this->assertNull(Core::header($sent, 'Transfer-Encoding'));
- $this->assertEquals('foo', $sent['body']);
- }
-
- public function testDoesNotAddMultipleContentLengthHeaders()
- {
- $this->addDecodeResponse();
- $handler = new CurlMultiHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => [
- 'host' => [Server::$host],
- 'content-length' => [3],
- ],
- 'body' => 'foo',
- ]);
- $response->wait();
- $sent = Server::received()[0];
- $this->assertEquals(3, Core::header($sent, 'Content-Length'));
- $this->assertNull(Core::header($sent, 'Transfer-Encoding'));
- $this->assertEquals('foo', $sent['body']);
- }
-
- public function testSendsPostWithNoBodyOrDefaultContentType()
- {
- Server::flush();
- Server::enqueue([['status' => 200]]);
- $handler = new CurlMultiHandler();
- $response = $handler([
- 'http_method' => 'POST',
- 'uri' => '/',
- 'headers' => ['host' => [Server::$host]],
- ]);
- $response->wait();
- $received = Server::received()[0];
- $this->assertEquals('POST', $received['http_method']);
- $this->assertNull(Core::header($received, 'content-type'));
- $this->assertSame('0', Core::firstHeader($received, 'content-length'));
- }
-
- public function testParseProtocolVersion()
- {
- $res = CurlFactory::createResponse(
- function () {},
- [],
- ['curl' => ['errno' => null]],
- ['HTTP/1.1 200 Ok'],
- null
- );
-
- $this->assertSame('1.1', $res['version']);
- }
-
- public function testFailsWhenNoResponseAndNoBody()
- {
- $res = CurlFactory::createResponse(function () {}, [], [], [], null);
- $this->assertInstanceOf('GuzzleHttp\Ring\Exception\RingException', $res['error']);
- $this->assertContains(
- 'No response was received for a request with no body',
- $res['error']->getMessage()
- );
- }
-
- public function testFailsWhenCannotRewindRetry()
- {
- $res = CurlFactory::createResponse(function () {}, [
- 'body' => new NoSeekStream(Stream::factory('foo'))
- ], [], [], null);
- $this->assertInstanceOf('GuzzleHttp\Ring\Exception\RingException', $res['error']);
- $this->assertContains(
- 'rewind the request body failed',
- $res['error']->getMessage()
- );
- }
-
- public function testRetriesWhenBodyCanBeRewound()
- {
- $callHandler = $called = false;
- $res = CurlFactory::createResponse(function () use (&$callHandler) {
- $callHandler = true;
- return ['status' => 200];
- }, [
- 'body' => FnStream::decorate(Stream::factory('test'), [
- 'seek' => function () use (&$called) {
- $called = true;
- return true;
- }
- ])
- ], [], [], null);
-
- $this->assertTrue($callHandler);
- $this->assertTrue($called);
- $this->assertEquals('200', $res['status']);
- }
-
- public function testFailsWhenRetryMoreThanThreeTimes()
- {
- $call = 0;
- $mock = new MockHandler(function (array $request) use (&$mock, &$call) {
- $call++;
- return CurlFactory::createResponse($mock, $request, [], [], null);
- });
- $response = $mock([
- 'http_method' => 'GET',
- 'body' => 'test',
- ]);
- $this->assertEquals(3, $call);
- $this->assertArrayHasKey('error', $response);
- $this->assertContains(
- 'The cURL request was retried 3 times',
- $response['error']->getMessage()
- );
- }
-
- public function testHandles100Continue()
- {
- Server::flush();
- Server::enqueue([
- [
- 'status' => '200',
- 'reason' => 'OK',
- 'headers' => [
- 'Test' => ['Hello'],
- 'Content-Length' => ['4'],
- ],
- 'body' => 'test',
- ],
- ]);
-
- $request = [
- 'http_method' => 'PUT',
- 'headers' => [
- 'Host' => [Server::$host],
- 'Expect' => ['100-Continue'],
- ],
- 'body' => 'test',
- ];
-
- $handler = new CurlMultiHandler();
- $response = $handler($request)->wait();
- $this->assertEquals(200, $response['status']);
- $this->assertEquals('OK', $response['reason']);
- $this->assertEquals(['Hello'], $response['headers']['Test']);
- $this->assertEquals(['4'], $response['headers']['Content-Length']);
- $this->assertEquals('test', Core::body($response));
- }
-
- public function testCreatesConnectException()
- {
- $m = new \ReflectionMethod('GuzzleHttp\Ring\Client\CurlFactory', 'createErrorResponse');
- $m->setAccessible(true);
- $response = $m->invoke(
- null,
- function () {},
- [],
- [
- 'err_message' => 'foo',
- 'curl' => [
- 'errno' => CURLE_COULDNT_CONNECT,
- ]
- ]
- );
- $this->assertInstanceOf('GuzzleHttp\Ring\Exception\ConnectException', $response['error']);
- }
-
- public function testParsesLastResponseOnly()
- {
- $response1 = [
- 'status' => 301,
- 'headers' => [
- 'Content-Length' => ['0'],
- 'Location' => ['/foo']
- ]
- ];
-
- $response2 = [
- 'status' => 200,
- 'headers' => [
- 'Content-Length' => ['0'],
- 'Foo' => ['bar']
- ]
- ];
-
- Server::flush();
- Server::enqueue([$response1, $response2]);
-
- $a = new CurlMultiHandler();
- $response = $a([
- 'http_method' => 'GET',
- 'headers' => ['Host' => [Server::$host]],
- 'client' => [
- 'curl' => [
- CURLOPT_FOLLOWLOCATION => true
- ]
- ]
- ])->wait();
-
- $this->assertEquals(1, $response['transfer_stats']['redirect_count']);
- $this->assertEquals('http://127.0.0.1:8125/foo', $response['effective_url']);
- $this->assertEquals(['bar'], $response['headers']['Foo']);
- $this->assertEquals(200, $response['status']);
- $this->assertFalse(Core::hasHeader($response, 'Location'));
- }
-
- public function testMaintainsMultiHeaderOrder()
- {
- Server::flush();
- Server::enqueue([
- [
- 'status' => 200,
- 'headers' => [
- 'Content-Length' => ['0'],
- 'Foo' => ['a', 'b'],
- 'foo' => ['c', 'd'],
- ]
- ]
- ]);
-
- $a = new CurlMultiHandler();
- $response = $a([
- 'http_method' => 'GET',
- 'headers' => ['Host' => [Server::$host]]
- ])->wait();
-
- $this->assertEquals(
- ['a', 'b', 'c', 'd'],
- Core::headerLines($response, 'Foo')
- );
- }
-
- /**
- * @expectedException \RuntimeException
- * @expectedExceptionMessage Directory /path/to/does/not does not exist for save_to value of /path/to/does/not/exist.txt
- */
- public function testThrowsWhenDirNotFound()
- {
- $request = [
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$url]],
- 'client' => ['save_to' => '/path/to/does/not/exist.txt'],
- ];
-
- $f = new CurlFactory();
- $f($request);
- }
-}
-
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/CurlHandlerTest.php b/lib/gerencianet/guzzlehttp/ringphp/tests/Client/CurlHandlerTest.php
deleted file mode 100644
index ba03b8c..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/CurlHandlerTest.php
+++ /dev/null
@@ -1,96 +0,0 @@
-markTestSkipped('curl_reset() is not available');
- }
- }
-
- protected function getHandler($factory = null, $options = [])
- {
- return new CurlHandler($options);
- }
-
- public function testCanSetMaxHandles()
- {
- $a = new CurlHandler(['max_handles' => 10]);
- $this->assertEquals(10, $this->readAttribute($a, 'maxHandles'));
- }
-
- public function testCreatesCurlErrors()
- {
- $handler = new CurlHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'uri' => '/',
- 'headers' => ['host' => ['localhost:123']],
- 'client' => ['timeout' => 0.001, 'connect_timeout' => 0.001],
- ]);
- $this->assertNull($response['status']);
- $this->assertNull($response['reason']);
- $this->assertEquals([], $response['headers']);
- $this->assertInstanceOf(
- 'GuzzleHttp\Ring\Exception\RingException',
- $response['error']
- );
-
- $this->assertEquals(
- 1,
- preg_match('/^cURL error \d+: .*$/', $response['error']->getMessage())
- );
- }
-
- public function testReleasesAdditionalEasyHandles()
- {
- Server::flush();
- $response = [
- 'status' => 200,
- 'headers' => ['Content-Length' => [4]],
- 'body' => 'test',
- ];
-
- Server::enqueue([$response, $response, $response, $response]);
- $a = new CurlHandler(['max_handles' => 2]);
-
- $fn = function () use (&$calls, $a, &$fn) {
- if (++$calls < 4) {
- $a([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'client' => ['progress' => $fn],
- ]);
- }
- };
-
- $request = [
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'client' => [
- 'progress' => $fn,
- ],
- ];
-
- $a($request);
- $this->assertCount(2, $this->readAttribute($a, 'handles'));
- }
-
- public function testReusesHandles()
- {
- Server::flush();
- $response = ['status' => 200];
- Server::enqueue([$response, $response]);
- $a = new CurlHandler();
- $request = [
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- ];
- $a($request);
- $a($request);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/CurlMultiHandlerTest.php b/lib/gerencianet/guzzlehttp/ringphp/tests/Client/CurlMultiHandlerTest.php
deleted file mode 100644
index 9228f1c..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/CurlMultiHandlerTest.php
+++ /dev/null
@@ -1,165 +0,0 @@
- 200]]);
- $a = new CurlMultiHandler();
- $response = $a([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- ]);
- $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response);
- $this->assertEquals(200, $response['status']);
- $this->assertArrayHasKey('transfer_stats', $response);
- $realUrl = trim($response['transfer_stats']['url'], '/');
- $this->assertEquals(trim(Server::$url, '/'), $realUrl);
- $this->assertArrayHasKey('effective_url', $response);
- $this->assertEquals(
- trim(Server::$url, '/'),
- trim($response['effective_url'], '/')
- );
- }
-
- public function testCreatesErrorResponses()
- {
- $url = 'http://localhost:123/';
- $a = new CurlMultiHandler();
- $response = $a([
- 'http_method' => 'GET',
- 'headers' => ['host' => ['localhost:123']],
- ]);
- $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response);
- $this->assertNull($response['status']);
- $this->assertNull($response['reason']);
- $this->assertEquals([], $response['headers']);
- $this->assertArrayHasKey('error', $response);
- $this->assertContains('cURL error ', $response['error']->getMessage());
- $this->assertArrayHasKey('transfer_stats', $response);
- $this->assertEquals(
- trim($url, '/'),
- trim($response['transfer_stats']['url'], '/')
- );
- $this->assertArrayHasKey('effective_url', $response);
- $this->assertEquals(
- trim($url, '/'),
- trim($response['effective_url'], '/')
- );
- }
-
- public function testSendsFuturesWhenDestructed()
- {
- Server::enqueue([['status' => 200]]);
- $a = new CurlMultiHandler();
- $response = $a([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- ]);
- $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response);
- $a->__destruct();
- $this->assertEquals(200, $response['status']);
- }
-
- public function testCanSetMaxHandles()
- {
- $a = new CurlMultiHandler(['max_handles' => 2]);
- $this->assertEquals(2, $this->readAttribute($a, 'maxHandles'));
- }
-
- public function testCanSetSelectTimeout()
- {
- $a = new CurlMultiHandler(['select_timeout' => 2]);
- $this->assertEquals(2, $this->readAttribute($a, 'selectTimeout'));
- }
-
- public function testSendsFuturesWhenMaxHandlesIsReached()
- {
- $request = [
- 'http_method' => 'PUT',
- 'headers' => ['host' => [Server::$host]],
- 'future' => 'lazy', // passing this to control the test
- ];
- $response = ['status' => 200];
- Server::flush();
- Server::enqueue([$response, $response, $response]);
- $a = new CurlMultiHandler(['max_handles' => 3]);
- for ($i = 0; $i < 5; $i++) {
- $responses[] = $a($request);
- }
- $this->assertCount(3, Server::received());
- $responses[3]->cancel();
- $responses[4]->cancel();
- }
-
- public function testCanCancel()
- {
- Server::flush();
- $response = ['status' => 200];
- Server::enqueue(array_fill_keys(range(0, 10), $response));
- $a = new CurlMultiHandler();
- $responses = [];
-
- for ($i = 0; $i < 10; $i++) {
- $response = $a([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'future' => 'lazy',
- ]);
- $response->cancel();
- $responses[] = $response;
- }
-
- $this->assertCount(0, Server::received());
-
- foreach ($responses as $response) {
- $this->assertTrue($this->readAttribute($response, 'isRealized'));
- }
- }
-
- public function testCannotCancelFinished()
- {
- Server::flush();
- Server::enqueue([['status' => 200]]);
- $a = new CurlMultiHandler();
- $response = $a([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- ]);
- $response->wait();
- $response->cancel();
- }
-
- public function testDelaysInParallel()
- {
- Server::flush();
- Server::enqueue([['status' => 200]]);
- $a = new CurlMultiHandler();
- $expected = microtime(true) + (100 / 1000);
- $response = $a([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'client' => ['delay' => 100],
- ]);
- $response->wait();
- $this->assertGreaterThanOrEqual($expected, microtime(true));
- }
-
- public function testSendsNonLazyFutures()
- {
- $request = [
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'future' => true,
- ];
- Server::flush();
- Server::enqueue([['status' => 202]]);
- $a = new CurlMultiHandler();
- $response = $a($request);
- $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response);
- $this->assertEquals(202, $response['status']);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/MiddlewareTest.php b/lib/gerencianet/guzzlehttp/ringphp/tests/Client/MiddlewareTest.php
deleted file mode 100644
index a47bb30..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/MiddlewareTest.php
+++ /dev/null
@@ -1,65 +0,0 @@
- 200]);
- $calledA = false;
- $a = function (array $req) use (&$calledA, $future) {
- $calledA = true;
- return $future;
- };
- $calledB = false;
- $b = function (array $req) use (&$calledB) { $calledB = true; };
- $s = Middleware::wrapFuture($a, $b);
- $s([]);
- $this->assertTrue($calledA);
- $this->assertFalse($calledB);
- }
-
- public function testFutureCallsStreamingHandler()
- {
- $future = new CompletedFutureArray(['status' => 200]);
- $calledA = false;
- $a = function (array $req) use (&$calledA) { $calledA = true; };
- $calledB = false;
- $b = function (array $req) use (&$calledB, $future) {
- $calledB = true;
- return $future;
- };
- $s = Middleware::wrapFuture($a, $b);
- $result = $s(['client' => ['future' => true]]);
- $this->assertFalse($calledA);
- $this->assertTrue($calledB);
- $this->assertSame($future, $result);
- }
-
- public function testStreamingCallsDefaultHandler()
- {
- $calledA = false;
- $a = function (array $req) use (&$calledA) { $calledA = true; };
- $calledB = false;
- $b = function (array $req) use (&$calledB) { $calledB = true; };
- $s = Middleware::wrapStreaming($a, $b);
- $s([]);
- $this->assertTrue($calledA);
- $this->assertFalse($calledB);
- }
-
- public function testStreamingCallsStreamingHandler()
- {
- $calledA = false;
- $a = function (array $req) use (&$calledA) { $calledA = true; };
- $calledB = false;
- $b = function (array $req) use (&$calledB) { $calledB = true; };
- $s = Middleware::wrapStreaming($a, $b);
- $s(['client' => ['stream' => true]]);
- $this->assertFalse($calledA);
- $this->assertTrue($calledB);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/MockHandlerTest.php b/lib/gerencianet/guzzlehttp/ringphp/tests/Client/MockHandlerTest.php
deleted file mode 100644
index 26bcd6c..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/MockHandlerTest.php
+++ /dev/null
@@ -1,86 +0,0 @@
- 200]);
- $response = $mock([]);
- $this->assertEquals(200, $response['status']);
- $this->assertEquals([], $response['headers']);
- $this->assertNull($response['body']);
- $this->assertNull($response['reason']);
- $this->assertNull($response['effective_url']);
- }
-
- public function testReturnsFutures()
- {
- $deferred = new Deferred();
- $future = new FutureArray(
- $deferred->promise(),
- function () use ($deferred) {
- $deferred->resolve(['status' => 200]);
- }
- );
- $mock = new MockHandler($future);
- $response = $mock([]);
- $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response);
- $this->assertEquals(200, $response['status']);
- }
-
- public function testReturnsFuturesWithThenCall()
- {
- $deferred = new Deferred();
- $future = new FutureArray(
- $deferred->promise(),
- function () use ($deferred) {
- $deferred->resolve(['status' => 200]);
- }
- );
- $mock = new MockHandler($future);
- $response = $mock([]);
- $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response);
- $this->assertEquals(200, $response['status']);
- $req = null;
- $promise = $response->then(function ($value) use (&$req) {
- $req = $value;
- $this->assertEquals(200, $req['status']);
- });
- $this->assertInstanceOf('React\Promise\PromiseInterface', $promise);
- $this->assertEquals(200, $req['status']);
- }
-
- public function testReturnsFuturesAndProxiesCancel()
- {
- $c = null;
- $deferred = new Deferred();
- $future = new FutureArray(
- $deferred->promise(),
- function () {},
- function () use (&$c) {
- $c = true;
- return true;
- }
- );
- $mock = new MockHandler($future);
- $response = $mock([]);
- $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response);
- $response->cancel();
- $this->assertTrue($c);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Response must be an array or FutureArrayInterface. Found
- */
- public function testEnsuresMockIsValid()
- {
- $mock = new MockHandler('foo');
- $mock([]);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/Server.php b/lib/gerencianet/guzzlehttp/ringphp/tests/Client/Server.php
deleted file mode 100644
index 14665a5..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/Server.php
+++ /dev/null
@@ -1,183 +0,0 @@
- [], 'reason' => '', 'body' => ''];
- $data[] = $response;
- }
-
- self::send('PUT', '/guzzle-server/responses', json_encode($data));
- }
-
- /**
- * Get all of the received requests as a RingPHP request structure.
- *
- * @return array
- * @throws \RuntimeException
- */
- public static function received()
- {
- if (!self::$started) {
- return [];
- }
-
- $response = self::send('GET', '/guzzle-server/requests');
- $body = Core::body($response);
- $result = json_decode($body, true);
- if ($result === false) {
- throw new \RuntimeException('Error decoding response: '
- . json_last_error());
- }
-
- foreach ($result as &$res) {
- if (isset($res['uri'])) {
- $res['resource'] = $res['uri'];
- }
- if (isset($res['query_string'])) {
- $res['resource'] .= '?' . $res['query_string'];
- }
- if (!isset($res['resource'])) {
- $res['resource'] = '';
- }
- // Ensure that headers are all arrays
- if (isset($res['headers'])) {
- foreach ($res['headers'] as &$h) {
- $h = (array) $h;
- }
- unset($h);
- }
- }
-
- unset($res);
- return $result;
- }
-
- /**
- * Stop running the node.js server
- */
- public static function stop()
- {
- if (self::$started) {
- self::send('DELETE', '/guzzle-server');
- }
-
- self::$started = false;
- }
-
- public static function wait($maxTries = 20)
- {
- $tries = 0;
- while (!self::isListening() && ++$tries < $maxTries) {
- usleep(100000);
- }
-
- if (!self::isListening()) {
- throw new \RuntimeException('Unable to contact node.js server');
- }
- }
-
- public static function start()
- {
- if (self::$started) {
- return;
- }
-
- try {
- self::wait();
- } catch (\Exception $e) {
- exec('node ' . __DIR__ . \DIRECTORY_SEPARATOR . 'server.js '
- . self::$port . ' >> /tmp/server.log 2>&1 &');
- self::wait();
- }
-
- self::$started = true;
- }
-
- private static function isListening()
- {
- $response = self::send('GET', '/guzzle-server/perf', null, [
- 'connect_timeout' => 1,
- 'timeout' => 1
- ]);
-
- return !isset($response['error']);
- }
-
- private static function send(
- $method,
- $path,
- $body = null,
- array $client = []
- ) {
- $handler = new StreamHandler();
-
- $request = [
- 'http_method' => $method,
- 'uri' => $path,
- 'request_port' => 8125,
- 'headers' => ['host' => ['127.0.0.1:8125']],
- 'body' => $body,
- 'client' => $client,
- ];
-
- if ($body) {
- $request['headers']['content-length'] = [strlen($body)];
- }
-
- return $handler($request);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/StreamHandlerTest.php b/lib/gerencianet/guzzlehttp/ringphp/tests/Client/StreamHandlerTest.php
deleted file mode 100644
index 3cb9a8e..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/StreamHandlerTest.php
+++ /dev/null
@@ -1,480 +0,0 @@
-queueRes();
- $handler = new StreamHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'uri' => '/',
- 'headers' => [
- 'host' => [Server::$host],
- 'Foo' => ['Bar'],
- ],
- ]);
-
- $this->assertEquals('1.1', $response['version']);
- $this->assertEquals(200, $response['status']);
- $this->assertEquals('OK', $response['reason']);
- $this->assertEquals(['Bar'], $response['headers']['Foo']);
- $this->assertEquals(['8'], $response['headers']['Content-Length']);
- $this->assertEquals('hi there', Core::body($response));
-
- $sent = Server::received()[0];
- $this->assertEquals('GET', $sent['http_method']);
- $this->assertEquals('/', $sent['resource']);
- $this->assertEquals(['127.0.0.1:8125'], $sent['headers']['host']);
- $this->assertEquals('Bar', Core::header($sent, 'foo'));
- }
-
- public function testAddsErrorToResponse()
- {
- $handler = new StreamHandler();
- $result = $handler([
- 'http_method' => 'GET',
- 'headers' => ['host' => ['localhost:123']],
- 'client' => ['timeout' => 0.01],
- ]);
- $this->assertInstanceOf(
- 'GuzzleHttp\Ring\Future\CompletedFutureArray',
- $result
- );
- $this->assertNull($result['status']);
- $this->assertNull($result['body']);
- $this->assertEquals([], $result['headers']);
- $this->assertInstanceOf(
- 'GuzzleHttp\Ring\Exception\RingException',
- $result['error']
- );
- }
-
- public function testEnsuresTheHttpProtocol()
- {
- $handler = new StreamHandler();
- $result = $handler([
- 'http_method' => 'GET',
- 'url' => 'ftp://localhost:123',
- ]);
- $this->assertArrayHasKey('error', $result);
- $this->assertContains(
- 'URL is invalid: ftp://localhost:123',
- $result['error']->getMessage()
- );
- }
-
- public function testStreamAttributeKeepsStreamOpen()
- {
- $this->queueRes();
- $handler = new StreamHandler();
- $response = $handler([
- 'http_method' => 'PUT',
- 'uri' => '/foo',
- 'query_string' => 'baz=bar',
- 'headers' => [
- 'host' => [Server::$host],
- 'Foo' => ['Bar'],
- ],
- 'body' => 'test',
- 'client' => ['stream' => true],
- ]);
-
- $this->assertEquals(200, $response['status']);
- $this->assertEquals('OK', $response['reason']);
- $this->assertEquals('8', Core::header($response, 'Content-Length'));
- $body = $response['body'];
- $this->assertTrue(is_resource($body));
- $this->assertEquals('http', stream_get_meta_data($body)['wrapper_type']);
- $this->assertEquals('hi there', stream_get_contents($body));
- fclose($body);
- $sent = Server::received()[0];
- $this->assertEquals('PUT', $sent['http_method']);
- $this->assertEquals('/foo', $sent['uri']);
- $this->assertEquals('baz=bar', $sent['query_string']);
- $this->assertEquals('/foo?baz=bar', $sent['resource']);
- $this->assertEquals('127.0.0.1:8125', Core::header($sent, 'host'));
- $this->assertEquals('Bar', Core::header($sent, 'foo'));
- }
-
- public function testDrainsResponseIntoTempStream()
- {
- $this->queueRes();
- $handler = new StreamHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'uri' => '/',
- 'headers' => ['host' => [Server::$host]],
- ]);
- $body = $response['body'];
- $this->assertEquals('php://temp', stream_get_meta_data($body)['uri']);
- $this->assertEquals('hi', fread($body, 2));
- fclose($body);
- }
-
- public function testDrainsResponseIntoSaveToBody()
- {
- $r = fopen('php://temp', 'r+');
- $this->queueRes();
- $handler = new StreamHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'uri' => '/',
- 'headers' => ['host' => [Server::$host]],
- 'client' => ['save_to' => $r],
- ]);
- $body = $response['body'];
- $this->assertEquals('php://temp', stream_get_meta_data($body)['uri']);
- $this->assertEquals('hi', fread($body, 2));
- $this->assertEquals(' there', stream_get_contents($r));
- fclose($r);
- }
-
- public function testDrainsResponseIntoSaveToBodyAtPath()
- {
- $tmpfname = tempnam('/tmp', 'save_to_path');
- $this->queueRes();
- $handler = new StreamHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'uri' => '/',
- 'headers' => ['host' => [Server::$host]],
- 'client' => ['save_to' => $tmpfname],
- ]);
- $body = $response['body'];
- $this->assertInstanceOf('GuzzleHttp\Stream\StreamInterface', $body);
- $this->assertEquals($tmpfname, $body->getMetadata('uri'));
- $this->assertEquals('hi', $body->read(2));
- $body->close();
- unlink($tmpfname);
- }
-
- public function testAutomaticallyDecompressGzip()
- {
- Server::flush();
- $content = gzencode('test');
- Server::enqueue([
- [
- 'status' => 200,
- 'reason' => 'OK',
- 'headers' => [
- 'Content-Encoding' => ['gzip'],
- 'Content-Length' => [strlen($content)],
- ],
- 'body' => $content,
- ],
- ]);
-
- $handler = new StreamHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'uri' => '/',
- 'client' => ['decode_content' => true],
- ]);
- $this->assertEquals('test', Core::body($response));
- }
-
- public function testDoesNotForceGzipDecode()
- {
- Server::flush();
- $content = gzencode('test');
- Server::enqueue([
- [
- 'status' => 200,
- 'reason' => 'OK',
- 'headers' => [
- 'Content-Encoding' => ['gzip'],
- 'Content-Length' => [strlen($content)],
- ],
- 'body' => $content,
- ],
- ]);
-
- $handler = new StreamHandler();
- $response = $handler([
- 'http_method' => 'GET',
- 'headers' => ['host' => [Server::$host]],
- 'uri' => '/',
- 'client' => ['stream' => true, 'decode_content' => false],
- ]);
- $this->assertSame($content, Core::body($response));
- }
-
- public function testProtocolVersion()
- {
- $this->queueRes();
- $handler = new StreamHandler();
- $handler([
- 'http_method' => 'GET',
- 'uri' => '/',
- 'headers' => ['host' => [Server::$host]],
- 'version' => 1.0,
- ]);
-
- $this->assertEquals(1.0, Server::received()[0]['version']);
- }
-
- protected function getSendResult(array $opts)
- {
- $this->queueRes();
- $handler = new StreamHandler();
- $opts['stream'] = true;
- return $handler([
- 'http_method' => 'GET',
- 'uri' => '/',
- 'headers' => ['host' => [Server::$host]],
- 'client' => $opts,
- ]);
- }
-
- public function testAddsProxy()
- {
- $res = $this->getSendResult(['stream' => true, 'proxy' => '127.0.0.1:8125']);
- $opts = stream_context_get_options($res['body']);
- $this->assertEquals('127.0.0.1:8125', $opts['http']['proxy']);
- }
-
- public function testAddsTimeout()
- {
- $res = $this->getSendResult(['stream' => true, 'timeout' => 200]);
- $opts = stream_context_get_options($res['body']);
- $this->assertEquals(200, $opts['http']['timeout']);
- }
-
- public function testVerifiesVerifyIsValidIfPath()
- {
- $res = $this->getSendResult(['verify' => '/does/not/exist']);
- $this->assertContains(
- 'SSL CA bundle not found: /does/not/exist',
- (string) $res['error']
- );
- }
-
- public function testVerifyCanBeDisabled()
- {
- $res = $this->getSendResult(['verify' => false]);
- $this->assertArrayNotHasKey('error', $res);
- }
-
- public function testVerifiesCertIfValidPath()
- {
- $res = $this->getSendResult(['cert' => '/does/not/exist']);
- $this->assertContains(
- 'SSL certificate not found: /does/not/exist',
- (string) $res['error']
- );
- }
-
- public function testVerifyCanBeSetToPath()
- {
- $path = $path = ClientUtils::getDefaultCaBundle();
- $res = $this->getSendResult(['verify' => $path]);
- $this->assertArrayNotHasKey('error', $res);
- $opts = stream_context_get_options($res['body']);
- $this->assertEquals(true, $opts['ssl']['verify_peer']);
- $this->assertEquals($path, $opts['ssl']['cafile']);
- $this->assertTrue(file_exists($opts['ssl']['cafile']));
- }
-
- public function testUsesSystemDefaultBundle()
- {
- $path = $path = ClientUtils::getDefaultCaBundle();
- $res = $this->getSendResult(['verify' => true]);
- $this->assertArrayNotHasKey('error', $res);
- $opts = stream_context_get_options($res['body']);
- if (PHP_VERSION_ID < 50600) {
- $this->assertEquals($path, $opts['ssl']['cafile']);
- }
- }
-
- public function testEnsuresVerifyOptionIsValid()
- {
- $res = $this->getSendResult(['verify' => 10]);
- $this->assertContains(
- 'Invalid verify request option',
- (string) $res['error']
- );
- }
-
- public function testCanSetPasswordWhenSettingCert()
- {
- $path = __FILE__;
- $res = $this->getSendResult(['cert' => [$path, 'foo']]);
- $opts = stream_context_get_options($res['body']);
- $this->assertEquals($path, $opts['ssl']['local_cert']);
- $this->assertEquals('foo', $opts['ssl']['passphrase']);
- }
-
- public function testDebugAttributeWritesToStream()
- {
- $this->queueRes();
- $f = fopen('php://temp', 'w+');
- $this->getSendResult(['debug' => $f]);
- fseek($f, 0);
- $contents = stream_get_contents($f);
- $this->assertContains(' [CONNECT]', $contents);
- $this->assertContains(' [FILE_SIZE_IS]', $contents);
- $this->assertContains(' [PROGRESS]', $contents);
- }
-
- public function testDebugAttributeWritesStreamInfoToBuffer()
- {
- $called = false;
- $this->queueRes();
- $buffer = fopen('php://temp', 'r+');
- $this->getSendResult([
- 'progress' => function () use (&$called) { $called = true; },
- 'debug' => $buffer,
- ]);
- fseek($buffer, 0);
- $contents = stream_get_contents($buffer);
- $this->assertContains(' [CONNECT]', $contents);
- $this->assertContains(' [FILE_SIZE_IS] message: "Content-Length: 8"', $contents);
- $this->assertContains(' [PROGRESS] bytes_max: "8"', $contents);
- $this->assertTrue($called);
- }
-
- public function testEmitsProgressInformation()
- {
- $called = [];
- $this->queueRes();
- $this->getSendResult([
- 'progress' => function () use (&$called) {
- $called[] = func_get_args();
- },
- ]);
- $this->assertNotEmpty($called);
- $this->assertEquals(8, $called[0][0]);
- $this->assertEquals(0, $called[0][1]);
- }
-
- public function testEmitsProgressInformationAndDebugInformation()
- {
- $called = [];
- $this->queueRes();
- $buffer = fopen('php://memory', 'w+');
- $this->getSendResult([
- 'debug' => $buffer,
- 'progress' => function () use (&$called) {
- $called[] = func_get_args();
- },
- ]);
- $this->assertNotEmpty($called);
- $this->assertEquals(8, $called[0][0]);
- $this->assertEquals(0, $called[0][1]);
- rewind($buffer);
- $this->assertNotEmpty(stream_get_contents($buffer));
- fclose($buffer);
- }
-
- public function testAddsProxyByProtocol()
- {
- $url = str_replace('http', 'tcp', Server::$url);
- $res = $this->getSendResult(['proxy' => ['http' => $url]]);
- $opts = stream_context_get_options($res['body']);
- $this->assertEquals($url, $opts['http']['proxy']);
- }
-
- public function testPerformsShallowMergeOfCustomContextOptions()
- {
- $res = $this->getSendResult([
- 'stream_context' => [
- 'http' => [
- 'request_fulluri' => true,
- 'method' => 'HEAD',
- ],
- 'socket' => [
- 'bindto' => '127.0.0.1:0',
- ],
- 'ssl' => [
- 'verify_peer' => false,
- ],
- ],
- ]);
-
- $opts = stream_context_get_options($res['body']);
- $this->assertEquals('HEAD', $opts['http']['method']);
- $this->assertTrue($opts['http']['request_fulluri']);
- $this->assertFalse($opts['ssl']['verify_peer']);
- $this->assertEquals('127.0.0.1:0', $opts['socket']['bindto']);
- }
-
- public function testEnsuresThatStreamContextIsAnArray()
- {
- $res = $this->getSendResult(['stream_context' => 'foo']);
- $this->assertContains(
- 'stream_context must be an array',
- (string) $res['error']
- );
- }
-
- public function testDoesNotAddContentTypeByDefault()
- {
- $this->queueRes();
- $handler = new StreamHandler();
- $handler([
- 'http_method' => 'PUT',
- 'uri' => '/',
- 'headers' => ['host' => [Server::$host], 'content-length' => [3]],
- 'body' => 'foo',
- ]);
- $req = Server::received()[0];
- $this->assertEquals('', Core::header($req, 'Content-Type'));
- $this->assertEquals(3, Core::header($req, 'Content-Length'));
- }
-
- private function queueRes()
- {
- Server::flush();
- Server::enqueue([
- [
- 'status' => 200,
- 'reason' => 'OK',
- 'headers' => [
- 'Foo' => ['Bar'],
- 'Content-Length' => [8],
- ],
- 'body' => 'hi there',
- ],
- ]);
- }
-
- public function testSupports100Continue()
- {
- Server::flush();
- Server::enqueue([
- [
- 'status' => '200',
- 'reason' => 'OK',
- 'headers' => [
- 'Test' => ['Hello'],
- 'Content-Length' => ['4'],
- ],
- 'body' => 'test',
- ],
- ]);
-
- $request = [
- 'http_method' => 'PUT',
- 'headers' => [
- 'Host' => [Server::$host],
- 'Expect' => ['100-Continue'],
- ],
- 'body' => 'test',
- ];
-
- $handler = new StreamHandler();
- $response = $handler($request);
- $this->assertEquals(200, $response['status']);
- $this->assertEquals('OK', $response['reason']);
- $this->assertEquals(['Hello'], $response['headers']['Test']);
- $this->assertEquals(['4'], $response['headers']['Content-Length']);
- $this->assertEquals('test', Core::body($response));
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/server.js b/lib/gerencianet/guzzlehttp/ringphp/tests/Client/server.js
deleted file mode 100644
index 6a03e33..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/tests/Client/server.js
+++ /dev/null
@@ -1,241 +0,0 @@
-/**
- * Guzzle node.js test server to return queued responses to HTTP requests and
- * expose a RESTful API for enqueueing responses and retrieving the requests
- * that have been received.
- *
- * - Delete all requests that have been received:
- * > DELETE /guzzle-server/requests
- * > Host: 127.0.0.1:8125
- *
- * - Enqueue responses
- * > PUT /guzzle-server/responses
- * > Host: 127.0.0.1:8125
- * >
- * > [{'status': 200, 'reason': 'OK', 'headers': {}, 'body': '' }]
- *
- * - Get the received requests
- * > GET /guzzle-server/requests
- * > Host: 127.0.0.1:8125
- *
- * < HTTP/1.1 200 OK
- * <
- * < [{'http_method': 'GET', 'uri': '/', 'headers': {}, 'body': 'string'}]
- *
- * - Attempt access to the secure area
- * > GET /secure/by-digest/qop-auth/guzzle-server/requests
- * > Host: 127.0.0.1:8125
- *
- * < HTTP/1.1 401 Unauthorized
- * < WWW-Authenticate: Digest realm="Digest Test", qop="auth", nonce="0796e98e1aeef43141fab2a66bf4521a", algorithm="MD5", stale="false"
- * <
- * < 401 Unauthorized
- *
- * - Shutdown the server
- * > DELETE /guzzle-server
- * > Host: 127.0.0.1:8125
- *
- * @package Guzzle PHP
- * @license See the LICENSE file that was distributed with this source code.
- */
-
-var http = require('http');
-var url = require('url');
-
-/**
- * Guzzle node.js server
- * @class
- */
-var GuzzleServer = function(port, log) {
-
- this.port = port;
- this.log = log;
- this.responses = [];
- this.requests = [];
- var that = this;
-
- var md5 = function(input) {
- var crypto = require('crypto');
- var hasher = crypto.createHash('md5');
- hasher.update(input);
- return hasher.digest('hex');
- }
-
- /**
- * Node.js HTTP server authentication module.
- *
- * It is only initialized on demand (by loadAuthentifier). This avoids
- * requiring the dependency to http-auth on standard operations, and the
- * performance hit at startup.
- */
- var auth;
-
- /**
- * Provides authentication handlers (Basic, Digest).
- */
- var loadAuthentifier = function(type, options) {
- var typeId = type;
- if (type == 'digest') {
- typeId += '.'+(options && options.qop ? options.qop : 'none');
- }
- if (!loadAuthentifier[typeId]) {
- if (!auth) {
- try {
- auth = require('http-auth');
- } catch (e) {
- if (e.code == 'MODULE_NOT_FOUND') {
- return;
- }
- }
- }
- switch (type) {
- case 'digest':
- var digestParams = {
- realm: 'Digest Test',
- login: 'me',
- password: 'test'
- };
- if (options && options.qop) {
- digestParams.qop = options.qop;
- }
- loadAuthentifier[typeId] = auth.digest(digestParams, function(username, callback) {
- callback(md5(digestParams.login + ':' + digestParams.realm + ':' + digestParams.password));
- });
- break
- }
- }
- return loadAuthentifier[typeId];
- };
-
- var firewallRequest = function(request, req, res, requestHandlerCallback) {
- var securedAreaUriParts = request.uri.match(/^\/secure\/by-(digest)(\/qop-([^\/]*))?(\/.*)$/);
- if (securedAreaUriParts) {
- var authentifier = loadAuthentifier(securedAreaUriParts[1], { qop: securedAreaUriParts[2] });
- if (!authentifier) {
- res.writeHead(501, 'HTTP authentication not implemented', { 'Content-Length': 0 });
- res.end();
- return;
- }
- authentifier.check(req, res, function(req, res) {
- req.url = securedAreaUriParts[4];
- requestHandlerCallback(request, req, res);
- });
- } else {
- requestHandlerCallback(request, req, res);
- }
- };
-
- var controlRequest = function(request, req, res) {
- if (req.url == '/guzzle-server/perf') {
- res.writeHead(200, 'OK', {'Content-Length': 16});
- res.end('Body of response');
- } else if (req.method == 'DELETE') {
- if (req.url == '/guzzle-server/requests') {
- // Clear the received requests
- that.requests = [];
- res.writeHead(200, 'OK', { 'Content-Length': 0 });
- res.end();
- if (that.log) {
- console.log('Flushing requests');
- }
- } else if (req.url == '/guzzle-server') {
- // Shutdown the server
- res.writeHead(200, 'OK', { 'Content-Length': 0, 'Connection': 'close' });
- res.end();
- if (that.log) {
- console.log('Shutting down');
- }
- that.server.close();
- }
- } else if (req.method == 'GET') {
- if (req.url === '/guzzle-server/requests') {
- if (that.log) {
- console.log('Sending received requests');
- }
- // Get received requests
- var body = JSON.stringify(that.requests);
- res.writeHead(200, 'OK', { 'Content-Length': body.length });
- res.end(body);
- }
- } else if (req.method == 'PUT' && req.url == '/guzzle-server/responses') {
- if (that.log) {
- console.log('Adding responses...');
- }
- if (!request.body) {
- if (that.log) {
- console.log('No response data was provided');
- }
- res.writeHead(400, 'NO RESPONSES IN REQUEST', { 'Content-Length': 0 });
- } else {
- that.responses = eval('(' + request.body + ')');
- for (var i = 0; i < that.responses.length; i++) {
- if (that.responses[i].body) {
- that.responses[i].body = new Buffer(that.responses[i].body, 'base64');
- }
- }
- if (that.log) {
- console.log(that.responses);
- }
- res.writeHead(200, 'OK', { 'Content-Length': 0 });
- }
- res.end();
- }
- };
-
- var receivedRequest = function(request, req, res) {
- if (req.url.indexOf('/guzzle-server') === 0) {
- controlRequest(request, req, res);
- } else if (req.url.indexOf('/guzzle-server') == -1 && !that.responses.length) {
- res.writeHead(500);
- res.end('No responses in queue');
- } else {
- if (that.log) {
- console.log('Returning response from queue and adding request');
- }
- that.requests.push(request);
- var response = that.responses.shift();
- res.writeHead(response.status, response.reason, response.headers);
- res.end(response.body);
- }
- };
-
- this.start = function() {
-
- that.server = http.createServer(function(req, res) {
-
- var parts = url.parse(req.url, false);
- var request = {
- http_method: req.method,
- scheme: parts.scheme,
- uri: parts.pathname,
- query_string: parts.query,
- headers: req.headers,
- version: req.httpVersion,
- body: ''
- };
-
- // Receive each chunk of the request body
- req.addListener('data', function(chunk) {
- request.body += chunk;
- });
-
- // Called when the request completes
- req.addListener('end', function() {
- firewallRequest(request, req, res, receivedRequest);
- });
- });
-
- that.server.listen(this.port, '127.0.0.1');
-
- if (this.log) {
- console.log('Server running at http://127.0.0.1:8125/');
- }
- };
-};
-
-// Get the port from the arguments
-port = process.argv.length >= 3 ? process.argv[2] : 8125;
-log = process.argv.length >= 4 ? process.argv[3] : false;
-
-// Start the server
-server = new GuzzleServer(port, log);
-server.start();
diff --git a/lib/gerencianet/guzzlehttp/ringphp/tests/CoreTest.php b/lib/gerencianet/guzzlehttp/ringphp/tests/CoreTest.php
deleted file mode 100644
index 49522f2..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/tests/CoreTest.php
+++ /dev/null
@@ -1,336 +0,0 @@
-assertNull(Core::header([], 'Foo'));
- $this->assertNull(Core::firstHeader([], 'Foo'));
- }
-
- public function testChecksIfHasHeader()
- {
- $message = [
- 'headers' => [
- 'Foo' => ['Bar', 'Baz'],
- 'foo' => ['hello'],
- 'bar' => ['1']
- ]
- ];
- $this->assertTrue(Core::hasHeader($message, 'Foo'));
- $this->assertTrue(Core::hasHeader($message, 'foo'));
- $this->assertTrue(Core::hasHeader($message, 'FoO'));
- $this->assertTrue(Core::hasHeader($message, 'bar'));
- $this->assertFalse(Core::hasHeader($message, 'barr'));
- }
-
- public function testReturnsFirstHeaderWhenSimple()
- {
- $this->assertEquals('Bar', Core::firstHeader([
- 'headers' => ['Foo' => ['Bar', 'Baz']],
- ], 'Foo'));
- }
-
- public function testReturnsFirstHeaderWhenMultiplePerLine()
- {
- $this->assertEquals('Bar', Core::firstHeader([
- 'headers' => ['Foo' => ['Bar, Baz']],
- ], 'Foo'));
- }
-
- public function testExtractsCaseInsensitiveHeader()
- {
- $this->assertEquals(
- 'hello',
- Core::header(['headers' => ['foo' => ['hello']]], 'FoO')
- );
- }
-
- public function testExtractsCaseInsensitiveHeaderLines()
- {
- $this->assertEquals(
- ['a', 'b', 'c', 'd'],
- Core::headerLines([
- 'headers' => [
- 'foo' => ['a', 'b'],
- 'Foo' => ['c', 'd']
- ]
- ], 'foo')
- );
- }
-
- public function testExtractsHeaderLines()
- {
- $this->assertEquals(
- ['bar', 'baz'],
- Core::headerLines([
- 'headers' => [
- 'Foo' => ['bar', 'baz'],
- ],
- ], 'Foo')
- );
- }
-
- public function testExtractsHeaderAsString()
- {
- $this->assertEquals(
- 'bar, baz',
- Core::header([
- 'headers' => [
- 'Foo' => ['bar', 'baz'],
- ],
- ], 'Foo', true)
- );
- }
-
- public function testReturnsNullWhenHeaderNotFound()
- {
- $this->assertNull(Core::header(['headers' => []], 'Foo'));
- }
-
- public function testRemovesHeaders()
- {
- $message = [
- 'headers' => [
- 'foo' => ['bar'],
- 'Foo' => ['bam'],
- 'baz' => ['123'],
- ],
- ];
-
- $this->assertSame($message, Core::removeHeader($message, 'bam'));
- $this->assertEquals([
- 'headers' => ['baz' => ['123']],
- ], Core::removeHeader($message, 'foo'));
- }
-
- public function testCreatesUrl()
- {
- $req = [
- 'scheme' => 'http',
- 'headers' => ['host' => ['foo.com']],
- 'uri' => '/',
- ];
-
- $this->assertEquals('http://foo.com/', Core::url($req));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage No Host header was provided
- */
- public function testEnsuresHostIsAvailableWhenCreatingUrls()
- {
- Core::url([]);
- }
-
- public function testCreatesUrlWithQueryString()
- {
- $req = [
- 'scheme' => 'http',
- 'headers' => ['host' => ['foo.com']],
- 'uri' => '/',
- 'query_string' => 'foo=baz',
- ];
-
- $this->assertEquals('http://foo.com/?foo=baz', Core::url($req));
- }
-
- public function testUsesUrlIfSet()
- {
- $req = ['url' => 'http://foo.com'];
- $this->assertEquals('http://foo.com', Core::url($req));
- }
-
- public function testReturnsNullWhenNoBody()
- {
- $this->assertNull(Core::body([]));
- }
-
- public function testReturnsStreamAsString()
- {
- $this->assertEquals(
- 'foo',
- Core::body(['body' => Stream::factory('foo')])
- );
- }
-
- public function testReturnsString()
- {
- $this->assertEquals('foo', Core::body(['body' => 'foo']));
- }
-
- public function testReturnsResourceContent()
- {
- $r = fopen('php://memory', 'w+');
- fwrite($r, 'foo');
- rewind($r);
- $this->assertEquals('foo', Core::body(['body' => $r]));
- fclose($r);
- }
-
- public function testReturnsIteratorContent()
- {
- $a = new \ArrayIterator(['a', 'b', 'cd', '']);
- $this->assertEquals('abcd', Core::body(['body' => $a]));
- }
-
- public function testReturnsObjectToString()
- {
- $this->assertEquals('foo', Core::body(['body' => new StrClass]));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testEnsuresBodyIsValid()
- {
- Core::body(['body' => false]);
- }
-
- public function testParsesHeadersFromLines()
- {
- $lines = ['Foo: bar', 'Foo: baz', 'Abc: 123', 'Def: a, b'];
- $this->assertEquals([
- 'Foo' => ['bar', 'baz'],
- 'Abc' => ['123'],
- 'Def' => ['a, b'],
- ], Core::headersFromLines($lines));
- }
-
- public function testParsesHeadersFromLinesWithMultipleLines()
- {
- $lines = ['Foo: bar', 'Foo: baz', 'Foo: 123'];
- $this->assertEquals([
- 'Foo' => ['bar', 'baz', '123'],
- ], Core::headersFromLines($lines));
- }
-
- public function testCreatesArrayCallFunctions()
- {
- $called = [];
- $a = function ($a, $b) use (&$called) {
- $called['a'] = func_get_args();
- };
- $b = function ($a, $b) use (&$called) {
- $called['b'] = func_get_args();
- };
- $c = Core::callArray([$a, $b]);
- $c(1, 2);
- $this->assertEquals([1, 2], $called['a']);
- $this->assertEquals([1, 2], $called['b']);
- }
-
- public function testRewindsGuzzleStreams()
- {
- $str = Stream::factory('foo');
- $this->assertTrue(Core::rewindBody(['body' => $str]));
- }
-
- public function testRewindsStreams()
- {
- $str = Stream::factory('foo')->detach();
- $this->assertTrue(Core::rewindBody(['body' => $str]));
- }
-
- public function testRewindsIterators()
- {
- $iter = new \ArrayIterator(['foo']);
- $this->assertTrue(Core::rewindBody(['body' => $iter]));
- }
-
- public function testRewindsStrings()
- {
- $this->assertTrue(Core::rewindBody(['body' => 'hi']));
- }
-
- public function testRewindsToStrings()
- {
- $this->assertTrue(Core::rewindBody(['body' => new StrClass()]));
- }
-
- public function typeProvider()
- {
- return [
- ['foo', 'string(3) "foo"'],
- [true, 'bool(true)'],
- [false, 'bool(false)'],
- [10, 'int(10)'],
- [1.0, 'float(1)'],
- [new StrClass(), 'object(GuzzleHttp\Tests\Ring\StrClass)'],
- [['foo'], 'array(1)']
- ];
- }
-
- /**
- * @dataProvider typeProvider
- */
- public function testDescribesType($input, $output)
- {
- $this->assertEquals($output, Core::describeType($input));
- }
-
- public function testDoesSleep()
- {
- $t = microtime(true);
- $expected = $t + (100 / 1000);
- Core::doSleep(['client' => ['delay' => 100]]);
- $this->assertGreaterThanOrEqual($expected, microtime(true));
- }
-
- public function testProxiesFuture()
- {
- $f = new CompletedFutureArray(['status' => 200]);
- $res = null;
- $proxied = Core::proxy($f, function ($value) use (&$res) {
- $value['foo'] = 'bar';
- $res = $value;
- return $value;
- });
- $this->assertNotSame($f, $proxied);
- $this->assertEquals(200, $f->wait()['status']);
- $this->assertArrayNotHasKey('foo', $f->wait());
- $this->assertEquals('bar', $proxied->wait()['foo']);
- $this->assertEquals(200, $proxied->wait()['status']);
- }
-
- public function testProxiesDeferredFuture()
- {
- $d = new Deferred();
- $f = new FutureArray($d->promise());
- $f2 = Core::proxy($f);
- $d->resolve(['foo' => 'bar']);
- $this->assertEquals('bar', $f['foo']);
- $this->assertEquals('bar', $f2['foo']);
- }
-
- public function testProxiesDeferredFutureFailure()
- {
- $d = new Deferred();
- $f = new FutureArray($d->promise());
- $f2 = Core::proxy($f);
- $d->reject(new \Exception('foo'));
- try {
- $f2['hello?'];
- $this->fail('did not throw');
- } catch (\Exception $e) {
- $this->assertEquals('foo', $e->getMessage());
- }
-
- }
-}
-
-final class StrClass
-{
- public function __toString()
- {
- return 'foo';
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/tests/Future/CompletedFutureArrayTest.php b/lib/gerencianet/guzzlehttp/ringphp/tests/Future/CompletedFutureArrayTest.php
deleted file mode 100644
index 82d7efb..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/tests/Future/CompletedFutureArrayTest.php
+++ /dev/null
@@ -1,21 +0,0 @@
- 'bar']);
- $this->assertEquals('bar', $f['foo']);
- $this->assertFalse(isset($f['baz']));
- $f['abc'] = '123';
- $this->assertTrue(isset($f['abc']));
- $this->assertEquals(['foo' => 'bar', 'abc' => '123'], iterator_to_array($f));
- $this->assertEquals(2, count($f));
- unset($f['abc']);
- $this->assertEquals(1, count($f));
- $this->assertEquals(['foo' => 'bar'], iterator_to_array($f));
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/tests/Future/CompletedFutureValueTest.php b/lib/gerencianet/guzzlehttp/ringphp/tests/Future/CompletedFutureValueTest.php
deleted file mode 100644
index 6ded40d..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/tests/Future/CompletedFutureValueTest.php
+++ /dev/null
@@ -1,46 +0,0 @@
-assertEquals('hi', $f->wait());
- $f->cancel();
-
- $a = null;
- $f->then(function ($v) use (&$a) {
- $a = $v;
- });
- $this->assertSame('hi', $a);
- }
-
- public function testThrows()
- {
- $ex = new \Exception('foo');
- $f = new CompletedFutureValue(null, $ex);
- $f->cancel();
- try {
- $f->wait();
- $this->fail('did not throw');
- } catch (\Exception $e) {
- $this->assertSame($e, $ex);
- }
- }
-
- public function testMarksAsCancelled()
- {
- $ex = new CancelledFutureAccessException();
- $f = new CompletedFutureValue(null, $ex);
- try {
- $f->wait();
- $this->fail('did not throw');
- } catch (\Exception $e) {
- $this->assertSame($e, $ex);
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/tests/Future/FutureArrayTest.php b/lib/gerencianet/guzzlehttp/ringphp/tests/Future/FutureArrayTest.php
deleted file mode 100644
index 0e09f5a..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/tests/Future/FutureArrayTest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-promise(),
- function () use (&$c, $deferred) {
- $c = true;
- $deferred->resolve(['status' => 200]);
- }
- );
- $this->assertFalse($c);
- $this->assertFalse($this->readAttribute($f, 'isRealized'));
- $this->assertEquals(200, $f['status']);
- $this->assertTrue($c);
- }
-
- public function testActsLikeArray()
- {
- $deferred = new Deferred();
- $f = new FutureArray(
- $deferred->promise(),
- function () use (&$c, $deferred) {
- $deferred->resolve(['status' => 200]);
- }
- );
-
- $this->assertTrue(isset($f['status']));
- $this->assertEquals(200, $f['status']);
- $this->assertEquals(['status' => 200], $f->wait());
- $this->assertEquals(1, count($f));
- $f['baz'] = 10;
- $this->assertEquals(10, $f['baz']);
- unset($f['baz']);
- $this->assertFalse(isset($f['baz']));
- $this->assertEquals(['status' => 200], iterator_to_array($f));
- }
-
- /**
- * @expectedException \RuntimeException
- */
- public function testThrowsWhenAccessingInvalidProperty()
- {
- $deferred = new Deferred();
- $f = new FutureArray($deferred->promise(), function () {});
- $f->foo;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/tests/Future/FutureValueTest.php b/lib/gerencianet/guzzlehttp/ringphp/tests/Future/FutureValueTest.php
deleted file mode 100644
index d59c543..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/tests/Future/FutureValueTest.php
+++ /dev/null
@@ -1,109 +0,0 @@
-promise(),
- function () use ($deferred, &$called) {
- $called++;
- $deferred->resolve('foo');
- }
- );
-
- $this->assertEquals('foo', $f->wait());
- $this->assertEquals(1, $called);
- $this->assertEquals('foo', $f->wait());
- $this->assertEquals(1, $called);
- $f->cancel();
- $this->assertTrue($this->readAttribute($f, 'isRealized'));
- }
-
- /**
- * @expectedException \GuzzleHttp\Ring\Exception\CancelledFutureAccessException
- */
- public function testThrowsWhenAccessingCancelled()
- {
- $f = new FutureValue(
- (new Deferred())->promise(),
- function () {},
- function () { return true; }
- );
- $f->cancel();
- $f->wait();
- }
-
- /**
- * @expectedException \OutOfBoundsException
- */
- public function testThrowsWhenDerefFailure()
- {
- $called = false;
- $deferred = new Deferred();
- $f = new FutureValue(
- $deferred->promise(),
- function () use(&$called) {
- $called = true;
- }
- );
- $deferred->reject(new \OutOfBoundsException());
- $f->wait();
- $this->assertFalse($called);
- }
-
- /**
- * @expectedException \GuzzleHttp\Ring\Exception\RingException
- * @expectedExceptionMessage Waiting did not resolve future
- */
- public function testThrowsWhenDerefDoesNotResolve()
- {
- $deferred = new Deferred();
- $f = new FutureValue(
- $deferred->promise(),
- function () use(&$called) {
- $called = true;
- }
- );
- $f->wait();
- }
-
- public function testThrowingCancelledFutureAccessExceptionCancels()
- {
- $deferred = new Deferred();
- $f = new FutureValue(
- $deferred->promise(),
- function () use ($deferred) {
- throw new CancelledFutureAccessException();
- }
- );
- try {
- $f->wait();
- $this->fail('did not throw');
- } catch (CancelledFutureAccessException $e) {}
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage foo
- */
- public function testThrowingExceptionInDerefMarksAsFailed()
- {
- $deferred = new Deferred();
- $f = new FutureValue(
- $deferred->promise(),
- function () {
- throw new \Exception('foo');
- }
- );
- $f->wait();
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/ringphp/tests/bootstrap.php b/lib/gerencianet/guzzlehttp/ringphp/tests/bootstrap.php
deleted file mode 100644
index 017610f..0000000
--- a/lib/gerencianet/guzzlehttp/ringphp/tests/bootstrap.php
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/lib/gerencianet/guzzlehttp/streams/Makefile b/lib/gerencianet/guzzlehttp/streams/Makefile
deleted file mode 100644
index f4d4284..0000000
--- a/lib/gerencianet/guzzlehttp/streams/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-all: clean coverage
-
-release: tag
- git push origin --tags
-
-tag:
- chag tag --sign --debug CHANGELOG.rst
-
-test:
- vendor/bin/phpunit
-
-coverage:
- vendor/bin/phpunit --coverage-html=artifacts/coverage
-
-view-coverage:
- open artifacts/coverage/index.html
-
-clean:
- rm -rf artifacts/*
diff --git a/lib/gerencianet/guzzlehttp/streams/README.rst b/lib/gerencianet/guzzlehttp/streams/README.rst
deleted file mode 100644
index baff63b..0000000
--- a/lib/gerencianet/guzzlehttp/streams/README.rst
+++ /dev/null
@@ -1,36 +0,0 @@
-==============
-Guzzle Streams
-==============
-
-Provides a simple abstraction over streams of data.
-
-This library is used in `Guzzle 5 `_, and is
-(currently) compatible with the WIP PSR-7.
-
-Installation
-============
-
-This package can be installed easily using `Composer `_.
-Simply add the following to the composer.json file at the root of your project:
-
-.. code-block:: javascript
-
- {
- "require": {
- "guzzlehttp/streams": "~3.0"
- }
- }
-
-Then install your dependencies using ``composer.phar install``.
-
-Documentation
-=============
-
-The documentation for this package can be found on the main Guzzle website at
-http://docs.guzzlephp.org/en/guzzle4/streams.html.
-
-Testing
-=======
-
-This library is tested using PHPUnit. You'll need to install the dependencies
-using `Composer `_ then run ``make test``.
diff --git a/lib/gerencianet/guzzlehttp/streams/composer.json b/lib/gerencianet/guzzlehttp/streams/composer.json
deleted file mode 100644
index 6d70343..0000000
--- a/lib/gerencianet/guzzlehttp/streams/composer.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "name": "guzzlehttp/streams",
- "description": "Provides a simple abstraction over streams of data",
- "homepage": "http://guzzlephp.org/",
- "keywords": ["stream", "guzzle"],
- "license": "MIT",
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "require": {
- "php": ">=5.4.0"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.0"
- },
- "autoload": {
- "psr-4": { "GuzzleHttp\\Stream\\": "src/" }
- },
- "extra": {
- "branch-alias": {
- "dev-master": "3.0-dev"
- }
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/phpunit.xml.dist b/lib/gerencianet/guzzlehttp/streams/phpunit.xml.dist
deleted file mode 100644
index 6e758c1..0000000
--- a/lib/gerencianet/guzzlehttp/streams/phpunit.xml.dist
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
- tests
-
-
-
-
- src
-
- src/functions.php
-
-
-
-
diff --git a/lib/gerencianet/guzzlehttp/streams/src/AppendStream.php b/lib/gerencianet/guzzlehttp/streams/src/AppendStream.php
deleted file mode 100644
index 94bda71..0000000
--- a/lib/gerencianet/guzzlehttp/streams/src/AppendStream.php
+++ /dev/null
@@ -1,220 +0,0 @@
-addStream($stream);
- }
- }
-
- public function __toString()
- {
- try {
- $this->seek(0);
- return $this->getContents();
- } catch (\Exception $e) {
- return '';
- }
- }
-
- /**
- * Add a stream to the AppendStream
- *
- * @param StreamInterface $stream Stream to append. Must be readable.
- *
- * @throws \InvalidArgumentException if the stream is not readable
- */
- public function addStream(StreamInterface $stream)
- {
- if (!$stream->isReadable()) {
- throw new \InvalidArgumentException('Each stream must be readable');
- }
-
- // The stream is only seekable if all streams are seekable
- if (!$stream->isSeekable()) {
- $this->seekable = false;
- }
-
- $this->streams[] = $stream;
- }
-
- public function getContents()
- {
- return Utils::copyToString($this);
- }
-
- /**
- * Closes each attached stream.
- *
- * {@inheritdoc}
- */
- public function close()
- {
- $this->pos = $this->current = 0;
-
- foreach ($this->streams as $stream) {
- $stream->close();
- }
-
- $this->streams = [];
- }
-
- /**
- * Detaches each attached stream
- *
- * {@inheritdoc}
- */
- public function detach()
- {
- $this->close();
- $this->detached = true;
- }
-
- public function attach($stream)
- {
- throw new CannotAttachException();
- }
-
- public function tell()
- {
- return $this->pos;
- }
-
- /**
- * Tries to calculate the size by adding the size of each stream.
- *
- * If any of the streams do not return a valid number, then the size of the
- * append stream cannot be determined and null is returned.
- *
- * {@inheritdoc}
- */
- public function getSize()
- {
- $size = 0;
-
- foreach ($this->streams as $stream) {
- $s = $stream->getSize();
- if ($s === null) {
- return null;
- }
- $size += $s;
- }
-
- return $size;
- }
-
- public function eof()
- {
- return !$this->streams ||
- ($this->current >= count($this->streams) - 1 &&
- $this->streams[$this->current]->eof());
- }
-
- /**
- * Attempts to seek to the given position. Only supports SEEK_SET.
- *
- * {@inheritdoc}
- */
- public function seek($offset, $whence = SEEK_SET)
- {
- if (!$this->seekable || $whence !== SEEK_SET) {
- return false;
- }
-
- $success = true;
- $this->pos = $this->current = 0;
-
- // Rewind each stream
- foreach ($this->streams as $stream) {
- if (!$stream->seek(0)) {
- $success = false;
- }
- }
-
- if (!$success) {
- return false;
- }
-
- // Seek to the actual position by reading from each stream
- while ($this->pos < $offset && !$this->eof()) {
- $this->read(min(8096, $offset - $this->pos));
- }
-
- return $this->pos == $offset;
- }
-
- /**
- * Reads from all of the appended streams until the length is met or EOF.
- *
- * {@inheritdoc}
- */
- public function read($length)
- {
- $buffer = '';
- $total = count($this->streams) - 1;
- $remaining = $length;
-
- while ($remaining > 0) {
- // Progress to the next stream if needed.
- if ($this->streams[$this->current]->eof()) {
- if ($this->current == $total) {
- break;
- }
- $this->current++;
- }
- $buffer .= $this->streams[$this->current]->read($remaining);
- $remaining = $length - strlen($buffer);
- }
-
- $this->pos += strlen($buffer);
-
- return $buffer;
- }
-
- public function isReadable()
- {
- return true;
- }
-
- public function isWritable()
- {
- return false;
- }
-
- public function isSeekable()
- {
- return $this->seekable;
- }
-
- public function write($string)
- {
- return false;
- }
-
- public function getMetadata($key = null)
- {
- return $key ? null : [];
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/src/AsyncReadStream.php b/lib/gerencianet/guzzlehttp/streams/src/AsyncReadStream.php
deleted file mode 100644
index 25ad960..0000000
--- a/lib/gerencianet/guzzlehttp/streams/src/AsyncReadStream.php
+++ /dev/null
@@ -1,207 +0,0 @@
-isReadable() || !$buffer->isWritable()) {
- throw new \InvalidArgumentException(
- 'Buffer must be readable and writable'
- );
- }
-
- if (isset($config['size'])) {
- $this->size = $config['size'];
- }
-
- static $callables = ['pump', 'drain'];
- foreach ($callables as $check) {
- if (isset($config[$check])) {
- if (!is_callable($config[$check])) {
- throw new \InvalidArgumentException(
- $check . ' must be callable'
- );
- }
- $this->{$check} = $config[$check];
- }
- }
-
- $this->hwm = $buffer->getMetadata('hwm');
-
- // Cannot drain when there's no high water mark.
- if ($this->hwm === null) {
- $this->drain = null;
- }
-
- $this->stream = $buffer;
- }
-
- /**
- * Factory method used to create new async stream and an underlying buffer
- * if no buffer is provided.
- *
- * This function accepts the same options as AsyncReadStream::__construct,
- * but added the following key value pairs:
- *
- * - buffer: (StreamInterface) Buffer used to buffer data. If none is
- * provided, a default buffer is created.
- * - hwm: (int) High water mark to use if a buffer is created on your
- * behalf.
- * - max_buffer: (int) If provided, wraps the utilized buffer in a
- * DroppingStream decorator to ensure that buffer does not exceed a given
- * length. When exceeded, the stream will begin dropping data. Set the
- * max_buffer to 0, to use a NullStream which does not store data.
- * - write: (callable) A function that is invoked when data is written
- * to the underlying buffer. The function accepts the buffer as the first
- * argument, and the data being written as the second. The function MUST
- * return the number of bytes that were written or false to let writers
- * know to slow down.
- * - drain: (callable) See constructor documentation.
- * - pump: (callable) See constructor documentation.
- *
- * @param array $options Associative array of options.
- *
- * @return array Returns an array containing the buffer used to buffer
- * data, followed by the ready to use AsyncReadStream object.
- */
- public static function create(array $options = [])
- {
- $maxBuffer = isset($options['max_buffer'])
- ? $options['max_buffer']
- : null;
-
- if ($maxBuffer === 0) {
- $buffer = new NullStream();
- } elseif (isset($options['buffer'])) {
- $buffer = $options['buffer'];
- } else {
- $hwm = isset($options['hwm']) ? $options['hwm'] : 16384;
- $buffer = new BufferStream($hwm);
- }
-
- if ($maxBuffer > 0) {
- $buffer = new DroppingStream($buffer, $options['max_buffer']);
- }
-
- // Call the on_write callback if an on_write function was provided.
- if (isset($options['write'])) {
- $onWrite = $options['write'];
- $buffer = FnStream::decorate($buffer, [
- 'write' => function ($string) use ($buffer, $onWrite) {
- $result = $buffer->write($string);
- $onWrite($buffer, $string);
- return $result;
- }
- ]);
- }
-
- return [$buffer, new self($buffer, $options)];
- }
-
- public function getSize()
- {
- return $this->size;
- }
-
- public function isWritable()
- {
- return false;
- }
-
- public function write($string)
- {
- return false;
- }
-
- public function read($length)
- {
- if (!$this->needsDrain && $this->drain) {
- $this->needsDrain = $this->stream->getSize() >= $this->hwm;
- }
-
- $result = $this->stream->read($length);
-
- // If we need to drain, then drain when the buffer is empty.
- if ($this->needsDrain && $this->stream->getSize() === 0) {
- $this->needsDrain = false;
- $drainFn = $this->drain;
- $drainFn($this->stream);
- }
-
- $resultLen = strlen($result);
-
- // If a pump was provided, the buffer is still open, and not enough
- // data was given, then block until the data is provided.
- if ($this->pump && $resultLen < $length) {
- $pumpFn = $this->pump;
- $result .= $pumpFn($length - $resultLen);
- }
-
- return $result;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/src/CachingStream.php b/lib/gerencianet/guzzlehttp/streams/src/CachingStream.php
deleted file mode 100644
index 60bb905..0000000
--- a/lib/gerencianet/guzzlehttp/streams/src/CachingStream.php
+++ /dev/null
@@ -1,122 +0,0 @@
-remoteStream = $stream;
- $this->stream = $target ?: new Stream(fopen('php://temp', 'r+'));
- }
-
- public function getSize()
- {
- return max($this->stream->getSize(), $this->remoteStream->getSize());
- }
-
- /**
- * {@inheritdoc}
- * @throws SeekException When seeking with SEEK_END or when seeking
- * past the total size of the buffer stream
- */
- public function seek($offset, $whence = SEEK_SET)
- {
- if ($whence == SEEK_SET) {
- $byte = $offset;
- } elseif ($whence == SEEK_CUR) {
- $byte = $offset + $this->tell();
- } else {
- return false;
- }
-
- // You cannot skip ahead past where you've read from the remote stream
- if ($byte > $this->stream->getSize()) {
- throw new SeekException(
- $this,
- $byte,
- sprintf('Cannot seek to byte %d when the buffered stream only'
- . ' contains %d bytes', $byte, $this->stream->getSize())
- );
- }
-
- return $this->stream->seek($byte);
- }
-
- public function read($length)
- {
- // Perform a regular read on any previously read data from the buffer
- $data = $this->stream->read($length);
- $remaining = $length - strlen($data);
-
- // More data was requested so read from the remote stream
- if ($remaining) {
- // If data was written to the buffer in a position that would have
- // been filled from the remote stream, then we must skip bytes on
- // the remote stream to emulate overwriting bytes from that
- // position. This mimics the behavior of other PHP stream wrappers.
- $remoteData = $this->remoteStream->read(
- $remaining + $this->skipReadBytes
- );
-
- if ($this->skipReadBytes) {
- $len = strlen($remoteData);
- $remoteData = substr($remoteData, $this->skipReadBytes);
- $this->skipReadBytes = max(0, $this->skipReadBytes - $len);
- }
-
- $data .= $remoteData;
- $this->stream->write($remoteData);
- }
-
- return $data;
- }
-
- public function write($string)
- {
- // When appending to the end of the currently read stream, you'll want
- // to skip bytes from being read from the remote stream to emulate
- // other stream wrappers. Basically replacing bytes of data of a fixed
- // length.
- $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell();
- if ($overflow > 0) {
- $this->skipReadBytes += $overflow;
- }
-
- return $this->stream->write($string);
- }
-
- public function eof()
- {
- return $this->stream->eof() && $this->remoteStream->eof();
- }
-
- /**
- * Close both the remote stream and buffer stream
- */
- public function close()
- {
- $this->remoteStream->close() && $this->stream->close();
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/src/Exception/CannotAttachException.php b/lib/gerencianet/guzzlehttp/streams/src/Exception/CannotAttachException.php
deleted file mode 100644
index e631b9f..0000000
--- a/lib/gerencianet/guzzlehttp/streams/src/Exception/CannotAttachException.php
+++ /dev/null
@@ -1,4 +0,0 @@
-stream = $stream;
- $msg = $msg ?: 'Could not seek the stream to position ' . $pos;
- parent::__construct($msg);
- }
-
- /**
- * @return StreamInterface
- */
- public function getStream()
- {
- return $this->stream;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/src/GuzzleStreamWrapper.php b/lib/gerencianet/guzzlehttp/streams/src/GuzzleStreamWrapper.php
deleted file mode 100644
index 4d049a6..0000000
--- a/lib/gerencianet/guzzlehttp/streams/src/GuzzleStreamWrapper.php
+++ /dev/null
@@ -1,117 +0,0 @@
-isReadable()) {
- $mode = $stream->isWritable() ? 'r+' : 'r';
- } elseif ($stream->isWritable()) {
- $mode = 'w';
- } else {
- throw new \InvalidArgumentException('The stream must be readable, '
- . 'writable, or both.');
- }
-
- return fopen('guzzle://stream', $mode, null, stream_context_create([
- 'guzzle' => ['stream' => $stream]
- ]));
- }
-
- /**
- * Registers the stream wrapper if needed
- */
- public static function register()
- {
- if (!in_array('guzzle', stream_get_wrappers())) {
- stream_wrapper_register('guzzle', __CLASS__);
- }
- }
-
- public function stream_open($path, $mode, $options, &$opened_path)
- {
- $options = stream_context_get_options($this->context);
-
- if (!isset($options['guzzle']['stream'])) {
- return false;
- }
-
- $this->mode = $mode;
- $this->stream = $options['guzzle']['stream'];
-
- return true;
- }
-
- public function stream_read($count)
- {
- return $this->stream->read($count);
- }
-
- public function stream_write($data)
- {
- return (int) $this->stream->write($data);
- }
-
- public function stream_tell()
- {
- return $this->stream->tell();
- }
-
- public function stream_eof()
- {
- return $this->stream->eof();
- }
-
- public function stream_seek($offset, $whence)
- {
- return $this->stream->seek($offset, $whence);
- }
-
- public function stream_stat()
- {
- static $modeMap = [
- 'r' => 33060,
- 'r+' => 33206,
- 'w' => 33188
- ];
-
- return [
- 'dev' => 0,
- 'ino' => 0,
- 'mode' => $modeMap[$this->mode],
- 'nlink' => 0,
- 'uid' => 0,
- 'gid' => 0,
- 'rdev' => 0,
- 'size' => $this->stream->getSize() ?: 0,
- 'atime' => 0,
- 'mtime' => 0,
- 'ctime' => 0,
- 'blksize' => 0,
- 'blocks' => 0
- ];
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/src/InflateStream.php b/lib/gerencianet/guzzlehttp/streams/src/InflateStream.php
deleted file mode 100644
index 978af21..0000000
--- a/lib/gerencianet/guzzlehttp/streams/src/InflateStream.php
+++ /dev/null
@@ -1,27 +0,0 @@
-stream = new Stream($resource);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/src/MetadataStreamInterface.php b/lib/gerencianet/guzzlehttp/streams/src/MetadataStreamInterface.php
deleted file mode 100644
index c1433ad..0000000
--- a/lib/gerencianet/guzzlehttp/streams/src/MetadataStreamInterface.php
+++ /dev/null
@@ -1,11 +0,0 @@
-stream->attach($stream);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/src/NullStream.php b/lib/gerencianet/guzzlehttp/streams/src/NullStream.php
deleted file mode 100644
index 41ee776..0000000
--- a/lib/gerencianet/guzzlehttp/streams/src/NullStream.php
+++ /dev/null
@@ -1,78 +0,0 @@
- [
- 'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true,
- 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true,
- 'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true,
- 'x+t' => true, 'c+t' => true, 'a+' => true
- ],
- 'write' => [
- 'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true,
- 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true,
- 'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true,
- 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true
- ]
- ];
-
- /**
- * Create a new stream based on the input type.
- *
- * This factory accepts the same associative array of options as described
- * in the constructor.
- *
- * @param resource|string|StreamInterface $resource Entity body data
- * @param array $options Additional options
- *
- * @return Stream
- * @throws \InvalidArgumentException if the $resource arg is not valid.
- */
- public static function factory($resource = '', array $options = [])
- {
- $type = gettype($resource);
-
- if ($type == 'string') {
- $stream = fopen('php://temp', 'r+');
- if ($resource !== '') {
- fwrite($stream, $resource);
- fseek($stream, 0);
- }
- return new self($stream, $options);
- }
-
- if ($type == 'resource') {
- return new self($resource, $options);
- }
-
- if ($resource instanceof StreamInterface) {
- return $resource;
- }
-
- if ($type == 'object' && method_exists($resource, '__toString')) {
- return self::factory((string) $resource, $options);
- }
-
- if (is_callable($resource)) {
- return new PumpStream($resource, $options);
- }
-
- if ($resource instanceof \Iterator) {
- return new PumpStream(function () use ($resource) {
- if (!$resource->valid()) {
- return false;
- }
- $result = $resource->current();
- $resource->next();
- return $result;
- }, $options);
- }
-
- throw new \InvalidArgumentException('Invalid resource type: ' . $type);
- }
-
- /**
- * This constructor accepts an associative array of options.
- *
- * - size: (int) If a read stream would otherwise have an indeterminate
- * size, but the size is known due to foreknownledge, then you can
- * provide that size, in bytes.
- * - metadata: (array) Any additional metadata to return when the metadata
- * of the stream is accessed.
- *
- * @param resource $stream Stream resource to wrap.
- * @param array $options Associative array of options.
- *
- * @throws \InvalidArgumentException if the stream is not a stream resource
- */
- public function __construct($stream, $options = [])
- {
- if (!is_resource($stream)) {
- throw new \InvalidArgumentException('Stream must be a resource');
- }
-
- if (isset($options['size'])) {
- $this->size = $options['size'];
- }
-
- $this->customMetadata = isset($options['metadata'])
- ? $options['metadata']
- : [];
-
- $this->attach($stream);
- }
-
- /**
- * Closes the stream when the destructed
- */
- public function __destruct()
- {
- $this->close();
- }
-
- public function __toString()
- {
- if (!$this->stream) {
- return '';
- }
-
- $this->seek(0);
-
- return (string) stream_get_contents($this->stream);
- }
-
- public function getContents()
- {
- return $this->stream ? stream_get_contents($this->stream) : '';
- }
-
- public function close()
- {
- if (is_resource($this->stream)) {
- fclose($this->stream);
- }
-
- $this->detach();
- }
-
- public function detach()
- {
- $result = $this->stream;
- $this->stream = $this->size = $this->uri = null;
- $this->readable = $this->writable = $this->seekable = false;
-
- return $result;
- }
-
- public function attach($stream)
- {
- $this->stream = $stream;
- $meta = stream_get_meta_data($this->stream);
- $this->seekable = $meta['seekable'];
- $this->readable = isset(self::$readWriteHash['read'][$meta['mode']]);
- $this->writable = isset(self::$readWriteHash['write'][$meta['mode']]);
- $this->uri = $this->getMetadata('uri');
- }
-
- public function getSize()
- {
- if ($this->size !== null) {
- return $this->size;
- }
-
- if (!$this->stream) {
- return null;
- }
-
- // Clear the stat cache if the stream has a URI
- if ($this->uri) {
- clearstatcache(true, $this->uri);
- }
-
- $stats = fstat($this->stream);
- if (isset($stats['size'])) {
- $this->size = $stats['size'];
- return $this->size;
- }
-
- return null;
- }
-
- public function isReadable()
- {
- return $this->readable;
- }
-
- public function isWritable()
- {
- return $this->writable;
- }
-
- public function isSeekable()
- {
- return $this->seekable;
- }
-
- public function eof()
- {
- return !$this->stream || feof($this->stream);
- }
-
- public function tell()
- {
- return $this->stream ? ftell($this->stream) : false;
- }
-
- public function setSize($size)
- {
- $this->size = $size;
-
- return $this;
- }
-
- public function seek($offset, $whence = SEEK_SET)
- {
- return $this->seekable
- ? fseek($this->stream, $offset, $whence) === 0
- : false;
- }
-
- public function read($length)
- {
- return $this->readable ? fread($this->stream, $length) : false;
- }
-
- public function write($string)
- {
- // We can't know the size after writing anything
- $this->size = null;
-
- return $this->writable ? fwrite($this->stream, $string) : false;
- }
-
- public function getMetadata($key = null)
- {
- if (!$this->stream) {
- return $key ? null : [];
- } elseif (!$key) {
- return $this->customMetadata + stream_get_meta_data($this->stream);
- } elseif (isset($this->customMetadata[$key])) {
- return $this->customMetadata[$key];
- }
-
- $meta = stream_get_meta_data($this->stream);
-
- return isset($meta[$key]) ? $meta[$key] : null;
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/src/StreamInterface.php b/lib/gerencianet/guzzlehttp/streams/src/StreamInterface.php
deleted file mode 100644
index fd19c6f..0000000
--- a/lib/gerencianet/guzzlehttp/streams/src/StreamInterface.php
+++ /dev/null
@@ -1,159 +0,0 @@
-eof()) {
- $buf = $stream->read(1048576);
- if ($buf === false) {
- break;
- }
- $buffer .= $buf;
- }
- return $buffer;
- }
-
- $len = 0;
- while (!$stream->eof() && $len < $maxLen) {
- $buf = $stream->read($maxLen - $len);
- if ($buf === false) {
- break;
- }
- $buffer .= $buf;
- $len = strlen($buffer);
- }
-
- return $buffer;
- }
-
- /**
- * Copy the contents of a stream into another stream until the given number
- * of bytes have been read.
- *
- * @param StreamInterface $source Stream to read from
- * @param StreamInterface $dest Stream to write to
- * @param int $maxLen Maximum number of bytes to read. Pass -1
- * to read the entire stream.
- */
- public static function copyToStream(
- StreamInterface $source,
- StreamInterface $dest,
- $maxLen = -1
- ) {
- if ($maxLen === -1) {
- while (!$source->eof()) {
- if (!$dest->write($source->read(1048576))) {
- break;
- }
- }
- return;
- }
-
- $bytes = 0;
- while (!$source->eof()) {
- $buf = $source->read($maxLen - $bytes);
- if (!($len = strlen($buf))) {
- break;
- }
- $bytes += $len;
- $dest->write($buf);
- if ($bytes == $maxLen) {
- break;
- }
- }
- }
-
- /**
- * Calculate a hash of a Stream
- *
- * @param StreamInterface $stream Stream to calculate the hash for
- * @param string $algo Hash algorithm (e.g. md5, crc32, etc)
- * @param bool $rawOutput Whether or not to use raw output
- *
- * @return string Returns the hash of the stream
- * @throws SeekException
- */
- public static function hash(
- StreamInterface $stream,
- $algo,
- $rawOutput = false
- ) {
- $pos = $stream->tell();
-
- if ($pos > 0 && !$stream->seek(0)) {
- throw new SeekException($stream);
- }
-
- $ctx = hash_init($algo);
- while (!$stream->eof()) {
- hash_update($ctx, $stream->read(1048576));
- }
-
- $out = hash_final($ctx, (bool) $rawOutput);
- $stream->seek($pos);
-
- return $out;
- }
-
- /**
- * Read a line from the stream up to the maximum allowed buffer length
- *
- * @param StreamInterface $stream Stream to read from
- * @param int $maxLength Maximum buffer length
- *
- * @return string|bool
- */
- public static function readline(StreamInterface $stream, $maxLength = null)
- {
- $buffer = '';
- $size = 0;
-
- while (!$stream->eof()) {
- if (false === ($byte = $stream->read(1))) {
- return $buffer;
- }
- $buffer .= $byte;
- // Break when a new line is found or the max length - 1 is reached
- if ($byte == PHP_EOL || ++$size == $maxLength - 1) {
- break;
- }
- }
-
- return $buffer;
- }
-
- /**
- * Alias of GuzzleHttp\Stream\Stream::factory.
- *
- * @param mixed $resource Resource to create
- * @param array $options Associative array of stream options defined in
- * {@see \GuzzleHttp\Stream\Stream::__construct}
- *
- * @return StreamInterface
- *
- * @see GuzzleHttp\Stream\Stream::factory
- * @see GuzzleHttp\Stream\Stream::__construct
- */
- public static function create($resource, array $options = [])
- {
- return Stream::factory($resource, $options);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/AppendStreamTest.php b/lib/gerencianet/guzzlehttp/streams/tests/AppendStreamTest.php
deleted file mode 100644
index 78798d9..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/AppendStreamTest.php
+++ /dev/null
@@ -1,178 +0,0 @@
-getMockBuilder('GuzzleHttp\Stream\StreamInterface')
- ->setMethods(['isReadable'])
- ->getMockForAbstractClass();
- $s->expects($this->once())
- ->method('isReadable')
- ->will($this->returnValue(false));
- $a->addStream($s);
- }
-
- public function testValidatesSeekType()
- {
- $a = new AppendStream();
- $this->assertFalse($a->seek(100, SEEK_CUR));
- }
-
- public function testTriesToRewindOnSeek()
- {
- $a = new AppendStream();
- $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface')
- ->setMethods(['isReadable', 'seek', 'isSeekable'])
- ->getMockForAbstractClass();
- $s->expects($this->once())
- ->method('isReadable')
- ->will($this->returnValue(true));
- $s->expects($this->once())
- ->method('isSeekable')
- ->will($this->returnValue(true));
- $s->expects($this->once())
- ->method('seek')
- ->will($this->returnValue(false));
- $a->addStream($s);
- $this->assertFalse($a->seek(10));
- }
-
- public function testSeeksToPositionByReading()
- {
- $a = new AppendStream([
- Stream::factory('foo'),
- Stream::factory('bar'),
- Stream::factory('baz'),
- ]);
-
- $this->assertTrue($a->seek(3));
- $this->assertEquals(3, $a->tell());
- $this->assertEquals('bar', $a->read(3));
- $a->seek(6);
- $this->assertEquals(6, $a->tell());
- $this->assertEquals('baz', $a->read(3));
- }
-
- public function testDetachesEachStream()
- {
- $s1 = Stream::factory('foo');
- $s2 = Stream::factory('foo');
- $a = new AppendStream([$s1, $s2]);
- $this->assertSame('foofoo', (string) $a);
- $a->detach();
- $this->assertSame('', (string) $a);
- $this->assertSame(0, $a->getSize());
- }
-
- public function testClosesEachStream()
- {
- $s1 = Stream::factory('foo');
- $a = new AppendStream([$s1]);
- $a->close();
- $this->assertSame('', (string) $a);
- }
-
- public function testIsNotWritable()
- {
- $a = new AppendStream([Stream::factory('foo')]);
- $this->assertFalse($a->isWritable());
- $this->assertTrue($a->isSeekable());
- $this->assertTrue($a->isReadable());
- $this->assertFalse($a->write('foo'));
- }
-
- public function testDoesNotNeedStreams()
- {
- $a = new AppendStream();
- $this->assertEquals('', (string) $a);
- }
-
- public function testCanReadFromMultipleStreams()
- {
- $a = new AppendStream([
- Stream::factory('foo'),
- Stream::factory('bar'),
- Stream::factory('baz'),
- ]);
- $this->assertFalse($a->eof());
- $this->assertSame(0, $a->tell());
- $this->assertEquals('foo', $a->read(3));
- $this->assertEquals('bar', $a->read(3));
- $this->assertEquals('baz', $a->read(3));
- $this->assertTrue($a->eof());
- $this->assertSame(9, $a->tell());
- $this->assertEquals('foobarbaz', (string) $a);
- }
-
- public function testCanDetermineSizeFromMultipleStreams()
- {
- $a = new AppendStream([
- Stream::factory('foo'),
- Stream::factory('bar')
- ]);
- $this->assertEquals(6, $a->getSize());
-
- $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface')
- ->setMethods(['isSeekable', 'isReadable'])
- ->getMockForAbstractClass();
- $s->expects($this->once())
- ->method('isSeekable')
- ->will($this->returnValue(null));
- $s->expects($this->once())
- ->method('isReadable')
- ->will($this->returnValue(true));
- $a->addStream($s);
- $this->assertNull($a->getSize());
- }
-
- public function testCatchesExceptionsWhenCastingToString()
- {
- $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface')
- ->setMethods(['read', 'isReadable', 'eof'])
- ->getMockForAbstractClass();
- $s->expects($this->once())
- ->method('read')
- ->will($this->throwException(new \RuntimeException('foo')));
- $s->expects($this->once())
- ->method('isReadable')
- ->will($this->returnValue(true));
- $s->expects($this->any())
- ->method('eof')
- ->will($this->returnValue(false));
- $a = new AppendStream([$s]);
- $this->assertFalse($a->eof());
- $this->assertSame('', (string) $a);
- }
-
- public function testCanDetach()
- {
- $s = new AppendStream();
- $s->detach();
- }
-
- public function testReturnsEmptyMetadata()
- {
- $s = new AppendStream();
- $this->assertEquals([], $s->getMetadata());
- $this->assertNull($s->getMetadata('foo'));
- }
-
- /**
- * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException
- */
- public function testCannotAttach()
- {
- $p = new AppendStream();
- $p->attach('a');
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/AsyncReadStreamTest.php b/lib/gerencianet/guzzlehttp/streams/tests/AsyncReadStreamTest.php
deleted file mode 100644
index 8c78995..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/AsyncReadStreamTest.php
+++ /dev/null
@@ -1,186 +0,0 @@
- function () { return false; }]
- ));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Buffer must be readable and writable
- */
- public function testValidatesWritableBuffer()
- {
- new AsyncReadStream(FnStream::decorate(
- Stream::factory(),
- ['isWritable' => function () { return false; }]
- ));
- }
-
- public function testValidatesHwmMetadata()
- {
- $a = new AsyncReadStream(Stream::factory(), [
- 'drain' => function() {}
- ]);
- $this->assertNull($this->readAttribute($a, 'drain'));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage pump must be callable
- */
- public function testValidatesPumpIsCallable()
- {
- new AsyncReadStream(new BufferStream(), ['pump' => true]);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage drain must be callable
- */
- public function testValidatesDrainIsCallable()
- {
- new AsyncReadStream(new BufferStream(), ['drain' => true]);
- }
-
- public function testCanInitialize()
- {
- $buffer = new BufferStream();
- $a = new AsyncReadStream($buffer, [
- 'size' => 10,
- 'drain' => function () {},
- 'pump' => function () {},
- ]);
- $this->assertSame($buffer, $this->readAttribute($a, 'stream'));
- $this->assertTrue(is_callable($this->readAttribute($a, 'drain')));
- $this->assertTrue(is_callable($this->readAttribute($a, 'pump')));
- $this->assertTrue($a->isReadable());
- $this->assertFalse($a->isSeekable());
- $this->assertFalse($a->isWritable());
- $this->assertFalse($a->write('foo'));
- $this->assertEquals(10, $a->getSize());
- }
-
- public function testReadsFromBufferWithNoDrainOrPump()
- {
- $buffer = new BufferStream();
- $a = new AsyncReadStream($buffer);
- $buffer->write('foo');
- $this->assertNull($a->getSize());
- $this->assertEquals('foo', $a->read(10));
- $this->assertEquals('', $a->read(10));
- }
-
- public function testCallsPumpForMoreDataWhenRequested()
- {
- $called = 0;
- $buffer = new BufferStream();
- $a = new AsyncReadStream($buffer, [
- 'pump' => function ($size) use (&$called) {
- $called++;
- return str_repeat('.', $size);
- }
- ]);
- $buffer->write('foobar');
- $this->assertEquals('foo', $a->read(3));
- $this->assertEquals(0, $called);
- $this->assertEquals('bar.....', $a->read(8));
- $this->assertEquals(1, $called);
- $this->assertEquals('..', $a->read(2));
- $this->assertEquals(2, $called);
- }
-
- public function testCallsDrainWhenNeeded()
- {
- $called = 0;
- $buffer = new BufferStream(5);
- $a = new AsyncReadStream($buffer, [
- 'drain' => function (BufferStream $b) use (&$called, $buffer) {
- $this->assertSame($b, $buffer);
- $called++;
- }
- ]);
-
- $buffer->write('foobar');
- $this->assertEquals(6, $buffer->getSize());
- $this->assertEquals(0, $called);
-
- $a->read(3);
- $this->assertTrue($this->readAttribute($a, 'needsDrain'));
- $this->assertEquals(3, $buffer->getSize());
- $this->assertEquals(0, $called);
-
- $a->read(3);
- $this->assertEquals(0, $buffer->getSize());
- $this->assertFalse($this->readAttribute($a, 'needsDrain'));
- $this->assertEquals(1, $called);
- }
-
- public function testCreatesBufferWithNoConfig()
- {
- list($buffer, $async) = AsyncReadStream::create();
- $this->assertInstanceOf('GuzzleHttp\Stream\BufferStream', $buffer);
- $this->assertInstanceOf('GuzzleHttp\Stream\AsyncReadStream', $async);
- }
-
- public function testCreatesBufferWithSpecifiedBuffer()
- {
- $buf = new BufferStream();
- list($buffer, $async) = AsyncReadStream::create(['buffer' => $buf]);
- $this->assertSame($buf, $buffer);
- $this->assertInstanceOf('GuzzleHttp\Stream\AsyncReadStream', $async);
- }
-
- public function testCreatesNullStream()
- {
- list($buffer, $async) = AsyncReadStream::create(['max_buffer' => 0]);
- $this->assertInstanceOf('GuzzleHttp\Stream\NullStream', $buffer);
- $this->assertInstanceOf('GuzzleHttp\Stream\AsyncReadStream', $async);
- }
-
- public function testCreatesDroppingStream()
- {
- list($buffer, $async) = AsyncReadStream::create(['max_buffer' => 5]);
- $this->assertInstanceOf('GuzzleHttp\Stream\DroppingStream', $buffer);
- $this->assertInstanceOf('GuzzleHttp\Stream\AsyncReadStream', $async);
- $buffer->write('12345678910');
- $this->assertEquals(5, $buffer->getSize());
- }
-
- public function testCreatesOnWriteStream()
- {
- $c = 0;
- $b = new BufferStream();
- list($buffer, $async) = AsyncReadStream::create([
- 'buffer' => $b,
- 'write' => function (BufferStream $buf, $data) use (&$c, $b) {
- $this->assertSame($buf, $b);
- $this->assertEquals('foo', $data);
- $c++;
- }
- ]);
- $this->assertInstanceOf('GuzzleHttp\Stream\FnStream', $buffer);
- $this->assertInstanceOf('GuzzleHttp\Stream\AsyncReadStream', $async);
- $this->assertEquals(0, $c);
- $this->assertEquals(3, $buffer->write('foo'));
- $this->assertEquals(1, $c);
- $this->assertEquals(3, $buffer->write('foo'));
- $this->assertEquals(2, $c);
- $this->assertEquals('foofoo', (string) $buffer);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/BufferStreamTest.php b/lib/gerencianet/guzzlehttp/streams/tests/BufferStreamTest.php
deleted file mode 100644
index f9bfea2..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/BufferStreamTest.php
+++ /dev/null
@@ -1,69 +0,0 @@
-assertTrue($b->isReadable());
- $this->assertTrue($b->isWritable());
- $this->assertFalse($b->isSeekable());
- $this->assertEquals(null, $b->getMetadata('foo'));
- $this->assertEquals(10, $b->getMetadata('hwm'));
- $this->assertEquals([], $b->getMetadata());
- }
-
- public function testRemovesReadDataFromBuffer()
- {
- $b = new BufferStream();
- $this->assertEquals(3, $b->write('foo'));
- $this->assertEquals(3, $b->getSize());
- $this->assertFalse($b->eof());
- $this->assertEquals('foo', $b->read(10));
- $this->assertTrue($b->eof());
- $this->assertEquals('', $b->read(10));
- }
-
- public function testCanCastToStringOrGetContents()
- {
- $b = new BufferStream();
- $b->write('foo');
- $b->write('baz');
- $this->assertEquals('foo', $b->read(3));
- $b->write('bar');
- $this->assertEquals('bazbar', (string) $b);
- $this->assertFalse($b->tell());
- }
-
- public function testDetachClearsBuffer()
- {
- $b = new BufferStream();
- $b->write('foo');
- $b->detach();
- $this->assertEquals(0, $b->tell());
- $this->assertTrue($b->eof());
- $this->assertEquals(3, $b->write('abc'));
- $this->assertEquals('abc', $b->read(10));
- }
-
- public function testExceedingHighwaterMarkReturnsFalseButStillBuffers()
- {
- $b = new BufferStream(5);
- $this->assertEquals(3, $b->write('hi '));
- $this->assertFalse($b->write('hello'));
- $this->assertEquals('hi hello', (string) $b);
- $this->assertEquals(4, $b->write('test'));
- }
-
- /**
- * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException
- */
- public function testCannotAttach()
- {
- $p = new BufferStream();
- $p->attach('a');
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/CachingStreamTest.php b/lib/gerencianet/guzzlehttp/streams/tests/CachingStreamTest.php
deleted file mode 100644
index ea969b3..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/CachingStreamTest.php
+++ /dev/null
@@ -1,136 +0,0 @@
-decorated = Stream::factory('testing');
- $this->body = new CachingStream($this->decorated);
- }
-
- public function tearDown()
- {
- $this->decorated->close();
- $this->body->close();
- }
-
- public function testUsesRemoteSizeIfPossible()
- {
- $body = Stream::factory('test');
- $caching = new CachingStream($body);
- $this->assertEquals(4, $caching->getSize());
- }
-
- /**
- * @expectedException \RuntimeException
- * @expectedExceptionMessage Cannot seek to byte 10
- */
- public function testCannotSeekPastWhatHasBeenRead()
- {
- $this->body->seek(10);
- }
-
- public function testCannotUseSeekEnd()
- {
- $this->assertFalse($this->body->seek(2, SEEK_END));
- }
-
- public function testRewindUsesSeek()
- {
- $a = Stream::factory('foo');
- $d = $this->getMockBuilder('GuzzleHttp\Stream\CachingStream')
- ->setMethods(array('seek'))
- ->setConstructorArgs(array($a))
- ->getMock();
- $d->expects($this->once())
- ->method('seek')
- ->with(0)
- ->will($this->returnValue(true));
- $d->seek(0);
- }
-
- public function testCanSeekToReadBytes()
- {
- $this->assertEquals('te', $this->body->read(2));
- $this->body->seek(0);
- $this->assertEquals('test', $this->body->read(4));
- $this->assertEquals(4, $this->body->tell());
- $this->body->seek(2);
- $this->assertEquals(2, $this->body->tell());
- $this->body->seek(2, SEEK_CUR);
- $this->assertEquals(4, $this->body->tell());
- $this->assertEquals('ing', $this->body->read(3));
- }
-
- public function testWritesToBufferStream()
- {
- $this->body->read(2);
- $this->body->write('hi');
- $this->body->seek(0);
- $this->assertEquals('tehiing', (string) $this->body);
- }
-
- public function testSkipsOverwrittenBytes()
- {
- $decorated = Stream::factory(
- implode("\n", array_map(function ($n) {
- return str_pad($n, 4, '0', STR_PAD_LEFT);
- }, range(0, 25)))
- );
-
- $body = new CachingStream($decorated);
-
- $this->assertEquals("0000\n", Utils::readline($body));
- $this->assertEquals("0001\n", Utils::readline($body));
- // Write over part of the body yet to be read, so skip some bytes
- $this->assertEquals(5, $body->write("TEST\n"));
- $this->assertEquals(5, $this->readAttribute($body, 'skipReadBytes'));
- // Read, which skips bytes, then reads
- $this->assertEquals("0003\n", Utils::readline($body));
- $this->assertEquals(0, $this->readAttribute($body, 'skipReadBytes'));
- $this->assertEquals("0004\n", Utils::readline($body));
- $this->assertEquals("0005\n", Utils::readline($body));
-
- // Overwrite part of the cached body (so don't skip any bytes)
- $body->seek(5);
- $this->assertEquals(5, $body->write("ABCD\n"));
- $this->assertEquals(0, $this->readAttribute($body, 'skipReadBytes'));
- $this->assertEquals("TEST\n", Utils::readline($body));
- $this->assertEquals("0003\n", Utils::readline($body));
- $this->assertEquals("0004\n", Utils::readline($body));
- $this->assertEquals("0005\n", Utils::readline($body));
- $this->assertEquals("0006\n", Utils::readline($body));
- $this->assertEquals(5, $body->write("1234\n"));
- $this->assertEquals(5, $this->readAttribute($body, 'skipReadBytes'));
-
- // Seek to 0 and ensure the overwritten bit is replaced
- $body->seek(0);
- $this->assertEquals("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", $body->read(50));
-
- // Ensure that casting it to a string does not include the bit that was overwritten
- $this->assertContains("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", (string) $body);
- }
-
- public function testClosesBothStreams()
- {
- $s = fopen('php://temp', 'r');
- $a = Stream::factory($s);
- $d = new CachingStream($a);
- $d->close();
- $this->assertFalse(is_resource($s));
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/DroppingStreamTest.php b/lib/gerencianet/guzzlehttp/streams/tests/DroppingStreamTest.php
deleted file mode 100644
index bb2cb22..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/DroppingStreamTest.php
+++ /dev/null
@@ -1,26 +0,0 @@
-assertEquals(3, $drop->write('hel'));
- $this->assertFalse($drop->write('lo'));
- $this->assertEquals(5, $drop->getSize());
- $this->assertEquals('hello', $drop->read(5));
- $this->assertEquals(0, $drop->getSize());
- $drop->write('12345678910');
- $this->assertEquals(5, $stream->getSize());
- $this->assertEquals(5, $drop->getSize());
- $this->assertEquals('12345', (string) $drop);
- $this->assertEquals(0, $drop->getSize());
- $drop->write('hello');
- $this->assertFalse($drop->write('test'));
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/Exception/SeekExceptionTest.php b/lib/gerencianet/guzzlehttp/streams/tests/Exception/SeekExceptionTest.php
deleted file mode 100644
index fd8cd1a..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/Exception/SeekExceptionTest.php
+++ /dev/null
@@ -1,16 +0,0 @@
-assertSame($s, $e->getStream());
- $this->assertContains('10', $e->getMessage());
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/FnStreamTest.php b/lib/gerencianet/guzzlehttp/streams/tests/FnStreamTest.php
deleted file mode 100644
index 6cc336b..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/FnStreamTest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-seek(1);
- }
-
- public function testProxiesToFunction()
- {
- $s = new FnStream([
- 'read' => function ($len) {
- $this->assertEquals(3, $len);
- return 'foo';
- }
- ]);
-
- $this->assertEquals('foo', $s->read(3));
- }
-
- public function testCanCloseOnDestruct()
- {
- $called = false;
- $s = new FnStream([
- 'close' => function () use (&$called) {
- $called = true;
- }
- ]);
- unset($s);
- $this->assertTrue($called);
- }
-
- public function testDoesNotRequireClose()
- {
- $s = new FnStream([]);
- unset($s);
- }
-
- public function testDecoratesStream()
- {
- $a = Stream::factory('foo');
- $b = FnStream::decorate($a, []);
- $this->assertEquals(3, $b->getSize());
- $this->assertEquals($b->isWritable(), true);
- $this->assertEquals($b->isReadable(), true);
- $this->assertEquals($b->isSeekable(), true);
- $this->assertEquals($b->read(3), 'foo');
- $this->assertEquals($b->tell(), 3);
- $this->assertEquals($a->tell(), 3);
- $this->assertEquals($b->eof(), true);
- $this->assertEquals($a->eof(), true);
- $b->seek(0);
- $this->assertEquals('foo', (string) $b);
- $b->seek(0);
- $this->assertEquals('foo', $b->getContents());
- $this->assertEquals($a->getMetadata(), $b->getMetadata());
- $b->seek(0, SEEK_END);
- $b->write('bar');
- $this->assertEquals('foobar', (string) $b);
- $this->assertInternalType('resource', $b->detach());
- $b->close();
- }
-
- public function testDecoratesWithCustomizations()
- {
- $called = false;
- $a = Stream::factory('foo');
- $b = FnStream::decorate($a, [
- 'read' => function ($len) use (&$called, $a) {
- $called = true;
- return $a->read($len);
- }
- ]);
- $this->assertEquals('foo', $b->read(3));
- $this->assertTrue($called);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/GuzzleStreamWrapperTest.php b/lib/gerencianet/guzzlehttp/streams/tests/GuzzleStreamWrapperTest.php
deleted file mode 100644
index 33c3ecc..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/GuzzleStreamWrapperTest.php
+++ /dev/null
@@ -1,99 +0,0 @@
-assertSame('foo', fread($handle, 3));
- $this->assertSame(3, ftell($handle));
- $this->assertSame(3, fwrite($handle, 'bar'));
- $this->assertSame(0, fseek($handle, 0));
- $this->assertSame('foobar', fread($handle, 6));
- $this->assertTrue(feof($handle));
-
- // This fails on HHVM for some reason
- if (!defined('HHVM_VERSION')) {
- $this->assertEquals([
- 'dev' => 0,
- 'ino' => 0,
- 'mode' => 33206,
- 'nlink' => 0,
- 'uid' => 0,
- 'gid' => 0,
- 'rdev' => 0,
- 'size' => 6,
- 'atime' => 0,
- 'mtime' => 0,
- 'ctime' => 0,
- 'blksize' => 0,
- 'blocks' => 0,
- 0 => 0,
- 1 => 0,
- 2 => 33206,
- 3 => 0,
- 4 => 0,
- 5 => 0,
- 6 => 0,
- 7 => 6,
- 8 => 0,
- 9 => 0,
- 10 => 0,
- 11 => 0,
- 12 => 0,
- ], fstat($handle));
- }
-
- $this->assertTrue(fclose($handle));
- $this->assertSame('foobar', (string) $stream);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesStream()
- {
- $stream = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface')
- ->setMethods(['isReadable', 'isWritable'])
- ->getMockForAbstractClass();
- $stream->expects($this->once())
- ->method('isReadable')
- ->will($this->returnValue(false));
- $stream->expects($this->once())
- ->method('isWritable')
- ->will($this->returnValue(false));
- GuzzleStreamWrapper::getResource($stream);
- }
-
- /**
- * @expectedException \PHPUnit_Framework_Error_Warning
- */
- public function testReturnsFalseWhenStreamDoesNotExist()
- {
- fopen('guzzle://foo', 'r');
- }
-
- public function testCanOpenReadonlyStream()
- {
- $stream = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface')
- ->setMethods(['isReadable', 'isWritable'])
- ->getMockForAbstractClass();
- $stream->expects($this->once())
- ->method('isReadable')
- ->will($this->returnValue(false));
- $stream->expects($this->once())
- ->method('isWritable')
- ->will($this->returnValue(true));
- $r = GuzzleStreamWrapper::getResource($stream);
- $this->assertInternalType('resource', $r);
- fclose($r);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/InflateStreamTest.php b/lib/gerencianet/guzzlehttp/streams/tests/InflateStreamTest.php
deleted file mode 100644
index ead9356..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/InflateStreamTest.php
+++ /dev/null
@@ -1,16 +0,0 @@
-assertEquals('test', (string) $b);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/LazyOpenStreamTest.php b/lib/gerencianet/guzzlehttp/streams/tests/LazyOpenStreamTest.php
deleted file mode 100644
index 79e0078..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/LazyOpenStreamTest.php
+++ /dev/null
@@ -1,64 +0,0 @@
-fname = tempnam('/tmp', 'tfile');
-
- if (file_exists($this->fname)) {
- unlink($this->fname);
- }
- }
-
- public function tearDown()
- {
- if (file_exists($this->fname)) {
- unlink($this->fname);
- }
- }
-
- public function testOpensLazily()
- {
- $l = new LazyOpenStream($this->fname, 'w+');
- $l->write('foo');
- $this->assertInternalType('array', $l->getMetadata());
- $this->assertFileExists($this->fname);
- $this->assertEquals('foo', file_get_contents($this->fname));
- $this->assertEquals('foo', (string) $l);
- }
-
- public function testProxiesToFile()
- {
- file_put_contents($this->fname, 'foo');
- $l = new LazyOpenStream($this->fname, 'r');
- $this->assertEquals('foo', $l->read(4));
- $this->assertTrue($l->eof());
- $this->assertEquals(3, $l->tell());
- $this->assertTrue($l->isReadable());
- $this->assertTrue($l->isSeekable());
- $this->assertFalse($l->isWritable());
- $l->seek(1);
- $this->assertEquals('oo', $l->getContents());
- $this->assertEquals('foo', (string) $l);
- $this->assertEquals(3, $l->getSize());
- $this->assertInternalType('array', $l->getMetadata());
- $l->close();
- }
-
- public function testDetachesUnderlyingStream()
- {
- file_put_contents($this->fname, 'foo');
- $l = new LazyOpenStream($this->fname, 'r');
- $r = $l->detach();
- $this->assertInternalType('resource', $r);
- fseek($r, 0);
- $this->assertEquals('foo', stream_get_contents($r));
- fclose($r);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/LimitStreamTest.php b/lib/gerencianet/guzzlehttp/streams/tests/LimitStreamTest.php
deleted file mode 100644
index efb1dc5..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/LimitStreamTest.php
+++ /dev/null
@@ -1,133 +0,0 @@
-decorated = Stream::factory(fopen(__FILE__, 'r'));
- $this->body = new LimitStream($this->decorated, 10, 3);
- }
-
- public function testReturnsSubset()
- {
- $body = new LimitStream(Stream::factory('foo'), -1, 1);
- $this->assertEquals('oo', (string) $body);
- $this->assertTrue($body->eof());
- $body->seek(0);
- $this->assertFalse($body->eof());
- $this->assertEquals('oo', $body->read(100));
- $this->assertTrue($body->eof());
- }
-
- public function testReturnsSubsetWhenCastToString()
- {
- $body = Stream::factory('foo_baz_bar');
- $limited = new LimitStream($body, 3, 4);
- $this->assertEquals('baz', (string) $limited);
- }
-
- public function testReturnsSubsetOfEmptyBodyWhenCastToString()
- {
- $body = Stream::factory('');
- $limited = new LimitStream($body, 0, 10);
- $this->assertEquals('', (string) $limited);
- }
-
- public function testSeeksWhenConstructed()
- {
- $this->assertEquals(0, $this->body->tell());
- $this->assertEquals(3, $this->decorated->tell());
- }
-
- public function testAllowsBoundedSeek()
- {
- $this->assertEquals(true, $this->body->seek(100));
- $this->assertEquals(10, $this->body->tell());
- $this->assertEquals(13, $this->decorated->tell());
- $this->assertEquals(true, $this->body->seek(0));
- $this->assertEquals(0, $this->body->tell());
- $this->assertEquals(3, $this->decorated->tell());
- $this->assertEquals(false, $this->body->seek(-10));
- $this->assertEquals(0, $this->body->tell());
- $this->assertEquals(3, $this->decorated->tell());
- $this->assertEquals(true, $this->body->seek(5));
- $this->assertEquals(5, $this->body->tell());
- $this->assertEquals(8, $this->decorated->tell());
- $this->assertEquals(false, $this->body->seek(1000, SEEK_END));
- }
-
- public function testReadsOnlySubsetOfData()
- {
- $data = $this->body->read(100);
- $this->assertEquals(10, strlen($data));
- $this->assertFalse($this->body->read(1000));
-
- $this->body->setOffset(10);
- $newData = $this->body->read(100);
- $this->assertEquals(10, strlen($newData));
- $this->assertNotSame($data, $newData);
- }
-
- /**
- * @expectedException \GuzzleHttp\Stream\Exception\SeekException
- * @expectedExceptionMessage Could not seek the stream to position 2
- */
- public function testThrowsWhenCurrentGreaterThanOffsetSeek()
- {
- $a = Stream::factory('foo_bar');
- $b = new NoSeekStream($a);
- $c = new LimitStream($b);
- $a->getContents();
- $c->setOffset(2);
- }
-
- public function testClaimsConsumedWhenReadLimitIsReached()
- {
- $this->assertFalse($this->body->eof());
- $this->body->read(1000);
- $this->assertTrue($this->body->eof());
- }
-
- public function testContentLengthIsBounded()
- {
- $this->assertEquals(10, $this->body->getSize());
- }
-
- public function testGetContentsIsBasedOnSubset()
- {
- $body = new LimitStream(Stream::factory('foobazbar'), 3, 3);
- $this->assertEquals('baz', $body->getContents());
- }
-
- public function testReturnsNullIfSizeCannotBeDetermined()
- {
- $a = new FnStream([
- 'getSize' => function () { return null; },
- 'tell' => function () { return 0; },
- ]);
- $b = new LimitStream($a);
- $this->assertNull($b->getSize());
- }
-
- public function testLengthLessOffsetWhenNoLimitSize()
- {
- $a = Stream::factory('foo_bar');
- $b = new LimitStream($a, -1, 4);
- $this->assertEquals(3, $b->getSize());
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/NoSeekStreamTest.php b/lib/gerencianet/guzzlehttp/streams/tests/NoSeekStreamTest.php
deleted file mode 100644
index 21b7c6d..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/NoSeekStreamTest.php
+++ /dev/null
@@ -1,41 +0,0 @@
-getMockBuilder('GuzzleHttp\Stream\StreamInterface')
- ->setMethods(['isSeekable', 'seek'])
- ->getMockForAbstractClass();
- $s->expects($this->never())->method('seek');
- $s->expects($this->never())->method('isSeekable');
- $wrapped = new NoSeekStream($s);
- $this->assertFalse($wrapped->isSeekable());
- $this->assertFalse($wrapped->seek(2));
- }
-
- public function testHandlesClose()
- {
- $s = Stream::factory('foo');
- $wrapped = new NoSeekStream($s);
- $wrapped->close();
- $this->assertFalse($wrapped->write('foo'));
- }
-
- public function testCanAttach()
- {
- $s1 = Stream::factory('foo');
- $s2 = Stream::factory('bar');
- $wrapped = new NoSeekStream($s1);
- $wrapped->attach($s2->detach());
- $this->assertEquals('bar', (string) $wrapped);
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/NullStreamTest.php b/lib/gerencianet/guzzlehttp/streams/tests/NullStreamTest.php
deleted file mode 100644
index 8e41431..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/NullStreamTest.php
+++ /dev/null
@@ -1,39 +0,0 @@
-assertEquals('', $b->read(10));
- $this->assertEquals(4, $b->write('test'));
- $this->assertEquals('', (string) $b);
- $this->assertNull($b->getMetadata('a'));
- $this->assertEquals([], $b->getMetadata());
- $this->assertEquals(0, $b->getSize());
- $this->assertEquals('', $b->getContents());
- $this->assertEquals(0, $b->tell());
-
- $this->assertTrue($b->isReadable());
- $this->assertTrue($b->isWritable());
- $this->assertTrue($b->isSeekable());
- $this->assertFalse($b->seek(10));
-
- $this->assertTrue($b->eof());
- $b->detach();
- $this->assertTrue($b->eof());
- $b->close();
- }
-
- /**
- * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException
- */
- public function testCannotAttach()
- {
- $p = new NullStream();
- $p->attach('a');
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/PumpStreamTest.php b/lib/gerencianet/guzzlehttp/streams/tests/PumpStreamTest.php
deleted file mode 100644
index 2d20ce9..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/PumpStreamTest.php
+++ /dev/null
@@ -1,77 +0,0 @@
- ['foo' => 'bar'],
- 'size' => 100
- ]);
-
- $this->assertEquals('bar', $p->getMetadata('foo'));
- $this->assertEquals(['foo' => 'bar'], $p->getMetadata());
- $this->assertEquals(100, $p->getSize());
- }
-
- public function testCanReadFromCallable()
- {
- $p = Stream::factory(function ($size) {
- return 'a';
- });
- $this->assertEquals('a', $p->read(1));
- $this->assertEquals(1, $p->tell());
- $this->assertEquals('aaaaa', $p->read(5));
- $this->assertEquals(6, $p->tell());
- }
-
- public function testStoresExcessDataInBuffer()
- {
- $called = [];
- $p = Stream::factory(function ($size) use (&$called) {
- $called[] = $size;
- return 'abcdef';
- });
- $this->assertEquals('a', $p->read(1));
- $this->assertEquals('b', $p->read(1));
- $this->assertEquals('cdef', $p->read(4));
- $this->assertEquals('abcdefabc', $p->read(9));
- $this->assertEquals([1, 9, 3], $called);
- }
-
- public function testInifiniteStreamWrappedInLimitStream()
- {
- $p = Stream::factory(function () { return 'a'; });
- $s = new LimitStream($p, 5);
- $this->assertEquals('aaaaa', (string) $s);
- }
-
- public function testDescribesCapabilities()
- {
- $p = Stream::factory(function () {});
- $this->assertTrue($p->isReadable());
- $this->assertFalse($p->isSeekable());
- $this->assertFalse($p->isWritable());
- $this->assertNull($p->getSize());
- $this->assertFalse($p->write('aa'));
- $this->assertEquals('', $p->getContents());
- $this->assertEquals('', (string) $p);
- $p->close();
- $this->assertEquals('', $p->read(10));
- $this->assertTrue($p->eof());
- }
-
- /**
- * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException
- */
- public function testCannotAttach()
- {
- $p = Stream::factory(function () {});
- $p->attach('a');
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/StreamDecoratorTraitTest.php b/lib/gerencianet/guzzlehttp/streams/tests/StreamDecoratorTraitTest.php
deleted file mode 100644
index 2ba79ad..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/StreamDecoratorTraitTest.php
+++ /dev/null
@@ -1,147 +0,0 @@
-c = fopen('php://temp', 'r+');
- fwrite($this->c, 'foo');
- fseek($this->c, 0);
- $this->a = Stream::factory($this->c);
- $this->b = new Str($this->a);
- }
-
- public function testCatchesExceptionsWhenCastingToString()
- {
- $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface')
- ->setMethods(['read'])
- ->getMockForAbstractClass();
- $s->expects($this->once())
- ->method('read')
- ->will($this->throwException(new \Exception('foo')));
- $msg = '';
- set_error_handler(function ($errNo, $str) use (&$msg) { $msg = $str; });
- echo new Str($s);
- restore_error_handler();
- $this->assertContains('foo', $msg);
- }
-
- public function testToString()
- {
- $this->assertEquals('foo', (string) $this->b);
- }
-
- public function testHasSize()
- {
- $this->assertEquals(3, $this->b->getSize());
- $this->assertSame($this->b, $this->b->setSize(2));
- $this->assertEquals(2, $this->b->getSize());
- }
-
- public function testReads()
- {
- $this->assertEquals('foo', $this->b->read(10));
- }
-
- public function testCheckMethods()
- {
- $this->assertEquals($this->a->isReadable(), $this->b->isReadable());
- $this->assertEquals($this->a->isWritable(), $this->b->isWritable());
- $this->assertEquals($this->a->isSeekable(), $this->b->isSeekable());
- }
-
- public function testSeeksAndTells()
- {
- $this->assertTrue($this->b->seek(1));
- $this->assertEquals(1, $this->a->tell());
- $this->assertEquals(1, $this->b->tell());
- $this->assertTrue($this->b->seek(0));
- $this->assertEquals(0, $this->a->tell());
- $this->assertEquals(0, $this->b->tell());
- $this->assertTrue($this->b->seek(0, SEEK_END));
- $this->assertEquals(3, $this->a->tell());
- $this->assertEquals(3, $this->b->tell());
- }
-
- public function testGetsContents()
- {
- $this->assertEquals('foo', $this->b->getContents());
- $this->assertEquals('', $this->b->getContents());
- $this->b->seek(1);
- $this->assertEquals('oo', $this->b->getContents(1));
- }
-
- public function testCloses()
- {
- $this->b->close();
- $this->assertFalse(is_resource($this->c));
- }
-
- public function testDetaches()
- {
- $this->b->detach();
- $this->assertFalse($this->b->isReadable());
- }
-
- /**
- * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException
- */
- public function testCannotAttachByDefault()
- {
- $this->b->attach('a');
- }
-
- public function testWrapsMetadata()
- {
- $this->assertSame($this->b->getMetadata(), $this->a->getMetadata());
- $this->assertSame($this->b->getMetadata('uri'), $this->a->getMetadata('uri'));
- }
-
- public function testWrapsWrites()
- {
- $this->b->seek(0, SEEK_END);
- $this->b->write('foo');
- $this->assertEquals('foofoo', (string) $this->a);
- }
-
- /**
- * @expectedException \UnexpectedValueException
- */
- public function testThrowsWithInvalidGetter()
- {
- $this->b->foo;
- }
-
- /**
- * @expectedException \BadMethodCallException
- */
- public function testThrowsWhenGetterNotImplemented()
- {
- $s = new BadStream();
- $s->stream;
- }
-}
-
-class BadStream
-{
- use StreamDecoratorTrait;
-
- public function __construct() {}
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/StreamTest.php b/lib/gerencianet/guzzlehttp/streams/tests/StreamTest.php
deleted file mode 100644
index 2985bfb..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/StreamTest.php
+++ /dev/null
@@ -1,252 +0,0 @@
-assertTrue($stream->isReadable());
- $this->assertTrue($stream->isWritable());
- $this->assertTrue($stream->isSeekable());
- $this->assertEquals('php://temp', $stream->getMetadata('uri'));
- $this->assertInternalType('array', $stream->getMetadata());
- $this->assertEquals(4, $stream->getSize());
- $this->assertFalse($stream->eof());
- $stream->close();
- }
-
- public function testStreamClosesHandleOnDestruct()
- {
- $handle = fopen('php://temp', 'r');
- $stream = new Stream($handle);
- unset($stream);
- $this->assertFalse(is_resource($handle));
- }
-
- public function testConvertsToString()
- {
- $handle = fopen('php://temp', 'w+');
- fwrite($handle, 'data');
- $stream = new Stream($handle);
- $this->assertEquals('data', (string) $stream);
- $this->assertEquals('data', (string) $stream);
- $stream->close();
- }
-
- public function testGetsContents()
- {
- $handle = fopen('php://temp', 'w+');
- fwrite($handle, 'data');
- $stream = new Stream($handle);
- $this->assertEquals('', $stream->getContents());
- $stream->seek(0);
- $this->assertEquals('data', $stream->getContents());
- $this->assertEquals('', $stream->getContents());
- }
-
- public function testChecksEof()
- {
- $handle = fopen('php://temp', 'w+');
- fwrite($handle, 'data');
- $stream = new Stream($handle);
- $this->assertFalse($stream->eof());
- $stream->read(4);
- $this->assertTrue($stream->eof());
- $stream->close();
- }
-
- public function testAllowsSettingManualSize()
- {
- $handle = fopen('php://temp', 'w+');
- fwrite($handle, 'data');
- $stream = new Stream($handle);
- $stream->setSize(10);
- $this->assertEquals(10, $stream->getSize());
- $stream->close();
- }
-
- public function testGetSize()
- {
- $size = filesize(__FILE__);
- $handle = fopen(__FILE__, 'r');
- $stream = new Stream($handle);
- $this->assertEquals($size, $stream->getSize());
- // Load from cache
- $this->assertEquals($size, $stream->getSize());
- $stream->close();
- }
-
- public function testEnsuresSizeIsConsistent()
- {
- $h = fopen('php://temp', 'w+');
- $this->assertEquals(3, fwrite($h, 'foo'));
- $stream = new Stream($h);
- $this->assertEquals(3, $stream->getSize());
- $this->assertEquals(4, $stream->write('test'));
- $this->assertEquals(7, $stream->getSize());
- $this->assertEquals(7, $stream->getSize());
- $stream->close();
- }
-
- public function testProvidesStreamPosition()
- {
- $handle = fopen('php://temp', 'w+');
- $stream = new Stream($handle);
- $this->assertEquals(0, $stream->tell());
- $stream->write('foo');
- $this->assertEquals(3, $stream->tell());
- $stream->seek(1);
- $this->assertEquals(1, $stream->tell());
- $this->assertSame(ftell($handle), $stream->tell());
- $stream->close();
- }
-
- public function testKeepsPositionOfResource()
- {
- $h = fopen(__FILE__, 'r');
- fseek($h, 10);
- $stream = Stream::factory($h);
- $this->assertEquals(10, $stream->tell());
- $stream->close();
- }
-
- public function testCanDetachAndAttachStream()
- {
- $r = fopen('php://temp', 'w+');
- $stream = new Stream($r);
- $stream->write('foo');
- $this->assertTrue($stream->isReadable());
- $this->assertSame($r, $stream->detach());
- $this->assertNull($stream->detach());
-
- $this->assertFalse($stream->isReadable());
- $this->assertFalse($stream->read(10));
- $this->assertFalse($stream->isWritable());
- $this->assertFalse($stream->write('bar'));
- $this->assertFalse($stream->isSeekable());
- $this->assertFalse($stream->seek(10));
- $this->assertFalse($stream->tell());
- $this->assertTrue($stream->eof());
- $this->assertNull($stream->getSize());
- $this->assertSame('', (string) $stream);
- $this->assertSame('', $stream->getContents());
-
- $stream->attach($r);
- $stream->seek(0);
- $this->assertEquals('foo', $stream->getContents());
- $this->assertTrue($stream->isReadable());
- $this->assertTrue($stream->isWritable());
- $this->assertTrue($stream->isSeekable());
-
- $stream->close();
- }
-
- public function testCloseClearProperties()
- {
- $handle = fopen('php://temp', 'r+');
- $stream = new Stream($handle);
- $stream->close();
-
- $this->assertEmpty($stream->getMetadata());
- $this->assertFalse($stream->isSeekable());
- $this->assertFalse($stream->isReadable());
- $this->assertFalse($stream->isWritable());
- $this->assertNull($stream->getSize());
- }
-
- public function testCreatesWithFactory()
- {
- $stream = Stream::factory('foo');
- $this->assertInstanceOf('GuzzleHttp\Stream\Stream', $stream);
- $this->assertEquals('foo', $stream->getContents());
- $stream->close();
- }
-
- public function testFactoryCreatesFromEmptyString()
- {
- $s = Stream::factory();
- $this->assertInstanceOf('GuzzleHttp\Stream\Stream', $s);
- }
-
- public function testFactoryCreatesFromResource()
- {
- $r = fopen(__FILE__, 'r');
- $s = Stream::factory($r);
- $this->assertInstanceOf('GuzzleHttp\Stream\Stream', $s);
- $this->assertSame(file_get_contents(__FILE__), (string) $s);
- }
-
- public function testFactoryCreatesFromObjectWithToString()
- {
- $r = new HasToString();
- $s = Stream::factory($r);
- $this->assertInstanceOf('GuzzleHttp\Stream\Stream', $s);
- $this->assertEquals('foo', (string) $s);
- }
-
- public function testCreatePassesThrough()
- {
- $s = Stream::factory('foo');
- $this->assertSame($s, Stream::factory($s));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testThrowsExceptionForUnknown()
- {
- Stream::factory(new \stdClass());
- }
-
- public function testReturnsCustomMetadata()
- {
- $s = Stream::factory('foo', ['metadata' => ['hwm' => 3]]);
- $this->assertEquals(3, $s->getMetadata('hwm'));
- $this->assertArrayHasKey('hwm', $s->getMetadata());
- }
-
- public function testCanSetSize()
- {
- $s = Stream::factory('', ['size' => 10]);
- $this->assertEquals(10, $s->getSize());
- }
-
- public function testCanCreateIteratorBasedStream()
- {
- $a = new \ArrayIterator(['foo', 'bar', '123']);
- $p = Stream::factory($a);
- $this->assertInstanceOf('GuzzleHttp\Stream\PumpStream', $p);
- $this->assertEquals('foo', $p->read(3));
- $this->assertFalse($p->eof());
- $this->assertEquals('b', $p->read(1));
- $this->assertEquals('a', $p->read(1));
- $this->assertEquals('r12', $p->read(3));
- $this->assertFalse($p->eof());
- $this->assertEquals('3', $p->getContents());
- $this->assertTrue($p->eof());
- $this->assertEquals(9, $p->tell());
- }
-}
-
-class HasToString
-{
- public function __toString() {
- return 'foo';
- }
-}
diff --git a/lib/gerencianet/guzzlehttp/streams/tests/UtilsTest.php b/lib/gerencianet/guzzlehttp/streams/tests/UtilsTest.php
deleted file mode 100644
index 6e3e3b2..0000000
--- a/lib/gerencianet/guzzlehttp/streams/tests/UtilsTest.php
+++ /dev/null
@@ -1,155 +0,0 @@
-assertEquals('foobaz', Utils::copyToString($s));
- $s->seek(0);
- $this->assertEquals('foo', Utils::copyToString($s, 3));
- $this->assertEquals('baz', Utils::copyToString($s, 3));
- $this->assertEquals('', Utils::copyToString($s));
- }
-
- public function testCopiesToStringStopsWhenReadFails()
- {
- $s1 = Stream::factory('foobaz');
- $s1 = FnStream::decorate($s1, [
- 'read' => function () {
- return false;
- }
- ]);
- $result = Utils::copyToString($s1);
- $this->assertEquals('', $result);
- }
-
- public function testCopiesToStream()
- {
- $s1 = Stream::factory('foobaz');
- $s2 = Stream::factory('');
- Utils::copyToStream($s1, $s2);
- $this->assertEquals('foobaz', (string) $s2);
- $s2 = Stream::factory('');
- $s1->seek(0);
- Utils::copyToStream($s1, $s2, 3);
- $this->assertEquals('foo', (string) $s2);
- Utils::copyToStream($s1, $s2, 3);
- $this->assertEquals('foobaz', (string) $s2);
- }
-
- public function testStopsCopyToStreamWhenWriteFails()
- {
- $s1 = Stream::factory('foobaz');
- $s2 = Stream::factory('');
- $s2 = FnStream::decorate($s2, ['write' => function () { return 0; }]);
- Utils::copyToStream($s1, $s2);
- $this->assertEquals('', (string) $s2);
- }
-
- public function testStopsCopyToSteamWhenWriteFailsWithMaxLen()
- {
- $s1 = Stream::factory('foobaz');
- $s2 = Stream::factory('');
- $s2 = FnStream::decorate($s2, ['write' => function () { return 0; }]);
- Utils::copyToStream($s1, $s2, 10);
- $this->assertEquals('', (string) $s2);
- }
-
- public function testStopsCopyToSteamWhenReadFailsWithMaxLen()
- {
- $s1 = Stream::factory('foobaz');
- $s1 = FnStream::decorate($s1, ['read' => function () { return ''; }]);
- $s2 = Stream::factory('');
- Utils::copyToStream($s1, $s2, 10);
- $this->assertEquals('', (string) $s2);
- }
-
- public function testReadsLines()
- {
- $s = Stream::factory("foo\nbaz\nbar");
- $this->assertEquals("foo\n", Utils::readline($s));
- $this->assertEquals("baz\n", Utils::readline($s));
- $this->assertEquals("bar", Utils::readline($s));
- }
-
- public function testReadsLinesUpToMaxLength()
- {
- $s = Stream::factory("12345\n");
- $this->assertEquals("123", Utils::readline($s, 4));
- $this->assertEquals("45\n", Utils::readline($s));
- }
-
- public function testReadsLineUntilFalseReturnedFromRead()
- {
- $s = $this->getMockBuilder('GuzzleHttp\Stream\Stream')
- ->setMethods(['read', 'eof'])
- ->disableOriginalConstructor()
- ->getMock();
- $s->expects($this->exactly(2))
- ->method('read')
- ->will($this->returnCallback(function () {
- static $c = false;
- if ($c) {
- return false;
- }
- $c = true;
- return 'h';
- }));
- $s->expects($this->exactly(2))
- ->method('eof')
- ->will($this->returnValue(false));
- $this->assertEquals("h", Utils::readline($s));
- }
-
- public function testCalculatesHash()
- {
- $s = Stream::factory('foobazbar');
- $this->assertEquals(md5('foobazbar'), Utils::hash($s, 'md5'));
- }
-
- /**
- * @expectedException \GuzzleHttp\Stream\Exception\SeekException
- */
- public function testCalculatesHashThrowsWhenSeekFails()
- {
- $s = new NoSeekStream(Stream::factory('foobazbar'));
- $s->read(2);
- Utils::hash($s, 'md5');
- }
-
- public function testCalculatesHashSeeksToOriginalPosition()
- {
- $s = Stream::factory('foobazbar');
- $s->seek(4);
- $this->assertEquals(md5('foobazbar'), Utils::hash($s, 'md5'));
- $this->assertEquals(4, $s->tell());
- }
-
- public function testOpensFilesSuccessfully()
- {
- $r = Utils::open(__FILE__, 'r');
- $this->assertInternalType('resource', $r);
- fclose($r);
- }
-
- /**
- * @expectedException \RuntimeException
- * @expectedExceptionMessage Unable to open /path/to/does/not/exist using mode r
- */
- public function testThrowsExceptionNotWarning()
- {
- Utils::open('/path/to/does/not/exist', 'r');
- }
-
- public function testProxiesToFactory()
- {
- $this->assertEquals('foo', (string) Utils::create('foo'));
- }
-}
diff --git a/lib/gerencianet/psr/http-client/CHANGELOG.md b/lib/gerencianet/psr/http-client/CHANGELOG.md
new file mode 100644
index 0000000..e2dc25f
--- /dev/null
+++ b/lib/gerencianet/psr/http-client/CHANGELOG.md
@@ -0,0 +1,23 @@
+# Changelog
+
+All notable changes to this project will be documented in this file, in reverse chronological order by release.
+
+## 1.0.1
+
+Allow installation with PHP 8. No code changes.
+
+## 1.0.0
+
+First stable release. No changes since 0.3.0.
+
+## 0.3.0
+
+Added Interface suffix on exceptions
+
+## 0.2.0
+
+All exceptions are in `Psr\Http\Client` namespace
+
+## 0.1.0
+
+First release
diff --git a/lib/gerencianet/psr/http-client/LICENSE b/lib/gerencianet/psr/http-client/LICENSE
new file mode 100644
index 0000000..cd5e002
--- /dev/null
+++ b/lib/gerencianet/psr/http-client/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2017 PHP Framework Interoperability Group
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/lib/gerencianet/psr/http-client/README.md b/lib/gerencianet/psr/http-client/README.md
new file mode 100644
index 0000000..6876b84
--- /dev/null
+++ b/lib/gerencianet/psr/http-client/README.md
@@ -0,0 +1,12 @@
+HTTP Client
+===========
+
+This repository holds all the common code related to [PSR-18 (HTTP Client)][psr-url].
+
+Note that this is not a HTTP Client implementation of its own. It is merely abstractions that describe the components of a HTTP Client.
+
+The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist.
+
+[psr-url]: http://www.php-fig.org/psr/psr-18
+[package-url]: https://packagist.org/packages/psr/http-client
+[implementation-url]: https://packagist.org/providers/psr/http-client-implementation
diff --git a/lib/gerencianet/psr/http-client/composer.json b/lib/gerencianet/psr/http-client/composer.json
new file mode 100644
index 0000000..c195f8f
--- /dev/null
+++ b/lib/gerencianet/psr/http-client/composer.json
@@ -0,0 +1,27 @@
+{
+ "name": "psr/http-client",
+ "description": "Common interface for HTTP clients",
+ "keywords": ["psr", "psr-18", "http", "http-client"],
+ "homepage": "https://github.com/php-fig/http-client",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "require": {
+ "php": "^7.0 || ^8.0",
+ "psr/http-message": "^1.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Client\\": "src/"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ }
+}
diff --git a/lib/gerencianet/psr/http-client/src/ClientExceptionInterface.php b/lib/gerencianet/psr/http-client/src/ClientExceptionInterface.php
new file mode 100644
index 0000000..aa0b9cf
--- /dev/null
+++ b/lib/gerencianet/psr/http-client/src/ClientExceptionInterface.php
@@ -0,0 +1,10 @@
+=5.3.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Message\\": "src/"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ }
+}
diff --git a/lib/gerencianet/psr/http-message/src/MessageInterface.php b/lib/gerencianet/psr/http-message/src/MessageInterface.php
new file mode 100644
index 0000000..dd46e5e
--- /dev/null
+++ b/lib/gerencianet/psr/http-message/src/MessageInterface.php
@@ -0,0 +1,187 @@
+getHeaders() as $name => $values) {
+ * echo $name . ": " . implode(", ", $values);
+ * }
+ *
+ * // Emit headers iteratively:
+ * foreach ($message->getHeaders() as $name => $values) {
+ * foreach ($values as $value) {
+ * header(sprintf('%s: %s', $name, $value), false);
+ * }
+ * }
+ *
+ * While header names are not case-sensitive, getHeaders() will preserve the
+ * exact case in which headers were originally specified.
+ *
+ * @return string[][] Returns an associative array of the message's headers. Each
+ * key MUST be a header name, and each value MUST be an array of strings
+ * for that header.
+ */
+ public function getHeaders();
+
+ /**
+ * Checks if a header exists by the given case-insensitive name.
+ *
+ * @param string $name Case-insensitive header field name.
+ * @return bool Returns true if any header names match the given header
+ * name using a case-insensitive string comparison. Returns false if
+ * no matching header name is found in the message.
+ */
+ public function hasHeader($name);
+
+ /**
+ * Retrieves a message header value by the given case-insensitive name.
+ *
+ * This method returns an array of all the header values of the given
+ * case-insensitive header name.
+ *
+ * If the header does not appear in the message, this method MUST return an
+ * empty array.
+ *
+ * @param string $name Case-insensitive header field name.
+ * @return string[] An array of string values as provided for the given
+ * header. If the header does not appear in the message, this method MUST
+ * return an empty array.
+ */
+ public function getHeader($name);
+
+ /**
+ * Retrieves a comma-separated string of the values for a single header.
+ *
+ * This method returns all of the header values of the given
+ * case-insensitive header name as a string concatenated together using
+ * a comma.
+ *
+ * NOTE: Not all header values may be appropriately represented using
+ * comma concatenation. For such headers, use getHeader() instead
+ * and supply your own delimiter when concatenating.
+ *
+ * If the header does not appear in the message, this method MUST return
+ * an empty string.
+ *
+ * @param string $name Case-insensitive header field name.
+ * @return string A string of values as provided for the given header
+ * concatenated together using a comma. If the header does not appear in
+ * the message, this method MUST return an empty string.
+ */
+ public function getHeaderLine($name);
+
+ /**
+ * Return an instance with the provided value replacing the specified header.
+ *
+ * While header names are case-insensitive, the casing of the header will
+ * be preserved by this function, and returned from getHeaders().
+ *
+ * This method MUST be implemented in such a way as to retain the
+ * immutability of the message, and MUST return an instance that has the
+ * new and/or updated header and value.
+ *
+ * @param string $name Case-insensitive header field name.
+ * @param string|string[] $value Header value(s).
+ * @return static
+ * @throws \InvalidArgumentException for invalid header names or values.
+ */
+ public function withHeader($name, $value);
+
+ /**
+ * Return an instance with the specified header appended with the given value.
+ *
+ * Existing values for the specified header will be maintained. The new
+ * value(s) will be appended to the existing list. If the header did not
+ * exist previously, it will be added.
+ *
+ * This method MUST be implemented in such a way as to retain the
+ * immutability of the message, and MUST return an instance that has the
+ * new header and/or value.
+ *
+ * @param string $name Case-insensitive header field name to add.
+ * @param string|string[] $value Header value(s).
+ * @return static
+ * @throws \InvalidArgumentException for invalid header names or values.
+ */
+ public function withAddedHeader($name, $value);
+
+ /**
+ * Return an instance without the specified header.
+ *
+ * Header resolution MUST be done without case-sensitivity.
+ *
+ * This method MUST be implemented in such a way as to retain the
+ * immutability of the message, and MUST return an instance that removes
+ * the named header.
+ *
+ * @param string $name Case-insensitive header field name to remove.
+ * @return static
+ */
+ public function withoutHeader($name);
+
+ /**
+ * Gets the body of the message.
+ *
+ * @return StreamInterface Returns the body as a stream.
+ */
+ public function getBody();
+
+ /**
+ * Return an instance with the specified message body.
+ *
+ * The body MUST be a StreamInterface object.
+ *
+ * This method MUST be implemented in such a way as to retain the
+ * immutability of the message, and MUST return a new instance that has the
+ * new body stream.
+ *
+ * @param StreamInterface $body Body.
+ * @return static
+ * @throws \InvalidArgumentException When the body is not valid.
+ */
+ public function withBody(StreamInterface $body);
+}
diff --git a/lib/gerencianet/psr/http-message/src/RequestInterface.php b/lib/gerencianet/psr/http-message/src/RequestInterface.php
new file mode 100644
index 0000000..a96d4fd
--- /dev/null
+++ b/lib/gerencianet/psr/http-message/src/RequestInterface.php
@@ -0,0 +1,129 @@
+getQuery()`
+ * or from the `QUERY_STRING` server param.
+ *
+ * @return array
+ */
+ public function getQueryParams();
+
+ /**
+ * Return an instance with the specified query string arguments.
+ *
+ * These values SHOULD remain immutable over the course of the incoming
+ * request. They MAY be injected during instantiation, such as from PHP's
+ * $_GET superglobal, or MAY be derived from some other value such as the
+ * URI. In cases where the arguments are parsed from the URI, the data
+ * MUST be compatible with what PHP's parse_str() would return for
+ * purposes of how duplicate query parameters are handled, and how nested
+ * sets are handled.
+ *
+ * Setting query string arguments MUST NOT change the URI stored by the
+ * request, nor the values in the server params.
+ *
+ * This method MUST be implemented in such a way as to retain the
+ * immutability of the message, and MUST return an instance that has the
+ * updated query string arguments.
+ *
+ * @param array $query Array of query string arguments, typically from
+ * $_GET.
+ * @return static
+ */
+ public function withQueryParams(array $query);
+
+ /**
+ * Retrieve normalized file upload data.
+ *
+ * This method returns upload metadata in a normalized tree, with each leaf
+ * an instance of Psr\Http\Message\UploadedFileInterface.
+ *
+ * These values MAY be prepared from $_FILES or the message body during
+ * instantiation, or MAY be injected via withUploadedFiles().
+ *
+ * @return array An array tree of UploadedFileInterface instances; an empty
+ * array MUST be returned if no data is present.
+ */
+ public function getUploadedFiles();
+
+ /**
+ * Create a new instance with the specified uploaded files.
+ *
+ * This method MUST be implemented in such a way as to retain the
+ * immutability of the message, and MUST return an instance that has the
+ * updated body parameters.
+ *
+ * @param array $uploadedFiles An array tree of UploadedFileInterface instances.
+ * @return static
+ * @throws \InvalidArgumentException if an invalid structure is provided.
+ */
+ public function withUploadedFiles(array $uploadedFiles);
+
+ /**
+ * Retrieve any parameters provided in the request body.
+ *
+ * If the request Content-Type is either application/x-www-form-urlencoded
+ * or multipart/form-data, and the request method is POST, this method MUST
+ * return the contents of $_POST.
+ *
+ * Otherwise, this method may return any results of deserializing
+ * the request body content; as parsing returns structured content, the
+ * potential types MUST be arrays or objects only. A null value indicates
+ * the absence of body content.
+ *
+ * @return null|array|object The deserialized body parameters, if any.
+ * These will typically be an array or object.
+ */
+ public function getParsedBody();
+
+ /**
+ * Return an instance with the specified body parameters.
+ *
+ * These MAY be injected during instantiation.
+ *
+ * If the request Content-Type is either application/x-www-form-urlencoded
+ * or multipart/form-data, and the request method is POST, use this method
+ * ONLY to inject the contents of $_POST.
+ *
+ * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of
+ * deserializing the request body content. Deserialization/parsing returns
+ * structured data, and, as such, this method ONLY accepts arrays or objects,
+ * or a null value if nothing was available to parse.
+ *
+ * As an example, if content negotiation determines that the request data
+ * is a JSON payload, this method could be used to create a request
+ * instance with the deserialized parameters.
+ *
+ * This method MUST be implemented in such a way as to retain the
+ * immutability of the message, and MUST return an instance that has the
+ * updated body parameters.
+ *
+ * @param null|array|object $data The deserialized body data. This will
+ * typically be in an array or object.
+ * @return static
+ * @throws \InvalidArgumentException if an unsupported argument type is
+ * provided.
+ */
+ public function withParsedBody($data);
+
+ /**
+ * Retrieve attributes derived from the request.
+ *
+ * The request "attributes" may be used to allow injection of any
+ * parameters derived from the request: e.g., the results of path
+ * match operations; the results of decrypting cookies; the results of
+ * deserializing non-form-encoded message bodies; etc. Attributes
+ * will be application and request specific, and CAN be mutable.
+ *
+ * @return array Attributes derived from the request.
+ */
+ public function getAttributes();
+
+ /**
+ * Retrieve a single derived request attribute.
+ *
+ * Retrieves a single derived request attribute as described in
+ * getAttributes(). If the attribute has not been previously set, returns
+ * the default value as provided.
+ *
+ * This method obviates the need for a hasAttribute() method, as it allows
+ * specifying a default value to return if the attribute is not found.
+ *
+ * @see getAttributes()
+ * @param string $name The attribute name.
+ * @param mixed $default Default value to return if the attribute does not exist.
+ * @return mixed
+ */
+ public function getAttribute($name, $default = null);
+
+ /**
+ * Return an instance with the specified derived request attribute.
+ *
+ * This method allows setting a single derived request attribute as
+ * described in getAttributes().
+ *
+ * This method MUST be implemented in such a way as to retain the
+ * immutability of the message, and MUST return an instance that has the
+ * updated attribute.
+ *
+ * @see getAttributes()
+ * @param string $name The attribute name.
+ * @param mixed $value The value of the attribute.
+ * @return static
+ */
+ public function withAttribute($name, $value);
+
+ /**
+ * Return an instance that removes the specified derived request attribute.
+ *
+ * This method allows removing a single derived request attribute as
+ * described in getAttributes().
+ *
+ * This method MUST be implemented in such a way as to retain the
+ * immutability of the message, and MUST return an instance that removes
+ * the attribute.
+ *
+ * @see getAttributes()
+ * @param string $name The attribute name.
+ * @return static
+ */
+ public function withoutAttribute($name);
+}
diff --git a/lib/gerencianet/psr/http-message/src/StreamInterface.php b/lib/gerencianet/psr/http-message/src/StreamInterface.php
new file mode 100644
index 0000000..f68f391
--- /dev/null
+++ b/lib/gerencianet/psr/http-message/src/StreamInterface.php
@@ -0,0 +1,158 @@
+
+ * [user-info@]host[:port]
+ *
+ *
+ * If the port component is not set or is the standard port for the current
+ * scheme, it SHOULD NOT be included.
+ *
+ * @see https://tools.ietf.org/html/rfc3986#section-3.2
+ * @return string The URI authority, in "[user-info@]host[:port]" format.
+ */
+ public function getAuthority();
+
+ /**
+ * Retrieve the user information component of the URI.
+ *
+ * If no user information is present, this method MUST return an empty
+ * string.
+ *
+ * If a user is present in the URI, this will return that value;
+ * additionally, if the password is also present, it will be appended to the
+ * user value, with a colon (":") separating the values.
+ *
+ * The trailing "@" character is not part of the user information and MUST
+ * NOT be added.
+ *
+ * @return string The URI user information, in "username[:password]" format.
+ */
+ public function getUserInfo();
+
+ /**
+ * Retrieve the host component of the URI.
+ *
+ * If no host is present, this method MUST return an empty string.
+ *
+ * The value returned MUST be normalized to lowercase, per RFC 3986
+ * Section 3.2.2.
+ *
+ * @see http://tools.ietf.org/html/rfc3986#section-3.2.2
+ * @return string The URI host.
+ */
+ public function getHost();
+
+ /**
+ * Retrieve the port component of the URI.
+ *
+ * If a port is present, and it is non-standard for the current scheme,
+ * this method MUST return it as an integer. If the port is the standard port
+ * used with the current scheme, this method SHOULD return null.
+ *
+ * If no port is present, and no scheme is present, this method MUST return
+ * a null value.
+ *
+ * If no port is present, but a scheme is present, this method MAY return
+ * the standard port for that scheme, but SHOULD return null.
+ *
+ * @return null|int The URI port.
+ */
+ public function getPort();
+
+ /**
+ * Retrieve the path component of the URI.
+ *
+ * The path can either be empty or absolute (starting with a slash) or
+ * rootless (not starting with a slash). Implementations MUST support all
+ * three syntaxes.
+ *
+ * Normally, the empty path "" and absolute path "/" are considered equal as
+ * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically
+ * do this normalization because in contexts with a trimmed base path, e.g.
+ * the front controller, this difference becomes significant. It's the task
+ * of the user to handle both "" and "/".
+ *
+ * The value returned MUST be percent-encoded, but MUST NOT double-encode
+ * any characters. To determine what characters to encode, please refer to
+ * RFC 3986, Sections 2 and 3.3.
+ *
+ * As an example, if the value should include a slash ("/") not intended as
+ * delimiter between path segments, that value MUST be passed in encoded
+ * form (e.g., "%2F") to the instance.
+ *
+ * @see https://tools.ietf.org/html/rfc3986#section-2
+ * @see https://tools.ietf.org/html/rfc3986#section-3.3
+ * @return string The URI path.
+ */
+ public function getPath();
+
+ /**
+ * Retrieve the query string of the URI.
+ *
+ * If no query string is present, this method MUST return an empty string.
+ *
+ * The leading "?" character is not part of the query and MUST NOT be
+ * added.
+ *
+ * The value returned MUST be percent-encoded, but MUST NOT double-encode
+ * any characters. To determine what characters to encode, please refer to
+ * RFC 3986, Sections 2 and 3.4.
+ *
+ * As an example, if a value in a key/value pair of the query string should
+ * include an ampersand ("&") not intended as a delimiter between values,
+ * that value MUST be passed in encoded form (e.g., "%26") to the instance.
+ *
+ * @see https://tools.ietf.org/html/rfc3986#section-2
+ * @see https://tools.ietf.org/html/rfc3986#section-3.4
+ * @return string The URI query string.
+ */
+ public function getQuery();
+
+ /**
+ * Retrieve the fragment component of the URI.
+ *
+ * If no fragment is present, this method MUST return an empty string.
+ *
+ * The leading "#" character is not part of the fragment and MUST NOT be
+ * added.
+ *
+ * The value returned MUST be percent-encoded, but MUST NOT double-encode
+ * any characters. To determine what characters to encode, please refer to
+ * RFC 3986, Sections 2 and 3.5.
+ *
+ * @see https://tools.ietf.org/html/rfc3986#section-2
+ * @see https://tools.ietf.org/html/rfc3986#section-3.5
+ * @return string The URI fragment.
+ */
+ public function getFragment();
+
+ /**
+ * Return an instance with the specified scheme.
+ *
+ * This method MUST retain the state of the current instance, and return
+ * an instance that contains the specified scheme.
+ *
+ * Implementations MUST support the schemes "http" and "https" case
+ * insensitively, and MAY accommodate other schemes if required.
+ *
+ * An empty scheme is equivalent to removing the scheme.
+ *
+ * @param string $scheme The scheme to use with the new instance.
+ * @return static A new instance with the specified scheme.
+ * @throws \InvalidArgumentException for invalid or unsupported schemes.
+ */
+ public function withScheme($scheme);
+
+ /**
+ * Return an instance with the specified user information.
+ *
+ * This method MUST retain the state of the current instance, and return
+ * an instance that contains the specified user information.
+ *
+ * Password is optional, but the user information MUST include the
+ * user; an empty string for the user is equivalent to removing user
+ * information.
+ *
+ * @param string $user The user name to use for authority.
+ * @param null|string $password The password associated with $user.
+ * @return static A new instance with the specified user information.
+ */
+ public function withUserInfo($user, $password = null);
+
+ /**
+ * Return an instance with the specified host.
+ *
+ * This method MUST retain the state of the current instance, and return
+ * an instance that contains the specified host.
+ *
+ * An empty host value is equivalent to removing the host.
+ *
+ * @param string $host The hostname to use with the new instance.
+ * @return static A new instance with the specified host.
+ * @throws \InvalidArgumentException for invalid hostnames.
+ */
+ public function withHost($host);
+
+ /**
+ * Return an instance with the specified port.
+ *
+ * This method MUST retain the state of the current instance, and return
+ * an instance that contains the specified port.
+ *
+ * Implementations MUST raise an exception for ports outside the
+ * established TCP and UDP port ranges.
+ *
+ * A null value provided for the port is equivalent to removing the port
+ * information.
+ *
+ * @param null|int $port The port to use with the new instance; a null value
+ * removes the port information.
+ * @return static A new instance with the specified port.
+ * @throws \InvalidArgumentException for invalid ports.
+ */
+ public function withPort($port);
+
+ /**
+ * Return an instance with the specified path.
+ *
+ * This method MUST retain the state of the current instance, and return
+ * an instance that contains the specified path.
+ *
+ * The path can either be empty or absolute (starting with a slash) or
+ * rootless (not starting with a slash). Implementations MUST support all
+ * three syntaxes.
+ *
+ * If the path is intended to be domain-relative rather than path relative then
+ * it must begin with a slash ("/"). Paths not starting with a slash ("/")
+ * are assumed to be relative to some base path known to the application or
+ * consumer.
+ *
+ * Users can provide both encoded and decoded path characters.
+ * Implementations ensure the correct encoding as outlined in getPath().
+ *
+ * @param string $path The path to use with the new instance.
+ * @return static A new instance with the specified path.
+ * @throws \InvalidArgumentException for invalid paths.
+ */
+ public function withPath($path);
+
+ /**
+ * Return an instance with the specified query string.
+ *
+ * This method MUST retain the state of the current instance, and return
+ * an instance that contains the specified query string.
+ *
+ * Users can provide both encoded and decoded query characters.
+ * Implementations ensure the correct encoding as outlined in getQuery().
+ *
+ * An empty query string value is equivalent to removing the query string.
+ *
+ * @param string $query The query string to use with the new instance.
+ * @return static A new instance with the specified query string.
+ * @throws \InvalidArgumentException for invalid query strings.
+ */
+ public function withQuery($query);
+
+ /**
+ * Return an instance with the specified URI fragment.
+ *
+ * This method MUST retain the state of the current instance, and return
+ * an instance that contains the specified URI fragment.
+ *
+ * Users can provide both encoded and decoded fragment characters.
+ * Implementations ensure the correct encoding as outlined in getFragment().
+ *
+ * An empty fragment value is equivalent to removing the fragment.
+ *
+ * @param string $fragment The fragment to use with the new instance.
+ * @return static A new instance with the specified fragment.
+ */
+ public function withFragment($fragment);
+
+ /**
+ * Return the string representation as a URI reference.
+ *
+ * Depending on which components of the URI are present, the resulting
+ * string is either a full URI or relative reference according to RFC 3986,
+ * Section 4.1. The method concatenates the various components of the URI,
+ * using the appropriate delimiters:
+ *
+ * - If a scheme is present, it MUST be suffixed by ":".
+ * - If an authority is present, it MUST be prefixed by "//".
+ * - The path can be concatenated without delimiters. But there are two
+ * cases where the path has to be adjusted to make the URI reference
+ * valid as PHP does not allow to throw an exception in __toString():
+ * - If the path is rootless and an authority is present, the path MUST
+ * be prefixed by "/".
+ * - If the path is starting with more than one "/" and no authority is
+ * present, the starting slashes MUST be reduced to one.
+ * - If a query is present, it MUST be prefixed by "?".
+ * - If a fragment is present, it MUST be prefixed by "#".
+ *
+ * @see http://tools.ietf.org/html/rfc3986#section-4.1
+ * @return string
+ */
+ public function __toString();
+}
diff --git a/lib/gerencianet/psr/log/.gitignore b/lib/gerencianet/psr/log/.gitignore
deleted file mode 100644
index 22d0d82..0000000
--- a/lib/gerencianet/psr/log/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-vendor
diff --git a/lib/gerencianet/psr/log/LICENSE b/lib/gerencianet/psr/log/LICENSE
deleted file mode 100644
index 474c952..0000000
--- a/lib/gerencianet/psr/log/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2012 PHP Framework Interoperability Group
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/lib/gerencianet/psr/log/Psr/Log/AbstractLogger.php b/lib/gerencianet/psr/log/Psr/Log/AbstractLogger.php
deleted file mode 100644
index 00f9034..0000000
--- a/lib/gerencianet/psr/log/Psr/Log/AbstractLogger.php
+++ /dev/null
@@ -1,120 +0,0 @@
-log(LogLevel::EMERGENCY, $message, $context);
- }
-
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function alert($message, array $context = array())
- {
- $this->log(LogLevel::ALERT, $message, $context);
- }
-
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function critical($message, array $context = array())
- {
- $this->log(LogLevel::CRITICAL, $message, $context);
- }
-
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function error($message, array $context = array())
- {
- $this->log(LogLevel::ERROR, $message, $context);
- }
-
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function warning($message, array $context = array())
- {
- $this->log(LogLevel::WARNING, $message, $context);
- }
-
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function notice($message, array $context = array())
- {
- $this->log(LogLevel::NOTICE, $message, $context);
- }
-
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function info($message, array $context = array())
- {
- $this->log(LogLevel::INFO, $message, $context);
- }
-
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function debug($message, array $context = array())
- {
- $this->log(LogLevel::DEBUG, $message, $context);
- }
-}
diff --git a/lib/gerencianet/psr/log/Psr/Log/InvalidArgumentException.php b/lib/gerencianet/psr/log/Psr/Log/InvalidArgumentException.php
deleted file mode 100644
index 67f852d..0000000
--- a/lib/gerencianet/psr/log/Psr/Log/InvalidArgumentException.php
+++ /dev/null
@@ -1,7 +0,0 @@
-logger = $logger;
- }
-}
diff --git a/lib/gerencianet/psr/log/Psr/Log/LoggerInterface.php b/lib/gerencianet/psr/log/Psr/Log/LoggerInterface.php
deleted file mode 100644
index 476bb96..0000000
--- a/lib/gerencianet/psr/log/Psr/Log/LoggerInterface.php
+++ /dev/null
@@ -1,114 +0,0 @@
-log(LogLevel::EMERGENCY, $message, $context);
- }
-
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function alert($message, array $context = array())
- {
- $this->log(LogLevel::ALERT, $message, $context);
- }
-
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function critical($message, array $context = array())
- {
- $this->log(LogLevel::CRITICAL, $message, $context);
- }
-
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function error($message, array $context = array())
- {
- $this->log(LogLevel::ERROR, $message, $context);
- }
-
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function warning($message, array $context = array())
- {
- $this->log(LogLevel::WARNING, $message, $context);
- }
-
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function notice($message, array $context = array())
- {
- $this->log(LogLevel::NOTICE, $message, $context);
- }
-
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function info($message, array $context = array())
- {
- $this->log(LogLevel::INFO, $message, $context);
- }
-
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function debug($message, array $context = array())
- {
- $this->log(LogLevel::DEBUG, $message, $context);
- }
-
- /**
- * Logs with an arbitrary level.
- *
- * @param mixed $level
- * @param string $message
- * @param array $context
- * @return null
- */
- abstract public function log($level, $message, array $context = array());
-}
diff --git a/lib/gerencianet/psr/log/Psr/Log/NullLogger.php b/lib/gerencianet/psr/log/Psr/Log/NullLogger.php
deleted file mode 100644
index 553a3c5..0000000
--- a/lib/gerencianet/psr/log/Psr/Log/NullLogger.php
+++ /dev/null
@@ -1,27 +0,0 @@
-logger) { }`
- * blocks.
- */
-class NullLogger extends AbstractLogger
-{
- /**
- * Logs with an arbitrary level.
- *
- * @param mixed $level
- * @param string $message
- * @param array $context
- * @return null
- */
- public function log($level, $message, array $context = array())
- {
- // noop
- }
-}
diff --git a/lib/gerencianet/psr/log/Psr/Log/Test/LoggerInterfaceTest.php b/lib/gerencianet/psr/log/Psr/Log/Test/LoggerInterfaceTest.php
deleted file mode 100644
index a932815..0000000
--- a/lib/gerencianet/psr/log/Psr/Log/Test/LoggerInterfaceTest.php
+++ /dev/null
@@ -1,116 +0,0 @@
- "
- *
- * Example ->error('Foo') would yield "error Foo"
- *
- * @return string[]
- */
- abstract function getLogs();
-
- public function testImplements()
- {
- $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger());
- }
-
- /**
- * @dataProvider provideLevelsAndMessages
- */
- public function testLogsAtAllLevels($level, $message)
- {
- $logger = $this->getLogger();
- $logger->{$level}($message, array('user' => 'Bob'));
- $logger->log($level, $message, array('user' => 'Bob'));
-
- $expected = array(
- $level.' message of level '.$level.' with context: Bob',
- $level.' message of level '.$level.' with context: Bob',
- );
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function provideLevelsAndMessages()
- {
- return array(
- LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'),
- LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'),
- LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'),
- LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'),
- LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'),
- LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'),
- LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'),
- LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'),
- );
- }
-
- /**
- * @expectedException Psr\Log\InvalidArgumentException
- */
- public function testThrowsOnInvalidLevel()
- {
- $logger = $this->getLogger();
- $logger->log('invalid level', 'Foo');
- }
-
- public function testContextReplacement()
- {
- $logger = $this->getLogger();
- $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar'));
-
- $expected = array('info {Message {nothing} Bob Bar a}');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testObjectCastToString()
- {
- $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString'));
- $dummy->expects($this->once())
- ->method('__toString')
- ->will($this->returnValue('DUMMY'));
-
- $this->getLogger()->warning($dummy);
- }
-
- public function testContextCanContainAnything()
- {
- $context = array(
- 'bool' => true,
- 'null' => null,
- 'string' => 'Foo',
- 'int' => 0,
- 'float' => 0.5,
- 'nested' => array('with object' => new DummyTest),
- 'object' => new \DateTime,
- 'resource' => fopen('php://memory', 'r'),
- );
-
- $this->getLogger()->warning('Crazy context data', $context);
- }
-
- public function testContextExceptionKeyCanBeExceptionOrOtherValues()
- {
- $this->getLogger()->warning('Random message', array('exception' => 'oops'));
- $this->getLogger()->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail')));
- }
-}
-
-class DummyTest
-{
-}
\ No newline at end of file
diff --git a/lib/gerencianet/psr/log/README.md b/lib/gerencianet/psr/log/README.md
deleted file mode 100644
index 574bc1c..0000000
--- a/lib/gerencianet/psr/log/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-PSR Log
-=======
-
-This repository holds all interfaces/classes/traits related to
-[PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md).
-
-Note that this is not a logger of its own. It is merely an interface that
-describes a logger. See the specification for more details.
-
-Usage
------
-
-If you need a logger, you can use the interface like this:
-
-```php
-logger = $logger;
- }
-
- public function doSomething()
- {
- if ($this->logger) {
- $this->logger->info('Doing work');
- }
-
- // do something useful
- }
-}
-```
-
-You can then pick one of the implementations of the interface to get a logger.
-
-If you want to implement the interface, you can require this package and
-implement `Psr\Log\LoggerInterface` in your code. Please read the
-[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
-for details.
diff --git a/lib/gerencianet/psr/log/composer.json b/lib/gerencianet/psr/log/composer.json
deleted file mode 100644
index 6bdcc21..0000000
--- a/lib/gerencianet/psr/log/composer.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "psr/log",
- "description": "Common interface for logging libraries",
- "keywords": ["psr", "psr-3", "log"],
- "license": "MIT",
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "autoload": {
- "psr-0": {
- "Psr\\Log\\": ""
- }
- }
-}
diff --git a/lib/gerencianet/ralouphie/getallheaders/LICENSE b/lib/gerencianet/ralouphie/getallheaders/LICENSE
new file mode 100644
index 0000000..be5540c
--- /dev/null
+++ b/lib/gerencianet/ralouphie/getallheaders/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Ralph Khattar
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/lib/gerencianet/ralouphie/getallheaders/README.md b/lib/gerencianet/ralouphie/getallheaders/README.md
new file mode 100644
index 0000000..9430d76
--- /dev/null
+++ b/lib/gerencianet/ralouphie/getallheaders/README.md
@@ -0,0 +1,27 @@
+getallheaders
+=============
+
+PHP `getallheaders()` polyfill. Compatible with PHP >= 5.3.
+
+[](https://travis-ci.org/ralouphie/getallheaders)
+[](https://coveralls.io/r/ralouphie/getallheaders?branch=master)
+[](https://packagist.org/packages/ralouphie/getallheaders)
+[](https://packagist.org/packages/ralouphie/getallheaders)
+[](https://packagist.org/packages/ralouphie/getallheaders)
+
+
+This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php).
+
+## Install
+
+For PHP version **`>= 5.6`**:
+
+```
+composer require ralouphie/getallheaders
+```
+
+For PHP version **`< 5.6`**:
+
+```
+composer require ralouphie/getallheaders "^2"
+```
diff --git a/lib/gerencianet/ralouphie/getallheaders/composer.json b/lib/gerencianet/ralouphie/getallheaders/composer.json
new file mode 100644
index 0000000..de8ce62
--- /dev/null
+++ b/lib/gerencianet/ralouphie/getallheaders/composer.json
@@ -0,0 +1,26 @@
+{
+ "name": "ralouphie/getallheaders",
+ "description": "A polyfill for getallheaders.",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Ralph Khattar",
+ "email": "ralph.khattar@gmail.com"
+ }
+ ],
+ "require": {
+ "php": ">=5.6"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^5 || ^6.5",
+ "php-coveralls/php-coveralls": "^2.1"
+ },
+ "autoload": {
+ "files": ["src/getallheaders.php"]
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "getallheaders\\Tests\\": "tests/"
+ }
+ }
+}
diff --git a/lib/gerencianet/ralouphie/getallheaders/src/getallheaders.php b/lib/gerencianet/ralouphie/getallheaders/src/getallheaders.php
new file mode 100644
index 0000000..c7285a5
--- /dev/null
+++ b/lib/gerencianet/ralouphie/getallheaders/src/getallheaders.php
@@ -0,0 +1,46 @@
+ 'Content-Type',
+ 'CONTENT_LENGTH' => 'Content-Length',
+ 'CONTENT_MD5' => 'Content-Md5',
+ );
+
+ foreach ($_SERVER as $key => $value) {
+ if (substr($key, 0, 5) === 'HTTP_') {
+ $key = substr($key, 5);
+ if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) {
+ $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key))));
+ $headers[$key] = $value;
+ }
+ } elseif (isset($copy_server[$key])) {
+ $headers[$copy_server[$key]] = $value;
+ }
+ }
+
+ if (!isset($headers['Authorization'])) {
+ if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
+ $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
+ } elseif (isset($_SERVER['PHP_AUTH_USER'])) {
+ $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : '';
+ $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass);
+ } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) {
+ $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST'];
+ }
+ }
+
+ return $headers;
+ }
+
+}
diff --git a/lib/gerencianet/react/promise/.gitignore b/lib/gerencianet/react/promise/.gitignore
deleted file mode 100644
index c4bcb78..0000000
--- a/lib/gerencianet/react/promise/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-composer.lock
-composer.phar
-phpunit.xml
-vendor/
diff --git a/lib/gerencianet/react/promise/.travis.yml b/lib/gerencianet/react/promise/.travis.yml
deleted file mode 100644
index 7e7f351..0000000
--- a/lib/gerencianet/react/promise/.travis.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-language: php
-
-php:
- - 5.4
- - 5.5
- - 5.6
- - 7.0
- - hhvm
-
-before_install:
- - composer self-update
-
-install:
- - composer install --prefer-source
-
-script:
- - phpunit -v --coverage-text
diff --git a/lib/gerencianet/react/promise/CHANGELOG.md b/lib/gerencianet/react/promise/CHANGELOG.md
deleted file mode 100644
index 28d279c..0000000
--- a/lib/gerencianet/react/promise/CHANGELOG.md
+++ /dev/null
@@ -1,69 +0,0 @@
-CHANGELOG
-=========
-
-* 2.2.2 (2016-02-26)
-
- * Fix cancellation handlers called multiple times (#47 by @clue).
-
-* 2.2.1 (2015-07-03)
-
- * Fix stack error when resolving a promise in its own fulfillment or rejection
- handlers.
-
-* 2.2.0 (2014-12-30)
-
- * Introduce new ExtendedPromiseInterface implemented by all promises
- * Add new .done() method (part of the ExtendedPromiseInterface)
- * Add new .otherwise() method (part of the ExtendedPromiseInterface)
- * Add new .always() method (part of the ExtendedPromiseInterface)
- * Add new .progress() method (part of the ExtendedPromiseInterface)
- * Rename Deferred::progress to Deferred::notify to avoid confusion with
- ExtendedPromiseInterface::progress (a Deferred::progress alias is still
- available for backward compatibility)
- * resolve() now always returns a ExtendedPromiseInterface
-
-* 2.1.0 (2014-10-15)
-
- * Introduce new CancellablePromiseInterface implemented by all promises
- * Add new .cancel() method (part of the CancellablePromiseInterface)
-
-* 2.0.0 (2013-12-10)
-
- New major release. The goal was to streamline the API and to make it more
- compliant with other promise libraries and especially with the new upcoming
- [ES6 promises specification](https://github.com/domenic/promises-unwrapping/).
-
- * Add standalone Promise class.
- * Add new React\Promise\race() function.
- * BC break: Bump minimum PHP version to PHP 5.4.
- * BC break: Remove ResolverInterface and PromiseInterface from Deferred.
- * BC break: Change signature of PromiseInterface.
- * BC break: Remove When and Util classes and move static methods to functions.
- * BC break: FulfilledPromise and RejectedPromise now throw an exception when
- initialized with a promise instead of a value/reason.
- * BC break: React\Promise\Deferred::resolve() and React\Promise\Deferred::reject()
- no longer return a promise.
-
-* 1.0.4 (2013-04-03)
-
- * Trigger PHP errors when invalid callback is passed.
- * Fully resolve rejection value before calling rejection handler.
- * Add When::lazy() to create lazy promises which will be initialized once a
- consumer calls the then() method.
-
-* 1.0.3 (2012-11-17)
-
- * Add `PromisorInterface` for objects that have a `promise()` method.
-
-* 1.0.2 (2012-11-14)
-
- * Fix bug in When::any() not correctly unwrapping to a single result value
- * $promiseOrValue argument of When::resolve() and When::reject() is now optional
-
-* 1.0.1 (2012-11-13)
-
- * Prevent deep recursion which was reaching `xdebug.max_nesting_level` default of 100
-
-* 1.0.0 (2012-11-07)
-
- * First tagged release
diff --git a/lib/gerencianet/react/promise/LICENSE b/lib/gerencianet/react/promise/LICENSE
deleted file mode 100644
index 5919d20..0000000
--- a/lib/gerencianet/react/promise/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2012-2016 Jan Sorgalla
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
diff --git a/lib/gerencianet/react/promise/README.md b/lib/gerencianet/react/promise/README.md
deleted file mode 100644
index d177e04..0000000
--- a/lib/gerencianet/react/promise/README.md
+++ /dev/null
@@ -1,823 +0,0 @@
-React/Promise
-=============
-
-A lightweight implementation of
-[CommonJS Promises/A](http://wiki.commonjs.org/wiki/Promises/A) for PHP.
-
-[](http://travis-ci.org/reactphp/promise)
-
-Table of Contents
------------------
-
-1. [Introduction](#introduction)
-2. [Concepts](#concepts)
- * [Deferred](#deferred)
- * [Promise](#promise)
-3. [API](#api)
- * [Deferred](#deferred-1)
- * [Deferred::promise()](#deferredpromise)
- * [Deferred::resolve()](#deferredresolve)
- * [Deferred::reject()](#deferredreject)
- * [Deferred::notify()](#deferrednotify)
- * [PromiseInterface](#promiseinterface)
- * [PromiseInterface::then()](#promiseinterfacethen)
- * [ExtendedPromiseInterface](#extendedpromiseinterface)
- * [ExtendedPromiseInterface::done()](#extendedpromiseinterfacedone)
- * [ExtendedPromiseInterface::otherwise()](#extendedpromiseinterfaceotherwise)
- * [ExtendedPromiseInterface::always()](#extendedpromiseinterfacealways)
- * [ExtendedPromiseInterface::progress()](#extendedpromiseinterfaceprogress)
- * [CancellablePromiseInterface](#cancellablepromiseinterface)
- * [CancellablePromiseInterface::cancel()](#cancellablepromiseinterfacecancel)
- * [Promise](#promise-1)
- * [FulfilledPromise](#fulfilledpromise)
- * [RejectedPromise](#rejectedpromise)
- * [LazyPromise](#lazypromise)
- * [Functions](#functions)
- * [resolve()](#resolve)
- * [reject()](#reject)
- * [all()](#all)
- * [race()](#race)
- * [any()](#any)
- * [some()](#some)
- * [map()](#map)
- * [reduce()](#reduce)
- * [PromisorInterface](#promisorinterface)
-4. [Examples](#examples)
- * [How to use Deferred](#how-to-use-deferred)
- * [How promise forwarding works](#how-promise-forwarding-works)
- * [Resolution forwarding](#resolution-forwarding)
- * [Rejection forwarding](#rejection-forwarding)
- * [Mixed resolution and rejection forwarding](#mixed-resolution-and-rejection-forwarding)
- * [Progress event forwarding](#progress-event-forwarding)
- * [done() vs. then()](#done-vs-then)
-5. [Credits](#credits)
-6. [License](#license)
-
-Introduction
-------------
-
-React/Promise is a library implementing
-[CommonJS Promises/A](http://wiki.commonjs.org/wiki/Promises/A) for PHP.
-
-It also provides several other useful promise-related concepts, such as joining
-multiple promises and mapping and reducing collections of promises.
-
-If you've never heard about promises before,
-[read this first](https://gist.github.com/3889970).
-
-Concepts
---------
-
-### Deferred
-
-A **Deferred** represents a computation or unit of work that may not have
-completed yet. Typically (but not always), that computation will be something
-that executes asynchronously and completes at some point in the future.
-
-### Promise
-
-While a deferred represents the computation itself, a **Promise** represents
-the result of that computation. Thus, each deferred has a promise that acts as
-a placeholder for its actual result.
-
-API
----
-
-### Deferred
-
-A deferred represents an operation whose resolution is pending. It has separate
-promise and resolver parts.
-
-```php
-$deferred = new React\Promise\Deferred();
-
-$promise = $deferred->promise();
-
-$deferred->resolve(mixed $value = null);
-$deferred->reject(mixed $reason = null);
-$deferred->notify(mixed $update = null);
-```
-
-The `promise` method returns the promise of the deferred.
-
-The `resolve` and `reject` methods control the state of the deferred.
-
-The `notify` method is for progress notification.
-
-The constructor of the `Deferred` accepts an optional `$canceller` argument.
-See [Promise](#promise-1) for more information.
-
-#### Deferred::promise()
-
-```php
-$promise = $deferred->promise();
-```
-
-Returns the promise of the deferred, which you can hand out to others while
-keeping the authority to modify its state to yourself.
-
-#### Deferred::resolve()
-
-```php
-$deferred->resolve(mixed $value = null);
-```
-
-Resolves the promise returned by `promise()`. All consumers are notified by
-having `$onFulfilled` (which they registered via `$promise->then()`) called with
-`$value`.
-
-If `$value` itself is a promise, the promise will transition to the state of
-this promise once it is resolved.
-
-#### Deferred::reject()
-
-```php
-$deferred->reject(mixed $reason = null);
-```
-
-Rejects the promise returned by `promise()`, signalling that the deferred's
-computation failed.
-All consumers are notified by having `$onRejected` (which they registered via
-`$promise->then()`) called with `$reason`.
-
-If `$reason` itself is a promise, the promise will be rejected with the outcome
-of this promise regardless whether it fulfills or rejects.
-
-#### Deferred::notify()
-
-```php
-$deferred->notify(mixed $update = null);
-```
-
-Triggers progress notifications, to indicate to consumers that the computation
-is making progress toward its result.
-
-All consumers are notified by having `$onProgress` (which they registered via
-`$promise->then()`) called with `$update`.
-
-### PromiseInterface
-
-The promise interface provides the common interface for all promise
-implementations.
-
-A promise represents an eventual outcome, which is either fulfillment (success)
-and an associated value, or rejection (failure) and an associated reason.
-
-Once in the fulfilled or rejected state, a promise becomes immutable.
-Neither its state nor its result (or error) can be modified.
-
-#### Implementations
-
-* [Promise](#promise-1)
-* [FulfilledPromise](#fulfilledpromise)
-* [RejectedPromise](#rejectedpromise)
-* [LazyPromise](#lazypromise)
-
-#### PromiseInterface::then()
-
-```php
-$transformedPromise = $promise->then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null);
-```
-
-Transforms a promise's value by applying a function to the promise's fulfillment
-or rejection value. Returns a new promise for the transformed result.
-
-The `then()` method registers new fulfilled, rejection and progress handlers
-with a promise (all parameters are optional):
-
- * `$onFulfilled` will be invoked once the promise is fulfilled and passed
- the result as the first argument.
- * `$onRejected` will be invoked once the promise is rejected and passed the
- reason as the first argument.
- * `$onProgress` will be invoked whenever the producer of the promise
- triggers progress notifications and passed a single argument (whatever it
- wants) to indicate progress.
-
-It returns a new promise that will fulfill with the return value of either
-`$onFulfilled` or `$onRejected`, whichever is called, or will reject with
-the thrown exception if either throws.
-
-A promise makes the following guarantees about handlers registered in
-the same call to `then()`:
-
- 1. Only one of `$onFulfilled` or `$onRejected` will be called,
- never both.
- 2. `$onFulfilled` and `$onRejected` will never be called more
- than once.
- 3. `$onProgress` may be called multiple times.
-
-#### See also
-
-* [resolve()](#resolve) - Creating a resolved promise
-* [reject()](#reject) - Creating a rejected promise
-* [ExtendedPromiseInterface::done()](#extendedpromiseinterfacedone)
-* [done() vs. then()](#done-vs-then)
-
-### ExtendedPromiseInterface
-
-The ExtendedPromiseInterface extends the PromiseInterface with useful shortcut
-and utility methods which are not part of the Promises/A specification.
-
-#### Implementations
-
-* [Promise](#promise-1)
-* [FulfilledPromise](#fulfilledpromise)
-* [RejectedPromise](#rejectedpromise)
-* [LazyPromise](#lazypromise)
-
-#### ExtendedPromiseInterface::done()
-
-```php
-$promise->done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null);
-```
-
-Consumes the promise's ultimate value if the promise fulfills, or handles the
-ultimate error.
-
-It will cause a fatal error if either `$onFulfilled` or `$onRejected` throw or
-return a rejected promise.
-
-Since the purpose of `done()` is consumption rather than transformation,
-`done()` always returns `null`.
-
-#### See also
-
-* [PromiseInterface::then()](#promiseinterfacethen)
-* [done() vs. then()](#done-vs-then)
-
-#### ExtendedPromiseInterface::otherwise()
-
-```php
-$promise->otherwise(callable $onRejected);
-```
-
-Registers a rejection handler for promise. It is a shortcut for:
-
-```php
-$promise->then(null, $onRejected);
-```
-
-Additionally, you can type hint the `$reason` argument of `$onRejected` to catch
-only specific errors.
-
-```php
-$promise
- ->otherwise(function (\RuntimeException $reason) {
- // Only catch \RuntimeException instances
- // All other types of errors will propagate automatically
- })
- ->otherwise(function ($reason) {
- // Catch other errors
- )};
-```
-
-#### ExtendedPromiseInterface::always()
-
-```php
-$newPromise = $promise->always(callable $onFulfilledOrRejected);
-```
-
-Allows you to execute "cleanup" type tasks in a promise chain.
-
-It arranges for `$onFulfilledOrRejected` to be called, with no arguments,
-when the promise is either fulfilled or rejected.
-
-* If `$promise` fulfills, and `$onFulfilledOrRejected` returns successfully,
- `$newPromise` will fulfill with the same value as `$promise`.
-* If `$promise` fulfills, and `$onFulfilledOrRejected` throws or returns a
- rejected promise, `$newPromise` will reject with the thrown exception or
- rejected promise's reason.
-* If `$promise` rejects, and `$onFulfilledOrRejected` returns successfully,
- `$newPromise` will reject with the same reason as `$promise`.
-* If `$promise` rejects, and `$onFulfilledOrRejected` throws or returns a
- rejected promise, `$newPromise` will reject with the thrown exception or
- rejected promise's reason.
-
-`always()` behaves similarly to the synchronous finally statement. When combined
-with `otherwise()`, `always()` allows you to write code that is similar to the familiar
-synchronous catch/finally pair.
-
-Consider the following synchronous code:
-
-```php
-try {
- return doSomething();
-} catch(\Exception $e) {
- return handleError($e);
-} finally {
- cleanup();
-}
-```
-
-Similar asynchronous code (with `doSomething()` that returns a promise) can be
-written:
-
-```php
-return doSomething()
- ->otherwise('handleError')
- ->always('cleanup');
-```
-
-#### ExtendedPromiseInterface::progress()
-
-```php
-$promise->progress(callable $onProgress);
-```
-
-Registers a handler for progress updates from promise. It is a shortcut for:
-
-```php
-$promise->then(null, null, $onProgress);
-```
-
-### CancellablePromiseInterface
-
-A cancellable promise provides a mechanism for consumers to notify the creator
-of the promise that they are not longer interested in the result of an
-operation.
-
-#### CancellablePromiseInterface::cancel()
-
-``` php
-$promise->cancel();
-```
-
-The `cancel()` method notifies the creator of the promise that there is no
-further interest in the results of the operation.
-
-Once a promise is settled (either fulfilled or rejected), calling `cancel()` on
-a promise has no effect.
-
-#### Implementations
-
-* [Promise](#promise-1)
-* [FulfilledPromise](#fulfilledpromise)
-* [RejectedPromise](#rejectedpromise)
-* [LazyPromise](#lazypromise)
-
-### Promise
-
-Creates a promise whose state is controlled by the functions passed to
-`$resolver`.
-
-```php
-$resolver = function (callable $resolve, callable $reject, callable $notify) {
- // Do some work, possibly asynchronously, and then
- // resolve or reject. You can notify of progress events
- // along the way if you want/need.
-
- $resolve($awesomeResult);
- // or $resolve($anotherPromise);
- // or $reject($nastyError);
- // or $notify($progressNotification);
-};
-
-$canceller = function (callable $resolve, callable $reject, callable $progress) {
- // Cancel/abort any running operations like network connections, streams etc.
-
- $reject(new \Exception('Promise cancelled'));
-};
-
-$promise = new React\Promise\Promise($resolver, $canceller);
-```
-
-The promise constructor receives a resolver function and an optional canceller
-function which both will be called with 3 arguments:
-
- * `$resolve($value)` - Primary function that seals the fate of the
- returned promise. Accepts either a non-promise value, or another promise.
- When called with a non-promise value, fulfills promise with that value.
- When called with another promise, e.g. `$resolve($otherPromise)`, promise's
- fate will be equivalent to that of `$otherPromise`.
- * `$reject($reason)` - Function that rejects the promise.
- * `$notify($update)` - Function that issues progress events for the promise.
-
-If the resolver or canceller throw an exception, the promise will be rejected
-with that thrown exception as the rejection reason.
-
-The resolver function will be called immediately, the canceller function only
-once all consumers called the `cancel()` method of the promise.
-
-### FulfilledPromise
-
-Creates a already fulfilled promise.
-
-```php
-$promise = React\Promise\FulfilledPromise($value);
-```
-
-Note, that `$value` **cannot** be a promise. It's recommended to use
-[resolve()](#resolve) for creating resolved promises.
-
-### RejectedPromise
-
-Creates a already rejected promise.
-
-```php
-$promise = React\Promise\RejectedPromise($reason);
-```
-
-Note, that `$reason` **cannot** be a promise. It's recommended to use
-[reject()](#reject) for creating rejected promises.
-
-### LazyPromise
-
-Creates a promise which will be lazily initialized by `$factory` once a consumer
-calls the `then()` method.
-
-```php
-$factory = function () {
- $deferred = new React\Promise\Deferred();
-
- // Do some heavy stuff here and resolve the deferred once completed
-
- return $deferred->promise();
-};
-
-$promise = React\Promise\LazyPromise($factory);
-
-// $factory will only be executed once we call then()
-$promise->then(function ($value) {
-});
-```
-
-### Functions
-
-Useful functions for creating, joining, mapping and reducing collections of
-promises.
-
-#### resolve()
-
-```php
-$promise = React\Promise\resolve(mixed $promiseOrValue);
-```
-
-Creates a promise for the supplied `$promiseOrValue`.
-
-If `$promiseOrValue` is a value, it will be the resolution value of the
-returned promise.
-
-If `$promiseOrValue` is a promise, it will simply be returned.
-
-Note: The promise returned is always a promise implementing
-[ExtendedPromiseInterface](#extendedpromiseinterface). If you pass in a custom
-promise which only implements [PromiseInterface](#promiseinterface), this
-promise will be assimilated to a extended promise following `$promiseOrValue`.
-
-#### reject()
-
-```php
-$promise = React\Promise\reject(mixed $promiseOrValue);
-```
-
-Creates a rejected promise for the supplied `$promiseOrValue`.
-
-If `$promiseOrValue` is a value, it will be the rejection value of the
-returned promise.
-
-If `$promiseOrValue` is a promise, its completion value will be the rejected
-value of the returned promise.
-
-This can be useful in situations where you need to reject a promise without
-throwing an exception. For example, it allows you to propagate a rejection with
-the value of another promise.
-
-#### all()
-
-```php
-$promise = React\Promise\all(array|React\Promise\PromiseInterface $promisesOrValues);
-```
-
-Returns a promise that will resolve only once all the items in
-`$promisesOrValues` have resolved. The resolution value of the returned promise
-will be an array containing the resolution values of each of the items in
-`$promisesOrValues`.
-
-#### race()
-
-```php
-$promise = React\Promise\race(array|React\Promise\PromiseInterface $promisesOrValues);
-```
-
-Initiates a competitive race that allows one winner. Returns a promise which is
-resolved in the same way the first settled promise resolves.
-
-#### any()
-
-```php
-$promise = React\Promise\any(array|React\Promise\PromiseInterface $promisesOrValues);
-```
-
-Returns a promise that will resolve when any one of the items in
-`$promisesOrValues` resolves. The resolution value of the returned promise
-will be the resolution value of the triggering item.
-
-The returned promise will only reject if *all* items in `$promisesOrValues` are
-rejected. The rejection value will be an array of all rejection reasons.
-
-#### some()
-
-```php
-$promise = React\Promise\some(array|React\Promise\PromiseInterface $promisesOrValues, integer $howMany);
-```
-
-Returns a promise that will resolve when `$howMany` of the supplied items in
-`$promisesOrValues` resolve. The resolution value of the returned promise
-will be an array of length `$howMany` containing the resolution values of the
-triggering items.
-
-The returned promise will reject if it becomes impossible for `$howMany` items
-to resolve (that is, when `(count($promisesOrValues) - $howMany) + 1` items
-reject). The rejection value will be an array of
-`(count($promisesOrValues) - $howMany) + 1` rejection reasons.
-
-#### map()
-
-```php
-$promise = React\Promise\map(array|React\Promise\PromiseInterface $promisesOrValues, callable $mapFunc);
-```
-
-Traditional map function, similar to `array_map()`, but allows input to contain
-promises and/or values, and `$mapFunc` may return either a value or a promise.
-
-The map function receives each item as argument, where item is a fully resolved
-value of a promise or value in `$promisesOrValues`.
-
-#### reduce()
-
-```php
-$promise = React\Promise\reduce(array|React\Promise\PromiseInterface $promisesOrValues, callable $reduceFunc , $initialValue = null);
-```
-
-Traditional reduce function, similar to `array_reduce()`, but input may contain
-promises and/or values, and `$reduceFunc` may return either a value or a
-promise, *and* `$initialValue` may be a promise or a value for the starting
-value.
-
-### PromisorInterface
-
-The `React\Promise\PromisorInterface` provides a common interface for objects
-that provide a promise. `React\Promise\Deferred` implements it, but since it
-is part of the public API anyone can implement it.
-
-Examples
---------
-
-### How to use Deferred
-
-```php
-function getAwesomeResultPromise()
-{
- $deferred = new React\Promise\Deferred();
-
- // Execute a Node.js-style function using the callback pattern
- computeAwesomeResultAsynchronously(function ($error, $result) use ($deferred) {
- if ($error) {
- $deferred->reject($error);
- } else {
- $deferred->resolve($result);
- }
- });
-
- // Return the promise
- return $deferred->promise();
-}
-
-getAwesomeResultPromise()
- ->then(
- function ($value) {
- // Deferred resolved, do something with $value
- },
- function ($reason) {
- // Deferred rejected, do something with $reason
- },
- function ($update) {
- // Progress notification triggered, do something with $update
- }
- );
-```
-
-### How promise forwarding works
-
-A few simple examples to show how the mechanics of Promises/A forwarding works.
-These examples are contrived, of course, and in real usage, promise chains will
-typically be spread across several function calls, or even several levels of
-your application architecture.
-
-#### Resolution forwarding
-
-Resolved promises forward resolution values to the next promise.
-The first promise, `$deferred->promise()`, will resolve with the value passed
-to `$deferred->resolve()` below.
-
-Each call to `then()` returns a new promise that will resolve with the return
-value of the previous handler. This creates a promise "pipeline".
-
-```php
-$deferred = new React\Promise\Deferred();
-
-$deferred->promise()
- ->then(function ($x) {
- // $x will be the value passed to $deferred->resolve() below
- // and returns a *new promise* for $x + 1
- return $x + 1;
- })
- ->then(function ($x) {
- // $x === 2
- // This handler receives the return value of the
- // previous handler.
- return $x + 1;
- })
- ->then(function ($x) {
- // $x === 3
- // This handler receives the return value of the
- // previous handler.
- return $x + 1;
- })
- ->then(function ($x) {
- // $x === 4
- // This handler receives the return value of the
- // previous handler.
- echo 'Resolve ' . $x;
- });
-
-$deferred->resolve(1); // Prints "Resolve 4"
-```
-
-#### Rejection forwarding
-
-Rejected promises behave similarly, and also work similarly to try/catch:
-When you catch an exception, you must rethrow for it to propagate.
-
-Similarly, when you handle a rejected promise, to propagate the rejection,
-"rethrow" it by either returning a rejected promise, or actually throwing
-(since promise translates thrown exceptions into rejections)
-
-```php
-$deferred = new React\Promise\Deferred();
-
-$deferred->promise()
- ->then(function ($x) {
- throw new \Exception($x + 1);
- })
- ->then(null, function (\Exception $x) {
- // Propagate the rejection
- throw $x;
- })
- ->then(null, function (\Exception $x) {
- // Can also propagate by returning another rejection
- return React\Promise\reject((integer) $x->getMessage() + 1);
- })
- ->then(null, function ($x) {
- echo 'Reject ' . $x; // 3
- });
-
-$deferred->resolve(1); // Prints "Reject 3"
-```
-
-#### Mixed resolution and rejection forwarding
-
-Just like try/catch, you can choose to propagate or not. Mixing resolutions and
-rejections will still forward handler results in a predictable way.
-
-```php
-$deferred = new React\Promise\Deferred();
-
-$deferred->promise()
- ->then(function ($x) {
- return $x + 1;
- })
- ->then(function ($x) {
- throw \Exception($x + 1);
- })
- ->then(null, function (\Exception $x) {
- // Handle the rejection, and don't propagate.
- // This is like catch without a rethrow
- return (integer) $x->getMessage() + 1;
- })
- ->then(function ($x) {
- echo 'Mixed ' . $x; // 4
- });
-
-$deferred->resolve(1); // Prints "Mixed 4"
-```
-
-#### Progress event forwarding
-
-In the same way as resolution and rejection handlers, your progress handler
-**MUST** return a progress event to be propagated to the next link in the chain.
-If you return nothing, `null` will be propagated.
-
-Also in the same way as resolutions and rejections, if you don't register a
-progress handler, the update will be propagated through.
-
-If your progress handler throws an exception, the exception will be propagated
-to the next link in the chain. The best thing to do is to ensure your progress
-handlers do not throw exceptions.
-
-This gives you the opportunity to transform progress events at each step in the
-chain so that they are meaningful to the next step. It also allows you to choose
-not to transform them, and simply let them propagate untransformed, by not
-registering a progress handler.
-
-```php
-$deferred = new React\Promise\Deferred();
-
-$deferred->promise()
- ->progress(function ($update) {
- return $update + 1;
- })
- ->progress(function ($update) {
- echo 'Progress ' . $update; // 2
- });
-
-$deferred->notify(1); // Prints "Progress 2"
-```
-
-### done() vs. then()
-
-The golden rule is:
-
- Either return your promise, or call done() on it.
-
-At a first glance, `then()` and `done()` seem very similar. However, there are
-important distinctions.
-
-The intent of `then()` is to transform a promise's value and to pass or return
-a new promise for the transformed value along to other parts of your code.
-
-The intent of `done()` is to consume a promise's value, transferring
-responsibility for the value to your code.
-
-In addition to transforming a value, `then()` allows you to recover from, or
-propagate intermediate errors. Any errors that are not handled will be caught
-by the promise machinery and used to reject the promise returned by `then()`.
-
-Calling `done()` transfers all responsibility for errors to your code. If an
-error (either a thrown exception or returned rejection) escapes the
-`$onFulfilled` or `$onRejected` callbacks you provide to done, it will be
-rethrown in an uncatchable way causing a fatal error.
-
-```php
-function getJsonResult()
-{
- return queryApi()
- ->then(
- // Transform API results to an object
- function ($jsonResultString) {
- return json_decode($jsonResultString);
- },
- // Transform API errors to an exception
- function ($jsonErrorString) {
- $object = json_decode($jsonErrorString);
- throw new ApiErrorException($object->errorMessage);
- }
- );
-}
-
-// Here we provide no rejection handler. If the promise returned has been
-// rejected, the ApiErrorException will be thrown
-getJsonResult()
- ->done(
- // Consume transformed object
- function ($jsonResultObject) {
- // Do something with $jsonResultObject
- }
- );
-
-// Here we provide a rejection handler which will either throw while debugging
-// or log the exception
-getJsonResult()
- ->done(
- function ($jsonResultObject) {
- // Do something with $jsonResultObject
- },
- function (ApiErrorException $exception) {
- if (isDebug()) {
- throw $exception;
- } else {
- logException($exception);
- }
- }
- );
-```
-
-Note that if a rejection value is not an instance of `\Exception`, it will be
-wrapped in an exception of the type `React\Promise\UnhandledRejectionException`.
-
-You can get the original rejection reason by calling `$exception->getReason()`.
-
-Credits
--------
-
-React/Promise is a port of [when.js](https://github.com/cujojs/when)
-by [Brian Cavalier](https://github.com/briancavalier).
-
-Also, large parts of the documentation have been ported from the when.js
-[Wiki](https://github.com/cujojs/when/wiki) and the
-[API docs](https://github.com/cujojs/when/blob/master/docs/api.md).
-
-License
--------
-
-React/Promise is released under the [MIT](https://github.com/reactphp/promise/blob/master/LICENSE) license.
diff --git a/lib/gerencianet/react/promise/composer.json b/lib/gerencianet/react/promise/composer.json
deleted file mode 100644
index b90b7c3..0000000
--- a/lib/gerencianet/react/promise/composer.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "name": "react/promise",
- "description": "A lightweight implementation of CommonJS Promises/A for PHP",
- "license": "MIT",
- "authors": [
- {"name": "Jan Sorgalla", "email": "jsorgalla@gmail.com"}
- ],
- "require": {
- "php": ">=5.4.0"
- },
- "autoload": {
- "psr-4": {
- "React\\Promise\\": "src/"
- },
- "files": ["src/functions_include.php"]
- },
- "extra": {
- "branch-alias": {
- "dev-master": "2.0-dev"
- }
- }
-}
diff --git a/lib/gerencianet/react/promise/phpunit.xml.dist b/lib/gerencianet/react/promise/phpunit.xml.dist
deleted file mode 100644
index 0200d46..0000000
--- a/lib/gerencianet/react/promise/phpunit.xml.dist
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
- ./tests/
-
-
-
-
-
- ./src/
-
-
-
diff --git a/lib/gerencianet/react/promise/src/CancellablePromiseInterface.php b/lib/gerencianet/react/promise/src/CancellablePromiseInterface.php
deleted file mode 100644
index 896db2d..0000000
--- a/lib/gerencianet/react/promise/src/CancellablePromiseInterface.php
+++ /dev/null
@@ -1,11 +0,0 @@
-canceller = $canceller;
- }
-
- public function promise()
- {
- if (null === $this->promise) {
- $this->promise = new Promise(function ($resolve, $reject, $notify) {
- $this->resolveCallback = $resolve;
- $this->rejectCallback = $reject;
- $this->notifyCallback = $notify;
- }, $this->canceller);
- }
-
- return $this->promise;
- }
-
- public function resolve($value = null)
- {
- $this->promise();
-
- call_user_func($this->resolveCallback, $value);
- }
-
- public function reject($reason = null)
- {
- $this->promise();
-
- call_user_func($this->rejectCallback, $reason);
- }
-
- public function notify($update = null)
- {
- $this->promise();
-
- call_user_func($this->notifyCallback, $update);
- }
-
- /**
- * @deprecated 2.2.0
- * @see Deferred::notify()
- */
- public function progress($update = null)
- {
- $this->notify($update);
- }
-}
diff --git a/lib/gerencianet/react/promise/src/ExtendedPromiseInterface.php b/lib/gerencianet/react/promise/src/ExtendedPromiseInterface.php
deleted file mode 100644
index 9cb6435..0000000
--- a/lib/gerencianet/react/promise/src/ExtendedPromiseInterface.php
+++ /dev/null
@@ -1,26 +0,0 @@
-value = $value;
- }
-
- public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
- {
- if (null === $onFulfilled) {
- return $this;
- }
-
- try {
- return resolve($onFulfilled($this->value));
- } catch (\Exception $exception) {
- return new RejectedPromise($exception);
- }
- }
-
- public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
- {
- if (null === $onFulfilled) {
- return;
- }
-
- $result = $onFulfilled($this->value);
-
- if ($result instanceof ExtendedPromiseInterface) {
- $result->done();
- }
- }
-
- public function otherwise(callable $onRejected)
- {
- return $this;
- }
-
- public function always(callable $onFulfilledOrRejected)
- {
- return $this->then(function ($value) use ($onFulfilledOrRejected) {
- return resolve($onFulfilledOrRejected())->then(function () use ($value) {
- return $value;
- });
- });
- }
-
- public function progress(callable $onProgress)
- {
- return $this;
- }
-
- public function cancel()
- {
- }
-}
diff --git a/lib/gerencianet/react/promise/src/LazyPromise.php b/lib/gerencianet/react/promise/src/LazyPromise.php
deleted file mode 100644
index 919da45..0000000
--- a/lib/gerencianet/react/promise/src/LazyPromise.php
+++ /dev/null
@@ -1,57 +0,0 @@
-factory = $factory;
- }
-
- public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
- {
- return $this->promise()->then($onFulfilled, $onRejected, $onProgress);
- }
-
- public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
- {
- return $this->promise()->done($onFulfilled, $onRejected, $onProgress);
- }
-
- public function otherwise(callable $onRejected)
- {
- return $this->promise()->otherwise($onRejected);
- }
-
- public function always(callable $onFulfilledOrRejected)
- {
- return $this->promise()->always($onFulfilledOrRejected);
- }
-
- public function progress(callable $onProgress)
- {
- return $this->promise()->progress($onProgress);
- }
-
- public function cancel()
- {
- return $this->promise()->cancel();
- }
-
- private function promise()
- {
- if (null === $this->promise) {
- try {
- $this->promise = resolve(call_user_func($this->factory));
- } catch (\Exception $exception) {
- $this->promise = new RejectedPromise($exception);
- }
- }
-
- return $this->promise;
- }
-}
diff --git a/lib/gerencianet/react/promise/src/Promise.php b/lib/gerencianet/react/promise/src/Promise.php
deleted file mode 100644
index 7af9943..0000000
--- a/lib/gerencianet/react/promise/src/Promise.php
+++ /dev/null
@@ -1,193 +0,0 @@
-canceller = $canceller;
- $this->call($resolver);
- }
-
- public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
- {
- if (null !== $this->result) {
- return $this->result()->then($onFulfilled, $onRejected, $onProgress);
- }
-
- if (null === $this->canceller) {
- return new static($this->resolver($onFulfilled, $onRejected, $onProgress));
- }
-
- $this->requiredCancelRequests++;
-
- return new static($this->resolver($onFulfilled, $onRejected, $onProgress), function () {
- if (++$this->cancelRequests < $this->requiredCancelRequests) {
- return;
- }
-
- $this->cancel();
- });
- }
-
- public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
- {
- if (null !== $this->result) {
- return $this->result()->done($onFulfilled, $onRejected, $onProgress);
- }
-
- $this->handlers[] = function (ExtendedPromiseInterface $promise) use ($onFulfilled, $onRejected) {
- $promise
- ->done($onFulfilled, $onRejected);
- };
-
- if ($onProgress) {
- $this->progressHandlers[] = $onProgress;
- }
- }
-
- public function otherwise(callable $onRejected)
- {
- return $this->then(null, function ($reason) use ($onRejected) {
- if (!_checkTypehint($onRejected, $reason)) {
- return new RejectedPromise($reason);
- }
-
- return $onRejected($reason);
- });
- }
-
- public function always(callable $onFulfilledOrRejected)
- {
- return $this->then(function ($value) use ($onFulfilledOrRejected) {
- return resolve($onFulfilledOrRejected())->then(function () use ($value) {
- return $value;
- });
- }, function ($reason) use ($onFulfilledOrRejected) {
- return resolve($onFulfilledOrRejected())->then(function () use ($reason) {
- return new RejectedPromise($reason);
- });
- });
- }
-
- public function progress(callable $onProgress)
- {
- return $this->then(null, null, $onProgress);
- }
-
- public function cancel()
- {
- if (null === $this->canceller || null !== $this->result) {
- return;
- }
-
- $canceller = $this->canceller;
- $this->canceller = null;
-
- $this->call($canceller);
- }
-
- private function resolver(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
- {
- return function ($resolve, $reject, $notify) use ($onFulfilled, $onRejected, $onProgress) {
- if ($onProgress) {
- $progressHandler = function ($update) use ($notify, $onProgress) {
- try {
- $notify($onProgress($update));
- } catch (\Exception $e) {
- $notify($e);
- }
- };
- } else {
- $progressHandler = $notify;
- }
-
- $this->handlers[] = function (ExtendedPromiseInterface $promise) use ($onFulfilled, $onRejected, $resolve, $reject, $progressHandler) {
- $promise
- ->then($onFulfilled, $onRejected)
- ->done($resolve, $reject, $progressHandler);
- };
-
- $this->progressHandlers[] = $progressHandler;
- };
- }
-
- private function resolve($value = null)
- {
- if (null !== $this->result) {
- return;
- }
-
- $this->settle(resolve($value));
- }
-
- private function reject($reason = null)
- {
- if (null !== $this->result) {
- return;
- }
-
- $this->settle(reject($reason));
- }
-
- private function notify($update = null)
- {
- if (null !== $this->result) {
- return;
- }
-
- foreach ($this->progressHandlers as $handler) {
- $handler($update);
- }
- }
-
- private function settle(ExtendedPromiseInterface $promise)
- {
- $handlers = $this->handlers;
-
- $this->progressHandlers = $this->handlers = [];
- $this->result = $promise;
-
- foreach ($handlers as $handler) {
- $handler($promise);
- }
- }
-
- private function result()
- {
- while ($this->result instanceof self && null !== $this->result->result) {
- $this->result = $this->result->result;
- }
-
- return $this->result;
- }
-
- private function call(callable $callback)
- {
- try {
- $callback(
- function ($value = null) {
- $this->resolve($value);
- },
- function ($reason = null) {
- $this->reject($reason);
- },
- function ($update = null) {
- $this->notify($update);
- }
- );
- } catch (\Exception $e) {
- $this->reject($e);
- }
- }
-}
diff --git a/lib/gerencianet/react/promise/src/PromiseInterface.php b/lib/gerencianet/react/promise/src/PromiseInterface.php
deleted file mode 100644
index d80d114..0000000
--- a/lib/gerencianet/react/promise/src/PromiseInterface.php
+++ /dev/null
@@ -1,11 +0,0 @@
-reason = $reason;
- }
-
- public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
- {
- if (null === $onRejected) {
- return $this;
- }
-
- try {
- return resolve($onRejected($this->reason));
- } catch (\Exception $exception) {
- return new RejectedPromise($exception);
- }
- }
-
- public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
- {
- if (null === $onRejected) {
- throw UnhandledRejectionException::resolve($this->reason);
- }
-
- $result = $onRejected($this->reason);
-
- if ($result instanceof self) {
- throw UnhandledRejectionException::resolve($result->reason);
- }
-
- if ($result instanceof ExtendedPromiseInterface) {
- $result->done();
- }
- }
-
- public function otherwise(callable $onRejected)
- {
- if (!_checkTypehint($onRejected, $this->reason)) {
- return $this;
- }
-
- return $this->then(null, $onRejected);
- }
-
- public function always(callable $onFulfilledOrRejected)
- {
- return $this->then(null, function ($reason) use ($onFulfilledOrRejected) {
- return resolve($onFulfilledOrRejected())->then(function () use ($reason) {
- return new RejectedPromise($reason);
- });
- });
- }
-
- public function progress(callable $onProgress)
- {
- return $this;
- }
-
- public function cancel()
- {
- }
-}
diff --git a/lib/gerencianet/react/promise/src/UnhandledRejectionException.php b/lib/gerencianet/react/promise/src/UnhandledRejectionException.php
deleted file mode 100644
index ed166b3..0000000
--- a/lib/gerencianet/react/promise/src/UnhandledRejectionException.php
+++ /dev/null
@@ -1,31 +0,0 @@
-reason = $reason;
-
- $message = sprintf('Unhandled Rejection: %s', json_encode($reason));
-
- parent::__construct($message, 0);
- }
-
- public function getReason()
- {
- return $this->reason;
- }
-}
diff --git a/lib/gerencianet/react/promise/src/functions.php b/lib/gerencianet/react/promise/src/functions.php
deleted file mode 100644
index 9b361dd..0000000
--- a/lib/gerencianet/react/promise/src/functions.php
+++ /dev/null
@@ -1,196 +0,0 @@
-then($resolve, $reject, $notify);
- });
-}
-
-function reject($promiseOrValue = null)
-{
- if ($promiseOrValue instanceof PromiseInterface) {
- return resolve($promiseOrValue)->then(function ($value) {
- return new RejectedPromise($value);
- });
- }
-
- return new RejectedPromise($promiseOrValue);
-}
-
-function all($promisesOrValues)
-{
- return map($promisesOrValues, function ($val) {
- return $val;
- });
-}
-
-function race($promisesOrValues)
-{
- return resolve($promisesOrValues)
- ->then(function ($array) {
- if (!is_array($array) || !$array) {
- return resolve();
- }
-
- return new Promise(function ($resolve, $reject, $notify) use ($array) {
- foreach ($array as $promiseOrValue) {
- resolve($promiseOrValue)
- ->done($resolve, $reject, $notify);
- }
- });
- });
-}
-
-function any($promisesOrValues)
-{
- return some($promisesOrValues, 1)
- ->then(function ($val) {
- return array_shift($val);
- });
-}
-
-function some($promisesOrValues, $howMany)
-{
- return resolve($promisesOrValues)
- ->then(function ($array) use ($howMany) {
- if (!is_array($array) || !$array || $howMany < 1) {
- return resolve([]);
- }
-
- return new Promise(function ($resolve, $reject, $notify) use ($array, $howMany) {
- $len = count($array);
- $toResolve = min($howMany, $len);
- $toReject = ($len - $toResolve) + 1;
- $values = [];
- $reasons = [];
-
- foreach ($array as $i => $promiseOrValue) {
- $fulfiller = function ($val) use ($i, &$values, &$toResolve, $toReject, $resolve) {
- if ($toResolve < 1 || $toReject < 1) {
- return;
- }
-
- $values[$i] = $val;
-
- if (0 === --$toResolve) {
- $resolve($values);
- }
- };
-
- $rejecter = function ($reason) use ($i, &$reasons, &$toReject, $toResolve, $reject) {
- if ($toResolve < 1 || $toReject < 1) {
- return;
- }
-
- $reasons[$i] = $reason;
-
- if (0 === --$toReject) {
- $reject($reasons);
- }
- };
-
- resolve($promiseOrValue)
- ->done($fulfiller, $rejecter, $notify);
- }
- });
- });
-}
-
-function map($promisesOrValues, callable $mapFunc)
-{
- return resolve($promisesOrValues)
- ->then(function ($array) use ($mapFunc) {
- if (!is_array($array) || !$array) {
- return resolve([]);
- }
-
- return new Promise(function ($resolve, $reject, $notify) use ($array, $mapFunc) {
- $toResolve = count($array);
- $values = [];
-
- foreach ($array as $i => $promiseOrValue) {
- resolve($promiseOrValue)
- ->then($mapFunc)
- ->done(
- function ($mapped) use ($i, &$values, &$toResolve, $resolve) {
- $values[$i] = $mapped;
-
- if (0 === --$toResolve) {
- $resolve($values);
- }
- },
- $reject,
- $notify
- );
- }
- });
- });
-}
-
-function reduce($promisesOrValues, callable $reduceFunc, $initialValue = null)
-{
- return resolve($promisesOrValues)
- ->then(function ($array) use ($reduceFunc, $initialValue) {
- if (!is_array($array)) {
- $array = [];
- }
-
- $total = count($array);
- $i = 0;
-
- // Wrap the supplied $reduceFunc with one that handles promises and then
- // delegates to the supplied.
- $wrappedReduceFunc = function ($current, $val) use ($reduceFunc, $total, &$i) {
- return resolve($current)
- ->then(function ($c) use ($reduceFunc, $total, &$i, $val) {
- return resolve($val)
- ->then(function ($value) use ($reduceFunc, $total, &$i, $c) {
- return $reduceFunc($c, $value, $i++, $total);
- });
- });
- };
-
- return array_reduce($array, $wrappedReduceFunc, $initialValue);
- });
-}
-
-// Internal functions
-function _checkTypehint(callable $callback, $object)
-{
- if (!is_object($object)) {
- return true;
- }
-
- if (is_array($callback)) {
- $callbackReflection = new \ReflectionMethod($callback[0], $callback[1]);
- } elseif (is_object($callback) && !$callback instanceof \Closure) {
- $callbackReflection = new \ReflectionMethod($callback, '__invoke');
- } else {
- $callbackReflection = new \ReflectionFunction($callback);
- }
-
- $parameters = $callbackReflection->getParameters();
-
- if (!isset($parameters[0])) {
- return true;
- }
-
- $expectedException = $parameters[0];
-
- if (!$expectedException->getClass()) {
- return true;
- }
-
- return $expectedException->getClass()->isInstance($object);
-}
diff --git a/lib/gerencianet/react/promise/src/functions_include.php b/lib/gerencianet/react/promise/src/functions_include.php
deleted file mode 100644
index c71decb..0000000
--- a/lib/gerencianet/react/promise/src/functions_include.php
+++ /dev/null
@@ -1,5 +0,0 @@
- [$d, 'promise'],
- 'resolve' => [$d, 'resolve'],
- 'reject' => [$d, 'reject'],
- 'notify' => [$d, 'progress'],
- 'settle' => [$d, 'resolve'],
- ]);
- }
-
- /** @test */
- public function progressIsAnAliasForNotify()
- {
- $deferred = new Deferred();
-
- $sentinel = new \stdClass();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($sentinel);
-
- $deferred->promise()
- ->then($this->expectCallableNever(), $this->expectCallableNever(), $mock);
-
- $deferred->progress($sentinel);
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/FulfilledPromiseTest.php b/lib/gerencianet/react/promise/tests/FulfilledPromiseTest.php
deleted file mode 100644
index 97fc8f6..0000000
--- a/lib/gerencianet/react/promise/tests/FulfilledPromiseTest.php
+++ /dev/null
@@ -1,50 +0,0 @@
- function () use (&$promise) {
- if (!$promise) {
- throw new \LogicException('FulfilledPromise must be resolved before obtaining the promise');
- }
-
- return $promise;
- },
- 'resolve' => function ($value = null) use (&$promise) {
- if (!$promise) {
- $promise = new FulfilledPromise($value);
- }
- },
- 'reject' => function () {
- throw new \LogicException('You cannot call reject() for React\Promise\FulfilledPromise');
- },
- 'notify' => function () {
- // no-op
- },
- 'settle' => function ($value = null) use (&$promise) {
- if (!$promise) {
- $promise = new FulfilledPromise($value);
- }
- },
- ]);
- }
-
- /** @test */
- public function shouldThrowExceptionIfConstructedWithAPromise()
- {
- $this->setExpectedException('\InvalidArgumentException');
-
- return new FulfilledPromise(new FulfilledPromise());
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/FunctionAllTest.php b/lib/gerencianet/react/promise/tests/FunctionAllTest.php
deleted file mode 100644
index fcd0a5d..0000000
--- a/lib/gerencianet/react/promise/tests/FunctionAllTest.php
+++ /dev/null
@@ -1,97 +0,0 @@
-createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([]));
-
- all([])
- ->then($mock);
- }
-
- /** @test */
- public function shouldResolveValuesArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([1, 2, 3]));
-
- all([1, 2, 3])
- ->then($mock);
- }
-
- /** @test */
- public function shouldResolvePromisesArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([1, 2, 3]));
-
- all([resolve(1), resolve(2), resolve(3)])
- ->then($mock);
- }
-
- /** @test */
- public function shouldResolveSparseArrayInput()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([null, 1, null, 1, 1]));
-
- all([null, 1, null, 1, 1])
- ->then($mock);
- }
-
- /** @test */
- public function shouldRejectIfAnyInputPromiseRejects()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(2));
-
- all([resolve(1), reject(2), resolve(3)])
- ->then($this->expectCallableNever(), $mock);
- }
-
- /** @test */
- public function shouldAcceptAPromiseForAnArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([1, 2, 3]));
-
- all(resolve([1, 2, 3]))
- ->then($mock);
- }
-
- /** @test */
- public function shouldResolveToEmptyArrayWhenInputPromiseDoesNotResolveToArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([]));
-
- all(resolve(1))
- ->then($mock);
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/FunctionAnyTest.php b/lib/gerencianet/react/promise/tests/FunctionAnyTest.php
deleted file mode 100644
index bf8a0db..0000000
--- a/lib/gerencianet/react/promise/tests/FunctionAnyTest.php
+++ /dev/null
@@ -1,116 +0,0 @@
-createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(null));
-
- any([])
- ->then($mock);
- }
-
- /** @test */
- public function shouldResolveWithAnInputValue()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- any([1, 2, 3])
- ->then($mock);
- }
-
- /** @test */
- public function shouldResolveWithAPromisedInputValue()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- any([resolve(1), resolve(2), resolve(3)])
- ->then($mock);
- }
-
- /** @test */
- public function shouldRejectWithAllRejectedInputValuesIfAllInputsAreRejected()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([0 => 1, 1 => 2, 2 => 3]));
-
- any([reject(1), reject(2), reject(3)])
- ->then($this->expectCallableNever(), $mock);
- }
-
- /** @test */
- public function shouldResolveWhenFirstInputPromiseResolves()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- any([resolve(1), reject(2), reject(3)])
- ->then($mock);
- }
-
- /** @test */
- public function shouldAcceptAPromiseForAnArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- any(resolve([1, 2, 3]))
- ->then($mock);
- }
-
- /** @test */
- public function shouldResolveToNullArrayWhenInputPromiseDoesNotResolveToArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(null));
-
- any(resolve(1))
- ->then($mock);
- }
-
- /** @test */
- public function shouldNotRelyOnArryIndexesWhenUnwrappingToASingleResolutionValue()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(2));
-
- $d1 = new Deferred();
- $d2 = new Deferred();
-
- any(['abc' => $d1->promise(), 1 => $d2->promise()])
- ->then($mock);
-
- $d2->resolve(2);
- $d1->resolve(1);
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/FunctionCheckTypehintTest.php b/lib/gerencianet/react/promise/tests/FunctionCheckTypehintTest.php
deleted file mode 100644
index 8449bc1..0000000
--- a/lib/gerencianet/react/promise/tests/FunctionCheckTypehintTest.php
+++ /dev/null
@@ -1,118 +0,0 @@
-assertTrue(_checkTypehint(function (\InvalidArgumentException $e) {
- }, new \InvalidArgumentException()));
- $this->assertfalse(_checkTypehint(function (\InvalidArgumentException $e) {
- }, new \Exception()));
- }
-
- /** @test */
- public function shouldAcceptFunctionStringCallbackWithTypehint()
- {
- $this->assertTrue(_checkTypehint('React\Promise\testCallbackWithTypehint', new \InvalidArgumentException()));
- $this->assertfalse(_checkTypehint('React\Promise\testCallbackWithTypehint', new \Exception()));
- }
-
- /** @test */
- public function shouldAcceptInvokableObjectCallbackWithTypehint()
- {
- $this->assertTrue(_checkTypehint(new TestCallbackWithTypehintClass(), new \InvalidArgumentException()));
- $this->assertfalse(_checkTypehint(new TestCallbackWithTypehintClass(), new \Exception()));
- }
-
- /** @test */
- public function shouldAcceptObjectMethodCallbackWithTypehint()
- {
- $this->assertTrue(_checkTypehint([new TestCallbackWithTypehintClass(), 'testCallback'], new \InvalidArgumentException()));
- $this->assertfalse(_checkTypehint([new TestCallbackWithTypehintClass(), 'testCallback'], new \Exception()));
- }
-
- /** @test */
- public function shouldAcceptStaticClassCallbackWithTypehint()
- {
- $this->assertTrue(_checkTypehint(['React\Promise\TestCallbackWithTypehintClass', 'testCallbackStatic'], new \InvalidArgumentException()));
- $this->assertfalse(_checkTypehint(['React\Promise\TestCallbackWithTypehintClass', 'testCallbackStatic'], new \Exception()));
- }
-
- /** @test */
- public function shouldAcceptClosureCallbackWithoutTypehint()
- {
- $this->assertTrue(_checkTypehint(function (\InvalidArgumentException $e) {
- }, new \InvalidArgumentException()));
- }
-
- /** @test */
- public function shouldAcceptFunctionStringCallbackWithoutTypehint()
- {
- $this->assertTrue(_checkTypehint('React\Promise\testCallbackWithoutTypehint', new \InvalidArgumentException()));
- }
-
- /** @test */
- public function shouldAcceptInvokableObjectCallbackWithoutTypehint()
- {
- $this->assertTrue(_checkTypehint(new TestCallbackWithoutTypehintClass(), new \InvalidArgumentException()));
- }
-
- /** @test */
- public function shouldAcceptObjectMethodCallbackWithoutTypehint()
- {
- $this->assertTrue(_checkTypehint([new TestCallbackWithoutTypehintClass(), 'testCallback'], new \InvalidArgumentException()));
- }
-
- /** @test */
- public function shouldAcceptStaticClassCallbackWithoutTypehint()
- {
- $this->assertTrue(_checkTypehint(['React\Promise\TestCallbackWithoutTypehintClass', 'testCallbackStatic'], new \InvalidArgumentException()));
- }
-}
-
-function testCallbackWithTypehint(\InvalidArgumentException $e)
-{
-}
-
-function testCallbackWithoutTypehint()
-{
-}
-
-class TestCallbackWithTypehintClass
-{
- public function __invoke(\InvalidArgumentException $e)
- {
-
- }
-
- public function testCallback(\InvalidArgumentException $e)
- {
-
- }
-
- public static function testCallbackStatic(\InvalidArgumentException $e)
- {
-
- }
-}
-
-class TestCallbackWithoutTypehintClass
-{
- public function __invoke()
- {
-
- }
-
- public function testCallback()
- {
-
- }
-
- public static function testCallbackStatic()
- {
-
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/FunctionMapTest.php b/lib/gerencianet/react/promise/tests/FunctionMapTest.php
deleted file mode 100644
index b8bf3a8..0000000
--- a/lib/gerencianet/react/promise/tests/FunctionMapTest.php
+++ /dev/null
@@ -1,125 +0,0 @@
-createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([2, 4, 6]));
-
- map(
- [1, 2, 3],
- $this->mapper()
- )->then($mock);
- }
-
- /** @test */
- public function shouldMapInputPromisesArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([2, 4, 6]));
-
- map(
- [resolve(1), resolve(2), resolve(3)],
- $this->mapper()
- )->then($mock);
- }
-
- /** @test */
- public function shouldMapMixedInputArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([2, 4, 6]));
-
- map(
- [1, resolve(2), 3],
- $this->mapper()
- )->then($mock);
- }
-
- /** @test */
- public function shouldMapInputWhenMapperReturnsAPromise()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([2, 4, 6]));
-
- map(
- [1, 2, 3],
- $this->promiseMapper()
- )->then($mock);
- }
-
- /** @test */
- public function shouldAcceptAPromiseForAnArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([2, 4, 6]));
-
- map(
- resolve([1, resolve(2), 3]),
- $this->mapper()
- )->then($mock);
- }
-
- /** @test */
- public function shouldResolveToEmptyArrayWhenInputPromiseDoesNotResolveToArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([]));
-
- map(
- resolve(1),
- $this->mapper()
- )->then($mock);
- }
-
- /** @test */
- public function shouldRejectWhenInputContainsRejection()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(2));
-
- map(
- [resolve(1), reject(2), resolve(3)],
- $this->mapper()
- )->then($this->expectCallableNever(), $mock);
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/FunctionRaceTest.php b/lib/gerencianet/react/promise/tests/FunctionRaceTest.php
deleted file mode 100644
index 553220c..0000000
--- a/lib/gerencianet/react/promise/tests/FunctionRaceTest.php
+++ /dev/null
@@ -1,122 +0,0 @@
-createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(null));
-
- race(
- []
- )->then($mock);
- }
-
- /** @test */
- public function shouldResolveValuesArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- race(
- [1, 2, 3]
- )->then($mock);
- }
-
- /** @test */
- public function shouldResolvePromisesArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(2));
-
- $d1 = new Deferred();
- $d2 = new Deferred();
- $d3 = new Deferred();
-
- race(
- [$d1->promise(), $d2->promise(), $d3->promise()]
- )->then($mock);
-
- $d2->resolve(2);
-
- $d1->resolve(1);
- $d3->resolve(3);
- }
-
- /** @test */
- public function shouldResolveSparseArrayInput()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(null));
-
- race(
- [null, 1, null, 2, 3]
- )->then($mock);
- }
-
- /** @test */
- public function shouldRejectIfFirstSettledPromiseRejects()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(2));
-
- $d1 = new Deferred();
- $d2 = new Deferred();
- $d3 = new Deferred();
-
- race(
- [$d1->promise(), $d2->promise(), $d3->promise()]
- )->then($this->expectCallableNever(), $mock);
-
- $d2->reject(2);
-
- $d1->resolve(1);
- $d3->resolve(3);
- }
-
- /** @test */
- public function shouldAcceptAPromiseForAnArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- race(
- resolve([1, 2, 3])
- )->then($mock);
- }
-
- /** @test */
- public function shouldResolveToNullWhenInputPromiseDoesNotResolveToArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(null));
-
- race(
- resolve(1)
- )->then($mock);
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/FunctionReduceTest.php b/lib/gerencianet/react/promise/tests/FunctionReduceTest.php
deleted file mode 100644
index 715e847..0000000
--- a/lib/gerencianet/react/promise/tests/FunctionReduceTest.php
+++ /dev/null
@@ -1,290 +0,0 @@
-createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(6));
-
- reduce(
- [1, 2, 3],
- $this->plus()
- )->then($mock);
- }
-
- /** @test */
- public function shouldReduceValuesWithInitialValue()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(7));
-
- reduce(
- [1, 2, 3],
- $this->plus(),
- 1
- )->then($mock);
- }
-
- /** @test */
- public function shouldReduceValuesWithInitialPromise()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(7));
-
- reduce(
- [1, 2, 3],
- $this->plus(),
- resolve(1)
- )->then($mock);
- }
-
- /** @test */
- public function shouldReducePromisedValuesWithoutInitialValue()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(6));
-
- reduce(
- [resolve(1), resolve(2), resolve(3)],
- $this->plus()
- )->then($mock);
- }
-
- /** @test */
- public function shouldReducePromisedValuesWithInitialValue()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(7));
-
- reduce(
- [resolve(1), resolve(2), resolve(3)],
- $this->plus(),
- 1
- )->then($mock);
- }
-
- /** @test */
- public function shouldReducePromisedValuesWithInitialPromise()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(7));
-
- reduce(
- [resolve(1), resolve(2), resolve(3)],
- $this->plus(),
- resolve(1)
- )->then($mock);
- }
-
- /** @test */
- public function shouldReduceEmptyInputWithInitialValue()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- reduce(
- [],
- $this->plus(),
- 1
- )->then($mock);
- }
-
- /** @test */
- public function shouldReduceEmptyInputWithInitialPromise()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- reduce(
- [],
- $this->plus(),
- resolve(1)
- )->then($mock);
- }
-
- /** @test */
- public function shouldRejectWhenInputContainsRejection()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(2));
-
- reduce(
- [resolve(1), reject(2), resolve(3)],
- $this->plus(),
- resolve(1)
- )->then($this->expectCallableNever(), $mock);
- }
-
- /** @test */
- public function shouldResolveWithNullWhenInputIsEmptyAndNoInitialValueOrPromiseProvided()
- {
- // Note: this is different from when.js's behavior!
- // In when.reduce(), this rejects with a TypeError exception (following
- // JavaScript's [].reduce behavior.
- // We're following PHP's array_reduce behavior and resolve with NULL.
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(null));
-
- reduce(
- [],
- $this->plus()
- )->then($mock);
- }
-
- /** @test */
- public function shouldAllowSparseArrayInputWithoutInitialValue()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(3));
-
- reduce(
- [null, null, 1, null, 1, 1],
- $this->plus()
- )->then($mock);
- }
-
- /** @test */
- public function shouldAllowSparseArrayInputWithInitialValue()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(4));
-
- reduce(
- [null, null, 1, null, 1, 1],
- $this->plus(),
- 1
- )->then($mock);
- }
-
- /** @test */
- public function shouldReduceInInputOrder()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo('123'));
-
- reduce(
- [1, 2, 3],
- $this->append(),
- ''
- )->then($mock);
- }
-
- /** @test */
- public function shouldAcceptAPromiseForAnArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo('123'));
-
- reduce(
- resolve([1, 2, 3]),
- $this->append(),
- ''
- )->then($mock);
- }
-
- /** @test */
- public function shouldResolveToInitialValueWhenInputPromiseDoesNotResolveToAnArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- reduce(
- resolve(1),
- $this->plus(),
- 1
- )->then($mock);
- }
-
- /** @test */
- public function shouldProvideCorrectBasisValue()
- {
- $insertIntoArray = function ($arr, $val, $i) {
- $arr[$i] = $val;
-
- return $arr;
- };
-
- $d1 = new Deferred();
- $d2 = new Deferred();
- $d3 = new Deferred();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([1, 2, 3]));
-
- reduce(
- [$d1->promise(), $d2->promise(), $d3->promise()],
- $insertIntoArray,
- []
- )->then($mock);
-
- $d3->resolve(3);
- $d1->resolve(1);
- $d2->resolve(2);
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/FunctionRejectTest.php b/lib/gerencianet/react/promise/tests/FunctionRejectTest.php
deleted file mode 100644
index 84b8ec6..0000000
--- a/lib/gerencianet/react/promise/tests/FunctionRejectTest.php
+++ /dev/null
@@ -1,64 +0,0 @@
-createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($expected));
-
- reject($expected)
- ->then(
- $this->expectCallableNever(),
- $mock
- );
- }
-
- /** @test */
- public function shouldRejectAFulfilledPromise()
- {
- $expected = 123;
-
- $resolved = new FulfilledPromise($expected);
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($expected));
-
- reject($resolved)
- ->then(
- $this->expectCallableNever(),
- $mock
- );
- }
-
- /** @test */
- public function shouldRejectARejectedPromise()
- {
- $expected = 123;
-
- $resolved = new RejectedPromise($expected);
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($expected));
-
- reject($resolved)
- ->then(
- $this->expectCallableNever(),
- $mock
- );
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/FunctionResolveTest.php b/lib/gerencianet/react/promise/tests/FunctionResolveTest.php
deleted file mode 100644
index 576c309..0000000
--- a/lib/gerencianet/react/promise/tests/FunctionResolveTest.php
+++ /dev/null
@@ -1,102 +0,0 @@
-createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($expected));
-
- resolve($expected)
- ->then(
- $mock,
- $this->expectCallableNever()
- );
- }
-
- /** @test */
- public function shouldResolveAFulfilledPromise()
- {
- $expected = 123;
-
- $resolved = new FulfilledPromise($expected);
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($expected));
-
- resolve($resolved)
- ->then(
- $mock,
- $this->expectCallableNever()
- );
- }
-
- /** @test */
- public function shouldRejectARejectedPromise()
- {
- $expected = 123;
-
- $resolved = new RejectedPromise($expected);
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($expected));
-
- resolve($resolved)
- ->then(
- $this->expectCallableNever(),
- $mock
- );
- }
-
- /** @test */
- public function shouldSupportDeepNestingInPromiseChains()
- {
- $d = new Deferred();
- $d->resolve(false);
-
- $result = resolve(resolve($d->promise()->then(function ($val) {
- $d = new Deferred();
- $d->resolve($val);
-
- $identity = function ($val) {
- return $val;
- };
-
- return resolve($d->promise()->then($identity))->then(
- function ($val) {
- return !$val;
- }
- );
- })));
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(true));
-
- $result->then($mock);
- }
-
- /** @test */
- public function returnsExtendePromiseForSimplePromise()
- {
- $promise = $this->getMock('React\Promise\PromiseInterface');
-
- $this->assertInstanceOf('React\Promise\ExtendedPromiseInterface', resolve($promise));
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/FunctionSomeTest.php b/lib/gerencianet/react/promise/tests/FunctionSomeTest.php
deleted file mode 100644
index 09e5350..0000000
--- a/lib/gerencianet/react/promise/tests/FunctionSomeTest.php
+++ /dev/null
@@ -1,126 +0,0 @@
-createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([]));
-
- some(
- [],
- 1
- )->then($mock);
- }
-
- /** @test */
- public function shouldResolveValuesArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([1, 2]));
-
- some(
- [1, 2, 3],
- 2
- )->then($mock);
- }
-
- /** @test */
- public function shouldResolvePromisesArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([1, 2]));
-
- some(
- [resolve(1), resolve(2), resolve(3)],
- 2
- )->then($mock);
- }
-
- /** @test */
- public function shouldResolveSparseArrayInput()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([null, 1]));
-
- some(
- [null, 1, null, 2, 3],
- 2
- )->then($mock);
- }
-
- /** @test */
- public function shouldRejectIfAnyInputPromiseRejectsBeforeDesiredNumberOfInputsAreResolved()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([1 => 2, 2 => 3]));
-
- some(
- [resolve(1), reject(2), reject(3)],
- 2
- )->then($this->expectCallableNever(), $mock);
- }
-
- /** @test */
- public function shouldAcceptAPromiseForAnArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([1, 2]));
-
- some(
- resolve([1, 2, 3]),
- 2
- )->then($mock);
- }
-
- /** @test */
- public function shouldResolveWithEmptyArrayIfHowManyIsLessThanOne()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([]));
-
- some(
- [1],
- 0
- )->then($mock);
- }
-
- /** @test */
- public function shouldResolveToEmptyArrayWhenInputPromiseDoesNotResolveToArray()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo([]));
-
- some(
- resolve(1),
- 1
- )->then($mock);
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/LazyPromiseTest.php b/lib/gerencianet/react/promise/tests/LazyPromiseTest.php
deleted file mode 100644
index b630881..0000000
--- a/lib/gerencianet/react/promise/tests/LazyPromiseTest.php
+++ /dev/null
@@ -1,107 +0,0 @@
-promise();
- };
-
- return new CallbackPromiseAdapter([
- 'promise' => function () use ($factory) {
- return new LazyPromise($factory);
- },
- 'resolve' => [$d, 'resolve'],
- 'reject' => [$d, 'reject'],
- 'notify' => [$d, 'progress'],
- 'settle' => [$d, 'resolve'],
- ]);
- }
-
- /** @test */
- public function shouldNotCallFactoryIfThenIsNotInvoked()
- {
- $factory = $this->createCallableMock();
- $factory
- ->expects($this->never())
- ->method('__invoke');
-
- new LazyPromise($factory);
- }
-
- /** @test */
- public function shouldCallFactoryIfThenIsInvoked()
- {
- $factory = $this->createCallableMock();
- $factory
- ->expects($this->once())
- ->method('__invoke');
-
- $p = new LazyPromise($factory);
- $p->then();
- }
-
- /** @test */
- public function shouldReturnPromiseFromFactory()
- {
- $factory = $this->createCallableMock();
- $factory
- ->expects($this->once())
- ->method('__invoke')
- ->will($this->returnValue(new FulfilledPromise(1)));
-
- $onFulfilled = $this->createCallableMock();
- $onFulfilled
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $p = new LazyPromise($factory);
-
- $p->then($onFulfilled);
- }
-
- /** @test */
- public function shouldReturnPromiseIfFactoryReturnsNull()
- {
- $factory = $this->createCallableMock();
- $factory
- ->expects($this->once())
- ->method('__invoke')
- ->will($this->returnValue(null));
-
- $p = new LazyPromise($factory);
- $this->assertInstanceOf('React\\Promise\\PromiseInterface', $p->then());
- }
-
- /** @test */
- public function shouldReturnRejectedPromiseIfFactoryThrowsException()
- {
- $exception = new \Exception();
-
- $factory = $this->createCallableMock();
- $factory
- ->expects($this->once())
- ->method('__invoke')
- ->will($this->throwException($exception));
-
- $onRejected = $this->createCallableMock();
- $onRejected
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $p = new LazyPromise($factory);
-
- $p->then($this->expectCallableNever(), $onRejected);
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/PromiseAdapter/CallbackPromiseAdapter.php b/lib/gerencianet/react/promise/tests/PromiseAdapter/CallbackPromiseAdapter.php
deleted file mode 100644
index bdedf46..0000000
--- a/lib/gerencianet/react/promise/tests/PromiseAdapter/CallbackPromiseAdapter.php
+++ /dev/null
@@ -1,40 +0,0 @@
-callbacks = $callbacks;
- }
-
- public function promise()
- {
- return call_user_func_array($this->callbacks['promise'], func_get_args());
- }
-
- public function resolve()
- {
- return call_user_func_array($this->callbacks['resolve'], func_get_args());
- }
-
- public function reject()
- {
- return call_user_func_array($this->callbacks['reject'], func_get_args());
- }
-
- public function notify()
- {
- return call_user_func_array($this->callbacks['notify'], func_get_args());
- }
-
- public function settle()
- {
- return call_user_func_array($this->callbacks['settle'], func_get_args());
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/PromiseAdapter/PromiseAdapterInterface.php b/lib/gerencianet/react/promise/tests/PromiseAdapter/PromiseAdapterInterface.php
deleted file mode 100644
index 9157cd4..0000000
--- a/lib/gerencianet/react/promise/tests/PromiseAdapter/PromiseAdapterInterface.php
+++ /dev/null
@@ -1,14 +0,0 @@
- function () use ($promise) {
- return $promise;
- },
- 'resolve' => $resolveCallback,
- 'reject' => $rejectCallback,
- 'notify' => $progressCallback,
- 'settle' => $resolveCallback,
- ]);
- }
-
- /** @test */
- public function shouldRejectIfResolverThrowsException()
- {
- $exception = new \Exception('foo');
-
- $promise = new Promise(function () use ($exception) {
- throw $exception;
- });
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $promise
- ->then($this->expectCallableNever(), $mock);
- }
-
- /** @test */
- public function shouldFulfillIfFullfilledWithSimplePromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo('foo'));
-
- $adapter->promise()
- ->then($mock);
-
- $adapter->resolve(new SimpleFulfilledTestPromise());
- }
-
- /** @test */
- public function shouldRejectIfRejectedWithSimplePromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo('foo'));
-
- $adapter->promise()
- ->then($this->expectCallableNever(), $mock);
-
- $adapter->resolve(new SimpleRejectedTestPromise());
- }
-}
-
-class SimpleFulfilledTestPromise implements PromiseInterface
-{
- public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
- {
- try {
- if ($onFulfilled) {
- $onFulfilled('foo');
- }
-
- return new self('foo');
- } catch (\Exception $exception) {
- return new RejectedPromise($exception);
- }
- }
-}
-
-class SimpleRejectedTestPromise implements PromiseInterface
-{
- public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
- {
- try {
- if ($onRejected) {
- $onRejected('foo');
- }
-
- return new self('foo');
- } catch (\Exception $exception) {
- return new RejectedPromise($exception);
- }
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/PromiseTest/CancelTestTrait.php b/lib/gerencianet/react/promise/tests/PromiseTest/CancelTestTrait.php
deleted file mode 100644
index d722d75..0000000
--- a/lib/gerencianet/react/promise/tests/PromiseTest/CancelTestTrait.php
+++ /dev/null
@@ -1,231 +0,0 @@
-createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->isType('callable'), $this->isType('callable'), $this->isType('callable'));
-
- $adapter = $this->getPromiseTestAdapter($mock);
-
- $adapter->promise()->cancel();
- }
-
- /** @test */
- public function cancelShouldFulfillPromiseIfCancellerFulfills()
- {
- $adapter = $this->getPromiseTestAdapter(function ($resolve) {
- $resolve(1);
- });
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->then($mock, $this->expectCallableNever());
-
- $adapter->promise()->cancel();
- }
-
- /** @test */
- public function cancelShouldRejectPromiseIfCancellerRejects()
- {
- $adapter = $this->getPromiseTestAdapter(function ($resolve, $reject) {
- $reject(1);
- });
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->then($this->expectCallableNever(), $mock);
-
- $adapter->promise()->cancel();
- }
-
- /** @test */
- public function cancelShouldRejectPromiseWithExceptionIfCancellerThrows()
- {
- $e = new \Exception();
-
- $adapter = $this->getPromiseTestAdapter(function () use ($e) {
- throw $e;
- });
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($e));
-
- $adapter->promise()
- ->then($this->expectCallableNever(), $mock);
-
- $adapter->promise()->cancel();
- }
-
- /** @test */
- public function cancelShouldProgressPromiseIfCancellerNotifies()
- {
- $adapter = $this->getPromiseTestAdapter(function ($resolve, $reject, $progress) {
- $progress(1);
- });
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->then($this->expectCallableNever(), $this->expectCallableNever(), $mock);
-
- $adapter->promise()->cancel();
- }
-
- /** @test */
- public function cancelShouldCallCancellerOnlyOnceIfCancellerResolves()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->will($this->returnCallback(function ($resolve) {
- $resolve();
- }));
-
- $adapter = $this->getPromiseTestAdapter($mock);
-
- $adapter->promise()->cancel();
- $adapter->promise()->cancel();
- }
-
- /** @test */
- public function cancelShouldHaveNoEffectIfCancellerDoesNothing()
- {
- $adapter = $this->getPromiseTestAdapter(function () {});
-
- $adapter->promise()
- ->then($this->expectCallableNever(), $this->expectCallableNever());
-
- $adapter->promise()->cancel();
- $adapter->promise()->cancel();
- }
-
- /** @test */
- public function cancelShouldCallCancellerFromDeepNestedPromiseChain()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke');
-
- $adapter = $this->getPromiseTestAdapter($mock);
-
- $promise = $adapter->promise()
- ->then(function () {
- return new Promise\Promise(function () {});
- })
- ->then(function () {
- $d = new Promise\Deferred();
-
- return $d->promise();
- })
- ->then(function () {
- return new Promise\Promise(function () {});
- });
-
- $promise->cancel();
- }
-
- /** @test */
- public function cancelCalledOnChildrenSouldOnlyCancelWhenAllChildrenCancelled()
- {
- $adapter = $this->getPromiseTestAdapter($this->expectCallableNever());
-
- $child1 = $adapter->promise()
- ->then()
- ->then();
-
- $adapter->promise()
- ->then();
-
- $child1->cancel();
- }
-
- /** @test */
- public function cancelShouldTriggerCancellerWhenAllChildrenCancel()
- {
- $adapter = $this->getPromiseTestAdapter($this->expectCallableOnce());
-
- $child1 = $adapter->promise()
- ->then()
- ->then();
-
- $child2 = $adapter->promise()
- ->then();
-
- $child1->cancel();
- $child2->cancel();
- }
-
- /** @test */
- public function cancelShouldNotTriggerCancellerWhenCancellingOneChildrenMultipleTimes()
- {
- $adapter = $this->getPromiseTestAdapter($this->expectCallableNever());
-
- $child1 = $adapter->promise()
- ->then()
- ->then();
-
- $child2 = $adapter->promise()
- ->then();
-
- $child1->cancel();
- $child1->cancel();
- }
-
- /** @test */
- public function cancelShouldTriggerCancellerOnlyOnceWhenCancellingMultipleTimes()
- {
- $adapter = $this->getPromiseTestAdapter($this->expectCallableOnce());
-
- $adapter->promise()->cancel();
- $adapter->promise()->cancel();
- }
-
- /** @test */
- public function cancelShouldAlwaysTriggerCancellerWhenCalledOnRootPromise()
- {
- $adapter = $this->getPromiseTestAdapter($this->expectCallableOnce());
-
- $adapter->promise()
- ->then()
- ->then();
-
- $adapter->promise()
- ->then();
-
- $adapter->promise()->cancel();
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/PromiseTest/FullTestTrait.php b/lib/gerencianet/react/promise/tests/PromiseTest/FullTestTrait.php
deleted file mode 100644
index 3ce45d6..0000000
--- a/lib/gerencianet/react/promise/tests/PromiseTest/FullTestTrait.php
+++ /dev/null
@@ -1,15 +0,0 @@
-getPromiseTestAdapter();
-
- $sentinel = new \stdClass();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($sentinel);
-
- $adapter->promise()
- ->then($this->expectCallableNever(), $this->expectCallableNever(), $mock);
-
- $adapter->notify($sentinel);
- }
-
- /** @test */
- public function notifyShouldPropagateProgressToDownstreamPromises()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $sentinel = new \stdClass();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->will($this->returnArgument(0));
-
- $mock2 = $this->createCallableMock();
- $mock2
- ->expects($this->once())
- ->method('__invoke')
- ->with($sentinel);
-
- $adapter->promise()
- ->then(
- $this->expectCallableNever(),
- $this->expectCallableNever(),
- $mock
- )
- ->then(
- $this->expectCallableNever(),
- $this->expectCallableNever(),
- $mock2
- );
-
- $adapter->notify($sentinel);
- }
-
- /** @test */
- public function notifyShouldPropagateTransformedProgressToDownstreamPromises()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $sentinel = new \stdClass();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->will($this->returnValue($sentinel));
-
- $mock2 = $this->createCallableMock();
- $mock2
- ->expects($this->once())
- ->method('__invoke')
- ->with($sentinel);
-
- $adapter->promise()
- ->then(
- $this->expectCallableNever(),
- $this->expectCallableNever(),
- $mock
- )
- ->then(
- $this->expectCallableNever(),
- $this->expectCallableNever(),
- $mock2
- );
-
- $adapter->notify(1);
- }
-
- /** @test */
- public function notifyShouldPropagateCaughtExceptionValueAsProgress()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->will($this->throwException($exception));
-
- $mock2 = $this->createCallableMock();
- $mock2
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->promise()
- ->then(
- $this->expectCallableNever(),
- $this->expectCallableNever(),
- $mock
- )
- ->then(
- $this->expectCallableNever(),
- $this->expectCallableNever(),
- $mock2
- );
-
- $adapter->notify(1);
- }
-
- /** @test */
- public function notifyShouldForwardProgressEventsWhenIntermediaryCallbackTiedToAResolvedPromiseReturnsAPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
- $adapter2 = $this->getPromiseTestAdapter();
-
- $promise2 = $adapter2->promise();
-
- $sentinel = new \stdClass();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($sentinel);
-
- // resolve BEFORE attaching progress handler
- $adapter->resolve();
-
- $adapter->promise()
- ->then(function () use ($promise2) {
- return $promise2;
- })
- ->then(
- $this->expectCallableNever(),
- $this->expectCallableNever(),
- $mock
- );
-
- $adapter2->notify($sentinel);
- }
-
- /** @test */
- public function notifyShouldForwardProgressEventsWhenIntermediaryCallbackTiedToAnUnresolvedPromiseReturnsAPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
- $adapter2 = $this->getPromiseTestAdapter();
-
- $promise2 = $adapter2->promise();
-
- $sentinel = new \stdClass();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($sentinel);
-
- $adapter->promise()
- ->then(function () use ($promise2) {
- return $promise2;
- })
- ->then(
- $this->expectCallableNever(),
- $this->expectCallableNever(),
- $mock
- );
-
- // resolve AFTER attaching progress handler
- $adapter->resolve();
- $adapter2->notify($sentinel);
- }
-
- /** @test */
- public function notifyShouldForwardProgressWhenResolvedWithAnotherPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
- $adapter2 = $this->getPromiseTestAdapter();
-
- $sentinel = new \stdClass();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->will($this->returnValue($sentinel));
-
- $mock2 = $this->createCallableMock();
- $mock2
- ->expects($this->once())
- ->method('__invoke')
- ->with($sentinel);
-
- $adapter->promise()
- ->then(
- $this->expectCallableNever(),
- $this->expectCallableNever(),
- $mock
- )
- ->then(
- $this->expectCallableNever(),
- $this->expectCallableNever(),
- $mock2
- );
-
- $adapter->resolve($adapter2->promise());
- $adapter2->notify($sentinel);
- }
-
- /** @test */
- public function notifyShouldAllowResolveAfterProgress()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->at(0))
- ->method('__invoke')
- ->with($this->identicalTo(1));
- $mock
- ->expects($this->at(1))
- ->method('__invoke')
- ->with($this->identicalTo(2));
-
- $adapter->promise()
- ->then(
- $mock,
- $this->expectCallableNever(),
- $mock
- );
-
- $adapter->notify(1);
- $adapter->resolve(2);
- }
-
- /** @test */
- public function notifyShouldAllowRejectAfterProgress()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->at(0))
- ->method('__invoke')
- ->with($this->identicalTo(1));
- $mock
- ->expects($this->at(1))
- ->method('__invoke')
- ->with($this->identicalTo(2));
-
- $adapter->promise()
- ->then(
- $this->expectCallableNever(),
- $mock,
- $mock
- );
-
- $adapter->notify(1);
- $adapter->reject(2);
- }
-
- /** @test */
- public function notifyShouldReturnSilentlyOnProgressWhenAlreadyRejected()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $adapter->reject(1);
-
- $this->assertNull($adapter->notify());
- }
-
- /** @test */
- public function notifyShouldInvokeProgressHandler()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()->progress($mock);
- $adapter->notify(1);
- }
-
- /** @test */
- public function notifyShouldInvokeProgressHandlerFromDone()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $this->assertNull($adapter->promise()->done(null, null, $mock));
- $adapter->notify(1);
- }
-
- /** @test */
- public function notifyShouldThrowExceptionThrownProgressHandlerFromDone()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('\Exception', 'UnhandledRejectionException');
-
- $this->assertNull($adapter->promise()->done(null, null, function () {
- throw new \Exception('UnhandledRejectionException');
- }));
- $adapter->notify(1);
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/PromiseTest/PromiseFulfilledTestTrait.php b/lib/gerencianet/react/promise/tests/PromiseTest/PromiseFulfilledTestTrait.php
deleted file mode 100644
index 428230b..0000000
--- a/lib/gerencianet/react/promise/tests/PromiseTest/PromiseFulfilledTestTrait.php
+++ /dev/null
@@ -1,351 +0,0 @@
-getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->resolve(1);
- $adapter->resolve(2);
-
- $adapter->promise()
- ->then(
- $mock,
- $this->expectCallableNever()
- );
- }
-
- /** @test */
- public function fulfilledPromiseShouldInvokeNewlyAddedCallback()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $adapter->resolve(1);
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->then($mock, $this->expectCallableNever());
- }
-
- /** @test */
- public function thenShouldForwardResultWhenCallbackIsNull()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->resolve(1);
- $adapter->promise()
- ->then(
- null,
- $this->expectCallableNever()
- )
- ->then(
- $mock,
- $this->expectCallableNever()
- );
- }
-
- /** @test */
- public function thenShouldForwardCallbackResultToNextCallback()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(2));
-
- $adapter->resolve(1);
- $adapter->promise()
- ->then(
- function ($val) {
- return $val + 1;
- },
- $this->expectCallableNever()
- )
- ->then(
- $mock,
- $this->expectCallableNever()
- );
- }
-
- /** @test */
- public function thenShouldForwardPromisedCallbackResultValueToNextCallback()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(2));
-
- $adapter->resolve(1);
- $adapter->promise()
- ->then(
- function ($val) {
- return \React\Promise\resolve($val + 1);
- },
- $this->expectCallableNever()
- )
- ->then(
- $mock,
- $this->expectCallableNever()
- );
- }
-
- /** @test */
- public function thenShouldSwitchFromCallbacksToErrbacksWhenCallbackReturnsARejection()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(2));
-
- $adapter->resolve(1);
- $adapter->promise()
- ->then(
- function ($val) {
- return \React\Promise\reject($val + 1);
- },
- $this->expectCallableNever()
- )
- ->then(
- $this->expectCallableNever(),
- $mock
- );
- }
-
- /** @test */
- public function thenShouldSwitchFromCallbacksToErrbacksWhenCallbackThrows()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->will($this->throwException($exception));
-
- $mock2 = $this->createCallableMock();
- $mock2
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->resolve(1);
- $adapter->promise()
- ->then(
- $mock,
- $this->expectCallableNever()
- )
- ->then(
- $this->expectCallableNever(),
- $mock2
- );
- }
-
- /** @test */
- public function cancelShouldReturnNullForFulfilledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $adapter->resolve();
-
- $this->assertNull($adapter->promise()->cancel());
- }
-
- /** @test */
- public function cancelShouldHaveNoEffectForFulfilledPromise()
- {
- $adapter = $this->getPromiseTestAdapter($this->expectCallableNever());
-
- $adapter->resolve();
-
- $adapter->promise()->cancel();
- }
-
- /** @test */
- public function doneShouldInvokeFulfillmentHandlerForFulfilledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->resolve(1);
- $this->assertNull($adapter->promise()->done($mock));
- }
-
- /** @test */
- public function doneShouldThrowExceptionThrownFulfillmentHandlerForFulfilledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('\Exception', 'UnhandledRejectionException');
-
- $adapter->resolve(1);
- $this->assertNull($adapter->promise()->done(function () {
- throw new \Exception('UnhandledRejectionException');
- }));
- }
-
- /** @test */
- public function doneShouldThrowUnhandledRejectionExceptionWhenFulfillmentHandlerRejectsForFulfilledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('React\\Promise\\UnhandledRejectionException');
-
- $adapter->resolve(1);
- $this->assertNull($adapter->promise()->done(function () {
- return \React\Promise\reject();
- }));
- }
-
- /** @test */
- public function otherwiseShouldNotInvokeRejectionHandlerForFulfilledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $adapter->resolve(1);
- $adapter->promise()->otherwise($this->expectCallableNever());
- }
-
- /** @test */
- public function alwaysShouldNotSuppressValueForFulfilledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $value = new \stdClass();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($value));
-
- $adapter->resolve($value);
- $adapter->promise()
- ->always(function () {})
- ->then($mock);
- }
-
- /** @test */
- public function alwaysShouldNotSuppressValueWhenHandlerReturnsANonPromiseForFulfilledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $value = new \stdClass();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($value));
-
- $adapter->resolve($value);
- $adapter->promise()
- ->always(function () {
- return 1;
- })
- ->then($mock);
- }
-
- /** @test */
- public function alwaysShouldNotSuppressValueWhenHandlerReturnsAPromiseForFulfilledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $value = new \stdClass();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($value));
-
- $adapter->resolve($value);
- $adapter->promise()
- ->always(function () {
- return \React\Promise\resolve(1);
- })
- ->then($mock);
- }
-
- /** @test */
- public function alwaysShouldRejectWhenHandlerThrowsForFulfilledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->resolve(1);
- $adapter->promise()
- ->always(function () use ($exception) {
- throw $exception;
- })
- ->then(null, $mock);
- }
-
- /** @test */
- public function alwaysShouldRejectWhenHandlerRejectsForFulfilledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->resolve(1);
- $adapter->promise()
- ->always(function () use ($exception) {
- return \React\Promise\reject($exception);
- })
- ->then(null, $mock);
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/PromiseTest/PromisePendingTestTrait.php b/lib/gerencianet/react/promise/tests/PromiseTest/PromisePendingTestTrait.php
deleted file mode 100644
index a4f48ee..0000000
--- a/lib/gerencianet/react/promise/tests/PromiseTest/PromisePendingTestTrait.php
+++ /dev/null
@@ -1,68 +0,0 @@
-getPromiseTestAdapter();
-
- $this->assertInstanceOf('React\\Promise\\PromiseInterface', $adapter->promise()->then());
- }
-
- /** @test */
- public function thenShouldReturnAllowNullForPendingPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->assertInstanceOf('React\\Promise\\PromiseInterface', $adapter->promise()->then(null, null, null));
- }
-
- /** @test */
- public function cancelShouldReturnNullForPendingPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->assertNull($adapter->promise()->cancel());
- }
-
- /** @test */
- public function doneShouldReturnNullForPendingPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->assertNull($adapter->promise()->done());
- }
-
- /** @test */
- public function doneShouldReturnAllowNullForPendingPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->assertNull($adapter->promise()->done(null, null, null));
- }
-
- /** @test */
- public function otherwiseShouldNotInvokeRejectionHandlerForPendingPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $adapter->settle();
- $adapter->promise()->otherwise($this->expectCallableNever());
- }
-
- /** @test */
- public function alwaysShouldReturnAPromiseForPendingPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->assertInstanceOf('React\\Promise\\PromiseInterface', $adapter->promise()->always(function () {}));
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/PromiseTest/PromiseRejectedTestTrait.php b/lib/gerencianet/react/promise/tests/PromiseTest/PromiseRejectedTestTrait.php
deleted file mode 100644
index 64255e8..0000000
--- a/lib/gerencianet/react/promise/tests/PromiseTest/PromiseRejectedTestTrait.php
+++ /dev/null
@@ -1,492 +0,0 @@
-getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->reject(1);
- $adapter->reject(2);
-
- $adapter->promise()
- ->then(
- $this->expectCallableNever(),
- $mock
- );
- }
-
- /** @test */
- public function rejectedPromiseShouldInvokeNewlyAddedCallback()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $adapter->reject(1);
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->then($this->expectCallableNever(), $mock);
- }
-
- /** @test */
- public function shouldForwardUndefinedRejectionValue()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with(null);
-
- $adapter->reject(1);
- $adapter->promise()
- ->then(
- $this->expectCallableNever(),
- function () {
- // Presence of rejection handler is enough to switch back
- // to resolve mode, even though it returns undefined.
- // The ONLY way to propagate a rejection is to re-throw or
- // return a rejected promise;
- }
- )
- ->then(
- $mock,
- $this->expectCallableNever()
- );
- }
-
- /** @test */
- public function shouldSwitchFromErrbacksToCallbacksWhenErrbackDoesNotExplicitlyPropagate()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(2));
-
- $adapter->reject(1);
- $adapter->promise()
- ->then(
- $this->expectCallableNever(),
- function ($val) {
- return $val + 1;
- }
- )
- ->then(
- $mock,
- $this->expectCallableNever()
- );
- }
-
- /** @test */
- public function shouldSwitchFromErrbacksToCallbacksWhenErrbackReturnsAResolution()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(2));
-
- $adapter->reject(1);
- $adapter->promise()
- ->then(
- $this->expectCallableNever(),
- function ($val) {
- return \React\Promise\resolve($val + 1);
- }
- )
- ->then(
- $mock,
- $this->expectCallableNever()
- );
- }
-
- /** @test */
- public function shouldPropagateRejectionsWhenErrbackThrows()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->will($this->throwException($exception));
-
- $mock2 = $this->createCallableMock();
- $mock2
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->reject(1);
- $adapter->promise()
- ->then(
- $this->expectCallableNever(),
- $mock
- )
- ->then(
- $this->expectCallableNever(),
- $mock2
- );
- }
-
- /** @test */
- public function shouldPropagateRejectionsWhenErrbackReturnsARejection()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(2));
-
- $adapter->reject(1);
- $adapter->promise()
- ->then(
- $this->expectCallableNever(),
- function ($val) {
- return \React\Promise\reject($val + 1);
- }
- )
- ->then(
- $this->expectCallableNever(),
- $mock
- );
- }
-
- /** @test */
- public function doneShouldInvokeRejectionHandlerForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->reject(1);
- $this->assertNull($adapter->promise()->done(null, $mock));
- }
-
- /** @test */
- public function doneShouldThrowExceptionThrownByRejectionHandlerForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('\Exception', 'UnhandledRejectionException');
-
- $adapter->reject(1);
- $this->assertNull($adapter->promise()->done(null, function () {
- throw new \Exception('UnhandledRejectionException');
- }));
- }
-
- /** @test */
- public function doneShouldThrowUnhandledRejectionExceptionWhenRejectedWithNonExceptionForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('React\\Promise\\UnhandledRejectionException');
-
- $adapter->reject(1);
- $this->assertNull($adapter->promise()->done());
- }
-
- /** @test */
- public function doneShouldThrowUnhandledRejectionExceptionWhenRejectionHandlerRejectsForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('React\\Promise\\UnhandledRejectionException');
-
- $adapter->reject(1);
- $this->assertNull($adapter->promise()->done(null, function () {
- return \React\Promise\reject();
- }));
- }
-
- /** @test */
- public function doneShouldThrowRejectionExceptionWhenRejectionHandlerRejectsWithExceptionForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('\Exception', 'UnhandledRejectionException');
-
- $adapter->reject(1);
- $this->assertNull($adapter->promise()->done(null, function () {
- return \React\Promise\reject(new \Exception('UnhandledRejectionException'));
- }));
- }
-
- /** @test */
- public function doneShouldThrowExceptionProvidedAsRejectionValueForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('\Exception', 'UnhandledRejectionException');
-
- $adapter->reject(new \Exception('UnhandledRejectionException'));
- $this->assertNull($adapter->promise()->done());
- }
-
- /** @test */
- public function doneShouldThrowWithDeepNestingPromiseChainsForRejectedPromise()
- {
- $this->setExpectedException('\Exception', 'UnhandledRejectionException');
-
- $exception = new \Exception('UnhandledRejectionException');
-
- $d = new Deferred();
- $d->resolve();
-
- $result = \React\Promise\resolve(\React\Promise\resolve($d->promise()->then(function () use ($exception) {
- $d = new Deferred();
- $d->resolve();
-
- return \React\Promise\resolve($d->promise()->then(function () {}))->then(
- function () use ($exception) {
- throw $exception;
- }
- );
- })));
-
- $result->done();
- }
-
- /** @test */
- public function doneShouldRecoverWhenRejectionHandlerCatchesExceptionForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $adapter->reject(new \Exception('UnhandledRejectionException'));
- $this->assertNull($adapter->promise()->done(null, function (\Exception $e) {
-
- }));
- }
-
- /** @test */
- public function otherwiseShouldInvokeRejectionHandlerForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->reject(1);
- $adapter->promise()->otherwise($mock);
- }
-
- /** @test */
- public function otherwiseShouldInvokeNonTypeHintedRejectionHandlerIfReasonIsAnExceptionForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->reject($exception);
- $adapter->promise()
- ->otherwise(function ($reason) use ($mock) {
- $mock($reason);
- });
- }
-
- /** @test */
- public function otherwiseShouldInvokeRejectionHandlerIfReasonMatchesTypehintForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \InvalidArgumentException();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->reject($exception);
- $adapter->promise()
- ->otherwise(function (\InvalidArgumentException $reason) use ($mock) {
- $mock($reason);
- });
- }
-
- /** @test */
- public function otherwiseShouldNotInvokeRejectionHandlerIfReaonsDoesNotMatchTypehintForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->expectCallableNever();
-
- $adapter->reject($exception);
- $adapter->promise()
- ->otherwise(function (\InvalidArgumentException $reason) use ($mock) {
- $mock($reason);
- });
- }
-
- /** @test */
- public function alwaysShouldNotSuppressRejectionForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->reject($exception);
- $adapter->promise()
- ->always(function () {})
- ->then(null, $mock);
- }
-
- /** @test */
- public function alwaysShouldNotSuppressRejectionWhenHandlerReturnsANonPromiseForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->reject($exception);
- $adapter->promise()
- ->always(function () {
- return 1;
- })
- ->then(null, $mock);
- }
-
- /** @test */
- public function alwaysShouldNotSuppressRejectionWhenHandlerReturnsAPromiseForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->reject($exception);
- $adapter->promise()
- ->always(function () {
- return \React\Promise\resolve(1);
- })
- ->then(null, $mock);
- }
-
- /** @test */
- public function alwaysShouldRejectWhenHandlerThrowsForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception1 = new \Exception();
- $exception2 = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception2));
-
- $adapter->reject($exception1);
- $adapter->promise()
- ->always(function () use ($exception2) {
- throw $exception2;
- })
- ->then(null, $mock);
- }
-
- /** @test */
- public function alwaysShouldRejectWhenHandlerRejectsForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception1 = new \Exception();
- $exception2 = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception2));
-
- $adapter->reject($exception1);
- $adapter->promise()
- ->always(function () use ($exception2) {
- return \React\Promise\reject($exception2);
- })
- ->then(null, $mock);
- }
-
- /** @test */
- public function cancelShouldReturnNullForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $adapter->reject();
-
- $this->assertNull($adapter->promise()->cancel());
- }
-
- /** @test */
- public function cancelShouldHaveNoEffectForRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter($this->expectCallableNever());
-
- $adapter->reject();
-
- $adapter->promise()->cancel();
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/PromiseTest/PromiseSettledTestTrait.php b/lib/gerencianet/react/promise/tests/PromiseTest/PromiseSettledTestTrait.php
deleted file mode 100644
index e363b6d..0000000
--- a/lib/gerencianet/react/promise/tests/PromiseTest/PromiseSettledTestTrait.php
+++ /dev/null
@@ -1,86 +0,0 @@
-getPromiseTestAdapter();
-
- $adapter->settle();
- $this->assertInstanceOf('React\\Promise\\PromiseInterface', $adapter->promise()->then());
- }
-
- /** @test */
- public function thenShouldReturnAllowNullForSettledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $adapter->settle();
- $this->assertInstanceOf('React\\Promise\\PromiseInterface', $adapter->promise()->then(null, null, null));
- }
-
- /** @test */
- public function cancelShouldReturnNullForSettledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $adapter->settle();
-
- $this->assertNull($adapter->promise()->cancel());
- }
-
- /** @test */
- public function cancelShouldHaveNoEffectForSettledPromise()
- {
- $adapter = $this->getPromiseTestAdapter($this->expectCallableNever());
-
- $adapter->settle();
-
- $adapter->promise()->cancel();
- }
-
- /** @test */
- public function doneShouldReturnNullForSettledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $adapter->settle();
- $this->assertNull($adapter->promise()->done(null, function () {}));
- }
-
- /** @test */
- public function doneShouldReturnAllowNullForSettledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $adapter->settle();
- $this->assertNull($adapter->promise()->done(null, function () {}, null));
- }
-
- /** @test */
- public function progressShouldNotInvokeProgressHandlerForSettledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $adapter->settle();
- $adapter->promise()->progress($this->expectCallableNever());
- $adapter->notify();
- }
-
- /** @test */
- public function alwaysShouldReturnAPromiseForSettledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $adapter->settle();
- $this->assertInstanceOf('React\\Promise\\PromiseInterface', $adapter->promise()->always(function () {}));
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/PromiseTest/RejectTestTrait.php b/lib/gerencianet/react/promise/tests/PromiseTest/RejectTestTrait.php
deleted file mode 100644
index 063f178..0000000
--- a/lib/gerencianet/react/promise/tests/PromiseTest/RejectTestTrait.php
+++ /dev/null
@@ -1,368 +0,0 @@
-getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->then($this->expectCallableNever(), $mock);
-
- $adapter->reject(1);
- }
-
- /** @test */
- public function rejectShouldRejectWithFulfilledPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->then($this->expectCallableNever(), $mock);
-
- $adapter->reject(Promise\resolve(1));
- }
-
- /** @test */
- public function rejectShouldRejectWithRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->then($this->expectCallableNever(), $mock);
-
- $adapter->reject(Promise\reject(1));
- }
-
- /** @test */
- public function rejectShouldForwardReasonWhenCallbackIsNull()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->then(
- $this->expectCallableNever()
- )
- ->then(
- $this->expectCallableNever(),
- $mock
- );
-
- $adapter->reject(1);
- }
-
- /** @test */
- public function rejectShouldMakePromiseImmutable()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->then(null, function ($value) use ($adapter) {
- $adapter->reject(3);
-
- return Promise\reject($value);
- })
- ->then(
- $this->expectCallableNever(),
- $mock
- );
-
- $adapter->reject(1);
- $adapter->reject(2);
- }
-
- /** @test */
- public function notifyShouldInvokeOtherwiseHandler()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->otherwise($mock);
-
- $adapter->reject(1);
- }
-
- /** @test */
- public function doneShouldInvokeRejectionHandler()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $this->assertNull($adapter->promise()->done(null, $mock));
- $adapter->reject(1);
- }
-
- /** @test */
- public function doneShouldThrowExceptionThrownByRejectionHandler()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('\Exception', 'UnhandledRejectionException');
-
- $this->assertNull($adapter->promise()->done(null, function () {
- throw new \Exception('UnhandledRejectionException');
- }));
- $adapter->reject(1);
- }
-
- /** @test */
- public function doneShouldThrowUnhandledRejectionExceptionWhenRejectedWithNonException()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('React\\Promise\\UnhandledRejectionException');
-
- $this->assertNull($adapter->promise()->done());
- $adapter->reject(1);
- }
-
- /** @test */
- public function doneShouldThrowUnhandledRejectionExceptionWhenRejectionHandlerRejects()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('React\\Promise\\UnhandledRejectionException');
-
- $this->assertNull($adapter->promise()->done(null, function () {
- return \React\Promise\reject();
- }));
- $adapter->reject(1);
- }
-
- /** @test */
- public function doneShouldThrowRejectionExceptionWhenRejectionHandlerRejectsWithException()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('\Exception', 'UnhandledRejectionException');
-
- $this->assertNull($adapter->promise()->done(null, function () {
- return \React\Promise\reject(new \Exception('UnhandledRejectionException'));
- }));
- $adapter->reject(1);
- }
-
- /** @test */
- public function doneShouldThrowUnhandledRejectionExceptionWhenRejectionHandlerRetunsPendingPromiseWhichRejectsLater()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('React\\Promise\\UnhandledRejectionException');
-
- $d = new Deferred();
- $promise = $d->promise();
-
- $this->assertNull($adapter->promise()->done(null, function () use ($promise) {
- return $promise;
- }));
- $adapter->reject(1);
- $d->reject(1);
- }
-
- /** @test */
- public function doneShouldThrowExceptionProvidedAsRejectionValue()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('\Exception', 'UnhandledRejectionException');
-
- $this->assertNull($adapter->promise()->done());
- $adapter->reject(new \Exception('UnhandledRejectionException'));
- }
-
- /** @test */
- public function doneShouldThrowWithDeepNestingPromiseChains()
- {
- $this->setExpectedException('\Exception', 'UnhandledRejectionException');
-
- $exception = new \Exception('UnhandledRejectionException');
-
- $d = new Deferred();
-
- $result = \React\Promise\resolve(\React\Promise\resolve($d->promise()->then(function () use ($exception) {
- $d = new Deferred();
- $d->resolve();
-
- return \React\Promise\resolve($d->promise()->then(function () {}))->then(
- function () use ($exception) {
- throw $exception;
- }
- );
- })));
-
- $result->done();
-
- $d->resolve();
- }
-
- /** @test */
- public function doneShouldRecoverWhenRejectionHandlerCatchesException()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->assertNull($adapter->promise()->done(null, function (\Exception $e) {
-
- }));
- $adapter->reject(new \Exception('UnhandledRejectionException'));
- }
-
- /** @test */
- public function alwaysShouldNotSuppressRejection()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->promise()
- ->always(function () {})
- ->then(null, $mock);
-
- $adapter->reject($exception);
- }
-
- /** @test */
- public function alwaysShouldNotSuppressRejectionWhenHandlerReturnsANonPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->promise()
- ->always(function () {
- return 1;
- })
- ->then(null, $mock);
-
- $adapter->reject($exception);
- }
-
- /** @test */
- public function alwaysShouldNotSuppressRejectionWhenHandlerReturnsAPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->promise()
- ->always(function () {
- return \React\Promise\resolve(1);
- })
- ->then(null, $mock);
-
- $adapter->reject($exception);
- }
-
- /** @test */
- public function alwaysShouldRejectWhenHandlerThrowsForRejection()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->promise()
- ->always(function () use ($exception) {
- throw $exception;
- })
- ->then(null, $mock);
-
- $adapter->reject($exception);
- }
-
- /** @test */
- public function alwaysShouldRejectWhenHandlerRejectsForRejection()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->promise()
- ->always(function () use ($exception) {
- return \React\Promise\reject($exception);
- })
- ->then(null, $mock);
-
- $adapter->reject($exception);
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/PromiseTest/ResolveTestTrait.php b/lib/gerencianet/react/promise/tests/PromiseTest/ResolveTestTrait.php
deleted file mode 100644
index 46f95ad..0000000
--- a/lib/gerencianet/react/promise/tests/PromiseTest/ResolveTestTrait.php
+++ /dev/null
@@ -1,263 +0,0 @@
-getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->then($mock);
-
- $adapter->resolve(1);
- }
-
- /** @test */
- public function resolveShouldResolveWithPromisedValue()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->then($mock);
-
- $adapter->resolve(Promise\resolve(1));
- }
-
- /** @test */
- public function resolveShouldRejectWhenResolvedWithRejectedPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->then($this->expectCallableNever(), $mock);
-
- $adapter->resolve(Promise\reject(1));
- }
-
- /** @test */
- public function resolveShouldForwardValueWhenCallbackIsNull()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->then(
- null,
- $this->expectCallableNever()
- )
- ->then(
- $mock,
- $this->expectCallableNever()
- );
-
- $adapter->resolve(1);
- }
-
- /** @test */
- public function resolveShouldMakePromiseImmutable()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $adapter->promise()
- ->then(function ($value) use ($adapter) {
- $adapter->resolve(3);
-
- return $value;
- })
- ->then(
- $mock,
- $this->expectCallableNever()
- );
-
- $adapter->resolve(1);
- $adapter->resolve(2);
- }
-
- /** @test */
- public function doneShouldInvokeFulfillmentHandler()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo(1));
-
- $this->assertNull($adapter->promise()->done($mock));
- $adapter->resolve(1);
- }
-
- /** @test */
- public function doneShouldThrowExceptionThrownFulfillmentHandler()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('\Exception', 'UnhandledRejectionException');
-
- $this->assertNull($adapter->promise()->done(function () {
- throw new \Exception('UnhandledRejectionException');
- }));
- $adapter->resolve(1);
- }
-
- /** @test */
- public function doneShouldThrowUnhandledRejectionExceptionWhenFulfillmentHandlerRejects()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $this->setExpectedException('React\\Promise\\UnhandledRejectionException');
-
- $this->assertNull($adapter->promise()->done(function () {
- return \React\Promise\reject();
- }));
- $adapter->resolve(1);
- }
-
- /** @test */
- public function alwaysShouldNotSuppressValue()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $value = new \stdClass();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($value));
-
- $adapter->promise()
- ->always(function () {})
- ->then($mock);
-
- $adapter->resolve($value);
- }
-
- /** @test */
- public function alwaysShouldNotSuppressValueWhenHandlerReturnsANonPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $value = new \stdClass();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($value));
-
- $adapter->promise()
- ->always(function () {
- return 1;
- })
- ->then($mock);
-
- $adapter->resolve($value);
- }
-
- /** @test */
- public function alwaysShouldNotSuppressValueWhenHandlerReturnsAPromise()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $value = new \stdClass();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($value));
-
- $adapter->promise()
- ->always(function () {
- return \React\Promise\resolve(1);
- })
- ->then($mock);
-
- $adapter->resolve($value);
- }
-
- /** @test */
- public function alwaysShouldRejectWhenHandlerThrowsForFulfillment()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->promise()
- ->always(function () use ($exception) {
- throw $exception;
- })
- ->then(null, $mock);
-
- $adapter->resolve(1);
- }
-
- /** @test */
- public function alwaysShouldRejectWhenHandlerRejectsForFulfillment()
- {
- $adapter = $this->getPromiseTestAdapter();
-
- $exception = new \Exception();
-
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke')
- ->with($this->identicalTo($exception));
-
- $adapter->promise()
- ->always(function () use ($exception) {
- return \React\Promise\reject($exception);
- })
- ->then(null, $mock);
-
- $adapter->resolve(1);
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/RejectedPromiseTest.php b/lib/gerencianet/react/promise/tests/RejectedPromiseTest.php
deleted file mode 100644
index c886b00..0000000
--- a/lib/gerencianet/react/promise/tests/RejectedPromiseTest.php
+++ /dev/null
@@ -1,50 +0,0 @@
- function () use (&$promise) {
- if (!$promise) {
- throw new \LogicException('RejectedPromise must be rejected before obtaining the promise');
- }
-
- return $promise;
- },
- 'resolve' => function () {
- throw new \LogicException('You cannot call resolve() for React\Promise\RejectedPromise');
- },
- 'reject' => function ($reason = null) use (&$promise) {
- if (!$promise) {
- $promise = new RejectedPromise($reason);
- }
- },
- 'notify' => function () {
- // no-op
- },
- 'settle' => function ($reason = null) use (&$promise) {
- if (!$promise) {
- $promise = new RejectedPromise($reason);
- }
- },
- ]);
- }
-
- /** @test */
- public function shouldThrowExceptionIfConstructedWithAPromise()
- {
- $this->setExpectedException('\InvalidArgumentException');
-
- return new RejectedPromise(new RejectedPromise());
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/Stub/CallableStub.php b/lib/gerencianet/react/promise/tests/Stub/CallableStub.php
deleted file mode 100644
index 0120893..0000000
--- a/lib/gerencianet/react/promise/tests/Stub/CallableStub.php
+++ /dev/null
@@ -1,10 +0,0 @@
-createCallableMock();
- $mock
- ->expects($this->exactly($amount))
- ->method('__invoke');
-
- return $mock;
- }
-
- public function expectCallableOnce()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke');
-
- return $mock;
- }
-
- public function expectCallableNever()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->never())
- ->method('__invoke');
-
- return $mock;
- }
-
- public function createCallableMock()
- {
- return $this->getMock('React\\Promise\Stub\CallableStub');
- }
-}
diff --git a/lib/gerencianet/react/promise/tests/bootstrap.php b/lib/gerencianet/react/promise/tests/bootstrap.php
deleted file mode 100644
index 9b7f872..0000000
--- a/lib/gerencianet/react/promise/tests/bootstrap.php
+++ /dev/null
@@ -1,7 +0,0 @@
-addPsr4('React\\Promise\\', __DIR__);
diff --git a/lib/gerencianet/satooshi/php-coveralls/.gitignore b/lib/gerencianet/satooshi/php-coveralls/.gitignore
deleted file mode 100644
index f427102..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/.gitignore
+++ /dev/null
@@ -1,21 +0,0 @@
-# eclipse
-.buildpath
-.project
-.settings/
-
-# PHP prj
-build/
-cache.properties
-
-# composer
-vendor/
-composer.lock
-
-# travis
-travis/
-
-# bin
-composer.phar
-php-cs-fixer.phar
-
-.coveralls.yml
diff --git a/lib/gerencianet/satooshi/php-coveralls/.travis.yml b/lib/gerencianet/satooshi/php-coveralls/.travis.yml
deleted file mode 100644
index 84ceadf..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/.travis.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-language: php
-php:
- - 5.5
- - 5.4
- - 5.3
-
-matrix:
- allow_failures:
- - php: 5.5
-
-before_script:
- - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ~/xdebug.ini
- - curl -s http://getcomposer.org/installer | php
- - php composer.phar install --dev --no-interaction --prefer-source
-
-script:
- - mkdir -p build/logs
- - php vendor/bin/phpcs --report=checkstyle --report-file=build/logs/checkstyle.xml --standard=build/config/phpcs.xml --ignore=*.html.php,*.config.php,*.twig.php src
- - php vendor/bin/phpmd src xml build/config/phpmd.xml --reportfile build/logs/pmd.xml
- - cp ~/xdebug.ini ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
- - php vendor/bin/phpunit -c travis.phpunit.xml
- - rm ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
-
-after_script:
- - curl -s https://gist.github.com/satooshi/4750401/raw > travis/ColorCLI.php
- - curl -s https://gist.github.com/satooshi/4752226/raw > travis/junit.php
- - curl -s https://gist.github.com/satooshi/4958593/raw > travis/pmd.php
- - curl -s https://gist.github.com/satooshi/4958909/raw > travis/checkstyle.php
- - php travis/checkstyle.php
- - php travis/pmd.php
- - php travis/junit.php
- - php composer/bin/coveralls -v --exclude-no-stmt
-
diff --git a/lib/gerencianet/satooshi/php-coveralls/CHANGELOG.md b/lib/gerencianet/satooshi/php-coveralls/CHANGELOG.md
deleted file mode 100644
index bc95020..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/CHANGELOG.md
+++ /dev/null
@@ -1,64 +0,0 @@
-CHANGELOG
-=============
-
-## 0.7.0 (WIP)
-
-- Support environment prop in json_file (issue #15)
-- Support commands: push, open, service, last (issue #16)
-- Show helpful message if the requirements are not satisfied (issue #24)
-
-## 0.6.1
-
-- Add CLI option: `--exclude-no-stmt` (issue #23)
-- Add .coveralls.yml configuration: `exclude_no_stmt` (issue #23)
-- Fix issue #27: Response message is not shown if exception occurred
-
-## 0.6
-
-- Support configuration for multiple clover.xml (issue #11)
-- Fix issue #12: end of file should not be included in code coverage
-- Show exception log at sending a request instead of exception backtrace
-- Log enhancement (issue #14):
- - show file size of `json_file`
- - show number of included source files
- - show elapsed time and memory usage
- - show coverage
- - show response message
-- Relax dependent libs version (issue #18)
-- Add connection error handling (issue #21)
-
-## 0.5
-
-- `--verbose (-v)` CLI option enables logging
-- Fix: only existing file lines should be included in coverage data
-- Support standardized env vars ([Codeship](https://www.codeship.io) supported these env vars)
- - CI_NAME
- - CI_BUILD_NUMBER
- - CI_BUILD_URL
- - CI_BRANCH
- - CI_PULL_REQUEST
-- Refactor console logging (PSR-3 compliant)
-- Change composer's minimal stability from dev to stable
-
-## 0.4
-
-- Replace REST client implementation by [guzzle/guzzle](https://github.com/guzzle/guzzle)
-- Change: `repo_token` is required on CircleCI, Jenkins
-
-## 0.3
-
-- Better CLI implementation by using [symfony/Console](https://github.com/symfony/Console) component
-- Support `--dry-run`, `--config (-c)` CLI option
-
-## 0.2
-
-- Support .coveralls.yml
-
-## 0.1
-
-- First release
-- Support Travis CI (tested)
-- Implement CircleCI, Jenkins, local environment (but not tested on these CI environments)
-- Collect coverage information from clover.xml
-- Collect git repository information
-
diff --git a/lib/gerencianet/satooshi/php-coveralls/LICENSE b/lib/gerencianet/satooshi/php-coveralls/LICENSE
deleted file mode 100644
index c70ef21..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2013 Kitamura Satoshi
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/lib/gerencianet/satooshi/php-coveralls/README.md b/lib/gerencianet/satooshi/php-coveralls/README.md
deleted file mode 100644
index 78fcb5a..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/README.md
+++ /dev/null
@@ -1,263 +0,0 @@
-php-coveralls
-=============
-
-[](https://travis-ci.org/satooshi/php-coveralls)
-[](https://coveralls.io/r/satooshi/php-coveralls)
-[](http://depending.in/satooshi/php-coveralls)
-
-PHP client library for [Coveralls](https://coveralls.io).
-
-# API doc
-
-[API doc](http://satooshi.github.io/php-coveralls/api/) is generated by [ApiGen](http://apigen.org/)
-
-# Prerequisites
-
-- PHP 5.3 or later
-- On [GitHub](https://github.com/)
-- Building on [Travis CI](http://travis-ci.org/), [CircleCI](https://circleci.com/), [Jenkins](http://jenkins-ci.org/) or [Codeship](https://www.codeship.io/)
-- Testing by [PHPUnit](https://github.com/sebastianbergmann/phpunit/) or other testing framework that can generate clover style coverage report
-
-# Installation
-
-To install php-coveralls with Composer, just add the following to your composer.json file:
-
-```js
-// composer.json
-{
- "require-dev": {
- "satooshi/php-coveralls": "dev-master"
- }
-}
-```
-
-Then, you can install the new dependencies by running Composer’s update command from the directory where your `composer.json` file is located:
-
-```sh
-# install
-$ php composer.phar install --dev
-# update
-$ php composer.phar update satooshi/php-coveralls --dev
-
-# or you can simply execute composer command if you set it to
-# your PATH environment variable
-$ composer install --dev
-$ composer update satooshi/php-coveralls --dev
-```
-
-You can see this library on [Packagist](https://packagist.org/packages/satooshi/php-coveralls).
-
-Composer installs autoloader at `./vendor/autoloader.php`. If you use php-coveralls in your php script, add:
-
-```php
-require_once 'vendor/autoload.php';
-```
-
-If you use Symfony2, autoloader has to be detected automatically.
-
-Or you can use git clone command:
-
-```sh
-# HTTP
-$ git clone https://github.com/satooshi/php-coveralls.git
-# SSH
-$ git clone git@github.com:satooshi/php-coveralls.git
-```
-
-# Configuration
-
-Currently support clover style coverage report. php-coveralls collect coverage information from `clover.xml`.
-
-## PHPUnit
-
-Make sure that `phpunit.xml.dist` is configured to generate "coverage-clover" type log named `clover.xml` like the following configuration:
-
-```xml
-
-
-
- ...
-
- ...
-
-
-```
-
-### clover.xml
-
-php-coveralls collects `count` attribute in a `line` tag from `clover.xml` if its `type` attribute equals to `stmt`. When `type` attribute equals to `method`, php-coveralls excludes its `count` attribute from coverage collection because abstract method in an abstract class is never counted though subclasses implement that method which is executed in test cases.
-
-```xml
-
-
-
-
-```
-
-## Travis CI
-
-Add `php vendor/bin/coveralls` to your `.travis.yml` at `after_script`.
-
-*Please note that `--dev` must be set to `composer install` option.*
-
-```yml
-# .travis.yml
-language: php
-php:
- - 5.5
- - 5.4
- - 5.3
-
-matrix:
- allow_failures:
- - php: 5.5
-
-before_script:
- - curl -s http://getcomposer.org/installer | php
- - php composer.phar install --dev --no-interaction
-
-script:
- - mkdir -p build/logs
- - php vendor/bin/phpunit -c phpunit.xml.dist
-
-after_script:
- - php vendor/bin/coveralls
- # or enable logging
- - php vendor/bin/coveralls -v
-```
-
-## CircleCI
-
-Add `pecl install xdebug` to your `circle.yml` at `dependencies` section since currently Xdebug extension is not pre-installed. `composer` and `phpunit` are pre-installed but you can install them manually in this dependencies section. The following sample uses default ones.
-
-```yml
-machine:
- php:
- version: 5.4.10
-
-## Customize dependencies
-dependencies:
- override:
- - mkdir -p build/logs
- - composer install --dev --no-interaction
- - pecl install xdebug
- - cat ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini | sed -e "s/;//" > xdebug.ini
- - mv xdebug.ini ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
-
-## Customize test commands
-test:
- override:
- - phpunit -c phpunit.xml.dist
-```
-
-Add `php vendor/bin/coveralls` to the "Test commands" textarea on Web UI (Edit settings > Tests > Test commands textarea).
-
-```sh
-COVERALLS_REPO_TOKEN=your_token php vendor/bin/coveralls
-```
-
-*Please note that `COVERALLS_REPO_TOKEN` should be set in the same line before coveralls command execution. You can not export this variable before coveralls command execution in other command since each command runs in its own shell and does not share environment variables ([see reference on CircleCI](https://circleci.com/docs/environment-variables)).*
-
-## Codeship
-
-You can configure CI process for Coveralls by adding the following commands to the textarea on Web UI (Project settings > Test tab).
-
-In the "Modify your Setup Commands" section:
-
-```sh
-curl -s http://getcomposer.org/installer | php
-php composer.phar install --dev --no-interaction
-mkdir -p build/logs
-```
-
-In the "Modify your Test Commands" section:
-
-```sh
-php vendor/bin/phpunit -c phpunit.xml.dist
-php vendor/bin/coveralls
-```
-
-Next, open Project settings > Environment tab, you can set `COVERALLS_REPO_TOKEN` environment variable.
-
-In the "Configure your environment variables" section:
-
-```sh
-COVERALLS_REPO_TOKEN=your_token
-```
-
-## From local environment
-
-If you would like to call Coveralls API from your local environment, you can set `COVERALLS_RUN_LOCALLY` envrionment variable. This configuration requires `repo_token` to specify which project on Coveralls your project maps to. This can be done by configuring `.coveralls.yml` or `COVERALLS_REPO_TOKEN` environment variable.
-
-```sh
-$ export COVERALLS_RUN_LOCALLY=1
-
-# either env var
-$ export COVERALLS_REPO_TOKEN=your_token
-
-# or .coveralls.yml configuration
-$ vi .coveralls.yml
-repo_token: your_token # should be kept secret!
-```
-
-php-coveralls set the following properties to `json_file` which is sent to Coveralls API (same behaviour as the Ruby library will do except for the service name).
-
-- service_name: php-coveralls
-- service_event_type: manual
-
-## CLI options
-
-You can get help information for `coveralls` with the `--help (-h)` option.
-
-```sh
-php vendor/bin/coveralls --help
-```
-
-## .coveralls.yml
-
-php-coveralls can use optional `.coveralls.yml` file to configure options. This configuration file is usually at the root level of your repository, but you can specify other path by `--config (or -c)` CLI option. Following options are the same as Ruby library ([see reference on coveralls.io](https://coveralls.io/docs/ruby)).
-
-- `repo_token`: Used to specify which project on Coveralls your project maps to. This is only needed for repos not using CI and should be kept secret
-- `service_name`: Allows you to specify where Coveralls should look to find additional information about your builds. This can be any string, but using `travis-ci` or `travis-pro` will allow Coveralls to fetch branch data, comment on pull requests, and more.
-
-Following options can be used for php-coveralls.
-
-- `src_dir`: Used to specify where the root level of your source files directory is. Default is `src`.
-- `coverage_clover`: Used to specify the path to `clover.xml`. Default is `build/logs/clover.xml`
-- `json_path`: Used to specify where to output `json_file` that will be uploaded to Coveralls API. Default is `build/logs/coveralls-upload.json`.
-
-```yml
-# .coveralls.yml example configuration
-
-# same as Ruby lib
-repo_token: your_token # should be kept secret!
-service_name: travis-pro # travis-ci or travis-pro
-
-# for php-coveralls
-src_dir: src
-coverage_clover: build/logs/clover.xml
-json_path: build/logs/coveralls-upload.json
-```
-
-You can specify multiple `clover.xml` logs at `coverage_clover`. This is useful for a project that has more than two test suites if all of the test results should be merged into one `json_file`.
-
-```yml
-#.coveralls.yml
-
-# single file
-coverage_clover: build/logs/clover.xml
-
-# glob
-coverage_clover: build/logs/clover-*.xml
-
-# array
-# specify files
-coverage_clover:
- - build/logs/clover-Auth.xml
- - build/logs/clover-Db.xml
- - build/logs/clover-Validator.xml
-```
-
-# Changelog
-
-[See changelog](CHANGELOG.md)
diff --git a/lib/gerencianet/satooshi/php-coveralls/build.xml b/lib/gerencianet/satooshi/php-coveralls/build.xml
deleted file mode 100644
index 35c877e..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/build.xml
+++ /dev/null
@@ -1,208 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/lib/gerencianet/satooshi/php-coveralls/composer.json b/lib/gerencianet/satooshi/php-coveralls/composer.json
deleted file mode 100644
index 414a2f4..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/composer.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "name": "satooshi/php-coveralls",
- "description": "PHP client library for Coveralls API",
- "keywords": ["coverage", "github", "test", "ci"],
- "homepage": "https://github.com/satooshi/php-coveralls",
- "type": "library",
- "license": "MIT",
- "minimum-stability": "stable",
- "authors": [
- {
- "name": "Kitamura Satoshi",
- "email": "with.no.parachute@gmail.com",
- "homepage": "https://www.facebook.com/satooshi.jp"
- }
- ],
- "require": {
- "php": ">=5.3",
- "ext-json": "*",
- "ext-curl": "*",
- "ext-simplexml": "*",
- "symfony/yaml": ">=2.0",
- "symfony/console": ">=2.0",
- "symfony/config": ">=2.0",
- "symfony/stopwatch": ">=2.2",
- "guzzle/guzzle": ">=3.0",
- "psr/log": "1.0.0"
- },
- "require-dev": {
- "phpunit/phpunit": "3.7.*@stable",
- "phpunit/php-invoker": ">=1.1.0,<1.2.0",
- "pdepend/pdepend": "dev-master",
- "phpmd/phpmd": "dev-master",
- "sebastian/phpcpd": "1.4.*@stable",
- "sebastian/finder-facade": "dev-master",
- "theseer/fdomdocument": "dev-master",
- "squizlabs/php_codesniffer": "1.4.*@stable",
- "apigen/apigen": "2.8.*@stable"
- },
- "autoload": {
- "psr-0": { "Contrib\\Component": "src/", "Contrib\\Bundle": "src/" }
- },
- "bin": ["composer/bin/coveralls"]
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/composer/bin/coveralls b/lib/gerencianet/satooshi/php-coveralls/composer/bin/coveralls
deleted file mode 100755
index f0bed25..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/composer/bin/coveralls
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env php
-run();
diff --git a/lib/gerencianet/satooshi/php-coveralls/phpunit.xml.dist b/lib/gerencianet/satooshi/php-coveralls/phpunit.xml.dist
deleted file mode 100644
index c4cc224..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/phpunit.xml.dist
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
- ./tests/
-
-
-
-
-
- ./src
-
- ./vendor
- ./tests
- ./travis
- ./composer
-
-
-
-
-
-
-
-
-
-
-
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsBundle/Console/Application.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsBundle/Console/Application.php
deleted file mode 100644
index 908fab6..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsBundle/Console/Application.php
+++ /dev/null
@@ -1,92 +0,0 @@
-
- */
-class Application extends BaseApplication
-{
- /**
- * Path to project root directory.
- *
- * @var string
- */
- private $rootDir;
-
- /**
- * Constructor.
- *
- * @param string $rootDir Path to project root directory.
- * @param string $name The name of the application
- * @param string $version The version of the application
- */
- public function __construct($rootDir, $name = 'UNKNOWN', $version = 'UNKNOWN')
- {
- $this->rootDir = $rootDir;
-
- parent::__construct($name, $version);
- }
-
- // internal method
-
- /**
- * {@inheritdoc}
- *
- * @see \Symfony\Component\Console\Application::getCommandName()
- */
- protected function getCommandName(InputInterface $input)
- {
- return 'coveralls:v1:jobs';
- }
-
- /**
- * {@inheritdoc}
- *
- * @see \Symfony\Component\Console\Application::getDefaultCommands()
- */
- protected function getDefaultCommands()
- {
- // Keep the core default commands to have the HelpCommand
- // which is used when using the --help option
- $defaultCommands = parent::getDefaultCommands();
-
- $defaultCommands[] = $this->createCoverallsV1JobsCommand();
-
- return $defaultCommands;
- }
-
- /**
- * Create CoverallsV1JobsCommand.
- *
- * @return \Contrib\Bundle\CoverallsBundle\Console\CoverallsV1JobsCommand
- */
- protected function createCoverallsV1JobsCommand()
- {
- $command = new CoverallsV1JobsCommand();
- $command->setRootDir($this->rootDir);
-
- return $command;
- }
-
- // accessor
-
- /**
- * {@inheritdoc}
- *
- * @see \Symfony\Component\Console\Application::getDefinition()
- */
- public function getDefinition()
- {
- $inputDefinition = parent::getDefinition();
- // clear out the normal first argument, which is the command name
- $inputDefinition->setArguments();
-
- return $inputDefinition;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsBundle/Entity/ArrayConvertable.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsBundle/Entity/ArrayConvertable.php
deleted file mode 100644
index 8bc7aed..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsBundle/Entity/ArrayConvertable.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- */
-interface ArrayConvertable
-{
- /**
- * Convert to an array.
- *
- * @return array
- */
- public function toArray();
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/CoverallsApi.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/CoverallsApi.php
deleted file mode 100644
index 1a6641d..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/CoverallsApi.php
+++ /dev/null
@@ -1,74 +0,0 @@
-
- */
-abstract class CoverallsApi
-{
- /**
- * Configuration.
- *
- * @var Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- protected $config;
-
- /**
- * HTTP client.
- *
- * @var \Guzzle\Http\Client
- */
- protected $client;
-
- /**
- * Constructor.
- *
- * @param Configuration $config Configuration.
- * @param \Guzzle\Http\Client $client HTTP client.
- */
- public function __construct(Configuration $config, Client $client = null)
- {
- $this->config = $config;
- $this->client = $client;
- }
-
- // accessor
-
- /**
- * Return configuration.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- public function getConfiguration()
- {
- return $this->config;
- }
-
- /**
- * Set HTTP client.
- *
- * @param \Guzzle\Http\Client $client HTTP client.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Api\CoverallsApi
- */
- public function setHttpClient(Client $client)
- {
- $this->client = $client;
-
- return $this;
- }
-
- /**
- * Return HTTP client.
- *
- * @return \Guzzle\Http\Client
- */
- public function getHttpClient()
- {
- return $this->client;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/Jobs.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/Jobs.php
deleted file mode 100644
index 7270d80..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/Jobs.php
+++ /dev/null
@@ -1,175 +0,0 @@
-
- */
-class Jobs extends CoverallsApi
-{
- /**
- * URL for jobs API.
- *
- * @var string
- */
- const URL = 'https://coveralls.io/api/v1/jobs';
-
- /**
- * Filename as a POST parameter.
- *
- * @var string
- */
- const FILENAME = 'json_file';
-
- /**
- * JsonFile.
- *
- * @var Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile
- */
- protected $jsonFile;
-
- // API
-
- /**
- * Collect clover XML into json_file.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Api\Jobs
- */
- public function collectCloverXml()
- {
- $srcDir = $this->config->getSrcDir();
- $cloverXmlPaths = $this->config->getCloverXmlPaths();
- $xmlCollector = new CloverXmlCoverageCollector();
-
- foreach ($cloverXmlPaths as $cloverXmlPath) {
- $xml = simplexml_load_file($cloverXmlPath);
-
- $xmlCollector->collect($xml, $srcDir);
- }
-
- $this->jsonFile = $xmlCollector->getJsonFile();
-
- if ($this->config->isExcludeNoStatements()) {
- $this->jsonFile->excludeNoStatementsFiles();
- }
-
- $this->jsonFile->sortSourceFiles();
-
- return $this;
- }
-
- /**
- * Collect git repository info into json_file.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Api\Jobs
- */
- public function collectGitInfo()
- {
- $command = new GitCommand();
- $gitCollector = new GitInfoCollector($command);
-
- $this->jsonFile->setGit($gitCollector->collect());
-
- return $this;
- }
-
- /**
- * Collect environment variables.
- *
- * @param array $env $_SERVER environment.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Api\Jobs
- */
- public function collectEnvVars(array $env)
- {
- $envCollector = new CiEnvVarsCollector($this->config);
-
- $this->jsonFile->fillJobs($envCollector->collect($env));
-
- return $this;
- }
-
- /**
- * Dump uploading json file.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Api\Jobs
- */
- public function dumpJsonFile()
- {
- $jsonPath = $this->config->getJsonPath();
-
- file_put_contents($jsonPath, $this->jsonFile);
-
- return $this;
- }
-
- /**
- * Send json_file to jobs API.
- *
- * @return \Guzzle\Http\Message\Response|null
- * @throws \RuntimeException
- */
- public function send()
- {
- if ($this->config->isDryRun()) {
- return;
- }
-
- $jsonPath = $this->config->getJsonPath();
-
- return $this->upload(static::URL, $jsonPath, static::FILENAME);
- }
-
- // internal method
-
- /**
- * Upload a file.
- *
- * @param string $url URL to upload.
- * @param string $path File path.
- * @param string $filename Filename.
- * @return \Guzzle\Http\Message\Response Response.
- * @throws \RuntimeException
- */
- protected function upload($url, $path, $filename)
- {
- $request = $this->client->post($url)->addPostFiles(array($filename => $path));
-
- return $request->send();
- }
-
- // accessor
-
- /**
- * Set JsonFile.
- *
- * @param JsonFile $jsonFile json_file content.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Api\Jobs
- */
- public function setJsonFile(JsonFile $jsonFile)
- {
- $this->jsonFile = $jsonFile;
-
- return $this;
- }
-
- /**
- * Return JsonFile.
- *
- * @return JsonFile
- */
- public function getJsonFile()
- {
- if (isset($this->jsonFile)) {
- return $this->jsonFile;
- }
-
- return null;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/CiEnvVarsCollector.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/CiEnvVarsCollector.php
deleted file mode 100644
index e7706c9..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/CiEnvVarsCollector.php
+++ /dev/null
@@ -1,152 +0,0 @@
-
- */
-class CiEnvVarsCollector
-{
- /**
- * Configuration.
- *
- * @var Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- protected $config;
-
- /**
- * Environment variables.
- *
- * Overwritten through collection process.
- *
- * @var array
- */
- protected $env;
-
- /**
- * Constructor.
- *
- * @param Configuration $config Configuration.
- */
- public function __construct(Configuration $config)
- {
- $this->config = $config;
- }
-
- // API
-
- /**
- * Collect environment variables.
- *
- * @param array $env $_SERVER environment.
- * @return array
- */
- public function collect(array $env)
- {
- $this->env = $env;
-
- $this->fillTravisCi()
- ->fillCircleCi()
- ->fillJenkins()
- ->fillLocal()
- ->fillRepoToken();
-
- return $this->env;
- }
-
- // internal method
-
- /**
- * Fill Travis CI environment variables.
- *
- * "TRAVIS", "TRAVIS_JOB_ID" must be set.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Collector\CiEnvVarsCollector
- */
- protected function fillTravisCi()
- {
- if (isset($this->env['TRAVIS']) && $this->env['TRAVIS'] && isset($this->env['TRAVIS_JOB_ID'])) {
- $this->env['CI_JOB_ID'] = $this->env['TRAVIS_JOB_ID'];
-
- if ($this->config->hasServiceName()) {
- $this->env['CI_NAME'] = $this->config->getServiceName();
- } else {
- $this->env['CI_NAME'] = 'travis-ci';
- }
- }
-
- return $this;
- }
-
- /**
- * Fill CircleCI environment variables.
- *
- * "CIRCLECI", "CIRCLE_BUILD_NUM" must be set.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Collector\CiEnvVarsCollector
- */
- protected function fillCircleCi()
- {
- if (isset($this->env['CIRCLECI']) && $this->env['CIRCLECI'] && isset($this->env['CIRCLE_BUILD_NUM'])) {
- $this->env['CI_BUILD_NUMBER'] = $this->env['CIRCLE_BUILD_NUM'];
- $this->env['CI_NAME'] = 'circleci';
- }
-
- return $this;
- }
-
- /**
- * Fill Jenkins environment variables.
- *
- * "JENKINS_URL", "BUILD_NUMBER" must be set.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Collector\CiEnvVarsCollector
- */
- protected function fillJenkins()
- {
- if (isset($this->env['JENKINS_URL']) && isset($this->env['BUILD_NUMBER'])) {
- $this->env['CI_BUILD_NUMBER'] = $this->env['BUILD_NUMBER'];
- $this->env['CI_BUILD_URL'] = $this->env['JENKINS_URL'];
- $this->env['CI_NAME'] = 'jenkins';
- }
-
- return $this;
- }
-
- /**
- * Fill local environment variables.
- *
- * "COVERALLS_RUN_LOCALLY" must be set.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Collector\CiEnvVarsCollector
- */
- protected function fillLocal()
- {
- if (isset($this->env['COVERALLS_RUN_LOCALLY']) && $this->env['COVERALLS_RUN_LOCALLY']) {
- $this->env['CI_JOB_ID'] = null;
- $this->env['CI_NAME'] = 'php-coveralls';
- $this->env['COVERALLS_EVENT_TYPE'] = 'manual';
- }
-
- return $this;
- }
-
- /**
- * Fill repo_token for unsupported CI service.
- *
- * "COVERALLS_REPO_TOKEN" must be set.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Collector\CiEnvVarsCollector
- */
- protected function fillRepoToken()
- {
- if ($this->config->hasRepoToken()) {
- $this->env['COVERALLS_REPO_TOKEN'] = $this->config->getRepoToken();
- }
-
- return $this;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/CloverXmlCoverageCollector.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/CloverXmlCoverageCollector.php
deleted file mode 100644
index 31eaf16..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/CloverXmlCoverageCollector.php
+++ /dev/null
@@ -1,137 +0,0 @@
-
- */
-class CloverXmlCoverageCollector
-{
- /**
- * JsonFile.
- *
- * @var \Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile
- */
- protected $jsonFile;
-
- // API
-
- /**
- * Collect coverage from XML object.
- *
- * @param SimpleXMLElement $xml Clover XML object.
- * @param string $rootDir Path to src directory.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile
- */
- public function collect(\SimpleXMLElement $xml, $rootDir)
- {
- $root = $rootDir . DIRECTORY_SEPARATOR;
-
- if (!isset($this->jsonFile)) {
- $this->jsonFile = new JsonFile();
- }
-
- // overwrite if run_at has already been set
- $runAt = $this->collectRunAt($xml);
- $this->jsonFile->setRunAt($runAt);
-
- $xpaths = array(
- '/coverage/project/file',
- '/coverage/project/package/file',
- );
-
- foreach ($xpaths as $xpath) {
- foreach ($xml->xpath($xpath) as $file) {
- $srcFile = $this->collectFileCoverage($file, $root);
-
- if ($srcFile !== null) {
- $this->jsonFile->addSourceFile($srcFile);
- }
- }
- }
-
- return $this->jsonFile;
- }
-
- // Internal method
-
- /**
- * Collect timestamp when the job ran.
- *
- * @param SimpleXMLElement $xml Clover XML object of a file.
- * @param string $format DateTime format.
- * @return string
- */
- protected function collectRunAt(\SimpleXMLElement $xml, $format = 'Y-m-d H:i:s O')
- {
- $timestamp = $xml->project['timestamp'];
- $runAt = new \DateTime('@' . $timestamp);
-
- return $runAt->format($format);
- }
-
- /**
- * Collect coverage data of a file.
- *
- * @param SimpleXMLElement $file Clover XML object of a file.
- * @param string $root Path to src directory.
- * @return NULL|\Contrib\Bundle\CoverallsV1Bundle\Entity\SourceFile
- */
- protected function collectFileCoverage(\SimpleXMLElement $file, $root)
- {
- $absolutePath = (string) $file['name'];
-
- if (false === strpos($absolutePath, $root)) {
- return null;
- }
-
- $filename = str_replace($root, '', $absolutePath);
-
- return $this->collectCoverage($file, $absolutePath, $filename);
- }
-
- /**
- * Collect coverage data.
- *
- * @param SimpleXMLElement $file Clover XML object of a file.
- * @param string $path Path to source file.
- * @param string $filename Filename.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\SourceFile
- */
- protected function collectCoverage(\SimpleXMLElement $file, $path, $filename)
- {
- if ($this->jsonFile->hasSourceFile($path)) {
- $srcFile = $this->jsonFile->getSourceFile($path);
- } else {
- $srcFile = new SourceFile($path, $filename);
- }
-
- foreach ($file->line as $line) {
- if ((string) $line['type'] === 'stmt') {
- $lineNum = (int) $line['num'];
-
- if ($lineNum > 0) {
- $srcFile->addCoverage($lineNum - 1, (int) $line['count']);
- }
- }
- }
-
- return $srcFile;
- }
-
- // accessor
-
- /**
- * Return json file.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile
- */
- public function getJsonFile()
- {
- return $this->jsonFile;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/GitInfoCollector.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/GitInfoCollector.php
deleted file mode 100644
index c150661..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Collector/GitInfoCollector.php
+++ /dev/null
@@ -1,151 +0,0 @@
-
- */
-class GitInfoCollector
-{
- /**
- * Git command.
- *
- * @var GitCommand
- */
- protected $command;
-
- /**
- * Constructor.
- *
- * @param GitCommand $gitCommand Git command
- */
- public function __construct(GitCommand $command)
- {
- $this->command = $command;
- }
-
- // API
-
- /**
- * Collect git repository info.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Git
- */
- public function collect()
- {
- $branch = $this->collectBranch();
- $commit = $this->collectCommit();
- $remotes = $this->collectRemotes();
-
- return new Git($branch, $commit, $remotes);
- }
-
- // internal method
-
- /**
- * Collect branch name.
- *
- * @return string
- * @throws \RuntimeException
- */
- protected function collectBranch()
- {
- $branchesResult = $this->command->getBranches();
-
- foreach ($branchesResult as $result) {
- if (strpos($result, '* ') === 0) {
- $exploded = explode('* ', $result, 2);
-
- return $exploded[1];
- }
- }
-
- throw new \RuntimeException();
- }
-
- /**
- * Collect commit info.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit
- * @throws \RuntimeException
- */
- protected function collectCommit()
- {
- $commitResult = $this->command->getHeadCommit();
-
- if (count($commitResult) !== 6 || array_keys($commitResult) !== range(0, 5)) {
- throw new \RuntimeException();
- }
-
- $commit = new Commit();
-
- return $commit
- ->setId($commitResult[0])
- ->setAuthorName($commitResult[1])
- ->setAuthorEmail($commitResult[2])
- ->setCommitterName($commitResult[3])
- ->setCommitterEmail($commitResult[4])
- ->setMessage($commitResult[5]);
- }
-
- /**
- * Collect remotes info.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Remote[]
- * @throws \RuntimeException
- */
- protected function collectRemotes()
- {
- $remotesResult = $this->command->getRemotes();
-
- if (count($remotesResult) === 0) {
- throw new \RuntimeException();
- }
-
- // parse command result
- $results = array();
-
- foreach ($remotesResult as $result) {
- if (strpos($result, ' ') !== false) {
- list($remote) = explode(' ', $result, 2);
-
- $results[] = $remote;
- }
- }
-
- // filter
- $results = array_unique($results);
-
- // create Remote instances
- $remotes = array();
-
- foreach ($results as $result) {
- if (strpos($result, "\t") !== false) {
- list($name, $url) = explode("\t", $result, 2);
-
- $remote = new Remote();
- $remotes[] = $remote->setName($name)->setUrl($url);
- }
- }
-
- return $remotes;
- }
-
- // accessor
-
- /**
- * Return git command.
- *
- * @return \Contrib\Component\System\Git\GitCommand
- */
- public function getCommand()
- {
- return $this->command;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php
deleted file mode 100644
index f388569..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php
+++ /dev/null
@@ -1,359 +0,0 @@
-
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
- */
-class CoverallsV1JobsCommand extends Command
-{
- /**
- * Path to project root directory.
- *
- * @var string
- */
- protected $rootDir;
-
- /**
- * Coveralls Jobs API.
- *
- * @var \Contrib\Bundle\CoverallsV1Bundle\Api\Jobs
- */
- protected $api;
-
- /**
- * Logger.
- *
- * @var \Psr\Log\LoggerInterface
- */
- protected $logger;
-
- // internal method
-
- /**
- * {@inheritdoc}
- *
- * @see \Symfony\Component\Console\Command\Command::configure()
- */
- protected function configure()
- {
- $this
- ->setName('coveralls:v1:jobs')
- ->setDescription('Coveralls Jobs API v1')
- ->addOption(
- 'config',
- '-c',
- InputOption::VALUE_OPTIONAL,
- '.coveralls.yml path',
- '.coveralls.yml'
- )
- ->addOption(
- 'dry-run',
- null,
- InputOption::VALUE_NONE,
- 'Do not send json_file to Jobs API'
- )
- ->addOption(
- 'exclude-no-stmt',
- null,
- InputOption::VALUE_NONE,
- 'Exclude source files that have no executable statements'
- )
- ->addOption(
- 'env',
- '-e',
- InputOption::VALUE_OPTIONAL,
- 'Runtime environment name: test, dev, prod',
- 'prod'
- );
- }
-
- /**
- * {@inheritdoc}
- *
- * @see \Symfony\Component\Console\Command\Command::execute()
- */
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $stopwatch = new Stopwatch();
- $stopwatch->start(__CLASS__);
-
- $config = $this->loadConfiguration($input, $this->rootDir);
- $this->logger = $config->isVerbose() && !$config->isTestEnv() ? new ConsoleLogger($output) : new NullLogger();
-
- $this->runApi($config);
-
- $event = $stopwatch->stop(__CLASS__);
- $time = number_format($event->getDuration() / 1000, 3); // sec
- $mem = number_format($event->getMemory() / (1024 * 1024), 2); // MB
- $this->logger->info(sprintf('elapsed time: %s sec memory: %s MB', $time, $mem));
-
- return 0;
- }
-
- // for Jobs API
-
- /**
- * Load configuration.
- *
- * @param InputInterface $input Input arguments.
- * @param string $rootDir Path to project root directory.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- protected function loadConfiguration(InputInterface $input, $rootDir)
- {
- $coverallsYmlPath = $input->getOption('config');
-
- $ymlPath = $this->rootDir . DIRECTORY_SEPARATOR . $coverallsYmlPath;
- $configurator = new Configurator();
-
- return $configurator
- ->load($ymlPath, $rootDir)
- ->setDryRun($input->getOption('dry-run'))
- ->setExcludeNoStatementsUnlessFalse($input->getOption('exclude-no-stmt'))
- ->setVerbose($input->getOption('verbose'))
- ->setEnv($input->getOption('env'));
- }
-
- /**
- * Run Jobs API.
- *
- * @param Configuration $config Configuration.
- * @return void
- */
- protected function runApi(Configuration $config)
- {
- $client = new Client();
- $this->api = new Jobs($config, $client);
-
- $this
- ->collectCloverXml($config)
- ->collectGitInfo()
- ->collectEnvVars()
- ->dumpJsonFile($config)
- ->send();
- }
-
- /**
- * Collect clover XML into json_file.
- *
- * @param Configuration $config Configuration.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand
- */
- protected function collectCloverXml(Configuration $config)
- {
- $this->logger->info('Load coverage clover log:');
-
- foreach ($config->getCloverXmlPaths() as $path) {
- $this->logger->info(sprintf(' - %s', $path));
- }
-
- $this->api->collectCloverXml();
-
- $jsonFile = $this->api->getJsonFile();
-
- if ($jsonFile->hasSourceFiles()) {
- $this->logCollectedSourceFiles($jsonFile);
- }
-
- return $this;
- }
-
- /**
- * Log collected source files.
- *
- * @param JsonFile $jsonFile
- * @return void
- */
- protected function logCollectedSourceFiles(JsonFile $jsonFile)
- {
- // @codeCoverageIgnoreStart
- $color = function ($coverage, $format) {
- // green 90% - 100%
- // yellow 80% - 90%
- // red 0% - 80%
- if ($coverage >= 90) {
- return sprintf('%s ', $format);
- } elseif ($coverage >= 80) {
- return sprintf('%s ', $format);
- } else {
- return sprintf('%s ', $format);
- }
- };
- // @codeCoverageIgnoreEnd
-
- $sourceFiles = $jsonFile->getSourceFiles();
- $numFiles = count($sourceFiles);
-
- $this->logger->info(sprintf('Found %s source file%s:', number_format($numFiles), $numFiles > 1 ? 's' : ''));
-
- foreach ($sourceFiles as $sourceFile) {
- /* @var $sourceFile \Contrib\Bundle\CoverallsV1Bundle\Entity\SourceFile */
- $coverage = $sourceFile->reportLineCoverage();
- $template = ' - ' . $color($coverage, '%6.2f%%') . ' %s';
-
- $this->logger->info(sprintf($template, $coverage, $sourceFile->getName()));
- }
-
- $coverage = $jsonFile->reportLineCoverage();
- $template = 'Coverage: ' . $color($coverage, '%6.2f%% (%d/%d)');
- $metrics = $jsonFile->getMetrics();
-
- $this->logger->info(sprintf($template, $coverage, $metrics->getCoveredStatements(), $metrics->getStatements()));
- }
-
- /**
- * Collect git repository info into json_file.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand
- */
- protected function collectGitInfo()
- {
- $this->logger->info('Collect git info');
-
- $this->api->collectGitInfo();
-
- return $this;
- }
-
- /**
- * Collect environment variables.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand
- */
- protected function collectEnvVars()
- {
- $this->logger->info('Read environment variables');
-
- $this->api->collectEnvVars($_SERVER);
-
- return $this;
- }
-
- /**
- * Dump uploading json file.
- *
- * @param Configuration $config Configuration.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand
- */
- protected function dumpJsonFile(Configuration $config)
- {
- $jsonPath = $config->getJsonPath();
- $this->logger->info(sprintf('Dump uploading json file: %s', $jsonPath));
-
- $this->api->dumpJsonFile();
-
- $filesize = number_format(filesize($jsonPath) / 1024, 2); // kB
- $this->logger->info(sprintf('File size: %s kB', $filesize));
-
- return $this;
- }
-
- /**
- * Send json_file to jobs API.
- *
- * @return void
- */
- protected function send()
- {
- $this->logger->info(sprintf('Submitting to %s', Jobs::URL));
-
- try {
- $response = $this->api->send();
-
- $message = $response
- ? sprintf('Finish submitting. status: %s %s', $response->getStatusCode(), $response->getReasonPhrase())
- : 'Finish dry run';
-
- $this->logger->info($message);
-
- // @codeCoverageIgnoreStart
- if ($response instanceof Response) {
- $this->logResponse($response);
- }
-
- return;
- } catch (CurlException $e) {
- // connection error
- // tested with network disconnected and got message:
- // Connection error occurred.
- // [curl] 6: Could not resolve host:
- // (nil); nodename nor servname provided, or not known [url] https://coveralls.io/api/v1/jobs
- $message = sprintf("Connection error occurred. %s\n\n%s", $e->getMessage(), $e->getTraceAsString());
- } catch (ClientErrorResponseException $e) {
- // 422 Unprocessable Entity
- $response = $e->getResponse();
- $message = sprintf('Client error occurred. status: %s %s', $response->getStatusCode(), $response->getReasonPhrase());
- } catch (ServerErrorResponseException $e) {
- // 503 Service Unavailable
- $response = $e->getResponse();
- $message = sprintf('Server error occurred. status: %s %s', $response->getStatusCode(), $response->getReasonPhrase());
- } catch (\Exception $e) {
- $message = sprintf("%s\n\n%s", $e->getMessage(), $e->getTraceAsString());
- }
-
- $this->logger->error($message);
-
- if (isset($response)) {
- $this->logResponse($response);
- }
- } // @codeCoverageIgnoreEnd
-
- /**
- * Log response.
- *
- * @param Response $response API response.
- * @return void
- *
- * @codeCoverageIgnore
- */
- protected function logResponse(Response $response)
- {
- $body = $response->json();
-
- if (isset($body['error'])) {
- if (isset($body['message'])) {
- $this->logger->error($body['message']);
- }
- } else {
- if (isset($body['message'])) {
- $this->logger->info(sprintf('Accepted %s', $body['message']));
- }
-
- if (isset($body['url'])) {
- $this->logger->info(sprintf('You can see the build on %s', $body['url']));
- }
- }
- }
-
- // accessor
-
- /**
- * Set root directory.
- *
- * @param string $rootDir Path to project root directory.
- */
- public function setRootDir($rootDir)
- {
- $this->rootDir = $rootDir;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/Configuration.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/Configuration.php
deleted file mode 100644
index a4ae190..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/Configuration.php
+++ /dev/null
@@ -1,366 +0,0 @@
-
- */
-class Configuration
-{
- // same as ruby lib
-
- /**
- * repo_token.
- *
- * @var string
- */
- protected $repoToken;
-
- /**
- * service_name.
- *
- * @var string
- */
- protected $serviceName;
-
- // only for php lib
-
- /**
- * Absolute path to src directory to include coverage report.
- *
- * @var string
- */
- protected $srcDir;
-
- /**
- * Absolute paths to clover.xml.
- *
- * @var array
- */
- protected $cloverXmlPaths = array();
-
- /**
- * Absolute path to output json_file.
- *
- * @var string
- */
- protected $jsonPath;
-
- // from command option
-
- /**
- * Whether to send json_file to jobs API.
- *
- * @var boolean
- */
- protected $dryRun = true;
-
- /**
- * Whether to exclude source files that have no executable statements.
- *
- * @var boolean
- */
- protected $excludeNoStatements = false;
-
- /**
- * Whether to show log.
- *
- * @var boolean
- */
- protected $verbose = false;
-
- /**
- * Runtime environment name.
- *
- * @var string
- */
- protected $env = 'prod';
-
- // accessor
-
- /**
- * Set repository token.
- *
- * @param string $repoToken
- * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- public function setRepoToken($repoToken)
- {
- $this->repoToken = $repoToken;
-
- return $this;
- }
-
- /**
- * Return whether repository token is configured.
- *
- * @return boolean
- */
- public function hasRepoToken()
- {
- return isset($this->repoToken);
- }
-
- /**
- * Return repository token.
- *
- * @return string|NULL
- */
- public function getRepoToken()
- {
- return $this->repoToken;
- }
-
- /**
- * Set service name.
- *
- * @param string $serviceName
- * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- public function setServiceName($serviceName)
- {
- $this->serviceName = $serviceName;
-
- return $this;
- }
-
- /**
- * Return whether the service name is configured.
- *
- * @return boolean
- */
- public function hasServiceName()
- {
- return isset($this->serviceName);
- }
-
- /**
- * Return service name.
- *
- * @return string|NULL
- */
- public function getServiceName()
- {
- return $this->serviceName;
- }
-
- /**
- * Set absolute path to src directory to include coverage report.
- *
- * @param string $srcDir
- * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- public function setSrcDir($srcDir)
- {
- $this->srcDir = $srcDir;
-
- return $this;
- }
-
- /**
- * Return absolute path to src directory to include coverage report.
- *
- * @return string
- */
- public function getSrcDir()
- {
- return $this->srcDir;
- }
-
- /**
- * Set absolute paths to clover.xml.
- *
- * @param string $cloverXmlPaths
- * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- public function setCloverXmlPaths(array $cloverXmlPaths)
- {
- $this->cloverXmlPaths = $cloverXmlPaths;
-
- return $this;
- }
-
- /**
- * Add absolute path to clover.xml.
- *
- * @param string $cloverXmlPath
- * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- public function addCloverXmlPath($cloverXmlPath)
- {
- $this->cloverXmlPaths[] = $cloverXmlPath;
-
- return $this;
- }
-
- /**
- * Return absolute path to clover.xml.
- *
- * @return string
- */
- public function getCloverXmlPaths()
- {
- return $this->cloverXmlPaths;
- }
-
- /**
- * Set absolute path to output json_file.
- *
- * @param string $jsonPath
- * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- public function setJsonPath($jsonPath)
- {
- $this->jsonPath = $jsonPath;
-
- return $this;
- }
-
- /**
- * Return absolute path to output json_file.
- *
- * @return string
- */
- public function getJsonPath()
- {
- return $this->jsonPath;
- }
-
- /**
- * Set whether to send json_file to jobs API.
- *
- * @param boolean $dryRun
- * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- public function setDryRun($dryRun)
- {
- $this->dryRun = $dryRun;
-
- return $this;
- }
-
- /**
- * Return whether to send json_file to jobs API.
- *
- * @return boolean
- */
- public function isDryRun()
- {
- return $this->dryRun;
- }
-
- /**
- * Set whether to exclude source files that have no executable statements.
- *
- * @param boolean $excludeNoStatements
- * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- public function setExcludeNoStatements($excludeNoStatements)
- {
- $this->excludeNoStatements = $excludeNoStatements;
-
- return $this;
- }
-
- /**
- * Set whether to exclude source files that have no executable statements unless false.
- *
- * @param boolean $excludeNoStatements
- * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- public function setExcludeNoStatementsUnlessFalse($excludeNoStatements)
- {
- if ($excludeNoStatements) {
- $this->excludeNoStatements = true;
- }
-
- return $this;
- }
-
- /**
- * Return whether to exclude source files that have no executable statements.
- *
- * @return boolean
- */
- public function isExcludeNoStatements()
- {
- return $this->excludeNoStatements;
- }
-
- /**
- * Set whether to show log.
- *
- * @param boolean $verbose
- * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- public function setVerbose($verbose)
- {
- $this->verbose = $verbose;
-
- return $this;
- }
-
- /**
- * Return whether to show log.
- *
- * @return boolean
- */
- public function isVerbose()
- {
- return $this->verbose;
- }
-
- /**
- * Set runtime environment name.
- *
- * @param string $env Runtime environment name.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- public function setEnv($env)
- {
- $this->env = $env;
-
- return $this;
- }
-
- /**
- * Return runtime environment name.
- *
- * @return string
- */
- public function getEnv()
- {
- return $this->env;
- }
-
- /**
- * Return whether the runtime environment is test.
- *
- * @return boolean
- */
- public function isTestEnv()
- {
- return $this->env === 'test';
- }
-
- /**
- * Return whether the runtime environment is dev.
- *
- * @return boolean
- */
- public function isDevEnv()
- {
- return $this->env === 'dev';
- }
-
- /**
- * Return whether the runtime environment is prod.
- *
- * @return boolean
- */
- public function isProdEnv()
- {
- return $this->env === 'prod';
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/Configurator.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/Configurator.php
deleted file mode 100644
index 760fec5..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/Configurator.php
+++ /dev/null
@@ -1,229 +0,0 @@
-
- */
-class Configurator
-{
- // API
-
- /**
- * Load configuration.
- *
- * @param string $coverallsYmlPath Path to .coveralls.yml.
- * @param string $rootDir Path to project root directory.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- public function load($coverallsYmlPath, $rootDir)
- {
- $yml = $this->parse($coverallsYmlPath);
- $options = $this->process($yml);
-
- return $this->createConfiguration($options, $rootDir);
- }
-
- // Internal method
-
- /**
- * Parse .coveralls.yml.
- *
- * @param string $coverallsYmlPath Path to .coveralls.yml.
- * @return array
- */
- protected function parse($coverallsYmlPath)
- {
- $file = new Path();
- $path = realpath($coverallsYmlPath);
-
- if ($file->isRealFileReadable($path)) {
- $yml = Yaml::parse($path);
-
- return empty($yml) ? array() : $yml;
- }
-
- return array();
- }
-
- /**
- * Process parsed configuration according to the configuration definition.
- *
- * @param array $yml Parsed configuration.
- * @return array
- */
- protected function process(array $yml)
- {
- $processor = new Processor();
- $configuration = new CoverallsConfiguration();
-
- return $processor->processConfiguration($configuration, array('coveralls' => $yml));
- }
-
- /**
- * Create coveralls configuration.
- *
- * @param array $options Processed configuration.
- * @param string $rootDir Path to project root directory.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Config\Configuration
- */
- protected function createConfiguration(array $options, $rootDir)
- {
- $configuration = new Configuration();
- $file = new Path();
-
- $repoToken = $options['repo_token'];
- $repoSecretToken = $options['repo_secret_token'];
-
- return $configuration
- ->setRepoToken($repoToken !== null ? $repoToken : $repoSecretToken)
- ->setServiceName($options['service_name'])
- // for PHP lib
- ->setSrcDir($this->ensureSrcDir($options['src_dir'], $rootDir, $file))
- ->setCloverXmlPaths($this->ensureCloverXmlPaths($options['coverage_clover'], $rootDir, $file))
- ->setJsonPath($this->ensureJsonPath($options['json_path'], $rootDir, $file))
- ->setExcludeNoStatements($options['exclude_no_stmt']);
- }
-
- /**
- * Ensure src_dir is valid.
- *
- * @param string $option src_dir option.
- * @param string $rootDir Path to project root directory.
- * @param Path $file Path object.
- * @return string Valid src_dir.
- * @throws InvalidConfigurationException
- */
- protected function ensureSrcDir($option, $rootDir, Path $file)
- {
- // normalize
- $realpath = $file->getRealPath($option, $rootDir);
-
- // validate
- if (!$file->isRealDirExist($realpath)) {
- throw new InvalidConfigurationException('src directory is not found');
- }
-
- return $realpath;
- }
-
- /**
- * Ensure coverage_clover is valid.
- *
- * @param string $option coverage_clover option.
- * @param string $rootDir Path to project root directory.
- * @param Path $file Path object.
- * @return array Valid Absolute pathes of coverage_clover.
- * @throws InvalidConfigurationException
- */
- protected function ensureCloverXmlPaths($option, $rootDir, Path $file)
- {
- if (is_array($option)) {
- return $this->getGlobPathsFromArrayOption($option, $rootDir, $file);
- }
-
- return $this->getGlobPathsFromStringOption($option, $rootDir, $file);
- }
-
- /**
- * Return absolute paths from glob path.
- *
- * @param string $path Absolute path.
- * @return array Absolute paths.
- * @throws InvalidConfigurationException
- */
- protected function getGlobPaths($path)
- {
- $paths = array();
- $iterator = new \GlobIterator($path);
-
- foreach ($iterator as $fileInfo) {
- /* @var $fileInfo \SplFileInfo */
- $paths[] = $fileInfo->getPathname();
- }
-
- // validate
- if (count($paths) === 0) {
- throw new InvalidConfigurationException('coverage_clover XML file is not readable');
- }
-
- return $paths;
- }
-
- /**
- * Return absolute paths from string option value.
- *
- * @param string $option coverage_clover option value.
- * @param string $rootDir Path to project root directory.
- * @param Path $file Path object.
- * @return array Absolute pathes.
- * @throws InvalidConfigurationException
- */
- protected function getGlobPathsFromStringOption($option, $rootDir, Path $file)
- {
- if (!is_string($option)) {
- throw new InvalidConfigurationException('coverage_clover XML file is not readable');
- }
-
- // normalize
- $path = $file->toAbsolutePath($option, $rootDir);
-
- return $this->getGlobPaths($path);
- }
-
- /**
- * Return absolute paths from array option values.
- *
- * @param array $options coverage_clover option values.
- * @param string $rootDir Path to project root directory.
- * @param Path $file Path object.
- * @return array Absolute pathes.
- */
- protected function getGlobPathsFromArrayOption(array $options, $rootDir, Path $file)
- {
- $paths = array();
-
- foreach ($options as $option) {
- $paths = array_merge($paths, $this->getGlobPathsFromStringOption($option, $rootDir, $file));
- }
-
- return $paths;
- }
-
- /**
- * Ensure json_path is valid.
- *
- * @param string $option json_path option.
- * @param string $rootDir Path to project root directory.
- * @param Path $file Path object.
- * @return string Valid json_path.
- * @throws InvalidConfigurationException
- */
- protected function ensureJsonPath($option, $rootDir, Path $file)
- {
- // normalize
- $realpath = $file->getRealWritingFilePath($option, $rootDir);
-
- // validate file
- $realFilePath = $file->getRealPath($realpath, $rootDir);
-
- if ($realFilePath !== false && !$file->isRealFileWritable($realFilePath)) {
- throw new InvalidConfigurationException('json_path is not writable');
- }
-
- // validate parent dir
- $realDir = $file->getRealDir($realpath, $rootDir);
-
- if (!$file->isRealDirWritable($realDir)) {
- throw new InvalidConfigurationException('json_path is not writable');
- }
-
- return $realpath;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/CoverallsConfiguration.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/CoverallsConfiguration.php
deleted file mode 100644
index 31f4bf3..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Config/CoverallsConfiguration.php
+++ /dev/null
@@ -1,68 +0,0 @@
-
- */
-class CoverallsConfiguration implements ConfigurationInterface
-{
- // ConfigurationInterface
-
- /**
- * {@inheritdoc}
- *
- * @see \Symfony\Component\Config\Definition\ConfigurationInterface::getConfigTreeBuilder()
- */
- public function getConfigTreeBuilder()
- {
- // define configuration
-
- $treeBuilder = new TreeBuilder();
- $rootNode = $treeBuilder->root('coveralls');
-
- $rootNode
- ->children()
- // same as ruby lib
- ->scalarNode('repo_token')
- ->defaultNull()
- ->end()
- ->scalarNode('repo_secret_token')
- ->defaultNull()
- ->end()
- ->scalarNode('service_name')
- ->defaultNull()
- ->end()
-
- // for php lib
- ->scalarNode('src_dir')
- ->defaultValue('src')
- ->end()
- ->variableNode('coverage_clover')
- ->defaultValue('build/logs/clover.xml')
- ->end()
- ->scalarNode('json_path')
- ->defaultValue('build/logs/coveralls-upload.json')
- ->end()
- ->booleanNode('exclude_no_stmt')
- ->defaultFalse()
- ->end()
- ->end();
-
- return $treeBuilder;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Coveralls.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Coveralls.php
deleted file mode 100644
index 5c7a682..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Coveralls.php
+++ /dev/null
@@ -1,22 +0,0 @@
-
- */
-abstract class Coveralls implements ArrayConvertable
-{
- /**
- * String expression (convert to json).
- *
- * @return string
- */
- public function __toString()
- {
- return json_encode($this->toArray());
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Commit.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Commit.php
deleted file mode 100644
index 3a61522..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Commit.php
+++ /dev/null
@@ -1,237 +0,0 @@
-
- */
-class Commit extends Coveralls
-{
- /**
- * Commit ID.
- *
- * @var string
- */
- protected $id;
-
- /**
- * Author name.
- *
- * @var string
- */
- protected $authorName;
-
- /**
- * Author email.
- *
- * @var string
- */
- protected $authorEmail;
-
- /**
- * Committer name.
- *
- * @var string
- */
- protected $committerName;
-
- /**
- * Committer email.
- *
- * @var string
- */
- protected $committerEmail;
-
- /**
- * Commit message.
- *
- * @var string
- */
- protected $message;
-
- // API
-
- /**
- * {@inheritdoc}
- *
- * @see \Contrib\Bundle\CoverallsBundle\Entity\ArrayConvertable::toArray()
- */
- public function toArray()
- {
- return array(
- 'id' => $this->id,
- 'author_name' => $this->authorName,
- 'author_email' => $this->authorEmail,
- 'committer_name' => $this->committerName,
- 'committer_email' => $this->committerEmail,
- 'message' => $this->message,
- );
- }
-
- // accessor
-
- /**
- * Set commit ID.
- *
- * @param string $id
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit
- */
- public function setId($id)
- {
- $this->id = $id;
-
- return $this;
- }
-
- /**
- * Return commit ID.
- *
- * @return string|null
- */
- public function getId()
- {
- if (isset($this->id)) {
- return $this->id;
- }
-
- return null;
- }
-
- /**
- * Set author name.
- *
- * @param string $authorName
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit
- */
- public function setAuthorName($authorName)
- {
- $this->authorName = $authorName;
-
- return $this;
- }
-
- /**
- * Return author name.
- *
- * @return string|null
- */
- public function getAuthorName()
- {
- if (isset($this->authorName)) {
- return $this->authorName;
- }
-
- return null;
- }
-
- /**
- * Set author email.
- *
- * @param string $authorEmail
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit
- */
- public function setAuthorEmail($authorEmail)
- {
- $this->authorEmail = $authorEmail;
-
- return $this;
- }
-
- /**
- * Return author email.
- *
- * @return string|null
- */
- public function getAuthorEmail()
- {
- if (isset($this->authorEmail)) {
- return $this->authorEmail;
- }
-
- return null;
- }
-
- /**
- * Set committer name.
- *
- * @param string $committerName
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit
- */
- public function setCommitterName($committerName)
- {
- $this->committerName = $committerName;
-
- return $this;
- }
-
- /**
- * Return committer name.
- *
- * @return string|null
- */
- public function getCommitterName()
- {
- if (isset($this->committerName)) {
- return $this->committerName;
- }
-
- return null;
- }
-
- /**
- * Set committer email.
- *
- * @param string $committerEmail
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit
- */
- public function setCommitterEmail($committerEmail)
- {
- $this->committerEmail = $committerEmail;
-
- return $this;
- }
-
- /**
- * Return committer email.
- *
- * @return string|null
- */
- public function getCommitterEmail()
- {
- if (isset($this->committerEmail)) {
- return $this->committerEmail;
- }
-
- return null;
- }
-
- /**
- * Set commit message.
- *
- * @param string $message
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit
- */
- public function setMessage($message)
- {
- $this->message = $message;
-
- return $this;
- }
-
- /**
- * Return commit message.
- *
- * @return string|null
- */
- public function getMessage()
- {
- if (isset($this->message)) {
- return $this->message;
- }
-
- return null;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Git.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Git.php
deleted file mode 100644
index d823b68..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Git.php
+++ /dev/null
@@ -1,119 +0,0 @@
-
- */
-class Git extends Coveralls
-{
- /**
- * Branch name.
- *
- * @var string
- */
- protected $branch;
-
- /**
- * Head.
- *
- * @var Commit
- */
- protected $head;
-
- /**
- * Remote.
- *
- * @var Remote[]
- */
- protected $remotes;
-
- /**
- * Constructor.
- *
- * @param string $branch Branch name.
- * @param Commit $head HEAD commit.
- * @param array $remotes Remote repositories.
- */
- public function __construct($branch, Commit $head, array $remotes)
- {
- $this->branch = $branch;
- $this->head = $head;
- $this->remotes = $remotes;
- }
-
- // API
-
- /**
- * {@inheritdoc}
- *
- * @see \Contrib\Bundle\CoverallsBundle\Entity\ArrayConvertable::toArray()
- */
- public function toArray()
- {
- $remotes = array();
-
- foreach ($this->remotes as $remote) {
- $remotes[] = $remote->toArray();
- }
-
- return array(
- 'branch' => $this->branch,
- 'head' => $this->head->toArray(),
- 'remotes' => $remotes,
- );
- }
-
- // accessor
-
- /**
- * Return branch name.
- *
- * @return string
- */
- public function getBranch()
- {
- return $this->branch;
- }
-
- /**
- * Return HEAD commit.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit
- */
- public function getHead()
- {
- return $this->head;
- }
-
- /**
- * Return remote repositories.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Remote[]
- */
- public function getRemotes()
- {
- return $this->remotes;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Remote.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Remote.php
deleted file mode 100644
index eb3590b..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/Remote.php
+++ /dev/null
@@ -1,97 +0,0 @@
-
- */
-class Remote extends Coveralls
-{
- /**
- * Remote name.
- *
- * @var string
- */
- protected $name;
-
- /**
- * Remote URL.
- *
- * @var string
- */
- protected $url;
-
- // API
-
- /**
- * {@inheritdoc}
- *
- * @see \Contrib\Bundle\CoverallsBundle\Entity\ArrayConvertable::toArray()
- */
- public function toArray()
- {
- return array(
- 'name' => $this->name,
- 'url' => $this->url,
- );
- }
-
- // accessor
-
- /**
- * Set remote name.
- *
- * @param string $name Remote name.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Remote
- */
- public function setName($name)
- {
- $this->name = $name;
-
- return $this;
- }
-
- /**
- * Return remote name.
- *
- * @return string
- */
- public function getName()
- {
- if (isset($this->name)) {
- return $this->name;
- }
-
- return null;
- }
-
- /**
- * Set remote URL.
- *
- * @param string $url Remote URL.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Remote
- */
- public function setUrl($url)
- {
- $this->url = $url;
-
- return $this;
- }
-
- /**
- * Return remote URL.
- *
- * @return string
- */
- public function getUrl()
- {
- if (isset($this->url)) {
- return $this->url;
- }
-
- return null;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/JsonFile.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/JsonFile.php
deleted file mode 100644
index 6314321..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/JsonFile.php
+++ /dev/null
@@ -1,598 +0,0 @@
-
- */
-class JsonFile extends Coveralls
-{
- /**
- * Service name.
- *
- * @var string
- */
- protected $serviceName;
-
- /**
- * Service job id.
- *
- * @var string
- */
- protected $serviceJobId;
-
- /**
- * Service number (not documented).
- *
- * @var string
- */
- protected $serviceNumber;
-
- /**
- * Service event type (not documented).
- *
- * @var string
- */
- protected $serviceEventType;
-
- /**
- * Build URL of the project (not documented).
- *
- * @var string
- */
- protected $serviceBuildUrl;
-
- /**
- * Branch name (not documented).
- *
- * @var string
- */
- protected $serviceBranch;
-
- /**
- * Pull request info (not documented).
- *
- * @var string
- */
- protected $servicePullRequest;
-
- /**
- * Repository token.
- *
- * @var string
- */
- protected $repoToken;
-
- /**
- * Source files.
- *
- * @var \Contrib\Bundle\CoverallsV1Bundle\Entity\SourceFile[]
- */
- protected $sourceFiles = array();
-
- /**
- * Git data.
- *
- * @var array
- */
- protected $git;
-
- /**
- * A timestamp when the job ran. Must be parsable by Ruby.
- *
- * "2013-02-18 00:52:48 -0800"
- *
- * @var string
- */
- protected $runAt;
-
- /**
- * Metrics.
- *
- * @var Metrics
- */
- protected $metrics;
-
- // API
-
- /**
- * {@inheritdoc}
- *
- * @see \Contrib\Bundle\CoverallsBundle\Entity\ArrayConvertable::toArray()
- */
- public function toArray()
- {
- $array = array();
-
- $arrayMap = array(
- // json key => property name
- 'service_name' => 'serviceName',
- 'service_job_id' => 'serviceJobId',
- 'service_number' => 'serviceNumber',
- 'service_build_url' => 'serviceBuildUrl',
- 'service_branch' => 'serviceBranch',
- 'service_pull_request' => 'servicePullRequest',
- 'service_event_type' => 'serviceEventType',
- 'repo_token' => 'repoToken',
- 'git' => 'git',
- 'run_at' => 'runAt',
- 'source_files' => 'sourceFiles',
- );
-
- foreach ($arrayMap as $jsonKey => $propName) {
- if (isset($this->$propName)) {
- $array[$jsonKey] = $this->toJsonProperty($this->$propName);
- }
- }
-
- return $array;
- }
-
- /**
- * Fill environment variables.
- *
- * @param array $env $_SERVER environment.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile
- * @throws \RuntimeException
- */
- public function fillJobs(array $env)
- {
- return $this
- ->fillStandardizedEnvVars($env)
- ->ensureJobs();
- }
-
- /**
- * Exclude source files that have no executable statements.
- *
- * @return void
- */
- public function excludeNoStatementsFiles()
- {
- $this->sourceFiles = array_filter(
- $this->sourceFiles,
- function (SourceFile $sourceFile) {
- return $sourceFile->getMetrics()->hasStatements();
- }
- );
- }
-
- /**
- * Sort source files by path.
- *
- * @return void
- */
- public function sortSourceFiles()
- {
- ksort($this->sourceFiles);
- }
-
- /**
- * Return line coverage.
- *
- * @return float
- */
- public function reportLineCoverage()
- {
- $metrics = $this->getMetrics();
-
- foreach ($this->sourceFiles as $sourceFile) {
- /* @var $sourceFile \Contrib\Bundle\CoverallsV1Bundle\Entity\SourceFile */
- $metrics->merge($sourceFile->getMetrics());
- }
-
- return $metrics->getLineCoverage();
- }
-
- // internal method
-
- /**
- * Convert to json property.
- *
- * @param mixed $prop
- * @return mixed
- */
- protected function toJsonProperty($prop)
- {
- if ($prop instanceof Coveralls) {
- return $prop->toArray();
- } elseif (is_array($prop)) {
- return $this->toJsonPropertyArray($prop);
- }
-
- return $prop;
- }
-
- /**
- * Convert to array as json property.
- *
- * @param array $propArray
- * @return array
- */
- protected function toJsonPropertyArray(array $propArray)
- {
- $array = array();
-
- foreach ($propArray as $prop) {
- $array[] = $this->toJsonProperty($prop);
- }
-
- return $array;
- }
-
- /**
- * Fill standardized environment variables.
- *
- * "CI_NAME", "CI_BUILD_NUMBER" must be set.
- *
- * Env vars are:
- *
- * * CI_NAME
- * * CI_BUILD_NUMBER
- * * CI_BUILD_URL
- * * CI_BRANCH
- * * CI_PULL_REQUEST
- *
- * These vars are supported by Codeship.
- *
- * @param array $env $_SERVER environment.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile
- */
- protected function fillStandardizedEnvVars(array $env)
- {
- $map = array(
- // defined in Ruby lib
- 'serviceName' => 'CI_NAME',
- 'serviceNumber' => 'CI_BUILD_NUMBER',
- 'serviceBuildUrl' => 'CI_BUILD_URL',
- 'serviceBranch' => 'CI_BRANCH',
- 'servicePullRequest' => 'CI_PULL_REQUEST',
-
- // extends by php-coveralls
- 'serviceJobId' => 'CI_JOB_ID',
- 'serviceEventType' => 'COVERALLS_EVENT_TYPE',
- 'repoToken' => 'COVERALLS_REPO_TOKEN',
- );
-
- foreach ($map as $propName => $envName) {
- if (isset($env[$envName])) {
- $this->$propName = $env[$envName];
- }
- }
-
- return $this;
- }
-
- /**
- * Ensure data consistency for jobs API.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile
- * @throws \RuntimeException
- */
- protected function ensureJobs()
- {
- if (!$this->hasSourceFiles()) {
- throw new \RuntimeException('source_files must be set');
- }
-
- if ($this->requireServiceJobId()) {
- return $this;
- }
-
- if ($this->requireServiceNumber()) {
- return $this;
- }
-
- if ($this->requireServiceEventType()) {
- return $this;
- }
-
- if ($this->isUnsupportedServiceJob()) {
- return $this;
- }
-
- $message = 'requirements are not satisfied.';
-
- throw new \RuntimeException($message);
- }
-
- /**
- * Return whether the job requires "service_job_id" (for Travis CI).
- *
- * @return boolean
- */
- protected function requireServiceJobId()
- {
- return isset($this->serviceName) && isset($this->serviceJobId) && !isset($this->repoToken);
- }
-
- /**
- * Return whether the job requires "service_number" (for CircleCI, Jenkins, Codeship or other CIs).
- *
- * @return boolean
- */
- protected function requireServiceNumber()
- {
- return isset($this->serviceName) && isset($this->serviceNumber) && isset($this->repoToken);
- }
-
- /**
- * Return whether the job requires "service_event_type" (for local environment).
- *
- * @return boolean
- */
- protected function requireServiceEventType()
- {
- return isset($this->serviceName) && isset($this->serviceEventType) && isset($this->repoToken);
- }
-
- /**
- * Return whether the job is running on unsupported service.
- *
- * @return boolean
- */
- protected function isUnsupportedServiceJob()
- {
- return !isset($this->serviceJobId) && !isset($this->serviceNumber) && !isset($this->serviceEventType) && isset($this->repoToken);
- }
-
- // accessor
-
- /**
- * Return whether the json file has source file.
- *
- * @param string $path Absolute path to source file.
- * @return boolean
- */
- public function hasSourceFile($path)
- {
- return isset($this->sourceFiles[$path]);
- }
-
- /**
- * Return source file.
- *
- * @param string $path Absolute path to source file.
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\SourceFile|null
- */
- public function getSourceFile($path)
- {
- if ($this->hasSourceFile($path)) {
- return $this->sourceFiles[$path];
- }
-
- return null;
- }
-
- /**
- * Add source file.
- *
- * @param SourceFile $sourceFile
- */
- public function addSourceFile(SourceFile $sourceFile)
- {
- $this->sourceFiles[$sourceFile->getPath()] = $sourceFile;
- }
-
- /**
- * Return whether the json file has a source file.
- *
- * @return boolean
- */
- public function hasSourceFiles()
- {
- return count($this->sourceFiles) > 0;
- }
-
- /**
- * Return source files.
- *
- * @return SourceFile[]
- */
- public function getSourceFiles()
- {
- return $this->sourceFiles;
- }
-
- /**
- * Set service name.
- *
- * @param string $serviceName Service name.
- * @return Coveralls
- */
- public function setServiceName($serviceName)
- {
- $this->serviceName = $serviceName;
-
- return $this;
- }
-
- /**
- * Return service name.
- *
- * @return string
- */
- public function getServiceName()
- {
- if (isset($this->serviceName)) {
- return $this->serviceName;
- }
-
- return null;
- }
-
- /**
- * Set repository token.
- *
- * @param string $repoToken Repository token.
- * @return Coveralls
- */
- public function setRepoToken($repoToken)
- {
- $this->repoToken = $repoToken;
-
- return $this;
- }
-
- /**
- * Return repository token.
- *
- * @return string
- */
- public function getRepoToken()
- {
- if (isset($this->repoToken)) {
- return $this->repoToken;
- }
-
- return null;
- }
-
- /**
- * Set service job id.
- *
- * @param string $serviceJobId Service job id.
- * @return Coveralls
- */
- public function setServiceJobId($serviceJobId)
- {
- $this->serviceJobId = $serviceJobId;
-
- return $this;
- }
-
- /**
- * Return service job id.
- *
- * @return string
- */
- public function getServiceJobId()
- {
- if (isset($this->serviceJobId)) {
- return $this->serviceJobId;
- }
-
- return null;
- }
-
- /**
- * Return service number.
- *
- * @return string
- */
- public function getServiceNumber()
- {
- return $this->serviceNumber;
- }
-
- /**
- * Return service event type.
- *
- * @return string
- */
- public function getServiceEventType()
- {
- return $this->serviceEventType;
- }
-
- /**
- * Return build URL of the project.
- *
- * @return string
- */
- public function getServiceBuildUrl()
- {
- return $this->serviceBuildUrl;
- }
-
- /**
- * Return branch name.
- *
- * @return string
- */
- public function getServiceBranch()
- {
- return $this->serviceBranch;
- }
-
- /**
- * Return pull request info.
- *
- * @return string
- */
- public function getServicePullRequest()
- {
- return $this->servicePullRequest;
- }
-
- /**
- * Set git data.
- *
- * @param array $git Git data.
- * @return Coveralls
- */
- public function setGit(Git $git)
- {
- $this->git = $git;
-
- return $this;
- }
-
- /**
- * Return git data.
- *
- * @return array
- */
- public function getGit()
- {
- if (isset($this->git)) {
- return $this->git;
- }
-
- return null;
- }
-
- /**
- * Set timestamp when the job ran.
- *
- * @param string $runAt Timestamp.
- * @return Coveralls
- */
- public function setRunAt($runAt)
- {
- $this->runAt = $runAt;
-
- return $this;
- }
-
- /**
- * Return timestamp when the job ran.
- *
- * @return string
- */
- public function getRunAt()
- {
- if (isset($this->runAt)) {
- return $this->runAt;
- }
-
- return null;
- }
-
- /**
- * Return metrics.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Metrics
- */
- public function getMetrics()
- {
- if (!isset($this->metrics)) {
- $this->metrics = new Metrics();
- }
-
- return $this->metrics;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Metrics.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Metrics.php
deleted file mode 100644
index 29708d3..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/Metrics.php
+++ /dev/null
@@ -1,143 +0,0 @@
-
- */
-class Metrics
-{
- /**
- * Number of statements.
- *
- * @var integer
- */
- protected $statements;
-
- /**
- * Number of covered statements.
- *
- * @var integer
- */
- protected $coveredStatements;
-
- /**
- * Line coverage.
- *
- * @var float
- */
- protected $lineCoverage;
-
- /**
- * Constructor.
- *
- * @param array $coverage Coverage data.
- */
- public function __construct(array $coverage = array())
- {
- if (!empty($coverage)) {
- // statements
- // not null
- $statementsArray = array_filter(
- $coverage,
- function ($line) {
- return $line !== null;
- }
- );
- $this->statements = count($statementsArray);
-
- // coveredstatements
- // gt 0
- $coveredArray = array_filter(
- $statementsArray,
- function ($line) {
- return $line > 0;
- }
- );
- $this->coveredStatements = count($coveredArray);
- } else {
- $this->statements = 0;
- $this->coveredStatements = 0;
- }
- }
-
- // API
-
- /**
- * Merge other metrics.
- *
- * @param Metrics $that
- * @return void
- */
- public function merge(Metrics $that)
- {
- $this->statements += $that->statements;
- $this->coveredStatements += $that->coveredStatements;
- $this->lineCoverage = null; // clear previous data
- }
-
- // internal method
-
- /**
- * Calculate line coverage.
- *
- * @param integer $statements Number of statements.
- * @param integer $coveredStatements Number of covered statements.
- * @return float
- */
- protected function calculateLineCoverage($statements, $coveredStatements)
- {
- if ($statements === 0) {
- return 0;
- }
-
- return ($coveredStatements / $statements) * 100;
- }
-
- // accessor
-
- /**
- * Return whether the source file has executable statements.
- *
- * @return boolean
- */
- public function hasStatements()
- {
- return $this->statements !== 0;
- }
-
- /**
- * Return number of statements.
- *
- * @return integer
- */
- public function getStatements()
- {
- return $this->statements;
- }
-
- /**
- * Return number of covered statements.
- *
- * @return integer
- */
- public function getCoveredStatements()
- {
- return $this->coveredStatements;
- }
-
- /**
- * Return line coverage.
- *
- * @return float
- */
- public function getLineCoverage()
- {
- if (!isset($this->lineCoverage)) {
- $this->lineCoverage = $this->calculateLineCoverage($this->statements, $this->coveredStatements);
- }
-
- return $this->lineCoverage;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/SourceFile.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/SourceFile.php
deleted file mode 100644
index 3672da4..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Entity/SourceFile.php
+++ /dev/null
@@ -1,176 +0,0 @@
-
- */
-class SourceFile extends Coveralls
-{
- /**
- * Source filename.
- *
- * @var string
- */
- protected $name;
-
- /**
- * Source content.
- *
- * @var string
- */
- protected $source;
-
- /**
- * Coverage data of the source file.
- *
- * @var array
- */
- protected $coverage;
-
- /**
- * Absolute path.
- *
- * @var string
- */
- protected $path;
-
- /**
- * Line number of the source file.
- *
- * @var integer
- */
- protected $fileLines;
-
- /**
- * Metrics.
- *
- * @var Metrics
- */
- protected $metrics;
-
- /**
- * Constructor.
- *
- * @param string $path Absolute path.
- * @param string $name Source filename.
- * @param string $eol End of line.
- */
- public function __construct($path, $name, $eol = "\n")
- {
- $this->path = $path;
- $this->name = $name;
- $this->source = trim(file_get_contents($path));
-
- $lines = explode($eol, $this->source);
- $this->fileLines = count($lines);
- $this->coverage = array_fill(0, $this->fileLines, null);
- }
-
- /**
- * {@inheritdoc}
- *
- * @see \Contrib\Bundle\CoverallsBundle\Entity\ArrayConvertable::toArray()
- */
- public function toArray()
- {
- return array(
- 'name' => $this->name,
- 'source' => $this->source,
- 'coverage' => $this->coverage,
- );
- }
-
- // API
-
- /**
- * Add coverage.
- *
- * @param integer $lineNum Line number.
- * @param integer $count Number of covered.
- * @return void
- */
- public function addCoverage($lineNum, $count)
- {
- if (array_key_exists($lineNum, $this->coverage)) {
- $this->coverage[$lineNum] += $count;
- }
- }
-
- /**
- * Return line coverage.
- *
- * @return float
- */
- public function reportLineCoverage()
- {
- return $this->getMetrics()->getLineCoverage();
- }
-
- // accessor
-
- /**
- * Return source filename.
- *
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
-
- /**
- * Return source content.
- *
- * @return string
- */
- public function getSource()
- {
- return $this->source;
- }
-
- /**
- * Return coverage data of the source file.
- *
- * @return array
- */
- public function getCoverage()
- {
- return $this->coverage;
- }
-
- /**
- * Return absolute path.
- *
- * @return string
- */
- public function getPath()
- {
- return $this->path;
- }
-
- /**
- * Return line number of the source file.
- *
- * @return integer
- */
- public function getFileLines()
- {
- return $this->fileLines;
- }
-
- /**
- * Return metrics.
- *
- * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Metrics
- */
- public function getMetrics()
- {
- if (!isset($this->metrics)) {
- $this->metrics = new Metrics($this->coverage);
- }
-
- return $this->metrics;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Component/File/Path.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Component/File/Path.php
deleted file mode 100644
index e96fa6d..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Component/File/Path.php
+++ /dev/null
@@ -1,165 +0,0 @@
-
- */
-class Path
-{
- /**
- * Return whether the path is relative path.
- *
- * @param string $path Path.
- * @return boolean true if the path is relative path, false otherwise.
- */
- public function isRelativePath($path)
- {
- return strlen($path) === 0 || strpos($path, DIRECTORY_SEPARATOR) !== 0;
- }
-
- /**
- * Cat file path.
- *
- * @param string $path File path.
- * @param string $rootDir Absolute path to project root directory.
- * @return string|false Absolute path.
- */
- public function toAbsolutePath($path, $rootDir)
- {
- if (!is_string($path)) {
- return false;
- }
-
- if ($this->isRelativePath($path)) {
- return $rootDir . DIRECTORY_SEPARATOR . $path;
- }
-
- return $path;
- }
-
- /**
- * Return real file path.
- *
- * @param string $path File path.
- * @param string $rootDir Absolute path to project root directory.
- * @return string|false Real path string if the path string is passed and real path exists, false otherwise.
- */
- public function getRealPath($path, $rootDir)
- {
- if (!is_string($path)) {
- return false;
- }
-
- if ($this->isRelativePath($path)) {
- return realpath($rootDir . DIRECTORY_SEPARATOR . $path);
- }
-
- return realpath($path);
- }
-
- /**
- * Return real directory path.
- *
- * @param string $path Path.
- * @param string $rootDir Absolute path to project root directory.
- * @return string|false Real directory path string if the path string is passed and real directory exists, false otherwise.
- */
- public function getRealDir($path, $rootDir)
- {
- if (!is_string($path)) {
- return false;
- }
-
- if ($this->isRelativePath($path)) {
- return realpath($rootDir . DIRECTORY_SEPARATOR . dirname($path));
- }
-
- return realpath(dirname($path));
- }
-
- /**
- * Return real file path to write.
- *
- * @param string $path File path.
- * @param string $rootDir Absolute path to project root directory.
- * @return string|false Real file path string if the parent directory exists, false otherwise.
- */
- public function getRealWritingFilePath($path, $rootDir)
- {
- $realDir = $this->getRealDir($path, $rootDir);
-
- if (!is_string($realDir)) {
- return false;
- }
-
- return $realDir . DIRECTORY_SEPARATOR . basename($path);
- }
-
- /**
- * Return whether the real path exists.
- *
- * @param string|boolean $realpath Real path.
- * @return boolean true if the real path exists, false otherwise.
- */
- public function isRealPathExist($realpath)
- {
- return $realpath !== false && file_exists($realpath);
- }
-
- /**
- * Return whether the real file path exists.
- *
- * @param string|boolean $realpath Real file path.
- * @return boolean true if the real file path exists, false otherwise.
- */
- public function isRealFileExist($realpath)
- {
- return $this->isRealPathExist($realpath) && is_file($realpath);
- }
-
- /**
- * Return whether the real file path is readable.
- *
- * @param string|boolean $realpath Real file path.
- * @return boolean true if the real file path is readable, false otherwise.
- */
- public function isRealFileReadable($realpath)
- {
- return $this->isRealFileExist($realpath) && is_readable($realpath);
- }
-
- /**
- * Return whether the real file path is writable.
- *
- * @param string|boolean $realpath Real file path.
- * @return boolean true if the real file path is writable, false otherwise.
- */
- public function isRealFileWritable($realpath)
- {
- return $this->isRealFileExist($realpath) && is_writable($realpath);
- }
-
- /**
- * Return whether the real directory exists.
- *
- * @param string|boolean $realpath Real directory path.
- * @return boolean true if the real directory exists, false otherwise.
- */
- public function isRealDirExist($realpath)
- {
- return $this->isRealPathExist($realpath) && is_dir($realpath);
- }
-
- /**
- * Return whether the real directory is writable.
- *
- * @param string|boolean $realpath Real directory path.
- * @return boolean true if the real directory is writable, false otherwise.
- */
- public function isRealDirWritable($realpath)
- {
- return $this->isRealDirExist($realpath) && is_writable($realpath);
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Component/Log/ConsoleLogger.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Component/Log/ConsoleLogger.php
deleted file mode 100644
index e8302d8..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Component/Log/ConsoleLogger.php
+++ /dev/null
@@ -1,41 +0,0 @@
-
- */
-class ConsoleLogger extends AbstractLogger
-{
- /**
- * Output.
- *
- * @var \Symfony\Component\Console\Output\OutputInterface
- */
- protected $output;
-
- /**
- * Constructor.
- *
- * @param OutputInterface $output
- */
- public function __construct(OutputInterface $output)
- {
- $this->output = $output;
- }
-
- /**
- * {@inheritdoc}
- *
- * @return void
- * @see \Psr\Log\LoggerInterface::log()
- */
- public function log($level, $message, array $context = array())
- {
- $this->output->writeln($message);
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Component/System/Git/GitCommand.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Component/System/Git/GitCommand.php
deleted file mode 100644
index 63de1d5..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Component/System/Git/GitCommand.php
+++ /dev/null
@@ -1,57 +0,0 @@
-
- */
-class GitCommand extends SystemCommand
-{
- /**
- * Command name or path.
- *
- * @var string
- */
- protected $commandPath = 'git';
-
- // API
-
- /**
- * Return branch names.
- *
- * @return array
- */
- public function getBranches()
- {
- $command = $this->createCommand('branch');
-
- return $this->executeCommand($command);
- }
-
- /**
- * Return HEAD commit.
- *
- * @return array
- */
- public function getHeadCommit()
- {
- $command = $this->createCommand("log -1 --pretty=format:'%H\n%aN\n%ae\n%cN\n%ce\n%s'");
-
- return $this->executeCommand($command);
- }
-
- /**
- * Return remote repositories.
- *
- * @return array
- */
- public function getRemotes()
- {
- $command = $this->createCommand('remote -v');
-
- return $this->executeCommand($command);
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Component/System/SystemCommand.php b/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Component/System/SystemCommand.php
deleted file mode 100644
index 934c0fe..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/src/Contrib/Component/System/SystemCommand.php
+++ /dev/null
@@ -1,90 +0,0 @@
-
- */
-abstract class SystemCommand
-{
- /**
- * Command name or path.
- *
- * @var string
- */
- protected $commandPath;
-
- // API
-
- /**
- * Execute command.
- *
- * @return array
- */
- public function execute()
- {
- $command = $this->createCommand();
-
- return $this->executeCommand($command);
- }
-
- // internal method
-
- /**
- * Execute command.
- *
- * @param string $command
- * @return array
- * @throws \RuntimeException
- */
- protected function executeCommand($command)
- {
- exec($command, $result, $returnValue);
-
- if ($returnValue === 0) {
- return $result;
- }
-
- throw new \RuntimeException(sprintf('Failed to execute command: %s', $command), $returnValue);
- }
-
- /**
- * Create command.
- *
- * @param string $args Command arguments.
- * @return string
- */
- protected function createCommand($args = null)
- {
- if ($args === null) {
- return $this->commandPath;
- }
-
- // escapeshellarg($args) ?
- return sprintf('%s %s', $this->commandPath, $args);
- }
-
- // accessor
-
- /**
- * Set command path.
- *
- * @param string $commandPath Command name or path.
- * @return void
- */
- public function setCommandPath($commandPath)
- {
- $this->commandPath = $commandPath;
- }
-
- /**
- * Return command path.
- *
- * @return string
- */
- public function getCommandPath()
- {
- return $this->commandPath;
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsBundle/Console/ApplicationTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsBundle/Console/ApplicationTest.php
deleted file mode 100644
index 03012a0..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsBundle/Console/ApplicationTest.php
+++ /dev/null
@@ -1,119 +0,0 @@
-
- */
-class ApplicationTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- $this->rootDir = realpath(__DIR__ . '/../../../../prj');
- $this->srcDir = $this->rootDir . '/files';
- $this->buildDir = $this->rootDir . '/build';
- $this->logsDir = $this->rootDir . '/build/logs';
- $this->cloverXmlPath = $this->logsDir . '/clover.xml';
- $this->jsonPath = $this->logsDir . DIRECTORY_SEPARATOR . 'coveralls-upload.json';
- }
-
- protected function tearDown()
- {
- $this->rmFile($this->cloverXmlPath);
- $this->rmFile($this->jsonPath);
- $this->rmDir($this->logsDir);
- $this->rmDir($this->buildDir);
- }
-
- protected function rmFile($file)
- {
- if (is_file($file)) {
- chmod(dirname($file), 0777);
- unlink($file);
- }
- }
-
- protected function rmDir($dir)
- {
- if (is_dir($dir)) {
- chmod($dir, 0777);
- rmdir($dir);
- }
- }
-
- protected function makeProjectDir($logsDir, $cloverXmlPath, $logsDirUnwritable = false, $jsonPathUnwritable = false)
- {
- if ($logsDir !== null) {
- mkdir($logsDir, 0777, true);
- }
-
- if ($cloverXmlPath !== null) {
- file_put_contents($cloverXmlPath, $this->getCloverXml());
- }
-
- if ($logsDirUnwritable) {
- chmod($logsDir, 0577);
- }
-
- if ($jsonPathUnwritable) {
- touch($this->jsonPath);
- chmod($this->jsonPath, 0577);
- }
- }
-
- protected function getCloverXml()
- {
- $xml = <<
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-XML;
- return sprintf($xml, $this->srcDir, $this->srcDir);
- }
-
- /**
- * @test
- */
- public function shouldExecuteCoverallsV1JobsCommand()
- {
- $this->makeProjectDir($this->logsDir, $this->cloverXmlPath);
-
- $app = new Application($this->rootDir, 'Coveralls API client for PHP', '1.0.0');
- $app->setAutoExit(false); // avoid to call exit() in Application
-
- // run
- $_SERVER['TRAVIS'] = true;
- $_SERVER['TRAVIS_JOB_ID'] = 'application_test';
-
- $tester = new ApplicationTester($app);
- $actual = $tester->run(
- array(
- '--dry-run' => true,
- '--config' => 'coveralls.yml',
- )
- );
-
- $this->assertEquals(0, $actual);
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Api/JobsTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Api/JobsTest.php
deleted file mode 100644
index 552e074..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Api/JobsTest.php
+++ /dev/null
@@ -1,655 +0,0 @@
-
- */
-class JobsTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- $this->dir = realpath(__DIR__ . '/../../../../');
- $this->rootDir = realpath($this->dir . '/prj/files');
- $this->srcDir = $this->rootDir;
- $this->url = 'https://coveralls.io/api/v1/jobs';
- $this->jsonPath = __DIR__ . '/coveralls.json';
- $this->filename = 'json_file';
- $this->cloverXmlPath = $this->rootDir . 'clover.xml';
- }
-
- protected function tearDown()
- {
- $this->rmFile($this->jsonPath);
- $this->rmFile($this->cloverXmlPath);
- }
-
- protected function rmFile($file)
- {
- if (is_file($file)) {
- unlink($file);
- }
- }
-
- protected function createJobsWith()
- {
- $this->config = new Configuration($this->rootDir);
-
- $this->config
- ->setJsonPath($this->jsonPath)
- ->setDryRun(false);
-
- $this->client = $this->createAdapterMockWith($this->url, $this->filename, $this->jsonPath);
-
- return new Jobs($this->config, $this->client);
- }
-
- protected function createJobsNeverSend()
- {
- $this->config = new Configuration($this->rootDir);
- $this->config
- ->setJsonPath($this->jsonPath)
- ->setDryRun(false);
-
- $this->client = $this->createAdapterMockNeverCalled();
-
- return new Jobs($this->config, $this->client);
- }
-
- protected function createJobsNeverSendOnDryRun()
- {
- $this->config = new Configuration($this->rootDir);
- $this->config
- ->setJsonPath($this->jsonPath)
- ->setDryRun(true);
-
- $this->client = $this->createAdapterMockNeverCalled();
-
- return new Jobs($this->config, $this->client);
- }
-
-
- protected function createAdapterMockNeverCalled()
- {
- $client = $this->getMock('Guzzle\Http\Client', array('send'));
-
- $client
- ->expects($this->never())
- ->method('send');
-
- return $client;
- }
-
- protected function createAdapterMockWith($url, $filename, $jsonPath)
- {
- $client = $this->getMock('Guzzle\Http\Client', array('post', 'addPostFiles'));
- $request = $this->getMockBuilder('Guzzle\Http\Message\EntityEnclosingRequest')
- ->disableOriginalConstructor()
- ->getMock();
-
- $client
- ->expects($this->once())
- ->method('post')
- ->with($this->equalTo($url))
- ->will($this->returnSelf());
-
- $client
- ->expects($this->once())
- ->method('addPostFiles')
- ->with($this->equalTo(array($filename => $jsonPath)))
- ->will($this->returnValue($request));
-
- $request
- ->expects($this->once())
- ->method('send')
- ->with()
- ;
-
- return $client;
- }
-
- protected function createConfiguration()
- {
- $config = new Configuration($this->rootDir);
-
- return $config
- ->setSrcDir($this->srcDir)
- ->addCloverXmlPath($this->cloverXmlPath);
- }
-
- protected function getCloverXml()
- {
- $xml = <<
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-XML;
- return sprintf($xml, $this->rootDir, $this->rootDir, $this->rootDir, $this->rootDir);
- }
-
- protected function createCloverXml()
- {
- $xml = $this->getCloverXml();
-
- return simplexml_load_string($xml);
- }
-
- protected function getNoSourceCloverXml()
- {
- return <<
-
-
-
-
-
-
-
-
-
-
-
-XML;
- }
-
- protected function createNoSourceCloverXml()
- {
- $xml = $this->getNoSourceCloverXml();
-
- return simplexml_load_string($xml);
- }
-
- protected function collectJsonFile()
- {
- $xml = $this->createCloverXml();
- $collector = new CloverXmlCoverageCollector();
-
- return $collector->collect($xml, $this->rootDir);
- }
-
- protected function collectJsonFileWithoutSourceFiles()
- {
- $xml = $this->createNoSourceCloverXml();
- $collector = new CloverXmlCoverageCollector();
-
- return $collector->collect($xml, $this->rootDir);
- }
-
- protected function createCiEnvVarsCollector($config = null)
- {
- if ($config === null) {
- $config = $this->createConfiguration();
- }
-
- return new CiEnvVarsCollector($config);
- }
-
- // getJsonFile()
-
- /**
- * @test
- */
- public function shouldNotHaveJsonFileOnConstruction()
- {
- $object = $this->createJobsNeverSendOnDryRun();
-
- $this->assertNull($object->getJsonFile());
- }
-
- // setJsonFile()
-
- /**
- * @test
- */
- public function setJsonFile()
- {
- $jsonFile = $this->collectJsonFile();
-
- $object = $this->createJobsNeverSendOnDryRun()->setJsonFile($jsonFile);
-
- $this->assertSame($jsonFile, $object->getJsonFile());
- }
-
- // getConfiguration()
-
- /**
- * @test
- */
- public function getConfiguration()
- {
- $config = $this->createConfiguration();
-
- $object = new Jobs($config);
-
- $this->assertSame($config, $object->getConfiguration());
- }
-
- // getHttpClient()
-
- /**
- * @test
- */
- public function shouldNotHaveHttpClientOnConstructionWithoutHttpClient()
- {
- $config = $this->createConfiguration();
-
- $object = new Jobs($config);
-
- $this->assertNull($object->getHttpClient());
- }
-
- /**
- * @test
- */
- public function shouldHaveHttpClientOnConstructionWithHttpClient()
- {
- $config = $this->createConfiguration();
- $client = $this->createAdapterMockNeverCalled();
-
- $object = new Jobs($config, $client);
-
- $this->assertSame($client, $object->getHttpClient());
- }
-
- // setHttpClient()
-
- /**
- * @test
- */
- public function setHttpClient()
- {
- $config = $this->createConfiguration();
- $client = $this->createAdapterMockNeverCalled();
-
- $object = new Jobs($config);
- $object->setHttpClient($client);
-
- $this->assertSame($client, $object->getHttpClient());
- }
-
- // collectCloverXml()
-
- /**
- * @test
- */
- public function collectCloverXml()
- {
- $xml = $this->getCloverXml();
-
- file_put_contents($this->cloverXmlPath, $xml);
-
- $config = $this->createConfiguration();
-
- $object = new Jobs($config);
-
- $same = $object->collectCloverXml();
-
- // return $this
- $this->assertSame($same, $object);
-
- return $object;
- }
-
- /**
- * @test
- * @depends collectCloverXml
- */
- public function shouldHaveJsonFileAfterCollectCloverXml(Jobs $object)
- {
- $jsonFile = $object->getJsonFile();
-
- $this->assertNotNull($jsonFile);
- $sourceFiles = $jsonFile->getSourceFiles();
- $this->assertCount(4, $sourceFiles);
-
- return $jsonFile;
- }
-
- /**
- * @test
- * @depends shouldHaveJsonFileAfterCollectCloverXml
- */
- public function shouldNotHaveGitAfterCollectCloverXml(JsonFile $jsonFile)
- {
- $git = $jsonFile->getGit();
-
- $this->assertNull($git);
- }
-
- /**
- * @test
- */
- public function collectCloverXmlExcludingNoStatementsFiles()
- {
- $xml = $this->getCloverXml();
-
- file_put_contents($this->cloverXmlPath, $xml);
-
- $config = $this->createConfiguration()->setExcludeNoStatements(true);
-
- $object = new Jobs($config);
-
- $same = $object->collectCloverXml();
-
- // return $this
- $this->assertSame($same, $object);
-
- return $object;
- }
-
- /**
- * @test
- * @depends collectCloverXmlExcludingNoStatementsFiles
- */
- public function shouldHaveJsonFileAfterCollectCloverXmlExcludingNoStatementsFiles(Jobs $object)
- {
- $jsonFile = $object->getJsonFile();
-
- $this->assertNotNull($jsonFile);
- $sourceFiles = $jsonFile->getSourceFiles();
- $this->assertCount(2, $sourceFiles);
-
- return $jsonFile;
- }
-
- // collectGitInfo()
-
- /**
- * @test
- * @depends collectCloverXml
- */
- public function collectGitInfo(Jobs $object)
- {
- $same = $object->collectGitInfo();
-
- // return $this
- $this->assertSame($same, $object);
-
- return $object;
- }
-
- /**
- * @test
- * @depends collectGitInfo
- */
- public function shouldHaveJsonFileAfterCollectGitInfo(Jobs $object)
- {
- $jsonFile = $object->getJsonFile();
-
- $this->assertNotNull($jsonFile);
-
- return $jsonFile;
- }
-
- /**
- * @test
- * @depends shouldHaveJsonFileAfterCollectGitInfo
- */
- public function shouldHaveGitAfterCollectGitInfo(JsonFile $jsonFile)
- {
- $git = $jsonFile->getGit();
-
- $this->assertNotNull($git);
- }
-
- // send()
-
- /**
- * @test
- */
- public function sendTravisCiJob()
- {
- $serviceName = 'travis-ci';
- $serviceJobId = '1.1';
-
- $server = array();
- $server['TRAVIS'] = true;
- $server['TRAVIS_JOB_ID'] = $serviceJobId;
-
- $object = $this->createJobsWith();
- $jsonFile = $this->collectJsonFile();
-
- $object
- ->setJsonFile($jsonFile)
- ->collectEnvVars($server)
- ->dumpJsonFile()
- ->send();
- }
-
- /**
- * @test
- */
- public function sendTravisProJob()
- {
- $serviceName = 'travis-pro';
- $serviceJobId = '1.1';
-
- $server = array();
- $server['TRAVIS'] = true;
- $server['TRAVIS_JOB_ID'] = $serviceJobId;
-
- $object = $this->createJobsWith();
- $config = $object->getConfiguration()->setServiceName($serviceName);
- $jsonFile = $this->collectJsonFile();
-
- $object
- ->setJsonFile($jsonFile)
- ->collectEnvVars($server)
- ->dumpJsonFile()
- ->send();
-
- $this->assertEquals($serviceName, $jsonFile->getServiceName());
- $this->assertEquals($serviceJobId, $jsonFile->getServiceJobId());
- }
-
- /**
- * @test
- */
- public function sendCircleCiJob()
- {
- $serviceName = 'circleci';
- $serviceNumber = '123';
- $repoToken = 'token';
-
- $server = array();
- $server['COVERALLS_REPO_TOKEN'] = $repoToken;
- $server['CIRCLECI'] = 'true';
- $server['CIRCLE_BUILD_NUM'] = $serviceNumber;
-
- $object = $this->createJobsWith();
- $jsonFile = $this->collectJsonFile();
-
- $object
- ->setJsonFile($jsonFile)
- ->collectEnvVars($server)
- ->dumpJsonFile()
- ->send();
- }
-
- /**
- * @test
- */
- public function sendJenkinsJob()
- {
- $serviceName = 'jenkins';
- $serviceNumber = '123';
- $repoToken = 'token';
-
- $server = array();
- $server['COVERALLS_REPO_TOKEN'] = $repoToken;
- $server['JENKINS_URL'] = 'http://localhost:8080';
- $server['BUILD_NUMBER'] = $serviceNumber;
-
- $object = $this->createJobsWith();
- $jsonFile = $this->collectJsonFile();
-
- $object
- ->setJsonFile($jsonFile)
- ->collectEnvVars($server)
- ->dumpJsonFile()
- ->send();
- }
-
- /**
- * @test
- */
- public function sendLocalJob()
- {
- $serviceName = 'php-coveralls';
- $serviceEventType = 'manual';
-
- $server = array();
- $server['COVERALLS_RUN_LOCALLY'] = '1';
-
- $object = $this->createJobsWith();
- $config = $object->getConfiguration()->setRepoToken('token');
- $jsonFile = $this->collectJsonFile();
-
- $object
- ->setJsonFile($jsonFile)
- ->collectEnvVars($server)
- ->dumpJsonFile()
- ->send();
- }
-
- /**
- * @test
- */
- public function sendUnsupportedJob()
- {
- $server = array();
- $server['COVERALLS_REPO_TOKEN'] = 'token';
-
- $object = $this->createJobsWith();
- $jsonFile = $this->collectJsonFile();
-
- $object
- ->setJsonFile($jsonFile)
- ->collectEnvVars($server)
- ->dumpJsonFile()
- ->send();
- }
-
- /**
- * @test
- */
- public function sendUnsupportedGitJob()
- {
- $server = array();
- $server['COVERALLS_REPO_TOKEN'] = 'token';
- $server['GIT_COMMIT'] = 'abc123';
-
- $object = $this->createJobsWith();
- $jsonFile = $this->collectJsonFile();
-
- $object
- ->setJsonFile($jsonFile)
- ->collectEnvVars($server)
- ->dumpJsonFile()
- ->send();
- }
-
- /**
- * @test
- */
- public function shouldNotSendJobIfTestEnv()
- {
- $server = array();
- $server['TRAVIS'] = true;
- $server['TRAVIS_JOB_ID'] = '1.1';
-
- $object = $this->createJobsNeverSendOnDryRun();
- $config = $object->getConfiguration()->setEnv('test');
- $jsonFile = $this->collectJsonFile();
-
- $object
- ->setJsonFile($jsonFile)
- ->collectEnvVars($server)
- ->dumpJsonFile()
- ->send();
- }
-
- /**
- * @test
- * @expectedException RuntimeException
- */
- public function throwRuntimeExceptionIfInvalidEnv()
- {
- $server = array();
-
- $object = $this->createJobsNeverSend();
- $jsonFile = $this->collectJsonFile();
-
- $object
- ->setJsonFile($jsonFile)
- ->collectEnvVars($server)
- ->dumpJsonFile()
- ->send();
- }
-
- /**
- * @test
- * @expectedException RuntimeException
- */
- public function throwRuntimeExceptionIfNoSourceFiles()
- {
- $server = array();
- $server['TRAVIS'] = true;
- $server['TRAVIS_JOB_ID'] = '1.1';
- $server['COVERALLS_REPO_TOKEN'] = 'token';
- $server['GIT_COMMIT'] = 'abc123';
-
- $object = $this->createJobsNeverSend();
- $jsonFile = $this->collectJsonFile();
-
- $object
- ->setJsonFile($jsonFile)
- ->collectEnvVars($server)
- ->dumpJsonFile()
- ->send();
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/CiEnvVarsCollectorTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/CiEnvVarsCollectorTest.php
deleted file mode 100644
index 5b61e2e..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/CiEnvVarsCollectorTest.php
+++ /dev/null
@@ -1,206 +0,0 @@
-
- */
-class CiEnvVarsCollectorTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- $this->dir = realpath(__DIR__ . '/../../../../');
- $this->rootDir = realpath($this->dir . '/prj/files');
- $this->srcDir = $this->rootDir;
- //$this->url = 'https://coveralls.io/api/v1/jobs';
- //$this->jsonPath = __DIR__ . '/coveralls.json';
- //$this->filename = 'json_file';
- $this->cloverXmlPath = $this->rootDir . 'clover.xml';
- }
-
- protected function createConfiguration()
- {
- $config = new Configuration($this->rootDir);
-
- return $config->setSrcDir($this->srcDir)->addCloverXmlPath($this->cloverXmlPath);
- }
-
- protected function createCiEnvVarsCollector($config = null)
- {
- if ($config === null) {
- $config = $this->createConfiguration();
- }
-
- return new CiEnvVarsCollector($config);
- }
-
- // collect()
-
- /**
- * @test
- */
- public function collectTravisCiEnvVars()
- {
- $serviceName = 'travis-ci';
- $serviceJobId = '1.1';
-
- $env = array();
- $env['TRAVIS'] = true;
- $env['TRAVIS_JOB_ID'] = $serviceJobId;
-
- $object = $this->createCiEnvVarsCollector();
-
- $actual = $object->collect($env);
-
- $this->assertArrayHasKey('CI_NAME', $actual);
- $this->assertEquals($serviceName, $actual['CI_NAME']);
-
- $this->assertArrayHasKey('CI_JOB_ID', $actual);
- $this->assertEquals($serviceJobId, $actual['CI_JOB_ID']);
- }
-
- /**
- * @test
- */
- public function collectTravisProEnvVars()
- {
- $serviceName = 'travis-pro';
- $serviceJobId = '1.2';
-
- $env = array();
- $env['TRAVIS'] = true;
- $env['TRAVIS_JOB_ID'] = $serviceJobId;
-
- $config = $this->createConfiguration();
- $config->setServiceName($serviceName);
-
- $object = $this->createCiEnvVarsCollector($config);
-
- $actual = $object->collect($env);
-
- $this->assertArrayHasKey('CI_NAME', $actual);
- $this->assertEquals($serviceName, $actual['CI_NAME']);
-
- $this->assertArrayHasKey('CI_JOB_ID', $actual);
- $this->assertEquals($serviceJobId, $actual['CI_JOB_ID']);
- }
-
- /**
- * @test
- */
- public function collectCircleCiEnvVars()
- {
- $serviceName = 'circleci';
- $serviceNumber = '123';
-
- $env = array();
- $env['COVERALLS_REPO_TOKEN'] = 'token';
- $env['CIRCLECI'] = 'true';
- $env['CIRCLE_BUILD_NUM'] = $serviceNumber;
-
- $object = $this->createCiEnvVarsCollector();
-
- $actual = $object->collect($env);
-
- $this->assertArrayHasKey('CI_NAME', $actual);
- $this->assertEquals($serviceName, $actual['CI_NAME']);
-
- $this->assertArrayHasKey('CI_BUILD_NUMBER', $actual);
- $this->assertEquals($serviceNumber, $actual['CI_BUILD_NUMBER']);
- }
-
- /**
- * @test
- */
- public function collectJenkinsEnvVars()
- {
- $serviceName = 'jenkins';
- $serviceNumber = '123';
- $buildUrl = 'http://localhost:8080';
-
- $env = array();
- $env['COVERALLS_REPO_TOKEN'] = 'token';
- $env['JENKINS_URL'] = $buildUrl;
- $env['BUILD_NUMBER'] = $serviceNumber;
-
- $object = $this->createCiEnvVarsCollector();
-
- $actual = $object->collect($env);
-
- $this->assertArrayHasKey('CI_NAME', $actual);
- $this->assertEquals($serviceName, $actual['CI_NAME']);
-
- $this->assertArrayHasKey('CI_BUILD_NUMBER', $actual);
- $this->assertEquals($serviceNumber, $actual['CI_BUILD_NUMBER']);
-
- $this->assertArrayHasKey('CI_BUILD_URL', $actual);
- $this->assertEquals($buildUrl, $actual['CI_BUILD_URL']);
- }
-
- /**
- * @test
- */
- public function collectLocalEnvVars()
- {
- $serviceName = 'php-coveralls';
- $serviceEventType = 'manual';
-
- $env = array();
- $env['COVERALLS_REPO_TOKEN'] = 'token';
- $env['COVERALLS_RUN_LOCALLY'] = '1';
-
- $object = $this->createCiEnvVarsCollector();
-
- $actual = $object->collect($env);
-
- $this->assertArrayHasKey('CI_NAME', $actual);
- $this->assertEquals($serviceName, $actual['CI_NAME']);
-
- $this->assertArrayHasKey('COVERALLS_EVENT_TYPE', $actual);
- $this->assertEquals($serviceEventType, $actual['COVERALLS_EVENT_TYPE']);
-
- $this->assertArrayHasKey('CI_JOB_ID', $actual);
- $this->assertNull($actual['CI_JOB_ID']);
- }
-
- /**
- * @test
- */
- public function collectUnsupportedConfig()
- {
- $repoToken = 'token';
-
- $env = array();
-
- $config = $this->createConfiguration();
- $config->setRepoToken($repoToken);
-
- $object = $this->createCiEnvVarsCollector($config);
-
- $actual = $object->collect($env);
-
- $this->assertArrayHasKey('COVERALLS_REPO_TOKEN', $actual);
- $this->assertEquals($repoToken, $actual['COVERALLS_REPO_TOKEN']);
- }
-
- /**
- * @test
- */
- public function collectUnsupportedEnvVars()
- {
- $repoToken = 'token';
-
- $env = array();
- $env['COVERALLS_REPO_TOKEN'] = $repoToken;
-
- $object = $this->createCiEnvVarsCollector();
-
- $actual = $object->collect($env);
-
- $this->assertArrayHasKey('COVERALLS_REPO_TOKEN', $actual);
- $this->assertEquals($repoToken, $actual['COVERALLS_REPO_TOKEN']);
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/CloverXmlCoverageCollectorTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/CloverXmlCoverageCollectorTest.php
deleted file mode 100644
index c6dc408..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/CloverXmlCoverageCollectorTest.php
+++ /dev/null
@@ -1,177 +0,0 @@
-
- */
-class CloverXmlCoverageCollectorTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- $this->dir = realpath(__DIR__ . '/../../../../');
- $this->rootDir = realpath($this->dir . '/prj/files');
-
- $this->object = new CloverXmlCoverageCollector();
- }
-
- protected function createCloverXml()
- {
- $xml = <<
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-XML;
-
- return simplexml_load_string(sprintf($xml, $this->rootDir, $this->rootDir, $this->rootDir));
- }
-
- // getJsonFile()
-
- /**
- * @test
- */
- public function shouldNotHaveJsonFileOnConstruction()
- {
- $this->assertNull($this->object->getJsonFile());
- }
-
- // collect()
-
- /**
- * @test
- */
- public function collect()
- {
- $xml = $this->createCloverXml();
- $jsonFile = $this->object->collect($xml, $this->rootDir);
-
- $this->assertSame($jsonFile, $this->object->getJsonFile());
- $this->assertJsonFile($jsonFile, null, null, null, null, '2013-04-13 10:28:13 +0000');
-
- return $jsonFile;
- }
-
- /**
- * @test
- * @depends collect
- */
- public function collectSourceFiles(JsonFile $jsonFile)
- {
- $sourceFiles = $jsonFile->getSourceFiles();
-
- $this->assertCount(2, $sourceFiles);
-
- return $jsonFile;
- }
-
- /**
- * @test
- * @depends collectSourceFiles
- */
- public function collectSourceFileTest1(JsonFile $jsonFile)
- {
- $sourceFiles = $jsonFile->getSourceFiles();
-
- $name1 = 'test.php';
- $path1 = $this->rootDir . DIRECTORY_SEPARATOR . $name1;
-
- $this->assertArrayHasKey($path1, $sourceFiles);
- $this->assertSourceFileTest1($sourceFiles[$path1]);
- }
-
- /**
- * @test
- * @depends collectSourceFiles
- */
- public function collectSourceFileTest2(JsonFile $jsonFile)
- {
- $sourceFiles = $jsonFile->getSourceFiles();
-
- $name2 = 'test2.php';
- $path2 = $this->rootDir . DIRECTORY_SEPARATOR . $name2;
-
- $this->assertArrayHasKey($path2, $sourceFiles);
- $this->assertSourceFileTest2($sourceFiles[$path2]);
- }
-
- // custom assert
-
- protected function assertJsonFile($jsonFile, $serviceName, $serviceJobId, $repoToken, $git, $runAt)
- {
- $this->assertEquals($serviceName, $jsonFile->getServiceName());
- $this->assertEquals($serviceJobId, $jsonFile->getServiceJobId());
- $this->assertEquals($repoToken, $jsonFile->getRepoToken());
- $this->assertSame($git, $jsonFile->getGit());
- $this->assertEquals($runAt, $jsonFile->getRunAt());
- }
-
- protected function assertSourceFile(SourceFile $sourceFile, $name, $path, $fileLines, array $coverage, $source)
- {
- $this->assertEquals($name, $sourceFile->getName());
- $this->assertEquals($path, $sourceFile->getPath());
- $this->assertEquals($fileLines, $sourceFile->getFileLines());
- $this->assertSame($coverage, $sourceFile->getCoverage());
- $this->assertEquals($source, $sourceFile->getSource());
- }
-
- protected function assertSourceFileTest1(SourceFile $sourceFile)
- {
- $name1 = 'test.php';
- $path1 = $this->rootDir . DIRECTORY_SEPARATOR . $name1;
- $fileLines1 = 9;
- $coverage1 = array_fill(0, $fileLines1, null);
- $coverage1[6] = 3;
- $source1 = trim(file_get_contents($path1));
-
- $this->assertSourceFile($sourceFile, $name1, $path1, $fileLines1, $coverage1, $source1);
- }
-
- protected function assertSourceFileTest2(SourceFile $sourceFile)
- {
- $name2 = 'test2.php';
- $path2 = $this->rootDir . DIRECTORY_SEPARATOR . $name2;
- $fileLines2 = 10;
- $coverage2 = array_fill(0, $fileLines2, null);
- $coverage2[7] = 0;
- $source2 = trim(file_get_contents($path2));
-
- $this->assertSourceFile($sourceFile, $name2, $path2, $fileLines2, $coverage2, $source2);
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/GitInfoCollectorTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/GitInfoCollectorTest.php
deleted file mode 100644
index 368d830..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Collector/GitInfoCollectorTest.php
+++ /dev/null
@@ -1,226 +0,0 @@
-
- */
-class GitInfoCollectorTest extends \PHPUnit_Framework_TestCase
-{
- public function setUp()
- {
- $this->getBranchesValue = array(
- ' master',
- '* branch1',
- ' branch2',
- );
- $this->getHeadCommitValue = array(
- 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
- 'Author Name',
- 'author@satooshi.jp',
- 'Committer Name',
- 'committer@satooshi.jp',
- 'commit message',
- );
- $this->getRemotesValue = array(
- "origin\tgit@github.com:satooshi/php-coveralls.git (fetch)",
- "origin\tgit@github.com:satooshi/php-coveralls.git (push)",
- );
- }
-
- protected function createGitCommandStub()
- {
- $class = 'Contrib\Component\System\Git\GitCommand';
-
- return $this->getMock($class);
- }
-
- protected function createGitCommandStubWith($getBranchesValue, $getHeadCommitValue, $getRemotesValue)
- {
- $stub = $this->createGitCommandStub();
-
- $this->setUpGitCommandStubWithGetBranchesOnce($stub, $getBranchesValue);
- $this->setUpGitCommandStubWithGetHeadCommitOnce($stub, $getHeadCommitValue);
- $this->setUpGitCommandStubWithGetRemotesOnce($stub, $getRemotesValue);
-
- return $stub;
- }
-
- protected function createGitCommandStubCalledBranches($getBranchesValue, $getHeadCommitValue, $getRemotesValue)
- {
- $stub = $this->createGitCommandStub();
-
- $this->setUpGitCommandStubWithGetBranchesOnce($stub, $getBranchesValue);
- $this->setUpGitCommandStubWithGetHeadCommitNeverCalled($stub, $getHeadCommitValue);
- $this->setUpGitCommandStubWithGetRemotesNeverCalled($stub, $getRemotesValue);
-
- return $stub;
- }
-
- protected function createGitCommandStubCalledHeadCommit($getBranchesValue, $getHeadCommitValue, $getRemotesValue)
- {
- $stub = $this->createGitCommandStub();
-
- $this->setUpGitCommandStubWithGetBranchesOnce($stub, $getBranchesValue);
- $this->setUpGitCommandStubWithGetHeadCommitOnce($stub, $getHeadCommitValue);
- $this->setUpGitCommandStubWithGetRemotesNeverCalled($stub, $getRemotesValue);
-
- return $stub;
- }
-
- protected function setUpGitCommandStubWithGetBranchesOnce($stub, $getBranchesValue)
- {
- $stub->expects($this->once())
- ->method('getBranches')
- ->will($this->returnValue($getBranchesValue));
- }
-
- protected function setUpGitCommandStubWithGetHeadCommitOnce($stub, $getHeadCommitValue)
- {
- $stub->expects($this->once())
- ->method('getHeadCommit')
- ->will($this->returnValue($getHeadCommitValue));
- }
-
- protected function setUpGitCommandStubWithGetHeadCommitNeverCalled($stub, $getHeadCommitValue)
- {
- $stub->expects($this->never())
- ->method('getHeadCommit')
- ->will($this->returnValue($getHeadCommitValue));
- }
-
- protected function setUpGitCommandStubWithGetRemotesOnce($stub, $getRemotesValue)
- {
- $stub->expects($this->once())
- ->method('getRemotes')
- ->will($this->returnValue($getRemotesValue));
- }
-
- protected function setUpGitCommandStubWithGetRemotesNeverCalled($stub, $getRemotesValue)
- {
- $stub->expects($this->never())
- ->method('getRemotes')
- ->will($this->returnValue($getRemotesValue));
- }
-
- // getCommand()
-
- /**
- * @test
- */
- public function getCommand()
- {
- $command = new GitCommand();
- $object = new GitInfoCollector($command);
-
- $this->assertSame($command, $object->getCommand());
- }
-
- // collect()
-
- /**
- * @test
- */
- public function collect()
- {
- $gitCommand = $this->createGitCommandStubWith($this->getBranchesValue, $this->getHeadCommitValue, $this->getRemotesValue);
- $object = new GitInfoCollector($gitCommand);
-
- $git = $object->collect();
-
- $gitClass = 'Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Git';
- $this->assertTrue($git instanceof $gitClass);
- $this->assertGit($git);
- }
-
- protected function assertGit(Git $git)
- {
- $this->assertEquals('branch1', $git->getBranch());
-
- $commit = $git->getHead();
-
- $commitClass = 'Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Commit';
- $this->assertTrue($commit instanceof $commitClass);
- $this->assertCommit($commit);
-
- $remotes = $git->getRemotes();
- $this->assertCount(1, $remotes);
-
- $remoteClass = 'Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Remote';
- $this->assertTrue($remotes[0] instanceof $remoteClass);
- $this->assertRemote($remotes[0]);
- }
-
- protected function assertCommit(Commit $commit)
- {
- $this->assertEquals('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', $commit->getId());
- $this->assertEquals('Author Name', $commit->getAuthorName());
- $this->assertEquals('author@satooshi.jp', $commit->getAuthorEmail());
- $this->assertEquals('Committer Name', $commit->getCommitterName());
- $this->assertEquals('committer@satooshi.jp', $commit->getCommitterEmail());
- $this->assertEquals('commit message', $commit->getMessage());
- }
-
- protected function assertRemote(Remote $remote)
- {
- $this->assertEquals('origin', $remote->getName());
- $this->assertEquals('git@github.com:satooshi/php-coveralls.git', $remote->getUrl());
- }
-
- // collectBranch() exception
-
- /**
- * @test
- * @expectedException RuntimeException
- */
- public function throwRuntimeExceptionIfCurrentBranchNotFound()
- {
- $getBranchesValue = array(
- ' master',
- );
- $gitCommand = $this->createGitCommandStubCalledBranches($getBranchesValue, $this->getHeadCommitValue, $this->getRemotesValue);
-
- $object = new GitInfoCollector($gitCommand);
-
- $object->collect();
- }
-
- // collectCommit() exception
-
- /**
- * @test
- * @expectedException RuntimeException
- */
- public function throwRuntimeExceptionIfHeadCommitIsInvalid()
- {
- $getHeadCommitValue = array();
- $gitCommand = $this->createGitCommandStubCalledHeadCommit($this->getBranchesValue, $getHeadCommitValue, $this->getRemotesValue);
-
- $object = new GitInfoCollector($gitCommand);
-
- $object->collect();
- }
-
- // collectRemotes() exception
-
- /**
- * @test
- * @expectedException RuntimeException
- */
- public function throwRuntimeExceptionIfRemoteIsInvalid()
- {
- $getRemotesValue = array();
- $gitCommand = $this->createGitCommandStubWith($this->getBranchesValue, $this->getHeadCommitValue, $getRemotesValue);
-
- $object = new GitInfoCollector($gitCommand);
-
- $object->collect();
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommandTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommandTest.php
deleted file mode 100644
index a50dae7..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommandTest.php
+++ /dev/null
@@ -1,126 +0,0 @@
-
- */
-class CoverallsV1JobsCommandTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- $this->rootDir = realpath(__DIR__ . '/../../../../prj');
- $this->srcDir = $this->rootDir . '/files';
- $this->buildDir = $this->rootDir . '/build';
- $this->logsDir = $this->rootDir . '/build/logs';
- $this->cloverXmlPath = $this->logsDir . '/clover.xml';
- $this->jsonPath = $this->logsDir . DIRECTORY_SEPARATOR . 'coveralls-upload.json';
- }
-
- protected function tearDown()
- {
- $this->rmFile($this->cloverXmlPath);
- $this->rmFile($this->jsonPath);
- $this->rmDir($this->logsDir);
- $this->rmDir($this->buildDir);
- }
-
- protected function rmFile($file)
- {
- if (is_file($file)) {
- chmod(dirname($file), 0777);
- unlink($file);
- }
- }
-
- protected function rmDir($dir)
- {
- if (is_dir($dir)) {
- chmod($dir, 0777);
- rmdir($dir);
- }
- }
-
- protected function makeProjectDir($logsDir, $cloverXmlPath, $logsDirUnwritable = false, $jsonPathUnwritable = false)
- {
- if ($logsDir !== null) {
- mkdir($logsDir, 0777, true);
- }
-
- if ($cloverXmlPath !== null) {
- file_put_contents($cloverXmlPath, $this->getCloverXml());
- }
-
- if ($logsDirUnwritable) {
- chmod($logsDir, 0577);
- }
-
- if ($jsonPathUnwritable) {
- touch($this->jsonPath);
- chmod($this->jsonPath, 0577);
- }
- }
-
- protected function getCloverXml()
- {
- $xml = <<
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-XML;
- return sprintf($xml, $this->srcDir, $this->srcDir);
- }
-
- /**
- * @test
- */
- public function shouldExecuteCoverallsV1JobsCommand()
- {
- $this->makeProjectDir($this->logsDir, $this->cloverXmlPath);
-
- $command = new CoverallsV1JobsCommand();
- $command->setRootDir($this->rootDir);
-
- $app = new Application();
- $app->add($command);
-
- $command = $app->find('coveralls:v1:jobs');
- $commandTester = new CommandTester($command);
-
- $_SERVER['TRAVIS'] = true;
- $_SERVER['TRAVIS_JOB_ID'] = 'command_test';
-
- $actual = $commandTester->execute(
- array(
- 'command' => $command->getName(),
- '--dry-run' => true,
- '--config' => 'coveralls.yml',
- '--env' => 'test',
- )
- );
-
- $this->assertEquals(0, $actual);
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/ConfigurationTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/ConfigurationTest.php
deleted file mode 100644
index 9829682..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/ConfigurationTest.php
+++ /dev/null
@@ -1,407 +0,0 @@
-
- */
-class ConfigurationTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- $this->object = new Configuration();
- }
-
- // hasRepoToken()
- // getRepoToken()
-
- /**
- * @test
- */
- public function shouldNotHaveRepoTokenOnConstruction()
- {
- $this->assertFalse($this->object->hasRepoToken());
- $this->assertNull($this->object->getRepoToken());
- }
-
- // hasServiceName()
- // getServiceName()
-
- /**
- * @test
- */
- public function shouldNotHaveServiceNameOnConstruction()
- {
- $this->assertFalse($this->object->hasServiceName());
- $this->assertNull($this->object->getServiceName());
- }
-
- // getSrcDir()
-
- /**
- * @test
- */
- public function shouldNotHaveSrcDirOnConstruction()
- {
- $this->assertNull($this->object->getSrcDir());
- }
-
- // getCloverXmlPaths()
-
- /**
- * @test
- */
- public function shouldHaveEmptyCloverXmlPathsOnConstruction()
- {
- $this->assertEmpty($this->object->getCloverXmlPaths());
- }
-
- // getJsonPath()
-
- /**
- * @test
- */
- public function shouldNotHaveJsonPathOnConstruction()
- {
- $this->assertNull($this->object->getJsonPath());
- }
-
- // isDryRun()
-
- /**
- * @test
- */
- public function shouldBeDryRunOnConstruction()
- {
- $this->assertTrue($this->object->isDryRun());
- }
-
- // isExcludeNoStatements()
-
- /**
- * @test
- */
- public function shouldNotBeExcludeNotStatementsOnConstruction()
- {
- $this->assertFalse($this->object->isExcludeNoStatements());
- }
-
- // isVerbose
-
- /**
- * @test
- */
- public function shouldNotBeVerboseOnConstruction()
- {
- $this->assertFalse($this->object->isVerbose());
- }
-
- // getEnv()
-
- /**
- * @test
- */
- public function shouldBeProdEnvOnConstruction()
- {
- $this->assertEquals('prod', $this->object->getEnv());
- }
-
- // isTestEnv()
-
- /**
- * @test
- */
- public function shouldBeTestEnv()
- {
- $expected = 'test';
-
- $this->object->setEnv($expected);
-
- $this->assertEquals($expected, $this->object->getEnv());
- $this->assertTrue($this->object->isTestEnv());
- $this->assertFalse($this->object->isDevEnv());
- $this->assertFalse($this->object->isProdEnv());
- }
-
- // isDevEnv()
-
- /**
- * @test
- */
- public function shouldBeDevEnv()
- {
- $expected = 'dev';
-
- $this->object->setEnv($expected);
-
- $this->assertEquals($expected, $this->object->getEnv());
- $this->assertFalse($this->object->isTestEnv());
- $this->assertTrue($this->object->isDevEnv());
- $this->assertFalse($this->object->isProdEnv());
- }
-
- // isProdEnv()
-
- /**
- * @test
- */
- public function shouldBeProdEnv()
- {
- $expected = 'prod';
-
- $this->object->setEnv($expected);
-
- $this->assertEquals($expected, $this->object->getEnv());
- $this->assertFalse($this->object->isTestEnv());
- $this->assertFalse($this->object->isDevEnv());
- $this->assertTrue($this->object->isProdEnv());
- }
-
-
-
- // setRepoToken()
-
- /**
- * @test
- */
- public function setRepoToken()
- {
- $expected = 'token';
-
- $same = $this->object->setRepoToken($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertSame($expected, $this->object->getRepoToken());
- }
-
- // setServiceName()
-
- /**
- * @test
- */
- public function setServiceName()
- {
- $expected = 'travis-ci';
-
- $same = $this->object->setServiceName($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertSame($expected, $this->object->getServiceName());
- }
-
- // setSrcDir()
-
- /**
- * @test
- */
- public function setSrcDir()
- {
- $expected = '/path/to/src';
-
- $same = $this->object->setSrcDir($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertSame($expected, $this->object->getSrcDir());
- }
-
- // setCloverXmlPaths()
-
- /**
- * @test
- */
- public function setCloverXmlPaths()
- {
- $expected = array('/path/to/clover.xml');
-
- $same = $this->object->setCloverXmlPaths($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertSame($expected, $this->object->getCloverXmlPaths());
- }
-
- // addCloverXmlPath()
-
- /**
- * @test
- */
- public function addCloverXmlPath()
- {
- $expected = '/path/to/clover.xml';
-
- $same = $this->object->addCloverXmlPath($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertSame(array($expected), $this->object->getCloverXmlPaths());
- }
-
- // setJsonPath()
-
- /**
- * @test
- */
- public function setJsonPath()
- {
- $expected = '/path/to/coveralls-upload.json';
-
- $same = $this->object->setJsonPath($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertSame($expected, $this->object->getJsonPath());
- }
-
- // setDryRun()
-
- /**
- * @test
- */
- public function setDryRunFalse()
- {
- $expected = false;
-
- $same = $this->object->setDryRun($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertFalse($this->object->isDryRun());
- }
-
- /**
- * @test
- */
- public function setDryRunTrue()
- {
- $expected = true;
-
- $same = $this->object->setDryRun($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertTrue($this->object->isDryRun());
- }
-
- // setExcludeNoStatements()
-
- /**
- * @test
- */
- public function setExcludeNoStatementsFalse()
- {
- $expected = false;
-
- $same = $this->object->setExcludeNoStatements($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertFalse($this->object->isExcludeNoStatements());
- }
-
- /**
- * @test
- */
- public function setExcludeNoStatementsTrue()
- {
- $expected = true;
-
- $same = $this->object->setExcludeNoStatements($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertTrue($this->object->isExcludeNoStatements());
- }
-
- // setExcludeNoStatementsUnlessFalse()
-
- /**
- * @test
- */
- public function setExcludeNoStatementsFalseUnlessFalse()
- {
- $expected = false;
-
- $same = $this->object->setExcludeNoStatementsUnlessFalse($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertFalse($this->object->isExcludeNoStatements());
- }
-
- /**
- * @test
- */
- public function setExcludeNoStatementsTrueUnlessFalse()
- {
- $expected = true;
-
- $same = $this->object->setExcludeNoStatementsUnlessFalse($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertTrue($this->object->isExcludeNoStatements());
- }
-
- /**
- * @test
- */
- public function setExcludeNoStatementsTrueIfFalsePassedAndIfTrueWasSet()
- {
- $expected = false;
-
- $same = $this->object->setExcludeNoStatements(true);
- $same = $this->object->setExcludeNoStatementsUnlessFalse($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertTrue($this->object->isExcludeNoStatements());
- }
-
- /**
- * @test
- */
- public function setExcludeNoStatementsTrueIfTruePassedAndIfTrueWasSet()
- {
- $expected = true;
-
- $same = $this->object->setExcludeNoStatements(true);
- $same = $this->object->setExcludeNoStatementsUnlessFalse($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertTrue($this->object->isExcludeNoStatements());
- }
-
- // setVerbose()
-
- /**
- * @test
- */
- public function setVerboseFalse()
- {
- $expected = false;
-
- $same = $this->object->setVerbose($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertFalse($this->object->isVerbose());
- }
-
- /**
- * @test
- */
- public function setVerboseTrue()
- {
- $expected = true;
-
- $same = $this->object->setVerbose($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertTrue($this->object->isVerbose());
- }
-
- // setEnv()
-
- /**
- * @test
- */
- public function setEnv()
- {
- $expected = 'myenv';
-
- $same = $this->object->setEnv($expected);
-
- $this->assertSame($same, $this->object);
- $this->assertEquals($expected, $this->object->getEnv());
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/ConfiguratorTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/ConfiguratorTest.php
deleted file mode 100644
index 3bc52bd..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/ConfiguratorTest.php
+++ /dev/null
@@ -1,355 +0,0 @@
-
- */
-class ConfiguratorTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- $this->rootDir = realpath(__DIR__ . '/../../../../prj');
- $this->srcDir = $this->rootDir . '/src';
- $this->buildDir = $this->rootDir . '/build';
- $this->logsDir = $this->rootDir . '/build/logs';
- $this->cloverXmlPath = $this->logsDir . '/clover.xml';
- $this->cloverXmlPath1 = $this->logsDir . '/clover-part1.xml';
- $this->cloverXmlPath2 = $this->logsDir . '/clover-part2.xml';
- $this->jsonPath = $this->logsDir . DIRECTORY_SEPARATOR . 'coveralls-upload.json';
-
- $this->object = new Configurator();
- }
-
- protected function tearDown()
- {
- $this->rmFile($this->cloverXmlPath);
- $this->rmFile($this->cloverXmlPath1);
- $this->rmFile($this->cloverXmlPath2);
- $this->rmFile($this->jsonPath);
- $this->rmDir($this->srcDir);
- $this->rmDir($this->logsDir);
- $this->rmDir($this->buildDir);
- }
-
- protected function rmFile($file)
- {
- if (is_file($file)) {
- chmod(dirname($file), 0777);
- unlink($file);
- }
- }
-
- protected function rmDir($dir)
- {
- if (is_dir($dir)) {
- chmod($dir, 0777);
- rmdir($dir);
- }
- }
-
- protected function makeProjectDir($srcDir, $logsDir, $cloverXmlPaths, $logsDirUnwritable = false, $jsonPathUnwritable = false)
- {
- if ($srcDir !== null) {
- mkdir($srcDir, 0777, true);
- }
-
- if ($logsDir !== null) {
- mkdir($logsDir, 0777, true);
- }
-
- if ($cloverXmlPaths !== null) {
- if (is_array($cloverXmlPaths)) {
- foreach ($cloverXmlPaths as $cloverXmlPath) {
- touch($cloverXmlPath);
- }
- } else {
- touch($cloverXmlPaths);
- }
- }
-
- if ($logsDirUnwritable) {
- chmod($logsDir, 0577);
- }
-
- if ($jsonPathUnwritable) {
- touch($this->jsonPath);
- chmod($this->jsonPath, 0577);
- }
- }
-
- // custom assertion
-
- protected function assertConfiguration(Configuration $config, $srcDir, array $cloverXml, $jsonPath, $excludeNoStatements = false)
- {
- $this->assertEquals($srcDir, $config->getSrcDir());
- $this->assertEquals($cloverXml, $config->getCloverXmlPaths());
- $this->assertEquals($jsonPath, $config->getJsonPath());
- $this->assertEquals($excludeNoStatements, $config->isExcludeNoStatements());
- }
-
- // load()
-
- /**
- * @test
- */
- public function shouldLoadNonExistingYml()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath);
-
- $path = realpath(__DIR__ . '/yaml/dummy.yml');
-
- $config = $this->object->load($path, $this->rootDir);
-
- $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath), $this->jsonPath);
- }
-
- // default src_dir not found
-
- /**
- * @test
- * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
- */
- public function throwInvalidConfigurationExceptionOnLoadEmptyYmlIfSrcDirNotFound()
- {
- $this->makeProjectDir(null, $this->logsDir, $this->cloverXmlPath);
-
- $path = realpath(__DIR__ . '/yaml/dummy.yml');
-
- $this->object->load($path, $this->rootDir);
- }
-
- // default coverage_clover not found
-
- /**
- * @test
- * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
- */
- public function throwInvalidConfigurationExceptionOnLoadEmptyYmlIfCoverageCloverNotFound()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, null);
-
- $path = realpath(__DIR__ . '/yaml/dummy.yml');
-
- $this->object->load($path, $this->rootDir);
- }
-
- // default json_path not writable
-
- /**
- * @test
- * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
- */
- public function throwInvalidConfigurationExceptionOnLoadEmptyYmlIfJsonPathDirNotWritable()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath, true);
-
- $path = realpath(__DIR__ . '/yaml/dummy.yml');
-
- $this->object->load($path, $this->rootDir);
- }
-
- /**
- * @test
- * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
- */
- public function throwInvalidConfigurationExceptionOnLoadEmptyYmlIfJsonPathNotWritable()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath, false, true);
-
- $path = realpath(__DIR__ . '/yaml/dummy.yml');
-
- $this->object->load($path, $this->rootDir);
- }
-
- // no configuration
-
- /**
- * @test
- */
- public function shouldLoadEmptyYml()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath);
-
- $path = realpath(__DIR__ . '/yaml/empty.yml');
-
- $config = $this->object->load($path, $this->rootDir);
-
- $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath), $this->jsonPath);
- }
-
- // load default value yml
-
- /**
- * @test
- */
- public function shouldLoadSrcDirYmlContainingDefaultValue()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath);
-
- $path = realpath(__DIR__ . '/yaml/src_dir.yml');
-
- $config = $this->object->load($path, $this->rootDir);
-
- $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath), $this->jsonPath);
- }
-
- /**
- * @test
- */
- public function shouldLoadCoverageCloverYmlContainingDefaultValue()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath);
-
- $path = realpath(__DIR__ . '/yaml/coverage_clover.yml');
-
- $config = $this->object->load($path, $this->rootDir);
-
- $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath), $this->jsonPath);
- }
-
- /**
- * @test
- */
- public function shouldLoadCoverageCloverYmlContainingGlobValue()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, array($this->cloverXmlPath1, $this->cloverXmlPath2));
-
- $path = realpath(__DIR__ . '/yaml/coverage_clover_glob.yml');
-
- $config = $this->object->load($path, $this->rootDir);
-
- $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath1, $this->cloverXmlPath2), $this->jsonPath);
- }
-
- /**
- * @test
- */
- public function shouldLoadCoverageCloverYmlContainingArrayValue()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, array($this->cloverXmlPath1, $this->cloverXmlPath2));
-
- $path = realpath(__DIR__ . '/yaml/coverage_clover_array.yml');
-
- $config = $this->object->load($path, $this->rootDir);
-
- $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath1, $this->cloverXmlPath2), $this->jsonPath);
- }
-
- /**
- * @test
- */
- public function shouldLoadJsonPathYmlContainingDefaultValue()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath);
-
- $path = realpath(__DIR__ . '/yaml/json_path.yml');
-
- $config = $this->object->load($path, $this->rootDir);
-
- $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath), $this->jsonPath);
- }
-
- /**
- * @test
- */
- public function shouldLoadExcludeNoStmtYmlContainingTrue()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath);
-
- $path = realpath(__DIR__ . '/yaml/exclude_no_stmt_true.yml');
-
- $config = $this->object->load($path, $this->rootDir);
-
- $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath), $this->jsonPath, true);
- }
-
- /**
- * @test
- */
- public function shouldLoadExcludeNoStmtYmlContainingFalse()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath);
-
- $path = realpath(__DIR__ . '/yaml/exclude_no_stmt_false.yml');
-
- $config = $this->object->load($path, $this->rootDir);
-
- $this->assertConfiguration($config, $this->srcDir, array($this->cloverXmlPath), $this->jsonPath, false);
- }
-
- // configured src_dir not found
-
- /**
- * @test
- * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
- */
- public function throwInvalidConfigurationExceptionOnLoadSrcDirYmlIfSrcDirNotFound()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath);
-
- $path = realpath(__DIR__ . '/yaml/src_dir_not_found.yml');
-
- $this->object->load($path, $this->rootDir);
- }
-
- // configured coverage_clover not found
-
- /**
- * @test
- * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
- */
- public function throwInvalidConfigurationExceptionOnLoadCoverageCloverYmlIfCoverageCloverNotFound()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath);
-
- $path = realpath(__DIR__ . '/yaml/coverage_clover_not_found.yml');
-
- $this->object->load($path, $this->rootDir);
- }
-
- /**
- * @test
- * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
- */
- public function throwInvalidConfigurationExceptionOnLoadCoverageCloverYmlIfCoverageCloverIsNotString()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath);
-
- $path = realpath(__DIR__ . '/yaml/coverage_clover_invalid.yml');
-
- $this->object->load($path, $this->rootDir);
- }
-
- // configured json_path not found
-
- /**
- * @test
- * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
- */
- public function throwInvalidConfigurationExceptionOnLoadJsonPathYmlIfJsonPathNotFound()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath);
-
- $path = realpath(__DIR__ . '/yaml/json_path_not_found.yml');
-
- $this->object->load($path, $this->rootDir);
- }
-
- // configured exclude_no_stmt invalid
-
- /**
- * @test
- * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
- */
- public function throwInvalidConfigurationExceptionOnLoadExcludeNoStmtYmlIfInvalid()
- {
- $this->makeProjectDir($this->srcDir, $this->logsDir, $this->cloverXmlPath);
-
- $path = realpath(__DIR__ . '/yaml/exclude_no_stmt_invalid.yml');
-
- $this->object->load($path, $this->rootDir);
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover.yml b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover.yml
deleted file mode 100644
index f6e9ef4..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover.yml
+++ /dev/null
@@ -1 +0,0 @@
-coverage_clover: build/logs/clover.xml
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_array.yml b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_array.yml
deleted file mode 100644
index 721b36e..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_array.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-coverage_clover:
- - build/logs/clover-part1.xml
- - build/logs/clover-part2.xml
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_glob.yml b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_glob.yml
deleted file mode 100644
index c8f7bd3..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_glob.yml
+++ /dev/null
@@ -1 +0,0 @@
-coverage_clover: build/logs/clover-*.xml
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_invalid.yml b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_invalid.yml
deleted file mode 100644
index bb3506d..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_invalid.yml
+++ /dev/null
@@ -1 +0,0 @@
-coverage_clover: false
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_not_found.yml b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_not_found.yml
deleted file mode 100644
index f111324..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/coverage_clover_not_found.yml
+++ /dev/null
@@ -1 +0,0 @@
-coverage_clover: build/logs/clover.dummy.xml
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/empty.yml b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/empty.yml
deleted file mode 100644
index e69de29..0000000
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_false.yml b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_false.yml
deleted file mode 100644
index 0c41182..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_false.yml
+++ /dev/null
@@ -1 +0,0 @@
-exclude_no_stmt: false
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_invalid.yml b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_invalid.yml
deleted file mode 100644
index 54d20fc..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_invalid.yml
+++ /dev/null
@@ -1 +0,0 @@
-exclude_no_stmt: 1
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_true.yml b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_true.yml
deleted file mode 100644
index c1c4d34..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/exclude_no_stmt_true.yml
+++ /dev/null
@@ -1 +0,0 @@
-exclude_no_stmt: true
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/json_path.yml b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/json_path.yml
deleted file mode 100644
index 092f4ee..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/json_path.yml
+++ /dev/null
@@ -1 +0,0 @@
-json_path: build/logs/coveralls-upload.json
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/json_path_not_found.yml b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/json_path_not_found.yml
deleted file mode 100644
index e4ad72c..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/json_path_not_found.yml
+++ /dev/null
@@ -1 +0,0 @@
-json_path: build/logs.dummy/coveralls-upload.json
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/src_dir.yml b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/src_dir.yml
deleted file mode 100644
index 7a18ce2..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/src_dir.yml
+++ /dev/null
@@ -1 +0,0 @@
-src_dir: src
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/src_dir_not_found.yml b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/src_dir_not_found.yml
deleted file mode 100644
index 7295a07..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Config/yaml/src_dir_not_found.yml
+++ /dev/null
@@ -1 +0,0 @@
-src_dir: src.dummy.dir
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/CommitTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/CommitTest.php
deleted file mode 100644
index f9c6bff..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/CommitTest.php
+++ /dev/null
@@ -1,220 +0,0 @@
-
- */
-class CommitTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- $this->object = new Commit();
- }
-
- // getId()
-
- /**
- * @test
- */
- public function shouldNotHaveIdOnConstruction()
- {
- $this->assertNull($this->object->getId());
- }
-
- // getAuthorName()
-
- /**
- * @test
- */
- public function shouldNotHoveAuthorNameOnConstruction()
- {
- $this->assertNull($this->object->getAuthorName());
- }
-
- // getAuthorEmail()
-
- /**
- * @test
- */
- public function shouldNotHoveAuthorEmailOnConstruction()
- {
- $this->assertNull($this->object->getAuthorEmail());
- }
-
- // getCommitterName()
-
- /**
- * @test
- */
- public function shouldNotHoveCommitterNameOnConstruction()
- {
- $this->assertNull($this->object->getCommitterName());
- }
-
- // getCommitterEmail()
-
- /**
- * @test
- */
- public function shouldNotHoveCommitterEmailOnConstruction()
- {
- $this->assertNull($this->object->getCommitterEmail());
- }
-
- // getMessage()
-
- /**
- * @test
- */
- public function shouldNotHoveMessageOnConstruction()
- {
- $this->assertNull($this->object->getMessage());
- }
-
-
- // setId()
-
- /**
- * @test
- */
- public function setId()
- {
- $expected = 'id';
-
- $obj = $this->object->setId($expected);
-
- $this->assertEquals($expected, $this->object->getId());
- $this->assertSame($obj, $this->object);
- }
-
- // setAuthorName()
-
- /**
- * @test
- */
- public function setAuthorName()
- {
- $expected = 'author_name';
-
- $obj = $this->object->setAuthorName($expected);
-
- $this->assertEquals($expected, $this->object->getAuthorName());
- $this->assertSame($obj, $this->object);
- }
-
- // setAuthorEmail()
-
- /**
- * @test
- */
- public function setAuthorEmail()
- {
- $expected = 'author_email';
-
- $obj = $this->object->setAuthorEmail($expected);
-
- $this->assertEquals($expected, $this->object->getAuthorEmail());
- $this->assertSame($obj, $this->object);
- }
-
- // setCommitterName()
-
- /**
- * @test
- */
- public function setCommitterName()
- {
- $expected = 'committer_name';
-
- $obj = $this->object->setCommitterName($expected);
-
- $this->assertEquals($expected, $this->object->getCommitterName());
- $this->assertSame($obj, $this->object);
- }
-
- // setCommitterEmail()
-
- /**
- * @test
- */
- public function setCommitterEmail()
- {
- $expected = 'committer_email';
-
- $obj = $this->object->setCommitterEmail($expected);
-
- $this->assertEquals($expected, $this->object->getCommitterEmail());
- $this->assertSame($obj, $this->object);
- }
-
- // setMessage()
-
- /**
- * @test
- */
- public function setMessage()
- {
- $expected = 'message';
-
- $obj = $this->object->setMessage($expected);
-
- $this->assertEquals($expected, $this->object->getMessage());
- $this->assertSame($obj, $this->object);
- }
-
- // toArray()
-
- /**
- * @test
- */
- public function toArray()
- {
- $expected = array(
- 'id' => null,
- 'author_name' => null,
- 'author_email' => null,
- 'committer_name' => null,
- 'committer_email' => null,
- 'message' => null,
- );
-
- $this->assertSame($expected, $this->object->toArray());
- $this->assertSame(json_encode($expected), (string)$this->object);
- }
-
- /**
- * @test
- */
- public function toArrayFilled()
- {
- $id = 'id';
- $authorName = 'author_name';
- $authorEmail = 'author_email';
- $committerName = 'committer_name';
- $committerEmail = 'committer_email';
- $message = 'message';
-
- $this->object
- ->setId($id)
- ->setAuthorName($authorName)
- ->setAuthorEmail($authorEmail)
- ->setCommitterName($committerName)
- ->setCommitterEmail($committerEmail)
- ->setMessage($message);
-
- $expected = array(
- 'id' => $id,
- 'author_name' => $authorName,
- 'author_email' => $authorEmail,
- 'committer_name' => $committerName,
- 'committer_email' => $committerEmail,
- 'message' => $message,
- );
-
- $this->assertSame($expected, $this->object->toArray());
- $this->assertSame(json_encode($expected), (string)$this->object);
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/GitTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/GitTest.php
deleted file mode 100644
index 7b1c818..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/GitTest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-
- */
-class GitTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- $this->branchName = 'branch_name';
- $this->commit = $this->createCommit();
- $this->remote = $this->createRemote();
-
- $this->object = new Git($this->branchName, $this->commit, array($this->remote));
- }
-
- protected function createRemote($name = 'name', $url = 'url')
- {
- $remote = new Remote();
-
- return $remote
- ->setName($name)
- ->setUrl($url);
- }
-
- protected function createCommit($id = 'id', $authorName = 'author_name', $authorEmail = 'author_email', $committerName = 'committer_name', $committerEmail = 'committer_email', $message = 'message')
- {
- $commit = new Commit();
-
- return $commit
- ->setId($id)
- ->setAuthorName($authorName)
- ->setAuthorEmail($authorEmail)
- ->setCommitterName($committerName)
- ->setCommitterEmail($committerEmail)
- ->setMessage($message);
- }
-
- // getBranch()
-
- /**
- * @test
- */
- public function getBranch()
- {
- $this->assertEquals($this->branchName, $this->object->getBranch());
- }
-
- // getHead()
-
- /**
- * @test
- */
- public function getHead()
- {
- $this->assertSame($this->commit, $this->object->getHead());
- }
-
- // getRemotes()
-
- /**
- * @test
- */
- public function getRemotes()
- {
- $this->assertSame(array($this->remote), $this->object->getRemotes());
- }
-
- // toArray()
-
- /**
- * @test
- */
- public function toArray()
- {
- $expected = array(
- 'branch' => $this->branchName,
- 'head' => $this->commit->toArray(),
- 'remotes' => array($this->remote->toArray()),
- );
-
- $this->assertSame($expected, $this->object->toArray());
- $this->assertSame(json_encode($expected), (string)$this->object);
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/RemoteTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/RemoteTest.php
deleted file mode 100644
index c83b012..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/Git/RemoteTest.php
+++ /dev/null
@@ -1,103 +0,0 @@
-
- */
-class RemoteTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- $this->object = new Remote();
- }
-
- // getName()
-
- /**
- * @test
- */
- public function shouldNotHaveRemoteNameOnConstruction()
- {
- $this->assertNull($this->object->getName());
- }
-
- // getUrl()
-
- /**
- * @test
- */
- public function shouldNotHaveUrlOnConstruction()
- {
- $this->assertNull($this->object->getUrl());
- }
-
- // setName()
-
- /**
- * @test
- */
- public function setRemoteName()
- {
- $expected = 'remote_name';
-
- $obj = $this->object->setName($expected);
-
- $this->assertEquals($expected, $this->object->getName());
- $this->assertSame($obj, $this->object);
- }
-
- // setUrl()
-
- /**
- * @test
- */
- public function setRemoteUrl()
- {
- $expected = 'git@github.com:satooshi/php-coveralls.git';
-
- $obj = $this->object->setUrl($expected);
-
- $this->assertEquals($expected, $this->object->getUrl());
- $this->assertSame($obj, $this->object);
- }
-
- // toArray()
-
- /**
- * @test
- */
- public function toArray()
- {
- $expected = array(
- 'name' => null,
- 'url' => null,
- );
-
- $this->assertSame($expected, $this->object->toArray());
- $this->assertSame(json_encode($expected), (string)$this->object);
- }
-
- /**
- * @test
- */
- public function toArrayFilled()
- {
- $name = 'name';
- $url = 'url';
-
- $this->object
- ->setName($name)
- ->setUrl($url);
-
- $expected = array(
- 'name' => $name,
- 'url' => $url,
- );
-
- $this->assertSame($expected, $this->object->toArray());
- $this->assertSame(json_encode($expected), (string)$this->object);
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/JsonFileTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/JsonFileTest.php
deleted file mode 100644
index 967a006..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/JsonFileTest.php
+++ /dev/null
@@ -1,725 +0,0 @@
-
- */
-class JsonFileTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- $this->dir = realpath(__DIR__ . '/../../../../');
- $this->rootDir = realpath($this->dir . '/prj/files');
- $this->filename = 'test.php';
- $this->path = $this->rootDir . DIRECTORY_SEPARATOR . $this->filename;
-
- $this->object = new JsonFile();
- }
-
-
- protected function createSourceFile()
- {
- return new SourceFile($this->path, $this->filename);
- }
-
- protected function getCloverXml()
- {
- $xml = <<
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-XML;
- return sprintf($xml, $this->rootDir, $this->rootDir, $this->rootDir, $this->rootDir);
- }
-
- protected function createCloverXml()
- {
- $xml = $this->getCloverXml();
-
- return simplexml_load_string($xml);
- }
-
- protected function collectJsonFile()
- {
- $xml = $this->createCloverXml();
- $collector = new CloverXmlCoverageCollector();
-
- return $collector->collect($xml, $this->rootDir);
- }
-
- protected function getNoSourceCloverXml()
- {
- return <<
-
-
-
-
-
-
-
-
-
-
-
-XML;
- }
-
- protected function createNoSourceCloverXml()
- {
- $xml = $this->getNoSourceCloverXml();
-
- return simplexml_load_string($xml);
- }
-
- protected function collectJsonFileWithoutSourceFiles()
- {
- $xml = $this->createNoSourceCloverXml();
- $collector = new CloverXmlCoverageCollector();
-
- return $collector->collect($xml, $this->rootDir);
- }
-
-
- // hasSourceFile()
- // getSourceFile()
-
- /**
- * @test
- */
- public function shouldNotHaveSourceFileOnConstruction()
- {
- $path = 'test.php';
-
- $this->assertFalse($this->object->hasSourceFile($path));
- $this->assertNull($this->object->getSourceFile($path));
- }
-
- // hasSourceFiles()
- // getSourceFiles()
-
- /**
- * @test
- */
- public function countZeroSourceFilesOnConstruction()
- {
- $this->assertFalse($this->object->hasSourceFiles());
- $this->assertEmpty($this->object->getSourceFiles());
- }
-
- // getServiceName()
-
- /**
- * @test
- */
- public function shouldNotHaveServiceNameOnConstruction()
- {
- $this->assertNull($this->object->getServiceName());
- }
-
- // getRepoToken()
-
- /**
- * @test
- */
- public function shouldNotHaveRepoTokenOnConstruction()
- {
- $this->assertNull($this->object->getRepoToken());
- }
-
- // getServiceJobId()
-
- /**
- * @test
- */
- public function shouldNotHaveServiceJobIdOnConstruction()
- {
- $this->assertNull($this->object->getServiceJobId());
- }
-
- // getServiceNumber()
-
- /**
- * @test
- */
- public function shouldNotHaveServiceNumberOnConstruction()
- {
- $this->assertNull($this->object->getServiceNumber());
- }
-
- // getServiceEventType()
-
- /**
- * @test
- */
- public function shouldNotHaveServiceEventTypeOnConstruction()
- {
- $this->assertNull($this->object->getServiceEventType());
- }
-
- // getServiceBuildUrl()
-
- /**
- * @test
- */
- public function shouldNotHaveServiceBuildUrlOnConstruction()
- {
- $this->assertNull($this->object->getServiceBuildUrl());
- }
-
- // getServiceBranch()
-
- /**
- * @test
- */
- public function shouldNotHaveServiceBranchOnConstruction()
- {
- $this->assertNull($this->object->getServiceBranch());
- }
-
- // getServicePullRequest()
-
- /**
- * @test
- */
- public function shouldNotHaveServicePullRequestOnConstruction()
- {
- $this->assertNull($this->object->getServicePullRequest());
- }
-
- // getGit()
-
- /**
- * @test
- */
- public function shouldNotHaveGitOnConstruction()
- {
- $this->assertNull($this->object->getGit());
- }
-
- // getRunAt()
-
- /**
- * @test
- */
- public function shouldNotHaveRunAtOnConstruction()
- {
- $this->assertNull($this->object->getRunAt());
- }
-
- // getMetrics()
-
- /**
- * @test
- */
- public function shouldHaveEmptyMetrics()
- {
- $metrics = $this->object->getMetrics();
-
- $this->assertEquals(0, $metrics->getStatements());
- $this->assertEquals(0, $metrics->getCoveredStatements());
- $this->assertEquals(0, $metrics->getLineCoverage());
- }
-
- // setServiceName()
-
- /**
- * @test
- */
- public function setServiceName()
- {
- $expected = 'travis-ci';
-
- $obj = $this->object->setServiceName($expected);
-
- $this->assertEquals($expected, $this->object->getServiceName());
- $this->assertSame($obj, $this->object);
-
- return $this->object;
- }
-
- // setRepoToken()
-
- /**
- * @test
- */
- public function setRepoToken()
- {
- $expected = 'token';
-
- $obj = $this->object->setRepoToken($expected);
-
- $this->assertEquals($expected, $this->object->getRepoToken());
- $this->assertSame($obj, $this->object);
-
- return $this->object;
- }
-
- // setServiceJobId()
-
- /**
- * @test
- */
- public function setServiceJobId()
- {
- $expected = 'job_id';
-
- $obj = $this->object->setServiceJobId($expected);
-
- $this->assertEquals($expected, $this->object->getServiceJobId());
- $this->assertSame($obj, $this->object);
-
- return $this->object;
- }
-
- // setGit()
-
- /**
- * @test
- */
- public function setGit()
- {
- $remotes = array(new Remote());
- $head = new Commit();
- $git = new Git('master', $head, $remotes);
-
- $obj = $this->object->setGit($git);
-
- $this->assertSame($git, $this->object->getGit());
- $this->assertSame($obj, $this->object);
-
- return $this->object;
- }
-
- // setRunAt()
-
- /**
- * @test
- */
- public function setRunAt()
- {
- $expected = '2013-04-04 11:22:33 +0900';
-
- $obj = $this->object->setRunAt($expected);
-
- $this->assertEquals($expected, $this->object->getRunAt());
- $this->assertSame($obj, $this->object);
-
- return $this->object;
- }
-
-
-
- // addSourceFile()
- // sortSourceFiles()
-
- /**
- * @test
- */
- public function addSourceFile()
- {
- $sourceFile = $this->createSourceFile();
-
- $this->object->addSourceFile($sourceFile);
- $this->object->sortSourceFiles();
-
- $path = $sourceFile->getPath();
-
- $this->assertTrue($this->object->hasSourceFiles());
- $this->assertSame(array($path => $sourceFile), $this->object->getSourceFiles());
- $this->assertTrue($this->object->hasSourceFile($path));
- $this->assertSame($sourceFile, $this->object->getSourceFile($path));
- }
-
- // toArray()
-
- /**
- * @test
- */
- public function toArray()
- {
- $expected = array(
- 'source_files' => array(),
- );
-
- $this->assertEquals($expected, $this->object->toArray());
- $this->assertEquals(json_encode($expected), (string)$this->object);
- }
-
- /**
- * @test
- */
- public function toArrayWithSourceFiles()
- {
- $sourceFile = $this->createSourceFile();
-
- $this->object->addSourceFile($sourceFile);
-
- $expected = array(
- 'source_files' => array($sourceFile->toArray()),
- );
-
- $this->assertEquals($expected, $this->object->toArray());
- $this->assertEquals(json_encode($expected), (string)$this->object);
- }
-
- // service_name
-
- /**
- * @test
- * @depends setServiceName
- */
- public function toArrayWithServiceName($object)
- {
- $item = 'travis-ci';
-
- $expected = array(
- 'service_name' => $item,
- 'source_files' => array(),
- );
-
- $this->assertEquals($expected, $object->toArray());
- $this->assertEquals(json_encode($expected), (string)$object);
- }
-
- // service_job_id
-
- /**
- * @test
- * @depends setServiceJobId
- */
- public function toArrayWithServiceJobId($object)
- {
- $item = 'job_id';
-
- $expected = array(
- 'service_job_id' => $item,
- 'source_files' => array(),
- );
-
- $this->assertEquals($expected, $object->toArray());
- $this->assertEquals(json_encode($expected), (string)$object);
- }
-
- // repo_token
-
- /**
- * @test
- * @depends setRepoToken
- */
- public function toArrayWithRepoToken($object)
- {
- $item = 'token';
-
- $expected = array(
- 'repo_token' => $item,
- 'source_files' => array(),
- );
-
- $this->assertEquals($expected, $object->toArray());
- $this->assertEquals(json_encode($expected), (string)$object);
- }
-
- // git
-
- /**
- * @test
- * @depends setGit
- */
- public function toArrayWithGit($object)
- {
- $remotes = array(new Remote());
- $head = new Commit();
- $git = new Git('master', $head, $remotes);
-
- $expected = array(
- 'git' => $git->toArray(),
- 'source_files' => array(),
- );
-
- $this->assertSame($expected, $object->toArray());
- $this->assertEquals(json_encode($expected), (string)$object);
- }
-
- // run_at
-
- /**
- * @test
- * @depends setRunAt
- */
- public function toArrayWithRunAt($object)
- {
- $item = '2013-04-04 11:22:33 +0900';
-
- $expected = array(
- 'run_at' => $item,
- 'source_files' => array(),
- );
-
- $this->assertEquals($expected, $object->toArray());
- $this->assertEquals(json_encode($expected), (string)$object);
- }
-
- // fillJobs()
-
- /**
- * @test
- */
- public function fillJobsForServiceJobId()
- {
- $serviceName = 'travis-ci';
- $serviceJobId = '1.1';
-
- $env = array();
- $env['CI_NAME'] = $serviceName;
- $env['CI_JOB_ID'] = $serviceJobId;
-
- $object = $this->collectJsonFile();
-
- $same = $object->fillJobs($env);
-
- $this->assertSame($same, $object);
- $this->assertEquals($serviceName, $object->getServiceName());
- $this->assertEquals($serviceJobId, $object->getServiceJobId());
- }
-
- /**
- * @test
- */
- public function fillJobsForServiceNumber()
- {
- $repoToken = 'token';
- $serviceName = 'circleci';
- $serviceNumber = '123';
-
- $env = array();
- $env['COVERALLS_REPO_TOKEN'] = $repoToken;
- $env['CI_NAME'] = $serviceName;
- $env['CI_BUILD_NUMBER'] = $serviceNumber;
-
- $object = $this->collectJsonFile();
-
- $same = $object->fillJobs($env);
-
- $this->assertSame($same, $object);
- $this->assertEquals($repoToken, $object->getRepoToken());
- $this->assertEquals($serviceName, $object->getServiceName());
- $this->assertEquals($serviceNumber, $object->getServiceNumber());
- }
-
- /**
- * @test
- */
- public function fillJobsForStandardizedEnvVars()
- {
- /*
- * CI_NAME=codeship
- * CI_BUILD_NUMBER=108821
- * CI_BUILD_URL=https://www.codeship.io/projects/2777/builds/108821
- * CI_BRANCH=master
- * CI_PULL_REQUEST=false
- */
-
- $repoToken = 'token';
- $serviceName = 'codeship';
- $serviceNumber = '108821';
- $serviceBuildUrl = 'https://www.codeship.io/projects/2777/builds/108821';
- $serviceBranch = 'master';
- $servicePullRequest = 'false';
-
- $env = array();
- $env['COVERALLS_REPO_TOKEN'] = $repoToken;
- $env['CI_NAME'] = $serviceName;
- $env['CI_BUILD_NUMBER'] = $serviceNumber;
- $env['CI_BUILD_URL'] = $serviceBuildUrl;
- $env['CI_BRANCH'] = $serviceBranch;
- $env['CI_PULL_REQUEST'] = $servicePullRequest;
-
- $object = $this->collectJsonFile();
-
- $same = $object->fillJobs($env);
-
- $this->assertSame($same, $object);
- $this->assertEquals($repoToken, $object->getRepoToken());
- $this->assertEquals($serviceName, $object->getServiceName());
- $this->assertEquals($serviceNumber, $object->getServiceNumber());
- $this->assertEquals($serviceBuildUrl, $object->getServiceBuildUrl());
- $this->assertEquals($serviceBranch, $object->getServiceBranch());
- $this->assertEquals($servicePullRequest, $object->getServicePullRequest());
- }
-
- /**
- * @test
- */
- public function fillJobsForServiceEventType()
- {
- $repoToken = 'token';
- $serviceName = 'php-coveralls';
- $serviceEventType = 'manual';
-
- $env = array();
- $env['COVERALLS_REPO_TOKEN'] = $repoToken;
- $env['COVERALLS_RUN_LOCALLY'] = '1';
- $env['COVERALLS_EVENT_TYPE'] = $serviceEventType;
- $env['CI_NAME'] = $serviceName;
-
- $object = $this->collectJsonFile();
-
- $same = $object->fillJobs($env);
-
- $this->assertSame($same, $object);
- $this->assertEquals($repoToken, $object->getRepoToken());
- $this->assertEquals($serviceName, $object->getServiceName());
- $this->assertNull($object->getServiceJobId());
- $this->assertEquals($serviceEventType, $object->getServiceEventType());
- }
-
- /**
- * @test
- */
- public function fillJobsForUnsupportedJob()
- {
- $repoToken = 'token';
-
- $env = array();
- $env['COVERALLS_REPO_TOKEN'] = $repoToken;
-
- $object = $this->collectJsonFile();
-
- $same = $object->fillJobs($env);
-
- $this->assertSame($same, $object);
- $this->assertEquals($repoToken, $object->getRepoToken());
- }
-
- /**
- * @test
- * @expectedException RuntimeException
- */
- public function throwRuntimeExceptionOnFillingJobsIfInvalidEnv()
- {
- $env = array();
-
- $object = $this->collectJsonFile();
-
- $object->fillJobs($env);
- }
-
- /**
- * @test
- * @expectedException RuntimeException
- */
- public function throwRuntimeExceptionOnFillingJobsIfNoSourceFiles()
- {
- $env = array();
- $env['TRAVIS'] = true;
- $env['TRAVIS_JOB_ID'] = '1.1';
-
- $object = $this->collectJsonFileWithoutSourceFiles();
-
- $object->fillJobs($env);
- }
-
- // reportLineCoverage()
-
- /**
- * @test
- */
- public function reportLineCoverage()
- {
- $object = $this->collectJsonFile();
-
- $this->assertEquals(50, $object->reportLineCoverage());
-
- $metrics = $object->getMetrics();
-
- $this->assertEquals(2, $metrics->getStatements());
- $this->assertEquals(1, $metrics->getCoveredStatements());
- $this->assertEquals(50, $metrics->getLineCoverage());
- }
-
- // excludeNoStatementsFiles()
-
- /**
- * @test
- */
- public function excludeNoStatementsFiles()
- {
- $rootDir = $this->rootDir . DIRECTORY_SEPARATOR;
-
- $object = $this->collectJsonFile();
-
- // before excluding
- $sourceFiles = $object->getSourceFiles();
- $this->assertCount(4, $sourceFiles);
-
- // filenames
- $paths = array_keys($sourceFiles);
- $filenames = array_map(function ($path) use ($rootDir) {return str_replace($rootDir, '', $path);}, $paths);
-
- $this->assertContains('test.php', $filenames);
- $this->assertContains('test2.php', $filenames);
- $this->assertContains('TestInterface.php', $filenames);
- $this->assertContains('AbstractClass.php', $filenames);
-
- // after excluding
- $object->excludeNoStatementsFiles();
-
- $sourceFiles = $object->getSourceFiles();
- $this->assertCount(2, $sourceFiles);
-
- // filenames
- $paths = array_keys($sourceFiles);
- $filenames = array_map(function ($path) use ($rootDir) {return str_replace($rootDir, '', $path);}, $paths);
-
- $this->assertContains('test.php', $filenames);
- $this->assertContains('test2.php', $filenames);
- $this->assertNotContains('TestInterface.php', $filenames);
- $this->assertNotContains('AbstractClass.php', $filenames);
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/MetricsTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/MetricsTest.php
deleted file mode 100644
index 74c9425..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/MetricsTest.php
+++ /dev/null
@@ -1,117 +0,0 @@
-
- */
-class MetricsTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- $this->coverage = array_fill(0, 5, null);
- $this->coverage[1] = 1;
- $this->coverage[3] = 1;
- $this->coverage[4] = 0;
- }
-
- // hasStatements()
- // getStatements()
-
- /**
- * @test
- */
- public function shouldNotHaveStatementsOnConstructionWithoutCoverage()
- {
- $object = new Metrics();
-
- $this->assertFalse($object->hasStatements());
- $this->assertEquals(0, $object->getStatements());
- }
-
- /**
- * @test
- */
- public function shouldHaveStatementsOnConstructionWithCoverage()
- {
- $object = new Metrics($this->coverage);
-
- $this->assertTrue($object->hasStatements());
- $this->assertEquals(3, $object->getStatements());
- }
-
- // getCoveredStatements()
-
- /**
- * @test
- */
- public function shouldNotHaveCoveredStatementsOnConstructionWithoutCoverage()
- {
- $object = new Metrics();
-
- $this->assertEquals(0, $object->getCoveredStatements());
- }
-
- /**
- * @test
- */
- public function shouldHaveCoveredStatementsOnConstructionWithCoverage()
- {
- $object = new Metrics($this->coverage);
-
- $this->assertEquals(2, $object->getCoveredStatements());
- }
-
- // getLineCoverage()
-
- /**
- * @test
- */
- public function shouldNotHaveLineCoverageOnConstructionWithoutCoverage()
- {
- $object = new Metrics();
-
- $this->assertEquals(0, $object->getLineCoverage());
- }
-
- /**
- * @test
- */
- public function shouldHaveLineCoverageOnConstructionWithCoverage()
- {
- $object = new Metrics($this->coverage);
-
- $this->assertEquals(200/3, $object->getLineCoverage());
- }
-
- // merge()
-
- /**
- * @test
- */
- public function mergeThatWithEmptyMetrics()
- {
- $object = new Metrics();
- $that = new Metrics($this->coverage);
- $object->merge($that);
-
- $this->assertEquals(3, $object->getStatements());
- $this->assertEquals(2, $object->getCoveredStatements());
- $this->assertEquals(200/3, $object->getLineCoverage());
- }
-
- /**
- * @test
- */
- public function mergeThat()
- {
- $object = new Metrics($this->coverage);
- $that = new Metrics($this->coverage);
- $object->merge($that);
-
- $this->assertEquals(6, $object->getStatements());
- $this->assertEquals(4, $object->getCoveredStatements());
- $this->assertEquals(400/6, $object->getLineCoverage());
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/SourceFileTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/SourceFileTest.php
deleted file mode 100644
index 23ccff5..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Bundle/CoverallsV1Bundle/Entity/SourceFileTest.php
+++ /dev/null
@@ -1,138 +0,0 @@
-
- */
-class SourceFileTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- $this->dir = realpath(__DIR__ . '/../../../../');
- $this->rootDir = realpath($this->dir . '/prj/files');
- $this->filename = 'test.php';
- $this->path = $this->rootDir . DIRECTORY_SEPARATOR . $this->filename;
-
- $this->object = new SourceFile($this->path, $this->filename);
- }
-
- // getName()
-
- /**
- * @test
- */
- public function shouldHaveNameOnConstruction()
- {
- $this->assertEquals($this->filename, $this->object->getName());
- }
-
- // getSource()
-
- /**
- * @test
- */
- public function shouldHaveSourceOnConstruction()
- {
- $expected = trim(file_get_contents($this->path));
-
- $this->assertEquals($expected, $this->object->getSource());
- }
-
- // getCoverage()
-
- /**
- * @test
- */
- public function shouldHaveNullCoverageOnConstruction()
- {
- $expected = array_fill(0, 9, null);
-
- $this->assertEquals($expected, $this->object->getCoverage());
- }
-
- // getPath()
-
- /**
- * @test
- */
- public function shouldHavePathOnConstruction()
- {
- $this->assertEquals($this->path, $this->object->getPath());
- }
-
- // getFileLines()
-
- /**
- * @test
- */
- public function shouldHaveFileLinesOnConstruction()
- {
- $this->assertEquals(9, $this->object->getFileLines());
- }
-
- // toArray()
-
- /**
- * @test
- */
- public function toArray()
- {
- $expected = array(
- 'name' => $this->filename,
- 'source' => trim(file_get_contents($this->path)),
- 'coverage' => array_fill(0, 9, null),
- );
-
- $this->assertEquals($expected, $this->object->toArray());
- $this->assertEquals(json_encode($expected), (string)$this->object);
- }
-
- // addCoverage()
-
- /**
- * @test
- */
- public function addCoverage()
- {
- $this->object->addCoverage(5, 1);
-
- $expected = array_fill(0, 9, null);
- $expected[5] = 1;
-
- $this->assertEquals($expected, $this->object->getCoverage());
- }
-
- // getMetrics()
- // reportLineCoverage()
-
- /**
- * @test
- */
- public function shouldLineCoverageZeroWithoutAddingCoverage()
- {
- $metrics = $this->object->getMetrics();
-
- $this->assertEquals(0, $metrics->getStatements());
- $this->assertEquals(0, $metrics->getCoveredStatements());
- $this->assertEquals(0, $metrics->getLineCoverage());
- $this->assertEquals(0, $this->object->reportLineCoverage());
- }
-
- /**
- * @test
- */
- public function shouldLineCoverageAfterAddingCoverage()
- {
- $this->object->addCoverage(6, 1);
-
- $metrics = $this->object->getMetrics();
-
- $this->assertEquals(1, $metrics->getStatements());
- $this->assertEquals(1, $metrics->getCoveredStatements());
- $this->assertEquals(100, $metrics->getLineCoverage());
- $this->assertEquals(100, $this->object->reportLineCoverage());
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Component/File/PathTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Component/File/PathTest.php
deleted file mode 100644
index d8f3f72..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Component/File/PathTest.php
+++ /dev/null
@@ -1,442 +0,0 @@
-
- */
-class PathTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- $this->existingFile = __DIR__ . '/existing.txt';
- $this->unreadablePath = __DIR__ . '/unreadable.txt';
- $this->unwritablePath = __DIR__ . '/unwritable.txt';
- $this->unwritableDir = __DIR__ . '/unwritable.dir';
-
- $this->object = new Path();
- }
-
- protected function tearDown()
- {
- $this->rmFile($this->existingFile);
- $this->rmFile($this->unreadablePath);
- $this->rmFile($this->unwritablePath);
-
- $this->rmDir($this->unwritableDir);
- }
-
- protected function rmFile($file)
- {
- if (is_file($file)) {
- unlink($file);
- }
- }
-
- protected function rmDir($dir)
- {
- if (is_dir($dir)) {
- rmdir($dir);
- }
- }
-
- protected function touchUnreadableFile()
- {
- $this->rmFile($this->unreadablePath);
-
- touch($this->unreadablePath);
- chmod($this->unreadablePath, 0377);
- }
-
- protected function touchUnwritableFile()
- {
- $this->rmFile($this->unwritablePath);
-
- touch($this->unwritablePath);
- chmod($this->unwritablePath, 0577);
- }
-
- protected function mkdirUnwritableDir()
- {
- $this->rmDir($this->unwritableDir);
-
- mkdir($this->unwritableDir);
- chmod($this->unwritableDir, 0577);
- }
-
- // provider
-
- public function provideRelativePaths()
- {
- return array(
- array(''),
- array('.'),
- array('..'),
- );
- }
-
- public function proviceAbsolutePaths()
- {
- return array(
- array('/'),
- array('/path/to/somewhere'),
- );
- }
-
- // isRelativePath()
-
- /**
- * @test
- * @dataProvider provideRelativePaths
- */
- public function shouldBeRelativePath($path)
- {
- $this->assertTrue($this->object->isRelativePath($path));
- }
-
- /**
- * @test
- * @dataProvider proviceAbsolutePaths
- */
- public function shouldNotBeRelativePath($path)
- {
- $this->assertFalse($this->object->isRelativePath($path));
- }
-
- // toAbsolutePath()
-
- /**
- * @test
- */
- public function shouldNotConvertAbsolutePath()
- {
- $path = false;
- $rootDir = __DIR__;
-
- $this->assertFalse($this->object->toAbsolutePath($path, $rootDir));
- }
-
- /**
- * @test
- * @dataProvider provideRelativePaths
- */
- public function shouldConvertAbsolutePathIfRelativePathGiven($path)
- {
- $rootDir = '/path/to/dir';
-
- $expected = $rootDir . DIRECTORY_SEPARATOR . $path;
-
- $this->assertEquals($expected, $this->object->toAbsolutePath($path, $rootDir));
- }
-
- /**
- * @test
- */
- public function shouldConvertAbsolutePathIfAbsolutePathGiven()
- {
- $rootDir = '/path/to/dir';
- $path = __DIR__;
-
- $expected = $path;
-
- $this->assertEquals($expected, $this->object->toAbsolutePath($path, $rootDir));
- }
-
- // getRealPath()
-
- /**
- * @test
- */
- public function shouldNotBeRealPath()
- {
- $path = false;
- $rootDir = __DIR__;
-
- $this->assertFalse($this->object->getRealPath($path, $rootDir));
- }
-
- /**
- * @test
- * @dataProvider provideRelativePaths
- */
- public function shouldGetRealPathIfRelativePathGiven($path)
- {
- $rootDir = __DIR__;
-
- $expected = realpath($rootDir . DIRECTORY_SEPARATOR . $path);
-
- $this->assertEquals($expected, $this->object->getRealPath($path, $rootDir));
- }
-
- /**
- * @test
- */
- public function shouldGetRealPathIfAbsolutePathGiven()
- {
- $path = __DIR__;
- $rootDir = '';
-
- $expected = realpath($path);
-
- $this->assertEquals($expected, $this->object->getRealPath($path, $rootDir));
- }
-
- // getRealDir()
-
- /**
- * @test
- */
- public function shouldNotBeRealDir()
- {
- $path = false;
- $rootDir = __DIR__;
-
- $this->assertFalse($this->object->getRealDir($path, $rootDir));
- }
-
- /**
- * @test
- */
- public function shouldGetRealDirIfRelativePathGiven()
- {
- $path = '';
- $rootDir = __DIR__;
-
- $expected = realpath($rootDir . DIRECTORY_SEPARATOR . $path);
-
- $this->assertEquals($expected, $this->object->getRealDir($path, $rootDir));
- }
-
- /**
- * @test
- */
- public function shouldGetRealDirIfAbsolutePathGiven()
- {
- $path = __DIR__;
- $rootDir = '';
-
- $expected = realpath($path . '/..');
-
- $this->assertEquals($expected, $this->object->getRealDir($path, $rootDir));
- }
-
- // getRealWritingFilePath()
-
- /**
- * @test
- */
- public function shouldNotBeRealWritingFilePath()
- {
- $path = false;
- $rootDir = __DIR__;
-
- $this->assertFalse($this->object->getRealWritingFilePath($path, $rootDir));
- }
-
- /**
- * @test
- */
- public function shouldGetRealWritingPathIfRelativePathGiven()
- {
- $path = 'test.txt';
- $rootDir = __DIR__;
-
- $expected = $rootDir . DIRECTORY_SEPARATOR . $path;
-
- $this->assertEquals($expected, $this->object->getRealWritingFilePath($path, $rootDir));
- }
-
- // isRealPathExist()
-
- /**
- * @test
- */
- public function shouldNotExistRealPathIfFalseGiven()
- {
- $path = false;
-
- $this->assertFalse($this->object->isRealPathExist($path));
- }
-
- /**
- * @test
- */
- public function shouldNotExistRealPath()
- {
- $path = __DIR__ . '/dummy.dir';
-
- $this->assertFalse($this->object->isRealPathExist($path));
- }
-
- /**
- * @test
- */
- public function shouldExistRealPath()
- {
- touch($this->existingFile);
-
- $this->assertTrue($this->object->isRealPathExist($this->existingFile));
- }
-
- // isRealFileExist()
-
- /**
- * @test
- */
- public function shouldNotExistRealFile()
- {
- $path = __DIR__ . '/dummy.file';
-
- $this->assertFalse($this->object->isRealFileExist($path));
- }
-
- /**
- * @test
- */
- public function shouldNotExistRealFileIfDirGiven()
- {
- $path = __DIR__;
-
- $this->assertFalse($this->object->isRealFileExist($path));
- }
-
- /**
- * @test
- */
- public function shouldExistRealFile()
- {
- touch($this->existingFile);
-
- $this->assertTrue($this->object->isRealFileExist($this->existingFile));
- }
-
- // isRealFileReadable()
-
- /**
- * @test
- */
- public function shouldNotBeRealFileReadableIfFileNotFound()
- {
- $path = __DIR__ . '/dummy.file';
-
- $this->assertFalse($this->object->isRealFileReadable($path));
- }
-
- /**
- * @test
- */
- public function shouldNotBeRealFileReadableIFFileUnreadable()
- {
- $this->touchUnreadableFile();
-
- $this->assertFalse($this->object->isRealFileReadable($this->unreadablePath));
- }
-
- /**
- * @test
- */
- public function shouldBeRealFileReadable()
- {
- touch($this->existingFile);
-
- $this->assertTrue($this->object->isRealFileReadable($this->existingFile));
- }
-
- // isRealFileWritable()
-
- /**
- * @test
- */
- public function shouldNotBeRealFileWritableIfFileNotFound()
- {
- $path = __DIR__ . '/dummy.file';
-
- $this->assertFalse($this->object->isRealFileWritable($path));
- }
-
- /**
- * @test
- */
- public function shouldNotBeRealFileWritableIfFileUnwritable()
- {
- $this->touchUnwritableFile();
-
- $this->assertFalse($this->object->isRealFileWritable($this->unwritablePath));
- }
-
- /**
- * @test
- */
- public function shouldBeRealFileWritable()
- {
- touch($this->existingFile);
-
- $this->assertTrue($this->object->isRealFileWritable($this->existingFile));
- }
-
- // isRealDirExist()
-
- /**
- * @test
- */
- public function shouldNotExistRealDir()
- {
- $path = __DIR__ . '/dummy.dir';
-
- $this->assertFalse($this->object->isRealDirExist($path));
- }
-
- /**
- * @test
- */
- public function shouldNotExistRealDirIfFileGiven()
- {
- touch($this->existingFile);
-
-
- $this->assertFalse($this->object->isRealDirExist($this->existingFile));
- }
-
- /**
- * @test
- */
- public function shouldExistRealDir()
- {
- $path = __DIR__;
-
- $this->assertTrue($this->object->isRealDirExist($path));
- }
-
- // isRealDirWritable()
-
- /**
- * @test
- */
- public function shouldNotBeRealDirWritableIfDirNotFound()
- {
- $path = __DIR__ . '/dummy.dir';
-
- $this->assertFalse($this->object->isRealDirWritable($path));
- }
-
- /**
- * @test
- */
- public function shouldNotBeRealDirWritableIfDirUnwritable()
- {
- $this->mkdirUnwritableDir();
-
- $this->assertFalse($this->object->isRealDirWritable($this->unwritableDir));
- }
-
- /**
- * @test
- */
- public function shouldBeRealDirWritable()
- {
- $path = __DIR__;
-
- $this->assertTrue($this->object->isRealDirWritable($path));
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Component/Log/ConsoleLoggerTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Component/Log/ConsoleLoggerTest.php
deleted file mode 100644
index d3817ad..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Component/Log/ConsoleLoggerTest.php
+++ /dev/null
@@ -1,38 +0,0 @@
-
- */
-class ConsoleLoggerTest extends \PHPUnit_Framework_TestCase
-{
- protected function createAdapterMockWith($message)
- {
- $mock = $this->getMockBuilder('Symfony\Component\Console\Output\StreamOutput')
- ->disableOriginalConstructor()
- ->setMethods(array('writeln'))
- ->getMock();
-
- $mock
- ->expects($this->once())
- ->method('writeln')
- ->with($this->equalTo($message));
-
- return $mock;
- }
-
- /**
- * @test
- */
- public function shouldWritelnToOutput()
- {
- $message = 'log test message';
- $output = $this->createAdapterMockWith($message);
-
- $object = new ConsoleLogger($output);
-
- $object->log('info', $message);
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Component/System/Git/GitCommandTest.php b/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Component/System/Git/GitCommandTest.php
deleted file mode 100644
index df67982..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/Contrib/Component/System/Git/GitCommandTest.php
+++ /dev/null
@@ -1,142 +0,0 @@
-
- */
-class GitCommandTest extends \PHPUnit_Framework_TestCase
-{
- protected function createGitCommandMock($params)
- {
- $class = 'Contrib\Component\System\Git\GitCommand';
- $adapter = $this->getMock($class, array('executeCommand'));
-
- $adapter
- ->expects($this->once())
- ->method('executeCommand')
- ->with($this->equalTo($params));
-
- return $adapter;
- }
-
- // getCommandPath()
-
- /**
- * @test
- */
- public function commandPathIsGit()
- {
- $object = new GitCommand();
-
- $expected = 'git';
-
- $this->assertEquals($expected, $object->getCommandPath());
- }
-
- // getBranches()
-
- /**
- * @test
- */
- public function getBranchesExecuteCommand()
- {
- $expected = 'git branch';
-
- $object = $this->createGitCommandMock($expected);
- $object->getBranches();
- }
-
- /**
- * @test
- */
- public function getBranches()
- {
- $object = new GitCommand();
- $actual = $object->getBranches();
-
- $this->assertTrue(is_array($actual));
- $this->assertNotEmpty($actual);
- }
-
- // getHeadCommit()
-
- /**
- * @test
- */
- public function getHeadCommitExecuteCommand()
- {
- $expected = "git log -1 --pretty=format:'%H\n%aN\n%ae\n%cN\n%ce\n%s'";
-
- $object = $this->createGitCommandMock($expected);
- $object->getHeadCommit();
- }
-
- /**
- * @test
- */
- public function getHeadCommit()
- {
- $object = new GitCommand();
- $actual = $object->getHeadCommit();
-
- $this->assertTrue(is_array($actual));
- $this->assertNotEmpty($actual);
- }
-
- // getRemotes()
-
- /**
- * @test
- */
- public function getRemotesExecuteCommand()
- {
- $expected = 'git remote -v';
-
- $object = $this->createGitCommandMock($expected);
- $object->getRemotes();
- }
-
- /**
- * @test
- */
- public function getRemotes()
- {
- $object = new GitCommand();
- $actual = $object->getRemotes();
-
- $this->assertTrue(is_array($actual));
- $this->assertNotEmpty($actual);
- }
-
- // execute()
-
- /**
- * @test
- * @expectedException RuntimeException
- */
- public function throwRuntimeExceptionIfExecutedWithoutArgs()
- {
- // `git` return 1 and cause RuntimeException
- $object = new GitCommand();
- $object->execute();
- }
-
- // createCommand()
-
- /**
- * @test
- */
- public function getCommandPath()
- {
- $object = new GitCommand();
- $object->setCommandPath('ls');
-
- $actual = $object->execute();
-
- $this->assertTrue(is_array($actual));
- $this->assertNotEmpty($actual);
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/prj/coveralls.yml b/lib/gerencianet/satooshi/php-coveralls/tests/prj/coveralls.yml
deleted file mode 100644
index 143b83f..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/prj/coveralls.yml
+++ /dev/null
@@ -1 +0,0 @@
-src_dir: files
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/prj/files/AbstractClass.php b/lib/gerencianet/satooshi/php-coveralls/tests/prj/files/AbstractClass.php
deleted file mode 100644
index 8b2292e..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/prj/files/AbstractClass.php
+++ /dev/null
@@ -1,6 +0,0 @@
-message = 'hoge';
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/tests/prj/files/test2.php b/lib/gerencianet/satooshi/php-coveralls/tests/prj/files/test2.php
deleted file mode 100644
index 156ad63..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/tests/prj/files/test2.php
+++ /dev/null
@@ -1,10 +0,0 @@
-message = 'hoge';
- }
-}
diff --git a/lib/gerencianet/satooshi/php-coveralls/travis.phpunit.xml b/lib/gerencianet/satooshi/php-coveralls/travis.phpunit.xml
deleted file mode 100644
index 662e96b..0000000
--- a/lib/gerencianet/satooshi/php-coveralls/travis.phpunit.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
- ./tests/
-
-
-
-
-
- ./src
-
- ./vendor
- ./tests
- ./travis
- ./composer
-
-
-
-
-
-
-
-
-
diff --git a/lib/gerencianet/symfony/config/.gitignore b/lib/gerencianet/symfony/config/.gitignore
deleted file mode 100644
index c49a5d8..0000000
--- a/lib/gerencianet/symfony/config/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-vendor/
-composer.lock
-phpunit.xml
diff --git a/lib/gerencianet/symfony/config/CHANGELOG.md b/lib/gerencianet/symfony/config/CHANGELOG.md
deleted file mode 100644
index b752df6..0000000
--- a/lib/gerencianet/symfony/config/CHANGELOG.md
+++ /dev/null
@@ -1,62 +0,0 @@
-CHANGELOG
-=========
-
-3.0.0
------
-
- * removed `ReferenceDumper` class
- * removed the `ResourceInterface::isFresh()` method
- * removed `BCResourceInterfaceChecker` class
- * removed `ResourceInterface::getResource()` method
-
-2.8.0
------
-
-The edge case of defining just one value for nodes of type Enum is now allowed:
-
-```php
-$rootNode
- ->children()
- ->enumNode('variable')
- ->values(array('value'))
- ->end()
- ->end()
-;
-```
-
-Before: `InvalidArgumentException` (variable must contain at least two
-distinct elements).
-After: the code will work as expected and it will restrict the values of the
-`variable` option to just `value`.
-
- * deprecated the `ResourceInterface::isFresh()` method. If you implement custom resource types and they
- can be validated that way, make them implement the new `SelfCheckingResourceInterface`.
- * deprecated the getResource() method in ResourceInterface. You can still call this method
- on concrete classes implementing the interface, but it does not make sense at the interface
- level as you need to know about the particular type of resource at hand to understand the
- semantics of the returned value.
-
-2.7.0
------
-
- * added `ConfigCacheInterface`, `ConfigCacheFactoryInterface` and a basic `ConfigCacheFactory`
- implementation to delegate creation of ConfigCache instances
-
-2.2.0
------
-
- * added `ArrayNodeDefinition::canBeEnabled()` and `ArrayNodeDefinition::canBeDisabled()`
- to ease configuration when some sections are respectively disabled / enabled
- by default.
- * added a `normalizeKeys()` method for array nodes (to avoid key normalization)
- * added numerical type handling for config definitions
- * added convenience methods for optional configuration sections to `ArrayNodeDefinition`
- * added a utils class for XML manipulations
-
-2.1.0
------
-
- * added a way to add documentation on configuration
- * implemented `Serializable` on resources
- * `LoaderResolverInterface` is now used instead of `LoaderResolver` for type
- hinting
diff --git a/lib/gerencianet/symfony/config/ConfigCache.php b/lib/gerencianet/symfony/config/ConfigCache.php
deleted file mode 100644
index 8318684..0000000
--- a/lib/gerencianet/symfony/config/ConfigCache.php
+++ /dev/null
@@ -1,58 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config;
-
-use Symfony\Component\Config\Resource\SelfCheckingResourceChecker;
-
-/**
- * ConfigCache caches arbitrary content in files on disk.
- *
- * When in debug mode, those metadata resources that implement
- * \Symfony\Component\Config\Resource\SelfCheckingResourceInterface will
- * be used to check cache freshness.
- *
- * @author Fabien Potencier
- * @author Matthias Pigulla
- */
-class ConfigCache extends ResourceCheckerConfigCache
-{
- private $debug;
-
- /**
- * @param string $file The absolute cache path
- * @param bool $debug Whether debugging is enabled or not
- */
- public function __construct($file, $debug)
- {
- parent::__construct($file, array(
- new SelfCheckingResourceChecker(),
- ));
- $this->debug = (bool) $debug;
- }
-
- /**
- * Checks if the cache is still fresh.
- *
- * This implementation always returns true when debug is off and the
- * cache file exists.
- *
- * @return bool true if the cache is fresh, false otherwise
- */
- public function isFresh()
- {
- if (!$this->debug && is_file($this->getPath())) {
- return true;
- }
-
- return parent::isFresh();
- }
-}
diff --git a/lib/gerencianet/symfony/config/ConfigCacheFactory.php b/lib/gerencianet/symfony/config/ConfigCacheFactory.php
deleted file mode 100644
index 396536e..0000000
--- a/lib/gerencianet/symfony/config/ConfigCacheFactory.php
+++ /dev/null
@@ -1,54 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config;
-
-/**
- * Basic implementation of ConfigCacheFactoryInterface that
- * creates an instance of the default ConfigCache.
- *
- * This factory and/or cache do not support cache validation
- * by means of ResourceChecker instances (that is, service-based).
- *
- * @author Matthias Pigulla
- */
-class ConfigCacheFactory implements ConfigCacheFactoryInterface
-{
- /**
- * @var bool Debug flag passed to the ConfigCache
- */
- private $debug;
-
- /**
- * @param bool $debug The debug flag to pass to ConfigCache
- */
- public function __construct($debug)
- {
- $this->debug = $debug;
- }
-
- /**
- * {@inheritdoc}
- */
- public function cache($file, $callback)
- {
- if (!is_callable($callback)) {
- throw new \InvalidArgumentException(sprintf('Invalid type for callback argument. Expected callable, but got "%s".', gettype($callback)));
- }
-
- $cache = new ConfigCache($file, $this->debug);
- if (!$cache->isFresh()) {
- call_user_func($callback, $cache);
- }
-
- return $cache;
- }
-}
diff --git a/lib/gerencianet/symfony/config/ConfigCacheFactoryInterface.php b/lib/gerencianet/symfony/config/ConfigCacheFactoryInterface.php
deleted file mode 100644
index bd614c4..0000000
--- a/lib/gerencianet/symfony/config/ConfigCacheFactoryInterface.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config;
-
-/**
- * Interface for a ConfigCache factory. This factory creates
- * an instance of ConfigCacheInterface and initializes the
- * cache if necessary.
- *
- * @author Matthias Pigulla
- */
-interface ConfigCacheFactoryInterface
-{
- /**
- * Creates a cache instance and (re-)initializes it if necessary.
- *
- * @param string $file The absolute cache file path
- * @param callable $callable The callable to be executed when the cache needs to be filled (i. e. is not fresh). The cache will be passed as the only parameter to this callback
- *
- * @return ConfigCacheInterface $configCache The cache instance
- */
- public function cache($file, $callable);
-}
diff --git a/lib/gerencianet/symfony/config/ConfigCacheInterface.php b/lib/gerencianet/symfony/config/ConfigCacheInterface.php
deleted file mode 100644
index e367ad1..0000000
--- a/lib/gerencianet/symfony/config/ConfigCacheInterface.php
+++ /dev/null
@@ -1,49 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config;
-
-use Symfony\Component\Config\Resource\ResourceInterface;
-
-/**
- * Interface for ConfigCache.
- *
- * @author Matthias Pigulla
- */
-interface ConfigCacheInterface
-{
- /**
- * Gets the cache file path.
- *
- * @return string The cache file path
- */
- public function getPath();
-
- /**
- * Checks if the cache is still fresh.
- *
- * This check should take the metadata passed to the write() method into consideration.
- *
- * @return bool Whether the cache is still fresh.
- */
- public function isFresh();
-
- /**
- * Writes the given content into the cache file. Metadata will be stored
- * independently and can be used to check cache freshness at a later time.
- *
- * @param string $content The content to write into the cache
- * @param ResourceInterface[]|null $metadata An array of ResourceInterface instances
- *
- * @throws \RuntimeException When the cache file cannot be written
- */
- public function write($content, array $metadata = null);
-}
diff --git a/lib/gerencianet/symfony/config/Definition/ArrayNode.php b/lib/gerencianet/symfony/config/Definition/ArrayNode.php
deleted file mode 100644
index 166db67..0000000
--- a/lib/gerencianet/symfony/config/Definition/ArrayNode.php
+++ /dev/null
@@ -1,399 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition;
-
-use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
-use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
-use Symfony\Component\Config\Definition\Exception\UnsetKeyException;
-
-/**
- * Represents an Array node in the config tree.
- *
- * @author Johannes M. Schmitt
- */
-class ArrayNode extends BaseNode implements PrototypeNodeInterface
-{
- protected $xmlRemappings = array();
- protected $children = array();
- protected $allowFalse = false;
- protected $allowNewKeys = true;
- protected $addIfNotSet = false;
- protected $performDeepMerging = true;
- protected $ignoreExtraKeys = false;
- protected $removeExtraKeys = true;
- protected $normalizeKeys = true;
-
- public function setNormalizeKeys($normalizeKeys)
- {
- $this->normalizeKeys = (bool) $normalizeKeys;
- }
-
- /**
- * Normalizes keys between the different configuration formats.
- *
- * Namely, you mostly have foo_bar in YAML while you have foo-bar in XML.
- * After running this method, all keys are normalized to foo_bar.
- *
- * If you have a mixed key like foo-bar_moo, it will not be altered.
- * The key will also not be altered if the target key already exists.
- *
- * @param mixed $value
- *
- * @return array The value with normalized keys
- */
- protected function preNormalize($value)
- {
- if (!$this->normalizeKeys || !is_array($value)) {
- return $value;
- }
-
- $normalized = array();
-
- foreach ($value as $k => $v) {
- if (false !== strpos($k, '-') && false === strpos($k, '_') && !array_key_exists($normalizedKey = str_replace('-', '_', $k), $value)) {
- $normalized[$normalizedKey] = $v;
- } else {
- $normalized[$k] = $v;
- }
- }
-
- return $normalized;
- }
-
- /**
- * Retrieves the children of this node.
- *
- * @return array The children
- */
- public function getChildren()
- {
- return $this->children;
- }
-
- /**
- * Sets the xml remappings that should be performed.
- *
- * @param array $remappings an array of the form array(array(string, string))
- */
- public function setXmlRemappings(array $remappings)
- {
- $this->xmlRemappings = $remappings;
- }
-
- /**
- * Gets the xml remappings that should be performed.
- *
- * @return array $remappings an array of the form array(array(string, string))
- */
- public function getXmlRemappings()
- {
- return $this->xmlRemappings;
- }
-
- /**
- * Sets whether to add default values for this array if it has not been
- * defined in any of the configuration files.
- *
- * @param bool $boolean
- */
- public function setAddIfNotSet($boolean)
- {
- $this->addIfNotSet = (bool) $boolean;
- }
-
- /**
- * Sets whether false is allowed as value indicating that the array should be unset.
- *
- * @param bool $allow
- */
- public function setAllowFalse($allow)
- {
- $this->allowFalse = (bool) $allow;
- }
-
- /**
- * Sets whether new keys can be defined in subsequent configurations.
- *
- * @param bool $allow
- */
- public function setAllowNewKeys($allow)
- {
- $this->allowNewKeys = (bool) $allow;
- }
-
- /**
- * Sets if deep merging should occur.
- *
- * @param bool $boolean
- */
- public function setPerformDeepMerging($boolean)
- {
- $this->performDeepMerging = (bool) $boolean;
- }
-
- /**
- * Whether extra keys should just be ignore without an exception.
- *
- * @param bool $boolean To allow extra keys
- * @param bool $remove To remove extra keys
- */
- public function setIgnoreExtraKeys($boolean, $remove = true)
- {
- $this->ignoreExtraKeys = (bool) $boolean;
- $this->removeExtraKeys = $this->ignoreExtraKeys && $remove;
- }
-
- /**
- * Sets the node Name.
- *
- * @param string $name The node's name
- */
- public function setName($name)
- {
- $this->name = $name;
- }
-
- /**
- * Checks if the node has a default value.
- *
- * @return bool
- */
- public function hasDefaultValue()
- {
- return $this->addIfNotSet;
- }
-
- /**
- * Retrieves the default value.
- *
- * @return array The default value
- *
- * @throws \RuntimeException if the node has no default value
- */
- public function getDefaultValue()
- {
- if (!$this->hasDefaultValue()) {
- throw new \RuntimeException(sprintf('The node at path "%s" has no default value.', $this->getPath()));
- }
-
- $defaults = array();
- foreach ($this->children as $name => $child) {
- if ($child->hasDefaultValue()) {
- $defaults[$name] = $child->getDefaultValue();
- }
- }
-
- return $defaults;
- }
-
- /**
- * Adds a child node.
- *
- * @param NodeInterface $node The child node to add
- *
- * @throws \InvalidArgumentException when the child node has no name
- * @throws \InvalidArgumentException when the child node's name is not unique
- */
- public function addChild(NodeInterface $node)
- {
- $name = $node->getName();
- if (!strlen($name)) {
- throw new \InvalidArgumentException('Child nodes must be named.');
- }
- if (isset($this->children[$name])) {
- throw new \InvalidArgumentException(sprintf('A child node named "%s" already exists.', $name));
- }
-
- $this->children[$name] = $node;
- }
-
- /**
- * Finalizes the value of this node.
- *
- * @param mixed $value
- *
- * @return mixed The finalised value
- *
- * @throws UnsetKeyException
- * @throws InvalidConfigurationException if the node doesn't have enough children
- */
- protected function finalizeValue($value)
- {
- if (false === $value) {
- $msg = sprintf('Unsetting key for path "%s", value: %s', $this->getPath(), json_encode($value));
- throw new UnsetKeyException($msg);
- }
-
- foreach ($this->children as $name => $child) {
- if (!array_key_exists($name, $value)) {
- if ($child->isRequired()) {
- $msg = sprintf('The child node "%s" at path "%s" must be configured.', $name, $this->getPath());
- $ex = new InvalidConfigurationException($msg);
- $ex->setPath($this->getPath());
-
- throw $ex;
- }
-
- if ($child->hasDefaultValue()) {
- $value[$name] = $child->getDefaultValue();
- }
-
- continue;
- }
-
- try {
- $value[$name] = $child->finalize($value[$name]);
- } catch (UnsetKeyException $e) {
- unset($value[$name]);
- }
- }
-
- return $value;
- }
-
- /**
- * Validates the type of the value.
- *
- * @param mixed $value
- *
- * @throws InvalidTypeException
- */
- protected function validateType($value)
- {
- if (!is_array($value) && (!$this->allowFalse || false !== $value)) {
- $ex = new InvalidTypeException(sprintf(
- 'Invalid type for path "%s". Expected array, but got %s',
- $this->getPath(),
- gettype($value)
- ));
- if ($hint = $this->getInfo()) {
- $ex->addHint($hint);
- }
- $ex->setPath($this->getPath());
-
- throw $ex;
- }
- }
-
- /**
- * Normalizes the value.
- *
- * @param mixed $value The value to normalize
- *
- * @return mixed The normalized value
- *
- * @throws InvalidConfigurationException
- */
- protected function normalizeValue($value)
- {
- if (false === $value) {
- return $value;
- }
-
- $value = $this->remapXml($value);
-
- $normalized = array();
- foreach ($value as $name => $val) {
- if (isset($this->children[$name])) {
- $normalized[$name] = $this->children[$name]->normalize($val);
- unset($value[$name]);
- } elseif (!$this->removeExtraKeys) {
- $normalized[$name] = $val;
- }
- }
-
- // if extra fields are present, throw exception
- if (count($value) && !$this->ignoreExtraKeys) {
- $msg = sprintf('Unrecognized option%s "%s" under "%s"', 1 === count($value) ? '' : 's', implode(', ', array_keys($value)), $this->getPath());
- $ex = new InvalidConfigurationException($msg);
- $ex->setPath($this->getPath());
-
- throw $ex;
- }
-
- return $normalized;
- }
-
- /**
- * Remaps multiple singular values to a single plural value.
- *
- * @param array $value The source values
- *
- * @return array The remapped values
- */
- protected function remapXml($value)
- {
- foreach ($this->xmlRemappings as list($singular, $plural)) {
- if (!isset($value[$singular])) {
- continue;
- }
-
- $value[$plural] = Processor::normalizeConfig($value, $singular, $plural);
- unset($value[$singular]);
- }
-
- return $value;
- }
-
- /**
- * Merges values together.
- *
- * @param mixed $leftSide The left side to merge.
- * @param mixed $rightSide The right side to merge.
- *
- * @return mixed The merged values
- *
- * @throws InvalidConfigurationException
- * @throws \RuntimeException
- */
- protected function mergeValues($leftSide, $rightSide)
- {
- if (false === $rightSide) {
- // if this is still false after the last config has been merged the
- // finalization pass will take care of removing this key entirely
- return false;
- }
-
- if (false === $leftSide || !$this->performDeepMerging) {
- return $rightSide;
- }
-
- foreach ($rightSide as $k => $v) {
- // no conflict
- if (!array_key_exists($k, $leftSide)) {
- if (!$this->allowNewKeys) {
- $ex = new InvalidConfigurationException(sprintf(
- 'You are not allowed to define new elements for path "%s". '
- .'Please define all elements for this path in one config file. '
- .'If you are trying to overwrite an element, make sure you redefine it '
- .'with the same name.',
- $this->getPath()
- ));
- $ex->setPath($this->getPath());
-
- throw $ex;
- }
-
- $leftSide[$k] = $v;
- continue;
- }
-
- if (!isset($this->children[$k])) {
- throw new \RuntimeException('merge() expects a normalized config array.');
- }
-
- $leftSide[$k] = $this->children[$k]->merge($leftSide[$k], $v);
- }
-
- return $leftSide;
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/BaseNode.php b/lib/gerencianet/symfony/config/Definition/BaseNode.php
deleted file mode 100644
index fc3e012..0000000
--- a/lib/gerencianet/symfony/config/Definition/BaseNode.php
+++ /dev/null
@@ -1,356 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition;
-
-use Symfony\Component\Config\Definition\Exception\Exception;
-use Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException;
-use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
-use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
-
-/**
- * The base node class.
- *
- * @author Johannes M. Schmitt
- */
-abstract class BaseNode implements NodeInterface
-{
- protected $name;
- protected $parent;
- protected $normalizationClosures = array();
- protected $finalValidationClosures = array();
- protected $allowOverwrite = true;
- protected $required = false;
- protected $equivalentValues = array();
- protected $attributes = array();
-
- /**
- * Constructor.
- *
- * @param string $name The name of the node
- * @param NodeInterface $parent The parent of this node
- *
- * @throws \InvalidArgumentException if the name contains a period.
- */
- public function __construct($name, NodeInterface $parent = null)
- {
- if (false !== strpos($name, '.')) {
- throw new \InvalidArgumentException('The name must not contain ".".');
- }
-
- $this->name = $name;
- $this->parent = $parent;
- }
-
- public function setAttribute($key, $value)
- {
- $this->attributes[$key] = $value;
- }
-
- public function getAttribute($key, $default = null)
- {
- return isset($this->attributes[$key]) ? $this->attributes[$key] : $default;
- }
-
- public function hasAttribute($key)
- {
- return isset($this->attributes[$key]);
- }
-
- public function getAttributes()
- {
- return $this->attributes;
- }
-
- public function setAttributes(array $attributes)
- {
- $this->attributes = $attributes;
- }
-
- public function removeAttribute($key)
- {
- unset($this->attributes[$key]);
- }
-
- /**
- * Sets an info message.
- *
- * @param string $info
- */
- public function setInfo($info)
- {
- $this->setAttribute('info', $info);
- }
-
- /**
- * Returns info message.
- *
- * @return string The info text
- */
- public function getInfo()
- {
- return $this->getAttribute('info');
- }
-
- /**
- * Sets the example configuration for this node.
- *
- * @param string|array $example
- */
- public function setExample($example)
- {
- $this->setAttribute('example', $example);
- }
-
- /**
- * Retrieves the example configuration for this node.
- *
- * @return string|array The example
- */
- public function getExample()
- {
- return $this->getAttribute('example');
- }
-
- /**
- * Adds an equivalent value.
- *
- * @param mixed $originalValue
- * @param mixed $equivalentValue
- */
- public function addEquivalentValue($originalValue, $equivalentValue)
- {
- $this->equivalentValues[] = array($originalValue, $equivalentValue);
- }
-
- /**
- * Set this node as required.
- *
- * @param bool $boolean Required node
- */
- public function setRequired($boolean)
- {
- $this->required = (bool) $boolean;
- }
-
- /**
- * Sets if this node can be overridden.
- *
- * @param bool $allow
- */
- public function setAllowOverwrite($allow)
- {
- $this->allowOverwrite = (bool) $allow;
- }
-
- /**
- * Sets the closures used for normalization.
- *
- * @param \Closure[] $closures An array of Closures used for normalization
- */
- public function setNormalizationClosures(array $closures)
- {
- $this->normalizationClosures = $closures;
- }
-
- /**
- * Sets the closures used for final validation.
- *
- * @param \Closure[] $closures An array of Closures used for final validation
- */
- public function setFinalValidationClosures(array $closures)
- {
- $this->finalValidationClosures = $closures;
- }
-
- /**
- * Checks if this node is required.
- *
- * @return bool
- */
- public function isRequired()
- {
- return $this->required;
- }
-
- /**
- * Returns the name of this node.
- *
- * @return string The Node's name.
- */
- public function getName()
- {
- return $this->name;
- }
-
- /**
- * Retrieves the path of this node.
- *
- * @return string The Node's path
- */
- public function getPath()
- {
- $path = $this->name;
-
- if (null !== $this->parent) {
- $path = $this->parent->getPath().'.'.$path;
- }
-
- return $path;
- }
-
- /**
- * Merges two values together.
- *
- * @param mixed $leftSide
- * @param mixed $rightSide
- *
- * @return mixed The merged value
- *
- * @throws ForbiddenOverwriteException
- */
- final public function merge($leftSide, $rightSide)
- {
- if (!$this->allowOverwrite) {
- throw new ForbiddenOverwriteException(sprintf(
- 'Configuration path "%s" cannot be overwritten. You have to '
- .'define all options for this path, and any of its sub-paths in '
- .'one configuration section.',
- $this->getPath()
- ));
- }
-
- $this->validateType($leftSide);
- $this->validateType($rightSide);
-
- return $this->mergeValues($leftSide, $rightSide);
- }
-
- /**
- * Normalizes a value, applying all normalization closures.
- *
- * @param mixed $value Value to normalize.
- *
- * @return mixed The normalized value.
- */
- final public function normalize($value)
- {
- $value = $this->preNormalize($value);
-
- // run custom normalization closures
- foreach ($this->normalizationClosures as $closure) {
- $value = $closure($value);
- }
-
- // replace value with their equivalent
- foreach ($this->equivalentValues as $data) {
- if ($data[0] === $value) {
- $value = $data[1];
- }
- }
-
- // validate type
- $this->validateType($value);
-
- // normalize value
- return $this->normalizeValue($value);
- }
-
- /**
- * Normalizes the value before any other normalization is applied.
- *
- * @param $value
- *
- * @return $value The normalized array value
- */
- protected function preNormalize($value)
- {
- return $value;
- }
-
- /**
- * Returns parent node for this node.
- *
- * @return NodeInterface|null
- */
- public function getParent()
- {
- return $this->parent;
- }
-
- /**
- * Finalizes a value, applying all finalization closures.
- *
- * @param mixed $value The value to finalize
- *
- * @return mixed The finalized value
- *
- * @throws Exception
- * @throws InvalidConfigurationException
- */
- final public function finalize($value)
- {
- $this->validateType($value);
-
- $value = $this->finalizeValue($value);
-
- // Perform validation on the final value if a closure has been set.
- // The closure is also allowed to return another value.
- foreach ($this->finalValidationClosures as $closure) {
- try {
- $value = $closure($value);
- } catch (Exception $e) {
- throw $e;
- } catch (\Exception $e) {
- throw new InvalidConfigurationException(sprintf('Invalid configuration for path "%s": %s', $this->getPath(), $e->getMessage()), $e->getCode(), $e);
- }
- }
-
- return $value;
- }
-
- /**
- * Validates the type of a Node.
- *
- * @param mixed $value The value to validate
- *
- * @throws InvalidTypeException when the value is invalid
- */
- abstract protected function validateType($value);
-
- /**
- * Normalizes the value.
- *
- * @param mixed $value The value to normalize.
- *
- * @return mixed The normalized value
- */
- abstract protected function normalizeValue($value);
-
- /**
- * Merges two values together.
- *
- * @param mixed $leftSide
- * @param mixed $rightSide
- *
- * @return mixed The merged value
- */
- abstract protected function mergeValues($leftSide, $rightSide);
-
- /**
- * Finalizes a value.
- *
- * @param mixed $value The value to finalize
- *
- * @return mixed The finalized value
- */
- abstract protected function finalizeValue($value);
-}
diff --git a/lib/gerencianet/symfony/config/Definition/BooleanNode.php b/lib/gerencianet/symfony/config/Definition/BooleanNode.php
deleted file mode 100644
index 08e1a77..0000000
--- a/lib/gerencianet/symfony/config/Definition/BooleanNode.php
+++ /dev/null
@@ -1,51 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition;
-
-use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
-
-/**
- * This node represents a Boolean value in the config tree.
- *
- * @author Johannes M. Schmitt
- */
-class BooleanNode extends ScalarNode
-{
- /**
- * {@inheritdoc}
- */
- protected function validateType($value)
- {
- if (!is_bool($value)) {
- $ex = new InvalidTypeException(sprintf(
- 'Invalid type for path "%s". Expected boolean, but got %s.',
- $this->getPath(),
- gettype($value)
- ));
- if ($hint = $this->getInfo()) {
- $ex->addHint($hint);
- }
- $ex->setPath($this->getPath());
-
- throw $ex;
- }
- }
-
- /**
- * {@inheritdoc}
- */
- protected function isValueEmpty($value)
- {
- // a boolean value cannot be empty
- return false;
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/ArrayNodeDefinition.php b/lib/gerencianet/symfony/config/Definition/Builder/ArrayNodeDefinition.php
deleted file mode 100644
index fb34cfa..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/ArrayNodeDefinition.php
+++ /dev/null
@@ -1,493 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-use Symfony\Component\Config\Definition\ArrayNode;
-use Symfony\Component\Config\Definition\PrototypedArrayNode;
-use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException;
-
-/**
- * This class provides a fluent interface for defining an array node.
- *
- * @author Johannes M. Schmitt
- */
-class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinitionInterface
-{
- protected $performDeepMerging = true;
- protected $ignoreExtraKeys = false;
- protected $removeExtraKeys = true;
- protected $children = array();
- protected $prototype;
- protected $atLeastOne = false;
- protected $allowNewKeys = true;
- protected $key;
- protected $removeKeyItem;
- protected $addDefaults = false;
- protected $addDefaultChildren = false;
- protected $nodeBuilder;
- protected $normalizeKeys = true;
-
- /**
- * {@inheritdoc}
- */
- public function __construct($name, NodeParentInterface $parent = null)
- {
- parent::__construct($name, $parent);
-
- $this->nullEquivalent = array();
- $this->trueEquivalent = array();
- }
-
- /**
- * Sets a custom children builder.
- *
- * @param NodeBuilder $builder A custom NodeBuilder
- */
- public function setBuilder(NodeBuilder $builder)
- {
- $this->nodeBuilder = $builder;
- }
-
- /**
- * Returns a builder to add children nodes.
- *
- * @return NodeBuilder
- */
- public function children()
- {
- return $this->getNodeBuilder();
- }
-
- /**
- * Sets a prototype for child nodes.
- *
- * @param string $type the type of node
- *
- * @return NodeDefinition
- */
- public function prototype($type)
- {
- return $this->prototype = $this->getNodeBuilder()->node(null, $type)->setParent($this);
- }
-
- /**
- * Adds the default value if the node is not set in the configuration.
- *
- * This method is applicable to concrete nodes only (not to prototype nodes).
- * If this function has been called and the node is not set during the finalization
- * phase, it's default value will be derived from its children default values.
- *
- * @return ArrayNodeDefinition
- */
- public function addDefaultsIfNotSet()
- {
- $this->addDefaults = true;
-
- return $this;
- }
-
- /**
- * Adds children with a default value when none are defined.
- *
- * @param int|string|array|null $children The number of children|The child name|The children names to be added
- *
- * This method is applicable to prototype nodes only.
- *
- * @return ArrayNodeDefinition
- */
- public function addDefaultChildrenIfNoneSet($children = null)
- {
- $this->addDefaultChildren = $children;
-
- return $this;
- }
-
- /**
- * Requires the node to have at least one element.
- *
- * This method is applicable to prototype nodes only.
- *
- * @return ArrayNodeDefinition
- */
- public function requiresAtLeastOneElement()
- {
- $this->atLeastOne = true;
-
- return $this;
- }
-
- /**
- * Disallows adding news keys in a subsequent configuration.
- *
- * If used all keys have to be defined in the same configuration file.
- *
- * @return ArrayNodeDefinition
- */
- public function disallowNewKeysInSubsequentConfigs()
- {
- $this->allowNewKeys = false;
-
- return $this;
- }
-
- /**
- * Sets a normalization rule for XML configurations.
- *
- * @param string $singular The key to remap
- * @param string $plural The plural of the key for irregular plurals
- *
- * @return ArrayNodeDefinition
- */
- public function fixXmlConfig($singular, $plural = null)
- {
- $this->normalization()->remap($singular, $plural);
-
- return $this;
- }
-
- /**
- * Sets the attribute which value is to be used as key.
- *
- * This is useful when you have an indexed array that should be an
- * associative array. You can select an item from within the array
- * to be the key of the particular item. For example, if "id" is the
- * "key", then:
- *
- * array(
- * array('id' => 'my_name', 'foo' => 'bar'),
- * );
- *
- * becomes
- *
- * array(
- * 'my_name' => array('foo' => 'bar'),
- * );
- *
- * If you'd like "'id' => 'my_name'" to still be present in the resulting
- * array, then you can set the second argument of this method to false.
- *
- * This method is applicable to prototype nodes only.
- *
- * @param string $name The name of the key
- * @param bool $removeKeyItem Whether or not the key item should be removed.
- *
- * @return ArrayNodeDefinition
- */
- public function useAttributeAsKey($name, $removeKeyItem = true)
- {
- $this->key = $name;
- $this->removeKeyItem = $removeKeyItem;
-
- return $this;
- }
-
- /**
- * Sets whether the node can be unset.
- *
- * @param bool $allow
- *
- * @return ArrayNodeDefinition
- */
- public function canBeUnset($allow = true)
- {
- $this->merge()->allowUnset($allow);
-
- return $this;
- }
-
- /**
- * Adds an "enabled" boolean to enable the current section.
- *
- * By default, the section is disabled. If any configuration is specified then
- * the node will be automatically enabled:
- *
- * enableableArrayNode: {enabled: true, ...} # The config is enabled & default values get overridden
- * enableableArrayNode: ~ # The config is enabled & use the default values
- * enableableArrayNode: true # The config is enabled & use the default values
- * enableableArrayNode: {other: value, ...} # The config is enabled & default values get overridden
- * enableableArrayNode: {enabled: false, ...} # The config is disabled
- * enableableArrayNode: false # The config is disabled
- *
- * @return ArrayNodeDefinition
- */
- public function canBeEnabled()
- {
- $this
- ->addDefaultsIfNotSet()
- ->treatFalseLike(array('enabled' => false))
- ->treatTrueLike(array('enabled' => true))
- ->treatNullLike(array('enabled' => true))
- ->beforeNormalization()
- ->ifArray()
- ->then(function ($v) {
- $v['enabled'] = isset($v['enabled']) ? $v['enabled'] : true;
-
- return $v;
- })
- ->end()
- ->children()
- ->booleanNode('enabled')
- ->defaultFalse()
- ;
-
- return $this;
- }
-
- /**
- * Adds an "enabled" boolean to enable the current section.
- *
- * By default, the section is enabled.
- *
- * @return ArrayNodeDefinition
- */
- public function canBeDisabled()
- {
- $this
- ->addDefaultsIfNotSet()
- ->treatFalseLike(array('enabled' => false))
- ->treatTrueLike(array('enabled' => true))
- ->treatNullLike(array('enabled' => true))
- ->children()
- ->booleanNode('enabled')
- ->defaultTrue()
- ;
-
- return $this;
- }
-
- /**
- * Disables the deep merging of the node.
- *
- * @return ArrayNodeDefinition
- */
- public function performNoDeepMerging()
- {
- $this->performDeepMerging = false;
-
- return $this;
- }
-
- /**
- * Allows extra config keys to be specified under an array without
- * throwing an exception.
- *
- * Those config values are simply ignored and removed from the
- * resulting array. This should be used only in special cases where
- * you want to send an entire configuration array through a special
- * tree that processes only part of the array.
- *
- * @param bool $remove Whether to remove the extra keys
- *
- * @return ArrayNodeDefinition
- */
- public function ignoreExtraKeys($remove = true)
- {
- $this->ignoreExtraKeys = true;
- $this->removeExtraKeys = $remove;
-
- return $this;
- }
-
- /**
- * Sets key normalization.
- *
- * @param bool $bool Whether to enable key normalization
- *
- * @return ArrayNodeDefinition
- */
- public function normalizeKeys($bool)
- {
- $this->normalizeKeys = (bool) $bool;
-
- return $this;
- }
-
- /**
- * Appends a node definition.
- *
- * $node = new ArrayNodeDefinition()
- * ->children()
- * ->scalarNode('foo')->end()
- * ->scalarNode('baz')->end()
- * ->end()
- * ->append($this->getBarNodeDefinition())
- * ;
- *
- * @param NodeDefinition $node A NodeDefinition instance
- *
- * @return ArrayNodeDefinition This node
- */
- public function append(NodeDefinition $node)
- {
- $this->children[$node->name] = $node->setParent($this);
-
- return $this;
- }
-
- /**
- * Returns a node builder to be used to add children and prototype.
- *
- * @return NodeBuilder The node builder
- */
- protected function getNodeBuilder()
- {
- if (null === $this->nodeBuilder) {
- $this->nodeBuilder = new NodeBuilder();
- }
-
- return $this->nodeBuilder->setParent($this);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function createNode()
- {
- if (null === $this->prototype) {
- $node = new ArrayNode($this->name, $this->parent);
-
- $this->validateConcreteNode($node);
-
- $node->setAddIfNotSet($this->addDefaults);
-
- foreach ($this->children as $child) {
- $child->parent = $node;
- $node->addChild($child->getNode());
- }
- } else {
- $node = new PrototypedArrayNode($this->name, $this->parent);
-
- $this->validatePrototypeNode($node);
-
- if (null !== $this->key) {
- $node->setKeyAttribute($this->key, $this->removeKeyItem);
- }
-
- if (true === $this->atLeastOne) {
- $node->setMinNumberOfElements(1);
- }
-
- if ($this->default) {
- $node->setDefaultValue($this->defaultValue);
- }
-
- if (false !== $this->addDefaultChildren) {
- $node->setAddChildrenIfNoneSet($this->addDefaultChildren);
- if ($this->prototype instanceof static && null === $this->prototype->prototype) {
- $this->prototype->addDefaultsIfNotSet();
- }
- }
-
- $this->prototype->parent = $node;
- $node->setPrototype($this->prototype->getNode());
- }
-
- $node->setAllowNewKeys($this->allowNewKeys);
- $node->addEquivalentValue(null, $this->nullEquivalent);
- $node->addEquivalentValue(true, $this->trueEquivalent);
- $node->addEquivalentValue(false, $this->falseEquivalent);
- $node->setPerformDeepMerging($this->performDeepMerging);
- $node->setRequired($this->required);
- $node->setIgnoreExtraKeys($this->ignoreExtraKeys, $this->removeExtraKeys);
- $node->setNormalizeKeys($this->normalizeKeys);
-
- if (null !== $this->normalization) {
- $node->setNormalizationClosures($this->normalization->before);
- $node->setXmlRemappings($this->normalization->remappings);
- }
-
- if (null !== $this->merge) {
- $node->setAllowOverwrite($this->merge->allowOverwrite);
- $node->setAllowFalse($this->merge->allowFalse);
- }
-
- if (null !== $this->validation) {
- $node->setFinalValidationClosures($this->validation->rules);
- }
-
- return $node;
- }
-
- /**
- * Validate the configuration of a concrete node.
- *
- * @param ArrayNode $node The related node
- *
- * @throws InvalidDefinitionException
- */
- protected function validateConcreteNode(ArrayNode $node)
- {
- $path = $node->getPath();
-
- if (null !== $this->key) {
- throw new InvalidDefinitionException(
- sprintf('->useAttributeAsKey() is not applicable to concrete nodes at path "%s"', $path)
- );
- }
-
- if (true === $this->atLeastOne) {
- throw new InvalidDefinitionException(
- sprintf('->requiresAtLeastOneElement() is not applicable to concrete nodes at path "%s"', $path)
- );
- }
-
- if ($this->default) {
- throw new InvalidDefinitionException(
- sprintf('->defaultValue() is not applicable to concrete nodes at path "%s"', $path)
- );
- }
-
- if (false !== $this->addDefaultChildren) {
- throw new InvalidDefinitionException(
- sprintf('->addDefaultChildrenIfNoneSet() is not applicable to concrete nodes at path "%s"', $path)
- );
- }
- }
-
- /**
- * Validate the configuration of a prototype node.
- *
- * @param PrototypedArrayNode $node The related node
- *
- * @throws InvalidDefinitionException
- */
- protected function validatePrototypeNode(PrototypedArrayNode $node)
- {
- $path = $node->getPath();
-
- if ($this->addDefaults) {
- throw new InvalidDefinitionException(
- sprintf('->addDefaultsIfNotSet() is not applicable to prototype nodes at path "%s"', $path)
- );
- }
-
- if (false !== $this->addDefaultChildren) {
- if ($this->default) {
- throw new InvalidDefinitionException(
- sprintf('A default value and default children might not be used together at path "%s"', $path)
- );
- }
-
- if (null !== $this->key && (null === $this->addDefaultChildren || is_int($this->addDefaultChildren) && $this->addDefaultChildren > 0)) {
- throw new InvalidDefinitionException(
- sprintf('->addDefaultChildrenIfNoneSet() should set default children names as ->useAttributeAsKey() is used at path "%s"', $path)
- );
- }
-
- if (null === $this->key && (is_string($this->addDefaultChildren) || is_array($this->addDefaultChildren))) {
- throw new InvalidDefinitionException(
- sprintf('->addDefaultChildrenIfNoneSet() might not set default children names as ->useAttributeAsKey() is not used at path "%s"', $path)
- );
- }
- }
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/BooleanNodeDefinition.php b/lib/gerencianet/symfony/config/Definition/Builder/BooleanNodeDefinition.php
deleted file mode 100644
index 28e5657..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/BooleanNodeDefinition.php
+++ /dev/null
@@ -1,53 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-use Symfony\Component\Config\Definition\BooleanNode;
-use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException;
-
-/**
- * This class provides a fluent interface for defining a node.
- *
- * @author Johannes M. Schmitt
- */
-class BooleanNodeDefinition extends ScalarNodeDefinition
-{
- /**
- * {@inheritdoc}
- */
- public function __construct($name, NodeParentInterface $parent = null)
- {
- parent::__construct($name, $parent);
-
- $this->nullEquivalent = true;
- }
-
- /**
- * Instantiate a Node.
- *
- * @return BooleanNode The node
- */
- protected function instantiateNode()
- {
- return new BooleanNode($this->name, $this->parent);
- }
-
- /**
- * {@inheritdoc}
- *
- * @throws InvalidDefinitionException
- */
- public function cannotBeEmpty()
- {
- throw new InvalidDefinitionException('->cannotBeEmpty() is not applicable to BooleanNodeDefinition.');
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/EnumNodeDefinition.php b/lib/gerencianet/symfony/config/Definition/Builder/EnumNodeDefinition.php
deleted file mode 100644
index 5d3ff01..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/EnumNodeDefinition.php
+++ /dev/null
@@ -1,58 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-use Symfony\Component\Config\Definition\EnumNode;
-
-/**
- * Enum Node Definition.
- *
- * @author Johannes M. Schmitt
- */
-class EnumNodeDefinition extends ScalarNodeDefinition
-{
- private $values;
-
- /**
- * @param array $values
- *
- * @return EnumNodeDefinition|$this
- */
- public function values(array $values)
- {
- $values = array_unique($values);
-
- if (empty($values)) {
- throw new \InvalidArgumentException('->values() must be called with at least one value.');
- }
-
- $this->values = $values;
-
- return $this;
- }
-
- /**
- * Instantiate a Node.
- *
- * @return EnumNode The node
- *
- * @throws \RuntimeException
- */
- protected function instantiateNode()
- {
- if (null === $this->values) {
- throw new \RuntimeException('You must call ->values() on enum nodes.');
- }
-
- return new EnumNode($this->name, $this->parent, $this->values);
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/ExprBuilder.php b/lib/gerencianet/symfony/config/Definition/Builder/ExprBuilder.php
deleted file mode 100644
index 3d79b29..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/ExprBuilder.php
+++ /dev/null
@@ -1,238 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-use Symfony\Component\Config\Definition\Exception\UnsetKeyException;
-
-/**
- * This class builds an if expression.
- *
- * @author Johannes M. Schmitt
- * @author Christophe Coevoet
- */
-class ExprBuilder
-{
- protected $node;
- public $ifPart;
- public $thenPart;
-
- /**
- * Constructor.
- *
- * @param NodeDefinition $node The related node
- */
- public function __construct(NodeDefinition $node)
- {
- $this->node = $node;
- }
-
- /**
- * Marks the expression as being always used.
- *
- * @param \Closure $then
- *
- * @return ExprBuilder
- */
- public function always(\Closure $then = null)
- {
- $this->ifPart = function ($v) { return true; };
-
- if (null !== $then) {
- $this->thenPart = $then;
- }
-
- return $this;
- }
-
- /**
- * Sets a closure to use as tests.
- *
- * The default one tests if the value is true.
- *
- * @param \Closure $closure
- *
- * @return ExprBuilder
- */
- public function ifTrue(\Closure $closure = null)
- {
- if (null === $closure) {
- $closure = function ($v) { return true === $v; };
- }
-
- $this->ifPart = $closure;
-
- return $this;
- }
-
- /**
- * Tests if the value is a string.
- *
- * @return ExprBuilder
- */
- public function ifString()
- {
- $this->ifPart = function ($v) { return is_string($v); };
-
- return $this;
- }
-
- /**
- * Tests if the value is null.
- *
- * @return ExprBuilder
- */
- public function ifNull()
- {
- $this->ifPart = function ($v) { return null === $v; };
-
- return $this;
- }
-
- /**
- * Tests if the value is an array.
- *
- * @return ExprBuilder
- */
- public function ifArray()
- {
- $this->ifPart = function ($v) { return is_array($v); };
-
- return $this;
- }
-
- /**
- * Tests if the value is in an array.
- *
- * @param array $array
- *
- * @return ExprBuilder
- */
- public function ifInArray(array $array)
- {
- $this->ifPart = function ($v) use ($array) { return in_array($v, $array, true); };
-
- return $this;
- }
-
- /**
- * Tests if the value is not in an array.
- *
- * @param array $array
- *
- * @return ExprBuilder
- */
- public function ifNotInArray(array $array)
- {
- $this->ifPart = function ($v) use ($array) { return !in_array($v, $array, true); };
-
- return $this;
- }
-
- /**
- * Sets the closure to run if the test pass.
- *
- * @param \Closure $closure
- *
- * @return ExprBuilder
- */
- public function then(\Closure $closure)
- {
- $this->thenPart = $closure;
-
- return $this;
- }
-
- /**
- * Sets a closure returning an empty array.
- *
- * @return ExprBuilder
- */
- public function thenEmptyArray()
- {
- $this->thenPart = function ($v) { return array(); };
-
- return $this;
- }
-
- /**
- * Sets a closure marking the value as invalid at validation time.
- *
- * if you want to add the value of the node in your message just use a %s placeholder.
- *
- * @param string $message
- *
- * @return ExprBuilder
- *
- * @throws \InvalidArgumentException
- */
- public function thenInvalid($message)
- {
- $this->thenPart = function ($v) use ($message) {throw new \InvalidArgumentException(sprintf($message, json_encode($v))); };
-
- return $this;
- }
-
- /**
- * Sets a closure unsetting this key of the array at validation time.
- *
- * @return ExprBuilder
- *
- * @throws UnsetKeyException
- */
- public function thenUnset()
- {
- $this->thenPart = function ($v) { throw new UnsetKeyException('Unsetting key'); };
-
- return $this;
- }
-
- /**
- * Returns the related node.
- *
- * @return NodeDefinition
- *
- * @throws \RuntimeException
- */
- public function end()
- {
- if (null === $this->ifPart) {
- throw new \RuntimeException('You must specify an if part.');
- }
- if (null === $this->thenPart) {
- throw new \RuntimeException('You must specify a then part.');
- }
-
- return $this->node;
- }
-
- /**
- * Builds the expressions.
- *
- * @param ExprBuilder[] $expressions An array of ExprBuilder instances to build
- *
- * @return array
- */
- public static function buildExpressions(array $expressions)
- {
- foreach ($expressions as $k => $expr) {
- if ($expr instanceof self) {
- $if = $expr->ifPart;
- $then = $expr->thenPart;
- $expressions[$k] = function ($v) use ($if, $then) {
- return $if($v) ? $then($v) : $v;
- };
- }
- }
-
- return $expressions;
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/FloatNodeDefinition.php b/lib/gerencianet/symfony/config/Definition/Builder/FloatNodeDefinition.php
deleted file mode 100644
index c0bed46..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/FloatNodeDefinition.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-use Symfony\Component\Config\Definition\FloatNode;
-
-/**
- * This class provides a fluent interface for defining a float node.
- *
- * @author Jeanmonod David
- */
-class FloatNodeDefinition extends NumericNodeDefinition
-{
- /**
- * Instantiates a Node.
- *
- * @return FloatNode The node
- */
- protected function instantiateNode()
- {
- return new FloatNode($this->name, $this->parent, $this->min, $this->max);
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/IntegerNodeDefinition.php b/lib/gerencianet/symfony/config/Definition/Builder/IntegerNodeDefinition.php
deleted file mode 100644
index f6c3c14..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/IntegerNodeDefinition.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-use Symfony\Component\Config\Definition\IntegerNode;
-
-/**
- * This class provides a fluent interface for defining an integer node.
- *
- * @author Jeanmonod David
- */
-class IntegerNodeDefinition extends NumericNodeDefinition
-{
- /**
- * Instantiates a Node.
- *
- * @return IntegerNode The node
- */
- protected function instantiateNode()
- {
- return new IntegerNode($this->name, $this->parent, $this->min, $this->max);
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/MergeBuilder.php b/lib/gerencianet/symfony/config/Definition/Builder/MergeBuilder.php
deleted file mode 100644
index f908a49..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/MergeBuilder.php
+++ /dev/null
@@ -1,72 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-/**
- * This class builds merge conditions.
- *
- * @author Johannes M. Schmitt
- */
-class MergeBuilder
-{
- protected $node;
- public $allowFalse = false;
- public $allowOverwrite = true;
-
- /**
- * Constructor.
- *
- * @param NodeDefinition $node The related node
- */
- public function __construct(NodeDefinition $node)
- {
- $this->node = $node;
- }
-
- /**
- * Sets whether the node can be unset.
- *
- * @param bool $allow
- *
- * @return MergeBuilder
- */
- public function allowUnset($allow = true)
- {
- $this->allowFalse = $allow;
-
- return $this;
- }
-
- /**
- * Sets whether the node can be overwritten.
- *
- * @param bool $deny Whether the overwriting is forbidden or not
- *
- * @return MergeBuilder
- */
- public function denyOverwrite($deny = true)
- {
- $this->allowOverwrite = !$deny;
-
- return $this;
- }
-
- /**
- * Returns the related node.
- *
- * @return NodeDefinition
- */
- public function end()
- {
- return $this->node;
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/NodeBuilder.php b/lib/gerencianet/symfony/config/Definition/Builder/NodeBuilder.php
deleted file mode 100644
index b2b6336..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/NodeBuilder.php
+++ /dev/null
@@ -1,245 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-/**
- * This class provides a fluent interface for building a node.
- *
- * @author Johannes M. Schmitt
- */
-class NodeBuilder implements NodeParentInterface
-{
- protected $parent;
- protected $nodeMapping;
-
- /**
- * Constructor.
- */
- public function __construct()
- {
- $this->nodeMapping = array(
- 'variable' => __NAMESPACE__.'\\VariableNodeDefinition',
- 'scalar' => __NAMESPACE__.'\\ScalarNodeDefinition',
- 'boolean' => __NAMESPACE__.'\\BooleanNodeDefinition',
- 'integer' => __NAMESPACE__.'\\IntegerNodeDefinition',
- 'float' => __NAMESPACE__.'\\FloatNodeDefinition',
- 'array' => __NAMESPACE__.'\\ArrayNodeDefinition',
- 'enum' => __NAMESPACE__.'\\EnumNodeDefinition',
- );
- }
-
- /**
- * Set the parent node.
- *
- * @param ParentNodeDefinitionInterface $parent The parent node
- *
- * @return NodeBuilder This node builder
- */
- public function setParent(ParentNodeDefinitionInterface $parent = null)
- {
- $this->parent = $parent;
-
- return $this;
- }
-
- /**
- * Creates a child array node.
- *
- * @param string $name The name of the node
- *
- * @return ArrayNodeDefinition The child node
- */
- public function arrayNode($name)
- {
- return $this->node($name, 'array');
- }
-
- /**
- * Creates a child scalar node.
- *
- * @param string $name the name of the node
- *
- * @return ScalarNodeDefinition The child node
- */
- public function scalarNode($name)
- {
- return $this->node($name, 'scalar');
- }
-
- /**
- * Creates a child Boolean node.
- *
- * @param string $name The name of the node
- *
- * @return BooleanNodeDefinition The child node
- */
- public function booleanNode($name)
- {
- return $this->node($name, 'boolean');
- }
-
- /**
- * Creates a child integer node.
- *
- * @param string $name the name of the node
- *
- * @return IntegerNodeDefinition The child node
- */
- public function integerNode($name)
- {
- return $this->node($name, 'integer');
- }
-
- /**
- * Creates a child float node.
- *
- * @param string $name the name of the node
- *
- * @return FloatNodeDefinition The child node
- */
- public function floatNode($name)
- {
- return $this->node($name, 'float');
- }
-
- /**
- * Creates a child EnumNode.
- *
- * @param string $name
- *
- * @return EnumNodeDefinition
- */
- public function enumNode($name)
- {
- return $this->node($name, 'enum');
- }
-
- /**
- * Creates a child variable node.
- *
- * @param string $name The name of the node
- *
- * @return VariableNodeDefinition The builder of the child node
- */
- public function variableNode($name)
- {
- return $this->node($name, 'variable');
- }
-
- /**
- * Returns the parent node.
- *
- * @return ParentNodeDefinitionInterface The parent node
- */
- public function end()
- {
- return $this->parent;
- }
-
- /**
- * Creates a child node.
- *
- * @param string $name The name of the node
- * @param string $type The type of the node
- *
- * @return NodeDefinition The child node
- *
- * @throws \RuntimeException When the node type is not registered
- * @throws \RuntimeException When the node class is not found
- */
- public function node($name, $type)
- {
- $class = $this->getNodeClass($type);
-
- $node = new $class($name);
-
- $this->append($node);
-
- return $node;
- }
-
- /**
- * Appends a node definition.
- *
- * Usage:
- *
- * $node = new ArrayNodeDefinition('name')
- * ->children()
- * ->scalarNode('foo')->end()
- * ->scalarNode('baz')->end()
- * ->append($this->getBarNodeDefinition())
- * ->end()
- * ;
- *
- * @param NodeDefinition $node
- *
- * @return NodeBuilder This node builder
- */
- public function append(NodeDefinition $node)
- {
- if ($node instanceof ParentNodeDefinitionInterface) {
- $builder = clone $this;
- $builder->setParent(null);
- $node->setBuilder($builder);
- }
-
- if (null !== $this->parent) {
- $this->parent->append($node);
- // Make this builder the node parent to allow for a fluid interface
- $node->setParent($this);
- }
-
- return $this;
- }
-
- /**
- * Adds or overrides a node Type.
- *
- * @param string $type The name of the type
- * @param string $class The fully qualified name the node definition class
- *
- * @return NodeBuilder This node builder
- */
- public function setNodeClass($type, $class)
- {
- $this->nodeMapping[strtolower($type)] = $class;
-
- return $this;
- }
-
- /**
- * Returns the class name of the node definition.
- *
- * @param string $type The node type
- *
- * @return string The node definition class name
- *
- * @throws \RuntimeException When the node type is not registered
- * @throws \RuntimeException When the node class is not found
- */
- protected function getNodeClass($type)
- {
- $type = strtolower($type);
-
- if (!isset($this->nodeMapping[$type])) {
- throw new \RuntimeException(sprintf('The node type "%s" is not registered.', $type));
- }
-
- $class = $this->nodeMapping[$type];
-
- if (!class_exists($class)) {
- throw new \RuntimeException(sprintf('The node class "%s" does not exist.', $class));
- }
-
- return $class;
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/NodeDefinition.php b/lib/gerencianet/symfony/config/Definition/Builder/NodeDefinition.php
deleted file mode 100644
index f7f84bc..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/NodeDefinition.php
+++ /dev/null
@@ -1,343 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-use Symfony\Component\Config\Definition\NodeInterface;
-use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException;
-
-/**
- * This class provides a fluent interface for defining a node.
- *
- * @author Johannes M. Schmitt
- */
-abstract class NodeDefinition implements NodeParentInterface
-{
- protected $name;
- protected $normalization;
- protected $validation;
- protected $defaultValue;
- protected $default = false;
- protected $required = false;
- protected $merge;
- protected $allowEmptyValue = true;
- protected $nullEquivalent;
- protected $trueEquivalent = true;
- protected $falseEquivalent = false;
-
- /**
- * @var NodeParentInterface|null
- */
- protected $parent;
- protected $attributes = array();
-
- /**
- * Constructor.
- *
- * @param string $name The name of the node
- * @param NodeParentInterface|null $parent The parent
- */
- public function __construct($name, NodeParentInterface $parent = null)
- {
- $this->parent = $parent;
- $this->name = $name;
- }
-
- /**
- * Sets the parent node.
- *
- * @param NodeParentInterface $parent The parent
- *
- * @return NodeDefinition|$this
- */
- public function setParent(NodeParentInterface $parent)
- {
- $this->parent = $parent;
-
- return $this;
- }
-
- /**
- * Sets info message.
- *
- * @param string $info The info text
- *
- * @return NodeDefinition|$this
- */
- public function info($info)
- {
- return $this->attribute('info', $info);
- }
-
- /**
- * Sets example configuration.
- *
- * @param string|array $example
- *
- * @return NodeDefinition|$this
- */
- public function example($example)
- {
- return $this->attribute('example', $example);
- }
-
- /**
- * Sets an attribute on the node.
- *
- * @param string $key
- * @param mixed $value
- *
- * @return NodeDefinition|$this
- */
- public function attribute($key, $value)
- {
- $this->attributes[$key] = $value;
-
- return $this;
- }
-
- /**
- * Returns the parent node.
- *
- * @return NodeParentInterface|null The builder of the parent node
- */
- public function end()
- {
- return $this->parent;
- }
-
- /**
- * Creates the node.
- *
- * @param bool $forceRootNode Whether to force this node as the root node
- *
- * @return NodeInterface
- */
- public function getNode($forceRootNode = false)
- {
- if ($forceRootNode) {
- $this->parent = null;
- }
-
- if (null !== $this->normalization) {
- $this->normalization->before = ExprBuilder::buildExpressions($this->normalization->before);
- }
-
- if (null !== $this->validation) {
- $this->validation->rules = ExprBuilder::buildExpressions($this->validation->rules);
- }
-
- $node = $this->createNode();
- $node->setAttributes($this->attributes);
-
- return $node;
- }
-
- /**
- * Sets the default value.
- *
- * @param mixed $value The default value
- *
- * @return NodeDefinition|$this
- */
- public function defaultValue($value)
- {
- $this->default = true;
- $this->defaultValue = $value;
-
- return $this;
- }
-
- /**
- * Sets the node as required.
- *
- * @return NodeDefinition|$this
- */
- public function isRequired()
- {
- $this->required = true;
-
- return $this;
- }
-
- /**
- * Sets the equivalent value used when the node contains null.
- *
- * @param mixed $value
- *
- * @return NodeDefinition|$this
- */
- public function treatNullLike($value)
- {
- $this->nullEquivalent = $value;
-
- return $this;
- }
-
- /**
- * Sets the equivalent value used when the node contains true.
- *
- * @param mixed $value
- *
- * @return NodeDefinition|$this
- */
- public function treatTrueLike($value)
- {
- $this->trueEquivalent = $value;
-
- return $this;
- }
-
- /**
- * Sets the equivalent value used when the node contains false.
- *
- * @param mixed $value
- *
- * @return NodeDefinition|$this
- */
- public function treatFalseLike($value)
- {
- $this->falseEquivalent = $value;
-
- return $this;
- }
-
- /**
- * Sets null as the default value.
- *
- * @return NodeDefinition|$this
- */
- public function defaultNull()
- {
- return $this->defaultValue(null);
- }
-
- /**
- * Sets true as the default value.
- *
- * @return NodeDefinition|$this
- */
- public function defaultTrue()
- {
- return $this->defaultValue(true);
- }
-
- /**
- * Sets false as the default value.
- *
- * @return NodeDefinition|$this
- */
- public function defaultFalse()
- {
- return $this->defaultValue(false);
- }
-
- /**
- * Sets an expression to run before the normalization.
- *
- * @return ExprBuilder
- */
- public function beforeNormalization()
- {
- return $this->normalization()->before();
- }
-
- /**
- * Denies the node value being empty.
- *
- * @return NodeDefinition|$this
- */
- public function cannotBeEmpty()
- {
- $this->allowEmptyValue = false;
-
- return $this;
- }
-
- /**
- * Sets an expression to run for the validation.
- *
- * The expression receives the value of the node and must return it. It can
- * modify it.
- * An exception should be thrown when the node is not valid.
- *
- * @return ExprBuilder
- */
- public function validate()
- {
- return $this->validation()->rule();
- }
-
- /**
- * Sets whether the node can be overwritten.
- *
- * @param bool $deny Whether the overwriting is forbidden or not
- *
- * @return NodeDefinition|$this
- */
- public function cannotBeOverwritten($deny = true)
- {
- $this->merge()->denyOverwrite($deny);
-
- return $this;
- }
-
- /**
- * Gets the builder for validation rules.
- *
- * @return ValidationBuilder
- */
- protected function validation()
- {
- if (null === $this->validation) {
- $this->validation = new ValidationBuilder($this);
- }
-
- return $this->validation;
- }
-
- /**
- * Gets the builder for merging rules.
- *
- * @return MergeBuilder
- */
- protected function merge()
- {
- if (null === $this->merge) {
- $this->merge = new MergeBuilder($this);
- }
-
- return $this->merge;
- }
-
- /**
- * Gets the builder for normalization rules.
- *
- * @return NormalizationBuilder
- */
- protected function normalization()
- {
- if (null === $this->normalization) {
- $this->normalization = new NormalizationBuilder($this);
- }
-
- return $this->normalization;
- }
-
- /**
- * Instantiate and configure the node according to this definition.
- *
- * @return NodeInterface $node The node instance
- *
- * @throws InvalidDefinitionException When the definition is invalid
- */
- abstract protected function createNode();
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/NodeParentInterface.php b/lib/gerencianet/symfony/config/Definition/Builder/NodeParentInterface.php
deleted file mode 100644
index 305e993..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/NodeParentInterface.php
+++ /dev/null
@@ -1,21 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-/**
- * An interface that must be implemented by all node parents.
- *
- * @author Victor Berchet
- */
-interface NodeParentInterface
-{
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/NormalizationBuilder.php b/lib/gerencianet/symfony/config/Definition/Builder/NormalizationBuilder.php
deleted file mode 100644
index 748c9f2..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/NormalizationBuilder.php
+++ /dev/null
@@ -1,67 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-/**
- * This class builds normalization conditions.
- *
- * @author Johannes M. Schmitt
- */
-class NormalizationBuilder
-{
- protected $node;
- public $before = array();
- public $remappings = array();
-
- /**
- * Constructor.
- *
- * @param NodeDefinition $node The related node
- */
- public function __construct(NodeDefinition $node)
- {
- $this->node = $node;
- }
-
- /**
- * Registers a key to remap to its plural form.
- *
- * @param string $key The key to remap
- * @param string $plural The plural of the key in case of irregular plural
- *
- * @return NormalizationBuilder
- */
- public function remap($key, $plural = null)
- {
- $this->remappings[] = array($key, null === $plural ? $key.'s' : $plural);
-
- return $this;
- }
-
- /**
- * Registers a closure to run before the normalization or an expression builder to build it if null is provided.
- *
- * @param \Closure $closure
- *
- * @return ExprBuilder|NormalizationBuilder
- */
- public function before(\Closure $closure = null)
- {
- if (null !== $closure) {
- $this->before[] = $closure;
-
- return $this;
- }
-
- return $this->before[] = new ExprBuilder($this->node);
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/NumericNodeDefinition.php b/lib/gerencianet/symfony/config/Definition/Builder/NumericNodeDefinition.php
deleted file mode 100644
index 8451e75..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/NumericNodeDefinition.php
+++ /dev/null
@@ -1,73 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException;
-
-/**
- * Abstract class that contains common code of integer and float node definitions.
- *
- * @author David Jeanmonod
- */
-abstract class NumericNodeDefinition extends ScalarNodeDefinition
-{
- protected $min;
- protected $max;
-
- /**
- * Ensures that the value is smaller than the given reference.
- *
- * @param mixed $max
- *
- * @return NumericNodeDefinition
- *
- * @throws \InvalidArgumentException when the constraint is inconsistent
- */
- public function max($max)
- {
- if (isset($this->min) && $this->min > $max) {
- throw new \InvalidArgumentException(sprintf('You cannot define a max(%s) as you already have a min(%s)', $max, $this->min));
- }
- $this->max = $max;
-
- return $this;
- }
-
- /**
- * Ensures that the value is bigger than the given reference.
- *
- * @param mixed $min
- *
- * @return NumericNodeDefinition
- *
- * @throws \InvalidArgumentException when the constraint is inconsistent
- */
- public function min($min)
- {
- if (isset($this->max) && $this->max < $min) {
- throw new \InvalidArgumentException(sprintf('You cannot define a min(%s) as you already have a max(%s)', $min, $this->max));
- }
- $this->min = $min;
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- *
- * @throws InvalidDefinitionException
- */
- public function cannotBeEmpty()
- {
- throw new InvalidDefinitionException('->cannotBeEmpty() is not applicable to NumericNodeDefinition.');
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/ParentNodeDefinitionInterface.php b/lib/gerencianet/symfony/config/Definition/Builder/ParentNodeDefinitionInterface.php
deleted file mode 100644
index 575495b..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/ParentNodeDefinitionInterface.php
+++ /dev/null
@@ -1,26 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-/**
- * An interface that must be implemented by nodes which can have children.
- *
- * @author Victor Berchet
- */
-interface ParentNodeDefinitionInterface
-{
- public function children();
-
- public function append(NodeDefinition $node);
-
- public function setBuilder(NodeBuilder $builder);
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/ScalarNodeDefinition.php b/lib/gerencianet/symfony/config/Definition/Builder/ScalarNodeDefinition.php
deleted file mode 100644
index 6170555..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/ScalarNodeDefinition.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-use Symfony\Component\Config\Definition\ScalarNode;
-
-/**
- * This class provides a fluent interface for defining a node.
- *
- * @author Johannes M. Schmitt
- */
-class ScalarNodeDefinition extends VariableNodeDefinition
-{
- /**
- * Instantiate a Node.
- *
- * @return ScalarNode The node
- */
- protected function instantiateNode()
- {
- return new ScalarNode($this->name, $this->parent);
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/TreeBuilder.php b/lib/gerencianet/symfony/config/Definition/Builder/TreeBuilder.php
deleted file mode 100644
index 5d02848..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/TreeBuilder.php
+++ /dev/null
@@ -1,63 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-use Symfony\Component\Config\Definition\NodeInterface;
-
-/**
- * This is the entry class for building a config tree.
- *
- * @author Johannes M. Schmitt
- */
-class TreeBuilder implements NodeParentInterface
-{
- protected $tree;
- protected $root;
- protected $builder;
-
- /**
- * Creates the root node.
- *
- * @param string $name The name of the root node
- * @param string $type The type of the root node
- * @param NodeBuilder $builder A custom node builder instance
- *
- * @return ArrayNodeDefinition|NodeDefinition The root node (as an ArrayNodeDefinition when the type is 'array')
- *
- * @throws \RuntimeException When the node type is not supported
- */
- public function root($name, $type = 'array', NodeBuilder $builder = null)
- {
- $builder = $builder ?: new NodeBuilder();
-
- return $this->root = $builder->node($name, $type)->setParent($this);
- }
-
- /**
- * Builds the tree.
- *
- * @return NodeInterface
- *
- * @throws \RuntimeException
- */
- public function buildTree()
- {
- if (null === $this->root) {
- throw new \RuntimeException('The configuration tree has no root node.');
- }
- if (null !== $this->tree) {
- return $this->tree;
- }
-
- return $this->tree = $this->root->getNode(true);
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/ValidationBuilder.php b/lib/gerencianet/symfony/config/Definition/Builder/ValidationBuilder.php
deleted file mode 100644
index e885823..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/ValidationBuilder.php
+++ /dev/null
@@ -1,51 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-/**
- * This class builds validation conditions.
- *
- * @author Christophe Coevoet
- */
-class ValidationBuilder
-{
- protected $node;
- public $rules = array();
-
- /**
- * Constructor.
- *
- * @param NodeDefinition $node The related node
- */
- public function __construct(NodeDefinition $node)
- {
- $this->node = $node;
- }
-
- /**
- * Registers a closure to run as normalization or an expression builder to build it if null is provided.
- *
- * @param \Closure $closure
- *
- * @return ExprBuilder|ValidationBuilder
- */
- public function rule(\Closure $closure = null)
- {
- if (null !== $closure) {
- $this->rules[] = $closure;
-
- return $this;
- }
-
- return $this->rules[] = new ExprBuilder($this->node);
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Builder/VariableNodeDefinition.php b/lib/gerencianet/symfony/config/Definition/Builder/VariableNodeDefinition.php
deleted file mode 100644
index a46b7ea..0000000
--- a/lib/gerencianet/symfony/config/Definition/Builder/VariableNodeDefinition.php
+++ /dev/null
@@ -1,64 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Builder;
-
-use Symfony\Component\Config\Definition\VariableNode;
-
-/**
- * This class provides a fluent interface for defining a node.
- *
- * @author Johannes M. Schmitt
- */
-class VariableNodeDefinition extends NodeDefinition
-{
- /**
- * Instantiate a Node.
- *
- * @return VariableNode The node
- */
- protected function instantiateNode()
- {
- return new VariableNode($this->name, $this->parent);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function createNode()
- {
- $node = $this->instantiateNode();
-
- if (null !== $this->normalization) {
- $node->setNormalizationClosures($this->normalization->before);
- }
-
- if (null !== $this->merge) {
- $node->setAllowOverwrite($this->merge->allowOverwrite);
- }
-
- if (true === $this->default) {
- $node->setDefaultValue($this->defaultValue);
- }
-
- $node->setAllowEmptyValue($this->allowEmptyValue);
- $node->addEquivalentValue(null, $this->nullEquivalent);
- $node->addEquivalentValue(true, $this->trueEquivalent);
- $node->addEquivalentValue(false, $this->falseEquivalent);
- $node->setRequired($this->required);
-
- if (null !== $this->validation) {
- $node->setFinalValidationClosures($this->validation->rules);
- }
-
- return $node;
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/ConfigurationInterface.php b/lib/gerencianet/symfony/config/Definition/ConfigurationInterface.php
deleted file mode 100644
index d6456ed..0000000
--- a/lib/gerencianet/symfony/config/Definition/ConfigurationInterface.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition;
-
-/**
- * Configuration interface.
- *
- * @author Victor Berchet
- */
-interface ConfigurationInterface
-{
- /**
- * Generates the configuration tree builder.
- *
- * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
- */
- public function getConfigTreeBuilder();
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Dumper/XmlReferenceDumper.php b/lib/gerencianet/symfony/config/Definition/Dumper/XmlReferenceDumper.php
deleted file mode 100644
index 2cc71b3..0000000
--- a/lib/gerencianet/symfony/config/Definition/Dumper/XmlReferenceDumper.php
+++ /dev/null
@@ -1,304 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Dumper;
-
-use Symfony\Component\Config\Definition\ConfigurationInterface;
-use Symfony\Component\Config\Definition\NodeInterface;
-use Symfony\Component\Config\Definition\ArrayNode;
-use Symfony\Component\Config\Definition\EnumNode;
-use Symfony\Component\Config\Definition\PrototypedArrayNode;
-
-/**
- * Dumps a XML reference configuration for the given configuration/node instance.
- *
- * @author Wouter J
- */
-class XmlReferenceDumper
-{
- private $reference;
-
- public function dump(ConfigurationInterface $configuration, $namespace = null)
- {
- return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree(), $namespace);
- }
-
- public function dumpNode(NodeInterface $node, $namespace = null)
- {
- $this->reference = '';
- $this->writeNode($node, 0, true, $namespace);
- $ref = $this->reference;
- $this->reference = null;
-
- return $ref;
- }
-
- /**
- * @param NodeInterface $node
- * @param int $depth
- * @param bool $root If the node is the root node
- * @param string $namespace The namespace of the node
- */
- private function writeNode(NodeInterface $node, $depth = 0, $root = false, $namespace = null)
- {
- $rootName = ($root ? 'config' : $node->getName());
- $rootNamespace = ($namespace ?: ($root ? 'http://example.org/schema/dic/'.$node->getName() : null));
-
- // xml remapping
- if ($node->getParent()) {
- $remapping = array_filter($node->getParent()->getXmlRemappings(), function ($mapping) use ($rootName) {
- return $rootName === $mapping[1];
- });
-
- if (count($remapping)) {
- list($singular) = current($remapping);
- $rootName = $singular;
- }
- }
- $rootName = str_replace('_', '-', $rootName);
-
- $rootAttributes = array();
- $rootAttributeComments = array();
- $rootChildren = array();
- $rootComments = array();
-
- if ($node instanceof ArrayNode) {
- $children = $node->getChildren();
-
- // comments about the root node
- if ($rootInfo = $node->getInfo()) {
- $rootComments[] = $rootInfo;
- }
-
- if ($rootNamespace) {
- $rootComments[] = 'Namespace: '.$rootNamespace;
- }
-
- // render prototyped nodes
- if ($node instanceof PrototypedArrayNode) {
- $prototype = $node->getPrototype();
-
- $info = 'prototype';
- if (null !== $prototype->getInfo()) {
- $info .= ': '.$prototype->getInfo();
- }
- array_unshift($rootComments, $info);
-
- if ($key = $node->getKeyAttribute()) {
- $rootAttributes[$key] = str_replace('-', ' ', $rootName).' '.$key;
- }
-
- if ($prototype instanceof ArrayNode) {
- $children = $prototype->getChildren();
- } else {
- if ($prototype->hasDefaultValue()) {
- $prototypeValue = $prototype->getDefaultValue();
- } else {
- switch (get_class($prototype)) {
- case 'Symfony\Component\Config\Definition\ScalarNode':
- $prototypeValue = 'scalar value';
- break;
-
- case 'Symfony\Component\Config\Definition\FloatNode':
- case 'Symfony\Component\Config\Definition\IntegerNode':
- $prototypeValue = 'numeric value';
- break;
-
- case 'Symfony\Component\Config\Definition\BooleanNode':
- $prototypeValue = 'true|false';
- break;
-
- case 'Symfony\Component\Config\Definition\EnumNode':
- $prototypeValue = implode('|', array_map('json_encode', $prototype->getValues()));
- break;
-
- default:
- $prototypeValue = 'value';
- }
- }
- }
- }
-
- // get attributes and elements
- foreach ($children as $child) {
- if (!$child instanceof ArrayNode) {
- // get attributes
-
- // metadata
- $name = str_replace('_', '-', $child->getName());
- $value = '%%%%not_defined%%%%'; // use a string which isn't used in the normal world
-
- // comments
- $comments = array();
- if ($info = $child->getInfo()) {
- $comments[] = $info;
- }
-
- if ($example = $child->getExample()) {
- $comments[] = 'Example: '.$example;
- }
-
- if ($child->isRequired()) {
- $comments[] = 'Required';
- }
-
- if ($child instanceof EnumNode) {
- $comments[] = 'One of '.implode('; ', array_map('json_encode', $child->getValues()));
- }
-
- if (count($comments)) {
- $rootAttributeComments[$name] = implode(";\n", $comments);
- }
-
- // default values
- if ($child->hasDefaultValue()) {
- $value = $child->getDefaultValue();
- }
-
- // append attribute
- $rootAttributes[$name] = $value;
- } else {
- // get elements
- $rootChildren[] = $child;
- }
- }
- }
-
- // render comments
-
- // root node comment
- if (count($rootComments)) {
- foreach ($rootComments as $comment) {
- $this->writeLine('', $depth);
- }
- }
-
- // attribute comments
- if (count($rootAttributeComments)) {
- foreach ($rootAttributeComments as $attrName => $comment) {
- $commentDepth = $depth + 4 + strlen($attrName) + 2;
- $commentLines = explode("\n", $comment);
- $multiline = (count($commentLines) > 1);
- $comment = implode(PHP_EOL.str_repeat(' ', $commentDepth), $commentLines);
-
- if ($multiline) {
- $this->writeLine('', $depth);
- } else {
- $this->writeLine('', $depth);
- }
- }
- }
-
- // render start tag + attributes
- $rootIsVariablePrototype = isset($prototypeValue);
- $rootIsEmptyTag = (0 === count($rootChildren) && !$rootIsVariablePrototype);
- $rootOpenTag = '<'.$rootName;
- if (1 >= ($attributesCount = count($rootAttributes))) {
- if (1 === $attributesCount) {
- $rootOpenTag .= sprintf(' %s="%s"', current(array_keys($rootAttributes)), $this->writeValue(current($rootAttributes)));
- }
-
- $rootOpenTag .= $rootIsEmptyTag ? ' />' : '>';
-
- if ($rootIsVariablePrototype) {
- $rootOpenTag .= $prototypeValue.''.$rootName.'>';
- }
-
- $this->writeLine($rootOpenTag, $depth);
- } else {
- $this->writeLine($rootOpenTag, $depth);
-
- $i = 1;
-
- foreach ($rootAttributes as $attrName => $attrValue) {
- $attr = sprintf('%s="%s"', $attrName, $this->writeValue($attrValue));
-
- $this->writeLine($attr, $depth + 4);
-
- if ($attributesCount === $i++) {
- $this->writeLine($rootIsEmptyTag ? '/>' : '>', $depth);
-
- if ($rootIsVariablePrototype) {
- $rootOpenTag .= $prototypeValue.''.$rootName.'>';
- }
- }
- }
- }
-
- // render children tags
- foreach ($rootChildren as $child) {
- $this->writeLine('');
- $this->writeNode($child, $depth + 4);
- }
-
- // render end tag
- if (!$rootIsEmptyTag && !$rootIsVariablePrototype) {
- $this->writeLine('');
-
- $rootEndTag = ''.$rootName.'>';
- $this->writeLine($rootEndTag, $depth);
- }
- }
-
- /**
- * Outputs a single config reference line.
- *
- * @param string $text
- * @param int $indent
- */
- private function writeLine($text, $indent = 0)
- {
- $indent = strlen($text) + $indent;
- $format = '%'.$indent.'s';
-
- $this->reference .= sprintf($format, $text).PHP_EOL;
- }
-
- /**
- * Renders the string conversion of the value.
- *
- * @param mixed $value
- *
- * @return string
- */
- private function writeValue($value)
- {
- if ('%%%%not_defined%%%%' === $value) {
- return '';
- }
-
- if (is_string($value) || is_numeric($value)) {
- return $value;
- }
-
- if (false === $value) {
- return 'false';
- }
-
- if (true === $value) {
- return 'true';
- }
-
- if (null === $value) {
- return 'null';
- }
-
- if (empty($value)) {
- return '';
- }
-
- if (is_array($value)) {
- return implode(',', $value);
- }
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Dumper/YamlReferenceDumper.php b/lib/gerencianet/symfony/config/Definition/Dumper/YamlReferenceDumper.php
deleted file mode 100644
index d38e6eb..0000000
--- a/lib/gerencianet/symfony/config/Definition/Dumper/YamlReferenceDumper.php
+++ /dev/null
@@ -1,203 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Dumper;
-
-use Symfony\Component\Config\Definition\ConfigurationInterface;
-use Symfony\Component\Config\Definition\NodeInterface;
-use Symfony\Component\Config\Definition\ArrayNode;
-use Symfony\Component\Config\Definition\EnumNode;
-use Symfony\Component\Config\Definition\PrototypedArrayNode;
-use Symfony\Component\Yaml\Inline;
-
-/**
- * Dumps a Yaml reference configuration for the given configuration/node instance.
- *
- * @author Kevin Bond
- */
-class YamlReferenceDumper
-{
- private $reference;
-
- public function dump(ConfigurationInterface $configuration)
- {
- return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree());
- }
-
- public function dumpNode(NodeInterface $node)
- {
- $this->reference = '';
- $this->writeNode($node);
- $ref = $this->reference;
- $this->reference = null;
-
- return $ref;
- }
-
- /**
- * @param NodeInterface $node
- * @param int $depth
- */
- private function writeNode(NodeInterface $node, $depth = 0)
- {
- $comments = array();
- $default = '';
- $defaultArray = null;
- $children = null;
- $example = $node->getExample();
-
- // defaults
- if ($node instanceof ArrayNode) {
- $children = $node->getChildren();
-
- if ($node instanceof PrototypedArrayNode) {
- $prototype = $node->getPrototype();
-
- if ($prototype instanceof ArrayNode) {
- $children = $prototype->getChildren();
- }
-
- // check for attribute as key
- if ($key = $node->getKeyAttribute()) {
- $keyNodeClass = 'Symfony\Component\Config\Definition\\'.($prototype instanceof ArrayNode ? 'ArrayNode' : 'ScalarNode');
- $keyNode = new $keyNodeClass($key, $node);
-
- $info = 'Prototype';
- if (null !== $prototype->getInfo()) {
- $info .= ': '.$prototype->getInfo();
- }
- $keyNode->setInfo($info);
-
- // add children
- foreach ($children as $childNode) {
- $keyNode->addChild($childNode);
- }
- $children = array($key => $keyNode);
- }
- }
-
- if (!$children) {
- if ($node->hasDefaultValue() && count($defaultArray = $node->getDefaultValue())) {
- $default = '';
- } elseif (!is_array($example)) {
- $default = '[]';
- }
- }
- } elseif ($node instanceof EnumNode) {
- $comments[] = 'One of '.implode('; ', array_map('json_encode', $node->getValues()));
- $default = $node->hasDefaultValue() ? Inline::dump($node->getDefaultValue()) : '~';
- } else {
- $default = '~';
-
- if ($node->hasDefaultValue()) {
- $default = $node->getDefaultValue();
-
- if (is_array($default)) {
- if (count($defaultArray = $node->getDefaultValue())) {
- $default = '';
- } elseif (!is_array($example)) {
- $default = '[]';
- }
- } else {
- $default = Inline::dump($default);
- }
- }
- }
-
- // required?
- if ($node->isRequired()) {
- $comments[] = 'Required';
- }
-
- // example
- if ($example && !is_array($example)) {
- $comments[] = 'Example: '.$example;
- }
-
- $default = (string) $default != '' ? ' '.$default : '';
- $comments = count($comments) ? '# '.implode(', ', $comments) : '';
-
- $text = rtrim(sprintf('%-20s %s %s', $node->getName().':', $default, $comments), ' ');
-
- if ($info = $node->getInfo()) {
- $this->writeLine('');
- // indenting multi-line info
- $info = str_replace("\n", sprintf("\n%".($depth * 4).'s# ', ' '), $info);
- $this->writeLine('# '.$info, $depth * 4);
- }
-
- $this->writeLine($text, $depth * 4);
-
- // output defaults
- if ($defaultArray) {
- $this->writeLine('');
-
- $message = count($defaultArray) > 1 ? 'Defaults' : 'Default';
-
- $this->writeLine('# '.$message.':', $depth * 4 + 4);
-
- $this->writeArray($defaultArray, $depth + 1);
- }
-
- if (is_array($example)) {
- $this->writeLine('');
-
- $message = count($example) > 1 ? 'Examples' : 'Example';
-
- $this->writeLine('# '.$message.':', $depth * 4 + 4);
-
- $this->writeArray($example, $depth + 1);
- }
-
- if ($children) {
- foreach ($children as $childNode) {
- $this->writeNode($childNode, $depth + 1);
- }
- }
- }
-
- /**
- * Outputs a single config reference line.
- *
- * @param string $text
- * @param int $indent
- */
- private function writeLine($text, $indent = 0)
- {
- $indent = strlen($text) + $indent;
- $format = '%'.$indent.'s';
-
- $this->reference .= sprintf($format, $text)."\n";
- }
-
- private function writeArray(array $array, $depth)
- {
- $isIndexed = array_values($array) === $array;
-
- foreach ($array as $key => $value) {
- if (is_array($value)) {
- $val = '';
- } else {
- $val = $value;
- }
-
- if ($isIndexed) {
- $this->writeLine('- '.$val, $depth * 4);
- } else {
- $this->writeLine(sprintf('%-20s %s', $key.':', $val), $depth * 4);
- }
-
- if (is_array($value)) {
- $this->writeArray($value, $depth + 1);
- }
- }
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/EnumNode.php b/lib/gerencianet/symfony/config/Definition/EnumNode.php
deleted file mode 100644
index 9b4c415..0000000
--- a/lib/gerencianet/symfony/config/Definition/EnumNode.php
+++ /dev/null
@@ -1,58 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition;
-
-use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
-
-/**
- * Node which only allows a finite set of values.
- *
- * @author Johannes M. Schmitt
- */
-class EnumNode extends ScalarNode
-{
- private $values;
-
- public function __construct($name, NodeInterface $parent = null, array $values = array())
- {
- $values = array_unique($values);
- if (empty($values)) {
- throw new \InvalidArgumentException('$values must contain at least one element.');
- }
-
- parent::__construct($name, $parent);
- $this->values = $values;
- }
-
- public function getValues()
- {
- return $this->values;
- }
-
- protected function finalizeValue($value)
- {
- $value = parent::finalizeValue($value);
-
- if (!in_array($value, $this->values, true)) {
- $ex = new InvalidConfigurationException(sprintf(
- 'The value %s is not allowed for path "%s". Permissible values: %s',
- json_encode($value),
- $this->getPath(),
- implode(', ', array_map('json_encode', $this->values))));
- $ex->setPath($this->getPath());
-
- throw $ex;
- }
-
- return $value;
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Exception/DuplicateKeyException.php b/lib/gerencianet/symfony/config/Definition/Exception/DuplicateKeyException.php
deleted file mode 100644
index 48dd932..0000000
--- a/lib/gerencianet/symfony/config/Definition/Exception/DuplicateKeyException.php
+++ /dev/null
@@ -1,22 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Exception;
-
-/**
- * This exception is thrown whenever the key of an array is not unique. This can
- * only be the case if the configuration is coming from an XML file.
- *
- * @author Johannes M. Schmitt
- */
-class DuplicateKeyException extends InvalidConfigurationException
-{
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Exception/Exception.php b/lib/gerencianet/symfony/config/Definition/Exception/Exception.php
deleted file mode 100644
index 8933a49..0000000
--- a/lib/gerencianet/symfony/config/Definition/Exception/Exception.php
+++ /dev/null
@@ -1,21 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Exception;
-
-/**
- * Base exception for all configuration exceptions.
- *
- * @author Johannes M. Schmitt
- */
-class Exception extends \RuntimeException
-{
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Exception/ForbiddenOverwriteException.php b/lib/gerencianet/symfony/config/Definition/Exception/ForbiddenOverwriteException.php
deleted file mode 100644
index 726c07f..0000000
--- a/lib/gerencianet/symfony/config/Definition/Exception/ForbiddenOverwriteException.php
+++ /dev/null
@@ -1,22 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Exception;
-
-/**
- * This exception is thrown when a configuration path is overwritten from a
- * subsequent configuration file, but the entry node specifically forbids this.
- *
- * @author Johannes M. Schmitt
- */
-class ForbiddenOverwriteException extends InvalidConfigurationException
-{
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Exception/InvalidConfigurationException.php b/lib/gerencianet/symfony/config/Definition/Exception/InvalidConfigurationException.php
deleted file mode 100644
index 3dbc57b..0000000
--- a/lib/gerencianet/symfony/config/Definition/Exception/InvalidConfigurationException.php
+++ /dev/null
@@ -1,49 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Exception;
-
-/**
- * A very general exception which can be thrown whenever non of the more specific
- * exceptions is suitable.
- *
- * @author Johannes M. Schmitt
- */
-class InvalidConfigurationException extends Exception
-{
- private $path;
- private $containsHints = false;
-
- public function setPath($path)
- {
- $this->path = $path;
- }
-
- public function getPath()
- {
- return $this->path;
- }
-
- /**
- * Adds extra information that is suffixed to the original exception message.
- *
- * @param string $hint
- */
- public function addHint($hint)
- {
- if (!$this->containsHints) {
- $this->message .= "\nHint: ".$hint;
- $this->containsHints = true;
- } else {
- $this->message .= ', '.$hint;
- }
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Exception/InvalidDefinitionException.php b/lib/gerencianet/symfony/config/Definition/Exception/InvalidDefinitionException.php
deleted file mode 100644
index 98310da..0000000
--- a/lib/gerencianet/symfony/config/Definition/Exception/InvalidDefinitionException.php
+++ /dev/null
@@ -1,21 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Exception;
-
-/**
- * Thrown when an error is detected in a node Definition.
- *
- * @author Victor Berchet
- */
-class InvalidDefinitionException extends Exception
-{
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Exception/InvalidTypeException.php b/lib/gerencianet/symfony/config/Definition/Exception/InvalidTypeException.php
deleted file mode 100644
index d7ca8c9..0000000
--- a/lib/gerencianet/symfony/config/Definition/Exception/InvalidTypeException.php
+++ /dev/null
@@ -1,21 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Exception;
-
-/**
- * This exception is thrown if an invalid type is encountered.
- *
- * @author Johannes M. Schmitt
- */
-class InvalidTypeException extends InvalidConfigurationException
-{
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Exception/UnsetKeyException.php b/lib/gerencianet/symfony/config/Definition/Exception/UnsetKeyException.php
deleted file mode 100644
index 863181a..0000000
--- a/lib/gerencianet/symfony/config/Definition/Exception/UnsetKeyException.php
+++ /dev/null
@@ -1,22 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition\Exception;
-
-/**
- * This exception is usually not encountered by the end-user, but only used
- * internally to signal the parent scope to unset a key.
- *
- * @author Johannes M. Schmitt
- */
-class UnsetKeyException extends Exception
-{
-}
diff --git a/lib/gerencianet/symfony/config/Definition/FloatNode.php b/lib/gerencianet/symfony/config/Definition/FloatNode.php
deleted file mode 100644
index 5e1af17..0000000
--- a/lib/gerencianet/symfony/config/Definition/FloatNode.php
+++ /dev/null
@@ -1,43 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition;
-
-use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
-
-/**
- * This node represents a float value in the config tree.
- *
- * @author Jeanmonod David
- */
-class FloatNode extends NumericNode
-{
- /**
- * {@inheritdoc}
- */
- protected function validateType($value)
- {
- // Integers are also accepted, we just cast them
- if (is_int($value)) {
- $value = (float) $value;
- }
-
- if (!is_float($value)) {
- $ex = new InvalidTypeException(sprintf('Invalid type for path "%s". Expected float, but got %s.', $this->getPath(), gettype($value)));
- if ($hint = $this->getInfo()) {
- $ex->addHint($hint);
- }
- $ex->setPath($this->getPath());
-
- throw $ex;
- }
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/IntegerNode.php b/lib/gerencianet/symfony/config/Definition/IntegerNode.php
deleted file mode 100644
index ba23070..0000000
--- a/lib/gerencianet/symfony/config/Definition/IntegerNode.php
+++ /dev/null
@@ -1,38 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition;
-
-use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
-
-/**
- * This node represents an integer value in the config tree.
- *
- * @author Jeanmonod David
- */
-class IntegerNode extends NumericNode
-{
- /**
- * {@inheritdoc}
- */
- protected function validateType($value)
- {
- if (!is_int($value)) {
- $ex = new InvalidTypeException(sprintf('Invalid type for path "%s". Expected int, but got %s.', $this->getPath(), gettype($value)));
- if ($hint = $this->getInfo()) {
- $ex->addHint($hint);
- }
- $ex->setPath($this->getPath());
-
- throw $ex;
- }
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/NodeInterface.php b/lib/gerencianet/symfony/config/Definition/NodeInterface.php
deleted file mode 100644
index b9bddc4..0000000
--- a/lib/gerencianet/symfony/config/Definition/NodeInterface.php
+++ /dev/null
@@ -1,88 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition;
-
-/**
- * Common Interface among all nodes.
- *
- * In most cases, it is better to inherit from BaseNode instead of implementing
- * this interface yourself.
- *
- * @author Johannes M. Schmitt
- */
-interface NodeInterface
-{
- /**
- * Returns the name of the node.
- *
- * @return string The name of the node
- */
- public function getName();
-
- /**
- * Returns the path of the node.
- *
- * @return string The node path
- */
- public function getPath();
-
- /**
- * Returns true when the node is required.
- *
- * @return bool If the node is required
- */
- public function isRequired();
-
- /**
- * Returns true when the node has a default value.
- *
- * @return bool If the node has a default value
- */
- public function hasDefaultValue();
-
- /**
- * Returns the default value of the node.
- *
- * @return mixed The default value
- *
- * @throws \RuntimeException if the node has no default value
- */
- public function getDefaultValue();
-
- /**
- * Normalizes the supplied value.
- *
- * @param mixed $value The value to normalize
- *
- * @return mixed The normalized value
- */
- public function normalize($value);
-
- /**
- * Merges two values together.
- *
- * @param mixed $leftSide
- * @param mixed $rightSide
- *
- * @return mixed The merged values
- */
- public function merge($leftSide, $rightSide);
-
- /**
- * Finalizes a value.
- *
- * @param mixed $value The value to finalize
- *
- * @return mixed The finalized value
- */
- public function finalize($value);
-}
diff --git a/lib/gerencianet/symfony/config/Definition/NumericNode.php b/lib/gerencianet/symfony/config/Definition/NumericNode.php
deleted file mode 100644
index 439935e..0000000
--- a/lib/gerencianet/symfony/config/Definition/NumericNode.php
+++ /dev/null
@@ -1,64 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition;
-
-use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
-
-/**
- * This node represents a numeric value in the config tree.
- *
- * @author David Jeanmonod
- */
-class NumericNode extends ScalarNode
-{
- protected $min;
- protected $max;
-
- public function __construct($name, NodeInterface $parent = null, $min = null, $max = null)
- {
- parent::__construct($name, $parent);
- $this->min = $min;
- $this->max = $max;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function finalizeValue($value)
- {
- $value = parent::finalizeValue($value);
-
- $errorMsg = null;
- if (isset($this->min) && $value < $this->min) {
- $errorMsg = sprintf('The value %s is too small for path "%s". Should be greater than or equal to %s', $value, $this->getPath(), $this->min);
- }
- if (isset($this->max) && $value > $this->max) {
- $errorMsg = sprintf('The value %s is too big for path "%s". Should be less than or equal to %s', $value, $this->getPath(), $this->max);
- }
- if (isset($errorMsg)) {
- $ex = new InvalidConfigurationException($errorMsg);
- $ex->setPath($this->getPath());
- throw $ex;
- }
-
- return $value;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function isValueEmpty($value)
- {
- // a numeric value cannot be empty
- return false;
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/Processor.php b/lib/gerencianet/symfony/config/Definition/Processor.php
deleted file mode 100644
index 025e693..0000000
--- a/lib/gerencianet/symfony/config/Definition/Processor.php
+++ /dev/null
@@ -1,97 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition;
-
-/**
- * This class is the entry point for config normalization/merging/finalization.
- *
- * @author Johannes M. Schmitt
- */
-class Processor
-{
- /**
- * Processes an array of configurations.
- *
- * @param NodeInterface $configTree The node tree describing the configuration
- * @param array $configs An array of configuration items to process
- *
- * @return array The processed configuration
- */
- public function process(NodeInterface $configTree, array $configs)
- {
- $currentConfig = array();
- foreach ($configs as $config) {
- $config = $configTree->normalize($config);
- $currentConfig = $configTree->merge($currentConfig, $config);
- }
-
- return $configTree->finalize($currentConfig);
- }
-
- /**
- * Processes an array of configurations.
- *
- * @param ConfigurationInterface $configuration The configuration class
- * @param array $configs An array of configuration items to process
- *
- * @return array The processed configuration
- */
- public function processConfiguration(ConfigurationInterface $configuration, array $configs)
- {
- return $this->process($configuration->getConfigTreeBuilder()->buildTree(), $configs);
- }
-
- /**
- * Normalizes a configuration entry.
- *
- * This method returns a normalize configuration array for a given key
- * to remove the differences due to the original format (YAML and XML mainly).
- *
- * Here is an example.
- *
- * The configuration in XML:
- *
- * twig.extension.foo
- * twig.extension.bar
- *
- * And the same configuration in YAML:
- *
- * extensions: ['twig.extension.foo', 'twig.extension.bar']
- *
- * @param array $config A config array
- * @param string $key The key to normalize
- * @param string $plural The plural form of the key if it is irregular
- *
- * @return array
- */
- public static function normalizeConfig($config, $key, $plural = null)
- {
- if (null === $plural) {
- $plural = $key.'s';
- }
-
- if (isset($config[$plural])) {
- return $config[$plural];
- }
-
- if (isset($config[$key])) {
- if (is_string($config[$key]) || !is_int(key($config[$key]))) {
- // only one
- return array($config[$key]);
- }
-
- return $config[$key];
- }
-
- return array();
- }
-}
diff --git a/lib/gerencianet/symfony/config/Definition/PrototypeNodeInterface.php b/lib/gerencianet/symfony/config/Definition/PrototypeNodeInterface.php
deleted file mode 100644
index 8bbb84d..0000000
--- a/lib/gerencianet/symfony/config/Definition/PrototypeNodeInterface.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition;
-
-/**
- * This interface must be implemented by nodes which can be used as prototypes.
- *
- * @author Johannes M. Schmitt
- */
-interface PrototypeNodeInterface extends NodeInterface
-{
- /**
- * Sets the name of the node.
- *
- * @param string $name The name of the node
- */
- public function setName($name);
-}
diff --git a/lib/gerencianet/symfony/config/Definition/PrototypedArrayNode.php b/lib/gerencianet/symfony/config/Definition/PrototypedArrayNode.php
deleted file mode 100644
index 931b467..0000000
--- a/lib/gerencianet/symfony/config/Definition/PrototypedArrayNode.php
+++ /dev/null
@@ -1,331 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Config\Definition;
-
-use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
-use Symfony\Component\Config\Definition\Exception\DuplicateKeyException;
-use Symfony\Component\Config\Definition\Exception\UnsetKeyException;
-use Symfony\Component\Config\Definition\Exception\Exception;
-
-/**
- * Represents a prototyped Array node in the config tree.
- *
- * @author Johannes M. Schmitt