From 9911ee4d515b6a39febc0e2bfb1d9eb598954792 Mon Sep 17 00:00:00 2001 From: moataz Date: Mon, 16 Jul 2018 17:41:57 +0200 Subject: [PATCH 1/7] - Add "Example" module - Configure Doctrin --- .db/.gitkeep | 0 .gitignore | 0 Dockerfile | 20 +- README.md | 7 +- composer.json | 10 +- composer.lock | 1884 +++++++++++++++-- config/application.config.php | 0 config/autoload/.gitignore | 0 config/autoload/README.md | 0 config/autoload/docker.php | 0 config/autoload/doctrine.docker.php | 18 + config/autoload/doctrine.global.php | 26 + config/autoload/global.php | 0 .../autoload/zend-developer-tools.docker.php | 0 config/modules.config.php | 9 + data/cache/.gitkeep | 0 docker-compose.yml | 1 - docker-init.sh | 3 + module/Application/config/module.config.php | 0 .../src/Controller/IndexController.php | 0 module/Application/src/Entity/Example.php | 24 + module/Application/src/Module.php | 0 .../test/Controller/IndexControllerTest.php | 0 .../view/application/index/index.phtml | 0 module/Application/view/error/404.phtml | 0 module/Application/view/error/index.phtml | 0 module/Application/view/layout/layout.phtml | 0 module/Example/config/module.config.php | 42 + .../Factory/IndexControllerFactory.php | 18 + .../src/Controller/IndexController.php | 27 + module/Example/src/Module.php | 11 + module/Example/src/Service/ExampleService.php | 11 + .../test/Controller/IndexControllerTest.php | 36 + module/Example/view/example/index/index.phtml | 4 + phpcs.xml | 0 phpunit.xml.dist | 0 public/.htaccess | 0 public/css/bootstrap-theme.css | 0 public/css/bootstrap-theme.css.map | 0 public/css/bootstrap-theme.min.css | 0 public/css/bootstrap-theme.min.css.map | 0 public/css/bootstrap.css | 0 public/css/bootstrap.css.map | 0 public/css/bootstrap.min.css | 0 public/css/bootstrap.min.css.map | 0 public/css/style.css | 0 public/fonts/glyphicons-halflings-regular.eot | Bin public/fonts/glyphicons-halflings-regular.svg | 0 public/fonts/glyphicons-halflings-regular.ttf | Bin .../fonts/glyphicons-halflings-regular.woff | Bin .../fonts/glyphicons-halflings-regular.woff2 | Bin public/index.php | 0 public/js/bootstrap.js | 0 public/js/bootstrap.min.js | 0 public/js/jquery-3.1.0.min.js | 0 public/web.config | 0 56 files changed, 1956 insertions(+), 195 deletions(-) mode change 100644 => 100755 .db/.gitkeep mode change 100644 => 100755 .gitignore mode change 100644 => 100755 Dockerfile mode change 100644 => 100755 README.md mode change 100644 => 100755 composer.json mode change 100644 => 100755 composer.lock mode change 100644 => 100755 config/application.config.php mode change 100644 => 100755 config/autoload/.gitignore mode change 100644 => 100755 config/autoload/README.md mode change 100644 => 100755 config/autoload/docker.php create mode 100644 config/autoload/doctrine.docker.php create mode 100644 config/autoload/doctrine.global.php mode change 100644 => 100755 config/autoload/global.php mode change 100644 => 100755 config/autoload/zend-developer-tools.docker.php mode change 100644 => 100755 config/modules.config.php mode change 100644 => 100755 data/cache/.gitkeep mode change 100644 => 100755 docker-compose.yml create mode 100644 docker-init.sh mode change 100644 => 100755 module/Application/config/module.config.php mode change 100644 => 100755 module/Application/src/Controller/IndexController.php create mode 100644 module/Application/src/Entity/Example.php mode change 100644 => 100755 module/Application/src/Module.php mode change 100644 => 100755 module/Application/test/Controller/IndexControllerTest.php mode change 100644 => 100755 module/Application/view/application/index/index.phtml mode change 100644 => 100755 module/Application/view/error/404.phtml mode change 100644 => 100755 module/Application/view/error/index.phtml mode change 100644 => 100755 module/Application/view/layout/layout.phtml create mode 100755 module/Example/config/module.config.php create mode 100755 module/Example/src/Controller/Factory/IndexControllerFactory.php create mode 100755 module/Example/src/Controller/IndexController.php create mode 100755 module/Example/src/Module.php create mode 100755 module/Example/src/Service/ExampleService.php create mode 100755 module/Example/test/Controller/IndexControllerTest.php create mode 100755 module/Example/view/example/index/index.phtml mode change 100644 => 100755 phpcs.xml mode change 100644 => 100755 phpunit.xml.dist mode change 100644 => 100755 public/.htaccess mode change 100644 => 100755 public/css/bootstrap-theme.css mode change 100644 => 100755 public/css/bootstrap-theme.css.map mode change 100644 => 100755 public/css/bootstrap-theme.min.css mode change 100644 => 100755 public/css/bootstrap-theme.min.css.map mode change 100644 => 100755 public/css/bootstrap.css mode change 100644 => 100755 public/css/bootstrap.css.map mode change 100644 => 100755 public/css/bootstrap.min.css mode change 100644 => 100755 public/css/bootstrap.min.css.map mode change 100644 => 100755 public/css/style.css mode change 100644 => 100755 public/fonts/glyphicons-halflings-regular.eot mode change 100644 => 100755 public/fonts/glyphicons-halflings-regular.svg mode change 100644 => 100755 public/fonts/glyphicons-halflings-regular.ttf mode change 100644 => 100755 public/fonts/glyphicons-halflings-regular.woff mode change 100644 => 100755 public/fonts/glyphicons-halflings-regular.woff2 mode change 100644 => 100755 public/index.php mode change 100644 => 100755 public/js/bootstrap.js mode change 100644 => 100755 public/js/bootstrap.min.js mode change 100644 => 100755 public/js/jquery-3.1.0.min.js mode change 100644 => 100755 public/web.config diff --git a/.db/.gitkeep b/.db/.gitkeep old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/Dockerfile b/Dockerfile old mode 100644 new mode 100755 index fae3669..8bd50b6 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,18 @@ FROM php:7.0-apache -RUN apt-get update \ - && apt-get install -y git zlib1g-dev \ - && docker-php-ext-install zip \ - && a2enmod rewrite \ +RUN apt-get update + +RUN apt-get install -y git +RUN apt-get install -y zlib1g-dev + +RUN docker-php-ext-install zip +RUN docker-php-ext-install pdo_mysql + +RUN a2enmod rewrite \ && sed -i 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/000-default.conf \ - && mv /var/www/html /var/www/public \ - && curl -sS https://getcomposer.org/installer \ + && mv /var/www/html /var/www/public + +RUN curl -sS https://getcomposer.org/installer \ | php -- --install-dir=/usr/local/bin --filename=composer -WORKDIR /var/www +WORKDIR /var/www \ No newline at end of file diff --git a/README.md b/README.md old mode 100644 new mode 100755 index fceb16f..abc6d42 --- a/README.md +++ b/README.md @@ -16,5 +16,10 @@ docker-compose up For the first install, **Docker** may take some time as it will download the images it requires. For subsequent runs, the start up time should be much faster. -3. View the test page: +3. Run init script +``` +docker-compose exec app ./docker-init.sh +``` + +4. View the test page: http://localhost:8080/ diff --git a/composer.json b/composer.json old mode 100644 new mode 100755 index a65fe86..a765726 --- a/composer.json +++ b/composer.json @@ -6,16 +6,20 @@ "require": { "php": "^7.0", "zendframework/zend-component-installer": "^1.0", - "zendframework/zend-mvc": "^3.0.1" + "zendframework/zend-mvc": "^3.0.1", + "doctrine/doctrine-orm-module": "^1.1" }, "autoload": { "psr-4": { - "Application\\": "module/Application/src/" + "Application\\": "module/Application/src/", + "Example\\": "module/Example/src/" + } }, "autoload-dev": { "psr-4": { - "ApplicationTest\\": "module/Application/test/" + "ApplicationTest\\": "module/Application/test/", + "ExampleTest\\": "module/Example/test/" } }, "extra": [], diff --git a/composer.lock b/composer.lock old mode 100644 new mode 100755 index dd1a3ce..3c3a4c4 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c3a709540b2acefe197d17a6dd2fcb6d", + "content-hash": "9afb8e7da01e97a122ac373498bdef79", "packages": [ { "name": "container-interop/container-interop", @@ -37,54 +37,1304 @@ "homepage": "https://github.com/container-interop/container-interop", "time": "2017-02-14T19:40:03+00:00" }, + { + "name": "doctrine/annotations", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "^5.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2017-02-24T16:22:25+00:00" + }, + { + "name": "doctrine/cache", + "version": "v1.6.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/eb152c5100571c7a45470ff2a35095ab3f3b900b", + "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b", + "shasum": "" + }, + "require": { + "php": "~5.5|~7.0" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "phpunit/phpunit": "~4.8|~5.0", + "predis/predis": "~1.0", + "satooshi/php-coveralls": "~0.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Caching library offering an object-oriented API for many cache backends", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "cache", + "caching" + ], + "time": "2017-07-22T12:49:21+00:00" + }, + { + "name": "doctrine/collections", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/1a4fb7e902202c33cce8c55989b945612943c2ba", + "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/coding-standard": "~0.1@dev", + "phpunit/phpunit": "^5.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Collections\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Collections Abstraction library", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "array", + "collections", + "iterator" + ], + "time": "2017-01-03T10:49:41+00:00" + }, + { + "name": "doctrine/common", + "version": "v2.7.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/common.git", + "reference": "4acb8f89626baafede6ee5475bc5844096eba8a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/common/zipball/4acb8f89626baafede6ee5475bc5844096eba8a9", + "reference": "4acb8f89626baafede6ee5475bc5844096eba8a9", + "shasum": "" + }, + "require": { + "doctrine/annotations": "1.*", + "doctrine/cache": "1.*", + "doctrine/collections": "1.*", + "doctrine/inflector": "1.*", + "doctrine/lexer": "1.*", + "php": "~5.6|~7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common Library for Doctrine projects", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "collections", + "eventmanager", + "persistence", + "spl" + ], + "time": "2017-07-22T08:35:12+00:00" + }, + { + "name": "doctrine/dbal", + "version": "v2.5.13", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "729340d8d1eec8f01bff708e12e449a3415af873" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/729340d8d1eec8f01bff708e12e449a3415af873", + "reference": "729340d8d1eec8f01bff708e12e449a3415af873", + "shasum": "" + }, + "require": { + "doctrine/common": ">=2.4,<2.8-dev", + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "symfony/console": "2.*||^3.0" + }, + "suggest": { + "symfony/console": "For helpful console commands such as SQL execution and import of files." + }, + "bin": [ + "bin/doctrine-dbal" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\DBAL\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Database Abstraction Layer", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "database", + "dbal", + "persistence", + "queryobject" + ], + "time": "2017-07-22T20:44:48+00:00" + }, + { + "name": "doctrine/doctrine-module", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/DoctrineModule.git", + "reference": "9407d04d0b08e7071dab05c9d068cefda9dc5a6f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/DoctrineModule/zipball/9407d04d0b08e7071dab05c9d068cefda9dc5a6f", + "reference": "9407d04d0b08e7071dab05c9d068cefda9dc5a6f", + "shasum": "" + }, + "require": { + "doctrine/cache": "^1.6", + "doctrine/common": "^2.6.1", + "php": "^5.6 || ^7.0", + "symfony/console": "^2.3 || ^3.0", + "zendframework/zend-authentication": "^2.5.3", + "zendframework/zend-cache": "^2.7.1", + "zendframework/zend-form": "^2.9", + "zendframework/zend-hydrator": "^1.1 || ^2.2.1", + "zendframework/zend-mvc": "^2.7.10 || ^3.0.1", + "zendframework/zend-paginator": "^2.7", + "zendframework/zend-servicemanager": "^2.7.6 || ^3.1", + "zendframework/zend-stdlib": "^2.7.7 || ^3.0.1", + "zendframework/zend-validator": "^2.8.1" + }, + "require-dev": { + "phpunit/phpunit": "^4.8", + "squizlabs/php_codesniffer": "^2.6.2", + "zendframework/zend-i18n": "^2.7.3", + "zendframework/zend-log": "^2.9", + "zendframework/zend-modulemanager": "^2.7.2", + "zendframework/zend-serializer": "^2.8", + "zendframework/zend-session": "^2.7.3", + "zendframework/zend-test": "^2.6.1 || ^3.0.1", + "zendframework/zend-version": "^2.5.1" + }, + "suggest": { + "doctrine/data-fixtures": "Data Fixtures if you want to generate test data or bootstrap data for your deployments", + "zendframework/zend-mvc-console": "^1.1.10 if you are using ZF3" + }, + "bin": [ + "bin/doctrine-module" + ], + "type": "library", + "extra": { + "zf": { + "module": "DoctrineModule" + } + }, + "autoload": { + "psr-0": { + "DoctrineModule\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Spraggs", + "email": "theman@spiffyjr.me", + "homepage": "http://www.spiffyjr.me/" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@hotmail.com" + }, + { + "name": "Michaël Gallego", + "email": "mic.gallego@gmail.com", + "homepage": "http://www.michaelgallego.fr" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://marco-pivetta.com/" + } + ], + "description": "Zend Framework Module that provides Doctrine basic functionality required for ORM and ODM modules", + "homepage": "http://www.doctrine-project.org/", + "keywords": [ + "doctrine", + "module", + "zf" + ], + "time": "2016-10-03T19:40:55+00:00" + }, + { + "name": "doctrine/doctrine-orm-module", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/DoctrineORMModule.git", + "reference": "8cb46190022ac71ef644416bd422ce2fb54d4823" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/DoctrineORMModule/zipball/8cb46190022ac71ef644416bd422ce2fb54d4823", + "reference": "8cb46190022ac71ef644416bd422ce2fb54d4823", + "shasum": "" + }, + "require": { + "doctrine/dbal": ">=2.4,<2.7", + "doctrine/doctrine-module": "^1.2", + "doctrine/orm": ">=2.5,<2.7", + "php": "^5.6 || ^7.0", + "symfony/console": "^2.3 || ^3.0", + "zendframework/zend-hydrator": "^1.1 || ^2.2.1", + "zendframework/zend-mvc": "^2.7.10 || ^3.0.1", + "zendframework/zend-servicemanager": "^2.7.6 || ^3.1", + "zendframework/zend-stdlib": "^2.7.7 || ^3.0.1" + }, + "require-dev": { + "doctrine/data-fixtures": "^1.2.1", + "doctrine/migrations": "^1.4.1", + "phpunit/phpunit": "^5.7.17 || ^6.2.1", + "squizlabs/php_codesniffer": "^2.7", + "zendframework/zend-console": "^2.6", + "zendframework/zend-developer-tools": "^1.1", + "zendframework/zend-i18n": "^2.7.3", + "zendframework/zend-log": "^2.9", + "zendframework/zend-modulemanager": "^2.7.2", + "zendframework/zend-serializer": "^2.8" + }, + "suggest": { + "doctrine/migrations": "doctrine migrations if you want to keep your schema definitions versioned", + "zendframework/zend-developer-tools": "zend-developer-tools if you want to profile operations executed by the ORM during development", + "zendframework/zend-form": "if you want to use form elements backed by Doctrine" + }, + "type": "library", + "extra": { + "zf": { + "module": "DoctrineORMModule" + } + }, + "autoload": { + "psr-0": { + "DoctrineORMModule\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Spraggs", + "email": "theman@spiffyjr.me", + "homepage": "http://www.spiffyjr.me/" + }, + { + "name": "Evan Coury", + "email": "me@evancoury.com", + "homepage": "http://blog.evan.pro/" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@hotmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://marco-pivetta.com/" + } + ], + "description": "Zend Framework Module that provides Doctrine ORM functionality", + "homepage": "http://www.doctrine-project.org/", + "keywords": [ + "doctrine", + "module", + "orm", + "zf" + ], + "time": "2017-09-20T01:06:34+00:00" + }, + { + "name": "doctrine/inflector", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/e11d84c6e018beedd929cff5220969a3c6d1d462", + "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common String Manipulations with regard to casing and singular/plural rules.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string" + ], + "time": "2017-07-22T12:18:28+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14T21:17:01+00:00" + }, + { + "name": "doctrine/lexer", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "lexer", + "parser" + ], + "time": "2014-09-09T13:34:57+00:00" + }, + { + "name": "doctrine/orm", + "version": "v2.5.14", + "source": { + "type": "git", + "url": "https://github.com/doctrine/doctrine2.git", + "reference": "810a7baf81462a5ddf10e8baa8cb94b6eec02754" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/810a7baf81462a5ddf10e8baa8cb94b6eec02754", + "reference": "810a7baf81462a5ddf10e8baa8cb94b6eec02754", + "shasum": "" + }, + "require": { + "doctrine/cache": "~1.4", + "doctrine/collections": "~1.2", + "doctrine/common": ">=2.5-dev,<2.9-dev", + "doctrine/dbal": ">=2.5-dev,<2.7-dev", + "doctrine/instantiator": "^1.0.1", + "ext-pdo": "*", + "php": ">=5.4", + "symfony/console": "~2.5|~3.0|~4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "symfony/yaml": "~2.3|~3.0|~4.0" + }, + "suggest": { + "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" + }, + "bin": [ + "bin/doctrine", + "bin/doctrine.php" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\ORM\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Object-Relational-Mapper for PHP", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "database", + "orm" + ], + "time": "2017-12-17T02:57:51+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "time": "2016-08-06T20:24:11+00:00" + }, { "name": "psr/container", "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "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-10T12:19:37+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.12", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "1b97071a26d028c9bd4588264e101e14f6e7cd00" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/1b97071a26d028c9bd4588264e101e14f6e7cd00", + "reference": "1b97071a26d028c9bd4588264e101e14f6e7cd00", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.3|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.3|~4.0" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "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 Console Component", + "homepage": "https://symfony.com", + "time": "2018-05-23T05:02:55+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.12", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "47e6788c5b151cf0cfdf3329116bf33800632d75" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/47e6788c5b151cf0cfdf3329116bf33800632d75", + "reference": "47e6788c5b151cf0cfdf3329116bf33800632d75", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "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/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-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": "2018-06-25T11:10:40+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "3296adf6a6454a050679cde90f95350ad604b171" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", + "reference": "3296adf6a6454a050679cde90f95350ad604b171", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-04-26T10:06:28+00:00" + }, + { + "name": "zendframework/zend-authentication", + "version": "2.6.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-authentication.git", + "reference": "ebc9464c11a5203e5256439f1079a7d6efe89eec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-authentication/zipball/ebc9464c11a5203e5256439f1079a7d6efe89eec", + "reference": "ebc9464c11a5203e5256439f1079a7d6efe89eec", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-crypt": "^2.6 || ^3.2.1", + "zendframework/zend-db": "^2.8.2", + "zendframework/zend-http": "^2.7", + "zendframework/zend-ldap": "^2.8", + "zendframework/zend-session": "^2.8", + "zendframework/zend-uri": "^2.5.2", + "zendframework/zend-validator": "^2.10.1" + }, + "suggest": { + "zendframework/zend-crypt": "Zend\\Crypt component", + "zendframework/zend-db": "Zend\\Db component", + "zendframework/zend-http": "Zend\\Http component", + "zendframework/zend-ldap": "Zend\\Ldap component", + "zendframework/zend-session": "Zend\\Session component", + "zendframework/zend-uri": "Zend\\Uri component", + "zendframework/zend-validator": "Zend\\Validator component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6.x-dev", + "dev-develop": "2.7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Authentication\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides an API for authentication and includes concrete authentication adapters for common use case scenarios", + "keywords": [ + "Authentication", + "ZendFramework", + "zf" + ], + "time": "2018-04-12T21:09:22+00:00" + }, + { + "name": "zendframework/zend-cache", + "version": "2.8.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-cache.git", + "reference": "4983dff629956490c78b88adcc8ece4711d7d8a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/zendframework/zend-cache/zipball/4983dff629956490c78b88adcc8ece4711d7d8a3", + "reference": "4983dff629956490c78b88adcc8ece4711d7d8a3", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^5.6 || ^7.0", + "psr/cache": "^1.0", + "psr/simple-cache": "^1.0", + "zendframework/zend-eventmanager": "^2.6.3 || ^3.2", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.3", + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + }, + "provide": { + "psr/cache-implementation": "1.0", + "psr/simple-cache-implementation": "1.0" + }, + "require-dev": { + "cache/integration-tests": "^0.16", + "phpbench/phpbench": "^0.13", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-serializer": "^2.6", + "zendframework/zend-session": "^2.7.4" + }, + "suggest": { + "ext-apc": "APC or compatible extension, to use the APC storage adapter", + "ext-apcu": "APCU >= 5.1.0, to use the APCu storage adapter", + "ext-dba": "DBA, to use the DBA storage adapter", + "ext-memcache": "Memcache >= 2.0.0 to use the Memcache storage adapter", + "ext-memcached": "Memcached >= 1.0.0 to use the Memcached storage adapter", + "ext-mongo": "Mongo, to use MongoDb storage adapter", + "ext-mongodb": "MongoDB, to use the ExtMongoDb storage adapter", + "ext-redis": "Redis, to use Redis storage adapter", + "ext-wincache": "WinCache, to use the WinCache storage adapter", + "ext-xcache": "XCache, to use the XCache storage adapter", + "mongodb/mongodb": "Required for use with the ext-mongodb adapter", + "mongofill/mongofill": "Alternative to ext-mongo - a pure PHP implementation designed as a drop in replacement", + "zendframework/zend-serializer": "Zend\\Serializer component", + "zendframework/zend-session": "Zend\\Session component" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.8.x-dev", + "dev-develop": "2.9.x-dev" + }, + "zf": { + "component": "Zend\\Cache", + "config-provider": "Zend\\Cache\\ConfigProvider" } }, "autoload": { + "files": [ + "autoload/patternPluginManagerPolyfill.php" + ], "psr-4": { - "Psr\\Container\\": "src/" + "Zend\\Cache\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } + "BSD-3-Clause" ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", + "description": "Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output", "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" + "ZendFramework", + "cache", + "psr-16", + "psr-6", + "zf" ], - "time": "2017-02-14T16:28:37+00:00" + "time": "2018-05-01T21:58:00+00:00" }, { "name": "zendframework/zend-component-installer", @@ -109,248 +1359,505 @@ "malukenho/docheader": "^0.1.6", "mikey179/vfsstream": "^1.6.5", "phpunit/phpunit": "^5.7.23 || ^6.4.3", - "zendframework/zend-coding-standard": "~1.0.0" + "zendframework/zend-coding-standard": "~1.0.0" + }, + "type": "composer-plugin", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev", + "dev-develop": "1.2-dev" + }, + "class": "Zend\\ComponentInstaller\\ComponentInstaller" + }, + "autoload": { + "psr-4": { + "Zend\\ComponentInstaller\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Composer plugin for automating component registration in zend-mvc and Expressive applications", + "keywords": [ + "ZendFramework", + "component installer", + "composer", + "plugin", + "zf" + ], + "time": "2018-01-11T15:03:06+00:00" + }, + { + "name": "zendframework/zend-config", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-config.git", + "reference": "6796f5dcba52c84ef2501d7313618989b5ef3023" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-config/zipball/6796f5dcba52c84ef2501d7313618989b5ef3023", + "reference": "6796f5dcba52c84ef2501d7313618989b5ef3023", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^5.6 || ^7.0", + "psr/container": "^1.0", + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + }, + "conflict": { + "container-interop/container-interop": "<1.2.0" + }, + "require-dev": { + "malukenho/docheader": "^0.1.6", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-filter": "^2.7.2", + "zendframework/zend-i18n": "^2.7.4", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.3" + }, + "suggest": { + "zendframework/zend-filter": "^2.7.2; install if you want to use the Filter processor", + "zendframework/zend-i18n": "^2.7.4; install if you want to use the Translator processor", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.3; if you need an extensible plugin manager for use with the Config Factory" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev", + "dev-develop": "3.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Config\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a nested object property based user interface for accessing this configuration data within application code", + "keywords": [ + "ZendFramework", + "config", + "zf" + ], + "time": "2018-04-24T19:26:44+00:00" + }, + { + "name": "zendframework/zend-escaper", + "version": "2.6.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-escaper.git", + "reference": "31d8aafae982f9568287cb4dce987e6aff8fd074" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/31d8aafae982f9568287cb4dce987e6aff8fd074", + "reference": "31d8aafae982f9568287cb4dce987e6aff8fd074", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6.x-dev", + "dev-develop": "2.7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Escaper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs", + "keywords": [ + "ZendFramework", + "escaper", + "zf" + ], + "time": "2018-04-25T15:48:53+00:00" + }, + { + "name": "zendframework/zend-eventmanager", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-eventmanager.git", + "reference": "a5e2583a211f73604691586b8406ff7296a946dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/a5e2583a211f73604691586b8406ff7296a946dd", + "reference": "a5e2583a211f73604691586b8406ff7296a946dd", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "^0.1", + "container-interop/container-interop": "^1.1.0", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0" + }, + "suggest": { + "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev", + "dev-develop": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\EventManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Trigger and listen to events within a PHP application", + "homepage": "https://github.com/zendframework/zend-eventmanager", + "keywords": [ + "event", + "eventmanager", + "events", + "zf2" + ], + "time": "2018-04-25T15:33:34+00:00" + }, + { + "name": "zendframework/zend-filter", + "version": "2.8.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-filter.git", + "reference": "7b997dbe79459f1652deccc8786d7407fb66caa9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-filter/zipball/7b997dbe79459f1652deccc8786d7407fb66caa9", + "reference": "7b997dbe79459f1652deccc8786d7407fb66caa9", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + }, + "conflict": { + "zendframework/zend-validator": "<2.10.1" + }, + "require-dev": { + "pear/archive_tar": "^1.4.3", + "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-crypt": "^3.2.1", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.3", + "zendframework/zend-uri": "^2.6" }, - "type": "composer-plugin", + "suggest": { + "zendframework/zend-crypt": "Zend\\Crypt component, for encryption filters", + "zendframework/zend-i18n": "Zend\\I18n component for filters depending on i18n functionality", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for using the filter chain functionality", + "zendframework/zend-uri": "Zend\\Uri component, for the UriNormalize filter" + }, + "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev", - "dev-develop": "1.2-dev" + "dev-master": "2.8.x-dev", + "dev-develop": "2.9.x-dev" }, - "class": "Zend\\ComponentInstaller\\ComponentInstaller" + "zf": { + "component": "Zend\\Filter", + "config-provider": "Zend\\Filter\\ConfigProvider" + } }, "autoload": { "psr-4": { - "Zend\\ComponentInstaller\\": "src/" + "Zend\\Filter\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "Composer plugin for automating component registration in zend-mvc and Expressive applications", + "description": "provides a set of commonly needed data filters", "keywords": [ "ZendFramework", - "component installer", - "composer", - "plugin", + "filter", "zf" ], - "time": "2018-01-11T15:03:06+00:00" + "time": "2018-04-11T16:20:04+00:00" }, { - "name": "zendframework/zend-config", - "version": "3.2.0", + "name": "zendframework/zend-form", + "version": "2.12.0", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-config.git", - "reference": "6796f5dcba52c84ef2501d7313618989b5ef3023" + "url": "https://github.com/zendframework/zend-form.git", + "reference": "565fb4f4bb3e0dbeea0173c923c4a8be77de9441" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-config/zipball/6796f5dcba52c84ef2501d7313618989b5ef3023", - "reference": "6796f5dcba52c84ef2501d7313618989b5ef3023", + "url": "https://api.github.com/repos/zendframework/zend-form/zipball/565fb4f4bb3e0dbeea0173c923c4a8be77de9441", + "reference": "565fb4f4bb3e0dbeea0173c923c4a8be77de9441", "shasum": "" }, "require": { - "ext-json": "*", "php": "^5.6 || ^7.0", - "psr/container": "^1.0", - "zendframework/zend-stdlib": "^2.7.7 || ^3.1" - }, - "conflict": { - "container-interop/container-interop": "<1.2.0" + "zendframework/zend-hydrator": "^1.1 || ^2.1", + "zendframework/zend-inputfilter": "^2.8", + "zendframework/zend-stdlib": "^2.7 || ^3.0" }, "require-dev": { - "malukenho/docheader": "^0.1.6", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "doctrine/annotations": "~1.0", + "phpunit/phpunit": "^5.7.23 || ^6.5.3", + "zendframework/zend-cache": "^2.6.1", + "zendframework/zend-captcha": "^2.7.1", + "zendframework/zend-code": "^2.6 || ^3.0", "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-filter": "^2.7.2", - "zendframework/zend-i18n": "^2.7.4", - "zendframework/zend-servicemanager": "^2.7.8 || ^3.3" + "zendframework/zend-escaper": "^2.5", + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", + "zendframework/zend-filter": "^2.6", + "zendframework/zend-i18n": "^2.6", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-session": "^2.8.1", + "zendframework/zend-text": "^2.6", + "zendframework/zend-validator": "^2.6", + "zendframework/zend-view": "^2.6.2", + "zendframework/zendservice-recaptcha": "^3.0.0" }, "suggest": { - "zendframework/zend-filter": "^2.7.2; install if you want to use the Filter processor", - "zendframework/zend-i18n": "^2.7.4; install if you want to use the Translator processor", - "zendframework/zend-servicemanager": "^2.7.8 || ^3.3; if you need an extensible plugin manager for use with the Config Factory" + "zendframework/zend-captcha": "^2.7.1, required for using CAPTCHA form elements", + "zendframework/zend-code": "^2.6 || ^3.0, required to use zend-form annotations support", + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0, reuired for zend-form annotations support", + "zendframework/zend-i18n": "^2.6, required when using zend-form view helpers", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3, required to use the form factories or provide services", + "zendframework/zend-view": "^2.6.2, required for using the zend-form view helpers", + "zendframework/zendservice-recaptcha": "in order to use the ReCaptcha form element" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev", - "dev-develop": "3.3.x-dev" + "dev-master": "2.12.x-dev", + "dev-develop": "2.13.x-dev" + }, + "zf": { + "component": "Zend\\Form", + "config-provider": "Zend\\Form\\ConfigProvider" } }, "autoload": { "psr-4": { - "Zend\\Config\\": "src/" - } + "Zend\\Form\\": "src/" + }, + "files": [ + "autoload/formElementManagerPolyfill.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "provides a nested object property based user interface for accessing this configuration data within application code", + "description": "Validate and display simple and complex forms, casting forms to business objects and vice versa", "keywords": [ "ZendFramework", - "config", + "form", "zf" ], - "time": "2018-04-24T19:26:44+00:00" + "time": "2018-05-16T18:49:44+00:00" }, { - "name": "zendframework/zend-escaper", - "version": "2.6.0", + "name": "zendframework/zend-http", + "version": "2.8.0", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-escaper.git", - "reference": "31d8aafae982f9568287cb4dce987e6aff8fd074" + "url": "https://github.com/zendframework/zend-http.git", + "reference": "f48b276ffa11b48dd1ae3c6bc306d6ed7958ef51" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/31d8aafae982f9568287cb4dce987e6aff8fd074", - "reference": "31d8aafae982f9568287cb4dce987e6aff8fd074", + "url": "https://api.github.com/repos/zendframework/zend-http/zipball/f48b276ffa11b48dd1ae3c6bc306d6ed7958ef51", + "reference": "f48b276ffa11b48dd1ae3c6bc306d6ed7958ef51", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^5.6 || ^7.0", + "zendframework/zend-loader": "^2.5.1", + "zendframework/zend-stdlib": "^3.1 || ^2.7.7", + "zendframework/zend-uri": "^2.5.2", + "zendframework/zend-validator": "^2.10.1" }, "require-dev": { - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", - "zendframework/zend-coding-standard": "~1.0.0" + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.3", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-config": "^3.1 || ^2.6" + }, + "suggest": { + "paragonie/certainty": "For automated management of cacert.pem" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6.x-dev", - "dev-develop": "2.7.x-dev" + "dev-master": "2.8.x-dev", + "dev-develop": "2.9.x-dev" } }, "autoload": { "psr-4": { - "Zend\\Escaper\\": "src/" + "Zend\\Http\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs", + "description": "Provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests", "keywords": [ "ZendFramework", - "escaper", + "http", + "http client", + "zend", "zf" ], - "time": "2018-04-25T15:48:53+00:00" + "time": "2018-04-26T21:04:50+00:00" }, { - "name": "zendframework/zend-eventmanager", - "version": "3.2.1", + "name": "zendframework/zend-hydrator", + "version": "2.4.0", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-eventmanager.git", - "reference": "a5e2583a211f73604691586b8406ff7296a946dd" + "url": "https://github.com/zendframework/zend-hydrator.git", + "reference": "bd48bc3bc046df007a94125f868dd1aa1b73a813" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/a5e2583a211f73604691586b8406ff7296a946dd", - "reference": "a5e2583a211f73604691586b8406ff7296a946dd", + "url": "https://api.github.com/repos/zendframework/zend-hydrator/zipball/bd48bc3bc046df007a94125f868dd1aa1b73a813", + "reference": "bd48bc3bc046df007a94125f868dd1aa1b73a813", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^5.6 || ^7.0", + "zendframework/zend-stdlib": "^3.0" }, "require-dev": { - "athletic/athletic": "^0.1", - "container-interop/container-interop": "^1.1.0", "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-stdlib": "^2.7.3 || ^3.0" + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", + "zendframework/zend-filter": "^2.6", + "zendframework/zend-inputfilter": "^2.6", + "zendframework/zend-serializer": "^2.6.1", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" }, "suggest": { - "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", - "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0, to support aggregate hydrator usage", + "zendframework/zend-filter": "^2.6, to support naming strategy hydrator usage", + "zendframework/zend-serializer": "^2.6.1, to use the SerializableStrategy", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3, to support hydrator plugin manager usage" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev", - "dev-develop": "3.3-dev" + "dev-release-1.0": "1.0.x-dev", + "dev-release-1.1": "1.1.x-dev", + "dev-master": "2.4.x-dev", + "dev-develop": "2.5.x-dev" + }, + "zf": { + "component": "Zend\\Hydrator", + "config-provider": "Zend\\Hydrator\\ConfigProvider" } }, "autoload": { "psr-4": { - "Zend\\EventManager\\": "src/" + "Zend\\Hydrator\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "Trigger and listen to events within a PHP application", - "homepage": "https://github.com/zendframework/zend-eventmanager", + "description": "Serialize objects to arrays, and vice versa", "keywords": [ - "event", - "eventmanager", - "events", - "zf2" + "ZendFramework", + "hydrator", + "zf" ], - "time": "2018-04-25T15:33:34+00:00" + "time": "2018-04-30T21:22:14+00:00" }, { - "name": "zendframework/zend-http", - "version": "2.8.0", + "name": "zendframework/zend-inputfilter", + "version": "2.8.2", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-http.git", - "reference": "f48b276ffa11b48dd1ae3c6bc306d6ed7958ef51" + "url": "https://github.com/zendframework/zend-inputfilter.git", + "reference": "3f02179e014d9ef0faccda2ad6c65d38adc338d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-http/zipball/f48b276ffa11b48dd1ae3c6bc306d6ed7958ef51", - "reference": "f48b276ffa11b48dd1ae3c6bc306d6ed7958ef51", + "url": "https://api.github.com/repos/zendframework/zend-inputfilter/zipball/3f02179e014d9ef0faccda2ad6c65d38adc338d8", + "reference": "3f02179e014d9ef0faccda2ad6c65d38adc338d8", "shasum": "" }, "require": { "php": "^5.6 || ^7.0", - "zendframework/zend-loader": "^2.5.1", - "zendframework/zend-stdlib": "^3.1 || ^2.7.7", - "zendframework/zend-uri": "^2.5.2", + "zendframework/zend-filter": "^2.6", + "zendframework/zend-servicemanager": "^2.7.10 || ^3.3.1", + "zendframework/zend-stdlib": "^2.7 || ^3.0", "zendframework/zend-validator": "^2.10.1" }, "require-dev": { - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.3", - "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-config": "^3.1 || ^2.6" - }, - "suggest": { - "paragonie/certainty": "For automated management of cacert.pem" + "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "2.8.x-dev", "dev-develop": "2.9.x-dev" + }, + "zf": { + "component": "Zend\\InputFilter", + "config-provider": "Zend\\InputFilter\\ConfigProvider" } }, "autoload": { "psr-4": { - "Zend\\Http\\": "src/" + "Zend\\InputFilter\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "Provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests", + "description": "Normalize and validate input sets from the web, APIs, the CLI, and more, including files", "keywords": [ "ZendFramework", - "http", - "http client", - "zend", + "inputfilter", "zf" ], - "time": "2018-04-26T21:04:50+00:00" + "time": "2018-05-14T17:38:03+00:00" }, { "name": "zendframework/zend-loader", @@ -529,6 +2036,71 @@ ], "time": "2017-11-24T06:32:07+00:00" }, + { + "name": "zendframework/zend-paginator", + "version": "2.8.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-paginator.git", + "reference": "fd58828c8280a90f133b9e0af2fe1a7885d47206" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-paginator/zipball/fd58828c8280a90f133b9e0af2fe1a7885d47206", + "reference": "fd58828c8280a90f133b9e0af2fe1a7885d47206", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^5.6", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.1 || ^5.7.15", + "zendframework/zend-cache": "^2.6.1", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-config": "^2.6.0", + "zendframework/zend-db": "^2.9.2", + "zendframework/zend-filter": "^2.6.1", + "zendframework/zend-json": "^2.6.1", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-view": "^2.6.3" + }, + "suggest": { + "zendframework/zend-cache": "Zend\\Cache component to support cache features", + "zendframework/zend-db": "Zend\\Db component", + "zendframework/zend-filter": "Zend\\Filter component", + "zendframework/zend-json": "Zend\\Json component", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component", + "zendframework/zend-view": "Zend\\View component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev", + "dev-develop": "2.9-dev" + }, + "zf": { + "component": "Zend\\Paginator", + "config-provider": "Zend\\Paginator\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Paginator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "zend-paginator is a flexible component for paginating collections of data and presenting that data to users.", + "homepage": "https://github.com/zendframework/zend-paginator", + "keywords": [ + "paginator", + "zf2" + ], + "time": "2018-01-30T15:52:44+00:00" + }, { "name": "zendframework/zend-router", "version": "3.1.0", @@ -912,60 +2484,6 @@ } ], "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2015-06-14T21:17:01+00:00" - }, { "name": "myclabs/deep-copy", "version": "1.7.0", @@ -1579,16 +3097,16 @@ }, { "name": "phpunit/phpunit", - "version": "6.5.8", + "version": "6.5.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "4f21a3c6b97c42952fd5c2837bb354ec0199b97b" + "reference": "093ca5508174cd8ab8efe44fd1dde447adfdec8f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4f21a3c6b97c42952fd5c2837bb354ec0199b97b", - "reference": "4f21a3c6b97c42952fd5c2837bb354ec0199b97b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/093ca5508174cd8ab8efe44fd1dde447adfdec8f", + "reference": "093ca5508174cd8ab8efe44fd1dde447adfdec8f", "shasum": "" }, "require": { @@ -1659,20 +3177,20 @@ "testing", "xunit" ], - "time": "2018-04-10T11:38:34+00:00" + "time": "2018-07-03T06:40:40+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "5.0.7", + "version": "5.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "3eaf040f20154d27d6da59ca2c6e28ac8fd56dce" + "reference": "6f9a3c8bf34188a2b53ce2ae7a126089c53e0a9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3eaf040f20154d27d6da59ca2c6e28ac8fd56dce", - "reference": "3eaf040f20154d27d6da59ca2c6e28ac8fd56dce", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/6f9a3c8bf34188a2b53ce2ae7a126089c53e0a9f", + "reference": "6f9a3c8bf34188a2b53ce2ae7a126089c53e0a9f", "shasum": "" }, "require": { @@ -1718,7 +3236,7 @@ "mock", "xunit" ], - "time": "2018-05-29T13:50:43+00:00" + "time": "2018-07-13T03:27:23+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", diff --git a/config/application.config.php b/config/application.config.php old mode 100644 new mode 100755 diff --git a/config/autoload/.gitignore b/config/autoload/.gitignore old mode 100644 new mode 100755 diff --git a/config/autoload/README.md b/config/autoload/README.md old mode 100644 new mode 100755 diff --git a/config/autoload/docker.php b/config/autoload/docker.php old mode 100644 new mode 100755 diff --git a/config/autoload/doctrine.docker.php b/config/autoload/doctrine.docker.php new file mode 100644 index 0000000..4711fe0 --- /dev/null +++ b/config/autoload/doctrine.docker.php @@ -0,0 +1,18 @@ + [ + 'connection' => [ + // default connection name + 'orm_default' => [ + 'driverClass' => \Doctrine\DBAL\Driver\PDOMySql\Driver::class, + 'params' => [ + 'host' => 'db', + 'port' => '3306', + 'user' => 'app', + 'password' => 'app', + 'dbname' => 'app', + ], + ], + ], + ], +]; \ No newline at end of file diff --git a/config/autoload/doctrine.global.php b/config/autoload/doctrine.global.php new file mode 100644 index 0000000..8c7d346 --- /dev/null +++ b/config/autoload/doctrine.global.php @@ -0,0 +1,26 @@ + [ + 'driver' => [ + // defines an annotation driver, named `annotation_driver` + 'annotation_driver' => [ + 'class' => \Doctrine\ORM\Mapping\Driver\AnnotationDriver::class, + 'cache' => 'array', + 'paths' => [ + realpath(__DIR__ . '/../../module/Application/src/Entity'), + ], + ], + // default metadata driver, aggregates all other drivers into a single one. + // Override `orm_default` only if you know what you're doing + 'orm_default' => [ + 'drivers' => [ + // register `annotation_driver` for any entity under namespace `Application\Entity` + 'Application\Entity' => 'annotation_driver', + ], + ], + ], + ], +]; \ No newline at end of file diff --git a/config/autoload/global.php b/config/autoload/global.php old mode 100644 new mode 100755 diff --git a/config/autoload/zend-developer-tools.docker.php b/config/autoload/zend-developer-tools.docker.php old mode 100644 new mode 100755 diff --git a/config/modules.config.php b/config/modules.config.php old mode 100644 new mode 100755 index 81b5749..b0887cd --- a/config/modules.config.php +++ b/config/modules.config.php @@ -6,7 +6,16 @@ * This should be an array of module namespaces used in the application. */ return [ + 'Zend\Cache', + 'Zend\Form', + 'Zend\InputFilter', + 'Zend\Filter', + 'Zend\Paginator', + 'Zend\Hydrator', 'Zend\Router', 'Zend\Validator', + 'DoctrineModule', + 'DoctrineORMModule', 'Application', + 'Example' ]; diff --git a/data/cache/.gitkeep b/data/cache/.gitkeep old mode 100644 new mode 100755 diff --git a/docker-compose.yml b/docker-compose.yml old mode 100644 new mode 100755 index 571a53d..b99f953 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,6 @@ services: dockerfile: Dockerfile environment: APP_ENV: docker - #command: /var/www/docker.sh volumes: - .:/var/www ports: diff --git a/docker-init.sh b/docker-init.sh new file mode 100644 index 0000000..59cf7db --- /dev/null +++ b/docker-init.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +vendor/bin/doctrine-module orm:schema-tool:update --force diff --git a/module/Application/config/module.config.php b/module/Application/config/module.config.php old mode 100644 new mode 100755 diff --git a/module/Application/src/Controller/IndexController.php b/module/Application/src/Controller/IndexController.php old mode 100644 new mode 100755 diff --git a/module/Application/src/Entity/Example.php b/module/Application/src/Entity/Example.php new file mode 100644 index 0000000..dedb72a --- /dev/null +++ b/module/Application/src/Entity/Example.php @@ -0,0 +1,24 @@ + [ + 'routes' => [ + 'example' => [ + 'type' => Segment::class, + 'options' => [ + 'route' => '/example[/:action]', + 'defaults' => [ + 'controller' => Controller\IndexController::class, + 'action' => 'index', + ], + ], + ], + ], + ], + 'controllers' => [ + 'factories' => [ + Controller\IndexController::class => Controller\Factory\IndexControllerFactory::class, + ], + ], + 'service_manager' => [ + 'factories' => [ + Service\ExampleService::class => InvokableFactory::class, + ], + ], + 'view_manager' => [ + 'template_map' => [ + 'example/index/index' => __DIR__ . '/../view/example/index/index.phtml', + ], + 'template_path_stack' => [ + __DIR__ . '/../view', + ], + ], +]; diff --git a/module/Example/src/Controller/Factory/IndexControllerFactory.php b/module/Example/src/Controller/Factory/IndexControllerFactory.php new file mode 100755 index 0000000..7d14620 --- /dev/null +++ b/module/Example/src/Controller/Factory/IndexControllerFactory.php @@ -0,0 +1,18 @@ +get('Example\Service\ExampleService'); + + return new IndexController($exampleService); + } +} diff --git a/module/Example/src/Controller/IndexController.php b/module/Example/src/Controller/IndexController.php new file mode 100755 index 0000000..d4ef807 --- /dev/null +++ b/module/Example/src/Controller/IndexController.php @@ -0,0 +1,27 @@ +exampleService = $exampleService; + } + + public function indexAction() + { + $view = new ViewModel(); + + $view->something = $this->exampleService->returnSomething(); + + return $view; + } +} diff --git a/module/Example/src/Module.php b/module/Example/src/Module.php new file mode 100755 index 0000000..f5bab3f --- /dev/null +++ b/module/Example/src/Module.php @@ -0,0 +1,11 @@ +setApplicationConfig(ArrayUtils::merge( + include __DIR__ . '/../../../../config/application.config.php', + $configOverrides + )); + + parent::setUp(); + } + + public function testIndexActionCanBeAccessed() + { + $this->dispatch('/', 'GET'); + $this->assertResponseStatusCode(200); + $this->assertModuleName('example'); + $this->assertControllerName(IndexController::class); // as specified in router's controller name alias + $this->assertControllerClass('IndexController'); + $this->assertMatchedRouteName('home'); + } +} diff --git a/module/Example/view/example/index/index.phtml b/module/Example/view/example/index/index.phtml new file mode 100755 index 0000000..0f8fc84 --- /dev/null +++ b/module/Example/view/example/index/index.phtml @@ -0,0 +1,4 @@ +

Hello

+ +

Following code from controller something ?>

+ diff --git a/phpcs.xml b/phpcs.xml old mode 100644 new mode 100755 diff --git a/phpunit.xml.dist b/phpunit.xml.dist old mode 100644 new mode 100755 diff --git a/public/.htaccess b/public/.htaccess old mode 100644 new mode 100755 diff --git a/public/css/bootstrap-theme.css b/public/css/bootstrap-theme.css old mode 100644 new mode 100755 diff --git a/public/css/bootstrap-theme.css.map b/public/css/bootstrap-theme.css.map old mode 100644 new mode 100755 diff --git a/public/css/bootstrap-theme.min.css b/public/css/bootstrap-theme.min.css old mode 100644 new mode 100755 diff --git a/public/css/bootstrap-theme.min.css.map b/public/css/bootstrap-theme.min.css.map old mode 100644 new mode 100755 diff --git a/public/css/bootstrap.css b/public/css/bootstrap.css old mode 100644 new mode 100755 diff --git a/public/css/bootstrap.css.map b/public/css/bootstrap.css.map old mode 100644 new mode 100755 diff --git a/public/css/bootstrap.min.css b/public/css/bootstrap.min.css old mode 100644 new mode 100755 diff --git a/public/css/bootstrap.min.css.map b/public/css/bootstrap.min.css.map old mode 100644 new mode 100755 diff --git a/public/css/style.css b/public/css/style.css old mode 100644 new mode 100755 diff --git a/public/fonts/glyphicons-halflings-regular.eot b/public/fonts/glyphicons-halflings-regular.eot old mode 100644 new mode 100755 diff --git a/public/fonts/glyphicons-halflings-regular.svg b/public/fonts/glyphicons-halflings-regular.svg old mode 100644 new mode 100755 diff --git a/public/fonts/glyphicons-halflings-regular.ttf b/public/fonts/glyphicons-halflings-regular.ttf old mode 100644 new mode 100755 diff --git a/public/fonts/glyphicons-halflings-regular.woff b/public/fonts/glyphicons-halflings-regular.woff old mode 100644 new mode 100755 diff --git a/public/fonts/glyphicons-halflings-regular.woff2 b/public/fonts/glyphicons-halflings-regular.woff2 old mode 100644 new mode 100755 diff --git a/public/index.php b/public/index.php old mode 100644 new mode 100755 diff --git a/public/js/bootstrap.js b/public/js/bootstrap.js old mode 100644 new mode 100755 diff --git a/public/js/bootstrap.min.js b/public/js/bootstrap.min.js old mode 100644 new mode 100755 diff --git a/public/js/jquery-3.1.0.min.js b/public/js/jquery-3.1.0.min.js old mode 100644 new mode 100755 diff --git a/public/web.config b/public/web.config old mode 100644 new mode 100755 From 35495f3511b38d3891bf22679197459fbef87929 Mon Sep 17 00:00:00 2001 From: moataz Date: Wed, 18 Jul 2018 15:19:50 +0200 Subject: [PATCH 2/7] user can list categories & products --- .../src/Entity/Category.php} | 0 module/Category/view/category/index/add.phtml | 1 + .../Category/view/category/index/delete.phtml | 1 + .../Category/view/category/index/edit.phtml | 1 + module/Product/src/Entity/Product.php | 24 +++++++++++++++++++ module/Product/view/product/index/add.phtml | 1 + .../Product/view/product/index/delete.phtml | 1 + module/Product/view/product/index/edit.phtml | 1 + 8 files changed, 30 insertions(+) rename module/{Application/src/Entity/Example.php => Category/src/Entity/Category.php} (100%) mode change 100644 => 100755 create mode 100755 module/Category/view/category/index/add.phtml create mode 100755 module/Category/view/category/index/delete.phtml create mode 100755 module/Category/view/category/index/edit.phtml create mode 100755 module/Product/src/Entity/Product.php create mode 100755 module/Product/view/product/index/add.phtml create mode 100755 module/Product/view/product/index/delete.phtml create mode 100755 module/Product/view/product/index/edit.phtml diff --git a/module/Application/src/Entity/Example.php b/module/Category/src/Entity/Category.php old mode 100644 new mode 100755 similarity index 100% rename from module/Application/src/Entity/Example.php rename to module/Category/src/Entity/Category.php diff --git a/module/Category/view/category/index/add.phtml b/module/Category/view/category/index/add.phtml new file mode 100755 index 0000000..02d5389 --- /dev/null +++ b/module/Category/view/category/index/add.phtml @@ -0,0 +1 @@ +

Add

\ No newline at end of file diff --git a/module/Category/view/category/index/delete.phtml b/module/Category/view/category/index/delete.phtml new file mode 100755 index 0000000..a904adc --- /dev/null +++ b/module/Category/view/category/index/delete.phtml @@ -0,0 +1 @@ +

Delete

\ No newline at end of file diff --git a/module/Category/view/category/index/edit.phtml b/module/Category/view/category/index/edit.phtml new file mode 100755 index 0000000..f7a4026 --- /dev/null +++ b/module/Category/view/category/index/edit.phtml @@ -0,0 +1 @@ +

Edit

\ No newline at end of file diff --git a/module/Product/src/Entity/Product.php b/module/Product/src/Entity/Product.php new file mode 100755 index 0000000..bed693e --- /dev/null +++ b/module/Product/src/Entity/Product.php @@ -0,0 +1,24 @@ +something ?> \ No newline at end of file diff --git a/module/Product/view/product/index/delete.phtml b/module/Product/view/product/index/delete.phtml new file mode 100755 index 0000000..02d5389 --- /dev/null +++ b/module/Product/view/product/index/delete.phtml @@ -0,0 +1 @@ +

Add

\ No newline at end of file diff --git a/module/Product/view/product/index/edit.phtml b/module/Product/view/product/index/edit.phtml new file mode 100755 index 0000000..02d5389 --- /dev/null +++ b/module/Product/view/product/index/edit.phtml @@ -0,0 +1 @@ +

Add

\ No newline at end of file From bd96e6c35609712665d31607a05b4d10fdc73655 Mon Sep 17 00:00:00 2001 From: moataz Date: Wed, 18 Jul 2018 17:09:16 +0200 Subject: [PATCH 3/7] user can add product && category --- module/Product/src/Form/PostForm.php | 7 +++ .../Service/Factory/ProductManagerFactory.php | 22 +++++++++ module/Product/src/Service/ProductManager.php | 46 +++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 module/Product/src/Form/PostForm.php create mode 100644 module/Product/src/Service/Factory/ProductManagerFactory.php create mode 100644 module/Product/src/Service/ProductManager.php diff --git a/module/Product/src/Form/PostForm.php b/module/Product/src/Form/PostForm.php new file mode 100644 index 0000000..56966c4 --- /dev/null +++ b/module/Product/src/Form/PostForm.php @@ -0,0 +1,7 @@ +get('doctrine.entitymanager.orm_default'); + + // Instantiate the service and inject dependencies + return new ProductManager($entityManager); + } +} \ No newline at end of file diff --git a/module/Product/src/Service/ProductManager.php b/module/Product/src/Service/ProductManager.php new file mode 100644 index 0000000..01e92a4 --- /dev/null +++ b/module/Product/src/Service/ProductManager.php @@ -0,0 +1,46 @@ +entityManager = $entityManager; + } + + // This method adds a new product. + public function addNewProduct($data) + { + // Create new Product entity. + $product = new Product(); + $product->setTitle($data['title']); + $product->setCategoryId(2); // todo : get it from data +// $product->setContent($data['content']); +// $product->setStatus($data['status']); + $currentDate = date('Y-m-d H:i:s'); + $product->setDateCreated($currentDate); + + // Add the entity to entity manager. + $this->entityManager->persist($product); + + // Add tags to product + $this->addTagsToProduct($data['tags'], $product); + + // Apply changes to database. + $this->entityManager->flush(); + } + +} \ No newline at end of file From 7537ef8b5cca352ba206cb7c72cc73f9b5d58faa Mon Sep 17 00:00:00 2001 From: moataz Date: Wed, 18 Jul 2018 17:13:13 +0200 Subject: [PATCH 4/7] - Add "Example" module - Configure Doctrin --- module/Application/view/layout/layout.phtml | 4 +- .../config/module.config.php | 14 +- .../Factory/IndexControllerFactory.php | 20 ++ .../src/Controller/IndexController.php | 72 +++++++ module/Category/src/Entity/Category.php | 96 +++++++++- module/Category/src/Module.php | 11 ++ .../Category/src/Service/CategoryService.php | 11 ++ .../test/Controller/IndexControllerTest.php | 8 +- .../Category/view/category/index/index.phtml | 31 +++ .../Factory/IndexControllerFactory.php | 18 -- .../src/Controller/IndexController.php | 27 --- module/Example/src/Service/ExampleService.php | 11 -- module/Example/view/example/index/index.phtml | 4 - module/Product/config/module.config.php | 47 +++++ .../Factory/ProductControllerFactory.php | 22 +++ .../src/Controller/ProductController.php | 89 +++++++++ module/Product/src/Entity/Product.php | 130 ++++++++++++- module/Product/src/Form/PostForm.php | 177 +++++++++++++++++- module/{Example => Product}/src/Module.php | 2 +- .../Service/Factory/ProductManagerFactory.php | 1 - module/Product/src/Service/ProductManager.php | 2 - module/Product/src/Service/ProductService.php | 11 ++ .../test/Controller/IndexControllerTest.php | 36 ++++ module/Product/view/product/index/add.phtml | 64 ++++++- .../Product/view/product/index/delete.phtml | 2 +- module/Product/view/product/index/edit.phtml | 2 +- module/Product/view/product/index/index.phtml | 26 +++ 27 files changed, 845 insertions(+), 93 deletions(-) rename module/{Example => Category}/config/module.config.php (66%) create mode 100755 module/Category/src/Controller/Factory/IndexControllerFactory.php create mode 100755 module/Category/src/Controller/IndexController.php create mode 100755 module/Category/src/Module.php create mode 100755 module/Category/src/Service/CategoryService.php rename module/{Example => Category}/test/Controller/IndexControllerTest.php (85%) create mode 100755 module/Category/view/category/index/index.phtml delete mode 100755 module/Example/src/Controller/Factory/IndexControllerFactory.php delete mode 100755 module/Example/src/Controller/IndexController.php delete mode 100755 module/Example/src/Service/ExampleService.php delete mode 100755 module/Example/view/example/index/index.phtml create mode 100755 module/Product/config/module.config.php create mode 100755 module/Product/src/Controller/Factory/ProductControllerFactory.php create mode 100755 module/Product/src/Controller/ProductController.php rename module/{Example => Product}/src/Module.php (87%) create mode 100755 module/Product/src/Service/ProductService.php create mode 100755 module/Product/test/Controller/IndexControllerTest.php create mode 100755 module/Product/view/product/index/index.phtml diff --git a/module/Application/view/layout/layout.phtml b/module/Application/view/layout/layout.phtml index 14dac28..ae5be7f 100755 --- a/module/Application/view/layout/layout.phtml +++ b/module/Application/view/layout/layout.phtml @@ -39,7 +39,9 @@ diff --git a/module/Example/config/module.config.php b/module/Category/config/module.config.php similarity index 66% rename from module/Example/config/module.config.php rename to module/Category/config/module.config.php index 0c109d1..14dd0bb 100755 --- a/module/Example/config/module.config.php +++ b/module/Category/config/module.config.php @@ -1,6 +1,6 @@ [ 'routes' => [ - 'example' => [ + 'category' => [ 'type' => Segment::class, 'options' => [ - 'route' => '/example[/:action]', + 'route' => '/category[/:action[/:id]]', + 'constraints' => [ + 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', + 'id' => '[0-9]+', + ], 'defaults' => [ 'controller' => Controller\IndexController::class, 'action' => 'index', @@ -28,12 +32,12 @@ ], 'service_manager' => [ 'factories' => [ - Service\ExampleService::class => InvokableFactory::class, + Service\CategoryService::class => InvokableFactory::class, ], ], 'view_manager' => [ 'template_map' => [ - 'example/index/index' => __DIR__ . '/../view/example/index/index.phtml', + 'category/index/index' => __DIR__ . '/../view/category/index/index.phtml', ], 'template_path_stack' => [ __DIR__ . '/../view', diff --git a/module/Category/src/Controller/Factory/IndexControllerFactory.php b/module/Category/src/Controller/Factory/IndexControllerFactory.php new file mode 100755 index 0000000..22215c1 --- /dev/null +++ b/module/Category/src/Controller/Factory/IndexControllerFactory.php @@ -0,0 +1,20 @@ +get('Category\Service\CategoryService'); + $entityManager = $container->get('doctrine.entitymanager.orm_default'); + return new IndexController($categoryService,$entityManager); + } +} diff --git a/module/Category/src/Controller/IndexController.php b/module/Category/src/Controller/IndexController.php new file mode 100755 index 0000000..c861db4 --- /dev/null +++ b/module/Category/src/Controller/IndexController.php @@ -0,0 +1,72 @@ +categoryService = $categoryService; + $this->entityManager = $entityManager; + } + + public function indexAction() + { + + + $categories = $this->entityManager->getRepository(Category::class)->findAll(); + $view = new ViewModel(); + $view->categories = $categories; + return $view; + } + + + + public function addAction() + { + + + // Create new Post entity. + $category = new Category(); +// $category = $this->entityManager->getRepository(Category::class); + + $category->setTitle('Category from controller'); +// $category->setContent('Post body goes here'); +// $category->setStatus(Post::STATUS_PUBLISHED); + $currentDate = date('Y-m-d H:i:s'); + $category->setDateCreated($currentDate); + +// Add the entity to entity manager. + $this->entityManager->persist($category); +// Apply changes to database. + $this->entityManager->flush(); + + + $view = new ViewModel(); + return $view; + } + + public function editAction() + { + $view = new ViewModel(); + return $view; + } + + + public function deleteAction() + { + $view = new ViewModel(); + return $view; + } +} diff --git a/module/Category/src/Entity/Category.php b/module/Category/src/Entity/Category.php index dedb72a..71d402a 100755 --- a/module/Category/src/Entity/Category.php +++ b/module/Category/src/Entity/Category.php @@ -1,13 +1,13 @@ id; + } + + // Sets ID + public function setId($id) + { + $this->id = $id; + } + + + // Returns Title + public function getTitle() + { + return $this->title; + } + + // Sets Title + public function setTitle($title) + { + $this->title = $title; + } + + + // Returns the date when this item was created. + public function getDateCreated() + { + return $this->dateCreated; + } + + // Sets the date when this item was created. + public function setDateCreated($dateCreated) + { + $this->dateCreated = $dateCreated; + } + + + + /* Relations */ + + /** + * @ORM\OneToMany(targetEntity="\Product\Entity\Product", mappedBy="product") + * @ORM\JoinColumn(name="id", referencedColumnName="product_id") + */ + protected $products; + + + /** + * Constructor. + */ + public function __construct() + { +// $this->products = new ArrayCollection(); + } + + /** + * Returns products for this post. + * @return array + */ + public function getProducts() + { + return $this->products; + } + + /** + * Adds a new product to this post. + * @param $product + */ + public function addProduct($product) + { + $this->products[] = $product; + } } \ No newline at end of file diff --git a/module/Category/src/Module.php b/module/Category/src/Module.php new file mode 100755 index 0000000..a57301f --- /dev/null +++ b/module/Category/src/Module.php @@ -0,0 +1,11 @@ +dispatch('/', 'GET'); $this->assertResponseStatusCode(200); - $this->assertModuleName('example'); + $this->assertModuleName('category'); $this->assertControllerName(IndexController::class); // as specified in router's controller name alias $this->assertControllerClass('IndexController'); - $this->assertMatchedRouteName('home'); + $this->assertMatchedRouteName('category'); } } diff --git a/module/Category/view/category/index/index.phtml b/module/Category/view/category/index/index.phtml new file mode 100755 index 0000000..31c1fbd --- /dev/null +++ b/module/Category/view/category/index/index.phtml @@ -0,0 +1,31 @@ +

Categories Add +

+ + + + + + + + + + + + categories as $category): ?> + + + + + + + + + + +
TitleCreated TimeActions
escapeHtml($category->getTitle()); ?> escapeHtml($category->getDateCreated()); ?> + Edit + Delete +
+ + + diff --git a/module/Example/src/Controller/Factory/IndexControllerFactory.php b/module/Example/src/Controller/Factory/IndexControllerFactory.php deleted file mode 100755 index 7d14620..0000000 --- a/module/Example/src/Controller/Factory/IndexControllerFactory.php +++ /dev/null @@ -1,18 +0,0 @@ -get('Example\Service\ExampleService'); - - return new IndexController($exampleService); - } -} diff --git a/module/Example/src/Controller/IndexController.php b/module/Example/src/Controller/IndexController.php deleted file mode 100755 index d4ef807..0000000 --- a/module/Example/src/Controller/IndexController.php +++ /dev/null @@ -1,27 +0,0 @@ -exampleService = $exampleService; - } - - public function indexAction() - { - $view = new ViewModel(); - - $view->something = $this->exampleService->returnSomething(); - - return $view; - } -} diff --git a/module/Example/src/Service/ExampleService.php b/module/Example/src/Service/ExampleService.php deleted file mode 100755 index 9e3bb38..0000000 --- a/module/Example/src/Service/ExampleService.php +++ /dev/null @@ -1,11 +0,0 @@ -Hello - -

Following code from controller something ?>

- diff --git a/module/Product/config/module.config.php b/module/Product/config/module.config.php new file mode 100755 index 0000000..8a3652d --- /dev/null +++ b/module/Product/config/module.config.php @@ -0,0 +1,47 @@ + [ + 'routes' => [ + 'product' => [ + 'type' => Segment::class, + 'options' => [ + 'route' => '/product[/:action[/:id]]', + 'constraints' => [ + 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', + 'id' => '[0-9]+', + ], + 'defaults' => [ + 'controller' => Controller\ProductController::class, + 'action' => 'index', + ], + ], + ], + ], + ], + 'controllers' => [ + 'factories' => [ + Controller\ProductController::class => Controller\Factory\ProductControllerFactory::class, + ], + ], + 'service_manager' => [ + 'factories' => [ + Service\ProductManager::class => Service\Factory\ProductManagerFactory::class, + + ], + ], + 'view_manager' => [ + 'template_map' => [ + 'product/index/index' => __DIR__ . '/../view/product/index/index.phtml', + ], + 'template_path_stack' => [ + __DIR__ . '/../view', + ], + ], +]; diff --git a/module/Product/src/Controller/Factory/ProductControllerFactory.php b/module/Product/src/Controller/Factory/ProductControllerFactory.php new file mode 100755 index 0000000..c08cdbf --- /dev/null +++ b/module/Product/src/Controller/Factory/ProductControllerFactory.php @@ -0,0 +1,22 @@ +get('doctrine.entitymanager.orm_default'); +// $productService = $container->get('Product\Service\ProductService'); + $productManager = $container->get(ProductManager::class); + return new ProductController($productManager,$entityManager); + } +} diff --git a/module/Product/src/Controller/ProductController.php b/module/Product/src/Controller/ProductController.php new file mode 100755 index 0000000..6e925da --- /dev/null +++ b/module/Product/src/Controller/ProductController.php @@ -0,0 +1,89 @@ +productManager = $productManager; + $this->entityManager = $entityManager; + } + + public function indexAction() + { + + + $products = $this->entityManager->getRepository(Product::class)->findAll(); + + $view = new ViewModel(); + $view->products = $products; + return $view; + } + + + /** + * This action displays the "New Product" page. The page contains + * a form allowing to enter post title, content and tags. When + * the user clicks the Submit button, a new Product entity will + * be created. + */ + public function addAction() + { + // Create the form. + $form = new ProductForm(); + + // Check whether this post is a POST request. + if ($this->getRequest()->isPost()) { + + // Get POST data. + $data = $this->params()->fromProduct(); + + // Fill form with data. + $form->setData($data); + if ($form->isValid()) { + + // Get validated form data. + $data = $form->getData(); + + // Use post manager service to add new post to database. + $this->postManager->addNewProduct($data); + + // Redirect the user to "index" page. + return $this->redirect()->toRoute('application'); + } + } + + // Render the view template. + return new ViewModel([ + 'form' => $form + ]); + } + + public function editAction() + { + $view = new ViewModel(); + return $view; + } + + + public function deleteAction() + { + $view = new ViewModel(); + return $view; + } +} diff --git a/module/Product/src/Entity/Product.php b/module/Product/src/Entity/Product.php index bed693e..fa79560 100755 --- a/module/Product/src/Entity/Product.php +++ b/module/Product/src/Entity/Product.php @@ -1,13 +1,13 @@ id; + } + + // Sets ID + public function setId($id) + { + $this->id = $id; + } + + + // Returns Title + public function getTitle() + { + return $this->title; + } + + // Sets Title + public function setTitle($title) + { + $this->title = $title; + } + + + + // Returns Price + public function getPrice() + { + return $this->price; + } + + // Sets Price + public function setPrice($price) + { + $this->price = $price; + } + + + + + // Returns CategoryId + public function getCategoryId() + { + return $this->category_id; + } + + // Sets CategoryId + public function setCategoryId($category_id) + { + $this->category_id = $category_id; + } + + // Returns the date when this item was created. + public function getDateCreated() + { + return $this->dateCreated; + } + + // Sets the date when this item was created. + public function setDateCreated($dateCreated) + { + $this->dateCreated = $dateCreated; + } + + + /*Relations*/ + + /** + * @ORM\ManyToOne(targetEntity="\Category\Entity\Category", inversedBy="categories") + * @ORM\JoinColumn(name="category_id", referencedColumnName="id") + */ + protected $category; + + /* + * Returns associated category. + * @return \Category\Entity\Category + */ + public function getCategory() + { + return $this->category; + } + + /** + * Sets associated category. + * @param \Category\Entity\Category $category + */ + public function setCategory($category) + { + $this->category = $category; + $category->addComment($this); + } + + + + } \ No newline at end of file diff --git a/module/Product/src/Form/PostForm.php b/module/Product/src/Form/PostForm.php index 56966c4..8e4f56b 100644 --- a/module/Product/src/Form/PostForm.php +++ b/module/Product/src/Form/PostForm.php @@ -1,7 +1,174 @@ setAttribute('method', 'post'); + $this->addElements(); + $this->addInputFilter(); + } + + /** + * This method adds elements to form (input fields and submit button). + */ + protected function addElements() + { + + // Add "title" field + $this->add([ + 'type' => 'text', + 'name' => 'title', + 'attributes' => [ + 'id' => 'title' + ], + 'options' => [ + 'label' => 'Title', + ], + ]); + + // Add "content" field + $this->add([ + 'type' => 'textarea', + 'name' => 'content', + 'attributes' => [ + 'id' => 'content' + ], + 'options' => [ + 'label' => 'Content', + ], + ]); + + // Add "tags" field + $this->add([ + 'type' => 'text', + 'name' => 'tags', + 'attributes' => [ + 'id' => 'tags' + ], + 'options' => [ + 'label' => 'Tags', + ], + ]); + + // Add "status" field + $this->add([ + 'type' => 'select', + 'name' => 'status', + 'attributes' => [ + 'id' => 'status' + ], + 'options' => [ + 'label' => 'Status', + 'value_options' => [ + Post::STATUS_PUBLISHED => 'Published', + Post::STATUS_DRAFT => 'Draft', + ] + ], + ]); + + // Add the submit button + $this->add([ + 'type' => 'submit', + 'name' => 'submit', + 'attributes' => [ + 'value' => 'Create', + 'id' => 'submitbutton', + ], + ]); + } + + /** + * This method creates input filter (used for form filtering/validation). + */ + private function addInputFilter() + { + + $inputFilter = new InputFilter(); + $this->setInputFilter($inputFilter); + + $inputFilter->add([ + 'name' => 'title', + 'required' => true, + 'filters' => [ + ['name' => 'StringTrim'], + ['name' => 'StripTags'], + ['name' => 'StripNewlines'], + ], + 'validators' => [ + [ + 'name' => 'StringLength', + 'options' => [ + 'min' => 1, + 'max' => 1024 + ], + ], + ], + ]); + + $inputFilter->add([ + 'name' => 'content', + 'required' => true, + 'filters' => [ + ['name' => 'StripTags'], + ], + 'validators' => [ + [ + 'name' => 'StringLength', + 'options' => [ + 'min' => 1, + 'max' => 4096 + ], + ], + ], + ]); + + $inputFilter->add([ + 'name' => 'tags', + 'required' => true, + 'filters' => [ + ['name' => 'StringTrim'], + ['name' => 'StripTags'], + ['name' => 'StripNewlines'], + ], + 'validators' => [ + [ + 'name' => 'StringLength', + 'options' => [ + 'min' => 1, + 'max' => 1024 + ], + ], + ], + ]); + + $inputFilter->add([ + 'name' => 'status', + 'required' => true, + 'validators' => [ + [ + 'name' => 'InArray', + 'options'=> [ + 'haystack' => [Post::STATUS_PUBLISHED, Post::STATUS_DRAFT], + ] + ], + ], + ]); + } +} \ No newline at end of file diff --git a/module/Example/src/Module.php b/module/Product/src/Module.php similarity index 87% rename from module/Example/src/Module.php rename to module/Product/src/Module.php index f5bab3f..e9bbc43 100755 --- a/module/Example/src/Module.php +++ b/module/Product/src/Module.php @@ -1,6 +1,6 @@ get('doctrine.entitymanager.orm_default'); - // Instantiate the service and inject dependencies return new ProductManager($entityManager); } diff --git a/module/Product/src/Service/ProductManager.php b/module/Product/src/Service/ProductManager.php index 01e92a4..4178c25 100644 --- a/module/Product/src/Service/ProductManager.php +++ b/module/Product/src/Service/ProductManager.php @@ -2,8 +2,6 @@ namespace Product\Service; use Product\Entity\Product; -use Product\Entity\Comment; -use Product\Entity\Tag; use Zend\Filter\StaticFilter; // The ProductManager service is responsible for adding new products. diff --git a/module/Product/src/Service/ProductService.php b/module/Product/src/Service/ProductService.php new file mode 100755 index 0000000..9d93e8e --- /dev/null +++ b/module/Product/src/Service/ProductService.php @@ -0,0 +1,11 @@ +setApplicationConfig(ArrayUtils::merge( + include __DIR__ . '/../../../../config/application.config.php', + $configOverrides + )); + + parent::setUp(); + } + + public function testIndexActionCanBeAccessed() + { + $this->dispatch('/', 'GET'); + $this->assertResponseStatusCode(200); + $this->assertModuleName('example'); + $this->assertControllerName(ProductController::class); // as specified in router's controller name alias + $this->assertControllerClass('IndexController'); + $this->assertMatchedRouteName('home'); + } +} diff --git a/module/Product/view/product/index/add.phtml b/module/Product/view/product/index/add.phtml index 1a4c933..6d6f28f 100755 --- a/module/Product/view/product/index/add.phtml +++ b/module/Product/view/product/index/add.phtml @@ -1 +1,63 @@ -

something ?>

\ No newline at end of file +form; +$form->get('title')->setAttributes([ + 'class'=>'form-control', + 'placeholder'=>'Enter product title here' +]); +$form->get('content')->setAttributes([ + 'class'=>'form-control', + 'placeholder'=>'Type content here', + 'rows'=>6 +]); +$form->get('tags')->setAttributes([ + 'class'=>'form-control', + 'placeholder'=>'comma, separated, list, of, tags' +]); +$form->get('status')->setAttributes([ + 'class'=>'form-control' +]); +$form->get('submit')->setAttributes(['class'=>'btn btn-primary']); +$form->prepare(); + +?> + +

Add New Product

+ +

+ Please fill out the following form and click the Create button. +

+ +
+
+ form()->openTag($form); ?> + +
+ formLabel($form->get('title')); ?> + formElement($form->get('title')); ?> + formElementErrors($form->get('title')); ?> +
+ +
+ formLabel($form->get('content')); ?> + formElement($form->get('content')); ?> + formElementErrors($form->get('content')); ?> +
+ +
+ formLabel($form->get('tags')); ?> + formElement($form->get('tags')); ?> + formElementErrors($form->get('tags')); ?> +

Separate tags with comma.

+
+ +
+ formLabel($form->get('status')); ?> + formElement($form->get('status')); ?> + formElementErrors($form->get('status')); ?> +
+ + formElement($form->get('submit')); ?> + + form()->closeTag(); ?> +
+
\ No newline at end of file diff --git a/module/Product/view/product/index/delete.phtml b/module/Product/view/product/index/delete.phtml index 02d5389..a904adc 100755 --- a/module/Product/view/product/index/delete.phtml +++ b/module/Product/view/product/index/delete.phtml @@ -1 +1 @@ -

Add

\ No newline at end of file +

Delete

\ No newline at end of file diff --git a/module/Product/view/product/index/edit.phtml b/module/Product/view/product/index/edit.phtml index 02d5389..f7a4026 100755 --- a/module/Product/view/product/index/edit.phtml +++ b/module/Product/view/product/index/edit.phtml @@ -1 +1 @@ -

Add

\ No newline at end of file +

Edit

\ No newline at end of file diff --git a/module/Product/view/product/index/index.phtml b/module/Product/view/product/index/index.phtml new file mode 100755 index 0000000..db3d302 --- /dev/null +++ b/module/Product/view/product/index/index.phtml @@ -0,0 +1,26 @@ +

Products Add + + + + + + + + + + products as $product): ?> + + + + + + + + +
TitleCreated TimeActions
escapeHtml($product->getTitle()); ?> escapeHtml($product->getDateCreated()); ?> + Edit + Delete +
+ + + From abf2545718755870a0b8fdff6a668feda019ba07 Mon Sep 17 00:00:00 2001 From: moataz Date: Sun, 22 Jul 2018 15:20:39 +0200 Subject: [PATCH 5/7] Product CRUD Category CRUD --- .../Proxy/__CG__CategoryEntityCategory.php | 246 ++++++++++++++++++ .../src/Controller/CategoryController.php | 173 ++++++++++++ module/Category/view/edit.phtml | 36 +++ .../view/{category/index => }/index.phtml | 7 +- .../Factory/ProductControllerFactory.php | 1 - .../src/Controller/ProductController.php | 140 ++++++++-- .../Service/Factory/ProductManagerFactory.php | 2 +- module/Product/src/Service/ProductManager.php | 55 +++- 8 files changed, 633 insertions(+), 27 deletions(-) create mode 100644 data/DoctrineORMModule/Proxy/__CG__CategoryEntityCategory.php create mode 100755 module/Category/src/Controller/CategoryController.php create mode 100755 module/Category/view/edit.phtml rename module/Category/view/{category/index => }/index.phtml (71%) diff --git a/data/DoctrineORMModule/Proxy/__CG__CategoryEntityCategory.php b/data/DoctrineORMModule/Proxy/__CG__CategoryEntityCategory.php new file mode 100644 index 0000000..2725044 --- /dev/null +++ b/data/DoctrineORMModule/Proxy/__CG__CategoryEntityCategory.php @@ -0,0 +1,246 @@ +__initializer__ = $initializer; + $this->__cloner__ = $cloner; + } + + + + + + + + /** + * + * @return array + */ + public function __sleep() + { + if ($this->__isInitialized__) { + return ['__isInitialized__', '' . "\0" . 'Category\\Entity\\Category' . "\0" . 'id', '' . "\0" . 'Category\\Entity\\Category' . "\0" . 'title', 'dateCreated']; + } + + return ['__isInitialized__', '' . "\0" . 'Category\\Entity\\Category' . "\0" . 'id', '' . "\0" . 'Category\\Entity\\Category' . "\0" . 'title', 'dateCreated']; + } + + /** + * + */ + public function __wakeup() + { + if ( ! $this->__isInitialized__) { + $this->__initializer__ = function (Category $proxy) { + $proxy->__setInitializer(null); + $proxy->__setCloner(null); + + $existingProperties = get_object_vars($proxy); + + foreach ($proxy->__getLazyProperties() as $property => $defaultValue) { + if ( ! array_key_exists($property, $existingProperties)) { + $proxy->$property = $defaultValue; + } + } + }; + + } + } + + /** + * + */ + public function __clone() + { + $this->__cloner__ && $this->__cloner__->__invoke($this, '__clone', []); + } + + /** + * Forces initialization of the proxy + */ + public function __load() + { + $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []); + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + */ + public function __isInitialized() + { + return $this->__isInitialized__; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + */ + public function __setInitialized($initialized) + { + $this->__isInitialized__ = $initialized; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + */ + public function __setInitializer(\Closure $initializer = null) + { + $this->__initializer__ = $initializer; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + */ + public function __getInitializer() + { + return $this->__initializer__; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + */ + public function __setCloner(\Closure $cloner = null) + { + $this->__cloner__ = $cloner; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific cloning logic + */ + public function __getCloner() + { + return $this->__cloner__; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + * @static + */ + public function __getLazyProperties() + { + return self::$lazyPropertiesDefaults; + } + + + /** + * {@inheritDoc} + */ + public function getId() + { + if ($this->__isInitialized__ === false) { + return (int) parent::getId(); + } + + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', []); + + return parent::getId(); + } + + /** + * {@inheritDoc} + */ + public function setId($id) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setId', [$id]); + + return parent::setId($id); + } + + /** + * {@inheritDoc} + */ + public function getTitle() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getTitle', []); + + return parent::getTitle(); + } + + /** + * {@inheritDoc} + */ + public function setTitle($title) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setTitle', [$title]); + + return parent::setTitle($title); + } + + /** + * {@inheritDoc} + */ + public function getDateCreated() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDateCreated', []); + + return parent::getDateCreated(); + } + + /** + * {@inheritDoc} + */ + public function setDateCreated($dateCreated) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDateCreated', [$dateCreated]); + + return parent::setDateCreated($dateCreated); + } + +} diff --git a/module/Category/src/Controller/CategoryController.php b/module/Category/src/Controller/CategoryController.php new file mode 100755 index 0000000..54a1303 --- /dev/null +++ b/module/Category/src/Controller/CategoryController.php @@ -0,0 +1,173 @@ +categoryManager = $categoryManager; + $this->entityManager = $entityManager; + } + + public function indexAction() + { + + + $categories = $this->entityManager->getRepository(Category::class)->findAll(); + $view = new ViewModel(); +// // $view->setTemplate('category/category/index'); + $view->categories = $categories; + return $view; + } + + + + + /** + * This action displays the "New Category" page. The page contains + * a form allowing to enter category title, content and tags. When + * the user clicks the Submit button, a new Category entity will + * be created. + */ + public function addAction() + { + + + + // Create the form. + $form = new CategoryForm(); + + // Check whether this category is a POST request. + if ($this->getRequest()->isPost()) { + + // Get data. + $data = $this->params()->fromPost(); + + + // Fill form with data. + $form->setData($data); + if ($form->isValid()) { + // Get validated form data. + $data = $form->getData(); + + $this->categoryManager->addNewCategory($data); + // Redirect the user to "index" page. + return $this->redirect()->toRoute('category'); + } + } + + // Render the view template. + + $view = new ViewModel([ + 'form' => $form, + ]); + + + return $view; + } + + + // This action displays the page allowing to edit a product. + public function editAction() + { + // Create the form. + + + + + $form = new CategoryForm(); + + // Get Category ID. + $category_id = $this->params()->fromRoute('id', -1); + + + + // Find existing product in the database. + $category = $this->entityManager->getRepository(Category::class) + ->findOneById($category_id); + + + if ($category == null) { + $this->getResponse()->setStatusCode(404); + return; + } + + + // Check whether this product is a POST request. + if ($this->getRequest()->isPost()) { + + // Get POST data. + $data = $this->params()->fromPost(); + + + + + + // Fill form with data. + $form->setData($data); + if ($form->isValid()) { + + + + // Get validated form data. + $data = $form->getData(); + + // Use product manager service to add new product to database. + $this->categoryManager->updateCategory($category, $data); + + // Redirect the user to "admin" page. + return $this->redirect()->toRoute('category', ['action'=>'index']); + } + } else { + $data = [ + 'title' => $category->getTitle(), + ]; + + + + $form->setData($data); + } + + + + + // Render the view template. + $view = new ViewModel([ + 'form' => $form, + 'category' => $category + ]); + + return $view ; + } + + // This "delete" action displays the Delete Post page. + public function deleteAction() + { + $category_id = $this->params()->fromRoute('id', -1); + + $product = $this->entityManager->getRepository(Category::class) + ->findOneById($category_id); + if ($product == null) { + $this->getResponse()->setStatusCode(404); + return; + } + + $this->categoryManager->removeCategory($product); + + // Redirect the user to "index" page. + return $this->redirect()->toRoute('category', ['action'=>'index']); + } +} diff --git a/module/Category/view/edit.phtml b/module/Category/view/edit.phtml new file mode 100755 index 0000000..8b2b513 --- /dev/null +++ b/module/Category/view/edit.phtml @@ -0,0 +1,36 @@ +form; +$form->get('title')->setAttributes([ + 'class'=>'form-control', + 'placeholder'=>'Enter Category title here' +]); + + + +$form->get('submit')->setAttributes(['class'=>'btn btn-primary']); +$form->get('submit')->setValue('Save'); +$form->prepare(); + +?> + +

Edit Category

+ +

+ Please fill out the following form and click the *Save* button. +

+ +
+
+ form()->openTag($form); ?> + +
+ formLabel($form->get('title')); ?> + formElement($form->get('title')); ?> + formElementErrors($form->get('title')); ?> +
+ + formElement($form->get('submit')); ?> + + form()->closeTag(); ?> +
+
\ No newline at end of file diff --git a/module/Category/view/category/index/index.phtml b/module/Category/view/index.phtml similarity index 71% rename from module/Category/view/category/index/index.phtml rename to module/Category/view/index.phtml index 31c1fbd..5774fdb 100755 --- a/module/Category/view/category/index/index.phtml +++ b/module/Category/view/index.phtml @@ -17,8 +17,11 @@ escapeHtml($category->getDateCreated()); ?> - Edit - Delete + +
+ Edit + Delete +
diff --git a/module/Product/src/Controller/Factory/ProductControllerFactory.php b/module/Product/src/Controller/Factory/ProductControllerFactory.php index c08cdbf..db8c9df 100755 --- a/module/Product/src/Controller/Factory/ProductControllerFactory.php +++ b/module/Product/src/Controller/Factory/ProductControllerFactory.php @@ -15,7 +15,6 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o // Get Doctrine entity manager $entityManager = $container->get('doctrine.entitymanager.orm_default'); -// $productService = $container->get('Product\Service\ProductService'); $productManager = $container->get(ProductManager::class); return new ProductController($productManager,$entityManager); } diff --git a/module/Product/src/Controller/ProductController.php b/module/Product/src/Controller/ProductController.php index 6e925da..bd3198c 100755 --- a/module/Product/src/Controller/ProductController.php +++ b/module/Product/src/Controller/ProductController.php @@ -1,10 +1,14 @@ productManager = $productManager; $this->entityManager = $entityManager; } @@ -31,6 +36,11 @@ public function indexAction() $products = $this->entityManager->getRepository(Product::class)->findAll(); $view = new ViewModel(); +// // $view->setTemplate('index'); + +// // $view->setTemplate('product/index'); // path to phtml file under view folder +// // $view->setTemplate('product/view/index.phtml'); // module/Test/view/test/test/ + $view->products = $products; return $view; } @@ -38,52 +48,148 @@ public function indexAction() /** * This action displays the "New Product" page. The page contains - * a form allowing to enter post title, content and tags. When + * a form allowing to enter product title, content and tags. When * the user clicks the Submit button, a new Product entity will * be created. */ public function addAction() { + + $categories = $this->entityManager->getRepository(Category::class)->findAll(); + + // Create the form. - $form = new ProductForm(); + $form = new ProductForm($categories); - // Check whether this post is a POST request. + + // Check whether this product is a POST request. if ($this->getRequest()->isPost()) { // Get POST data. - $data = $this->params()->fromProduct(); + $data = $this->params()->fromPost(); + + // Fill form with data. $form->setData($data); if ($form->isValid()) { - // Get validated form data. $data = $form->getData(); - // Use post manager service to add new post to database. - $this->postManager->addNewProduct($data); - +// $data['category_id'] = (int) $data['category_id']; + // Use product manager service to add new product to database. + $this->productManager->addNewProduct($data); // Redirect the user to "index" page. - return $this->redirect()->toRoute('application'); + return $this->redirect()->toRoute('product'); } } // Render the view template. - return new ViewModel([ - 'form' => $form + + $view = new ViewModel([ + 'form' => $form, ]); + +// // $view->setTemplate('add'); + + return $view; } + // This action displays the page allowing to edit a product. public function editAction() { - $view = new ViewModel(); - return $view; + // Create the form. + + $categories = $this->entityManager->getRepository(Category::class)->findAll(); + + + + $form = new ProductForm($categories); + + // Get product ID. + $productId = $this->params()->fromRoute('id', -1); + + + + // Find existing product in the database. + $product = $this->entityManager->getRepository(Product::class) + ->findOneById($productId); + + + if ($product == null) { + $this->getResponse()->setStatusCode(404); + return; + } + + + // Check whether this product is a POST request. + if ($this->getRequest()->isPost()) { + + // Get POST data. + $data = $this->params()->fromPost(); + + + + + + // Fill form with data. + $form->setData($data); + if ($form->isValid()) { + + + + // Get validated form data. + $data = $form->getData(); + + // Use product manager service to add new product to database. + + + $this->productManager->updateProduct($product, $data); + + // Redirect the user to "admin" page. + return $this->redirect()->toRoute('product', ['action'=>'index']); + } + } else { + $data = [ + 'title' => $product->getTitle(), + 'price' => $product->getPrice(), + 'category_id' => $product->getCategoryId(), + ]; + + + + $form->setData($data); + } + + + + + // Render the view template. + $view = new ViewModel([ + 'form' => $form, + 'product' => $product + ]); + + // $view->setTemplate('edit'); + return $view ; } + // This "delete" action displays the Delete Post page. public function deleteAction() { - $view = new ViewModel(); - return $view; + $productId = $this->params()->fromRoute('id', -1); + + $product = $this->entityManager->getRepository(Product::class) + ->findOneById($productId); + if ($product == null) { + $this->getResponse()->setStatusCode(404); + return; + } + + $this->productManager->removeProduct($product); + + // Redirect the user to "index" page. + return $this->redirect()->toRoute('product', ['action'=>'index']); } } diff --git a/module/Product/src/Service/Factory/ProductManagerFactory.php b/module/Product/src/Service/Factory/ProductManagerFactory.php index 12f935a..8ff8bdf 100644 --- a/module/Product/src/Service/Factory/ProductManagerFactory.php +++ b/module/Product/src/Service/Factory/ProductManagerFactory.php @@ -2,8 +2,8 @@ namespace Product\Service\Factory; use Interop\Container\ContainerInterface; -use Zend\ServiceManager\Factory\FactoryInterface; use Product\Service\ProductManager; +use Zend\ServiceManager\Factory\FactoryInterface; /** * This is the factory for ProductManager. Its purpose is to instantiate the diff --git a/module/Product/src/Service/ProductManager.php b/module/Product/src/Service/ProductManager.php index 4178c25..66628cb 100644 --- a/module/Product/src/Service/ProductManager.php +++ b/module/Product/src/Service/ProductManager.php @@ -1,6 +1,8 @@ entityManager = $entityManager; } // This method adds a new product. public function addNewProduct($data) { + + // Create new Product entity. $product = new Product(); $product->setTitle($data['title']); - $product->setCategoryId(2); // todo : get it from data + $product->setPrice($data['price']); + + +// $product->setCategoryId($data['category_id']); + + + $category = $this->entityManager->getRepository(Category::class) + ->findOneById($data['category_id']); + + + $product->setCategory($category); +// echo '
';
+//        var_dump($product);
+//        echo '
'; // $product->setContent($data['content']); // $product->setStatus($data['status']); $currentDate = date('Y-m-d H:i:s'); $product->setDateCreated($currentDate); - // Add the entity to entity manager. $this->entityManager->persist($product); - // Add tags to product - $this->addTagsToProduct($data['tags'], $product); + // Apply changes to database. + $this->entityManager->flush(); + + } + + + + + // This method allows to update data of a single post. + public function updateProduct($product, $data) + { + $product->setTitle($data['title']); + $product->setPrice($data['price']); + + + $product->setCategoryId($data['category_id']); + + // Apply changes to database. $this->entityManager->flush(); } + + + // Removes post and all associated comments. + public function removeProduct($post) + { + $this->entityManager->remove($post); + $this->entityManager->flush(); + } + + + } \ No newline at end of file From 8ddccf2e17b6ba5c765c8a1f5843bdf5864b9eb1 Mon Sep 17 00:00:00 2001 From: moataz Date: Sun, 22 Jul 2018 17:02:02 +0200 Subject: [PATCH 6/7] Fix warning --- .db/.gitkeep | 0 .gitignore | 2 + Dockerfile | 0 README.md | 0 composer.json | 9 +- composer.lock | 696 ++++++++++++++++-- config/application.config.php | 0 config/autoload/.gitignore | 0 config/autoload/README.md | 0 config/autoload/docker.php | 0 config/autoload/doctrine.docker.php | 2 +- config/autoload/doctrine.global.php | 8 +- config/autoload/global.php | 0 .../autoload/zend-developer-tools.docker.php | 0 config/modules.config.php | 4 +- .../Proxy/__CG__CategoryEntityCategory.php | 4 +- data/cache/.gitkeep | 0 docker-compose.yml | 0 docker-init.sh | 1 + module/Application/config/module.config.php | 24 +- module/Application/view/error/404.phtml | 108 +-- module/Application/view/error/index.phtml | 81 +- module/Application/view/layout/layout.phtml | 93 ++- module/Category/config/module.config.php | 26 +- .../src/Controller/CategoryController.php | 40 +- ...tory.php => CategoryControllerFactory.php} | 14 +- .../src/Controller/IndexController.php | 72 -- module/Category/src/Entity/Category.php | 59 +- module/Category/src/Form/CategoryForm.php | 87 +++ .../Category/src/Service/CategoryManager.php | 54 ++ .../Category/src/Service/CategoryService.php | 11 - .../Factory/CategorytManagerFactory.php | 21 + .../test/Controller/IndexControllerTest.php | 4 +- module/Category/view/add.phtml | 34 + module/Category/view/category/index/add.phtml | 1 - .../Category/view/category/index/delete.phtml | 1 - .../Category/view/category/index/edit.phtml | 1 - module/Category/view/edit.phtml | 7 +- module/Category/view/index.phtml | 27 +- module/Product/config/module.config.php | 18 +- .../Factory/ProductControllerFactory.php | 10 +- .../src/Controller/ProductController.php | 50 +- module/Product/src/Entity/Product.php | 50 +- .../Form/{PostForm.php => ProductForm.php} | 122 ++- .../Service/Factory/ProductManagerFactory.php | 6 +- module/Product/src/Service/ProductManager.php | 20 +- module/Product/src/Service/ProductService.php | 11 - module/Product/view/add.phtml | 58 ++ module/Product/view/edit.phtml | 60 ++ module/Product/view/index.phtml | 50 ++ module/Product/view/product/index/add.phtml | 63 -- .../Product/view/product/index/delete.phtml | 1 - module/Product/view/product/index/edit.phtml | 1 - module/Product/view/product/index/index.phtml | 26 - phpcs.xml | 0 phpunit.xml.dist | 0 public/.htaccess | 0 public/css/bootstrap-theme.css | 0 public/css/bootstrap-theme.css.map | 0 public/css/bootstrap-theme.min.css | 0 public/css/bootstrap-theme.min.css.map | 0 public/css/bootstrap.css | 0 public/css/bootstrap.css.map | 0 public/css/bootstrap.min.css | 0 public/css/bootstrap.min.css.map | 0 public/css/style.css | 10 + public/fonts/glyphicons-halflings-regular.eot | Bin public/fonts/glyphicons-halflings-regular.svg | 0 public/fonts/glyphicons-halflings-regular.ttf | Bin .../fonts/glyphicons-halflings-regular.woff | Bin .../fonts/glyphicons-halflings-regular.woff2 | Bin public/index.php | 0 public/js/bootstrap.js | 0 public/js/bootstrap.min.js | 0 public/js/jquery-3.1.0.min.js | 0 public/web.config | 0 76 files changed, 1364 insertions(+), 683 deletions(-) mode change 100755 => 100644 .db/.gitkeep mode change 100755 => 100644 .gitignore mode change 100755 => 100644 Dockerfile mode change 100755 => 100644 README.md mode change 100755 => 100644 composer.json mode change 100755 => 100644 composer.lock mode change 100755 => 100644 config/application.config.php mode change 100755 => 100644 config/autoload/.gitignore mode change 100755 => 100644 config/autoload/README.md mode change 100755 => 100644 config/autoload/docker.php mode change 100755 => 100644 config/autoload/global.php mode change 100755 => 100644 config/autoload/zend-developer-tools.docker.php mode change 100755 => 100644 config/modules.config.php mode change 100755 => 100644 data/cache/.gitkeep mode change 100755 => 100644 docker-compose.yml rename module/Category/src/Controller/Factory/{IndexControllerFactory.php => CategoryControllerFactory.php} (63%) delete mode 100755 module/Category/src/Controller/IndexController.php create mode 100644 module/Category/src/Form/CategoryForm.php create mode 100644 module/Category/src/Service/CategoryManager.php delete mode 100755 module/Category/src/Service/CategoryService.php create mode 100644 module/Category/src/Service/Factory/CategorytManagerFactory.php create mode 100755 module/Category/view/add.phtml delete mode 100755 module/Category/view/category/index/add.phtml delete mode 100755 module/Category/view/category/index/delete.phtml delete mode 100755 module/Category/view/category/index/edit.phtml rename module/Product/src/Form/{PostForm.php => ProductForm.php} (53%) delete mode 100755 module/Product/src/Service/ProductService.php create mode 100755 module/Product/view/add.phtml create mode 100755 module/Product/view/edit.phtml create mode 100755 module/Product/view/index.phtml delete mode 100755 module/Product/view/product/index/add.phtml delete mode 100755 module/Product/view/product/index/delete.phtml delete mode 100755 module/Product/view/product/index/edit.phtml delete mode 100755 module/Product/view/product/index/index.phtml mode change 100755 => 100644 phpcs.xml mode change 100755 => 100644 phpunit.xml.dist mode change 100755 => 100644 public/.htaccess mode change 100755 => 100644 public/css/bootstrap-theme.css mode change 100755 => 100644 public/css/bootstrap-theme.css.map mode change 100755 => 100644 public/css/bootstrap-theme.min.css mode change 100755 => 100644 public/css/bootstrap-theme.min.css.map mode change 100755 => 100644 public/css/bootstrap.css mode change 100755 => 100644 public/css/bootstrap.css.map mode change 100755 => 100644 public/css/bootstrap.min.css mode change 100755 => 100644 public/css/bootstrap.min.css.map mode change 100755 => 100644 public/css/style.css mode change 100755 => 100644 public/fonts/glyphicons-halflings-regular.eot mode change 100755 => 100644 public/fonts/glyphicons-halflings-regular.svg mode change 100755 => 100644 public/fonts/glyphicons-halflings-regular.ttf mode change 100755 => 100644 public/fonts/glyphicons-halflings-regular.woff mode change 100755 => 100644 public/fonts/glyphicons-halflings-regular.woff2 mode change 100755 => 100644 public/index.php mode change 100755 => 100644 public/js/bootstrap.js mode change 100755 => 100644 public/js/bootstrap.min.js mode change 100755 => 100644 public/js/jquery-3.1.0.min.js mode change 100755 => 100644 public/web.config diff --git a/.db/.gitkeep b/.db/.gitkeep old mode 100755 new mode 100644 diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 index 03a206f..c515c86 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ vendor/ data/cache/* !data/cache/.gitkeep phpunit.xml +.idea/ +.db/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/composer.json b/composer.json old mode 100755 new mode 100644 index a765726..c89bc17 --- a/composer.json +++ b/composer.json @@ -7,19 +7,22 @@ "php": "^7.0", "zendframework/zend-component-installer": "^1.0", "zendframework/zend-mvc": "^3.0.1", - "doctrine/doctrine-orm-module": "^1.1" + "doctrine/doctrine-orm-module": "^1.1", + "zendframework/zftool": "dev-master" }, "autoload": { "psr-4": { "Application\\": "module/Application/src/", - "Example\\": "module/Example/src/" + "Product\\": "module/Product/src/", + "Category\\": "module/Category/src/" } }, "autoload-dev": { "psr-4": { "ApplicationTest\\": "module/Application/test/", - "ExampleTest\\": "module/Example/test/" + "ProductTest\\": "module/Product/test/", + "CategoryTest\\": "module/Category/test/" } }, "extra": [], diff --git a/composer.lock b/composer.lock old mode 100755 new mode 100644 index 3c3a4c4..67d053b --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9afb8e7da01e97a122ac373498bdef79", + "content-hash": "c6e83ee054c0cc82cb383263d1943dae", "packages": [ { "name": "container-interop/container-interop", @@ -1336,6 +1336,59 @@ ], "time": "2018-05-01T21:58:00+00:00" }, + { + "name": "zendframework/zend-code", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-code.git", + "reference": "2899c17f83a7207f2d7f53ec2f421204d3beea27" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-code/zipball/2899c17f83a7207f2d7f53ec2f421204d3beea27", + "reference": "2899c17f83a7207f2d7f53ec2f421204d3beea27", + "shasum": "" + }, + "require": { + "php": "^5.6 || 7.0.0 - 7.0.4 || ^7.0.6", + "zendframework/zend-eventmanager": "^2.6 || ^3.0" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "ext-phar": "*", + "phpunit/phpunit": "^4.8.21", + "squizlabs/php_codesniffer": "^2.5", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "suggest": { + "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", + "zendframework/zend-stdlib": "Zend\\Stdlib component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev", + "dev-develop": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Code\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides facilities to generate arbitrary code using an object oriented interface", + "homepage": "https://github.com/zendframework/zend-code", + "keywords": [ + "code", + "zf2" + ], + "time": "2016-10-24T13:23:32+00:00" + }, { "name": "zendframework/zend-component-installer", "version": "1.1.1", @@ -1448,6 +1501,59 @@ ], "time": "2018-04-24T19:26:44+00:00" }, + { + "name": "zendframework/zend-console", + "version": "2.7.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-console.git", + "reference": "e8aa08da83de3d265256c40ba45cd649115f0e18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-console/zipball/e8aa08da83de3d265256c40ba45cd649115f0e18", + "reference": "e8aa08da83de3d265256c40ba45cd649115f0e18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-filter": "^2.7.2", + "zendframework/zend-json": "^2.6 || ^3.0", + "zendframework/zend-validator": "^2.10.1" + }, + "suggest": { + "zendframework/zend-filter": "To support DefaultRouteMatcher usage", + "zendframework/zend-validator": "To support DefaultRouteMatcher usage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7.x-dev", + "dev-develop": "2.8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Console\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Build console applications using getopt syntax or routing, complete with prompts", + "keywords": [ + "ZendFramework", + "console", + "zf" + ], + "time": "2018-01-25T19:08:04+00:00" + }, { "name": "zendframework/zend-escaper", "version": "2.6.0", @@ -1547,6 +1653,63 @@ ], "time": "2018-04-25T15:33:34+00:00" }, + { + "name": "zendframework/zend-file", + "version": "2.8.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-file.git", + "reference": "4b2ecb77a9123a03cc648893b63e38b3735f192c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-file/zipball/4b2ecb77a9123a03cc648893b63e38b3735f192c", + "reference": "4b2ecb77a9123a03cc648893b63e38b3735f192c", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-filter": "^2.7.2", + "zendframework/zend-i18n": "^2.7.4", + "zendframework/zend-progressbar": "^2.5.2", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.3", + "zendframework/zend-session": "^2.8", + "zendframework/zend-validator": "^2.10.1" + }, + "suggest": { + "zendframework/zend-filter": "Zend\\Filter component", + "zendframework/zend-i18n": "Zend\\I18n component", + "zendframework/zend-validator": "Zend\\Validator component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8.x-dev", + "dev-develop": "2.9.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\File\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Locate PHP classfiles", + "keywords": [ + "ZendFramework", + "file", + "zf" + ], + "time": "2018-05-01T22:03:07+00:00" + }, { "name": "zendframework/zend-filter", "version": "2.8.0", @@ -1806,6 +1969,74 @@ ], "time": "2018-04-30T21:22:14+00:00" }, + { + "name": "zendframework/zend-i18n", + "version": "2.9.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-i18n.git", + "reference": "6d69af5a04e1a4de7250043cb1322f077a0cdb7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/6d69af5a04e1a4de7250043cb1322f077a0cdb7f", + "reference": "6d69af5a04e1a4de7250043cb1322f077a0cdb7f", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-cache": "^2.6.1", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-config": "^2.6", + "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", + "zendframework/zend-filter": "^2.6.1", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-validator": "^2.6", + "zendframework/zend-view": "^2.6.3" + }, + "suggest": { + "ext-intl": "Required for most features of Zend\\I18n; included in default builds of PHP", + "zendframework/zend-cache": "Zend\\Cache component", + "zendframework/zend-config": "Zend\\Config component", + "zendframework/zend-eventmanager": "You should install this package to use the events in the translator", + "zendframework/zend-filter": "You should install this package to use the provided filters", + "zendframework/zend-i18n-resources": "Translation resources", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component", + "zendframework/zend-validator": "You should install this package to use the provided validators", + "zendframework/zend-view": "You should install this package to use the provided view helpers" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.9.x-dev", + "dev-develop": "2.10.x-dev" + }, + "zf": { + "component": "Zend\\I18n", + "config-provider": "Zend\\I18n\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\I18n\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Provide translations for your application, and filter and validate internationalized values", + "keywords": [ + "ZendFramework", + "i18n", + "zf" + ], + "time": "2018-05-16T16:39:13+00:00" + }, { "name": "zendframework/zend-inputfilter", "version": "2.8.2", @@ -1859,6 +2090,61 @@ ], "time": "2018-05-14T17:38:03+00:00" }, + { + "name": "zendframework/zend-json", + "version": "2.6.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-json.git", + "reference": "4c8705dbe4ad7d7e51b2876c5b9eea0ef916ba28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-json/zipball/4c8705dbe4ad7d7e51b2876c5b9eea0ef916ba28", + "reference": "4c8705dbe4ad7d7e51b2876c5b9eea0ef916ba28", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-http": "^2.5.4", + "zendframework/zend-server": "^2.6.1", + "zendframework/zend-stdlib": "^2.5 || ^3.0", + "zendframework/zendxml": "^1.0.2" + }, + "suggest": { + "zendframework/zend-http": "Zend\\Http component, required to use Zend\\Json\\Server", + "zendframework/zend-server": "Zend\\Server component, required to use Zend\\Json\\Server", + "zendframework/zend-stdlib": "Zend\\Stdlib component, for use with caching Zend\\Json\\Server responses", + "zendframework/zendxml": "To support Zend\\Json\\Json::fromXml() usage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev", + "dev-develop": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Json\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP", + "homepage": "https://github.com/zendframework/zend-json", + "keywords": [ + "json", + "zf2" + ], + "time": "2016-02-04T21:20:26+00:00" + }, { "name": "zendframework/zend-loader", "version": "2.6.0", @@ -1904,6 +2190,77 @@ ], "time": "2018-04-30T15:20:54+00:00" }, + { + "name": "zendframework/zend-log", + "version": "2.10.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-log.git", + "reference": "9cec3b092acb39963659c2f32441cccc56b3f430" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-log/zipball/9cec3b092acb39963659c2f32441cccc56b3f430", + "reference": "9cec3b092acb39963659c2f32441cccc56b3f430", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "psr/log": "^1.0", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^5.7.15 || ^6.0.8", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-db": "^2.6", + "zendframework/zend-escaper": "^2.5", + "zendframework/zend-filter": "^2.5", + "zendframework/zend-mail": "^2.6.1", + "zendframework/zend-validator": "^2.10.1" + }, + "suggest": { + "ext-mongo": "mongo extension to use Mongo writer", + "ext-mongodb": "mongodb extension to use MongoDB writer", + "zendframework/zend-console": "Zend\\Console component to use the RequestID log processor", + "zendframework/zend-db": "Zend\\Db component to use the database log writer", + "zendframework/zend-escaper": "Zend\\Escaper component, for use in the XML log formatter", + "zendframework/zend-mail": "Zend\\Mail component to use the email log writer", + "zendframework/zend-validator": "Zend\\Validator component to block invalid log messages" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.10.x-dev", + "dev-develop": "2.11.x-dev" + }, + "zf": { + "component": "Zend\\Log", + "config-provider": "Zend\\Log\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Log\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "component for general purpose logging", + "homepage": "https://github.com/zendframework/zend-log", + "keywords": [ + "log", + "logging", + "zf2" + ], + "time": "2018-04-09T21:59:51+00:00" + }, { "name": "zendframework/zend-modulemanager", "version": "2.8.2", @@ -2163,6 +2520,63 @@ ], "time": "2018-06-18T21:10:59+00:00" }, + { + "name": "zendframework/zend-serializer", + "version": "2.9.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-serializer.git", + "reference": "0172690db48d8935edaf625c4cba38b79719892c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-serializer/zipball/0172690db48d8935edaf625c4cba38b79719892c", + "reference": "0172690db48d8935edaf625c4cba38b79719892c", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-json": "^2.5 || ^3.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.25 || ^6.4.4", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-math": "^2.6 || ^3.0", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" + }, + "suggest": { + "zendframework/zend-math": "(^2.6 || ^3.0) To support Python Pickle serialization", + "zendframework/zend-servicemanager": "(^2.7.5 || ^3.0.3) To support plugin manager support" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.9.x-dev", + "dev-develop": "2.10.x-dev" + }, + "zf": { + "component": "Zend\\Serializer", + "config-provider": "Zend\\Serializer\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Serializer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides an adapter based interface to simply generate storable representation of PHP types by different facilities, and recover", + "keywords": [ + "ZendFramework", + "serializer", + "zf" + ], + "time": "2018-05-14T18:45:18+00:00" + }, { "name": "zendframework/zend-servicemanager", "version": "3.3.2", @@ -2277,6 +2691,54 @@ ], "time": "2018-04-30T13:50:40+00:00" }, + { + "name": "zendframework/zend-text", + "version": "2.7.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-text.git", + "reference": "ca987dd4594f5f9508771fccd82c89bc7fbb39ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-text/zipball/ca987dd4594f5f9508771fccd82c89bc7fbb39ac", + "reference": "ca987dd4594f5f9508771fccd82c89bc7fbb39ac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.4", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-config": "^2.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7.x-dev", + "dev-develop": "2.8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Text\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Create FIGlets and text-based tables", + "keywords": [ + "ZendFramework", + "text", + "zf" + ], + "time": "2018-04-30T14:55:10+00:00" + }, { "name": "zendframework/zend-uri", "version": "2.6.1", @@ -2395,6 +2857,57 @@ ], "time": "2018-02-01T17:05:33+00:00" }, + { + "name": "zendframework/zend-version", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-version.git", + "reference": "e30c55dc394eaf396f0347887af0a7bef471fe08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-version/zipball/e30c55dc394eaf396f0347887af0a7bef471fe08", + "reference": "e30c55dc394eaf396f0347887af0a7bef471fe08", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-json": "~2.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-http": "~2.5" + }, + "suggest": { + "zendframework/zend-http": "Allows use of Zend\\Http\\Client to check version information", + "zendframework/zend-json": "To check latest version hosted in GitHub" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Version\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-version", + "keywords": [ + "version", + "zf2" + ], + "abandoned": "ocramius/package-versions", + "time": "2015-06-04T15:41:05+00:00" + }, { "name": "zendframework/zend-view", "version": "2.10.0", @@ -2481,6 +2994,130 @@ "zf2" ], "time": "2018-01-17T22:21:50+00:00" + }, + { + "name": "zendframework/zenddiagnostics", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-diagnostics.git", + "reference": "bb03241c503fdf4d6d420e06653a8b65a10b239d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-diagnostics/zipball/bb03241c503fdf4d6d420e06653a8b65a10b239d", + "reference": "bb03241c503fdf4d6d420e06653a8b65a10b239d", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/migrations": "^1.0", + "guzzlehttp/guzzle": "^5.3.2 || ^6.3.3", + "mikey179/vfsstream": "^1.6", + "php-amqplib/php-amqplib": "^2.0", + "phpunit/phpunit": "^5.7.27 || 6.5.8 || ^7.1.2", + "predis/predis": "^1.0", + "sensiolabs/security-checker": "^1.3", + "symfony/yaml": "^2.7 || ^3.0 || ^4.0", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-loader": "^2.0" + }, + "suggest": { + "doctrine/migrations": "Required by Check\\DoctrineMigration", + "ext-bcmath": "Required by Check\\CpuPerformance", + "guzzlehttp/guzzle": "Required by Check\\GuzzleHttpService", + "predis/predis": "Required by Check\\Redis", + "sensiolabs/security-checker": "Required by Check\\SecurityAdvisory", + "symfony/yaml": "Required by Check\\YamlFile", + "videlalvaro/php-amqplib": "Required by Check\\RabbitMQ" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "ZendDiagnostics\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "A set of components for performing diagnostic tests in PHP applications", + "homepage": "https://github.com/zendframework/zend-diagnostics", + "keywords": [ + "ZendFramework", + "diagnostics", + "php", + "test", + "zf" + ], + "time": "2018-06-25T22:03:27+00:00" + }, + { + "name": "zendframework/zftool", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/zendframework/ZFTool.git", + "reference": "840c3eecd58454396983d84d1da293813af484af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/ZFTool/zipball/840c3eecd58454396983d84d1da293813af484af", + "reference": "840c3eecd58454396983d84d1da293813af484af", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-code": ">=2.2.2", + "zendframework/zend-config": ">=2.2.2", + "zendframework/zend-console": ">=2.2.2", + "zendframework/zend-file": ">=2.2.2", + "zendframework/zend-form": ">=2.2.2", + "zendframework/zend-http": ">=2.2.2", + "zendframework/zend-i18n": ">=2.2.2", + "zendframework/zend-loader": ">=2.2.2", + "zendframework/zend-log": ">=2.2.2", + "zendframework/zend-modulemanager": ">=2.2.2", + "zendframework/zend-mvc": ">=2.2.2", + "zendframework/zend-serializer": ">=2.2.2", + "zendframework/zend-servicemanager": ">=2.2.2", + "zendframework/zend-stdlib": ">=2.2.2", + "zendframework/zend-text": ">=2.2.2", + "zendframework/zend-version": ">=2.2.2 ", + "zendframework/zend-view": ">=2.2.2", + "zendframework/zenddiagnostics": ">=1.0.0" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "4.*" + }, + "bin": [ + "zf.php" + ], + "type": "library", + "autoload": { + "psr-0": { + "ZFTool\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Utility module for Zend Framework 2 applications.", + "homepage": "http://framework.zend.com/", + "keywords": [ + "tool", + "zf2" + ], + "time": "2015-10-21T07:40:59+00:00" } ], "packages-dev": [ @@ -3938,59 +4575,6 @@ ], "time": "2018-01-29T19:49:41+00:00" }, - { - "name": "zendframework/zend-console", - "version": "2.7.0", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-console.git", - "reference": "e8aa08da83de3d265256c40ba45cd649115f0e18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-console/zipball/e8aa08da83de3d265256c40ba45cd649115f0e18", - "reference": "e8aa08da83de3d265256c40ba45cd649115f0e18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0", - "zendframework/zend-stdlib": "^2.7.7 || ^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3", - "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-filter": "^2.7.2", - "zendframework/zend-json": "^2.6 || ^3.0", - "zendframework/zend-validator": "^2.10.1" - }, - "suggest": { - "zendframework/zend-filter": "To support DefaultRouteMatcher usage", - "zendframework/zend-validator": "To support DefaultRouteMatcher usage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7.x-dev", - "dev-develop": "2.8.x-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Console\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Build console applications using getopt syntax or routing, complete with prompts", - "keywords": [ - "ZendFramework", - "console", - "zf" - ], - "time": "2018-01-25T19:08:04+00:00" - }, { "name": "zendframework/zend-dom", "version": "2.7.1", @@ -4110,7 +4694,9 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": { + "zendframework/zftool": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": { diff --git a/config/application.config.php b/config/application.config.php old mode 100755 new mode 100644 diff --git a/config/autoload/.gitignore b/config/autoload/.gitignore old mode 100755 new mode 100644 diff --git a/config/autoload/README.md b/config/autoload/README.md old mode 100755 new mode 100644 diff --git a/config/autoload/docker.php b/config/autoload/docker.php old mode 100755 new mode 100644 diff --git a/config/autoload/doctrine.docker.php b/config/autoload/doctrine.docker.php index 4711fe0..bb911e6 100644 --- a/config/autoload/doctrine.docker.php +++ b/config/autoload/doctrine.docker.php @@ -15,4 +15,4 @@ ], ], ], -]; \ No newline at end of file +]; diff --git a/config/autoload/doctrine.global.php b/config/autoload/doctrine.global.php index 8c7d346..5af9cef 100644 --- a/config/autoload/doctrine.global.php +++ b/config/autoload/doctrine.global.php @@ -10,7 +10,9 @@ 'class' => \Doctrine\ORM\Mapping\Driver\AnnotationDriver::class, 'cache' => 'array', 'paths' => [ - realpath(__DIR__ . '/../../module/Application/src/Entity'), +// realpath(__DIR__ . '/../../module/Application/src/Entity'), + realpath(__DIR__ . '/../../module/Product/src/Entity'), + realpath(__DIR__ . '/../../module/Category/src/Entity'), ], ], // default metadata driver, aggregates all other drivers into a single one. @@ -19,8 +21,10 @@ 'drivers' => [ // register `annotation_driver` for any entity under namespace `Application\Entity` 'Application\Entity' => 'annotation_driver', + 'Product\Entity' => 'annotation_driver', + 'Category\Entity' => 'annotation_driver', ], ], ], ], -]; \ No newline at end of file +]; diff --git a/config/autoload/global.php b/config/autoload/global.php old mode 100755 new mode 100644 diff --git a/config/autoload/zend-developer-tools.docker.php b/config/autoload/zend-developer-tools.docker.php old mode 100755 new mode 100644 diff --git a/config/modules.config.php b/config/modules.config.php old mode 100755 new mode 100644 index b0887cd..ed1c1d1 --- a/config/modules.config.php +++ b/config/modules.config.php @@ -16,6 +16,8 @@ 'Zend\Validator', 'DoctrineModule', 'DoctrineORMModule', +// 'ZFTool', 'Application', - 'Example' + 'Product', + 'Category', ]; diff --git a/data/DoctrineORMModule/Proxy/__CG__CategoryEntityCategory.php b/data/DoctrineORMModule/Proxy/__CG__CategoryEntityCategory.php index 2725044..d262e25 100644 --- a/data/DoctrineORMModule/Proxy/__CG__CategoryEntityCategory.php +++ b/data/DoctrineORMModule/Proxy/__CG__CategoryEntityCategory.php @@ -64,10 +64,10 @@ public function __construct($initializer = null, $cloner = null) public function __sleep() { if ($this->__isInitialized__) { - return ['__isInitialized__', '' . "\0" . 'Category\\Entity\\Category' . "\0" . 'id', '' . "\0" . 'Category\\Entity\\Category' . "\0" . 'title', 'dateCreated']; + return ['__isInitialized__', 'dateCreated', '' . "\0" . 'Category\\Entity\\Category' . "\0" . 'id', '' . "\0" . 'Category\\Entity\\Category' . "\0" . 'title']; } - return ['__isInitialized__', '' . "\0" . 'Category\\Entity\\Category' . "\0" . 'id', '' . "\0" . 'Category\\Entity\\Category' . "\0" . 'title', 'dateCreated']; + return ['__isInitialized__', 'dateCreated', '' . "\0" . 'Category\\Entity\\Category' . "\0" . 'id', '' . "\0" . 'Category\\Entity\\Category' . "\0" . 'title']; } /** diff --git a/data/cache/.gitkeep b/data/cache/.gitkeep old mode 100755 new mode 100644 diff --git a/docker-compose.yml b/docker-compose.yml old mode 100755 new mode 100644 diff --git a/docker-init.sh b/docker-init.sh index 59cf7db..9f87d88 100644 --- a/docker-init.sh +++ b/docker-init.sh @@ -1,3 +1,4 @@ #!/bin/bash vendor/bin/doctrine-module orm:schema-tool:update --force +#vendor/bin/doctrine-module orm:schema:drop --full-database --force diff --git a/module/Application/config/module.config.php b/module/Application/config/module.config.php index 7bb6a67..d47ffdc 100755 --- a/module/Application/config/module.config.php +++ b/module/Application/config/module.config.php @@ -12,20 +12,20 @@ 'home' => [ 'type' => Literal::class, 'options' => [ - 'route' => '/', + 'route' => '/', 'defaults' => [ 'controller' => Controller\IndexController::class, - 'action' => 'index', + 'action' => 'index', ], ], ], 'application' => [ - 'type' => Segment::class, + 'type' => Segment::class, 'options' => [ - 'route' => '/application[/:action]', + 'route' => '/application[/:action]', 'defaults' => [ 'controller' => Controller\IndexController::class, - 'action' => 'index', + 'action' => 'index', ], ], ], @@ -38,15 +38,15 @@ ], 'view_manager' => [ 'display_not_found_reason' => true, - 'display_exceptions' => true, - 'doctype' => 'HTML5', - 'not_found_template' => 'error/404', - 'exception_template' => 'error/index', + 'display_exceptions' => true, + 'doctype' => 'HTML5', + 'not_found_template' => 'error/404', + 'exception_template' => 'error/index', 'template_map' => [ - 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', + 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', 'application/index/index' => __DIR__ . '/../view/application/index/index.phtml', - 'error/404' => __DIR__ . '/../view/error/404.phtml', - 'error/index' => __DIR__ . '/../view/error/index.phtml', + 'error/404' => __DIR__ . '/../view/error/404.phtml', + 'error/index' => __DIR__ . '/../view/error/index.phtml', ], 'template_path_stack' => [ __DIR__ . '/../view', diff --git a/module/Application/view/error/404.phtml b/module/Application/view/error/404.phtml index 1b4ebca..135701f 100755 --- a/module/Application/view/error/404.phtml +++ b/module/Application/view/error/404.phtml @@ -1,5 +1,7 @@

A 404 error occurred

message ?>

@@ -26,80 +28,80 @@ use Zend\Mvc\Application; break; } ?> -

+

controller)) : ?> -
-
Controller:
-
- escapeHtml($this->controller) ?> - controller_class) && $this->controller_class != $this->controller) { - printf('(resolves to %s)', $this->escapeHtml($this->controller_class)); - } - ?> -
-
+
+
Controller:
+
+ escapeHtml($this->controller) ?> + controller_class) && $this->controller_class != $this->controller) { + printf('(resolves to %s)', $this->escapeHtml($this->controller_class)); + } + ?> +
+
display_exceptions)) : ?> exception) && ($this->exception instanceof \Exception || $this->exception instanceof \Error)) : ?> -
- -

Additional information:

-

exception) ?>

-
-
File:
-
-
exception->getFile() ?>:exception->getLine() ?>
-
-
Message:
-
-
escapeHtml($this->exception->getMessage()) ?>
-
-
Stack trace:
-
-
escapeHtml($this->exception->getTraceAsString()) ?>
-
-
- - exception->getPrevious()) : ?> -
+
-

Previous exceptions:

-
    - - -
  • -

    +

    Additional information:

    +

    exception) ?>

    File:
    -
    getFile() ?>:getLine() ?>
    +
    exception->getFile() ?>:exception->getLine() ?>
    Message:
    -
    escapeHtml($ex->getMessage()) ?>
    +
    escapeHtml($this->exception->getMessage()) ?>
    Stack trace:
    -
    escapeHtml($ex->getTraceAsString()) ?>
    +
    escapeHtml($this->exception->getTraceAsString()) ?>
    -
  • - getPrevious(); - if (++$icount >= 50) { - echo '
  • There may be more exceptions, but we do not have enough memory to process it.
  • '; - break; - } - ?> - -
+ + exception->getPrevious()) : ?> +
+ +

Previous exceptions:

+
    + + +
  • +

    +
    +
    File:
    +
    +
    getFile() ?>:getLine() ?>
    +
    +
    Message:
    +
    +
    escapeHtml($ex->getMessage()) ?>
    +
    +
    Stack trace:
    +
    +
    escapeHtml($ex->getTraceAsString()) ?>
    +
    +
    +
  • + getPrevious(); + if (++$icount >= 50) { + echo '
  • There may be more exceptions, but we do not have enough memory to process it.
  • '; + break; + } + ?> + +
-

No Exception available

+

No Exception available

diff --git a/module/Application/view/error/index.phtml b/module/Application/view/error/index.phtml index 1b28a21..ae8f8eb 100755 --- a/module/Application/view/error/index.phtml +++ b/module/Application/view/error/index.phtml @@ -4,60 +4,61 @@ display_exceptions)) : ?> exception) && ($this->exception instanceof \Exception || $this->exception instanceof \Error)) : ?> -
+
-

Additional information:

-

exception) ?>

-
-
File:
-
-
exception->getFile() ?>:exception->getLine() ?>
-
-
Message:
-
-
escapeHtml($this->exception->getMessage()) ?>
-
-
Stack trace:
-
-
escapeHtml($this->exception->getTraceAsString()) ?>
-
-
- - exception->getPrevious()) : ?> -
- -

Previous exceptions:

-
    - - -
  • -

    +

    Additional information:

    +

    exception) ?>

    File:
    -
    getFile() ?>:getLine() ?>
    +
    exception->getFile() ?>:exception->getLine() ?>
    Message:
    -
    escapeHtml($ex->getMessage()) ?>
    +
    escapeHtml($this->exception->getMessage()) ?>
    Stack trace:
    -
    escapeHtml($ex->getTraceAsString()) ?>
    +
    escapeHtml($this->exception->getTraceAsString()) ?>
    -
  • - getPrevious(); - if (++$icount >= 50) { - echo '
  • There may be more exceptions, but we do not have enough memory to process it.
  • '; - break; - } - ?> - -
+ + exception->getPrevious()) : ?> +
+ +

Previous exceptions:

+
    + + +
  • +

    +
    +
    File:
    +
    +
    getFile() ?>:getLine() ?>
    +
    +
    Message:
    +
    +
    escapeHtml($ex->getMessage()) ?>
    +
    +
    Stack trace:
    +
    +
    escapeHtml($ex->getTraceAsString()) ?>
    +
    +
    +
  • + getPrevious(); + if (++$icount >= 50) { + echo '
  • There may be more exceptions, but we do not have enough memory to process it.
  • '; + break; + } + ?> + +

No Exception available

+ diff --git a/module/Application/view/layout/layout.phtml b/module/Application/view/layout/layout.phtml index ae5be7f..8ced262 100755 --- a/module/Application/view/layout/layout.phtml +++ b/module/Application/view/layout/layout.phtml @@ -1,54 +1,53 @@ doctype() ?> - - - headTitle('Application')->setSeparator(' - ')->setAutoEscape(false) ?> + + + headTitle('Application')->setSeparator(' - ')->setAutoEscape(false) ?> - headMeta() - ->appendName('viewport', 'width=device-width, initial-scale=1.0') - ->appendHttpEquiv('X-UA-Compatible', 'IE=edge') - ?> + headMeta() + ->appendName('viewport', 'width=device-width, initial-scale=1.0') + ->appendHttpEquiv('X-UA-Compatible', 'IE=edge') + ?> - - headLink(['rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->basePath() . '/img/favicon.ico']) - ->prependStylesheet($this->basePath('css/style.css')) - ->prependStylesheet($this->basePath('css/bootstrap-theme.min.css')) - ->prependStylesheet($this->basePath('css/bootstrap.min.css')) - ?> + headLink([ + 'rel' => 'shortcut icon', + 'type' => 'image/vnd.microsoft.icon', + 'href' => $this->basePath() . '/img/favicon.ico' + ])->prependStylesheet($this->basePath('css/style.css')) + ->prependStylesheet($this->basePath('css/bootstrap-theme.min.css')) + ->prependStylesheet($this->basePath('css/bootstrap.min.css')) + ?> - - headScript() - ->prependFile($this->basePath('js/bootstrap.min.js')) - ->prependFile($this->basePath('js/jquery-3.1.0.min.js')) - ?> - - - -
- content ?> + headScript() + ->prependFile($this->basePath('js/bootstrap.min.js')) + ->prependFile($this->basePath('js/jquery-3.1.0.min.js')) + ?> + + + +
+ content ?> +
+inlineScript() ?> + diff --git a/module/Category/config/module.config.php b/module/Category/config/module.config.php index 14dd0bb..ca62a77 100755 --- a/module/Category/config/module.config.php +++ b/module/Category/config/module.config.php @@ -2,24 +2,22 @@ namespace Category; -use Zend\Router\Http\Literal; use Zend\Router\Http\Segment; -use Zend\ServiceManager\Factory\InvokableFactory; return [ 'router' => [ 'routes' => [ 'category' => [ - 'type' => Segment::class, + 'type' => Segment::class, 'options' => [ 'route' => '/category[/:action[/:id]]', 'constraints' => [ 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', - 'id' => '[0-9]+', + 'id' => '[0-9]+', ], 'defaults' => [ - 'controller' => Controller\IndexController::class, - 'action' => 'index', + 'controller' => Controller\CategoryController::class, + 'action' => 'index', ], ], ], @@ -27,17 +25,27 @@ ], 'controllers' => [ 'factories' => [ - Controller\IndexController::class => Controller\Factory\IndexControllerFactory::class, + Controller\CategoryController::class => Controller\Factory\CategoryControllerFactory::class, ], ], 'service_manager' => [ 'factories' => [ - Service\CategoryService::class => InvokableFactory::class, + Service\CategoryManager::class => Service\Factory\CategorytManagerFactory::class, + ], ], + + 'view_manager' => [ + 'display_not_found_reason' => true, + 'display_exceptions' => true, + 'doctype' => 'HTML5', + 'not_found_template' => 'error/404', + 'exception_template' => 'error/index', 'template_map' => [ - 'category/index/index' => __DIR__ . '/../view/category/index/index.phtml', + 'category/category/index' => __DIR__ . '/../view/index.phtml', + 'category/category/add' => __DIR__ . '/../view/add.phtml', + 'category/category/edit' => __DIR__ . '/../view/edit.phtml', ], 'template_path_stack' => [ __DIR__ . '/../view', diff --git a/module/Category/src/Controller/CategoryController.php b/module/Category/src/Controller/CategoryController.php index 54a1303..db0b370 100755 --- a/module/Category/src/Controller/CategoryController.php +++ b/module/Category/src/Controller/CategoryController.php @@ -4,19 +4,17 @@ use Category\Entity\Category; use Category\Form\CategoryForm; +use Category\Service\CategoryManager; use Doctrine\ORM\EntityManager; -use function PHPSTORM_META\type; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; -use Category\Service\CategoryManager; - class CategoryController extends AbstractActionController { private $categoryManager; private $entityManager; - public function __construct(CategoryManager $categoryManager , EntityManager $entityManager) + public function __construct(CategoryManager $categoryManager, EntityManager $entityManager) { $this->categoryManager = $categoryManager; $this->entityManager = $entityManager; @@ -24,18 +22,13 @@ public function __construct(CategoryManager $categoryManager , EntityManager $en public function indexAction() { - - $categories = $this->entityManager->getRepository(Category::class)->findAll(); $view = new ViewModel(); -// // $view->setTemplate('category/category/index'); $view->categories = $categories; return $view; } - - /** * This action displays the "New Category" page. The page contains * a form allowing to enter category title, content and tags. When @@ -46,17 +39,13 @@ public function addAction() { - // Create the form. $form = new CategoryForm(); // Check whether this category is a POST request. if ($this->getRequest()->isPost()) { - - // Get data. $data = $this->params()->fromPost(); - // Fill form with data. $form->setData($data); if ($form->isValid()) { @@ -71,7 +60,7 @@ public function addAction() // Render the view template. - $view = new ViewModel([ + $view = new ViewModel([ 'form' => $form, ]); @@ -86,15 +75,12 @@ public function editAction() // Create the form. - - $form = new CategoryForm(); // Get Category ID. $category_id = $this->params()->fromRoute('id', -1); - // Find existing product in the database. $category = $this->entityManager->getRepository(Category::class) ->findOneById($category_id); @@ -108,28 +94,19 @@ public function editAction() // Check whether this product is a POST request. if ($this->getRequest()->isPost()) { - // Get POST data. $data = $this->params()->fromPost(); - - - - // Fill form with data. $form->setData($data); if ($form->isValid()) { - - - // Get validated form data. $data = $form->getData(); - // Use product manager service to add new product to database. $this->categoryManager->updateCategory($category, $data); // Redirect the user to "admin" page. - return $this->redirect()->toRoute('category', ['action'=>'index']); + return $this->redirect()->toRoute('category', ['action' => 'index']); } } else { $data = [ @@ -137,20 +114,17 @@ public function editAction() ]; - $form->setData($data); } - - // Render the view template. - $view = new ViewModel([ + $view = new ViewModel([ 'form' => $form, 'category' => $category ]); - return $view ; + return $view; } // This "delete" action displays the Delete Post page. @@ -168,6 +142,6 @@ public function deleteAction() $this->categoryManager->removeCategory($product); // Redirect the user to "index" page. - return $this->redirect()->toRoute('category', ['action'=>'index']); + return $this->redirect()->toRoute('category', ['action' => 'index']); } } diff --git a/module/Category/src/Controller/Factory/IndexControllerFactory.php b/module/Category/src/Controller/Factory/CategoryControllerFactory.php similarity index 63% rename from module/Category/src/Controller/Factory/IndexControllerFactory.php rename to module/Category/src/Controller/Factory/CategoryControllerFactory.php index 22215c1..063367e 100755 --- a/module/Category/src/Controller/Factory/IndexControllerFactory.php +++ b/module/Category/src/Controller/Factory/CategoryControllerFactory.php @@ -2,19 +2,17 @@ namespace Category\Controller\Factory; -use Zend\ServiceManager\Factory\FactoryInterface; +use Category\Controller\CategoryController; use Interop\Container\ContainerInterface; +use Zend\ServiceManager\Factory\FactoryInterface; -use Category\Controller\IndexController; - -class IndexControllerFactory implements FactoryInterface +class CategoryControllerFactory implements FactoryInterface { - public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { - // Get Doctrine entity manager - $categoryService = $container->get('Category\Service\CategoryService'); + $categoryService = $container->get('Category\Service\CategoryManager'); $entityManager = $container->get('doctrine.entitymanager.orm_default'); - return new IndexController($categoryService,$entityManager); + return new CategoryController($categoryService, $entityManager); } } diff --git a/module/Category/src/Controller/IndexController.php b/module/Category/src/Controller/IndexController.php deleted file mode 100755 index c861db4..0000000 --- a/module/Category/src/Controller/IndexController.php +++ /dev/null @@ -1,72 +0,0 @@ -categoryService = $categoryService; - $this->entityManager = $entityManager; - } - - public function indexAction() - { - - - $categories = $this->entityManager->getRepository(Category::class)->findAll(); - $view = new ViewModel(); - $view->categories = $categories; - return $view; - } - - - - public function addAction() - { - - - // Create new Post entity. - $category = new Category(); -// $category = $this->entityManager->getRepository(Category::class); - - $category->setTitle('Category from controller'); -// $category->setContent('Post body goes here'); -// $category->setStatus(Post::STATUS_PUBLISHED); - $currentDate = date('Y-m-d H:i:s'); - $category->setDateCreated($currentDate); - -// Add the entity to entity manager. - $this->entityManager->persist($category); -// Apply changes to database. - $this->entityManager->flush(); - - - $view = new ViewModel(); - return $view; - } - - public function editAction() - { - $view = new ViewModel(); - return $view; - } - - - public function deleteAction() - { - $view = new ViewModel(); - return $view; - } -} diff --git a/module/Category/src/Entity/Category.php b/module/Category/src/Entity/Category.php index 71d402a..d8c189a 100755 --- a/module/Category/src/Entity/Category.php +++ b/module/Category/src/Entity/Category.php @@ -1,6 +1,9 @@ id; } - // Sets ID + /** + * @param $id + */ public function setId($id) { $this->id = $id; @@ -68,41 +74,4 @@ public function setDateCreated($dateCreated) { $this->dateCreated = $dateCreated; } - - - - /* Relations */ - - /** - * @ORM\OneToMany(targetEntity="\Product\Entity\Product", mappedBy="product") - * @ORM\JoinColumn(name="id", referencedColumnName="product_id") - */ - protected $products; - - - /** - * Constructor. - */ - public function __construct() - { -// $this->products = new ArrayCollection(); - } - - /** - * Returns products for this post. - * @return array - */ - public function getProducts() - { - return $this->products; - } - - /** - * Adds a new product to this post. - * @param $product - */ - public function addProduct($product) - { - $this->products[] = $product; - } -} \ No newline at end of file +} diff --git a/module/Category/src/Form/CategoryForm.php b/module/Category/src/Form/CategoryForm.php new file mode 100644 index 0000000..e8d51a6 --- /dev/null +++ b/module/Category/src/Form/CategoryForm.php @@ -0,0 +1,87 @@ +setAttribute('method', 'post'); + $this->addElements(); + $this->addInputFilter(); + } + + /** + * This method adds elements to form (input fields and submit button). + */ + protected function addElements() + { + + // Add "title" field + $this->add([ + 'type' => 'text', + 'name' => 'title', + 'attributes' => [ + 'id' => 'title' + ], + + + 'options' => [ + 'label' => 'Title', + ], + ]); + + + // Add the submit button + $this->add([ + 'type' => 'submit', + 'name' => 'submit', + 'attributes' => [ + 'value' => 'Save', + 'id' => 'submitbutton', + ], + ]); + } + + /** + * This method creates input filter (used for form filtering/validation). + */ + private function addInputFilter() + { + + $inputFilter = new InputFilter(); + $this->setInputFilter($inputFilter); + + $inputFilter->add([ + 'name' => 'title', + 'required' => true, + 'filters' => [ + ['name' => 'StringTrim'], + ['name' => 'StripTags'], + ['name' => 'StripNewlines'], + ], + 'validators' => [ + [ + 'name' => 'StringLength', + 'options' => [ + 'min' => 1, + 'max' => 1024 + ], + ], + ], + ]); + } +} diff --git a/module/Category/src/Service/CategoryManager.php b/module/Category/src/Service/CategoryManager.php new file mode 100644 index 0000000..76471d6 --- /dev/null +++ b/module/Category/src/Service/CategoryManager.php @@ -0,0 +1,54 @@ +entityManager = $entityManager; + } + + // This method adds a new category. + public function addNewCategory($data) + { + + + // Create new Category entity. + $category = new Category(); + $category->setTitle($data['title']); + $currentDate = date('Y-m-d H:i:s'); + $category->setDateCreated($currentDate); + // Add the entity to entity manager. + $this->entityManager->persist($category); + // Apply changes to database. + $this->entityManager->flush(); + } + + + // This method allows to update data of a single post. + public function updateCategory($category, $data) + { + $category->setTitle($data['title']); + // Apply changes to database. + $this->entityManager->flush(); + } + + + // Removes post and all associated comments. + public function removeCategory($category) + { + $this->entityManager->remove($category); + $this->entityManager->flush(); + } +} diff --git a/module/Category/src/Service/CategoryService.php b/module/Category/src/Service/CategoryService.php deleted file mode 100755 index 943d438..0000000 --- a/module/Category/src/Service/CategoryService.php +++ /dev/null @@ -1,11 +0,0 @@ -get('doctrine.entitymanager.orm_default'); + // Instantiate the service and inject dependencies + return new CategoryManager($entityManager); + } +} diff --git a/module/Category/test/Controller/IndexControllerTest.php b/module/Category/test/Controller/IndexControllerTest.php index 7da8824..ee32759 100755 --- a/module/Category/test/Controller/IndexControllerTest.php +++ b/module/Category/test/Controller/IndexControllerTest.php @@ -2,7 +2,7 @@ namespace CategoryTest\Controller; -use Category\Controller\IndexController; +use Category\Controller\CategoryController; use Zend\Stdlib\ArrayUtils; use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase; @@ -29,7 +29,7 @@ public function testIndexActionCanBeAccessed() $this->dispatch('/', 'GET'); $this->assertResponseStatusCode(200); $this->assertModuleName('category'); - $this->assertControllerName(IndexController::class); // as specified in router's controller name alias + $this->assertControllerName(CategoryController::class); // as specified in router's controller name alias $this->assertControllerClass('IndexController'); $this->assertMatchedRouteName('category'); } diff --git a/module/Category/view/add.phtml b/module/Category/view/add.phtml new file mode 100755 index 0000000..4295d3e --- /dev/null +++ b/module/Category/view/add.phtml @@ -0,0 +1,34 @@ +form; +$form->get('title')->setAttributes([ + 'class' => 'form-control', + 'placeholder' => 'Enter category title here' +]); + +$form->get('submit')->setAttributes(['class' => 'btn btn-primary']); +$form->prepare(); + +?> + +

Add New Category

+ +

+ Please fill out the following form and click the Create button. +

+ +
+
+ form()->openTag($form); ?> + +
+ formLabel($form->get('title')); ?> + formElement($form->get('title')); ?> + formElementErrors($form->get('title')); ?> +
+ + + formElement($form->get('submit')); ?> + + form()->closeTag(); ?> +
+
\ No newline at end of file diff --git a/module/Category/view/category/index/add.phtml b/module/Category/view/category/index/add.phtml deleted file mode 100755 index 02d5389..0000000 --- a/module/Category/view/category/index/add.phtml +++ /dev/null @@ -1 +0,0 @@ -

Add

\ No newline at end of file diff --git a/module/Category/view/category/index/delete.phtml b/module/Category/view/category/index/delete.phtml deleted file mode 100755 index a904adc..0000000 --- a/module/Category/view/category/index/delete.phtml +++ /dev/null @@ -1 +0,0 @@ -

Delete

\ No newline at end of file diff --git a/module/Category/view/category/index/edit.phtml b/module/Category/view/category/index/edit.phtml deleted file mode 100755 index f7a4026..0000000 --- a/module/Category/view/category/index/edit.phtml +++ /dev/null @@ -1 +0,0 @@ -

Edit

\ No newline at end of file diff --git a/module/Category/view/edit.phtml b/module/Category/view/edit.phtml index 8b2b513..6c6a484 100755 --- a/module/Category/view/edit.phtml +++ b/module/Category/view/edit.phtml @@ -1,13 +1,12 @@ form; $form->get('title')->setAttributes([ - 'class'=>'form-control', - 'placeholder'=>'Enter Category title here' + 'class' => 'form-control', + 'placeholder' => 'Enter Category title here' ]); - -$form->get('submit')->setAttributes(['class'=>'btn btn-primary']); +$form->get('submit')->setAttributes(['class' => 'btn btn-primary']); $form->get('submit')->setValue('Save'); $form->prepare(); diff --git a/module/Category/view/index.phtml b/module/Category/view/index.phtml index 5774fdb..ba199d1 100755 --- a/module/Category/view/index.phtml +++ b/module/Category/view/index.phtml @@ -1,34 +1,33 @@ -

Categories Add -

- - +

Categories Add

- + - categories as $category): ?> + categories as $category) : ?> - -
Title Created TimeActions
escapeHtml($category->getTitle()); ?> escapeHtml($category->getDateCreated()); ?> -
- - - diff --git a/module/Product/config/module.config.php b/module/Product/config/module.config.php index 8a3652d..38c7772 100755 --- a/module/Product/config/module.config.php +++ b/module/Product/config/module.config.php @@ -2,24 +2,22 @@ namespace Product; -use Zend\Router\Http\Literal; use Zend\Router\Http\Segment; -use Zend\ServiceManager\Factory\InvokableFactory; return [ 'router' => [ 'routes' => [ 'product' => [ - 'type' => Segment::class, + 'type' => Segment::class, 'options' => [ 'route' => '/product[/:action[/:id]]', 'constraints' => [ 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', - 'id' => '[0-9]+', + 'id' => '[0-9]+', ], 'defaults' => [ 'controller' => Controller\ProductController::class, - 'action' => 'index', + 'action' => 'index', ], ], ], @@ -36,9 +34,17 @@ ], ], + 'view_manager' => [ + 'display_not_found_reason' => true, + 'display_exceptions' => true, + 'doctype' => 'HTML5', + 'not_found_template' => 'error/404', + 'exception_template' => 'error/index', 'template_map' => [ - 'product/index/index' => __DIR__ . '/../view/product/index/index.phtml', + 'product/product/index' => __DIR__ . '/../view/index.phtml', + 'product/product/add' => __DIR__ . '/../view/add.phtml', + 'product/product/edit' => __DIR__ . '/../view/edit.phtml', ], 'template_path_stack' => [ __DIR__ . '/../view', diff --git a/module/Product/src/Controller/Factory/ProductControllerFactory.php b/module/Product/src/Controller/Factory/ProductControllerFactory.php index db8c9df..262e884 100755 --- a/module/Product/src/Controller/Factory/ProductControllerFactory.php +++ b/module/Product/src/Controller/Factory/ProductControllerFactory.php @@ -2,20 +2,18 @@ namespace Product\Controller\Factory; -use Product\Service\ProductManager; -use Zend\ServiceManager\Factory\FactoryInterface; use Interop\Container\ContainerInterface; - use Product\Controller\ProductController; +use Product\Service\ProductManager; +use Zend\ServiceManager\Factory\FactoryInterface; class ProductControllerFactory implements FactoryInterface { - public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { - // Get Doctrine entity manager $entityManager = $container->get('doctrine.entitymanager.orm_default'); $productManager = $container->get(ProductManager::class); - return new ProductController($productManager,$entityManager); + return new ProductController($productManager, $entityManager); } } diff --git a/module/Product/src/Controller/ProductController.php b/module/Product/src/Controller/ProductController.php index bd3198c..e615b26 100755 --- a/module/Product/src/Controller/ProductController.php +++ b/module/Product/src/Controller/ProductController.php @@ -1,18 +1,16 @@ productManager = $productManager; @@ -36,11 +32,6 @@ public function indexAction() $products = $this->entityManager->getRepository(Product::class)->findAll(); $view = new ViewModel(); -// // $view->setTemplate('index'); - -// // $view->setTemplate('product/index'); // path to phtml file under view folder -// // $view->setTemplate('product/view/index.phtml'); // module/Test/view/test/test/ - $view->products = $products; return $view; } @@ -64,19 +55,13 @@ public function addAction() // Check whether this product is a POST request. if ($this->getRequest()->isPost()) { - // Get POST data. $data = $this->params()->fromPost(); - - - // Fill form with data. $form->setData($data); if ($form->isValid()) { // Get validated form data. $data = $form->getData(); - -// $data['category_id'] = (int) $data['category_id']; // Use product manager service to add new product to database. $this->productManager->addNewProduct($data); // Redirect the user to "index" page. @@ -86,12 +71,10 @@ public function addAction() // Render the view template. - $view = new ViewModel([ + $view = new ViewModel([ 'form' => $form, ]); -// // $view->setTemplate('add'); - return $view; } @@ -103,14 +86,12 @@ public function editAction() $categories = $this->entityManager->getRepository(Category::class)->findAll(); - $form = new ProductForm($categories); // Get product ID. $productId = $this->params()->fromRoute('id', -1); - // Find existing product in the database. $product = $this->entityManager->getRepository(Product::class) ->findOneById($productId); @@ -124,30 +105,21 @@ public function editAction() // Check whether this product is a POST request. if ($this->getRequest()->isPost()) { - // Get POST data. $data = $this->params()->fromPost(); - - - // Fill form with data. $form->setData($data); if ($form->isValid()) { - - - // Get validated form data. $data = $form->getData(); // Use product manager service to add new product to database. - - $this->productManager->updateProduct($product, $data); // Redirect the user to "admin" page. - return $this->redirect()->toRoute('product', ['action'=>'index']); + return $this->redirect()->toRoute('product', ['action' => 'index']); } } else { $data = [ @@ -157,21 +129,17 @@ public function editAction() ]; - $form->setData($data); } - - // Render the view template. - $view = new ViewModel([ + $view = new ViewModel([ 'form' => $form, 'product' => $product ]); - // $view->setTemplate('edit'); - return $view ; + return $view; } @@ -190,6 +158,6 @@ public function deleteAction() $this->productManager->removeProduct($product); // Redirect the user to "index" page. - return $this->redirect()->toRoute('product', ['action'=>'index']); + return $this->redirect()->toRoute('product', ['action' => 'index']); } } diff --git a/module/Product/src/Entity/Product.php b/module/Product/src/Entity/Product.php index fa79560..aecd51d 100755 --- a/module/Product/src/Entity/Product.php +++ b/module/Product/src/Entity/Product.php @@ -1,6 +1,9 @@ id; @@ -70,7 +76,6 @@ public function setTitle($title) } - // Returns Price public function getPrice() { @@ -84,18 +89,24 @@ public function setPrice($price) } - - - // Returns CategoryId + /** + * + * @return int + */ public function getCategoryId() { return $this->category_id; } // Sets CategoryId - public function setCategoryId($category_id) + + /** + * @param $id + * + */ + public function setCategoryId($id) { - $this->category_id = $category_id; + $this->category_id = $id; } // Returns the date when this item was created. @@ -110,15 +121,6 @@ public function setDateCreated($dateCreated) $this->dateCreated = $dateCreated; } - - /*Relations*/ - - /** - * @ORM\ManyToOne(targetEntity="\Category\Entity\Category", inversedBy="categories") - * @ORM\JoinColumn(name="category_id", referencedColumnName="id") - */ - protected $category; - /* * Returns associated category. * @return \Category\Entity\Category @@ -128,6 +130,7 @@ public function getCategory() return $this->category; } + /** * Sets associated category. * @param \Category\Entity\Category $category @@ -135,10 +138,5 @@ public function getCategory() public function setCategory($category) { $this->category = $category; - $category->addComment($this); } - - - - -} \ No newline at end of file +} diff --git a/module/Product/src/Form/PostForm.php b/module/Product/src/Form/ProductForm.php similarity index 53% rename from module/Product/src/Form/PostForm.php rename to module/Product/src/Form/ProductForm.php index 8e4f56b..52f5a1f 100644 --- a/module/Product/src/Form/PostForm.php +++ b/module/Product/src/Form/ProductForm.php @@ -4,21 +4,23 @@ use Zend\Form\Form; use Zend\InputFilter\InputFilter; -use Product\Entity\Post; /** * This form is used to collect product data. */ class ProductForm extends Form { + private $categories; + /** * Constructor. */ - public function __construct() + public function __construct($categories) { // Define form name parent::__construct('product-form'); + $this->categories = $categories; // Set POST method for this form $this->setAttribute('method', 'post'); $this->addElements(); @@ -33,62 +35,81 @@ protected function addElements() // Add "title" field $this->add([ - 'type' => 'text', + 'type' => 'text', 'name' => 'title', 'attributes' => [ 'id' => 'title' ], + + 'options' => [ 'label' => 'Title', ], ]); - // Add "content" field + + // Add "category_id" field $this->add([ - 'type' => 'textarea', - 'name' => 'content', + 'type' => 'number', + 'name' => 'category_id', 'attributes' => [ - 'id' => 'content' + 'id' => 'category_id', ], + 'options' => [ - 'label' => 'Content', + 'label' => 'Category', ], ]); - // Add "tags" field + + // Add "Price" field $this->add([ - 'type' => 'text', - 'name' => 'tags', + 'type' => 'number', + 'name' => 'price', 'attributes' => [ - 'id' => 'tags' + 'id' => 'Price', ], + 'options' => [ - 'label' => 'Tags', + 'label' => 'Price', ], ]); - // Add "status" field + + /* convert array of objects to array of properties + + [ + '0' => 'French', + '1' => 'English', + '2' => 'Japanese', + '3' => 'Chinese', + ] + */ + + $categoriesForView = [ + '' => '## Select ##' + ]; + foreach ($this->categories as $category) { + $categoriesForView[$category->getId()] = $category->getTitle(); + } + + $this->add([ - 'type' => 'select', - 'name' => 'status', - 'attributes' => [ - 'id' => 'status' - ], + 'type' => 'Select', + 'name' => 'category_id', 'options' => [ - 'label' => 'Status', - 'value_options' => [ - Post::STATUS_PUBLISHED => 'Published', - Post::STATUS_DRAFT => 'Draft', - ] - ], + 'label' => 'Category', + 'value_options' => $categoriesForView + ] ]); + // Add the submit button $this->add([ - 'type' => 'submit', + 'type' => 'submit', 'name' => 'submit', 'attributes' => [ - 'value' => 'Create', + 'value' => 'Save', 'id' => 'submitbutton', ], ]); @@ -104,16 +125,16 @@ private function addInputFilter() $this->setInputFilter($inputFilter); $inputFilter->add([ - 'name' => 'title', + 'name' => 'title', 'required' => true, - 'filters' => [ + 'filters' => [ ['name' => 'StringTrim'], ['name' => 'StripTags'], ['name' => 'StripNewlines'], ], 'validators' => [ [ - 'name' => 'StringLength', + 'name' => 'StringLength', 'options' => [ 'min' => 1, 'max' => 1024 @@ -122,53 +143,22 @@ private function addInputFilter() ], ]); - $inputFilter->add([ - 'name' => 'content', - 'required' => true, - 'filters' => [ - ['name' => 'StripTags'], - ], - 'validators' => [ - [ - 'name' => 'StringLength', - 'options' => [ - 'min' => 1, - 'max' => 4096 - ], - ], - ], - ]); $inputFilter->add([ - 'name' => 'tags', + 'name' => 'price', 'required' => true, - 'filters' => [ - ['name' => 'StringTrim'], + 'filters' => [ ['name' => 'StripTags'], - ['name' => 'StripNewlines'], ], 'validators' => [ [ - 'name' => 'StringLength', + 'name' => 'StringLength', 'options' => [ 'min' => 1, - 'max' => 1024 + 'max' => 4096 ], ], ], ]); - - $inputFilter->add([ - 'name' => 'status', - 'required' => true, - 'validators' => [ - [ - 'name' => 'InArray', - 'options'=> [ - 'haystack' => [Post::STATUS_PUBLISHED, Post::STATUS_DRAFT], - ] - ], - ], - ]); } -} \ No newline at end of file +} diff --git a/module/Product/src/Service/Factory/ProductManagerFactory.php b/module/Product/src/Service/Factory/ProductManagerFactory.php index 8ff8bdf..27c287d 100644 --- a/module/Product/src/Service/Factory/ProductManagerFactory.php +++ b/module/Product/src/Service/Factory/ProductManagerFactory.php @@ -1,4 +1,5 @@ get('doctrine.entitymanager.orm_default'); // Instantiate the service and inject dependencies return new ProductManager($entityManager); } -} \ No newline at end of file +} diff --git a/module/Product/src/Service/ProductManager.php b/module/Product/src/Service/ProductManager.php index 66628cb..1d58f26 100644 --- a/module/Product/src/Service/ProductManager.php +++ b/module/Product/src/Service/ProductManager.php @@ -1,19 +1,20 @@ setCategory($category); -// echo '
';
-//        var_dump($product);
-//        echo '
'; -// $product->setContent($data['content']); -// $product->setStatus($data['status']); $currentDate = date('Y-m-d H:i:s'); $product->setDateCreated($currentDate); // Add the entity to entity manager. @@ -52,12 +48,9 @@ public function addNewProduct($data) // Apply changes to database. $this->entityManager->flush(); - } - - // This method allows to update data of a single post. public function updateProduct($product, $data) { @@ -68,20 +61,15 @@ public function updateProduct($product, $data) $product->setCategoryId($data['category_id']); - // Apply changes to database. $this->entityManager->flush(); } - // Removes post and all associated comments. public function removeProduct($post) { $this->entityManager->remove($post); $this->entityManager->flush(); } - - - -} \ No newline at end of file +} diff --git a/module/Product/src/Service/ProductService.php b/module/Product/src/Service/ProductService.php deleted file mode 100755 index 9d93e8e..0000000 --- a/module/Product/src/Service/ProductService.php +++ /dev/null @@ -1,11 +0,0 @@ -form; +$form->get('title')->setAttributes([ + 'class' => 'form-control', + 'placeholder' => 'Enter product title here' +]); + + +$form->get('category_id')->setAttributes([ + 'class' => 'form-control', +]); + + +$form->get('price')->setAttributes([ + 'class' => 'form-control', +]); + +$form->get('submit')->setAttributes(['class' => 'btn btn-primary']); +$form->prepare(); + +?> + +

Add New Product

+ +

+ Please fill out the following form and click the Create button. +

+ +
+
+ form()->openTag($form); ?> + +
+ formLabel($form->get('title')); ?> + formElement($form->get('title')); ?> + formElementErrors($form->get('title')); ?> +
+ + +
+ formLabel($form->get('category_id')); ?> + formElement($form->get('category_id')); ?> + formElementErrors($form->get('category_id')); ?> +
+ + +
+ formLabel($form->get('price')); ?> + formElement($form->get('price')); ?> + formElementErrors($form->get('price')); ?> +
+ + + formElement($form->get('submit')); ?> + + form()->closeTag(); ?> +
+
\ No newline at end of file diff --git a/module/Product/view/edit.phtml b/module/Product/view/edit.phtml new file mode 100755 index 0000000..46dc933 --- /dev/null +++ b/module/Product/view/edit.phtml @@ -0,0 +1,60 @@ +form; +$form->get('title')->setAttributes([ + 'class' => 'form-control', + 'placeholder' => 'Enter product title here' +]); + + +$form->get('category_id')->setAttributes([ + 'class' => 'form-control', +]); + + +$form->get('price')->setAttributes([ + 'class' => 'form-control', + 'placeholder' => 'Type price here', + 'rows' => 6 +]); + +$form->get('submit')->setAttributes(['class' => 'btn btn-primary']); +$form->get('submit')->setValue('Save'); +$form->prepare(); + +?> + +

Edit Product

+ +

+ Please fill out the following form and click the *Save* button. +

+ +
+
+ form()->openTag($form); ?> + +
+ formLabel($form->get('title')); ?> + formElement($form->get('title')); ?> + formElementErrors($form->get('title')); ?> +
+ +
+ formLabel($form->get('price')); ?> + formElement($form->get('price')); ?> + formElementErrors($form->get('price')); ?> +
+ + +
+ formLabel($form->get('category_id')); ?> + formElement($form->get('category_id')); ?> + formElementErrors($form->get('category_id')); ?> +
+ + + formElement($form->get('submit')); ?> + + form()->closeTag(); ?> +
+
\ No newline at end of file diff --git a/module/Product/view/index.phtml b/module/Product/view/index.phtml new file mode 100755 index 0000000..a559513 --- /dev/null +++ b/module/Product/view/index.phtml @@ -0,0 +1,50 @@ +

Products Add +

+products)) : ?> + + + + + + + + + + + + products as $product) : ?> + + + + + + + + + + +
TitlePriceCategoryCreated Time
escapeHtml($product->getTitle()); ?> escapeHtml($product->getPrice()); ?> escapeHtml($product->getCategory()->getTitle()); ?> escapeHtml($product->getDateCreated()); ?> + +
+ Edit + Delete + +
+ +
+ +

No products

+ + + diff --git a/module/Product/view/product/index/add.phtml b/module/Product/view/product/index/add.phtml deleted file mode 100755 index 6d6f28f..0000000 --- a/module/Product/view/product/index/add.phtml +++ /dev/null @@ -1,63 +0,0 @@ -form; -$form->get('title')->setAttributes([ - 'class'=>'form-control', - 'placeholder'=>'Enter product title here' -]); -$form->get('content')->setAttributes([ - 'class'=>'form-control', - 'placeholder'=>'Type content here', - 'rows'=>6 -]); -$form->get('tags')->setAttributes([ - 'class'=>'form-control', - 'placeholder'=>'comma, separated, list, of, tags' -]); -$form->get('status')->setAttributes([ - 'class'=>'form-control' -]); -$form->get('submit')->setAttributes(['class'=>'btn btn-primary']); -$form->prepare(); - -?> - -

Add New Product

- -

- Please fill out the following form and click the Create button. -

- -
-
- form()->openTag($form); ?> - -
- formLabel($form->get('title')); ?> - formElement($form->get('title')); ?> - formElementErrors($form->get('title')); ?> -
- -
- formLabel($form->get('content')); ?> - formElement($form->get('content')); ?> - formElementErrors($form->get('content')); ?> -
- -
- formLabel($form->get('tags')); ?> - formElement($form->get('tags')); ?> - formElementErrors($form->get('tags')); ?> -

Separate tags with comma.

-
- -
- formLabel($form->get('status')); ?> - formElement($form->get('status')); ?> - formElementErrors($form->get('status')); ?> -
- - formElement($form->get('submit')); ?> - - form()->closeTag(); ?> -
-
\ No newline at end of file diff --git a/module/Product/view/product/index/delete.phtml b/module/Product/view/product/index/delete.phtml deleted file mode 100755 index a904adc..0000000 --- a/module/Product/view/product/index/delete.phtml +++ /dev/null @@ -1 +0,0 @@ -

Delete

\ No newline at end of file diff --git a/module/Product/view/product/index/edit.phtml b/module/Product/view/product/index/edit.phtml deleted file mode 100755 index f7a4026..0000000 --- a/module/Product/view/product/index/edit.phtml +++ /dev/null @@ -1 +0,0 @@ -

Edit

\ No newline at end of file diff --git a/module/Product/view/product/index/index.phtml b/module/Product/view/product/index/index.phtml deleted file mode 100755 index db3d302..0000000 --- a/module/Product/view/product/index/index.phtml +++ /dev/null @@ -1,26 +0,0 @@ -

Products Add - - - - - - - - - - products as $product): ?> - - - - - - - - -
TitleCreated TimeActions
escapeHtml($product->getTitle()); ?> escapeHtml($product->getDateCreated()); ?> - Edit - Delete -
- - - diff --git a/phpcs.xml b/phpcs.xml old mode 100755 new mode 100644 diff --git a/phpunit.xml.dist b/phpunit.xml.dist old mode 100755 new mode 100644 diff --git a/public/.htaccess b/public/.htaccess old mode 100755 new mode 100644 diff --git a/public/css/bootstrap-theme.css b/public/css/bootstrap-theme.css old mode 100755 new mode 100644 diff --git a/public/css/bootstrap-theme.css.map b/public/css/bootstrap-theme.css.map old mode 100755 new mode 100644 diff --git a/public/css/bootstrap-theme.min.css b/public/css/bootstrap-theme.min.css old mode 100755 new mode 100644 diff --git a/public/css/bootstrap-theme.min.css.map b/public/css/bootstrap-theme.min.css.map old mode 100755 new mode 100644 diff --git a/public/css/bootstrap.css b/public/css/bootstrap.css old mode 100755 new mode 100644 diff --git a/public/css/bootstrap.css.map b/public/css/bootstrap.css.map old mode 100755 new mode 100644 diff --git a/public/css/bootstrap.min.css b/public/css/bootstrap.min.css old mode 100755 new mode 100644 diff --git a/public/css/bootstrap.min.css.map b/public/css/bootstrap.min.css.map old mode 100755 new mode 100644 diff --git a/public/css/style.css b/public/css/style.css old mode 100755 new mode 100644 index 71f683b..cf1bbb2 --- a/public/css/style.css +++ b/public/css/style.css @@ -3,3 +3,13 @@ body { padding-top: 60px; } + + + +td a { + margin-right: 1em; +} + +form li { + color:red +} \ No newline at end of file diff --git a/public/fonts/glyphicons-halflings-regular.eot b/public/fonts/glyphicons-halflings-regular.eot old mode 100755 new mode 100644 diff --git a/public/fonts/glyphicons-halflings-regular.svg b/public/fonts/glyphicons-halflings-regular.svg old mode 100755 new mode 100644 diff --git a/public/fonts/glyphicons-halflings-regular.ttf b/public/fonts/glyphicons-halflings-regular.ttf old mode 100755 new mode 100644 diff --git a/public/fonts/glyphicons-halflings-regular.woff b/public/fonts/glyphicons-halflings-regular.woff old mode 100755 new mode 100644 diff --git a/public/fonts/glyphicons-halflings-regular.woff2 b/public/fonts/glyphicons-halflings-regular.woff2 old mode 100755 new mode 100644 diff --git a/public/index.php b/public/index.php old mode 100755 new mode 100644 diff --git a/public/js/bootstrap.js b/public/js/bootstrap.js old mode 100755 new mode 100644 diff --git a/public/js/bootstrap.min.js b/public/js/bootstrap.min.js old mode 100755 new mode 100644 diff --git a/public/js/jquery-3.1.0.min.js b/public/js/jquery-3.1.0.min.js old mode 100755 new mode 100644 diff --git a/public/web.config b/public/web.config old mode 100755 new mode 100644 From 9b86dfe288906b52e205280719164c1788b9120b Mon Sep 17 00:00:00 2001 From: moataz Date: Sun, 22 Jul 2018 17:02:35 +0200 Subject: [PATCH 7/7] Fix warning --- zftool.phar | 5695 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 5695 insertions(+) create mode 100644 zftool.phar diff --git a/zftool.phar b/zftool.phar new file mode 100644 index 0000000..07c180b --- /dev/null +++ b/zftool.phar @@ -0,0 +1,5695 @@ + + + + + + Zend Framework Composer Repository + + + + + + + + + + +
+
+

Zend Framework Composer Repository

+ +

+ Last updated: +

+
+ +
+
+

+ Adding the repository to composer.json: +

+ +

+{
+    "repositories": [
+        {
+            "type": "composer",
+            "url": "https://packages.zendframework.com"
+        }
+    ]
+}
+                
+
+ +
+ +
+

Filter by package name:

+ + +
+
+
+ +
+
+
+ +
+
+
+
+

zendframework/skeleton-application

+
+ +
+

Skeleton Application for Zend Framework zend-mvc applications

+ + + + + + + + + + + + + + + + + + +
Homepagehttp://framework.zend.com/
LicenseBSD-3-Clause
Releases + dev-master, 3.0.3, 3.0.2, 3.0.1, 3.0.0, 2.5.0, 2.4.11, 2.3.3, 2.3.2, 2.3.1, 2.3.0, 2.2.8, 2.2.7, dev-develop
Required by +
+
+
+
+ + + + + + + + + + + +
+
+
+

zendframework/zend-developer-tools

+
+ +
+

Module for developer and debug tools for use with zend-mvc applications.

+ + + + + + + + + + + + + + + + + + + + + + +
Homepagehttps://github.com/zendframework/ZendDeveloperTools
LicenseBSD-3-Clause
Authors + Evan Coury, Eric Boh
Releases + dev-master, 1.2.1, 1.2.0, 1.1.1, 1.1.0, 1.0.0, 1.0.0-RC1, 1.0.0-BETA5, 1.0.0-BETA4, 1.0.0-BETA3, 1.0.0-BETA2, 1.0.0-BETA1, 1.0.0-ALPHA1, 0.0.2, 0.0.1, dev-develop
Required by +
+
+
+
+ + + + +
+
+
+

zendframework/zend-eventmanager

+
+ + +
+
+ + + + +
+ +
+ + + + + +
+
+
+

zendframework/zend-expressive-zendviewrenderer

+
+ + +
+
+ + + + +
+
+
+

zendframework/zend-http

+
+ +
+

Provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests

+ + + + + + + + + + + + + + + + + + +
LicenseBSD-3-Clause
Support + +
Releases + dev-master, 2.8.0, 2.7.0, 2.6.0, 2.5.6, 2.5.5, 2.5.4, 2.5.3, 2.5.2, 2.5.1, 2.5.0, 2.4.13, 2.4.12, 2.4.11, 2.4.10, 2.4.9, 2.4.8, 2.4.7, 2.4.6, 2.4.5, 2.4.4, 2.4.3, 2.4.2, 2.4.1, 2.4.0, 2.4.0rc7, 2.4.0rc6, 2.4.0rc5, 2.4.0rc4, 2.4.0rc3, 2.4.0rc2, 2.4.0rc1, 2.3.9, 2.3.8, 2.3.7, 2.3.6, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.3.1, 2.3.0, 2.2.10, 2.2.9, 2.2.8, 2.2.7, 2.2.6, 2.2.5, 2.2.4, 2.2.3, 2.2.2, 2.2.1, 2.2.0, 2.2.0rc3, 2.2.0rc2, 2.2.0rc1, 2.1.6, 2.1.5, 2.1.4, 2.1.3, 2.1.2, 2.1.1, 2.1.0, 2.0.8, 2.0.7, 2.0.6, 2.0.5, 2.0.4, 2.0.3, 2.0.2, 2.0.1, 2.0.0, dev-develop
Required by + +
+
+
+
+ + + + + +
+
+
+

zendframework/zend-json-server

+
+ + +
+
+ + + +
+
+
+

zendframework/zend-mail

+
+ +
+

provides generalized functionality to compose and send both text and MIME-compliant multipart e-mail messages

+ + + + + + + + + + + + + + + + + + +
Homepagehttps://github.com/zendframework/zend-mail
LicenseBSD-3-Clause
Releases + dev-master, 2.10.0, 2.9.0, 2.8.0, 2.7.3, 2.7.2, 2.7.1, 2.7.0, 2.6.2, 2.6.1, 2.6.0, 2.5.2, 2.5.1, 2.5.0, 2.4.13, 2.4.12, 2.4.11, 2.4.10, 2.4.9, 2.4.8, 2.4.7, 2.4.6, 2.4.5, 2.4.4, 2.4.3, 2.4.2, 2.4.1, 2.4.0, 2.4.0rc7, 2.4.0rc6, 2.4.0rc5, 2.4.0rc4, 2.4.0rc3, 2.4.0rc2, 2.4.0rc1, 2.3.9, 2.3.8, 2.3.7, 2.3.6, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.3.1, 2.3.0, 2.2.10, 2.2.9, 2.2.8, 2.2.7, 2.2.6, 2.2.5, 2.2.4, 2.2.3, 2.2.2, 2.2.1, 2.2.0, 2.2.0rc3, 2.2.0rc2, 2.2.0rc1, 2.1.6, 2.1.5, 2.1.4, 2.1.3, 2.1.2, 2.1.1, 2.1.0, 2.0.8, 2.0.7, 2.0.6, 2.0.5, 2.0.4, 2.0.3, 2.0.2, 2.0.1, 2.0.0, dev-develop
Required by + +
+
+
+
+ + + +
+
+
+

zendframework/zend-modulemanager

+
+ + +
+
+
+
+
+

zendframework/zend-mvc

+
+ +
+

Zend Framework's event-driven MVC layer, including MVC Applications, Controllers, and Plugins

+ + + + + + + + + + + + + + + + + + +
LicenseBSD-3-Clause
Support + +
Releases + dev-master, 3.1.1, 3.1.0, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0.0, 2.7.15, 2.7.14, 2.7.13, 2.7.12, 2.7.11, 2.7.10, 2.7.9, 2.7.8, 2.7.7, 2.7.6, 2.7.5, 2.7.4, 2.7.3, 2.7.2, 2.7.1, 2.7.0, 2.6.3, 2.6.2, 2.6.1, 2.6.0, 2.5.3, 2.5.2, 2.5.1, 2.5.0, 2.4.13, 2.4.12, 2.4.11, 2.4.10, 2.4.9, 2.4.8, 2.4.7, 2.4.6, 2.4.5, 2.4.4, 2.4.3, 2.4.2, 2.4.1, 2.4.0, 2.4.0rc7, 2.4.0rc6, 2.4.0rc5, 2.4.0rc4, 2.4.0rc3, 2.4.0rc2, 2.4.0rc1, 2.3.9, 2.3.8, 2.3.7, 2.3.6, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.3.1, 2.3.0, 2.2.10, 2.2.9, 2.2.8, 2.2.7, 2.2.6, 2.2.5, 2.2.4, 2.2.3, 2.2.2, 2.2.1, 2.2.0, 2.2.0rc3, 2.2.0rc2, 2.2.0rc1, 2.1.6, 2.1.5, 2.1.4, 2.1.3, 2.1.2, 2.1.1, 2.1.0, 2.0.8, 2.0.7, 2.0.6, 2.0.5, 2.0.4, 2.0.3, 2.0.2, 2.0.1, 2.0.0, dev-develop
Required by + +
+
+
+
+ +
+
+
+

zendframework/zend-mvc-form

+
+ +
+

Metapackage with all requirements needed to use zend-form with zend-mvc.

+ + + + + + + + + + + + + + + + + + +
Homepagehttps://github.com/zendframework/zend-mvc-form
LicenseBSD-3-Clause
Releases + dev-master, 1.0.0
Required by + +
+
+
+
+
+
+
+

zendframework/zend-mvc-i18n

+
+ + +
+
+
+
+
+

zendframework/zend-mvc-plugin-fileprg

+
+ + +
+
+
+
+
+

zendframework/zend-mvc-plugin-flashmessenger

+
+ + +
+
+
+
+
+

zendframework/zend-mvc-plugin-identity

+
+ + +
+
+
+
+
+

zendframework/zend-mvc-plugin-prg

+
+ + +
+
+
+
+
+

zendframework/zend-mvc-plugins

+
+ +
+

Collection of all stable zend-mvc plugins served via separate packages.

+ + + + + + + + + + + + + + + + + + +
Homepagehttps://github.com/zendframework/zend-mvc-plugins
LicenseBSD-3-Clause
Releases + dev-master, 1.0.1, 1.0.0
Required by + +
+
+
+
+ + + +
+
+
+

zendframework/zend-permissions-rbac

+
+ + +
+
+ + + + + +
+
+
+

zendframework/zend-servicemanager

+
+ +
+

Factory-Driven Dependency Injection Container

+ + + + + + + + + + + + + + + + + + +
LicenseBSD-3-Clause
Support + +
Releases + dev-master, 3.3.2, 3.3.1, 3.3.0, 3.2.1, 3.2.0, 3.1.2, 3.1.1, 3.1.0, 3.0.3, 3.0.2, 3.0.1, 3.0.0, 2.7.11, 2.7.10, 2.7.9, 2.7.8, 2.7.7, 2.7.6, 2.7.5, 2.7.4, 2.7.3, 2.7.2, 2.7.1, 2.7.0, 2.6.0, 2.5.1, 2.5.0, 2.4.13, 2.4.12, 2.4.11, 2.4.10, 2.4.9, 2.4.8, 2.4.7, 2.4.6, 2.4.5, 2.4.4, 2.4.3, 2.4.2, 2.4.1, 2.4.0, 2.4.0rc7, 2.4.0rc6, 2.4.0rc5, 2.4.0rc4, 2.4.0rc3, 2.4.0rc2, 2.4.0rc1, 2.3.9, 2.3.8, 2.3.7, 2.3.6, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.3.1, 2.3.0, 2.2.10, 2.2.9, 2.2.8, 2.2.7, 2.2.6, 2.2.5, 2.2.4, 2.2.3, 2.2.2, 2.2.1, 2.2.0, 2.2.0rc3, 2.2.0rc2, 2.2.0rc1, 2.1.6, 2.1.5, 2.1.4, 2.1.3, 2.1.2, 2.1.1, 2.1.0, 2.0.8, 2.0.7, 2.0.6, 2.0.5, 2.0.4, 2.0.3, 2.0.2, 2.0.1, 2.0.0, dev-develop
Required by + +
+
+
+
+ + +
+
+
+

zendframework/zend-skeleton-installer

+
+ + +
+
+ +
+
+
+

zendframework/zend-stdlib

+
+ +
+

SPL extensions, array utilities, error handlers, and more

+ + + + + + + + + + + + + + + + + + +
LicenseBSD-3-Clause
Support + +
Releases + dev-master, 3.2.0, 3.1.1, 3.1.0, 3.0.1, 3.0.0, 2.7.7, 2.7.6, 2.7.5, 2.7.4, 2.7.3, 2.7.2, 2.7.1, 2.7.0, 2.6.0, 2.5.2, 2.5.1, 2.5.0, 2.4.13, 2.4.12, 2.4.11, 2.4.10, 2.4.9, 2.4.8, 2.4.7, 2.4.6, 2.4.5, 2.4.4, 2.4.3, 2.4.2, 2.4.1, 2.4.0, 2.4.0rc7, 2.4.0rc6, 2.4.0rc5, 2.4.0rc4, 2.4.0rc3, 2.4.0rc2, 2.4.0rc1, 2.3.9, 2.3.8, 2.3.7, 2.3.6, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.3.1, 2.3.0, 2.2.10, 2.2.9, 2.2.8, 2.2.7, 2.2.6, 2.2.5, 2.2.4, 2.2.3, 2.2.2, 2.2.1, 2.2.0, 2.2.0rc3, 2.2.0rc2, 2.2.0rc1, 2.1.6, 2.1.5, 2.1.4, 2.1.3, 2.1.2, 2.1.1, 2.1.0, 2.0.8, 2.0.7, 2.0.6, 2.0.5, 2.0.4, 2.0.3, 2.0.2, 2.0.1, 2.0.0, dev-develop
Required by + +
+
+
+
+ + + + + + + + +
+
+
+

zendframework/zend-xml2json

+
+ +
+

Provides functionality for converting XML to JSON, optionally including XML attributes

+ + + + + + + + + + + + + + + + + + +
LicenseBSD-3-Clause
Support + +
Releases + dev-master, 3.1.1, 3.1.0, 3.0.0, dev-develop
Required by + +
+
+
+
+ +
+
+
+

zendframework/zenddiagnostics

+
+ + +
+
+ +
+
+
+

zendframework/zendframework1

+
+ +
+

Zend Framework 1

+ + + + + + + + + + + + + + + + + + +
Homepagehttp://framework.zend.com/
LicenseBSD-3-Clause
Releases + dev-master, 1.12.20, 1.12.19, 1.12.18, 1.12.17, 1.12.16, 1.12.15, 1.12.14, 1.12.13, 1.12.12, 1.12.11, 1.12.10, 1.12.9, 1.12.8, 1.12.7, 1.12.6, 1.12.5, 1.12.4, 1.12.3, 1.12.2, 1.12.1, 1.12.0
Required by + +
+
+
+
+
+
+
+

zendframework/zendoauth

+
+ +
+

+ + + + + + + + + + + + + + + + + + +
Homepagehttp://packages.zendframework.com/
LicenseBSD-3-Clause
Releases + dev-master, 2.0.3, 2.0.2, 2.0.1, 2.0.0, 2.0.0rc7, 2.0.0rc6, 2.0.0rc5, 2.0.0rc4, 2.0.0rc3, 2.0.0rc2, 2.0.0rc1
Required by +
+
+
+
+
+
+
+

zendframework/zendopenid

+
+ +
+

provides a simple API for building OpenID-enabled sites and identity providers

+ + + + + + + + + + + + + + + + + + +
Homepagehttp://packages.zendframework.com/
LicenseBSD-3-Clause
Releases + dev-master, 2.0.2, 2.0.1, 2.0.0, 2.0.0rc7, 2.0.0rc6, 2.0.0rc5, 2.0.0rc4, 2.0.0rc3, 2.0.0rc2, 2.0.0rc1
Required by +
+
+
+
+
+
+
+

zendframework/zendservice-apple-apns

+
+ + +
+
+
+
+
+

zendframework/zendservice-google-c2dm

+
+ +
+

OOP wrapper for Google Cloud 2 Device Messaging

+ + + + + + + + + + + + + + + + + + +
Homepagehttp://packages.zendframework.com/
LicenseBSD-3-Clause
Releases + dev-master, 1.0.0
Required by +
+
+
+
+
+
+
+

zendframework/zendservice-google-gcm

+
+ + +
+
+
+
+
+

zendframework/zendservice-recaptcha

+
+ + +
+
+
+
+
+

zendframework/zendxml

+
+ +
+

Utility library for XML usage, best practices, and security in PHP

+ + + + + + + + + + + + + + + + + + +
LicenseBSD-3-Clause
Support + +
Releases + dev-master, 1.1.0, 1.0.2, 1.0.1, 1.0.0, dev-develop
Required by + +
+
+
+
+
+
+
+

zendframework/zf1-extras

+
+ +
+

Zend Framework 1 Extras

+ + + + + + + + + + + + + + + + + + +
Homepagehttp://framework.zend.com/
LicenseBSD-3-Clause
Releases + dev-master, 1.12.20, 1.12.19, 1.12.18, 1.12.16, 1.12.15, 1.12.13, 1.12.12, 1.12.11, 1.12.10, 1.12.8, 1.12.7, 1.12.6, 1.12.5, 1.12.4
Required by +
+
+
+
+
+
+
+

zfcampus/apigility-documentation

+
+ +
+

Apigility Documentation

+ + + + + + + + + + + + + + + + + + + + + + +
Homepagehttp://apigility.org/
LicenseBSD-3-Clause
Support + +
Releases + dev-master, dev-develop
Required by +
+
+
+
+
+
+
+

zfcampus/zf-angular

+
+ +
+

ZFAngular module for ZF2

+ + + + + + + + + + + + + + + + + + + + + + +
Homepagehttp://apigility.org/
LicenseBSD-3-Clause
Support + +
Releases + dev-master, 0.6.0
Required by +
+
+
+
+ + +
+
+
+

zfcampus/zf-apigility-admin

+
+ + +
+
+
+
+
+

zfcampus/zf-apigility-admin-ui

+
+ +
+

Apigility Admin UI module

+ + + + + + + + + + + + + + + + + + + + + + +
Homepagehttp://apigility.org/
LicenseBSD-3-Clause
Support + +
Releases + dev-master, 1.3.9, 1.3.8, 1.3.7, 1.3.6, 1.3.5, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.7, 1.0.6, 1.0.5, 1.0.4, dev-develop
Required by + +
+
+
+
+ + +
+
+
+

zfcampus/zf-apigility-documentation-apiblueprint

+
+ + +
+
+
+
+
+

zfcampus/zf-apigility-documentation-swagger

+
+ + +
+
+
+
+
+

zfcampus/zf-apigility-example

+
+ +
+

Apigility Example module

+ + + + + + + + + + + + + + + + + + + + + + +
Homepagehttp://apigility.org/
LicenseBSD-3-Clause
Support + +
Releases + dev-master, 0.6.0
Required by +
+
+
+
+ + +
+
+
+

zfcampus/zf-apigility-welcome

+
+ +
+

Apigility Welcome Screen

+ + + + + + + + + + + + + + + + + + + + + + +
Homepagehttp://apigility.org/
LicenseBSD-3-Clause
Support + +
Releases + dev-master, 1.0.1, 1.0.0, 1.0.0-beta3, 1.0.0beta2, 1.0.0beta1, 0.9.1, 0.9.0, 0.8.0, 0.7.0, 0.6.0, dev-develop
Required by +
+
+
+
+
+
+
+

zfcampus/zf-configuration

+
+ + +
+
+
+
+
+

zfcampus/zf-console

+
+ +
+

Library for creating and dispatching console commands

+ + + + + + + + + + + + + + + + + + +
LicenseBSD-3-Clause
Support + +
Releases + dev-master, 1.4.0, 1.3.0, 1.2.1, 1.2.0, 1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2, 1.0.1, 1.0.0, 1.0.0-beta3, 0.1.1, 0.1.0, dev-develop
Required by + +
+
+
+
+ + +
+
+
+

zfcampus/zf-deploy

+
+ +
+

Deployment tool for Zend Framework applications

+ + + + + + + + + + + + + + + + + + +
LicenseBSD-3-Clause
Support + +
Releases + dev-master, 1.3.0, 1.2.0, 1.1.1, 1.1.0, 1.0.5, 1.0.4, 1.0.3, 1.0.2, 1.0.1, 1.0.0, 1.0.0-beta3, 0.2.0, dev-develop
Required by +
+
+
+
+ +
+
+
+

zfcampus/zf-doctrine-querybuilder

+
+ +
+

QueryBuilder filters for Doctrine

+ + + + + + + + + + + + + + + + + + + + + + +
Homepagehttps://github.com/zfcampus/zf-doctrine-querybuilder-filter
LicenseBSD-3-Clause
Authors + Tom Anderson
Releases + dev-master, 1.6.0, 1.5.1, 1.5.0, 1.4.6, 1.4.5, 1.4.4, 1.4.3, 1.4.2, 1.4.1, 1.4.0, 1.3.2, 1.3.1, 1.3.0, 1.2.0, 1.0.1, 1.0.0, 0.1.2, 0.1.1, 0.1.0, dev-develop
Required by +
+
+
+
+
+
+
+

zfcampus/zf-hal

+
+ + +
+
+
+
+
+

zfcampus/zf-http-cache

+
+ +
+

ZF2 Module providing http cache headers support

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Homepagehttp://apigility.org/
LicenseBSD-3-Clause
Authors + Corentin Larose
Support + +
Releases + dev-master, 1.4.0, 1.3.0, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.0, 1.0.2, 1.0.1, 1.0.0, dev-develop
Required by +
+
+
+
+ + + + +
+
+
+

zfcampus/zf-versioning

+
+ + +
+
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+ +
+
+

Copyright

+
+ +

© 2006-2018 by Zend, a Rogue Wave Company.

+
+ +
+

Contacts

+
+

+ + + +

+
+
+
+
+ + + + + + + +