diff --git a/CHANGELOG.md b/CHANGELOG.md index e1945234..18d51832 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## Changelog +* 2.0.7 - 2016.12.28: + * Fix: Downloadable email link. + * Fix: Updating shipping methods in checkout. + * Fix: Order link in my account. + * Fix: Fatal error on product page. * 2.0.6 - 2016.12.2: * Fix: Do not allow to add external products to cart. * Fix: Fix external product url. diff --git a/assets/js/shop/checkout.js b/assets/js/shop/checkout.js index 9164b725..a6787ff8 100755 --- a/assets/js/shop/checkout.js +++ b/assets/js/shop/checkout.js @@ -1 +1 @@ -var Checkout,bind=function(t,e){return function(){return t.apply(e,arguments)}},hasProp={}.hasOwnProperty;Checkout=function(){function t(t){this.params=t,this._updateShippingField=bind(this._updateShippingField,this),this.updateDiscounts=bind(this.updateDiscounts,this),this.updatePostcode=bind(this.updatePostcode,this),this.updateState=bind(this.updateState,this),this.updateCountry=bind(this.updateCountry,this),this.selectShipping=bind(this.selectShipping,this),this.block=bind(this.block,this),this._prepareStateField("#jigoshop_order_billing_address_state"),this._prepareStateField("#jigoshop_order_shipping_address_state"),jQuery("#jigoshop-login").on("click",function(t){return t.preventDefault(),jQuery("#jigoshop-login-form").slideToggle()}),jQuery("#create-account").on("change",function(){return jQuery("#registration-form").slideToggle()}),jQuery("#different_shipping_address").on("change",function(){return jQuery("#shipping-address").slideToggle(),jQuery(this).is(":checked")?jQuery("#jigoshop_order_shipping_address_country").change():jQuery("#jigoshop_order_billing_address_country").change()}),jQuery("#payment-methods").on("change","li input[type=radio]",function(){return jQuery("#payment-methods li > div").slideUp(),jQuery("div",jQuery(this).closest("li")).slideDown()}),jQuery("#shipping-calculator").on("click","input[type=radio]",this.selectShipping),jQuery("#jigoshop_order_billing_address_country").on("change",function(t){return function(e){return t.updateCountry("billing_address",e)}}(this)),jQuery("#jigoshop_order_shipping_address_country").on("change",function(t){return function(e){return t.updateCountry("shipping_address",e)}}(this)),jQuery("#jigoshop_order_billing_address_state").on("change",this.updateState.bind(this,"billing_address")),jQuery("#jigoshop_order_shipping_address_state").on("change",this.updateState.bind(this,"shipping_address")),jQuery("#jigoshop_order_billing_address_postcode").on("change",this.updatePostcode.bind(this,"billing_address")),jQuery("#jigoshop_order_shipping_address_postcode").on("change",this.updatePostcode.bind(this,"shipping_address")),jQuery("#jigoshop_coupons").on("change",this.updateDiscounts).select2({tags:[],tokenSeparators:[","],multiple:!0,formatNoMatches:""})}return t.prototype.params={assets:"",i18n:{loading:"Loading..."}},t.prototype.block=function(){return jQuery("#checkout > button").block({message:''+this.params.i18n.loading+'',css:{padding:"20px",width:"auto",height:"auto",border:"1px solid #83AC31"},overlayCss:{opacity:.01}})},t.prototype.unblock=function(){return jQuery("#checkout > button").unblock()},t.prototype._prepareStateField=function(t){var e,s,i;return e=jQuery(t),e.is("select")?(s=jQuery(document.createElement("input")).attr("type","text").attr("id",e.attr("id")).attr("name",e.attr("name")).attr("class",e.attr("class")).val(e.val()),i=[],jQuery("option",e).each(function(){return i.push({id:jQuery(this).val(),text:jQuery(this).html()})}),e.replaceWith(s),s.select2({data:i})):void 0},t.prototype.selectShipping=function(){var t,e;return t=jQuery("#shipping-calculator input[type=radio]:checked"),e=jQuery(".shipping-method-rate",t.closest("li")),jQuery.ajax({url:jigoshop.getAjaxUrl(),type:"post",dataType:"json",data:{action:"jigoshop_cart_select_shipping",method:t.val(),rate:e.val()}}).done(function(t){return function(e){return e.success?(t._updateTotals(e.html.total,e.html.subtotal),t._updateDiscount(e),t._updateTaxes(e.tax,e.html.tax)):jigoshop.addMessage("danger",e.error,6e3)}}(this))},t.prototype.updateCountry=function(t,e){return this.block(),jQuery(".noscript_state_field").remove(),jQuery.ajax({url:jigoshop.getAjaxUrl(),type:"post",dataType:"json",data:{action:"jigoshop_checkout_change_country",field:t,differentShipping:jQuery("#different_shipping_address").is(":checked"),value:jQuery(e.target).val()}}).done(function(t){return function(s){var i,o,r,n,a;if(null!=s.success&&s.success)if(t._updateTotals(s.html.total,s.html.subtotal),t._updateDiscount(s),t._updateTaxes(s.tax,s.html.tax),t._updateShipping(s.shipping_address,s.html.shipping_address),a="#"+jQuery(e.target).attr("id").replace(/country/,"state"),s.has_states){i=[],r=s.states;for(n in r)hasProp.call(r,n)&&(o=r[n],i.push({id:n,text:o}));jQuery(a).select2({data:i})}else jQuery(a).attr("type","text").select2("destroy").val("");else jigoshop.addMessage("danger",s.error,6e3);return t.unblock()}}(this))},t.prototype.updateState=function(t){var e;return e="#jigoshop_order_"+t+"_state",this._updateShippingField("jigoshop_checkout_change_state",t,jQuery(e).val())},t.prototype.updatePostcode=function(t){var e;return e="#jigoshop_order_"+t+"_postcode",this._updateShippingField("jigoshop_checkout_change_postcode",t,jQuery(e).val())},t.prototype.updateDiscounts=function(t){var e;return e=jQuery(t.target),this.block(),jQuery.ajax({url:jigoshop.getAjaxUrl(),type:"post",dataType:"json",data:{action:"jigoshop_cart_update_discounts",coupons:e.val()}}).done(function(t){return function(e){var s,i;if(null!=e.success&&e.success){if(null!=e.empty_cart==!0)return i=jQuery(e.html).hide(),s=jQuery("#cart"),s.after(i),s.slideUp(),i.slideDown(),void t.unblock();jQuery("td#product-subtotal").html(e.html.product_subtotal),t._updateTotals(e.html.total,e.html.subtotal),t._updateDiscount(e),t._updateTaxes(e.tax,e.html.tax),t._updateShipping(e.shipping_address,e.html.shipping_address)}else jigoshop.addMessage("danger",e.error,6e3);return t.unblock()}}(this))},t.prototype._updateShippingField=function(t,e,s){return this.block(),jQuery.ajax({url:jigoshop.getAjaxUrl(),type:"post",dataType:"json",data:{action:t,field:e,differentShipping:jQuery("#different_shipping_address").is(":checked"),value:s}}).done(function(t){return function(e){return null!=e.success&&e.success?(t._updateTotals(e.html.total,e.html.subtotal),t._updateDiscount(e),t._updateTaxes(e.tax,e.html.tax),t._updateShipping(e.shipping_address,e.html.shipping_address)):jigoshop.addMessage("danger",e.error,6e3),t.unblock()}}(this))},t.prototype._updateTotals=function(t,e){return jQuery("#cart-total > td > strong").html(t),jQuery("#cart-subtotal > td").html(e)},t.prototype._updateDiscount=function(t){var e;return null!=t.coupons&&(jQuery("input#jigoshop_coupons").select2("val",t.coupons.split(",")),e=jQuery("tr#cart-discount"),t.discount>0?(jQuery("td",e).html(t.html.discount),e.show()):e.hide(),null!=t.html.coupons)?jigoshop.addMessage("warning",t.html.coupons):void 0},t.prototype._updateShipping=function(t,e){var s,i,o,r;for(o in t)hasProp.call(t,o)&&(r=t[o],i=jQuery(".shipping_address-"+o),i.addClass("existing"),i.length>0?r>-1?(s=jQuery(e[o].html).addClass("existing"),i.replaceWith(s)):i.slideUp(function(){return jQuery(this).remove()}):null!=e[o]&&(s=jQuery(e[o].html),s.hide().addClass("existing").appendTo(jQuery("#shipping_address-methods")).slideDown()));return jQuery("#shipping_address-methods > li:not(.existing)").slideUp(function(){return jQuery(this).remove()}),jQuery("#shipping_address-methods > li").removeClass("existing")},t.prototype._updateTaxes=function(t,e){var s,i,o,r;i=[];for(r in e)hasProp.call(e,r)&&(o=e[r],s=jQuery("#tax-"+r),jQuery("th",s).html(o.label),jQuery("td",s).html(o.value),t[r]>0?i.push(s.show()):i.push(s.hide()));return i},t}(),jQuery(function(){return new Checkout(jigoshop_checkout)}); \ No newline at end of file +var Checkout,bind=function(t,e){return function(){return t.apply(e,arguments)}},hasProp={}.hasOwnProperty;Checkout=function(){function t(t){this.params=t,this._updateShippingField=bind(this._updateShippingField,this),this.updateDiscounts=bind(this.updateDiscounts,this),this.updatePostcode=bind(this.updatePostcode,this),this.updateState=bind(this.updateState,this),this.updateCountry=bind(this.updateCountry,this),this.selectShipping=bind(this.selectShipping,this),this.block=bind(this.block,this),this._prepareStateField("#jigoshop_order_billing_address_state"),this._prepareStateField("#jigoshop_order_shipping_address_state"),jQuery("#jigoshop-login").on("click",function(t){return t.preventDefault(),jQuery("#jigoshop-login-form").slideToggle()}),jQuery("#create-account").on("change",function(){return jQuery("#registration-form").slideToggle()}),jQuery("#different_shipping_address").on("change",function(){return jQuery("#shipping-address").slideToggle(),jQuery(this).is(":checked")?jQuery("#jigoshop_order_shipping_address_country").change():jQuery("#jigoshop_order_billing_address_country").change()}),jQuery("#payment-methods").on("change","li input[type=radio]",function(){return jQuery("#payment-methods li > div").slideUp(),jQuery("div",jQuery(this).closest("li")).slideDown()}),jQuery("#shipping-calculator").on("click","input[type=radio]",this.selectShipping),jQuery("#jigoshop_order_billing_address_country").on("change",function(t){return function(e){return t.updateCountry("billing_address",e)}}(this)),jQuery("#jigoshop_order_shipping_address_country").on("change",function(t){return function(e){return t.updateCountry("shipping_address",e)}}(this)),jQuery("#jigoshop_order_billing_address_state").on("change",this.updateState.bind(this,"billing_address")),jQuery("#jigoshop_order_shipping_address_state").on("change",this.updateState.bind(this,"shipping_address")),jQuery("#jigoshop_order_billing_address_postcode").on("change",this.updatePostcode.bind(this,"billing_address")),jQuery("#jigoshop_order_shipping_address_postcode").on("change",this.updatePostcode.bind(this,"shipping_address")),jQuery("#jigoshop_coupons").on("change",this.updateDiscounts).select2({tags:[],tokenSeparators:[","],multiple:!0,formatNoMatches:""})}return t.prototype.params={assets:"",i18n:{loading:"Loading..."}},t.prototype.block=function(){return jQuery("#checkout > button").block({message:''+this.params.i18n.loading+'',css:{padding:"20px",width:"auto",height:"auto",border:"1px solid #83AC31"},overlayCss:{opacity:.01}})},t.prototype.unblock=function(){return jQuery("#checkout > button").unblock()},t.prototype._prepareStateField=function(t){var e,i,s;return e=jQuery(t),e.is("select")?(i=jQuery(document.createElement("input")).attr("type","text").attr("id",e.attr("id")).attr("name",e.attr("name")).attr("class",e.attr("class")).val(e.val()),s=[],jQuery("option",e).each(function(){return s.push({id:jQuery(this).val(),text:jQuery(this).html()})}),e.replaceWith(i),i.select2({data:s})):void 0},t.prototype.selectShipping=function(){var t,e;return t=jQuery("#shipping-calculator input[type=radio]:checked"),e=jQuery(".shipping-method-rate",t.closest("li")),jQuery.ajax({url:jigoshop.getAjaxUrl(),type:"post",dataType:"json",data:{action:"jigoshop_cart_select_shipping",method:t.val(),rate:e.val()}}).done(function(t){return function(e){return e.success?(t._updateTotals(e.html.total,e.html.subtotal),t._updateDiscount(e),t._updateTaxes(e.tax,e.html.tax)):jigoshop.addMessage("danger",e.error,6e3)}}(this))},t.prototype.updateCountry=function(t,e){return this.block(),jQuery(".noscript_state_field").remove(),jQuery.ajax({url:jigoshop.getAjaxUrl(),type:"post",dataType:"json",data:{action:"jigoshop_checkout_change_country",field:t,differentShipping:jQuery("#different_shipping_address").is(":checked"),value:jQuery(e.target).val()}}).done(function(t){return function(i){var s,o,r,n,a;if(null!=i.success&&i.success)if(t._updateTotals(i.html.total,i.html.subtotal),t._updateDiscount(i),t._updateTaxes(i.tax,i.html.tax),t._updateShipping(i.shipping,i.html.shipping),a="#"+jQuery(e.target).attr("id").replace(/country/,"state"),i.has_states){s=[],r=i.states;for(n in r)hasProp.call(r,n)&&(o=r[n],s.push({id:n,text:o}));jQuery(a).select2({data:s})}else jQuery(a).attr("type","text").select2("destroy").val("");else jigoshop.addMessage("danger",i.error,6e3);return t.unblock()}}(this))},t.prototype.updateState=function(t){var e;return e="#jigoshop_order_"+t+"_state",this._updateShippingField("jigoshop_checkout_change_state",t,jQuery(e).val())},t.prototype.updatePostcode=function(t){var e;return e="#jigoshop_order_"+t+"_postcode",this._updateShippingField("jigoshop_checkout_change_postcode",t,jQuery(e).val())},t.prototype.updateDiscounts=function(t){var e;return e=jQuery(t.target),this.block(),jQuery.ajax({url:jigoshop.getAjaxUrl(),type:"post",dataType:"json",data:{action:"jigoshop_cart_update_discounts",coupons:e.val()}}).done(function(t){return function(e){var i,s;if(null!=e.success&&e.success){if(null!=e.empty_cart==!0)return s=jQuery(e.html).hide(),i=jQuery("#cart"),i.after(s),i.slideUp(),s.slideDown(),void t.unblock();jQuery("td#product-subtotal").html(e.html.product_subtotal),t._updateTotals(e.html.total,e.html.subtotal),t._updateDiscount(e),t._updateTaxes(e.tax,e.html.tax),t._updateShipping(e.shipping,e.html.shipping)}else jigoshop.addMessage("danger",e.error,6e3);return t.unblock()}}(this))},t.prototype._updateShippingField=function(t,e,i){return this.block(),jQuery.ajax({url:jigoshop.getAjaxUrl(),type:"post",dataType:"json",data:{action:t,field:e,differentShipping:jQuery("#different_shipping_address").is(":checked"),value:i}}).done(function(t){return function(e){return null!=e.success&&e.success?(t._updateTotals(e.html.total,e.html.subtotal),t._updateDiscount(e),t._updateTaxes(e.tax,e.html.tax),t._updateShipping(e.shipping,e.html.shipping)):jigoshop.addMessage("danger",e.error,6e3),t.unblock()}}(this))},t.prototype._updateTotals=function(t,e){return jQuery("#cart-total > td > strong").html(t),jQuery("#cart-subtotal > td").html(e)},t.prototype._updateDiscount=function(t){var e;return null!=t.coupons&&(jQuery("input#jigoshop_coupons").select2("val",t.coupons.split(",")),e=jQuery("tr#cart-discount"),t.discount>0?(jQuery("td",e).html(t.html.discount),e.show()):e.hide(),null!=t.html.coupons)?jigoshop.addMessage("warning",t.html.coupons):void 0},t.prototype._updateShipping=function(t,e){var i,s,o,r;for(o in t)hasProp.call(t,o)&&(r=t[o],s=jQuery(".shipping-"+o),s.addClass("existing"),s.length>0?r>-1?(i=jQuery(e[o].html).addClass("existing"),s.replaceWith(i)):s.slideUp(function(){return jQuery(this).remove()}):null!=e[o]&&(i=jQuery(e[o].html),i.hide().addClass("existing").appendTo(jQuery("#shipping-methods")).slideDown()));return jQuery("#shipping-methods > li:not(.existing)").slideUp(function(){return jQuery(this).remove()}),jQuery("#shipping-methods > li").removeClass("existing")},t.prototype._updateTaxes=function(t,e){var i,s,o,r;s=[];for(r in e)hasProp.call(e,r)&&(o=e[r],i=jQuery("#tax-"+r),jQuery("th",i).html(o.label),jQuery("td",i).html(o.value),t[r]>0?s.push(i.show()):s.push(i.hide()));return s},t}(),jQuery(function(){return new Checkout(jigoshop_checkout)}); \ No newline at end of file diff --git a/jigoshop.php b/jigoshop.php index 36397be6..54b897ef 100755 --- a/jigoshop.php +++ b/jigoshop.php @@ -20,7 +20,7 @@ * Description: Jigoshop, a WordPress eCommerce plugin that works. * Author: Jigoshop * Author URI: http://www.jigoshop.com - * Version: 2.0.6 + * Version: 2.0.7 * Requires at least: 4.0 * Tested up to: 4.6.1 * Text Domain: jigoshop diff --git a/readme.txt b/readme.txt index 5edfd9b8..83bf1113 100755 --- a/readme.txt +++ b/readme.txt @@ -4,8 +4,8 @@ Tags: ecommerce, wordpress ecommerce, store, shop, shopping, cart, checkout, wid Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XTG9C24KAA7VA Requires at least: 4.0 -Tested up to: 4.6.1 -Stable tag: 2.0.6 +Tested up to: 4.7 +Stable tag: 2.0.7 A feature-packed eCommerce plugin built upon WordPress core functionality ensuring excellent performance and customizability. @@ -104,6 +104,11 @@ However, if you want priority, dedicated support from Jigoshop staff, we dp offe == Changelog == += 2.0.7 - 2016.12.28 = +* Fix: Downloadable email link. +* Fix: Updating shipping methods in checkout. +* Fix: Order link in my account. +* Fix: Fatal error on product page. = 2.0.6 - 2016.12.2 = * Fix: Do not allow to add external products to cart. * Fix: Fix external product url. diff --git a/src/Jigoshop/Core.php b/src/Jigoshop/Core.php index d8c49c6a..c55a8c25 100755 --- a/src/Jigoshop/Core.php +++ b/src/Jigoshop/Core.php @@ -13,7 +13,7 @@ class Core { - const VERSION = '2.0.6'; + const VERSION = '2.0.7'; const WIDGET_CACHE = 'jigoshop_widget_cache'; const TERMS = 'jigoshop_term'; diff --git a/src/Jigoshop/Core/Types/Product/Downloadable.php b/src/Jigoshop/Core/Types/Product/Downloadable.php index 3da38a9c..d2f75e16 100755 --- a/src/Jigoshop/Core/Types/Product/Downloadable.php +++ b/src/Jigoshop/Core/Types/Product/Downloadable.php @@ -186,8 +186,7 @@ public function emailLink($result, $item, $order) { $product = $item->getProduct(); if ($product instanceof Product\Downloadable && in_array($order->getStatus(), array(Order\Status::COMPLETED, Order\Status::PROCESSING))) { - $url = $this->wp->getHelpers()->addQueryArg(array('file' => $order->getKey().'.'.$order->getId().'.'.$item->getKey(), Api::getUrl(DownloadFile::NAME))); - + $url = $this->wp->getHelpers()->addQueryArg(array('file' => $order->getKey().'.'.$order->getId().'.'.$item->getKey()), Api::getUrl(DownloadFile::NAME)); $result .= PHP_EOL.__('Your download link for this file is:', 'jigoshop'); $result .= PHP_EOL.' - '.$url; } diff --git a/src/Jigoshop/Entity/Product/Variable.php b/src/Jigoshop/Entity/Product/Variable.php index e1954606..3276bab0 100755 --- a/src/Jigoshop/Entity/Product/Variable.php +++ b/src/Jigoshop/Entity/Product/Variable.php @@ -179,7 +179,14 @@ public function getAssignedVariableAttributes() 'options' => [] ]; } - $attributes[$attribute->getAttribute()->getId()]['options'][$attribute->getValue()] = $attribute->getAttribute()->getOption($attribute->getValue())->getLabel(); + + if($attribute->getValue()) { + $attributes[$attribute->getAttribute()->getId()]['options'][$attribute->getValue()] = $attribute->getAttribute()->getOption($attribute->getValue())->getLabel(); + } else { + foreach($attribute->getAttribute()->getOptions() as $option) { + $attributes[$attribute->getAttribute()->getId()]['options'][$option->getId()] = $option->getLabel(); + } + } } } diff --git a/templates/user/account/orders.php b/templates/user/account/orders.php index 515bebf4..a4c68e35 100755 --- a/templates/user/account/orders.php +++ b/templates/user/account/orders.php @@ -28,7 +28,7 @@ - +
diff --git a/vendor/autoload.php b/vendor/autoload.php index aee57bc4..9cd33b61 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInit686ddfe1d7d54e7df1ed9e5a204f1480::getLoader(); +return ComposerAutoloaderInit0c98a2e8ea41c94cdcaded652ea9cb22::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index c69dedfa..a73092b0 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit686ddfe1d7d54e7df1ed9e5a204f1480 +class ComposerAutoloaderInit0c98a2e8ea41c94cdcaded652ea9cb22 { private static $loader; @@ -19,9 +19,9 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit686ddfe1d7d54e7df1ed9e5a204f1480', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit0c98a2e8ea41c94cdcaded652ea9cb22', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit686ddfe1d7d54e7df1ed9e5a204f1480', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit0c98a2e8ea41c94cdcaded652ea9cb22', 'loadClassLoader')); $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index b82439d7..cb7942ca 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -125,86 +125,6 @@ "psr-3" ] }, - { - "name": "monolog/monolog", - "version": "1.x-dev", - "version_normalized": "1.9999999.9999999.9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "bad29cb8d18ab0315e6c477751418a82c850d558" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bad29cb8d18ab0315e6c477751418a82c850d558", - "reference": "bad29cb8d18ab0315e6c477751418a82c850d558", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "provide": { - "psr/log-implementation": "1.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "doctrine/couchdb": "~1.0@dev", - "graylog2/gelf-php": "~1.0", - "jakub-onderka/php-parallel-lint": "0.9", - "php-amqplib/php-amqplib": "~2.4", - "php-console/php-console": "^3.1.3", - "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "2.3.0", - "ruflin/elastica": ">=0.90 <3.0", - "sentry/sentry": "^0.13", - "swiftmailer/swiftmailer": "~5.3" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", - "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "php-console/php-console": "Allow sending log messages to Google Chrome", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "sentry/sentry": "Allow sending log messages to a Sentry server" - }, - "time": "2016-11-26 00:15:39", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-4": { - "Monolog\\": "src/Monolog" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ] - }, { "name": "erusev/parsedown", "version": "dev-master", @@ -402,34 +322,64 @@ ] }, { - "name": "spatie/array-to-xml", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "monolog/monolog", + "version": "1.x-dev", + "version_normalized": "1.9999999.9999999.9999999-dev", "source": { "type": "git", - "url": "https://github.com/spatie/array-to-xml.git", - "reference": "06e2e7b256f02672a35f1811385f1d98239c1464" + "url": "https://github.com/Seldaek/monolog.git", + "reference": "b732364e70a615231f15944e015b31d0d77bf9f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/06e2e7b256f02672a35f1811385f1d98239c1464", - "reference": "06e2e7b256f02672a35f1811385f1d98239c1464", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/b732364e70a615231f15944e015b31d0d77bf9f5", + "reference": "b732364e70a615231f15944e015b31d0d77bf9f5", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" }, "require-dev": { - "mockery/mockery": "0.9.*", - "phpunit/phpunit": "4.*", - "scrutinizer/ocular": "~1.1" + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "~5.3" }, - "time": "2016-07-29 15:10:32", + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" + }, + "time": "2016-12-13 14:25:55", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "installation-source": "source", "autoload": { "psr-4": { - "Spatie\\ArrayToXml\\": "src" + "Monolog\\": "src/Monolog" } }, "notification-url": "https://packagist.org/downloads/", @@ -438,18 +388,17 @@ ], "authors": [ { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://murze.be", - "role": "Developer" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "Convert an array to xml", - "homepage": "https://github.com/spatie/array-to-xml", + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", "keywords": [ - "array", - "convert", - "xml" + "log", + "logging", + "psr-3" ] }, { @@ -459,16 +408,17 @@ "source": { "type": "git", "url": "https://github.com/PHPSocialNetwork/phpfastcache.git", - "reference": "de48dc3b91799ab915785e103a9726a03b544dd7" + "reference": "8b3c5f6de94213111d229722878a608507aaf2a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPSocialNetwork/phpfastcache/zipball/de48dc3b91799ab915785e103a9726a03b544dd7", - "reference": "de48dc3b91799ab915785e103a9726a03b544dd7", + "url": "https://api.github.com/repos/PHPSocialNetwork/phpfastcache/zipball/8b3c5f6de94213111d229722878a608507aaf2a4", + "reference": "8b3c5f6de94213111d229722878a608507aaf2a4", "shasum": "" }, "require": { "ext-json": "*", + "ext-mbstring": "*", "php": "^5.6 || ^7.0", "phpfastcache/phpssdb": "~1.0.0", "predis/predis": "~1.1.0", @@ -477,14 +427,13 @@ "suggest": { "ext-apc": "*", "ext-intl": "*", - "ext-mbstring": "*", "ext-memcache": "*", "ext-memcached": "*", "ext-predis": "*", "ext-redis": "*", "ext-sqlite": "*" }, - "time": "2016-11-30 19:16:22", + "time": "2016-12-26 00:16:45", "type": "library", "installation-source": "source", "autoload": { @@ -539,5 +488,55 @@ "zend memory cache", "zend server" ] + }, + { + "name": "spatie/array-to-xml", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/spatie/array-to-xml.git", + "reference": "26344dae3450ca3efcb003343f292d9c31dc7a2d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/26344dae3450ca3efcb003343f292d9c31dc7a2d", + "reference": "26344dae3450ca3efcb003343f292d9c31dc7a2d", + "shasum": "" + }, + "require": { + "php": "^5.4|^7.0" + }, + "require-dev": { + "mockery/mockery": "0.9.*", + "phpunit/phpunit": "4.*" + }, + "time": "2016-12-08 09:21:07", + "type": "library", + "installation-source": "source", + "autoload": { + "psr-4": { + "Spatie\\ArrayToXml\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://murze.be", + "role": "Developer" + } + ], + "description": "Convert an array to xml", + "homepage": "https://github.com/spatie/array-to-xml", + "keywords": [ + "array", + "convert", + "xml" + ] } ] diff --git a/vendor/monolog/monolog/CHANGELOG.mdown b/vendor/monolog/monolog/CHANGELOG.md similarity index 100% rename from vendor/monolog/monolog/CHANGELOG.mdown rename to vendor/monolog/monolog/CHANGELOG.md diff --git a/vendor/monolog/monolog/README.mdown b/vendor/monolog/monolog/README.md similarity index 100% rename from vendor/monolog/monolog/README.mdown rename to vendor/monolog/monolog/README.md diff --git a/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php b/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php index cb0b8717..38bc838a 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php @@ -12,7 +12,7 @@ namespace Monolog\Handler\Slack; use Monolog\Logger; -use Monolog\Formatter\LineFormatter; +use Monolog\Formatter\NormalizerFormatter; use Monolog\Formatter\FormatterInterface; /** @@ -41,15 +41,15 @@ class SlackRecord /** * Name of a bot - * @var string + * @var string|null */ private $username; /** - * Emoji icon name + * User icon e.g. 'ghost', 'http://example.com/user.png' * @var string */ - private $iconEmoji; + private $userIcon; /** * Whether the message should be added to Slack as attachment (plain text otherwise) @@ -69,43 +69,52 @@ class SlackRecord */ private $includeContextAndExtra; + /** + * Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] + * @var array + */ + private $excludeFields; + /** * @var FormatterInterface */ private $formatter; /** - * @var LineFormatter + * @var NormalizerFormatter */ - private $lineFormatter; + private $normalizerFormatter; - public function __construct($channel = null, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $useShortAttachment = false, $includeContextAndExtra = false, FormatterInterface $formatter = null) + public function __construct($channel = null, $username = null, $useAttachment = true, $userIcon = null, $useShortAttachment = false, $includeContextAndExtra = false, array $excludeFields = array(), FormatterInterface $formatter = null) { $this->channel = $channel; $this->username = $username; - $this->iconEmoji = trim($iconEmoji, ':'); + $this->userIcon = trim($userIcon, ':'); $this->useAttachment = $useAttachment; $this->useShortAttachment = $useShortAttachment; $this->includeContextAndExtra = $includeContextAndExtra; + $this->excludeFields = $excludeFields; $this->formatter = $formatter; if ($this->includeContextAndExtra) { - $this->lineFormatter = new LineFormatter(); + $this->normalizerFormatter = new NormalizerFormatter(); } } public function getSlackData(array $record) { - $dataArray = array( - 'username' => $this->username, - 'text' => '', - ); + $dataArray = array(); + $record = $this->excludeFields($record); + + if ($this->username) { + $dataArray['username'] = $this->username; + } if ($this->channel) { $dataArray['channel'] = $this->channel; } - if ($this->formatter) { + if ($this->formatter && !$this->useAttachment) { $message = $this->formatter->format($record); } else { $message = $record['message']; @@ -113,19 +122,22 @@ public function getSlackData(array $record) if ($this->useAttachment) { $attachment = array( - 'fallback' => $message, - 'text' => $message, - 'color' => $this->getAttachmentColor($record['level']), - 'fields' => array(), + 'fallback' => $message, + 'text' => $message, + 'color' => $this->getAttachmentColor($record['level']), + 'fields' => array(), + 'mrkdwn_in' => array('fields'), + 'ts' => $record['datetime']->getTimestamp() ); if ($this->useShortAttachment) { $attachment['title'] = $record['level_name']; } else { $attachment['title'] = 'Message'; - $attachment['fields'][] = $this->generateAttachmentField('Level', $record['level_name'], true); + $attachment['fields'][] = $this->generateAttachmentField('Level', $record['level_name']); } + if ($this->includeContextAndExtra) { foreach (array('extra', 'context') as $key) { if (empty($record[$key])) { @@ -135,8 +147,7 @@ public function getSlackData(array $record) if ($this->useShortAttachment) { $attachment['fields'][] = $this->generateAttachmentField( ucfirst($key), - $this->stringify($record[$key]), - true + $record[$key] ); } else { // Add all extra fields as individual fields in attachment @@ -153,8 +164,12 @@ public function getSlackData(array $record) $dataArray['text'] = $message; } - if ($this->iconEmoji) { - $dataArray['icon_emoji'] = ":{$this->iconEmoji}:"; + if ($this->userIcon) { + if (filter_var($this->userIcon, FILTER_VALIDATE_URL)) { + $dataArray['icon_url'] = $this->userIcon; + } else { + $dataArray['icon_emoji'] = ":{$this->userIcon}:"; + } } return $dataArray; @@ -184,23 +199,21 @@ public function getAttachmentColor($level) /** * Stringifies an array of key/value pairs to be used in attachment fields * - * @param array $fields - * @return string|null + * @param array $fields + * + * @return string */ public function stringify($fields) { - if (!$this->lineFormatter) { - return null; - } - - $string = ''; - foreach ($fields as $var => $val) { - $string .= $var.': '.$this->lineFormatter->stringify($val)." | "; - } + $normalized = $this->normalizerFormatter->format($fields); + $prettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128; - $string = rtrim($string, " |"); + $hasSecondDimension = count(array_filter($normalized, 'is_array')); + $hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric')); - return $string; + return $hasSecondDimension || $hasNonNumericKeys + ? json_encode($normalized, $prettyPrintFlag) + : json_encode($normalized); } /** @@ -217,16 +230,20 @@ public function setFormatter(FormatterInterface $formatter) * Generates attachment field * * @param string $title - * @param string|array $value - * @param bool $short + * @param string|array $value\ + * * @return array */ - private function generateAttachmentField($title, $value, $short) + private function generateAttachmentField($title, $value) { + $value = is_array($value) + ? sprintf('```%s```', $this->stringify($value)) + : $value; + return array( 'title' => $title, - 'value' => is_array($value) ? $this->lineFormatter->stringify($value) : $value, - 'short' => $short + 'value' => $value, + 'short' => false ); } @@ -234,15 +251,44 @@ private function generateAttachmentField($title, $value, $short) * Generates a collection of attachment fields from array * * @param array $data + * * @return array */ private function generateAttachmentFields(array $data) { $fields = array(); foreach ($data as $key => $value) { - $fields[] = $this->generateAttachmentField($key, $value, false); + $fields[] = $this->generateAttachmentField($key, $value); } return $fields; } + + /** + * Get a copy of record with fields excluded according to $this->excludeFields + * + * @param array $record + * + * @return array + */ + private function excludeFields(array $record) + { + foreach ($this->excludeFields as $field) { + $keys = explode('.', $field); + $node = &$record; + $lastKey = end($keys); + foreach ($keys as $key) { + if (!isset($node[$key])) { + break; + } + if ($lastKey === $key) { + unset($node[$key]); + break; + } + $node = &$node[$key]; + } + } + + return $record; + } } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php index c2cca0c8..9324fc9a 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php @@ -38,16 +38,17 @@ class SlackHandler extends SocketHandler /** * @param string $token Slack API token * @param string $channel Slack channel (encoded ID or name) - * @param string $username Name of a bot + * @param string|null $username Name of a bot * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise) * @param string|null $iconEmoji The emoji name to use (or null) * @param int $level The minimum logging level at which this handler will be triggered * @param bool $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style * @param bool $includeContextAndExtra Whether the attachment should include context and extra data + * @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] * @throws MissingExtensionException If no OpenSSL PHP extension configured */ - public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false) + public function __construct($token, $channel, $username = null, $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false, array $excludeFields = array()) { if (!extension_loaded('openssl')) { throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler'); @@ -62,6 +63,7 @@ public function __construct($token, $channel, $username = 'Monolog', $useAttachm $iconEmoji, $useShortAttachment, $includeContextAndExtra, + $excludeFields, $this->formatter ); diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php index a2df0f1a..0d3e3ea1 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php @@ -38,15 +38,16 @@ class SlackWebhookHandler extends AbstractProcessingHandler /** * @param string $webhookUrl Slack Webhook URL * @param string|null $channel Slack channel (encoded ID or name) - * @param string $username Name of a bot + * @param string|null $username Name of a bot * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise) * @param string|null $iconEmoji The emoji name to use (or null) * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style * @param bool $includeContextAndExtra Whether the attachment should include context and extra data * @param int $level The minimum logging level at which this handler will be triggered * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] */ - public function __construct($webhookUrl, $channel = null, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $useShortAttachment = false, $includeContextAndExtra = false, $level = Logger::CRITICAL, $bubble = true) + public function __construct($webhookUrl, $channel = null, $username = null, $useAttachment = true, $iconEmoji = null, $useShortAttachment = false, $includeContextAndExtra = false, $level = Logger::CRITICAL, $bubble = true, array $excludeFields = array()) { parent::__construct($level, $bubble); @@ -59,6 +60,7 @@ public function __construct($webhookUrl, $channel = null, $username = 'Monolog', $iconEmoji, $useShortAttachment, $includeContextAndExtra, + $excludeFields, $this->formatter ); } diff --git a/vendor/phpfastcache/phpfastcache/README.md b/vendor/phpfastcache/phpfastcache/README.md index 3ad7a4a1..b22e2cdb 100644 --- a/vendor/phpfastcache/phpfastcache/README.md +++ b/vendor/phpfastcache/phpfastcache/README.md @@ -12,30 +12,32 @@ One Class uses for All Cache. You don't need to rewrite your code many times aga ### Supported drivers at this day * :bulb: Feel free to propose a driver by making a new **Pull Request**, they are welcome ! -| Regular drivers | High performances drivers | Development driver | -|--------------------|---------------------------|--------------------| -| `Apc(u)` | `CouchBase` | `Devnull` | -| `Cookie` | `Mongodb` | `Devfalse` | -| `Files` | `Predis` | `Devtrue` | -| `Leveldb` | `Redis` | | -| `Memcache(d)` | `Ssdb` | | -| `Sqlite` | `Zend Memory Cache` | | -| `Wincache` | | | -| `Xcache` | | | -| `Zend Disk Cache` | | | +| Regular drivers | High performances drivers | Development drivers | +|--------------------|---------------------------|---------------------| +| `Apc(u)` | `CouchBase` | `Devnull` | +| `Cookie` | `Mongodb` | `Devfalse` | +| `Files` | `Predis` | `Devtrue` | +| `Leveldb` | `Redis` | `Memstatic` | +| `Memcache(d)` | `Ssdb` | | +| `Sqlite` | `Zend Memory Cache` | | +| `Wincache` | | | +| `Xcache` | | | +| `Zend Disk Cache` | | | \* Driver descriptions available in DOCS/DRIVERS.md -### Symfony developers are not forgotten ! -Starting of the v5, phpFastCache comes with a [Symfony Bundle](https://github.com/PHPSocialNetwork/phpfastcache-bundle). -He's fresh, so feel free to report any bug or contribute to the code using pull requests. +### Symfony/Drupal developers are not forgotten ! +Starting with v5, phpFastCache comes with a [Symfony Bundle](https://github.com/PHPSocialNetwork/phpfastcache-bundle). +It's fresh, so feel free to report any bug or contribute to the project using pull requests. + +Also a [Drupal 8 Module](https://github.com/PHPSocialNetwork/phpfastcache-drupal) is currently in development, add it to your starred projects to get notified of the first public release. --------------------------- Not a "Traditional" Caching --------------------------- -phpFastCache is not a traditional caching method which keep read and write to files, sqlite or mass connections to memcache, redis, mongodb... Also, when you use Memcache / Memcached, your miss hits will be reduce. -Different with normal caching methods which shared everywhere on internet, phpFastCache Lib reduce the high I/O load, and faster than traditional caching method at least x7 ~+ times. -However, some time you still want to use traditional caching, we support them too. +phpFastCache is not like the traditional caching methods which keep reading and writing to files, sqlite or keeping open massive amounts of connections to memcache, redis, mongodb... Also, when you use Memcache / Memcached, your miss hits will be reduced. +Different from the usual caching methods you'll find everywhere on the internet, the phpFastCache library reduces high I/O load, and is faster than the traditional caching methods by at least ~7 times. +However, when you still want to use traditional caching methods, we support them too. ```php use phpFastCache\CacheManager; @@ -50,8 +52,8 @@ CacheManager::Files($config); Reduce Database Calls --------------------------- -Your website have 10,000 visitors who are online, and your dynamic page have to send 10,000 same queries to database on every page load. -With phpFastCache, your page only send 1 query to DB, and use the cache to serve 9,999 other visitors. +Your website has 10,000 visitors who are online, and your dynamic page has to send 10,000 times the same queries to database on every page load. +With phpFastCache, your page only sends 1 query to your DB, and uses the cache to serve the 9,999 other visitors. --------------------------- Rich Development API @@ -60,68 +62,68 @@ Rich Development API phpFastCache offers you a lot of useful APIs: ### Item API -- getKey() // Return the item identifier (key) -- get() // The getter, obviously, return your cache object -- set($value) // The setter, for those who missed it, put 0 meant cache it forever -- expiresAfter($ttl) // Allow you to extends the lifetime of an entry without altering the value (formerly known as touch()) +- getKey() // Returns the item identifier (key) +- get() // The getter, obviously, returns your cache object +- set($value) // The setter, for those who missed it, putting 0 means cache it forever +- expiresAfter($ttl) // Allows you to extends the lifetime of an entry without altering its value (formerly known as touch()) - expiresAt($expiration) // Sets the expiration time for this cache item (as a DateTimeInterface object) -- increment($step = 1) // For integer that we can count on +- increment($step = 1) // To allow us to count on an integer item - decrement($step = 1) // Redundant joke... -- append($data) // Append data to a string or an array (push) -- prepend($data) // Prepend data to a string or an array (unshift) -- isHit() // Check if your cache entry exists and is still valid, it is the equivalent of isset() -- isExpired() // Check if your cache entry is expired -- getTtl() // Get the remaining Time To Live as an integer -- getExpirationDate() // Get the expiration date as a Datetime object -- addTag($tagName) // Add a tag -- addTags(array $tagNames) // Add many tags -- setTags(array $tags) // Set some tags -- getTags() // Get the tags -- getTagsAsString($separator = ', ') // Get the data a string separated by $separator -- removeTag($tagName) // Remove a tag -- removeTags(array $tagNames) // Remove some tags +- append($data) // Appends data to a string or an array (push) +- prepend($data) // Prepends data to a string or an array (unshift) +- isHit() // Checks if your cache entry exists and is still valid, it's the equivalent of isset() +- isExpired() // Checks if your cache entry is expired +- getTtl() // Gets the remaining Time To Live as an integer +- getExpirationDate() // Gets the expiration date as a Datetime object +- addTag($tagName) // Adds a tag +- addTags(array $tagNames) // Adds multiple tags +- setTags(array $tags) // Sets multiple tags +- getTags() // Gets the tags +- getTagsAsString($separator = ', ') // Gets the data as a string separated by $separator +- removeTag($tagName) // Removes a tag +- removeTags(array $tagNames) // Removes multiple tags - getDataAsJsonString()// Return the data as a well-formatted json string - setExpirationDate() // Alias of expireAt() (for more code logic) -- getCreationDate() // Get the creation date for this cache item (as a DateTimeInterface object) * -- getModificationDate() // Get the modification date for this cache item (as a DateTimeInterface object) * -- setCreationDate($expiration) // Set the creation date for this cache item (as a DateTimeInterface object) * -- setModificationDate($expiration) // Set the modification date for this cache item (as a DateTimeInterface object) * -- setEventManager($evtMngr) // Set the event manager +- getCreationDate() // Gets the creation date for this cache item (as a DateTimeInterface object) * +- getModificationDate() // Gets the modification date for this cache item (as a DateTimeInterface object) * +- setCreationDate($expiration) // Sets the creation date for this cache item (as a DateTimeInterface object) * +- setModificationDate($expiration) // Sets the modification date for this cache item (as a DateTimeInterface object) * +- setEventManager($evtMngr) // Sets the event manager \* Require configuration directive "itemDetailedDate" to be enabled ### ItemPool API -- getItem($key) // Retrieve an item and returns an empty item if not found -- getItems(array $keys) // Retrieve one or more item and returns an array of items +- getItem($key) // Retrieves an item and returns an empty item if not found +- getItems(array $keys) // Retrieves one or more item and returns an array of items - getItemsAsJsonString(array $keys) // Returns A json string that represents an array of items - hasItem($key) // Tests if an item exists -- deleteItem($key) // Delete an item -- deleteItems(array $keys) // Delete one or more items +- deleteItem($key) // Deletes an item +- deleteItems(array $keys) // Deletes one or more items - save(CacheItemInterface $item) // Persists a cache item immediately - saveDeferred(CacheItemInterface $item); // Sets a cache item to be persisted later - commit(); // Persists any deferred cache items -- clear() // Allow you to completely empty the cache and restart from the beginning -- getStats() // Return the cache statistics as an object, useful for checking disk space used by the cache etc. -- getItemsByTag($tagName) // Return items by a tag -- getItemsByTags(array $tagNames) // Return items by some tags -- getItemsByTagsAsJsonString(array $tagNames) // Returns A json string that represents an array of items by tags-based -- deleteItemsByTag($tagName) // Delete items by a tag -- deleteItemsByTags(array $tagNames) // Delete items by some tags -- incrementItemsByTag($tagName, $step = 1) // Increment items by a tag -- incrementItemsByTags(array $tagNames, $step = 1) // Increment items by some tags -- decrementItemsByTag($tagName, $step = 1) // Decrement items by a tag -- decrementItemsByTags(array $tagNames, $step = 1) // Decrement items by some tags -- appendItemsByTag($tagName, $data) // Append items by a tag -- appendItemsByTags(array $tagNames, $data) // Append items by some tags -- prependItemsByTag($tagName, $data) // Prepend items by a tag -- prependItemsByTags(array $tagNames, $data) // Prepend items by some tags -- detachItem($item) // Detach an item from the pool -- detachAllItems($item) // Detach all items from the pool -- attachItem($item) // (Re-)attach an item to the pool +- clear() // Allows you to completely empty the cache and restart from the beginning +- getStats() // Returns the cache statistics as an object, useful for checking disk space used by the cache etc. +- getItemsByTag($tagName) // Returns items by a tag +- getItemsByTags(array $tagNames) // Returns items by multiple tags +- getItemsByTagsAsJsonString(array $tagNames) // Returns A json string that represents an array of items corresponding to given tags +- deleteItemsByTag($tagName) // Deletes items by a tag +- deleteItemsByTags(array $tagNames) // Deletes items by multiple tags +- incrementItemsByTag($tagName, $step = 1) // Increments items by a tag +- incrementItemsByTags(array $tagNames, $step = 1) // Increments items by multiple tags +- decrementItemsByTag($tagName, $step = 1) // Decrements items by a tag +- decrementItemsByTags(array $tagNames, $step = 1) // Decrements items by multiple tags +- appendItemsByTag($tagName, $data) // Appends items by a tag +- appendItemsByTags(array $tagNames, $data) // Appends items by multiple tags +- prependItemsByTag($tagName, $data) // Prepends items by a tag +- prependItemsByTags(array $tagNames, $data) // Prepends items by multiple tags +- detachItem($item) // Detaches an item from the pool +- detachAllItems($item) // Detaches all items from the pool +- attachItem($item) // (Re-)attaches an item to the pool - isAttached($item) // Verify if an item is (still) attached -- setEventManager($evtMngr) // Set the event manager +- setEventManager($evtMngr) // Sets the event manager -Also support Multiple calls, Tagging, Setup Folder for caching. Look at our examples folders. +It also supports multiple calls, Tagging, Setup Folder for caching. Look at our examples folders for more information. --------------------------- Introducing to events @@ -162,7 +164,7 @@ EventManager::getInstance()->unbindEventCallback('onCacheGetItem', 'myCallbackNa ``` -More informations about the implementation and the events on the [Wiki](https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV6%5D-Introducing-to-events) +More information about the implementation and the events available on the [Wiki](https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV6%5D-Introducing-to-events) --------------------------- As Fast To Implement As Opening a Beer @@ -176,7 +178,7 @@ As Fast To Implement As Opening a Beer composer require phpFastCache/phpFastCache ``` -#### :construction: Step 2: Setup your website code to implements phpFastCache bits (With Composer) +#### :construction: Step 2: Setup your website code to implement the phpFastCache calls (with Composer) ```php use phpFastCache\CacheManager; @@ -215,7 +217,7 @@ if (is_null($CachedString->get())) { } /** - * use your products here or return it; + * use your products here or return them; */ echo implode('
', $CachedString->get());// Will echo your product list @@ -224,8 +226,8 @@ echo implode('
', $CachedString->get());// Will echo your product list ##### :floppy_disk: Legacy / Lazy Method (Without Composer) * See the file examples/withoutComposer.php for more information. -#### :zap: Step 3: Enjoy ! Your website is now faster than flash ! -For curious developpers, there is a lot of others available examples [here](https://github.com/PHPSocialNetwork/phpfastcache/tree/final/examples). +#### :zap: Step 3: Enjoy ! Your website is now faster than lightning ! +For curious developpers, there is a lot of other examples available [here](https://github.com/PHPSocialNetwork/phpfastcache/tree/final/examples). #### :boom: phpFastCache support -Found an issue or had an idea ? Come [here](https://github.com/PHPSocialNetwork/phpfastcache/issues) and let us know ! +Found an issue or have an idea ? Come [here](https://github.com/PHPSocialNetwork/phpfastcache/issues) and let us know ! diff --git a/vendor/phpfastcache/phpfastcache/composer.json b/vendor/phpfastcache/phpfastcache/composer.json index 95af3bb2..d23510a2 100644 --- a/vendor/phpfastcache/phpfastcache/composer.json +++ b/vendor/phpfastcache/phpfastcache/composer.json @@ -24,12 +24,12 @@ "psr/cache": "~1.0.0", "predis/predis": "~1.1.0", "phpfastcache/phpssdb": "~1.0.0", + "ext-mbstring": "*", "ext-json": "*" }, "suggest": { "ext-apc": "*", "ext-intl": "*", - "ext-mbstring": "*", "ext-memcached": "*", "ext-memcache": "*", "ext-redis": "*", diff --git a/vendor/phpfastcache/phpfastcache/docs/DRIVERS.md b/vendor/phpfastcache/phpfastcache/docs/DRIVERS.md index dfcd4ab3..d70073e2 100644 --- a/vendor/phpfastcache/phpfastcache/docs/DRIVERS.md +++ b/vendor/phpfastcache/phpfastcache/docs/DRIVERS.md @@ -21,6 +21,8 @@ * The Memcache driver. A memory cache for regular performances. Do not cross this driver with Memcached driver * Memcached * The Memcached driver. A memory cache for regular performances. Do not cross this driver with Memcache driver +* Memstatic + * The Memstatic driver is a memory static driver that expires when the script execution ends * Mongodb * A very high-performance NoSQL driver using a key-value pair system * Predis diff --git a/vendor/phpfastcache/phpfastcache/src/autoload.php b/vendor/phpfastcache/phpfastcache/src/autoload.php index 84383755..bc2279de 100644 --- a/vendor/phpfastcache/phpfastcache/src/autoload.php +++ b/vendor/phpfastcache/phpfastcache/src/autoload.php @@ -45,7 +45,7 @@ } }); -if (class_exists('Composer\Autoload\ClassLoader')) { - trigger_error('Your project already makes use of Composer. You SHOULD use the composer dependency "phpfastcache/phpfastcache" instead of hard-autoloading.', - E_USER_WARNING); +if ((!defined('PFC_IGNORE_COMPOSER_WARNING') || !PFC_IGNORE_COMPOSER_WARNING) && class_exists('Composer\Autoload\ClassLoader')) { + trigger_error('Your project already makes use of Composer. You SHOULD use the composer dependency "phpfastcache/phpfastcache" instead of hard-autoloading.', + E_USER_WARNING); } \ No newline at end of file diff --git a/vendor/phpfastcache/phpfastcache/src/phpFastCache/CacheManager.php b/vendor/phpfastcache/phpfastcache/src/phpFastCache/CacheManager.php index 06566264..a78bc1a7 100644 --- a/vendor/phpfastcache/phpfastcache/src/phpFastCache/CacheManager.php +++ b/vendor/phpfastcache/phpfastcache/src/phpFastCache/CacheManager.php @@ -260,21 +260,22 @@ public static function getDefaultConfig() public static function getStaticSystemDrivers() { return [ - 'Sqlite', - 'Files', 'Apc', 'Apcu', + 'Couchbase', + 'Devnull', + 'Files', + 'Leveldb', 'Memcache', 'Memcached', - 'Couchbase', + 'Memstatic', 'Mongodb', 'Predis', 'Redis', 'Ssdb', - 'Leveldb', + 'Sqlite', 'Wincache', 'Xcache', - 'Devnull', ]; } diff --git a/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Apcu/Driver.php b/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Apcu/Driver.php index 27b2091b..f53f97c0 100644 --- a/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Apcu/Driver.php +++ b/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Apcu/Driver.php @@ -70,7 +70,7 @@ protected function driverWrite(CacheItemInterface $item) if ($item instanceof Item) { $ttl = $item->getExpirationDate()->getTimestamp() - time(); - return apc_store($item->getKey(), $this->driverPreWrap($item), ($ttl > 0 ? $ttl : 0)); + return apcu_store($item->getKey(), $this->driverPreWrap($item), ($ttl > 0 ? $ttl : 0)); } else { throw new \InvalidArgumentException('Cross-Driver type confusion detected'); } @@ -82,7 +82,7 @@ protected function driverWrite(CacheItemInterface $item) */ protected function driverRead(CacheItemInterface $item) { - $data = apc_fetch($item->getKey(), $success); + $data = apcu_fetch($item->getKey(), $success); if ($success === false) { return null; } @@ -101,7 +101,7 @@ protected function driverDelete(CacheItemInterface $item) * Check for Cross-Driver type confusion */ if ($item instanceof Item) { - return apc_delete($item->getKey()); + return apcu_delete($item->getKey()); } else { throw new \InvalidArgumentException('Cross-Driver type confusion detected'); } @@ -112,7 +112,7 @@ protected function driverDelete(CacheItemInterface $item) */ protected function driverClear() { - return @apc_clear_cache() && @apc_clear_cache('user'); + return @apcu_clear_cache() && @apcu_clear_cache('user'); } /** @@ -134,7 +134,7 @@ protected function driverConnect() */ public function getStats() { - $stats = (array) apc_cache_info('user'); + $stats = (array) apcu_cache_info('user'); $date = (new \DateTime())->setTimestamp($stats[ 'start_time' ]); return (new driverStatistic()) diff --git a/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Memstatic/Driver.php b/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Memstatic/Driver.php new file mode 100644 index 00000000..8f186e1c --- /dev/null +++ b/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Memstatic/Driver.php @@ -0,0 +1,152 @@ + http://www.phpfastcache.com + * @author Georges.L (Geolim4) + * + */ + +namespace phpFastCache\Drivers\Memstatic; + +use phpFastCache\Core\Pool\DriverBaseTrait; +use phpFastCache\Core\Pool\ExtendedCacheItemPoolInterface; +use phpFastCache\Entities\driverStatistic; +use phpFastCache\Exceptions\phpFastCacheDriverCheckException; +use phpFastCache\Exceptions\phpFastCacheDriverException; +use Psr\Cache\CacheItemInterface; + +/** + * Class Driver + * @package phpFastCache\Drivers + */ +class Driver implements ExtendedCacheItemPoolInterface +{ + use DriverBaseTrait; + + /** + * @var array + */ + protected $staticStack = []; + + /** + * Driver constructor. + * @param array $config + * @throws phpFastCacheDriverException + */ + public function __construct(array $config = []) + { + $this->setup($config); + + if (!$this->driverCheck()) { + throw new phpFastCacheDriverCheckException(sprintf(self::DRIVER_CHECK_FAILURE, $this->getDriverName())); + } + } + + /** + * @return bool + */ + public function driverCheck() + { + return true; + } + + /** + * @param \Psr\Cache\CacheItemInterface $item + * @return mixed + * @throws \InvalidArgumentException + */ + protected function driverWrite(CacheItemInterface $item) + { + /** + * Check for Cross-Driver type confusion + */ + if ($item instanceof Item) { + return $this->staticStack[md5($item->getKey())] = $this->driverPreWrap($item); + } else { + throw new \InvalidArgumentException('Cross-Driver type confusion detected'); + } + } + + /** + * @param \Psr\Cache\CacheItemInterface $item + * @return array [ + * 'd' => 'THE ITEM DATA' + * 't' => 'THE ITEM DATE EXPIRATION' + * 'g' => 'THE ITEM TAGS' + * ] + */ + protected function driverRead(CacheItemInterface $item) + { + $key = md5($item->getKey()); + if(isset($this->staticStack[$key])){ + return $this->staticStack[$key]; + } + return null; + } + + /** + * @param \Psr\Cache\CacheItemInterface $item + * @return bool + * @throws \InvalidArgumentException + */ + protected function driverDelete(CacheItemInterface $item) + { + /** + * Check for Cross-Driver type confusion + */ + if ($item instanceof Item) { + $key = md5($item->getKey()); + if(isset($this->staticStack[$key])){ + unset($this->staticStack[$key]); + return true; + } + return false; + } else { + throw new \InvalidArgumentException('Cross-Driver type confusion detected'); + } + } + + /** + * @return bool + */ + protected function driverClear() + { + unset($this->staticStack); + $this->staticStack = []; + return true; + } + + /** + * @return bool + */ + protected function driverConnect() + { + return true; + } + + /******************** + * + * PSR-6 Extended Methods + * + *******************/ + + /** + * @return driverStatistic + */ + public function getStats() + { + $stat = new driverStatistic(); + $stat->setInfo('[Memstatic] A memory static driver') + ->setSize(mb_strlen(serialize($this->staticStack))) + ->setData(implode(', ', array_keys($this->itemInstances))) + ->setRawData($this->staticStack); + + return $stat; + } +} \ No newline at end of file diff --git a/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Memstatic/Item.php b/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Memstatic/Item.php new file mode 100644 index 00000000..8a0cb05b --- /dev/null +++ b/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Memstatic/Item.php @@ -0,0 +1,63 @@ + http://www.phpfastcache.com + * @author Georges.L (Geolim4) + * + */ + +namespace phpFastCache\Drivers\Memstatic; + +use phpFastCache\Core\Item\ExtendedCacheItemInterface; +use phpFastCache\Core\Pool\ExtendedCacheItemPoolInterface; +use phpFastCache\Core\Item\ItemBaseTrait; +use phpFastCache\Drivers\Memstatic\Driver as MemstaticDriver; + +/** + * Class Item + * @package phpFastCache\Drivers\Devnull + */ +class Item implements ExtendedCacheItemInterface +{ + use ItemBaseTrait; + + /** + * Item constructor. + * @param \phpFastCache\Drivers\Memstatic\Driver $driver + * @param $key + * @throws \InvalidArgumentException + */ + public function __construct(MemstaticDriver $driver, $key) + { + if (is_string($key)) { + $this->key = $key; + $this->driver = $driver; + $this->driver->setItem($this); + $this->expirationDate = new \DateTime(); + } else { + throw new \InvalidArgumentException(sprintf('$key must be a string, got type "%s" instead.', gettype($key))); + } + } + + /** + * @param ExtendedCacheItemPoolInterface $driver + * @throws \InvalidArgumentException + * @return static + */ + public function setDriver(ExtendedCacheItemPoolInterface $driver) + { + if ($driver instanceof MemstaticDriver) { + $this->driver = $driver; + + return $this; + } else { + throw new \InvalidArgumentException('Invalid driver instance'); + } + } +} \ No newline at end of file diff --git a/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Mongodb/Driver.php b/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Mongodb/Driver.php index 778a0acd..af2162ec 100644 --- a/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Mongodb/Driver.php +++ b/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Mongodb/Driver.php @@ -67,7 +67,7 @@ public function driverCheck() The Support for the MongoDB extension will be added coming soon.', E_USER_ERROR); } - return extension_loaded('Mongodb'); + return extension_loaded('Mongodb') && class_exists('MongoClient'); } /** diff --git a/vendor/spatie/array-to-xml/CHANGELOG.md b/vendor/spatie/array-to-xml/CHANGELOG.md index c6772c1b..77e5eeab 100755 --- a/vendor/spatie/array-to-xml/CHANGELOG.md +++ b/vendor/spatie/array-to-xml/CHANGELOG.md @@ -2,7 +2,10 @@ All Notable changes to `array-to-xml` will be documented in this file -# 2.2.0 - 2016-06-04 +## 2.2.1 - 2016-12-08 +- fixed an error when there is a special character to the value set in _value + +## 2.2.0 - 2016-06-04 - added `toDom` method ## 2.1.1 - 2016-02-23 diff --git a/vendor/spatie/array-to-xml/LICENSE.md b/vendor/spatie/array-to-xml/LICENSE.md index 86f85b25..70162900 100755 --- a/vendor/spatie/array-to-xml/LICENSE.md +++ b/vendor/spatie/array-to-xml/LICENSE.md @@ -1,6 +1,6 @@ # The MIT License (MIT) -Copyright (c) 2015 Freek Van der Herten +Copyright (c) 2016 Spatie bvba > 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/vendor/spatie/array-to-xml/README.md b/vendor/spatie/array-to-xml/README.md index 159c840f..f0979f44 100755 --- a/vendor/spatie/array-to-xml/README.md +++ b/vendor/spatie/array-to-xml/README.md @@ -4,6 +4,7 @@ [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) [![Build Status](https://img.shields.io/travis/spatie/array-to-xml/master.svg?style=flat-square)](https://travis-ci.org/spatie/array-to-xml) [![Quality Score](https://img.shields.io/scrutinizer/g/spatie/array-to-xml.svg?style=flat-square)](https://scrutinizer-ci.com/g/spatie/array-to-xml) +[![StyleCI](https://styleci.io/repos/32388747/shield?branch=master)](https://styleci.io/repos/32388747) [![Total Downloads](https://img.shields.io/packagist/dt/spatie/array-to-xml.svg?style=flat-square)](https://packagist.org/packages/spatie/array-to-xml) This package provides a very simple class to convert an array to an xml string. diff --git a/vendor/spatie/array-to-xml/composer.json b/vendor/spatie/array-to-xml/composer.json index 51a7121a..3cc47d7c 100755 --- a/vendor/spatie/array-to-xml/composer.json +++ b/vendor/spatie/array-to-xml/composer.json @@ -17,12 +17,11 @@ } ], "require": { - "php" : ">=5.3.0" + "php" : "^5.4|^7.0" }, "require-dev": { "phpunit/phpunit" : "4.*", - "mockery/mockery": "0.9.*", - "scrutinizer/ocular": "~1.1" + "mockery/mockery": "0.9.*" }, "autoload": { "psr-4": { diff --git a/vendor/spatie/array-to-xml/src/ArrayToXml.php b/vendor/spatie/array-to-xml/src/ArrayToXml.php index fb71e706..00a24658 100644 --- a/vendor/spatie/array-to-xml/src/ArrayToXml.php +++ b/vendor/spatie/array-to-xml/src/ArrayToXml.php @@ -36,7 +36,7 @@ public function __construct(array $array, $rootElementName = '', $replaceSpacesB $this->document = new DOMDocument(); $this->replaceSpacesByUnderScoresInKeyNames = $replaceSpacesByUnderScoresInKeyNames; - if ($this->isArrayAllKeySequential($array) && !empty($array)) { + if ($this->isArrayAllKeySequential($array) && ! empty($array)) { throw new DOMException('Invalid Character Error'); } @@ -93,18 +93,18 @@ private function convertElement(DOMElement $element, $value) { $sequential = $this->isArrayAllKeySequential($value); - if (!is_array($value)) { + if (! is_array($value)) { $element->nodeValue = htmlspecialchars($value); return; } foreach ($value as $key => $data) { - if (!$sequential) { + if (! $sequential) { if ($key === '_attributes') { $this->addAttributes($element, $data); } elseif ($key === '_value' && is_string($data)) { - $element->nodeValue = $data; + $element->nodeValue = htmlspecialchars($data); } else { $this->addNode($element, $key, $data); } @@ -185,7 +185,7 @@ protected function addSequentialNode(DOMElement $element, $value) */ protected function isArrayAllKeySequential($value) { - if (!is_array($value)) { + if (! is_array($value)) { return false; } @@ -193,7 +193,7 @@ protected function isArrayAllKeySequential($value) return true; } - return array_unique(array_map('is_int', array_keys($value))) === array(true); + return array_unique(array_map('is_int', array_keys($value))) === [true]; } /**