diff --git a/Dockerfile b/Dockerfile
index ce2c895..1a22996 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,4 +4,6 @@ COPY . /app/module
COPY tools/docker/usr/ /usr/
COPY tools/docker/etc/ /etc/
+ARG GITHUB_TOKEN=
+
RUN bash /app/module/tools/docker/usr/local/share/container/plan.sh
diff --git a/composer.json b/composer.json
index 455d58d..34d3adb 100755
--- a/composer.json
+++ b/composer.json
@@ -5,8 +5,9 @@
"description": "Cloudinary Magento Integration.",
"require": {
"php": ">=5.4.0",
- "magento-hackathon/magento-composer-installer":"*",
- "cloudinary/cloudinary_php": "~1.1.1"
+ "cloudinary/cloudinary_php": "~1.6.0",
+ "inviqa/cloudinary-core": "~1.1.0",
+ "inviqa/cloudinary-m1-testcard": "~1.1.1"
},
"require-dev": {
"phpspec/phpspec": "2.1.0-RC1",
@@ -25,22 +26,21 @@
"theseer/fxsl": "1.0.*@dev",
"phpunit/phpunit": "3.7.*",
"covex-nn/phpcb": "1.0.*@dev",
- "bossa/phpspec2-expect": "dev-master",
+ "bossa/phpspec2-expect": "1.0.3",
"symfony/dependency-injection": "2.6.4"
},
"config": {
- "bin-dir": "bin"
+ "bin-dir": "bin",
+ "secure-http": false,
+ "magento-deploystrategy": "copy"
},
"autoload": {
"psr-0": {
"": [
- "../../../public/app",
- "../../../public/app/code/local",
- "../../../public/app/code/community",
- "../../../public/app/code/core",
- "../../../public/lib",
+ "src/app/code/community",
"features/bootstrap",
- "src/lib/Cloudinary/src"
+ "src/lib/Cloudinary/src",
+ "src/lib"
]
}
},
@@ -48,9 +48,17 @@
{
"type": "composer",
"url": "http://packages.firegento.com"
+ },
+ {
+ "type": "vcs",
+ "url": "https://github.com/inviqa/cloudinary-core.git"
+ },
+ {
+ "type": "vcs",
+ "url": "https://github.com/inviqa/cloudinary-m1-testcard.git"
}
],
"extra": {
- "magento-root-dir": "./"
+ "magento-root-dir": "/app/public"
}
}
diff --git a/composer.lock b/composer.lock
index 1a295c7..4b3e582 100755
--- a/composer.lock
+++ b/composer.lock
@@ -4,21 +4,21 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "778214c725da95b1ae8542b3e4a0d721",
- "content-hash": "2d088e3fdf20818e23590db7d45ee621",
+ "hash": "859d806db18164a306d47e49657e3114",
+ "content-hash": "439eeda0b48d168d7b0aa8fa8d595174",
"packages": [
{
"name": "cloudinary/cloudinary_php",
- "version": "1.1.4",
+ "version": "1.6.2",
"source": {
"type": "git",
"url": "https://github.com/cloudinary/cloudinary_php.git",
- "reference": "99fce1c4a8c293f2dadcdba5cf292572f5071287"
+ "reference": "8b89be228b39bcdb36d5e642e9796c756760737e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/cloudinary/cloudinary_php/zipball/99fce1c4a8c293f2dadcdba5cf292572f5071287",
- "reference": "99fce1c4a8c293f2dadcdba5cf292572f5071287",
+ "url": "https://api.github.com/repos/cloudinary/cloudinary_php/zipball/8b89be228b39bcdb36d5e642e9796c756760737e",
+ "reference": "8b89be228b39bcdb36d5e642e9796c756760737e",
"shasum": ""
},
"require": {
@@ -57,32 +57,30 @@
"image management",
"sdk"
],
- "time": "2015-08-23 20:03:14"
+ "time": "2017-02-23 01:10:18"
},
{
"name": "eloquent/composer-config-reader",
- "version": "2.0.1",
+ "version": "2.0.2",
"source": {
"type": "git",
"url": "https://github.com/eloquent/composer-config-reader.git",
- "reference": "f6e72fc8a241e98e0e54657ba02df1df4f678292"
+ "reference": "873dfd6d2b38c14bf1bfd0deb0f54ac7e11d1a14"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/eloquent/composer-config-reader/zipball/f6e72fc8a241e98e0e54657ba02df1df4f678292",
- "reference": "f6e72fc8a241e98e0e54657ba02df1df4f678292",
+ "url": "https://api.github.com/repos/eloquent/composer-config-reader/zipball/873dfd6d2b38c14bf1bfd0deb0f54ac7e11d1a14",
+ "reference": "873dfd6d2b38c14bf1bfd0deb0f54ac7e11d1a14",
"shasum": ""
},
"require": {
"eloquent/enumeration": "^5",
- "icecave/isolator": "^3",
- "justinrainbow/json-schema": "^2",
+ "justinrainbow/json-schema": "^4",
"php": ">=5.3"
},
"require-dev": {
"eloquent/liberator": "^2",
- "friendsofphp/php-cs-fixer": "^1",
- "phake/phake": "^2",
+ "eloquent/phony": "0.14.4",
"phpunit/phpunit": "^4"
},
"type": "library",
@@ -110,7 +108,7 @@
"parser",
"reader"
],
- "time": "2016-06-23 07:33:20"
+ "time": "2016-12-20 03:37:03"
},
{
"name": "eloquent/enumeration",
@@ -164,75 +162,105 @@
"time": "2015-11-03 22:21:38"
},
{
- "name": "icecave/isolator",
- "version": "3.0.3",
+ "name": "inviqa/cloudinary-core",
+ "version": "1.1.0",
"source": {
"type": "git",
- "url": "https://github.com/IcecaveStudios/isolator.git",
- "reference": "8fad9e64c393238b01b359e01bd7f25dcdb818e4"
+ "url": "git@github.com:inviqa/cloudinary-core.git",
+ "reference": "46a05bb73c6d597ebb96a7609034c3d35300e00d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/IcecaveStudios/isolator/zipball/8fad9e64c393238b01b359e01bd7f25dcdb818e4",
- "reference": "8fad9e64c393238b01b359e01bd7f25dcdb818e4",
+ "url": "https://api.github.com/repos/inviqa/cloudinary-core/zipball/46a05bb73c6d597ebb96a7609034c3d35300e00d",
+ "reference": "46a05bb73c6d597ebb96a7609034c3d35300e00d",
"shasum": ""
},
"require": {
- "php": ">=5.3"
+ "cloudinary/cloudinary_php": "~1.6.0",
+ "php": ">=5.4.0"
},
"require-dev": {
- "icecave/archer": "~1"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-develop": "3.0.x-dev"
+ "behat/mink-goutte-driver": "^1.0",
+ "behat/mink-selenium2-driver": "*",
+ "bossa/phpspec2-expect": "1.0.3",
+ "mayflower/php-codebrowser": "^1.1",
+ "phpspec/phpspec": "^2.4.0",
+ "phpunit/phpunit": "3.7.*",
+ "sensiolabs/behat-page-object-extension": "*@dev",
+ "squizlabs/php_codesniffer": "1.*"
+ },
+ "type": "cloudinary-core",
+ "autoload": {
+ "psr-0": {
+ "": [
+ "features/bootstrap",
+ "lib"
+ ]
}
},
- "autoload": {
- "psr-4": {
- "Icecave\\Isolator\\": "src"
- },
- "files": [
- "src/register-autoloader.php"
+ "license": [
+ "proprietary"
+ ],
+ "description": "Cloudinary Core.",
+ "support": {
+ "source": "https://github.com/inviqa/cloudinary-core/tree/1.1.0",
+ "issues": "https://github.com/inviqa/cloudinary-core/issues"
+ },
+ "time": "2017-03-16 14:47:52"
+ },
+ {
+ "name": "inviqa/cloudinary-m1-testcard",
+ "version": "1.1.2",
+ "source": {
+ "type": "git",
+ "url": "git@github.com:inviqa/cloudinary-m1-testcard.git",
+ "reference": "754409dd4c6815db3544c077a212bc691cdf55f3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/inviqa/cloudinary-m1-testcard/zipball/754409dd4c6815db3544c077a212bc691cdf55f3",
+ "reference": "754409dd4c6815db3544c077a212bc691cdf55f3",
+ "shasum": ""
+ },
+ "require": {
+ "magento-hackathon/magento-composer-installer": "*",
+ "php": ">=5.4.0"
+ },
+ "type": "magento-module",
+ "extra": {
+ "map": [
+ [
+ "src/app/code/community/Cloudinary/Testcard",
+ "app/code/community/Cloudinary/Testcard"
+ ],
+ [
+ "src/app/etc/modules/Cloudinary_Testcard.xml",
+ "app/etc/modules/Cloudinary_Testcard.xml"
+ ]
]
},
- "notification-url": "https://packagist.org/downloads/",
"license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "James Harris",
- "email": "james.harris@icecave.com.au",
- "homepage": "https://github.com/jmalloc"
- }
+ "proprietary"
],
- "description": "Dependency injection for global functions.",
- "homepage": "https://github.com/IcecaveStudios/isolator",
- "keywords": [
- "Double",
- "fake",
- "mock",
- "phpunit",
- "stub",
- "test",
- "unit"
- ],
- "time": "2015-03-27 05:04:19"
+ "description": "Magento1 module to display a test set of images with various transforms.",
+ "support": {
+ "source": "https://github.com/inviqa/cloudinary-m1-testcard/tree/1.1.2",
+ "issues": "https://github.com/inviqa/cloudinary-m1-testcard/issues"
+ },
+ "time": "2017-03-06 16:29:37"
},
{
"name": "justinrainbow/json-schema",
- "version": "2.0.5",
+ "version": "4.1.0",
"source": {
"type": "git",
"url": "https://github.com/justinrainbow/json-schema.git",
- "reference": "6b2a33e6a768f96bdc2ead5600af0822eed17d67"
+ "reference": "d39c56a46b3ebe1f3696479966cd2b9f50aaa24f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/6b2a33e6a768f96bdc2ead5600af0822eed17d67",
- "reference": "6b2a33e6a768f96bdc2ead5600af0822eed17d67",
+ "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/d39c56a46b3ebe1f3696479966cd2b9f50aaa24f",
+ "reference": "d39c56a46b3ebe1f3696479966cd2b9f50aaa24f",
"shasum": ""
},
"require": {
@@ -249,7 +277,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0.x-dev"
+ "dev-master": "4.0.x-dev"
}
},
"autoload": {
@@ -285,20 +313,20 @@
"json",
"schema"
],
- "time": "2016-06-02 10:59:52"
+ "time": "2016-12-22 16:43:46"
},
{
"name": "magento-hackathon/magento-composer-installer",
- "version": "3.0.6",
+ "version": "3.1.0",
"source": {
"type": "git",
"url": "https://github.com/Cotya/magento-composer-installer.git",
- "reference": "0bb00f1d17f73107c1927d31d3280750b93ae652"
+ "reference": "49257eef08a37ebc5e1e9ffaab438d00a14a578f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Cotya/magento-composer-installer/zipball/0bb00f1d17f73107c1927d31d3280750b93ae652",
- "reference": "0bb00f1d17f73107c1927d31d3280750b93ae652",
+ "url": "https://api.github.com/repos/Cotya/magento-composer-installer/zipball/49257eef08a37ebc5e1e9ffaab438d00a14a578f",
+ "reference": "49257eef08a37ebc5e1e9ffaab438d00a14a578f",
"shasum": ""
},
"archive": {
@@ -308,13 +336,13 @@
]
},
"require": {
- "composer-plugin-api": "~1.0",
+ "composer-plugin-api": "^1.0",
"eloquent/composer-config-reader": "2.*",
- "php": ">=5.4",
- "symfony/console": "~2.5"
+ "php": ">=5.5",
+ "symfony/console": "^2.5|^3.0"
},
"require-dev": {
- "composer/composer": "1.0.*@dev",
+ "composer/composer": "1.0.*",
"cotya/composer-test-framework": "dev-master",
"mikey179/vfsstream": "~1.4",
"phpunit/phpunit": "~4.3",
@@ -379,27 +407,75 @@
"magento"
],
"support": {
- "source": "https://github.com/Cotya/magento-composer-installer/tree/3.0.6",
+ "source": "https://github.com/Cotya/magento-composer-installer/tree/master",
"issues": "https://github.com/Cotya/magento-composer-installer/issues"
},
- "time": "2015-10-21 21:00:24"
+ "time": "2017-02-23 13:23:06"
+ },
+ {
+ "name": "psr/log",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "time": "2016-10-10 12:19:37"
},
{
"name": "symfony/console",
- "version": "v2.8.8",
+ "version": "v2.8.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "c392a6ec72f2122748032c2ad6870420561ffcfa"
+ "reference": "81508e6fac4476771275a3f4f53c3fee9b956bfa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/c392a6ec72f2122748032c2ad6870420561ffcfa",
- "reference": "c392a6ec72f2122748032c2ad6870420561ffcfa",
+ "url": "https://api.github.com/repos/symfony/console/zipball/81508e6fac4476771275a3f4f53c3fee9b956bfa",
+ "reference": "81508e6fac4476771275a3f4f53c3fee9b956bfa",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
+ "symfony/debug": "^2.7.2|~3.0.0",
"symfony/polyfill-mbstring": "~1.0"
},
"require-dev": {
@@ -442,20 +518,77 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
- "time": "2016-06-29 07:02:14"
+ "time": "2017-03-04 11:00:12"
+ },
+ {
+ "name": "symfony/debug",
+ "version": "v3.0.9",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/debug.git",
+ "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a",
+ "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "psr/log": "~1.0"
+ },
+ "conflict": {
+ "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
+ },
+ "require-dev": {
+ "symfony/class-loader": "~2.8|~3.0",
+ "symfony/http-kernel": "~2.8|~3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Debug\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Debug Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-07-30 07:22:48"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.2.0",
+ "version": "v1.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "dff51f72b0706335131b00a7f49606168c582594"
+ "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594",
- "reference": "dff51f72b0706335131b00a7f49606168c582594",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4",
+ "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4",
"shasum": ""
},
"require": {
@@ -467,7 +600,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.2-dev"
+ "dev-master": "1.3-dev"
}
},
"autoload": {
@@ -501,7 +634,7 @@
"portable",
"shim"
],
- "time": "2016-05-18 14:26:46"
+ "time": "2016-11-14 01:06:16"
}
],
"packages-dev": [
@@ -588,24 +721,25 @@
},
{
"name": "behat/gherkin",
- "version": "v4.4.1",
+ "version": "v4.4.5",
"source": {
"type": "git",
"url": "https://github.com/Behat/Gherkin.git",
- "reference": "1576b485c0f92ef6d27da9c4bbfc57ee30cf6911"
+ "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Behat/Gherkin/zipball/1576b485c0f92ef6d27da9c4bbfc57ee30cf6911",
- "reference": "1576b485c0f92ef6d27da9c4bbfc57ee30cf6911",
+ "url": "https://api.github.com/repos/Behat/Gherkin/zipball/5c14cff4f955b17d20d088dec1bde61c0539ec74",
+ "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74",
"shasum": ""
},
"require": {
"php": ">=5.3.1"
},
"require-dev": {
- "phpunit/phpunit": "~4.0",
- "symfony/yaml": "~2.1"
+ "phpunit/phpunit": "~4.5|~5",
+ "symfony/phpunit-bridge": "~2.7|~3",
+ "symfony/yaml": "~2.3|~3"
},
"suggest": {
"symfony/yaml": "If you want to parse features, represented in YAML files"
@@ -642,7 +776,7 @@
"gherkin",
"parser"
],
- "time": "2015-12-30 14:47:00"
+ "time": "2016-10-30 11:50:56"
},
{
"name": "behat/mink",
@@ -972,7 +1106,7 @@
},
{
"name": "bossa/phpspec2-expect",
- "version": "dev-master",
+ "version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/BossaConsulting/phpspec2-expect.git",
@@ -1168,16 +1302,16 @@
},
{
"name": "guzzlehttp/guzzle",
- "version": "5.3.0",
+ "version": "5.3.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "f3c8c22471cb55475105c14769644a49c3262b93"
+ "reference": "70f1fa53b71c4647bf2762c09068a95f77e12fb8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f3c8c22471cb55475105c14769644a49c3262b93",
- "reference": "f3c8c22471cb55475105c14769644a49c3262b93",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/70f1fa53b71c4647bf2762c09068a95f77e12fb8",
+ "reference": "70f1fa53b71c4647bf2762c09068a95f77e12fb8",
"shasum": ""
},
"require": {
@@ -1186,15 +1320,9 @@
},
"require-dev": {
"ext-curl": "*",
- "phpunit/phpunit": "^4.0",
- "psr/log": "^1.0"
+ "phpunit/phpunit": "^4.0"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "5.0-dev"
- }
- },
"autoload": {
"psr-4": {
"GuzzleHttp\\": "src/"
@@ -1222,7 +1350,7 @@
"rest",
"web service"
],
- "time": "2015-05-20 03:47:55"
+ "time": "2016-07-15 19:28:39"
},
{
"name": "guzzlehttp/ringphp",
@@ -1525,24 +1653,24 @@
},
{
"name": "nikic/php-parser",
- "version": "v2.1.0",
+ "version": "v3.0.5",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "47b254ea51f1d6d5dc04b9b299e88346bf2369e3"
+ "reference": "2b9e2f71b722f7c53918ab0c25f7646c2013f17d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/47b254ea51f1d6d5dc04b9b299e88346bf2369e3",
- "reference": "47b254ea51f1d6d5dc04b9b299e88346bf2369e3",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/2b9e2f71b722f7c53918ab0c25f7646c2013f17d",
+ "reference": "2b9e2f71b722f7c53918ab0c25f7646c2013f17d",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
- "php": ">=5.4"
+ "php": ">=5.5"
},
"require-dev": {
- "phpunit/phpunit": "~4.0"
+ "phpunit/phpunit": "~4.0|~5.0"
},
"bin": [
"bin/php-parse"
@@ -1550,7 +1678,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.1-dev"
+ "dev-master": "3.0-dev"
}
},
"autoload": {
@@ -1572,7 +1700,7 @@
"parser",
"php"
],
- "time": "2016-04-19 13:41:41"
+ "time": "2017-03-05 18:23:57"
},
{
"name": "ocramius/proxy-manager",
@@ -2041,16 +2169,16 @@
},
{
"name": "phpunit/php-file-iterator",
- "version": "1.4.1",
+ "version": "1.4.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0"
+ "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
- "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5",
+ "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5",
"shasum": ""
},
"require": {
@@ -2084,7 +2212,7 @@
"filesystem",
"iterator"
],
- "time": "2015-06-21 13:08:43"
+ "time": "2016-10-03 07:40:28"
},
{
"name": "phpunit/php-text-template",
@@ -2129,25 +2257,30 @@
},
{
"name": "phpunit/php-timer",
- "version": "1.0.8",
+ "version": "1.0.9",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260"
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260",
- "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": "^5.3.3 || ^7.0"
},
"require-dev": {
- "phpunit/phpunit": "~4|~5"
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
"autoload": {
"classmap": [
"src/"
@@ -2169,7 +2302,7 @@
"keywords": [
"timer"
],
- "time": "2016-05-12 18:03:57"
+ "time": "2017-02-26 11:10:40"
},
{
"name": "phpunit/php-token-stream",
@@ -2345,27 +2478,22 @@
},
{
"name": "react/promise",
- "version": "v2.4.1",
+ "version": "v2.5.0",
"source": {
"type": "git",
"url": "https://github.com/reactphp/promise.git",
- "reference": "8025426794f1944de806618671d4fa476dc7626f"
+ "reference": "2760f3898b7e931aa71153852dcd48a75c9b95db"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/reactphp/promise/zipball/8025426794f1944de806618671d4fa476dc7626f",
- "reference": "8025426794f1944de806618671d4fa476dc7626f",
+ "url": "https://api.github.com/repos/reactphp/promise/zipball/2760f3898b7e931aa71153852dcd48a75c9b95db",
+ "reference": "2760f3898b7e931aa71153852dcd48a75c9b95db",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0-dev"
- }
- },
"autoload": {
"psr-4": {
"React\\Promise\\": "src/"
@@ -2385,7 +2513,11 @@
}
],
"description": "A lightweight implementation of CommonJS Promises/A for PHP",
- "time": "2016-05-03 17:50:52"
+ "keywords": [
+ "promise",
+ "promises"
+ ],
+ "time": "2016-12-22 14:09:01"
},
{
"name": "sebastian/exporter",
@@ -2495,16 +2627,16 @@
},
{
"name": "sebastian/git",
- "version": "2.1.3",
+ "version": "2.1.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/git.git",
- "reference": "5100bc50cd9e70f424c643618e142214225024f3"
+ "reference": "815bbbc963cf35e5413df195aa29df58243ecd24"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/git/zipball/5100bc50cd9e70f424c643618e142214225024f3",
- "reference": "5100bc50cd9e70f424c643618e142214225024f3",
+ "url": "https://api.github.com/repos/sebastianbergmann/git/zipball/815bbbc963cf35e5413df195aa29df58243ecd24",
+ "reference": "815bbbc963cf35e5413df195aa29df58243ecd24",
"shasum": ""
},
"require": {
@@ -2536,7 +2668,7 @@
"keywords": [
"git"
],
- "time": "2016-06-15 09:30:19"
+ "time": "2017-01-23 20:57:12"
},
{
"name": "sebastian/phpcpd",
@@ -2591,16 +2723,16 @@
},
{
"name": "sebastian/recursion-context",
- "version": "1.0.2",
+ "version": "1.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "913401df809e99e4f47b27cdd781f4a258d58791"
+ "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791",
- "reference": "913401df809e99e4f47b27cdd781f4a258d58791",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
+ "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
"shasum": ""
},
"require": {
@@ -2640,7 +2772,7 @@
],
"description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
- "time": "2015-11-11 19:50:13"
+ "time": "2016-10-03 07:41:43"
},
{
"name": "sebastian/version",
@@ -2679,30 +2811,33 @@
},
{
"name": "sensiolabs/behat-page-object-extension",
- "version": "v2.0.0",
+ "version": "v2.0.1",
"source": {
"type": "git",
"url": "https://github.com/sensiolabs/BehatPageObjectExtension.git",
- "reference": "b07ebd668ebdafb26f6cf75604161c4973c7e1c5"
+ "reference": "1d3f08e67a9131feb78cfc4331068755faceef2d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sensiolabs/BehatPageObjectExtension/zipball/b07ebd668ebdafb26f6cf75604161c4973c7e1c5",
- "reference": "b07ebd668ebdafb26f6cf75604161c4973c7e1c5",
+ "url": "https://api.github.com/repos/sensiolabs/BehatPageObjectExtension/zipball/1d3f08e67a9131feb78cfc4331068755faceef2d",
+ "reference": "1d3f08e67a9131feb78cfc4331068755faceef2d",
"shasum": ""
},
"require": {
- "behat/behat": "^3.0",
+ "behat/behat": "^3.0.6",
+ "behat/mink": "^1.6",
"behat/mink-extension": "^2.0",
- "ocramius/proxy-manager": "^1.0",
+ "ocramius/proxy-manager": "^1.0||^2.0",
"php": ">=5.3.0"
},
"require-dev": {
- "behat/mink-goutte-driver": "~1.0",
- "bossa/phpspec2-expect": "~1.0",
- "phpspec/phpspec": "~2.0",
- "symfony/filesystem": "^2.3|^3.0",
- "symfony/process": "^2.3|^3.0"
+ "behat/mink-goutte-driver": "^1.0",
+ "bossa/phpspec2-expect": "^1.0.3||^2.0",
+ "fabpot/goutte": "^1.0.4||^2.0||^3.0",
+ "phpspec/phpspec": "^2.5||^3.0",
+ "symfony/filesystem": "^2.8||^3.0",
+ "symfony/process": "^2.8||^3.0",
+ "symfony/yaml": "^2.8||^3.0"
},
"suggest": {
"bossa/phpspec2-expect": "Allows to use PHPSpec2 matchers in Behat context files"
@@ -2729,7 +2864,7 @@
},
{
"name": "Jakub Zalas",
- "email": "jzalas@sensiolabs.co.uk"
+ "email": "jakub@zalas.pl"
}
],
"description": "Page object extension for Behat",
@@ -2739,7 +2874,7 @@
"Behat",
"page"
],
- "time": "2016-06-12 13:18:12"
+ "time": "2017-01-18 22:05:14"
},
{
"name": "squizlabs/php_codesniffer",
@@ -2818,16 +2953,16 @@
},
{
"name": "symfony/browser-kit",
- "version": "v2.8.8",
+ "version": "v2.8.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/browser-kit.git",
- "reference": "7be191464d63441382db763c53907a8eebe9a259"
+ "reference": "8827db04bcd8d9b9bf3114ea41081d8036ab209c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/browser-kit/zipball/7be191464d63441382db763c53907a8eebe9a259",
- "reference": "7be191464d63441382db763c53907a8eebe9a259",
+ "url": "https://api.github.com/repos/symfony/browser-kit/zipball/8827db04bcd8d9b9bf3114ea41081d8036ab209c",
+ "reference": "8827db04bcd8d9b9bf3114ea41081d8036ab209c",
"shasum": ""
},
"require": {
@@ -2835,8 +2970,8 @@
"symfony/dom-crawler": "~2.1|~3.0.0"
},
"require-dev": {
- "symfony/css-selector": "~2.0,>=2.0.5|~3.0.0",
- "symfony/process": "~2.3.34|~2.7,>=2.7.6|~3.0.0"
+ "symfony/css-selector": "^2.0.5|~3.0.0",
+ "symfony/process": "~2.3.34|^2.7.6|~3.0.0"
},
"suggest": {
"symfony/process": ""
@@ -2871,20 +3006,20 @@
],
"description": "Symfony BrowserKit Component",
"homepage": "https://symfony.com",
- "time": "2016-06-29 05:29:29"
+ "time": "2017-02-21 08:33:48"
},
{
"name": "symfony/class-loader",
- "version": "v2.8.8",
+ "version": "v2.8.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/class-loader.git",
- "reference": "a99a6b0c7171b8251fef4a628033ef7f8fe875ee"
+ "reference": "2c8de07a8a4cc4da9c018ab7a81888b80e762f93"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/class-loader/zipball/a99a6b0c7171b8251fef4a628033ef7f8fe875ee",
- "reference": "a99a6b0c7171b8251fef4a628033ef7f8fe875ee",
+ "url": "https://api.github.com/repos/symfony/class-loader/zipball/2c8de07a8a4cc4da9c018ab7a81888b80e762f93",
+ "reference": "2c8de07a8a4cc4da9c018ab7a81888b80e762f93",
"shasum": ""
},
"require": {
@@ -2892,7 +3027,7 @@
"symfony/polyfill-apcu": "~1.1"
},
"require-dev": {
- "symfony/finder": "~2.0,>=2.0.5|~3.0.0"
+ "symfony/finder": "^2.0.5|~3.0.0"
},
"type": "library",
"extra": {
@@ -2924,26 +3059,29 @@
],
"description": "Symfony ClassLoader Component",
"homepage": "https://symfony.com",
- "time": "2016-06-29 05:29:29"
+ "time": "2017-02-18 19:13:35"
},
{
"name": "symfony/config",
- "version": "v2.8.8",
+ "version": "v2.8.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
- "reference": "0926e69411eba491803dbafb9f1f233e2ced58d0"
+ "reference": "06ce6bb46c24963ec09323da45d0f4f85d3cecd2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/0926e69411eba491803dbafb9f1f233e2ced58d0",
- "reference": "0926e69411eba491803dbafb9f1f233e2ced58d0",
+ "url": "https://api.github.com/repos/symfony/config/zipball/06ce6bb46c24963ec09323da45d0f4f85d3cecd2",
+ "reference": "06ce6bb46c24963ec09323da45d0f4f85d3cecd2",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"symfony/filesystem": "~2.3|~3.0.0"
},
+ "require-dev": {
+ "symfony/yaml": "~2.7|~3.0.0"
+ },
"suggest": {
"symfony/yaml": "To use the yaml reference dumper"
},
@@ -2977,20 +3115,20 @@
],
"description": "Symfony Config Component",
"homepage": "https://symfony.com",
- "time": "2016-06-29 05:31:50"
+ "time": "2017-03-01 18:13:50"
},
{
"name": "symfony/css-selector",
- "version": "v2.8.8",
+ "version": "v2.8.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
- "reference": "9da4c615ba303850986e0480cc472bf704cfdb64"
+ "reference": "742bd688bd778dde8991ba696cb372570610afcd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/css-selector/zipball/9da4c615ba303850986e0480cc472bf704cfdb64",
- "reference": "9da4c615ba303850986e0480cc472bf704cfdb64",
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/742bd688bd778dde8991ba696cb372570610afcd",
+ "reference": "742bd688bd778dde8991ba696cb372570610afcd",
"shasum": ""
},
"require": {
@@ -3030,7 +3168,7 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
- "time": "2016-06-29 05:31:50"
+ "time": "2017-02-21 08:33:48"
},
{
"name": "symfony/dependency-injection",
@@ -3094,16 +3232,16 @@
},
{
"name": "symfony/dom-crawler",
- "version": "v2.8.8",
+ "version": "v2.8.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
- "reference": "f8c304f5715081c949043902d311480d71adb1e0"
+ "reference": "24b1a3ffa5b64e4f8b1c5f2cdffd16368640704a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/f8c304f5715081c949043902d311480d71adb1e0",
- "reference": "f8c304f5715081c949043902d311480d71adb1e0",
+ "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/24b1a3ffa5b64e4f8b1c5f2cdffd16368640704a",
+ "reference": "24b1a3ffa5b64e4f8b1c5f2cdffd16368640704a",
"shasum": ""
},
"require": {
@@ -3146,20 +3284,20 @@
],
"description": "Symfony DomCrawler Component",
"homepage": "https://symfony.com",
- "time": "2016-06-29 05:29:29"
+ "time": "2017-02-21 08:33:48"
},
{
"name": "symfony/event-dispatcher",
- "version": "v2.8.8",
+ "version": "v2.8.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "b180b70439dca70049b6b9b7e21d75e6e5d7aca9"
+ "reference": "bb4ec47e8e109c1c1172145732d0aa468d967cd0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b180b70439dca70049b6b9b7e21d75e6e5d7aca9",
- "reference": "b180b70439dca70049b6b9b7e21d75e6e5d7aca9",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/bb4ec47e8e109c1c1172145732d0aa468d967cd0",
+ "reference": "bb4ec47e8e109c1c1172145732d0aa468d967cd0",
"shasum": ""
},
"require": {
@@ -3167,7 +3305,7 @@
},
"require-dev": {
"psr/log": "~1.0",
- "symfony/config": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/config": "^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"
@@ -3206,20 +3344,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
- "time": "2016-06-29 05:29:29"
+ "time": "2017-02-21 08:33:48"
},
{
"name": "symfony/filesystem",
- "version": "v3.0.8",
+ "version": "v3.0.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "a108b1d603ccb52addb5da9b14a3ba259f8b3db0"
+ "reference": "b2da5009d9bacbd91d83486aa1f44c793a8c380d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/a108b1d603ccb52addb5da9b14a3ba259f8b3db0",
- "reference": "a108b1d603ccb52addb5da9b14a3ba259f8b3db0",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2da5009d9bacbd91d83486aa1f44c793a8c380d",
+ "reference": "b2da5009d9bacbd91d83486aa1f44c793a8c380d",
"shasum": ""
},
"require": {
@@ -3255,20 +3393,20 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
- "time": "2016-06-29 05:40:00"
+ "time": "2016-07-20 05:43:46"
},
{
"name": "symfony/finder",
- "version": "v2.8.8",
+ "version": "v2.8.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "bf0506ef4e7778fd3f0f1f141ab5e8c1ef35dd7d"
+ "reference": "5fc4b5cab38b9d28be318fcffd8066988e7d9451"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/bf0506ef4e7778fd3f0f1f141ab5e8c1ef35dd7d",
- "reference": "bf0506ef4e7778fd3f0f1f141ab5e8c1ef35dd7d",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/5fc4b5cab38b9d28be318fcffd8066988e7d9451",
+ "reference": "5fc4b5cab38b9d28be318fcffd8066988e7d9451",
"shasum": ""
},
"require": {
@@ -3304,20 +3442,20 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
- "time": "2016-06-29 05:29:29"
+ "time": "2017-02-21 08:33:48"
},
{
"name": "symfony/polyfill-apcu",
- "version": "v1.2.0",
+ "version": "v1.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-apcu.git",
- "reference": "6d58bceaeea2c2d3eb62503839b18646e161cd6b"
+ "reference": "5d4474f447403c3348e37b70acc2b95475b7befa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/6d58bceaeea2c2d3eb62503839b18646e161cd6b",
- "reference": "6d58bceaeea2c2d3eb62503839b18646e161cd6b",
+ "url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/5d4474f447403c3348e37b70acc2b95475b7befa",
+ "reference": "5d4474f447403c3348e37b70acc2b95475b7befa",
"shasum": ""
},
"require": {
@@ -3326,7 +3464,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.2-dev"
+ "dev-master": "1.3-dev"
}
},
"autoload": {
@@ -3357,20 +3495,20 @@
"portable",
"shim"
],
- "time": "2016-05-18 14:26:46"
+ "time": "2016-11-14 01:06:16"
},
{
"name": "symfony/process",
- "version": "v2.8.8",
+ "version": "v2.8.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "89f33c16796415ccfd8bb3cf8d520cbb79899bfe"
+ "reference": "41336b20b52f5fd5b42a227e394e673c8071118f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/89f33c16796415ccfd8bb3cf8d520cbb79899bfe",
- "reference": "89f33c16796415ccfd8bb3cf8d520cbb79899bfe",
+ "url": "https://api.github.com/repos/symfony/process/zipball/41336b20b52f5fd5b42a227e394e673c8071118f",
+ "reference": "41336b20b52f5fd5b42a227e394e673c8071118f",
"shasum": ""
},
"require": {
@@ -3406,20 +3544,20 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
- "time": "2016-06-29 05:29:29"
+ "time": "2017-03-04 12:20:59"
},
{
"name": "symfony/translation",
- "version": "v2.8.8",
+ "version": "v2.8.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
- "reference": "00334ef0b9317e5d7c7641a2b56671a1df23b7a0"
+ "reference": "b538355bc99db2ec7cc35284ec76d92ae7d1d256"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation/zipball/00334ef0b9317e5d7c7641a2b56671a1df23b7a0",
- "reference": "00334ef0b9317e5d7c7641a2b56671a1df23b7a0",
+ "url": "https://api.github.com/repos/symfony/translation/zipball/b538355bc99db2ec7cc35284ec76d92ae7d1d256",
+ "reference": "b538355bc99db2ec7cc35284ec76d92ae7d1d256",
"shasum": ""
},
"require": {
@@ -3432,7 +3570,7 @@
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~2.8",
- "symfony/intl": "~2.4|~3.0.0",
+ "symfony/intl": "~2.7.25|^2.8.18|~3.2.5",
"symfony/yaml": "~2.2|~3.0.0"
},
"suggest": {
@@ -3470,20 +3608,20 @@
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
- "time": "2016-06-29 05:29:29"
+ "time": "2017-03-04 12:20:59"
},
{
"name": "symfony/yaml",
- "version": "v2.8.8",
+ "version": "v2.8.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "dba4bb5846798cd12f32e2d8f3f35d77045773c8"
+ "reference": "2a7bab3c16f6f452c47818fdd08f3b1e49ffcf7d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/dba4bb5846798cd12f32e2d8f3f35d77045773c8",
- "reference": "dba4bb5846798cd12f32e2d8f3f35d77045773c8",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/2a7bab3c16f6f452c47818fdd08f3b1e49ffcf7d",
+ "reference": "2a7bab3c16f6f452c47818fdd08f3b1e49ffcf7d",
"shasum": ""
},
"require": {
@@ -3519,20 +3657,20 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
- "time": "2016-06-29 05:29:29"
+ "time": "2017-03-01 18:13:50"
},
{
"name": "theseer/directoryscanner",
- "version": "1.3.1",
+ "version": "1.3.2",
"source": {
"type": "git",
"url": "https://github.com/theseer/DirectoryScanner.git",
- "reference": "b1406a99f5e4b1761c84d9e98127c03871bb7b0e"
+ "reference": "549aa9fdbc47d50365db42d9ade35fdef65f854c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/theseer/DirectoryScanner/zipball/b1406a99f5e4b1761c84d9e98127c03871bb7b0e",
- "reference": "b1406a99f5e4b1761c84d9e98127c03871bb7b0e",
+ "url": "https://api.github.com/repos/theseer/DirectoryScanner/zipball/549aa9fdbc47d50365db42d9ade35fdef65f854c",
+ "reference": "549aa9fdbc47d50365db42d9ade35fdef65f854c",
"shasum": ""
},
"require": {
@@ -3561,7 +3699,7 @@
}
],
"description": "A recursive directory scanner and filter",
- "time": "2014-11-25 14:27:49"
+ "time": "2015-03-24 21:28:20"
},
{
"name": "theseer/fdomdocument",
@@ -3760,26 +3898,26 @@
},
{
"name": "zendframework/zend-eventmanager",
- "version": "3.0.1",
+ "version": "3.1.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-eventmanager.git",
- "reference": "5c80bdee0e952be112dcec0968bad770082c3a6e"
+ "reference": "c3bce7b7d47c54040b9ae51bc55491c72513b75d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/5c80bdee0e952be112dcec0968bad770082c3a6e",
- "reference": "5c80bdee0e952be112dcec0968bad770082c3a6e",
+ "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/c3bce7b7d47c54040b9ae51bc55491c72513b75d",
+ "reference": "c3bce7b7d47c54040b9ae51bc55491c72513b75d",
"shasum": ""
},
"require": {
- "php": "^5.5 || ^7.0"
+ "php": "^5.6 || ^7.0"
},
"require-dev": {
"athletic/athletic": "^0.1",
"container-interop/container-interop": "^1.1.0",
- "phpunit/phpunit": "~4.0",
- "squizlabs/php_codesniffer": "^2.0",
+ "phpunit/phpunit": "^5.6",
+ "zendframework/zend-coding-standard": "~1.0.0",
"zendframework/zend-stdlib": "^2.7.3 || ^3.0"
},
"suggest": {
@@ -3789,8 +3927,8 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0-dev",
- "dev-develop": "3.1-dev"
+ "dev-master": "3.1-dev",
+ "dev-develop": "3.2-dev"
}
},
"autoload": {
@@ -3810,7 +3948,7 @@
"events",
"zf2"
],
- "time": "2016-02-18 20:53:00"
+ "time": "2016-12-19 21:47:12"
},
{
"name": "zetacomponents/base",
@@ -3949,8 +4087,7 @@
"magetest/magento-behat-extension": 20,
"magetest/manager": 20,
"theseer/fxsl": 20,
- "covex-nn/phpcb": 20,
- "bossa/phpspec2-expect": 20
+ "covex-nn/phpcb": 20
},
"prefer-stable": false,
"prefer-lowest": false,
diff --git a/continuous-pipe.yml b/continuous-pipe.yml
index e8fd835..769912b 100644
--- a/continuous-pipe.yml
+++ b/continuous-pipe.yml
@@ -9,6 +9,9 @@ tasks:
webce:
image: ${IMAGE_NAME}
naming_strategy: sha1
+ environment:
+ - name: GITHUB_TOKEN
+ value: ${GITHUB_TOKEN}
infrastructure:
deploy:
@@ -78,6 +81,8 @@ tasks:
environment_variables:
- name: PUBLIC_ADDRESS
value: https://${SERVICE_WEBCE_PUBLIC_ENDPOINT}/
+ - name: GITHUB_TOKEN
+ value: ${GITHUB_TOKEN}
deployment_strategy:
readiness_probe:
type: tcp
diff --git a/docker-compose.yml b/docker-compose.yml
index 70debf1..061f61a 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -4,6 +4,8 @@ services:
webce:
build:
context: .
+ args:
+ - GITHUB_TOKEN
environment:
- APP_HOSTNAME=dockerm1demo_webce.docker
- PUBLIC_ADDRESS=https://dockerm1demo_webce.docker/
@@ -14,7 +16,8 @@ services:
- DATABASE_PASSWORD=magento
- DATABASE_ROOT_PASSWORD=magento
- MAGENTO_CRYPT_KEY=VElJzTQztEttxRfSyVn5w4sAqOjWvWFa
- - FORCE_DATABASE_DROP=true
+ - FORCE_DATABASE_DROP=false
+ - GITHUB_TOKEN
links:
- database
- redis
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Block/Adminhtml/Manage.php b/src/app/code/community/Cloudinary/Cloudinary/Block/Adminhtml/Manage.php
index 7bd96d9..08aa16e 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Block/Adminhtml/Manage.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Block/Adminhtml/Manage.php
@@ -17,7 +17,7 @@ public function __construct()
$this->_migrationTask = Mage::getModel('cloudinary_cloudinary/migration')
->load(Cloudinary_Cloudinary_Model_Migration::CLOUDINARY_MIGRATION_ID);
- $this->_cloudinaryConfig = Mage::helper('cloudinary_cloudinary/configuration');
+ $this->_cloudinaryConfig = Mage::getModel('cloudinary_cloudinary/configuration');
parent::__construct();
}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Block/Adminhtml/System/Config/Signup.php b/src/app/code/community/Cloudinary/Cloudinary/Block/Adminhtml/System/Config/Signup.php
index 0c9b77c..5b415bf 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Block/Adminhtml/System/Config/Signup.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Block/Adminhtml/System/Config/Signup.php
@@ -1,5 +1,7 @@
getEnvironmentVariable();
+ return Mage::helper('core')->decrypt(
+ Mage::getStoreConfig(Configuration::CONFIG_PATH_ENVIRONMENT_VARIABLE)
+ );
}
-
}
\ No newline at end of file
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Helper/Configuration.php b/src/app/code/community/Cloudinary/Cloudinary/Helper/Configuration.php
deleted file mode 100755
index 5251df3..0000000
--- a/src/app/code/community/Cloudinary/Cloudinary/Helper/Configuration.php
+++ /dev/null
@@ -1,173 +0,0 @@
-isActive = true;
- $this->folderTranslator = Mage::getModel('cloudinary_cloudinary/magentoFolderTranslator');
- }
-
- public function activate()
- {
- $this->isActive = true;
- }
-
- public function deactivate()
- {
- $this->isActive = false;
- }
-
- public function buildCredentials()
- {
- $environmentVariable = CloudinaryEnvironmentVariable::fromString($this->getEnvironmentVariable());
- return $environmentVariable->getCredentials();
- }
-
- public function getEnvironmentVariable()
- {
- return Mage::helper('core')->decrypt(Mage::getStoreConfig(self::CONFIG_PATH_ENVIRONMENT_VARIABLE));
- }
-
- public function getDefaultGravity()
- {
- return (string)Mage::getStoreConfig(self::CONFIG_DEFAULT_GRAVITY);
- }
-
- public function getFetchFormat()
- {
- return Mage::getStoreConfig(self::CONFIG_DEFAULT_FETCH_FORMAT) === "1" ? FetchFormat::FETCH_FORMAT_AUTO : null;
- }
-
- public function getImageQuality()
- {
- return (string)Mage::getStoreConfig(self::CONFIG_DEFAULT_QUALITY);
- }
-
- public function getImageDpr()
- {
- return (string)Mage::getStoreConfig(self::CONFIG_DEFAULT_DPR);
- }
-
- public function getCdnSubdomainFlag()
- {
- return (boolean)Mage::getStoreConfig(self::CONFIG_CDN_SUBDOMAIN);
- }
-
- public function isFolderedMigration()
- {
- return Mage::getStoreConfigFlag(self::CONFIG_FOLDERED_MIGRATION);
- }
-
- public function getMigratedPath($file)
- {
- if ($this->isFolderedMigration()) {
- $result = $this->folderTranslator->translate($file);
- } else {
- $result = basename($file);
- }
- return $result;
- }
-
- public function reverseMigratedPathIfNeeded($migratedPath)
- {
- if ($this->isFolderedMigration()) {
- return $this->folderTranslator->reverse($migratedPath);
- }
- return $migratedPath;
- }
-
- public function isEnabled()
- {
- return $this->isActive && (boolean)Mage::getStoreConfig(self::CONFIG_PATH_ENABLED);
- }
-
- public function enable()
- {
- $this->_setStoreConfig(self::CONFIG_PATH_ENABLED, self::STATUS_ENABLED);
- }
-
- public function disable()
- {
- $this->_setStoreConfig(self::CONFIG_PATH_ENABLED, self::STATUS_DISABLED);
- }
-
- public function getUserPlatform()
- {
- return sprintf(
- self::USER_PLATFORM_TEMPLATE,
- Mage::getConfig()->getModuleConfig('Cloudinary_Cloudinary')->version,
- Mage::getVersion()
- );
- }
-
- public function buildConfiguration()
- {
- $config = Configuration::fromEnvironmentVariable(
- CloudinaryEnvironmentVariable::fromString($this->getEnvironmentVariable())
- );
-
- $config->setUserPlatform($this->getUserPlatform());
-
- if ($this->getCdnSubdomainFlag()) {
- $config->enableCdnSubdomain();
- }
-
- $config->getDefaultTransformation()
- ->withGravity(Gravity::fromString($this->getDefaultGravity()))
- ->withFetchFormat(FetchFormat::fromString($this->getFetchFormat()))
- ->withQuality(Quality::fromString($this->getImageQuality()))
- ->withDpr(Dpr::fromString($this->getImageDpr()));
-
- return $config;
- }
-
- private function _setStoreConfig($configPath, $value)
- {
- $config = new Mage_Core_Model_Config();
- $config->saveConfig($configPath, $value)->reinit();
- }
-
- /**
- * @return Cloudinary_Cloudinary_Helper_Configuration
- */
- public static function getInstance()
- {
- return Mage::helper('cloudinary_cloudinary/configuration');
- }
-
-}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Helper/Configuration/Validation.php b/src/app/code/community/Cloudinary/Cloudinary/Helper/Configuration/Validation.php
deleted file mode 100755
index 4674345..0000000
--- a/src/app/code/community/Cloudinary/Cloudinary/Helper/Configuration/Validation.php
+++ /dev/null
@@ -1,28 +0,0 @@
-_getConfiguration($environmentVariable);
- $imageProvider = CloudinaryImageProvider::fromConfiguration($configuration);
-
- if (!$imageProvider->validateCredentials()) {
- throw new InvalidCredentials("There was a problem validating your Cloudinary credentials.");
- }
- }
-
- private function _getConfiguration($environmentVariable)
- {
- return Configuration::fromEnvironmentVariable(
- CloudinaryEnvironmentVariable::fromString($environmentVariable)
- );
- }
-
-}
\ No newline at end of file
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Helper/Console.php b/src/app/code/community/Cloudinary/Cloudinary/Helper/Console.php
index abf6821..ef9e08c 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Helper/Console.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Helper/Console.php
@@ -5,15 +5,12 @@
class Cloudinary_Cloudinary_Helper_Console extends Mage_Core_Helper_Abstract
{
-
public function getMediaLibraryUrl()
{
$consoleUrl = ConsoleUrl::fromPath("media_library/cms");
return (string)SignedConsoleUrl::fromConsoleUrlAndCredentials(
$consoleUrl,
- Mage::helper('cloudinary_cloudinary/configuration')->buildCredentials()
+ Mage::getModel('cloudinary_cloudinary/configuration')->getCredentials()
);
-
}
-
}
\ No newline at end of file
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Helper/Image.php b/src/app/code/community/Cloudinary/Cloudinary/Helper/Image.php
index 8c435a7..3524192 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Helper/Image.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Helper/Image.php
@@ -1,32 +1,63 @@
_isEnabled()) {
+ /**
+ * @var Cloudinary_Cloudinary_Helper_ImageFactory
+ */
+ private $_imageFactory;
- $this->_configuration = $this->_getConfigHelper()->buildConfiguration();
+ /**
+ * @var UrlGenerator
+ */
+ private $_urlGenerator;
- $this->_dimensions = Dimensions::null();
- $this->_attributeName = $attributeName;
+ public function __construct()
+ {
+ $this->_configuration = Mage::getModel('cloudinary_cloudinary/configuration');
+ $this->_imageFactory = new ImageFactory(
+ $this->_configuration,
+ Mage::getModel('cloudinary_cloudinary/synchronizationChecker')
+ );
+ $this->_imageProvider = CloudinaryImageProvider::fromConfiguration($this->_configuration);
+ $this->_dimensions = Dimensions::null();
+ $this->_urlGenerator = new UrlGenerator($this->_configuration, $this->_imageProvider);
+ }
- $this->_imageProvider = CloudinaryImageProvider::fromConfiguration(
- $this->_configuration
- );
+ public function init(Mage_Catalog_Model_Product $product, $attributeName, $imageFile = null)
+ {
+ if ($this->_configuration->isEnabled()) {
+ $this->_attributeName = $attributeName;
+ $this->_dimensions = Dimensions::null();
}
return parent::init($product, $attributeName, $imageFile);
@@ -34,39 +65,36 @@ public function init(Mage_Catalog_Model_Product $product, $attributeName, $image
public function resize($width, $height = null)
{
- if ($this->_imageShouldComeFromCloudinary($this->_getRequestedImageFile())) {
- $this->_dimensions = Dimensions::fromWidthAndHeight($width, $height);
- return $this;
- }
+ $this->_dimensions = Dimensions::fromWidthAndHeight($width, $height);
return parent::resize($width, $height);
}
- private function _getRequestedImageFile()
+ public function getImageUrlForCategory(Mage_Catalog_Model_Category $category)
{
- return $this->getImageFile() ?: $this->getProduct()->getData($this->_attributeName);
+ $imagePath = Mage::getBaseDir('media') . DS . 'catalog' . DS . 'category' . DS . $category->getImage();
+
+ $image = $this->_imageFactory->build($imagePath, array($category, 'getImageUrl'));
+
+ return $this->_urlGenerator->generateFor($image);
}
public function __toString()
{
- $result = null;
- $imageFile = $this->_getRequestedImageFile();
-
- if ($this->_imageShouldComeFromCloudinary($imageFile)) {
- $image = Cloudinary_Cloudinary_Helper_Image::newApiImage($imageFile);
+ $image = $this->_imageFactory->build(
+ $this->_getRequestedImageFile(),
+ function() { return parent::__toString();}
+ );
- $transformation = $this->createTransformation();
-
- $result = (string)$this->_imageProvider->transformImage($image, $transformation);
- } else {
- $result = parent::__toString();
- }
- return $result;
+ return $this->_urlGenerator->generateFor($image, $this->createTransformation());
}
- public static function newApiImage($path){
- $migratedPath = Cloudinary_Cloudinary_Helper_Configuration::getInstance()->getMigratedPath($path);
- return Image::fromPath($path, $migratedPath);
+ /**
+ * @return string
+ */
+ private function _getRequestedImageFile()
+ {
+ return $this->getImageFile() ?: $this->getProduct()->getData($this->_attributeName);
}
private function createTransformation()
@@ -74,11 +102,11 @@ private function createTransformation()
if ($this->_getModel()->getKeepFrameState()) {
return $this->_configuration->getDefaultTransformation()
->withDimensions(Dimensions::squareMissingDimension($this->_dimensions))
- ->withCrop(Crop::fromString('pad'));
+ ->withCrop(Crop::pad());
} else {
return $this->_configuration->getDefaultTransformation()
->withDimensions($this->_dimensions)
- ->withCrop(Crop::fromString('fit'));
+ ->withCrop(Crop::fit());
}
}
}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Helper/Util/ArrayUtils.php b/src/app/code/community/Cloudinary/Cloudinary/Helper/Util/ArrayUtils.php
deleted file mode 100644
index 853756d..0000000
--- a/src/app/code/community/Cloudinary/Cloudinary/Helper/Util/ArrayUtils.php
+++ /dev/null
@@ -1,22 +0,0 @@
-_imageFactory = new ImageFactory(
+ Mage::getModel('cloudinary_cloudinary/configuration'),
+ Mage::getModel('cloudinary_cloudinary/synchronizationChecker')
+ );
+
+ return parent::__construct();
+ }
public function getUrl()
{
- $config = $this->_getConfigHelper();
- $file = $this->_newFile;
- if ($this->_imageShouldComeFromCloudinary($file)) {
- $imageProvider = CloudinaryImageProvider::fromConfiguration($config->buildConfiguration());
- $result = (string)$imageProvider->transformImage(Cloudinary_Cloudinary_Helper_Image::newApiImage($file));
- } else {
- $result = parent::getUrl();
- }
- Cloudinary_Cloudinary_Model_Logger::getInstance()->debugLog($result);
- return $result;
+ return (string) $this->_imageFactory->build(
+ $this->_newFile, function() { return parent::getUrl();}
+ );
}
public function getKeepFrameState()
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/Catalog/Product/Media/Config.php b/src/app/code/community/Cloudinary/Cloudinary/Model/Catalog/Product/Media/Config.php
index c9c2d91..e33943c 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/Catalog/Product/Media/Config.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Model/Catalog/Product/Media/Config.php
@@ -3,34 +3,38 @@
use CloudinaryExtension\Cloud;
use CloudinaryExtension\CloudinaryImageProvider;
use CloudinaryExtension\Image;
+use CloudinaryExtension\Image\ImageFactory;
+use CloudinaryExtension\UrlGenerator;
class Cloudinary_Cloudinary_Model_Catalog_Product_Media_Config extends Mage_Catalog_Model_Product_Media_Config
{
- use Cloudinary_Cloudinary_Model_PreConditionsValidator;
+ private $_configuration;
+ private $_imageProvider;
+ private $_urlGenerator;
- public function getMediaUrl($file)
+ public function __construct()
{
- if ($this->_imageShouldComeFromCloudinary($file)) {
- return $this->_getUrlForImage($file);
- }
+ $this->_configuration = Mage::getModel('cloudinary_cloudinary/configuration');
+ $this->_imageFactory = new ImageFactory(
+ $this->_configuration,
+ Mage::getModel('cloudinary_cloudinary/synchronizationChecker')
+ );
+ $this->_imageProvider = CloudinaryImageProvider::fromConfiguration($this->_configuration);
+ $this->_urlGenerator = new UrlGenerator($this->_configuration, $this->_imageProvider);
- return parent::getMediaUrl($file);
}
- public function getTmpMediaUrl($file)
+ public function getMediaUrl($file)
{
- if ($this->_imageShouldComeFromCloudinary($file)) {
- return $this->_getUrlForImage($file);
- }
+ $image = $this->_imageFactory->build($file, function() use($file) { return parent::getMediaUrl($file);});
- return parent::getTmpMediaUrl($file);
+ return $this->_urlGenerator->generateFor($image);
}
- private function _getUrlForImage($file)
+ public function getTmpMediaUrl($file)
{
- $config = Cloudinary_Cloudinary_Helper_Configuration::getInstance();
- $imageProvider = CloudinaryImageProvider::fromConfiguration($config->buildConfiguration());
+ $image = $this->_imageFactory->build($file, function() use($file) { return parent::getTmpMediaUrl($file);});
- return (string)$imageProvider->transformImage(Cloudinary_Cloudinary_Helper_Image::newApiImage($file));
+ return $this->_urlGenerator->generateFor($image);
}
}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Adminhtml/Template/Filter.php b/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Adminhtml/Template/Filter.php
index 2f08152..58b8401 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Adminhtml/Template/Filter.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Adminhtml/Template/Filter.php
@@ -1,32 +1,68 @@
imageFactory = new ImageFactory(
+ $configuration,
+ Mage::getModel('cloudinary_cloudinary/synchronizationChecker')
+ );
+
+ $this->urlGenerator = new UrlGenerator(
+ $configuration,
+ CloudinaryImageProvider::fromConfiguration($configuration)
+ );
+
+ parent::__construct();
+ }
+
+ /**
+ * @param array $construction
+ * @return string
+ */
public function mediaDirective($construction)
{
- $directiveParams = $construction[2];
- $params = $this->_getIncludeParameters($directiveParams);
+ if (ini_get('allow_url_fopen')) {
+ $image = $this->imageFactory->build(
+ $this->imagePath($construction),
+ function() use($construction) { return parent::mediaDirective($construction); }
+ );
- if (!isset($params['url'])) {
- Mage::throwException('Undefined url parameter for media directive.');
+ return $this->urlGenerator->generateFor($image);
}
- $allowRemoteFileOpen = ini_get('allow_url_fopen');
-
- if ($this->_isEnabled() && $allowRemoteFileOpen) {
+ return parent::mediaDirective($construction);
+ }
- $imagePath = $params['url'];
+ /**
+ * @param array $construction
+ * @return string
+ */
+ protected function imagePath(array $construction)
+ {
+ $params = $this->_getIncludeParameters($construction[2]);
- if ($this->_imageShouldComeFromCloudinary($imagePath)) {
- return Mage::getModel('cloudinary_cloudinary/image')->getUrl($imagePath);
- }
+ if (!isset($params['url'])) {
+ Mage::throwException('Undefined url parameter for media directive.');
}
- return parent::mediaDirective($construction);
+ return $params['url'];
}
-}
\ No newline at end of file
+}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Synchronisation.php b/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Synchronisation.php
index 97df055..6f61118 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Synchronisation.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Synchronisation.php
@@ -2,7 +2,9 @@
use CloudinaryExtension\Image\Synchronizable;
-class Cloudinary_Cloudinary_Model_Cms_Synchronisation extends Mage_Core_Model_Abstract implements Synchronizable
+class Cloudinary_Cloudinary_Model_Cms_Synchronisation
+ extends Mage_Core_Model_Abstract
+ implements Synchronizable
{
protected function _construct()
@@ -15,15 +17,8 @@ public function getFilename()
return $this->getData('filename');
}
- public function setValue($fileName)
- {
- $this->setData('basename', basename($fileName));
- return $this;
- }
-
public function getRelativePath(){
- $helperConfig = Mage::helper('cloudinary_cloudinary/configuration');
- return $helperConfig->getMigratedPath($this->getFilename());
+ return Mage::getModel('cloudinary_cloudinary/configuration')->getMigratedPath($this->getFilename());
}
public function tagAsSynchronized()
@@ -31,8 +26,7 @@ public function tagAsSynchronized()
$this->setData('media_gallery_id', null);
$this->setData('cloudinary_synchronisation_id', null);
$this->setData('image_name', $this->getRelativePath());
- Cloudinary_Cloudinary_Model_Logger::getInstance()->debugLog( json_encode($this->toArray(), JSON_PRETTY_PRINT));
+
$this->save();
}
-
}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Template/Filter.php b/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Template/Filter.php
index 674ec69..56d37f2 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Template/Filter.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Template/Filter.php
@@ -1,27 +1,46 @@
imageFactory = new ImageFactory(
+ $configuration,
+ Mage::getModel('cloudinary_cloudinary/synchronizationChecker')
+ );
+
+ $this->urlGenerator = new UrlGenerator(
+ $configuration,
+ CloudinaryImageProvider::fromConfiguration($configuration)
+ );
+
+ parent::__construct();
+ }
public function mediaDirective($construction)
{
- if ($this->_isEnabled()) {
- $imagePath = $this->_getImagePath($construction[2]);
-
- if ($this->_imageShouldComeFromCloudinary($imagePath)) {
- return Mage::getModel('cloudinary_cloudinary/image')->getUrl($imagePath);
- }
- }
- return parent::mediaDirective($construction);
+ $imagePath = $this->getImagePath($construction[2]);
+
+ $image = $this->imageFactory->build(
+ $imagePath,
+ function() use($construction) { return parent::mediaDirective($construction);}
+ );
+
+ return $this->urlGenerator->generateFor($image);
}
- private function _getImagePath($directiveParams)
+ private function getImagePath($directiveParams)
{
$params = $this->_getIncludeParameters($directiveParams);
return $params['url'];
}
-
-}
\ No newline at end of file
+}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Uploader.php b/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Uploader.php
index 15cab90..1b9af20 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Uploader.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Uploader.php
@@ -5,61 +5,31 @@
class Cloudinary_Cloudinary_Model_Cms_Uploader extends Mage_Core_Model_File_Uploader
{
- use Cloudinary_Cloudinary_Model_PreConditionsValidator;
-
- private $requiredParams = ['path', 'file', 'type'];
-
protected function _afterSave($result)
{
parent::_afterSave($result);
- if ($this->shouldUpload($result)) {
- $this->upload($result);
- }
+ $configuration = Mage::getModel('cloudinary_cloudinary/configuration');
- return $this;
- }
+ if ($configuration->isEnabled() && !empty($result['path']) && !empty($result['file'])) {
+ $imageProvider = CloudinaryImageProvider::fromConfiguration($configuration);
- private function upload($result)
- {
- $imageProvider = CloudinaryImageProvider::fromConfiguration($this->_getConfigHelper()->buildConfiguration());
- $imageProvider->upload(Image::fromPath($result['path'] . DIRECTORY_SEPARATOR . $result['file']));
- Mage::getModel('cloudinary_cloudinary/cms_synchronisation')->setValue($result['file'])->tagAsSynchronized();
- }
+ $fullPath = rtrim($result['path'], '/') . DIRECTORY_SEPARATOR . $result['file'];
+ $relativePath = $configuration->isFolderedMigration() ? $configuration->getMigratedPath($fullPath) : '';
- /**
- * @param array $result
- *
- * @return boolean
- */
- private function shouldUpload($result)
- {
- return $this->hasRequiredParams($result) && $this->isImage($result);
- }
+ $image = Image::fromPath($fullPath, $relativePath);
+ $imageProvider->upload($image);
- /**
- * @param array $result
- *
- * @return boolean
- */
- private function hasRequiredParams($result)
- {
- foreach ($this->requiredParams as $requiredParam) {
- if (empty($result[$requiredParam])) {
- return false;
- }
+ $this->_trackSynchronisation((string)$image);
}
- return true;
+ return $this;
}
- /**
- * @param array $result
- *
- * @return boolean
- */
- private function isImage($result)
+ private function _trackSynchronisation($fileName)
{
- return strpos($result['type'], 'image') !== false;
+ Mage::getModel('cloudinary_cloudinary/cms_synchronisation')
+ ->setFilename($fileName)
+ ->tagAsSynchronized();
}
}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Wysiwyg/Images/Storage.php b/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Wysiwyg/Images/Storage.php
index bfb40dc..d4c3f24 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Wysiwyg/Images/Storage.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Model/Cms/Wysiwyg/Images/Storage.php
@@ -1,46 +1,76 @@
_imageShouldComeFromCloudinary($filePath)) {
- $imageProvider = $this->_buildImageProvider();
- $imageDimensions = $this->_buildImageDimensions();
- $defaultTransformation = $this->_getConfigHelper()->buildConfiguration()->getDefaultTransformation();
+ /**
+ * @var UrlGenerator
+ */
+ private $_urlGenerator;
- return (string)$imageProvider->transformImage(
- Image::fromPath($filePath),
- $defaultTransformation->withDimensions($imageDimensions)
- );
- }
- return parent::getThumbnailUrl($filePath, $checkFile);
- }
+ /**
+ * @var ConfigurationInterface
+ */
+ private $_configuration;
- private function _buildImageProvider()
+ public function __construct()
{
- return CloudinaryImageProvider::fromConfiguration($this->_getConfigHelper()->buildConfiguration());
+ $this->_configuration = Mage::getModel('cloudinary_cloudinary/configuration');
+
+ $this->_imageFactory = new ImageFactory(
+ $this->_configuration,
+ Mage::getModel('cloudinary_cloudinary/synchronizationChecker')
+ );
+
+ $this->_urlGenerator = new UrlGenerator(
+ $this->_configuration,
+ CloudinaryImageProvider::fromConfiguration($this->_configuration)
+ );
}
- private function _buildImageDimensions()
+ /**
+ * @param string $filePath
+ * @param bool $checkFile
+ * @return string
+ */
+ public function getThumbnailUrl($filePath, $checkFile = false)
{
- return Dimensions::fromWidthAndHeight(
- $this->getConfigData('resize_width'),
- $this->getConfigData('resize_height')
+ $image = $this->_imageFactory->build(
+ $filePath,
+ function() use($filePath, $checkFile) {
+ return parent::getThumbnailUrl($filePath, $checkFile);
+ }
+ );
+
+ return $this->_urlGenerator->generateWithDimensions(
+ $image,
+ Dimensions::fromWidthAndHeight(
+ $this->getConfigData('resize_width'),
+ $this->getConfigData('resize_height')
+ )
);
}
+ /**
+ * @param string $targetPath
+ * @param null|string $type
+ * @return array
+ */
public function uploadFile($targetPath, $type = null)
{
-
- if(!$this->_getConfigHelper()->isEnabled()) {
+ if (!$this->_configuration->isEnabled()) {
return parent::uploadFile($targetPath, $type);
}
@@ -53,7 +83,7 @@ public function uploadFile($targetPath, $type = null)
$result = $uploader->save($targetPath);
if (!$result) {
- Mage::throwException( Mage::helper('cms')->__('Cannot upload file.') );
+ Mage::throwException(Mage::helper('cms')->__('Cannot upload file.'));
}
// create thumbnail
@@ -69,5 +99,4 @@ public function uploadFile($targetPath, $type = null)
return $result;
}
-
-}
\ No newline at end of file
+}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/Configuration.php b/src/app/code/community/Cloudinary/Cloudinary/Model/Configuration.php
new file mode 100644
index 0000000..aa7c806
--- /dev/null
+++ b/src/app/code/community/Cloudinary/Cloudinary/Model/Configuration.php
@@ -0,0 +1,209 @@
+folderTranslator = Mage::getModel('cloudinary_cloudinary/magentoFolderTranslator');
+ }
+
+ /**
+ * @return Cloud
+ */
+ public function getCloud()
+ {
+ return $this->getEnvironmentVariable()->getCloud();
+ }
+
+ /**
+ * @return Credentials
+ */
+ public function getCredentials()
+ {
+ return $this->getEnvironmentVariable()->getCredentials();
+ }
+
+ /**
+ * @return Transformation
+ */
+ public function getDefaultTransformation()
+ {
+ $transformation = Transformation::builder()
+ ->withGravity(Gravity::fromString($this->getDefaultGravity()))
+ ->withFetchFormat(FetchFormat::fromString($this->getFetchFormat()))
+ ->withQuality(Quality::fromString($this->getImageQuality()))
+ ->withDpr(Dpr::fromString($this->getImageDpr()));
+
+ if ($this->isSmartServing()){
+ $transformation
+ ->addFlags(['lossy'])
+ ->withFetchFormat(FetchFormat::fromString(FetchFormat::FETCH_FORMAT_AUTO))
+ ->withoutFormat();
+ }
+ return $transformation;
+ }
+
+ /**
+ * @return boolean
+ */
+ public function getCdnSubdomainStatus()
+ {
+ return Mage::getStoreConfig(self::CONFIG_CDN_SUBDOMAIN);
+ }
+
+ /**
+ * @return string
+ */
+ public function getUserPlatform()
+ {
+ return sprintf(
+ self::USER_PLATFORM_TEMPLATE,
+ Mage::getConfig()->getModuleConfig('Cloudinary_Cloudinary')->version,
+ Mage::getVersion()
+ );
+ }
+
+ /**
+ * @return UploadConfig
+ */
+ public function getUploadConfig()
+ {
+ return UploadConfig::fromBooleanValues(true, false, false);
+ }
+
+ /**
+ * @return boolean
+ */
+ public function isEnabled()
+ {
+ return Mage::getStoreConfigFlag(self::CONFIG_PATH_ENABLED);
+ }
+
+ public function enable()
+ {
+ $this->setStoreConfig(self::CONFIG_PATH_ENABLED, self::STATUS_ENABLED);
+ }
+
+ public function disable()
+ {
+ $this->setStoreConfig(self::CONFIG_PATH_ENABLED, self::STATUS_DISABLED);
+ }
+
+ public function getFormatsToPreserve() {
+ return ['png', 'webp', 'gif', 'svg'];
+ }
+
+ public function validateCredentials()
+ {
+ try {
+ $api = new \Cloudinary\Api();
+ return $api->ping((new ConfigurationBuilder($this))->build());
+ } catch (Exception $e) {
+ Mage::logException($e);
+ }
+ return false;
+ }
+
+ public function getMigratedPath($file)
+ {
+ if ($this->isFolderedMigration()) {
+ $result = $this->folderTranslator->translate($file);
+ } else {
+ $result = basename($file);
+ }
+ return $result;
+ }
+
+ public function reverseMigratedPathIfNeeded($migratedPath)
+ {
+ if ($this->isFolderedMigration()) {
+ return $this->folderTranslator->reverse($migratedPath);
+ }
+ return $migratedPath;
+ }
+
+ public function isFolderedMigration()
+ {
+ return Mage::getStoreConfigFlag(self::CONFIG_FOLDERED_MIGRATION);
+ }
+
+ private function setStoreConfig($configPath, $value)
+ {
+ Mage::getModel('core/config')->saveConfig($configPath, $value)->reinit();
+ }
+
+ /**
+ * @return CloudinaryEnvironmentVariable
+ */
+ private function getEnvironmentVariable()
+ {
+ if (is_null($this->environmentVariable)) {
+ $value = Mage::helper('core')->decrypt(Mage::getStoreConfig(self::CONFIG_PATH_ENVIRONMENT_VARIABLE));
+ $this->environmentVariable = CloudinaryEnvironmentVariable::fromString($value);
+ }
+ return $this->environmentVariable;
+ }
+
+ /**
+ * Smart serving means lossy compression and automatic fetch format.
+ * @return bool
+ */
+ private function isSmartServing()
+ {
+ return Mage::getStoreConfigFlag(self::CONFIG_SMART_SERVING);
+ }
+
+ private function getDefaultGravity()
+ {
+ return Mage::getStoreConfig(self::CONFIG_DEFAULT_GRAVITY);
+ }
+
+ /**
+ * @return null|string
+ */
+ private function getFetchFormat()
+ {
+ if (Mage::getStoreConfigFlag(self::CONFIG_DEFAULT_FETCH_FORMAT)) {
+ return FetchFormat::FETCH_FORMAT_AUTO;
+ }
+ return null;
+ }
+
+ private function getImageQuality()
+ {
+ return Mage::getStoreConfig(self::CONFIG_DEFAULT_QUALITY);
+ }
+
+ private function getImageDpr()
+ {
+ return Mage::getStoreConfig(self::CONFIG_DEFAULT_DPR);
+ }
+}
\ No newline at end of file
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/Cron.php b/src/app/code/community/Cloudinary/Cloudinary/Model/Cron.php
index 7248e71..b9de77c 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/Cron.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Model/Cron.php
@@ -16,7 +16,9 @@ public function migrateImages()
->load(Cloudinary_Cloudinary_Model_Migration::CLOUDINARY_MIGRATION_ID);
$batchUploader = new BatchUploader(
- CloudinaryImageProvider::fromConfiguration(Mage::helper('cloudinary_cloudinary/configuration')->buildConfiguration()),
+ CloudinaryImageProvider::fromConfiguration(
+ Mage::getModel('cloudinary_cloudinary/configuration')
+ ),
$migrationTask,
Mage::getModel('cloudinary_cloudinary/logger'),
null
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/Image.php b/src/app/code/community/Cloudinary/Cloudinary/Model/Image.php
index ed69cd7..e4d3afb 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/Image.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Model/Image.php
@@ -2,22 +2,20 @@
use CloudinaryExtension\CloudinaryImageProvider;
use CloudinaryExtension\Image;
+use Cloudinary_Cloudinary_Model_Exception_BadFilePathException as BadFilePathException;
class Cloudinary_Cloudinary_Model_Image extends Mage_Core_Model_Abstract
{
- use Cloudinary_Cloudinary_Model_PreConditionsValidator;
-
- private $_folder;
-
public function upload(array $imageDetails)
{
- if ($this->_getConfigHelper()->isFolderedMigration()) {
- $this->_folder = $this->_getConfigHelper()->getMigratedPath($imageDetails['file']);
- }
+ $configuration = Mage::getModel('cloudinary_cloudinary/configuration');
+ $imageManager = CloudinaryImageProvider::fromConfiguration($configuration);
+
+ $fullPath = $this->_imageFullPathFromImageDetails($imageDetails);
+ $relativePath = $configuration->isFolderedMigration() ? $configuration->getMigratedPath($fullPath) : '';
- $imageManager = $this->_getImageProvider();
- $imageManager->upload(Image::fromPath($this->_imageFullPathFromImageDetails($imageDetails), $this->_folder));
+ $imageManager->upload(Image::fromPath($fullPath, $relativePath));
Mage::getModel('cloudinary_cloudinary/synchronisation')
->setValueId($imageDetails['value_id'])
@@ -33,7 +31,7 @@ private function _imageFullPathFromImageDetails($imageDetails)
private function _getImageDetailFromKey(array $imageDetails, $key)
{
if (!array_key_exists($key, $imageDetails)) {
- throw new Cloudinary_Cloudinary_Model_Exception_BadFilePathException("Invalid image data structure. Missing " . $key);
+ throw new BadFilePathException("Invalid image data structure. Missing " . $key);
}
return $imageDetails[$key];
}
@@ -42,21 +40,4 @@ private function _getMediaBasePath()
{
return Mage::getSingleton('catalog/product_media_config')->getBaseMediaPath();
}
-
- public function deleteImage($imageName)
- {
- $this->_getImageProvider()->deleteImage(Cloudinary_Cloudinary_Helper_Image::newApiImage($imageName));
- }
-
- public function getUrl($imagePath)
- {
- $imageProvider = $this->_getImageProvider();
-
- return (string)$imageProvider->transformImage(Cloudinary_Cloudinary_Helper_Image::newApiImage($imagePath));
- }
-
- private function _getImageProvider()
- {
- return CloudinaryImageProvider::fromConfiguration($this->_getConfigHelper()->buildConfiguration());
- }
}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/Logger.php b/src/app/code/community/Cloudinary/Cloudinary/Model/Logger.php
index d86f510..8e38259 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/Logger.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Model/Logger.php
@@ -28,7 +28,6 @@ public function debugLog($message)
/**
* Add extra information to a log entry: class and funcion name from which the log is called
- * @param $message
* @return string
*/
public static function getSignature()
@@ -37,12 +36,4 @@ public static function getSignature()
$logSignature = sprintf(self::SIGNATURE_TEMPLATE, $parentTrace['class'], $parentTrace['function']);
return $logSignature;
}
-
- /**
- * @return Cloudinary_Cloudinary_Model_Logger
- */
- public static function getInstance()
- {
- return Mage::getModel('cloudinary_cloudinary/logger');
- }
}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/MagentoFolderTranslator.php b/src/app/code/community/Cloudinary/Cloudinary/Model/MagentoFolderTranslator.php
index fa22bc7..7a919b0 100644
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/MagentoFolderTranslator.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Model/MagentoFolderTranslator.php
@@ -27,7 +27,6 @@ public function translate($path)
{
$baseName = basename($path);
$result = $this->unifiedDirName($path);
- $debug = $result;
$baseDir = Mage::getBaseDir();
@@ -50,7 +49,7 @@ public function translate($path)
$result = $this->mediaDir . $result;
}
$result .= $baseName;
- Cloudinary_Cloudinary_Model_Logger::getInstance()->debugLog("$path => $debug => $result");
+
return $result;
}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/MediaCollectionCounter.php b/src/app/code/community/Cloudinary/Cloudinary/Model/MediaCollectionCounter.php
deleted file mode 100755
index 7a513f1..0000000
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/MediaCollectionCounter.php
+++ /dev/null
@@ -1,24 +0,0 @@
-_collections[] = $collection;
-
- return $this;
- }
-
- public function count()
- {
- $mediaCount = 0;
- foreach ($this->_collections as $collection) {
- $mediaCount += $collection->getSize();
- }
- return $mediaCount;
- }
-
-}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/Observer.php b/src/app/code/community/Cloudinary/Cloudinary/Model/Observer.php
index d4b8e8a..0e6b67c 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/Observer.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Model/Observer.php
@@ -1,69 +1,108 @@
register();
return $event;
}
- public function uploadImagesToCloudinary(Varien_Event_Observer $event)
+ /**
+ * @param EventObserver $event
+ */
+ public function uploadImagesToCloudinary(EventObserver $event)
{
- if (Mage::helper('cloudinary_cloudinary/configuration')->isEnabled()) {
+ if (Mage::getModel('cloudinary_cloudinary/configuration')->isEnabled()) {
$cloudinaryImage = Mage::getModel('cloudinary_cloudinary/image');
- foreach ($this->_getImagesToUpload($event->getProduct()) as $image) {
+ foreach ($this->getImagesToUpload($event->getProduct()) as $image) {
$cloudinaryImage->upload($image);
}
}
}
- public function validateCloudinaryCredentials(Varien_Event_Observer $observer)
+ /**
+ * @param EventObserver $event
+ */
+ public function deleteImagesFromCloudinary(EventObserver $event)
{
- $configObject = $observer->getEvent()->getObject();
- if ($this->_isNotCloudinaryConfigurationSection($configObject)) {
- return;
- }
-
- try {
- $this->_validateEnvironmentVariableFromConfigObject($configObject);
- } catch (Exception $e) {
- $this->_addErrorMessageToAdminSession($e);
- $this->_logException($e);
+ $cloudinaryImagePovider = CloudinaryImageProvider::fromConfiguration(
+ Mage::getModel('cloudinary_cloudinary/configuration')
+ );
+ foreach ($this->getImagesToDelete($event->getProduct()) as $image) {
+ $cloudinaryImagePovider->delete(Image::fromPath($image['file']));
}
}
- private function _getImagesToUpload(Mage_Catalog_Model_Product $product)
+ /**
+ * @param EventObserver $observer
+ */
+ public function validateCloudinaryCredentials(EventObserver $observer)
{
- return Mage::getModel('cloudinary_cloudinary/catalog_product_media')->newImagesForProduct($product);
- }
+ $credentialValidator = new CredentialValidator();
- public function deleteImagesFromCloudinary(Varien_Event_Observer $event)
- {
- $cloudinaryImage = Mage::getModel('cloudinary_cloudinary/image');
+ $configObject = $observer->getEvent()->getObject();
+ if ($configObject->getSection() == self::CLOUDINARY_CONFIG_SECTION) {
+ $configData = $this->flattenConfigData($configObject);
- foreach ($this->_getImagesToDelete($event->getProduct()) as $image) {
- $cloudinaryImage->deleteImage($image['file']);
+ $environmentVariable = CloudinaryEnvironmentVariable::fromString($configData['cloudinary_environment_variable']);
+ if (!$credentialValidator->validate($environmentVariable->getCredentials())) {
+ Mage::getSingleton('adminhtml/session')->addError(self::ERROR_WRONG_CREDENTIALS);
+ }
}
+ }
+
+ /**
+ * @param Product $product
+ *
+ * @return array
+ */
+ private function getImagesToUpload(Product $product)
+ {
+ return Mage::getModel('cloudinary_cloudinary/catalog_product_media')->newImagesForProduct($product);
}
- private function _getImagesToDelete(Mage_Catalog_Model_Product $product)
+ /**
+ * @param Product $product
+ *
+ * @return array
+ */
+ private function getImagesToDelete(Product $product)
{
$productMedia = Mage::getModel('cloudinary_cloudinary/catalog_product_media');
return $productMedia->removedImagesForProduct($product);
}
- private function _flattenConfigData(Mage_Adminhtml_Model_Config_Data $configObject)
+ /**
+ * @param ConfigData $configObject
+ *
+ * @return array
+ */
+ private function flattenConfigData(ConfigData $configObject)
{
$configData = array();
$groups = $configObject->getGroups();
- if ($this->_containsSetup($groups)) {
+ if (array_key_exists('setup', $groups)) {
$configData = array_map(
function($field) {
return $field['value'];
@@ -73,34 +112,4 @@ function($field) {
}
return $configData;
}
-
- private function _isNotCloudinaryConfigurationSection(Mage_Adminhtml_Model_Config_Data $configObject)
- {
- return $configObject->getSection() != self::CLOUDINARY_CONFIG_SECTION;
- }
-
- private function _validateEnvironmentVariableFromConfigObject(Mage_Adminhtml_Model_Config_Data $configObject)
- {
- $configData = $this->_flattenConfigData($configObject);
- $cloudinaryConfiguration = Mage::helper('cloudinary_cloudinary/configuration_validation');
-
- $cloudinaryConfiguration->validateEnvironmentVariable(
- $configData['cloudinary_environment_variable']
- );
- }
-
- private function _addErrorMessageToAdminSession($e)
- {
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
- }
-
- private function _logException($e)
- {
- Mage::logException($e);
- }
-
- private function _containsSetup($groups)
- {
- return array_key_exists('setup', $groups);
- }
-}
\ No newline at end of file
+}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/PreConditionsValidator.php b/src/app/code/community/Cloudinary/Cloudinary/Model/PreConditionsValidator.php
deleted file mode 100755
index 51c5e2f..0000000
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/PreConditionsValidator.php
+++ /dev/null
@@ -1,29 +0,0 @@
-_getConfigHelper()->isEnabled();
- }
-
- private function _isImageInCloudinary($imageName)
- {
- return Mage::getSingleton('cloudinary_cloudinary/syncedImages')->isImageInCloudinary($imageName);
- }
-
- /**
- * @return Cloudinary_Cloudinary_Helper_Configuration
- */
- private function _getConfigHelper()
- {
- return Mage::helper('cloudinary_cloudinary/configuration');
- }
-
- private function _imageShouldComeFromCloudinary($file)
- {
- $relativePath = $this->_getConfigHelper()->getMigratedPath($file);
- $result = $this->_isEnabled() && $this->_isImageInCloudinary($relativePath);
- return $result;
- }
-}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/Resource/Cms/Synchronisation/Collection.php b/src/app/code/community/Cloudinary/Cloudinary/Model/Resource/Cms/Synchronisation/Collection.php
index 0ad6f19..7d8373f 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/Resource/Cms/Synchronisation/Collection.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Model/Resource/Cms/Synchronisation/Collection.php
@@ -15,6 +15,8 @@ class Cloudinary_Cloudinary_Model_Resource_Cms_Synchronisation_Collection
public function __construct()
{
+ $categoryImages = Mage::getBaseDir('media') . DS . 'catalog' . DS . 'category';
+ $this->addTargetDir($categoryImages);
$this->addTargetDir(Mage::helper('cms/wysiwyg_images')->getStorageRoot());
$this->setItemObjectClass('cloudinary_cloudinary/cms_synchronisation');
$this->setFilesFilter(
@@ -38,38 +40,34 @@ public function addTargetDir($value)
public function findUnsynchronisedImages()
{
- $helperConfig = Mage::helper('cloudinary_cloudinary/configuration');
+ $helperConfig = Mage::getModel('cloudinary_cloudinary/configuration');
if ($helperConfig->isFolderedMigration()){
$this->addFieldToFilter('filename', array('nin' => $this->_getSynchronisedImageNames()));
} else {
$this->addFieldToFilter('basename', array('nin' => $this->_getSynchronisedImageNames()));
}
- Cloudinary_Cloudinary_Model_Logger::getInstance()->debugLog(json_encode($this->toArray(), JSON_PRETTY_PRINT));
return $this->getItems();
}
private function _getSynchronisedImageNames()
{
- $helperConfig = Cloudinary_Cloudinary_Helper_Configuration::getInstance();
$result = array_map(
- function ($itemData) use ($helperConfig) {
+ function ($itemData) {
$imageName = $itemData['image_name'];
- return $helperConfig->reverseMigratedPathIfNeeded($imageName);
+ return Mage::getModel('cloudinary_cloudinary/configuration')->reverseMigratedPathIfNeeded($imageName);
},
$this->_getSynchronisedImageData()
);
- Cloudinary_Cloudinary_Model_Logger::getInstance()->debugLog(print_r($result, true));
+
return $result;
}
private function _getSynchronisedImageData()
{
- $result = Mage::getResourceModel('cloudinary_cloudinary/synchronisation_collection')
+ return Mage::getResourceModel('cloudinary_cloudinary/synchronisation_collection')
->addFieldToSelect('image_name')
->addFieldToFilter('media_gallery_id', array('null' => true))
->getData();
- return $result;
}
-
}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/Resource/Media/Collection/Interface.php b/src/app/code/community/Cloudinary/Cloudinary/Model/Resource/Media/Collection/Interface.php
deleted file mode 100755
index 05cc88d..0000000
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/Resource/Media/Collection/Interface.php
+++ /dev/null
@@ -1,8 +0,0 @@
-where("cloudinary_synchronisation_id is null and value not in ($syncedImagesQuery)")
->limit($limit);
- Cloudinary_Cloudinary_Model_Logger::getInstance()->debugLog(print_r($this->toArray(), true));
return $this->getItems();
}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/SyncedImages.php b/src/app/code/community/Cloudinary/Cloudinary/Model/SyncedImages.php
deleted file mode 100644
index 780b457..0000000
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/SyncedImages.php
+++ /dev/null
@@ -1,31 +0,0 @@
-_syncronisation = $arguments['synchronisation'];
-
- }
-
- public function isImageInCloudinary($imageName)
- {
- if (!isset($this->_syncedImages[$imageName])) {
- $coll = $this->_syncronisation->getCollection();
- $table = $coll->getMainTable();
- // case sensitive check
-
- $query = "select 1 from $table where binary image_name = '$imageName' limit 1";
-
- $this->_syncedImages[$imageName] = ($coll->getConnection()->query($query)->fetchColumn() > 0);
- }
-
- return $this->_syncedImages[$imageName];
- }
-}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/Synchronisation.php b/src/app/code/community/Cloudinary/Cloudinary/Model/Synchronisation.php
index ac198b0..541c27f 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/Model/Synchronisation.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/Model/Synchronisation.php
@@ -16,7 +16,7 @@ public function tagAsSynchronized()
$this->setData('media_gallery_id', $this['value_id']);
$this->setData('media_gallery_value', $this['value']);
$this->unsetData('value_id');
- Cloudinary_Cloudinary_Model_Logger::getInstance()->debugLog( json_encode($this->toArray(), JSON_PRETTY_PRINT));
+
$this->save();
}
@@ -31,8 +31,8 @@ public function getFilename()
public function getRelativePath()
{
- $helperConfig = Mage::helper('cloudinary_cloudinary/configuration');
- return $helperConfig->getMigratedPath($this->getFilename());
+ return Mage::getModel('cloudinary_cloudinary/configuration')
+ ->getMigratedPath($this->getFilename());
}
private function _baseMediaPath()
diff --git a/src/app/code/community/Cloudinary/Cloudinary/Model/SynchronizationChecker.php b/src/app/code/community/Cloudinary/Cloudinary/Model/SynchronizationChecker.php
new file mode 100644
index 0000000..c46eaf5
--- /dev/null
+++ b/src/app/code/community/Cloudinary/Cloudinary/Model/SynchronizationChecker.php
@@ -0,0 +1,18 @@
+getCollection();
+ $table = $coll->getMainTable();
+ // case sensitive check
+ $query = "select count(*) from $table where binary image_name = '$imageName' limit 1";
+ return $coll->getConnection()->query($query)->fetchColumn() > 0;
+ }
+}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/controllers/Adminhtml/CloudinaryController.php b/src/app/code/community/Cloudinary/Cloudinary/controllers/Adminhtml/CloudinaryController.php
index c6fc82e..5c1b7d9 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/controllers/Adminhtml/CloudinaryController.php
+++ b/src/app/code/community/Cloudinary/Cloudinary/controllers/Adminhtml/CloudinaryController.php
@@ -3,13 +3,15 @@
class Cloudinary_Cloudinary_Adminhtml_CloudinaryController extends Mage_Adminhtml_Controller_Action
{
private $_migrationTask;
-
+ /**
+ * @var Cloudinary_Cloudinary_Helper_Configuration
+ */
private $_cloudinaryConfig;
public function preDispatch()
{
$this->_migrationTask = Mage::getModel('cloudinary_cloudinary/migration')->load(Cloudinary_Cloudinary_Model_Migration::CLOUDINARY_MIGRATION_ID);
- $this->_cloudinaryConfig = Mage::helper('cloudinary_cloudinary/configuration');
+ $this->_cloudinaryConfig = Mage::getModel('cloudinary_cloudinary/configuration');
parent::preDispatch();
}
@@ -18,6 +20,13 @@ public function indexAction()
{
$layout = $this->loadLayout();
+ if (!$this->_cloudinaryConfig->validateCredentials()) {
+ $link = 'here';
+ $this->_getSession()->addError(
+ "Please enter your Cloudinary Credentials $link to Activate Cloudinary"
+ );
+ }
+
if ($this->_migrationTask->hasStarted()) {
$layout->_addContent($this->_buildMetaRefreshBlock());
}
@@ -25,6 +34,11 @@ public function indexAction()
$this->renderLayout();
}
+ public function configAction()
+ {
+ $this->_redirect("*/system_config/edit/section/cloudinary/");
+ }
+
public function startMigrationAction()
{
$this->_migrationTask->start();
@@ -41,8 +55,11 @@ public function stopMigrationAction()
public function enableCloudinaryAction()
{
- $this->_cloudinaryConfig->enable();
-
+ if (!$this->_cloudinaryConfig->validateCredentials()) {
+ $this->_getSession()->addError('Validating credentials failed. Cloudinary stays disabled');
+ } else {
+ $this->_cloudinaryConfig->enable();
+ }
$this->_redirectToManageCloudinary();
}
@@ -57,7 +74,7 @@ public function clearErrorsAction()
{
$items = Mage::getModel('cloudinary_cloudinary/migrationError')->getCollection()->getItems();
- foreach ($items as $error){
+ foreach ($items as $error) {
$error->delete();
}
diff --git a/src/app/code/community/Cloudinary/Cloudinary/etc/config.xml b/src/app/code/community/Cloudinary/Cloudinary/etc/config.xml
index 36e2538..e78cd20 100755
--- a/src/app/code/community/Cloudinary/Cloudinary/etc/config.xml
+++ b/src/app/code/community/Cloudinary/Cloudinary/etc/config.xml
@@ -2,7 +2,7 @@
- 1.2.2
+ 2.0.0
diff --git a/src/lib/CloudinaryExtension/Cloud.php b/src/lib/CloudinaryExtension/Cloud.php
deleted file mode 100755
index 559a02c..0000000
--- a/src/lib/CloudinaryExtension/Cloud.php
+++ /dev/null
@@ -1,25 +0,0 @@
-cloudName = (string)$cloudName;
- }
-
- public static function fromName($aCloudName)
- {
- return new Cloud($aCloudName);
- }
-
- public function __toString()
- {
- return $this->cloudName;
- }
-}
diff --git a/src/lib/CloudinaryExtension/CloudinaryImageProvider.php b/src/lib/CloudinaryExtension/CloudinaryImageProvider.php
deleted file mode 100755
index ecb9385..0000000
--- a/src/lib/CloudinaryExtension/CloudinaryImageProvider.php
+++ /dev/null
@@ -1,89 +0,0 @@
- true,
- "unique_filename" => false,
- "overwrite" => false
- );
-
- private function __construct(Configuration $configuration)
- {
- $this->configuration = $configuration;
- $this->authorise();
- }
-
- public static function fromConfiguration(Configuration $configuration)
- {
- return new CloudinaryImageProvider($configuration);
- }
-
- public function upload(Image $image)
- {
- try{
- $imagePath = (string)$image;
- $uploadOptionsAndFolder = $this->uploadConfig + ["folder" => $image->getRelativeFolder()];
- $uploadResult = Uploader::upload($imagePath, $uploadOptionsAndFolder);
-
- if ($uploadResult['existing'] == 1) {
- MigrationError::throwWith($image, MigrationError::CODE_FILE_ALREADY_EXISTS);
- }
- return $uploadResult;
- } catch (\Exception $e) {
- MigrationError::throwWith($image, MigrationError::CODE_API_ERROR, $e->getMessage());
- }
- }
-
- public function transformImage(Image $image, Transformation $transformation = null)
- {
- if ($transformation === null) {
- $transformation = $this->configuration->getDefaultTransformation();
- }
- return Image::fromPath(\cloudinary_url($image->getId(), $transformation->build()), $image->getRelativePath());
- }
-
- public function validateCredentials()
- {
- $signedValidationUrl = $this->getSignedValidationUrl();
- return $this->validationResult($signedValidationUrl);
- }
-
- public function deleteImage(Image $image)
- {
- Uploader::destroy($image->getId());
- }
-
- private function authorise()
- {
- Cloudinary::config($this->configuration->build());
- Cloudinary::$USER_PLATFORM = $this->configuration->getUserPlatform();
- }
-
- private function getSignedValidationUrl()
- {
- $consoleUrl = Security\ConsoleUrl::fromPath("media_library/cms");
- return (string)Security\SignedConsoleUrl::fromConsoleUrlAndCredentials(
- $consoleUrl,
- $this->configuration->getCredentials()
- );
- }
-
- private function validationResult($signedValidationUrl)
- {
- $request = new ValidateRemoteUrlRequest($signedValidationUrl);
- return $request->validate();
- }
-}
diff --git a/src/lib/CloudinaryExtension/Configuration.php b/src/lib/CloudinaryExtension/Configuration.php
deleted file mode 100755
index 8b57648..0000000
--- a/src/lib/CloudinaryExtension/Configuration.php
+++ /dev/null
@@ -1,97 +0,0 @@
-cdnSubdomain = false;
- $this->credentials = $credentials;
- $this->cloud = $cloud;
- $this->defaultTransformation = Transformation::builder();
- }
-
- public static function fromCloudAndCredentials(Cloud $cloud, Credentials $credentials)
- {
- return new Configuration($cloud, $credentials);
- }
-
- public static function fromEnvironmentVariable(EnvironmentVariable $environmentVariable)
- {
- return new Configuration($environmentVariable->getCloud(), $environmentVariable->getCredentials());
- }
-
- public function getCloud()
- {
- return $this->cloud;
- }
-
- public function getCredentials()
- {
- return $this->credentials;
- }
-
- public function getDefaultTransformation()
- {
- return $this->defaultTransformation;
- }
-
- public function build()
- {
- $configuration = $this->getMandatoryConfiguration();
- if($this->cdnSubdomain) {
- $configuration['cdn_subdomain'] = true;
- }
-
- return $configuration;
- }
-
- public function enableCdnSubdomain()
- {
- $this->cdnSubdomain = true;
- }
-
- public function getCdnSubdomainStatus()
- {
- return $this->cdnSubdomain;
- }
-
- private function getMandatoryConfiguration()
- {
- return array(
- "cloud_name" => (string)$this->cloud,
- "api_key" => (string)$this->credentials->getKey(),
- "api_secret" => (string)$this->credentials->getSecret()
- );
- }
-
- /**
- * @return string
- */
- public function getUserPlatform()
- {
- return $this->userPlatform;
- }
-
- /**
- * @param string $userPlatform
- */
- public function setUserPlatform($userPlatform)
- {
- $this->userPlatform = $userPlatform;
- }
-}
diff --git a/src/lib/CloudinaryExtension/Credentials.php b/src/lib/CloudinaryExtension/Credentials.php
deleted file mode 100755
index c49c5e2..0000000
--- a/src/lib/CloudinaryExtension/Credentials.php
+++ /dev/null
@@ -1,30 +0,0 @@
-key = $key;
- $this->secret = $secret;
- }
-
- public function getKey()
- {
- return $this->key;
- }
-
- public function getSecret()
- {
- return $this->secret;
- }
-}
diff --git a/src/lib/CloudinaryExtension/Exception/InvalidCredentials.php b/src/lib/CloudinaryExtension/Exception/InvalidCredentials.php
deleted file mode 100755
index 5dd83b8..0000000
--- a/src/lib/CloudinaryExtension/Exception/InvalidCredentials.php
+++ /dev/null
@@ -1,10 +0,0 @@
- 'File already exists (cloudinary is case insensitive!!).',
- self::CODE_API_ERROR => 'Internal API error'
- ];
-
- private $image;
-
- /**
- * @return Image
- */
- public function getImage()
- {
- return $this->image;
- }
-
- /**
- * @param Image $image
- * @param $code
- * @param $message overrides the default message attached to the code
- * @return MigrationError
- */
- private static function build(Image $image, $code, $message = '')
- {
- $result = new MigrationError($message ?: self::$messages[$code], $code);
- $result->image = $image;
- return $result;
- }
-
- public static function throwWith(Image $image, $code, $message = '')
- {
- throw self::build($image, $code, $message);
- }
-
-}
diff --git a/src/lib/CloudinaryExtension/FolderTranslator.php b/src/lib/CloudinaryExtension/FolderTranslator.php
deleted file mode 100644
index 2949dc6..0000000
--- a/src/lib/CloudinaryExtension/FolderTranslator.php
+++ /dev/null
@@ -1,16 +0,0 @@
-imagePath = $imagePath;
- $this->relativePath = $relativePath;
- $this->pathInfo = pathinfo($this->imagePath);
- }
-
- public static function fromPath($imagePath, $relativePath = '')
- {
- return new Image($imagePath, $relativePath);
- }
-
- public function __toString()
- {
- return $this->imagePath;
- }
-
- public function getRelativePath()
- {
- return $this->relativePath;
- }
-
- public function getRelativeFolder()
- {
- $result = dirname($this->getRelativePath());
- return $result == '.' ? '' : $result;
- }
-
- public function getId()
- {
- if ($this->relativePath) {
- return $this->getRelativeFolder() . DS . $this->pathInfo['filename'];
- } else {
- return $this->pathInfo['filename'];
- }
- }
-
- public function getExtension()
- {
- return $this->pathInfo['extension'];
- }
-}
diff --git a/src/lib/CloudinaryExtension/Image/Synchronizable.php b/src/lib/CloudinaryExtension/Image/Synchronizable.php
deleted file mode 100755
index c6a4aed..0000000
--- a/src/lib/CloudinaryExtension/Image/Synchronizable.php
+++ /dev/null
@@ -1,10 +0,0 @@
-fetchFormat = FetchFormat::fromString(Format::FETCH_FORMAT_AUTO);
- $this->crop = 'pad';
- $this->format = Format::fromExtension('jpg');
- $this->validFormats = array('gif', 'jpg', 'png', 'svg');
- }
-
- public function withGravity(Gravity $gravity)
- {
- $this->gravity = $gravity;
- $this->crop = ((string) $gravity) ? 'crop' : 'pad';
-
- return $this;
- }
-
- public function withDimensions(Dimensions $dimensions)
- {
- $this->dimensions = $dimensions;
-
- return $this;
- }
-
- public function withFetchFormat(FetchFormat $fetchFormat)
- {
- $this->fetchFormat = $fetchFormat;
-
- return $this;
- }
-
- public function withFormat(Format $format)
- {
- if (in_array((string) $format, $this->validFormats)) {
- $this->format = $format;
- }
-
- return $this;
- }
-
- public function withQuality(Quality $quality)
- {
- $this->quality = $quality;
-
- return $this;
- }
-
- public function withDpr(Dpr $dpr)
- {
- $this->dpr = $dpr;
-
- return $this;
- }
-
- public function withCrop(Crop $crop)
- {
- $this->crop = $crop;
-
- return $this;
- }
-
- public function withOptimisationDisabled()
- {
- $this->withFetchFormat(FetchFormat::fromString(''));
- return $this;
- }
-
- public static function builder()
- {
- return new Transformation();
- }
-
- public function build()
- {
- return array(
- 'fetch_format' => (string) $this->fetchFormat,
- 'quality' => (string) $this->quality,
- 'crop' => (string) $this->crop,
- 'gravity' => (string) $this->gravity ?: null,
- 'width' => $this->dimensions ? $this->dimensions->getWidth() : null,
- 'height' => $this->dimensions ? $this->dimensions->getHeight() : null,
- 'format' => (string) $this->format,
- 'dpr' => (string) $this->dpr
- );
- }
-}
-
diff --git a/src/lib/CloudinaryExtension/Image/Transformation/Crop.php b/src/lib/CloudinaryExtension/Image/Transformation/Crop.php
deleted file mode 100644
index ab5f410..0000000
--- a/src/lib/CloudinaryExtension/Image/Transformation/Crop.php
+++ /dev/null
@@ -1,23 +0,0 @@
-value = $value;
- }
-
- public static function fromString($value)
- {
- return new Crop($value);
- }
-
- public function __toString()
- {
- return $this->value;
- }
-}
diff --git a/src/lib/CloudinaryExtension/Image/Transformation/Dimensions.php b/src/lib/CloudinaryExtension/Image/Transformation/Dimensions.php
deleted file mode 100755
index 5082934..0000000
--- a/src/lib/CloudinaryExtension/Image/Transformation/Dimensions.php
+++ /dev/null
@@ -1,52 +0,0 @@
-width = is_null($width) ? null : (int) round($width);
- $this->height = is_null($height) ? null : (int) round($height);
- }
-
- public function getWidth()
- {
- return $this->width;
- }
-
- public function getHeight()
- {
- return $this->height;
- }
-
- public static function square($length)
- {
- return new Dimensions($length, $length);
- }
-
- public static function squareMissingDimension(Dimensions $dimensions)
- {
- if (!$dimensions->getWidth()) {
- return Dimensions::square($dimensions->getHeight());
- } else if (!$dimensions->getHeight()) {
- return Dimensions::square($dimensions->getWidth());
- }
-
- return $dimensions;
- }
-
- public static function fromWidthAndHeight($width, $height)
- {
- return new Dimensions($width, $height);
- }
-
- public static function null()
- {
- return new Dimensions(null, null);
- }
-}
diff --git a/src/lib/CloudinaryExtension/Image/Transformation/Dpr.php b/src/lib/CloudinaryExtension/Image/Transformation/Dpr.php
deleted file mode 100755
index 8c15aa5..0000000
--- a/src/lib/CloudinaryExtension/Image/Transformation/Dpr.php
+++ /dev/null
@@ -1,23 +0,0 @@
-value = $value;
- }
-
- public static function fromString($value)
- {
- return new Dpr($value);
- }
-
- public function __toString()
- {
- return $this->value;
- }
-}
diff --git a/src/lib/CloudinaryExtension/Image/Transformation/FetchFormat.php b/src/lib/CloudinaryExtension/Image/Transformation/FetchFormat.php
deleted file mode 100755
index 8b34308..0000000
--- a/src/lib/CloudinaryExtension/Image/Transformation/FetchFormat.php
+++ /dev/null
@@ -1,25 +0,0 @@
-value = $value;
- }
-
- public static function fromString($value)
- {
- return new FetchFormat($value);
- }
-
- public function __toString()
- {
- return $this->value;
- }
-}
diff --git a/src/lib/CloudinaryExtension/Image/Transformation/Format.php b/src/lib/CloudinaryExtension/Image/Transformation/Format.php
deleted file mode 100755
index 94da009..0000000
--- a/src/lib/CloudinaryExtension/Image/Transformation/Format.php
+++ /dev/null
@@ -1,25 +0,0 @@
-value = $value;
- }
-
- public static function fromExtension($value)
- {
- return new Format($value);
- }
-
- public function __toString()
- {
- return $this->value;
- }
-}
diff --git a/src/lib/CloudinaryExtension/Image/Transformation/Gravity.php b/src/lib/CloudinaryExtension/Image/Transformation/Gravity.php
deleted file mode 100755
index 9eb0d1a..0000000
--- a/src/lib/CloudinaryExtension/Image/Transformation/Gravity.php
+++ /dev/null
@@ -1,30 +0,0 @@
-value = $value;
- }
-
- public function __toString()
- {
- return $this->value;
- }
-
- public static function fromString($value)
- {
- return new Gravity($value);
- }
-
- public static function null()
- {
- return new Gravity(null);
- }
-}
-
-
diff --git a/src/lib/CloudinaryExtension/Image/Transformation/Quality.php b/src/lib/CloudinaryExtension/Image/Transformation/Quality.php
deleted file mode 100755
index 6b7f4d3..0000000
--- a/src/lib/CloudinaryExtension/Image/Transformation/Quality.php
+++ /dev/null
@@ -1,23 +0,0 @@
-value = $value;
- }
-
- public static function fromString($value)
- {
- return new Quality($value);
- }
-
- public function __toString()
- {
- return $this->value;
- }
-}
diff --git a/src/lib/CloudinaryExtension/ImageProvider.php b/src/lib/CloudinaryExtension/ImageProvider.php
deleted file mode 100755
index ea140aa..0000000
--- a/src/lib/CloudinaryExtension/ImageProvider.php
+++ /dev/null
@@ -1,13 +0,0 @@
-imageProvider = $imageProvider;
- $this->migrationTask = $migrationTask;
- $this->baseMediaPath = $baseMediaPath;
- $this->logger = $logger;
- }
-
- public function uploadImages(array $images)
- {
- $this->countMigrated = 0;
- foreach ($images as $image) {
-
- if ($this->migrationTask->hasBeenStopped()) {
- break;
- }
- $this->uploadImage($image);
- }
- $this->logger->notice(sprintf(self::MESSAGE_STATUS, $this->countMigrated, $this->countFailed));
- }
-
- private function getAbsolutePath(Synchronizable $image)
- {
- return sprintf('%s%s', $this->baseMediaPath, $image->getFilename());
- }
-
- private function uploadImage(Synchronizable $image)
- {
- $absolutePath = $this->getAbsolutePath($image);
- $relativePath = $image->getRelativePath();
- $apiImage = Image::fromPath($absolutePath, $relativePath);
-
- try {
- $this->imageProvider->upload($apiImage);
- $image->tagAsSynchronized();
- $this->countMigrated++;
- $this->logger->notice(sprintf(self::MESSAGE_UPLOADED, $absolutePath . ' - ' . $relativePath));
- } catch (\Exception $e) {
- $this->errors[] = $e;
- $this->countFailed++;
- $this->logger->error(sprintf(self::MESSAGE_UPLOAD_ERROR, $e->getMessage(), $absolutePath . ' - ' . $relativePath));
- }
- }
-
- /**
- * @return array
- */
- public function getErrors()
- {
- return $this->errors;
- }
-
- public function getMigrationErrors()
- {
- return array_filter($this->errors, function ($val) {
- return $val instanceof MigrationError;
- });
- }
-
-}
diff --git a/src/lib/CloudinaryExtension/Migration/Logger.php b/src/lib/CloudinaryExtension/Migration/Logger.php
deleted file mode 100755
index 74bba5a..0000000
--- a/src/lib/CloudinaryExtension/Migration/Logger.php
+++ /dev/null
@@ -1,14 +0,0 @@
-migrationTask = $migrationTask;
- $this->synchronizedMediaRepository = $synchronizedMediaRepository;
- $this->logger = $logger;
- $this->batchUploader = $batchUploader;
- }
-
- public function process()
- {
- if ($this->migrationTask->hasBeenStopped()) {
- return;
- }
-
- $images = $this->synchronizedMediaRepository->findUnsynchronisedImages();
-
- if (!$images) {
- $this->logger->notice(self::MESSAGE_COMPLETE);
- $this->migrationTask->stop();
- } else {
- $this->logger->notice(self::MESSAGE_PROCESSING);
- $this->batchUploader->uploadImages($images);
- }
- }
-}
diff --git a/src/lib/CloudinaryExtension/Migration/SynchronizedMediaRepository.php b/src/lib/CloudinaryExtension/Migration/SynchronizedMediaRepository.php
deleted file mode 100755
index c01dc34..0000000
--- a/src/lib/CloudinaryExtension/Migration/SynchronizedMediaRepository.php
+++ /dev/null
@@ -1,8 +0,0 @@
-apiSignature = Cloudinary::api_sign_request($params, (string) $secret);
- }
-
- public static function fromSecretAndParams(Secret $secret, array $params = array())
- {
- return new ApiSignature($secret, $params);
- }
-
- public function __toString()
- {
- return $this->apiSignature;
- }
-}
diff --git a/src/lib/CloudinaryExtension/Security/CloudinaryEnvironmentVariable.php b/src/lib/CloudinaryExtension/Security/CloudinaryEnvironmentVariable.php
deleted file mode 100755
index 1dcc5d0..0000000
--- a/src/lib/CloudinaryExtension/Security/CloudinaryEnvironmentVariable.php
+++ /dev/null
@@ -1,50 +0,0 @@
-environmentVariable = (string)$environmentVariable;
- $cloudinaryUrl = str_replace('CLOUDINARY_URL=', '', $environmentVariable);
- if ($this->isUrlValid($cloudinaryUrl)) {
- Cloudinary::config_from_url($cloudinaryUrl);
- }
-
- }
-
- public static function fromString($environmentVariable)
- {
- return new CloudinaryEnvironmentVariable($environmentVariable);
- }
-
- public function getCloud()
- {
- return Cloud::fromName(Cloudinary::config_get('cloud_name'));
- }
-
- public function getCredentials()
- {
- return new Credentials(
- Key::fromString(Cloudinary::config_get('api_key')),
- Secret::fromString(Cloudinary::config_get('api_secret'))
- );
- }
-
- public function __toString()
- {
- return $this->environmentVariable;
- }
-
- private function isUrlValid($cloudinaryUrl)
- {
- return parse_url($cloudinaryUrl, PHP_URL_SCHEME) == "cloudinary";
- }
-}
diff --git a/src/lib/CloudinaryExtension/Security/ConsoleUrl.php b/src/lib/CloudinaryExtension/Security/ConsoleUrl.php
deleted file mode 100755
index e34c900..0000000
--- a/src/lib/CloudinaryExtension/Security/ConsoleUrl.php
+++ /dev/null
@@ -1,26 +0,0 @@
-consoleUrl = self::CLOUDINARY_CONSOLE_BASE_URL . $path;
- }
-
- public static function fromPath($path)
- {
- return new ConsoleUrl($path);
- }
-
- public function __toString()
- {
- return $this->consoleUrl;
- }
-}
diff --git a/src/lib/CloudinaryExtension/Security/EnvironmentVariable.php b/src/lib/CloudinaryExtension/Security/EnvironmentVariable.php
deleted file mode 100755
index ae51017..0000000
--- a/src/lib/CloudinaryExtension/Security/EnvironmentVariable.php
+++ /dev/null
@@ -1,9 +0,0 @@
-key = (string)$key;
- }
-
- public static function fromString($aKey)
- {
- return new Key($aKey);
- }
-
- public function __toString()
- {
- return $this->key;
- }
-
-}
diff --git a/src/lib/CloudinaryExtension/Security/Secret.php b/src/lib/CloudinaryExtension/Security/Secret.php
deleted file mode 100755
index 5a57ef8..0000000
--- a/src/lib/CloudinaryExtension/Security/Secret.php
+++ /dev/null
@@ -1,24 +0,0 @@
-secret = (string)$secret;
- }
-
- public static function fromString($aSecret)
- {
- return new Secret($aSecret);
- }
-
- public function __toString()
- {
- return $this->secret;
- }
-}
diff --git a/src/lib/CloudinaryExtension/Security/SignedConsoleUrl.php b/src/lib/CloudinaryExtension/Security/SignedConsoleUrl.php
deleted file mode 100755
index dce9b23..0000000
--- a/src/lib/CloudinaryExtension/Security/SignedConsoleUrl.php
+++ /dev/null
@@ -1,31 +0,0 @@
- time(), "mode" => "check");
- $params["signature"] = (string)ApiSignature::fromSecretAndParams($credentials->getSecret(), $params);
- $params["api_key"] = (string)$credentials->getKey();
- $query = http_build_query($params);
-
- $this->signedConsoleUrl = (string)$url . '?' . $query;
- }
-
- public static function fromConsoleUrlAndCredentials(ConsoleUrl $url, Credentials $credentials)
- {
- return new SignedConsoleUrl($url, $credentials);
- }
-
- public function __toString()
- {
- return $this->signedConsoleUrl;
- }
-}
diff --git a/src/lib/CloudinaryExtension/ValidateRemoteUrlRequest.php b/src/lib/CloudinaryExtension/ValidateRemoteUrlRequest.php
deleted file mode 100755
index b2c5499..0000000
--- a/src/lib/CloudinaryExtension/ValidateRemoteUrlRequest.php
+++ /dev/null
@@ -1,55 +0,0 @@
-curlHandler = curl_init($url);
- $this->setCurlOptions();
- }
-
- public function validate()
- {
- $result = $this->execute();
-
- if ($result->responseCode == 200 && is_null($result->error)) {
- return true;
- }
- return false;
- }
-
- private function execute()
- {
- curl_exec($this->curlHandler);
-
- $result = new \stdClass();
- $result->responseCode = $this->getResponseCode();
- $result->error = $this->getErrorMessage();
-
- curl_close($this->curlHandler);
-
- return $result;
- }
-
- private function getResponseCode()
- {
- return curl_getinfo($this->curlHandler, CURLINFO_HTTP_CODE);
- }
-
- private function getErrorMessage()
- {
- return curl_errno($this->curlHandler) ? curl_error($this->curlHandler) : null;
- }
-
- private function setCurlOptions()
- {
- curl_setopt($this->curlHandler, CURLOPT_HEADER, 1);
- curl_setopt($this->curlHandler, CURLOPT_FAILONERROR, 1);
- curl_setopt($this->curlHandler, CURLOPT_RETURNTRANSFER, 1);
- }
-}
diff --git a/src/var/connect/Cloudinary_Cloudinary.xml b/src/var/connect/Cloudinary_Cloudinary.xml
index d7b1d84..9983154 100644
--- a/src/var/connect/Cloudinary_Cloudinary.xml
+++ b/src/var/connect/Cloudinary_Cloudinary.xml
@@ -9,7 +9,7 @@
Cloudinary supercharges your images! Upload images to the cloud, deliver optimized via a fast CDN, perform smart resizing and apply effects.
MIT License (MITL)
- 1.2.2
+ 2.0.0
stable
v1.2.0
diff --git a/tools/docker/usr/local/share/container/plan.sh b/tools/docker/usr/local/share/container/plan.sh
index c8eeaef..88f719a 100644
--- a/tools/docker/usr/local/share/container/plan.sh
+++ b/tools/docker/usr/local/share/container/plan.sh
@@ -17,14 +17,20 @@ symlink() {
chown -R "${CODE_OWNER}:${CODE_GROUP}" /app/module
echo "Symlinking Cloudinary Magento module"
-mkdir -p /app/public/app/code/community/Cloudinary
+as_code_owner "mkdir -p /app/public/app/code/community/Cloudinary"
symlink /app/module/src/app/code/community/Cloudinary/Cloudinary /app/public/app/code/community/Cloudinary/Cloudinary
-symlink /app/module/src/lib/CloudinaryExtension /app/public/lib/CloudinaryExtension
symlink /app/module/src/app/etc/modules/Cloudinary_Cloudinary.xml /app/public/app/etc/modules/Cloudinary_Cloudinary.xml
symlink /app/module/src/app/design/adminhtml/default/default/layout/cloudinary /app/public/app/design/adminhtml/default/default/layout/cloudinary
symlink /app/module/src/app/design/adminhtml/default/default/template/cloudinary /app/public/app/design/adminhtml/default/default/template/cloudinary
-as_code_owner "composer install" /app/module
+echo "Installing core and SDK via composer"
+if [ -n "$GITHUB_TOKEN" ]; then
+ as_code_owner "composer global config github-oauth.github.com '$GITHUB_TOKEN'"
+fi
+as_code_owner "composer install --no-interaction --optimize-autoloader" /app/module
echo "Symlinking Cloudinary SDK"
symlink /app/module/vendor/cloudinary/cloudinary_php/src /app/public/lib/Cloudinary
+
+echo "Symlinking Cloudinary core"
+symlink /app/module/vendor/inviqa/cloudinary-core/lib/CloudinaryExtension /app/public/lib/CloudinaryExtension