From 60d9d7575f5cf1c05ba19afe78de9ac6975a2725 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 8 Jul 2016 13:53:21 +0200 Subject: [PATCH] ZF2 --- .gitignore | 1 + application/Bootstrap.php | 41 - application/configs/README | 0 application/models/Sdv1FluxFileIn.php | 6 - application/models/Sdv1FluxFileOut.php | 6 - cli.php | 17 + composer.json | 27 +- composer.lock | 1035 ++++++++++++++++- config/application.config.php | 66 ++ config/autoload/.gitignore | 2 + config/autoload/README.md | 8 + config/autoload/doctrine.global.php | 3 + config/autoload/doctrine.local.php.dist | 34 + config/autoload/global.php | 16 + config/autoload/local.php.dist | 15 + config/autoload/presta.global.php | 166 +++ data/cache/.gitignore | 2 + doc/README-DEV | 2 + README-FTP-USE => doc/README-FTP-USE | 0 README-SFTP-USE => doc/README-SFTP-USE | 0 doc/TODO | 64 + init_autoloader.php | 54 + module/Application/Module.php | 69 ++ module/Application/config/module.config.php | 173 +++ .../Controller/ConfigController.php | 25 + .../Application/Controller/FileController.php | 147 +++ .../Controller/FileControllerFactory.php | 18 + .../Controller/IndexController.php | 21 + .../src/Application/Entity/FluxFilein.php | 314 +++++ .../src/Application/Entity/FluxFileout.php | 407 +++++++ .../Repository/FluxFileinRepository.php | 8 + .../Repository/FluxFileoutRepository.php | 20 + module/PhpSettings/Module.php | 63 + module/PhpSettings/config/module.config.php | 2 + 34 files changed, 2743 insertions(+), 89 deletions(-) delete mode 100644 application/Bootstrap.php delete mode 100644 application/configs/README delete mode 100644 application/models/Sdv1FluxFileIn.php delete mode 100644 application/models/Sdv1FluxFileOut.php create mode 100644 cli.php create mode 100644 config/application.config.php create mode 100644 config/autoload/.gitignore create mode 100644 config/autoload/README.md create mode 100644 config/autoload/doctrine.global.php create mode 100644 config/autoload/doctrine.local.php.dist create mode 100644 config/autoload/global.php create mode 100644 config/autoload/local.php.dist create mode 100644 config/autoload/presta.global.php create mode 100644 data/cache/.gitignore create mode 100644 doc/README-DEV rename README-FTP-USE => doc/README-FTP-USE (100%) rename README-SFTP-USE => doc/README-SFTP-USE (100%) create mode 100644 doc/TODO create mode 100644 init_autoloader.php create mode 100644 module/Application/Module.php create mode 100644 module/Application/config/module.config.php create mode 100644 module/Application/src/Application/Controller/ConfigController.php create mode 100644 module/Application/src/Application/Controller/FileController.php create mode 100644 module/Application/src/Application/Controller/FileControllerFactory.php create mode 100644 module/Application/src/Application/Controller/IndexController.php create mode 100644 module/Application/src/Application/Entity/FluxFilein.php create mode 100644 module/Application/src/Application/Entity/FluxFileout.php create mode 100644 module/Application/src/Application/Repository/FluxFileinRepository.php create mode 100644 module/Application/src/Application/Repository/FluxFileoutRepository.php create mode 100644 module/PhpSettings/Module.php create mode 100644 module/PhpSettings/config/module.config.php diff --git a/.gitignore b/.gitignore index ca21e90..ea59ac2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /.settings/ /.buildpath /.project +/vendor/ diff --git a/application/Bootstrap.php b/application/Bootstrap.php deleted file mode 100644 index f4aeadd..0000000 --- a/application/Bootstrap.php +++ /dev/null @@ -1,41 +0,0 @@ -getOptions()); - Zend_Registry::set('config', $config); - - return $config; - } - - protected function _initDb() - { - $c = Zend_Registry::get('config'); - try { - $db = Zend_Db::factory($c->profil->db->metier); - } catch ( Exception $e ) { - echo "Database !\n"; - exit; - } - - /** - * Set the default adapter to use with all model - */ - Zend_Db_Table::setDefaultAdapter($db); - } - - protected function _initCache() - { - /*if ( APPLICATION_ENV!='development' ) { - //MetadataCache pour la base de données - $frontendOptions = array( - 'lifetime' => 14400, - 'automatic_serialization' => true - ); - $backendOptions = array(); - $cache = Zend_Cache::factory('Core','Apc', $frontendOptions, $backendOptions); - Zend_Db_Table_Abstract::setDefaultMetadataCache($cache); - }*/ - } -} \ No newline at end of file diff --git a/application/configs/README b/application/configs/README deleted file mode 100644 index e69de29..0000000 diff --git a/application/models/Sdv1FluxFileIn.php b/application/models/Sdv1FluxFileIn.php deleted file mode 100644 index 82b8462..0000000 --- a/application/models/Sdv1FluxFileIn.php +++ /dev/null @@ -1,6 +0,0 @@ -run(); diff --git a/composer.json b/composer.json index ceed26e..928df48 100644 --- a/composer.json +++ b/composer.json @@ -1,18 +1,15 @@ { - "name": "scores/batchflux", - "description": "Gestion des flux", + "name": "zendframework/skeleton-application", + "description": "Skeleton Application for ZF2", + "license": "BSD-3-Clause", + "keywords": [ + "framework", + "zf2" + ], + "homepage": "http://framework.zend.com/", "require": { - "zendframework/zendframework1": "^1.12" - }, - "autoload": { - "classmap": [ - "application/" - ] - }, - "authors": [ - { - "name": "Scores et Decisions", - "email": "supportdev@scores-decisions.com" - } - ] + "php": ">=5.3.3", + "zendframework/zendframework": "2.4.10", + "doctrine/doctrine-orm-module": "dev-master" + } } diff --git a/composer.lock b/composer.lock index fe41cf1..b99393e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,63 +4,1056 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "024fc28c980a3c725595a65740d6758f", - "content-hash": "642e41c0ee74abf61b061b3992d6b73e", + "hash": "59c85216e432b1d4f39132fb41b67d86", + "content-hash": "7dd3f736a6f896ffb8424ca43b684087", "packages": [ { - "name": "zendframework/zendframework1", - "version": "1.12.16", + "name": "doctrine/annotations", + "version": "v1.2.7", "source": { "type": "git", - "url": "https://github.com/zendframework/zf1.git", - "reference": "8a3c471ef0a337d303cd5ae578e64c2ba1d2c025" + "url": "https://github.com/doctrine/annotations.git", + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zf1/zipball/8a3c471ef0a337d303cd5ae578e64c2ba1d2c025", - "reference": "8a3c471ef0a337d303cd5ae578e64c2ba1d2c025", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", "shasum": "" }, "require": { - "php": ">=5.2.11" + "doctrine/lexer": "1.*", + "php": ">=5.3.2" }, "require-dev": { - "phpunit/dbunit": "1.3.*", - "phpunit/phpunit": "3.7.*" + "doctrine/cache": "1.*", + "phpunit/phpunit": "4.*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { "psr-0": { - "Zend_": "library/" + "Doctrine\\Common\\Annotations\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "library/" + "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": "2015-08-31 12:32:49" + }, + { + "name": "doctrine/cache", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "f8af318d14bdb0eff0336795b428b547bd39ccb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/f8af318d14bdb0eff0336795b428b547bd39ccb6", + "reference": "f8af318d14bdb0eff0336795b428b547bd39ccb6", + "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": "2015-12-31 16:37:02" + }, + { + "name": "doctrine/collections", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.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": "2015-04-14 22:21:58" + }, + { + "name": "doctrine/common", + "version": "v2.6.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/common.git", + "reference": "a579557bc689580c19fee4e27487a67fe60defc0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/common/zipball/a579557bc689580c19fee4e27487a67fe60defc0", + "reference": "a579557bc689580c19fee4e27487a67fe60defc0", + "shasum": "" + }, + "require": { + "doctrine/annotations": "1.*", + "doctrine/cache": "1.*", + "doctrine/collections": "1.*", + "doctrine/inflector": "1.*", + "doctrine/lexer": "1.*", + "php": "~5.5|~7.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8|~5.0" + }, + "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": "2015-12-25 13:18:31" + }, + { + "name": "doctrine/dbal", + "version": "v2.5.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "abbdfd1cff43a7b99d027af3be709bc8fc7d4769" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/abbdfd1cff43a7b99d027af3be709bc8fc7d4769", + "reference": "abbdfd1cff43a7b99d027af3be709bc8fc7d4769", + "shasum": "" + }, + "require": { + "doctrine/common": ">=2.4,<2.7-dev", + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "symfony/console": "2.*" + }, + "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": "2016-01-05 22:11:12" + }, + { + "name": "doctrine/doctrine-module", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/DoctrineModule.git", + "reference": "ade6c1667283e3d8131d40e79c427b8a8100e7d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/DoctrineModule/zipball/ade6c1667283e3d8131d40e79c427b8a8100e7d3", + "reference": "ade6c1667283e3d8131d40e79c427b8a8100e7d3", + "shasum": "" + }, + "require": { + "doctrine/cache": "~1.5", + "doctrine/common": "~2.6", + "php": "^5.5 || ^7.0", + "symfony/console": "~2.3|~3.0", + "zendframework/zend-authentication": "~2.3", + "zendframework/zend-cache": "~2.3", + "zendframework/zend-mvc": "~2.3", + "zendframework/zend-paginator": "~2.3", + "zendframework/zend-servicemanager": "~2.3", + "zendframework/zend-stdlib": "~2.3", + "zendframework/zend-validator": "~2.3" + }, + "require-dev": { + "doctrine/coding-standard": "dev-master", + "phpunit/phpunit": "~4.0", + "zendframework/zendframework": "~2.3" + }, + "suggest": { + "doctrine/data-fixtures": "Data Fixtures if you want to generate test data or bootstrap data for your deployments" + }, + "bin": [ + "bin/doctrine-module" + ], + "type": "library", + "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 2 Module that provides Doctrine basic functionality required for ORM and ODM modules", + "homepage": "http://www.doctrine-project.org/", + "keywords": [ + "doctrine", + "module", + "zf2" + ], + "time": "2016-03-21 22:50:01" + }, + { + "name": "doctrine/doctrine-orm-module", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/doctrine/DoctrineORMModule.git", + "reference": "50808eb795d00aac6a551023b1bb379de054f9b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/DoctrineORMModule/zipball/50808eb795d00aac6a551023b1bb379de054f9b5", + "reference": "50808eb795d00aac6a551023b1bb379de054f9b5", + "shasum": "" + }, + "require": { + "doctrine/dbal": ">=2.4,<2.7", + "doctrine/doctrine-module": "~1.0", + "doctrine/orm": ">=2.5,<2.7", + "php": "^5.5 || ^7.0", + "symfony/console": "~2.5|~3.0", + "zendframework/zend-mvc": "~2.3", + "zendframework/zend-servicemanager": "~2.3", + "zendframework/zend-stdlib": "~2.3" + }, + "require-dev": { + "doctrine/data-fixtures": "1.0.*", + "doctrine/migrations": "1.0.*@dev", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2", + "zendframework/zend-developer-tools": "*", + "zendframework/zendframework": "~2.3" + }, + "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", + "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 2 Module that provides Doctrine ORM functionality", + "homepage": "http://www.doctrine-project.org/", + "keywords": [ + "doctrine", + "module", + "orm", + "zf2" + ], + "time": "2016-03-22 00:43:08" + }, + { + "name": "doctrine/inflector", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", + "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Inflector\\": "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": "Common String Manipulations with regard to casing and singular/plural rules.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string" + ], + "time": "2015-11-06 14:35:42" + }, + { + "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-14 21:17:01" + }, + { + "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-09 13:34:57" + }, + { + "name": "doctrine/orm", + "version": "v2.5.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/doctrine2.git", + "reference": "bc4ddbfb0114cb33438cc811c9a740d8aa304aab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/bc4ddbfb0114cb33438cc811c9a740d8aa304aab", + "reference": "bc4ddbfb0114cb33438cc811c9a740d8aa304aab", + "shasum": "" + }, + "require": { + "doctrine/cache": "~1.4", + "doctrine/collections": "~1.2", + "doctrine/common": ">=2.5-dev,<2.7-dev", + "doctrine/dbal": ">=2.5-dev,<2.6-dev", + "doctrine/instantiator": "~1.0.1", + "ext-pdo": "*", + "php": ">=5.4", + "symfony/console": "~2.5|~3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "symfony/yaml": "~2.3|~3.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": "2016-01-05 21:34:58" + }, + { + "name": "symfony/console", + "version": "v3.1.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "64a4d43b045f07055bb197650159769604cb2a92" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/64a4d43b045f07055bb197650159769604cb2a92", + "reference": "64a4d43b045f07055bb197650159769604cb2a92", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-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": "2016-06-14 11:18:07" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "dff51f72b0706335131b00a7f49606168c582594" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", + "reference": "dff51f72b0706335131b00a7f49606168c582594", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-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": "2016-05-18 14:26:46" + }, + { + "name": "zendframework/zendframework", + "version": "2.4.10", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zendframework.git", + "reference": "7e5bdc38820aef518c1c49d4b6e8fcb0083b165b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zendframework/zipball/7e5bdc38820aef518c1c49d4b6e8fcb0083b165b", + "reference": "7e5bdc38820aef518c1c49d4b6e8fcb0083b165b", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zendxml": "^1.0.1" + }, + "replace": { + "zendframework/zend-authentication": "self.version", + "zendframework/zend-barcode": "self.version", + "zendframework/zend-cache": "self.version", + "zendframework/zend-captcha": "self.version", + "zendframework/zend-code": "self.version", + "zendframework/zend-config": "self.version", + "zendframework/zend-console": "self.version", + "zendframework/zend-crypt": "self.version", + "zendframework/zend-db": "self.version", + "zendframework/zend-debug": "self.version", + "zendframework/zend-di": "self.version", + "zendframework/zend-dom": "self.version", + "zendframework/zend-escaper": "self.version", + "zendframework/zend-eventmanager": "self.version", + "zendframework/zend-feed": "self.version", + "zendframework/zend-file": "self.version", + "zendframework/zend-filter": "self.version", + "zendframework/zend-form": "self.version", + "zendframework/zend-http": "self.version", + "zendframework/zend-i18n": "self.version", + "zendframework/zend-inputfilter": "self.version", + "zendframework/zend-json": "self.version", + "zendframework/zend-ldap": "self.version", + "zendframework/zend-loader": "self.version", + "zendframework/zend-log": "self.version", + "zendframework/zend-mail": "self.version", + "zendframework/zend-math": "self.version", + "zendframework/zend-memory": "self.version", + "zendframework/zend-mime": "self.version", + "zendframework/zend-modulemanager": "self.version", + "zendframework/zend-mvc": "self.version", + "zendframework/zend-navigation": "self.version", + "zendframework/zend-paginator": "self.version", + "zendframework/zend-permissions-acl": "self.version", + "zendframework/zend-permissions-rbac": "self.version", + "zendframework/zend-progressbar": "self.version", + "zendframework/zend-resources": "self.version", + "zendframework/zend-serializer": "self.version", + "zendframework/zend-server": "self.version", + "zendframework/zend-servicemanager": "self.version", + "zendframework/zend-session": "self.version", + "zendframework/zend-soap": "self.version", + "zendframework/zend-stdlib": "self.version", + "zendframework/zend-tag": "self.version", + "zendframework/zend-test": "self.version", + "zendframework/zend-text": "self.version", + "zendframework/zend-uri": "self.version", + "zendframework/zend-validator": "self.version", + "zendframework/zend-version": "self.version", + "zendframework/zend-view": "self.version", + "zendframework/zend-xmlrpc": "self.version" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "fabpot/php-cs-fixer": "~1.0", + "ircmaxell/random-lib": "~1.1", + "mikey179/vfsstream": "~1.2", + "phpunit/phpcov": "~2.0", + "phpunit/phpunit": "~4.6", + "satooshi/php-coveralls": "dev-master" + }, + "suggest": { + "doctrine/annotations": "Doctrine Annotations >=1.0 for annotation features", + "ext-intl": "ext/intl for i18n features (included in default builds of PHP)", + "ircmaxell/random-lib": "Fallback random byte generator for Zend\\Math\\Rand if OpenSSL/Mcrypt extensions are unavailable", + "ocramius/proxy-manager": "ProxyManager 0.5.* to handle lazy initialization of services", + "zendframework/zendpdf": "ZendPdf for creating PDF representations of barcodes", + "zendframework/zendservice-recaptcha": "ZendService\\ReCaptcha for rendering ReCaptchas in Zend\\Captcha and/or Zend\\Form" + }, + "bin": [ + "bin/classmap_generator.php", + "bin/pluginmap_generator.php", + "bin/templatemap_generator.php" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev", + "dev-develop": "2.5-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\": "library/Zend/" + } + }, + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "Zend Framework 1", + "description": "Zend Framework 2", "homepage": "http://framework.zend.com/", "keywords": [ - "ZF1", - "framework" + "framework", + "zf2" ], - "time": "2015-09-15 15:49:51" + "time": "2016-05-09 20:54:25" + }, + { + "name": "zendframework/zendxml", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/ZendXml.git", + "reference": "7b64507bc35d841c9c5802d67f6f87ef8e1a58c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/ZendXml/zipball/7b64507bc35d841c9c5802d67f6f87ef8e1a58c9", + "reference": "7b64507bc35d841c9c5802d67f6f87ef8e1a58c9", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^3.7 || ^4.0", + "squizlabs/php_codesniffer": "^1.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "ZendXml\\": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Utility library for XML usage, best practices, and security in PHP", + "homepage": "http://packages.zendframework.com/", + "keywords": [ + "security", + "xml", + "zf2" + ], + "time": "2016-02-04 21:02:08" } ], "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "doctrine/doctrine-orm-module": 20 + }, "prefer-stable": false, "prefer-lowest": false, - "platform": [], + "platform": { + "php": ">=5.3.3" + }, "platform-dev": [] } diff --git a/config/application.config.php b/config/application.config.php new file mode 100644 index 0000000..c41ba93 --- /dev/null +++ b/config/application.config.php @@ -0,0 +1,66 @@ + array( + 'DoctrineModule', + 'DoctrineORMModule', + 'Application', + ), + + // These are various options for the listeners attached to the ModuleManager + 'module_listener_options' => array( + // This should be an array of paths in which modules reside. + // If a string key is provided, the listener will consider that a module + // namespace, the value of that key the specific path to that module's + // Module class. + 'module_paths' => array( + './module', + './vendor', + ), + + // An array of paths from which to glob configuration files after + // modules are loaded. These effectively override configuration + // provided by modules themselves. Paths may use GLOB_BRACE notation. + 'config_glob_paths' => array( + 'config/autoload/{,*.}{global,local}.php', + ), + + // Whether or not to enable a configuration cache. + // If enabled, the merged configuration will be cached and used in + // subsequent requests. + //'config_cache_enabled' => $booleanValue, + + // The key used to create the configuration cache file name. + //'config_cache_key' => $stringKey, + + // Whether or not to enable a module class map cache. + // If enabled, creates a module class map cache which will be used + // by in future requests, to reduce the autoloading process. + //'module_map_cache_enabled' => $booleanValue, + + // The key used to create the class map cache file name. + //'module_map_cache_key' => $stringKey, + + // The path in which to cache merged configuration. + //'cache_dir' => $stringPath, + + // Whether or not to enable modules dependency checking. + // Enabled by default, prevents usage of modules that depend on other modules + // that weren't loaded. + // 'check_dependencies' => true, + ), + + // Used to create an own service manager. May contain one or more child arrays. + //'service_listener_options' => array( + // array( + // 'service_manager' => $stringServiceManagerName, + // 'config_key' => $stringConfigKey, + // 'interface' => $stringOptionalInterface, + // 'method' => $stringRequiredMethodName, + // ), + // ) + + // Initial configuration with which to seed the ServiceManager. + // Should be compatible with Zend\ServiceManager\Config. + // 'service_manager' => array(), +); diff --git a/config/autoload/.gitignore b/config/autoload/.gitignore new file mode 100644 index 0000000..1a83fda --- /dev/null +++ b/config/autoload/.gitignore @@ -0,0 +1,2 @@ +local.php +*.local.php diff --git a/config/autoload/README.md b/config/autoload/README.md new file mode 100644 index 0000000..4e504db --- /dev/null +++ b/config/autoload/README.md @@ -0,0 +1,8 @@ +About this directory: +===================== + +By default, this application is configured to load all configs in +`./config/autoload/{,*.}{global,local}.php`. Doing this provides a +location for a developer to drop in configuration override files provided by +modules, as well as cleanly provide individual, application-wide config files +for things like database connections, etc. diff --git a/config/autoload/doctrine.global.php b/config/autoload/doctrine.global.php new file mode 100644 index 0000000..8ba81d6 --- /dev/null +++ b/config/autoload/doctrine.global.php @@ -0,0 +1,3 @@ + array( + 'connection' => array( + // default connection name + 'orm_default' => array( + 'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', + 'params' => array( + 'host' => 'localhost', + 'port' => '3306', + 'dbname' => 'dbname', + 'charset' => 'utf8', + 'user' => 'user', + 'password' => 'password', + ), + // To automatically convert enum to string + 'doctrine_type_mappings' => array( + 'enum' => 'string' + ), + ), + ), + ), +); \ No newline at end of file diff --git a/config/autoload/global.php b/config/autoload/global.php new file mode 100644 index 0000000..104762e --- /dev/null +++ b/config/autoload/global.php @@ -0,0 +1,16 @@ + array( + 'sfrbtr' => array( + 'prestations' => array( + array( + 'name' => 'FICH_RCE', + 'type' => 'SFTP', + 'in' => array( + 'CopyDeleteAfter' => true, + ), + 'out' => array(), + ), + ), + ), + 'gefacto' => array( + 'prestations' => array( + array( + 'name' => 'GEFACTO', + 'type' => 'SFTP', + 'in' => array( + 'RunWithEndFile' => true, + 'CopyAddDate' => true, + 'CopyDeleteAfter' => true, + ), + 'out' => array(), + ), + ), + ), + 'fransbonhomme' => array( + 'prestations' => array( + array( + 'name' => 'RAPPORT', + 'type' => 'FTP', + 'in' => array( + 'CopyDeleteAfter' => true, + ), + 'out' => array(), + ), + ), + ), + 'bilansext' => array( + 'prestations' => array( + array( + 'name' => 'EXTRANET', + 'type' => 'FTP', + 'in' => array( + 'CopyDeleteAfter' => true, + ), + 'out' => array(), + ), + ), + ), + 'rrg' => array( + 'prestations' => array( + array( + 'name' => 'HEXAVIA', + 'type' => 'FTP', + 'in' => array(), + 'out' => array(), + ), + ), + ), + 'jalpdfsed' => array( + 'prestations' => array( + array( + 'name' => 'PDF', + 'type' => 'FTP', + 'in' => array( + 'CopyDeleteAfter' => true, + ), + 'out' => array(), + ), + ), + ), + 'orone' => array( + 'prestations' => array( + array( + 'name' => 'XML', + 'type' => 'FTP', + 'in' => array(), + 'out' => array(), + ), + array( + 'name' => 'PDF', + 'type' => 'FTP', + 'in' => array(), + 'out' => array(), + ), + ), + ), + 'vwbank' => array( + 'prestations' => array( + array( + 'name' => 'SURBODPRDCFTVWBANK19300', + 'type' => 'FTP', + 'in' => array( + 'FilterName' => true, + 'Route' => array( 'cp' => '/home/data/clients-ftp/vwbank/send' ), + 'CopyDeleteAfter' => true, + ), + 'out' => array(), + ), + array( + 'name' => 'SURBODPRDCFTVWBENG', + 'type' => 'FTP', + 'in' => array( + 'FilterName' => true, + 'Route' => array( 'cp' => '/home/data/clients-ftp/vwbank/send' ), + 'CopyDeleteAfter' => true, + ), + 'out' => array(), + ), + ), + ), + 'futur' => array( + 'prestations' => array( + array( + 'name' => 'SURBODPRDFTPSFRFUTUR', + 'type' => 'FTP', + 'in' => array( + 'Route' => array( 'cp' => '/home/data/clients-ftp/futur/send' ), + 'CopyDeleteAfter' => true, + ), + 'out' => array(), + ), + ), + ), + 'fboissons' => array( + 'prestations' => array( + array( + 'name' => 'SCOREETDECISION', + 'type' => 'FTP', + 'in' => array( + 'Route' => array( 'cp' => '/home/data/clients-ftp/fboissons/send' ), + 'CopyDeleteAfter' => true, + ), + 'out' => array(), + ), + ), + ), + 'effico' => array( + 'prestations' => array( + array( + 'name' => 'DIFBODPRDSFTPEFFICO', + 'type' => 'SFTP', + 'in' => array(), + 'out' => array(), + ), + ), + ), + 'sofid' => array( + 'prestations' => array( + array( + 'name' => 'SURBODPRDFTSSOFID', + 'type' => 'FTP', + 'in' => array( + 'Route' => array( 'cp' => '/home/data/clients-ftp/sofid/send' ), + 'CopyDeleteAfter' => true, + ), + 'out' => array(), + ), + ), + ), + ), +); diff --git a/data/cache/.gitignore b/data/cache/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/data/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/doc/README-DEV b/doc/README-DEV new file mode 100644 index 0000000..139597f --- /dev/null +++ b/doc/README-DEV @@ -0,0 +1,2 @@ + + diff --git a/README-FTP-USE b/doc/README-FTP-USE similarity index 100% rename from README-FTP-USE rename to doc/README-FTP-USE diff --git a/README-SFTP-USE b/doc/README-SFTP-USE similarity index 100% rename from README-SFTP-USE rename to doc/README-SFTP-USE diff --git a/doc/TODO b/doc/TODO new file mode 100644 index 0000000..58b609b --- /dev/null +++ b/doc/TODO @@ -0,0 +1,64 @@ +client + prestations + prestation + name + type + in + options + schedule + adapter + name + params + entityClass (repository with getNotSent) + out + options + schedule + adapter + name + params + entityClass + + + +PrestaManager (serviceLocator, array config) + + queue + + deliverAll ( type ) + + deliver ( ) + + isSchedule () + + collect ( type ) + foreach prestation + getEntity + createQueue With entity + + getEntity ( entity ) + return entity + + createQueue ( ) + + + +Créer une liste des éléments à traiter +Flux (delivery, entity) + + done () { + $this->entity->done() + } + + send () { + $this->delivery->send() + } + + +Delivery (Filesystem adapter, string file) + adapter + file + send () { + $this->adapter->copy($this->file) + } + + diff --git a/init_autoloader.php b/init_autoloader.php new file mode 100644 index 0000000..befbd08 --- /dev/null +++ b/init_autoloader.php @@ -0,0 +1,54 @@ +add('Zend', $zf2Path); + $loader->add('ZendXml', $zf2Path); + } else { + include $zf2Path . '/Zend/Loader/AutoloaderFactory.php'; + Zend\Loader\AutoloaderFactory::factory(array( + 'Zend\Loader\StandardAutoloader' => array( + 'autoregister_zf' => true + ) + )); + } +} + +if (!class_exists('Zend\Loader\AutoloaderFactory')) { + throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.'); +} diff --git a/module/Application/Module.php b/module/Application/Module.php new file mode 100644 index 0000000..628443e --- /dev/null +++ b/module/Application/Module.php @@ -0,0 +1,69 @@ +getApplication()->getEventManager(); + $moduleRouteListener = new ModuleRouteListener(); + $moduleRouteListener->attach($eventManager); + } + + public function getConfig() + { + return include __DIR__ . '/config/module.config.php'; + } + + public function getAutoloaderConfig() + { + return array( + 'Zend\Loader\StandardAutoloader' => array( + 'namespaces' => array( + __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, + ), + ), + ); + } + + public function getConsoleUsage(Console $console) + { + return array( + "Detect event on file", + 'recv [--debug] ' => "Action sur évenement reception (SD => Client)", + 'send [--debug] ' => "Action sur évenement envoi (Client => SD)", + 'read [--debug] ' => "Action sur évenenent lecture fichier", + 'tck [--debug] ' => "Action sur réception fichier .tck (Transfert ChecK)", + 'clean --cron [--verbose|-v]' => "Nettoyage des repertoires", + 'trigger event ' => "Trigger sur tous les evenemets", + 'fallback --cron [--verbose|-v]' => + "Fallback de distribution de fichier si la dectection par event échoue", + + "Configuration", + 'config [--debug] incron ' => "Créer la configuration incron.d", + 'config [--debug] cron' => "Créer la crontab", + + array( 'filepath', "chemin complet du fichier" ), + array( '--debug', "(optional) turn on debug mode" ), + array( '--verbose|-v', "(optional) turn on verbose mode" ), + ); + } +} diff --git a/module/Application/config/module.config.php b/module/Application/config/module.config.php new file mode 100644 index 0000000..749f5c3 --- /dev/null +++ b/module/Application/config/module.config.php @@ -0,0 +1,173 @@ + array( + 'routes' => array( + 'home' => array( + 'type' => 'Zend\Mvc\Router\Http\Literal', + 'options' => array( + 'route' => '/', + 'defaults' => array( + 'controller' => 'Application\Controller\Index', + 'action' => 'index', + ), + ), + ), + // The following is a route to simplify getting started creating + // new controllers and actions without needing to create a new + // module. Simply drop new controllers in, and you can access them + // using the path /application/:controller/:action + 'application' => array( + 'type' => 'Literal', + 'options' => array( + 'route' => '/application', + 'defaults' => array( + '__NAMESPACE__' => 'Application\Controller', + 'controller' => 'Index', + 'action' => 'index', + ), + ), + 'may_terminate' => true, + 'child_routes' => array( + 'default' => array( + 'type' => 'Segment', + 'options' => array( + 'route' => '/[:controller[/:action]]', + 'constraints' => array( + 'controller' => '[a-zA-Z][a-zA-Z0-9_-]*', + 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', + ), + 'defaults' => array( + ), + ), + ), + ), + ), + ), + ), + 'service_manager' => array( + 'abstract_factories' => array( + 'Zend\Cache\Service\StorageCacheAbstractServiceFactory', + 'Zend\Log\LoggerAbstractServiceFactory', + ), + 'aliases' => array( + 'translator' => 'MvcTranslator', + ), + ), + 'controllers' => array( + 'invokables' => array( + 'Application\Controller\Config' => 'Application\Controller\ConfigController', + ), + 'factories' => array( + 'Application\Controller\File' => 'Application\Controller\FileControllerFactory', + ), + ), + 'view_manager' => array( + 'display_not_found_reason' => true, + 'display_exceptions' => true, + 'doctype' => 'HTML5', + 'not_found_template' => 'error/404', + 'exception_template' => 'error/index', + 'template_map' => array( + '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', + ), + 'template_path_stack' => array( + __DIR__ . '/../view', + ), + ), + // Placeholder for console routes + 'console' => array( + 'router' => array( + 'routes' => array( + 'file-read' => array( + 'options' => array( + 'route' => 'read [--verbose|-v] [--dry-run|-n] ', + 'defaults' => array( + 'controller' => 'Application\Controller\File', + 'action' => 'read' + ), + ), + ), + 'file-tck' => array( + 'options' => array( + 'route' => 'tck [--verbose|-v] [--dry-run|-n] ', + 'defaults' => array( + 'controller' => 'Application\Controller\File', + 'action' => 'tck' + ), + ), + ), + 'file-recv' => array( + 'options' => array( + 'route' => 'recv [--verbose|-v] [--dry-run|-n] ', + 'defaults' => array( + 'controller' => 'Application\Controller\File', + 'action' => 'recv' + ), + ), + ), + 'file-send' => array( + 'options' => array( + 'route' => 'send [--verbose|-v] [--dry-run|-n] ', + 'defaults' => array( + 'controller' => 'Application\Controller\File', + 'action' => 'send' + ), + ), + ), + 'file-trigger' => array( + 'options' => array( + 'route' => 'trigger [--verbose|-v] [--dry-run|-n] event ', + 'defaults' => array( + 'controller' => 'Application\Controller\File', + 'action' => 'trigger' + ), + ), + ), + 'file-fallback' => array( + 'options' => array( + 'route' => 'fallback [--verbose|-v] [--dry-run|-n] --cron', + 'defaults' => array( + 'controller' => 'Application\Controller\File', + 'action' => 'fallback' + ), + ), + ), + 'config-incron' => array( + 'options' => array( + 'route' => 'config [--verbose|-v] incron ', + 'defaults' => array( + 'controller' => 'Application\Controller\Config', + 'action' => 'incron' + ), + ), + ), + ), + ), + ), + // Doctrine + 'doctrine' => array( + 'driver' => array( + 'Application_driver' => array( + 'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver', + 'cache' => 'array', + 'paths' => array(__DIR__ . '/../src/Application/Entity'), + ), + 'orm_default' => array( + 'drivers' => array( + 'Application\Entity' => 'Application_driver', + ), + ), + ), + ), +); diff --git a/module/Application/src/Application/Controller/ConfigController.php b/module/Application/src/Application/Controller/ConfigController.php new file mode 100644 index 0000000..0cc95e6 --- /dev/null +++ b/module/Application/src/Application/Controller/ConfigController.php @@ -0,0 +1,25 @@ +getRequest(); + + // Make sure that we are running in a console and the user has not tricked our + // application into running this action from a public web server. + if (!$request instanceof ConsoleRequest){ + throw new \RuntimeException('You can only use this action from a console!'); + } + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Controller/FileController.php b/module/Application/src/Application/Controller/FileController.php new file mode 100644 index 0000000..4f74170 --- /dev/null +++ b/module/Application/src/Application/Controller/FileController.php @@ -0,0 +1,147 @@ +console = $console; + $this->appConfig = $appConfig; + } + + /** + * {@inheritdoc} + * @param RequestInterface $request + * @param ResponseInterface $response + * @return mixed|ResponseInterface + * @throws \RuntimeException + */ + public function dispatch(RequestInterface $request, ResponseInterface $response = null) + { + if (!($request instanceof ConsoleRequest)) { + throw new \RuntimeException('You can use this controller only from a console!'); + } + + return parent::dispatch($request, $response); + } + + /** + * Fichier SD => Client + * Depot d'un fichier dans le repertoire client du FTP (recv) + */ + public function recvAction() + { + $request = $this->getRequest(); + $verbose = $request->getParam('verbose', false) || $request->getParam('v', false); + + // Get file not sent + $em = $this->getServiceLocator()->get('Doctrine\ORM\EntityManager'); + $results = $em->getRepository('Application\Entity\FluxFileout')->getNotSent(); + if (count($results) == 0) { + $this->output("Rien à traiter.", $verbose); + } else { + foreach($results as $result) { + + + + + echo $result->getFileout(); + $this->output("", $verbose); + } + } + $this->output("", $verbose); + } + + /** + * flux_fileout + */ + public function readAction() + { + $request = $this->getRequest(); + $verbose = $request->getParam('verbose', false) || $request->getParam('v', false); + $dryrun = $request->getParam('dry-run', false) || $request->getParam('n', false); + + } + + /** + * flux_fileout + */ + public function tckAction() + { + $request = $this->getRequest(); + $verbose = $request->getParam('verbose', false) || $request->getParam('v', false); + $dryrun = $request->getParam('dry-run', false) || $request->getParam('n', false); + } + + /** + * flux_fileout + */ + public function cleanAction() + { + $request = $this->getRequest(); + $verbose = $request->getParam('verbose', false) || $request->getParam('v', false); + $dryrun = $request->getParam('dry-run', false) || $request->getParam('n', false); + } + + /** + * flux_fileout + */ + public function triggerAction() + { + $request = $this->getRequest(); + $verbose = $request->getParam('verbose', false) || $request->getParam('v', false); + $dryrun = $request->getParam('dry-run', false) || $request->getParam('n', false); + } + + /** + * flux_filein + */ + public function sendAction() + { + $request = $this->getRequest(); + $verbose = $request->getParam('verbose', false) || $request->getParam('v', false); + $dryrun = $request->getParam('dry-run', false) || $request->getParam('n', false); + } + + /** + * flux_filein + */ + public function fallbackAction() + { + $request = $this->getRequest(); + $verbose = $request->getParam('verbose', false) || $request->getParam('v', false); + $dryrun = $request->getParam('dry-run', false) || $request->getParam('n', false); + } + + /** + * Outputs given $line if $verbose i truthy value. + * @param $line + * @param bool $verbose verbose flag, default true + */ + protected function output($line, $verbose = true) + { + if ($verbose) { + $this->console->writeLine($line); + } + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Controller/FileControllerFactory.php b/module/Application/src/Application/Controller/FileControllerFactory.php new file mode 100644 index 0000000..6f35103 --- /dev/null +++ b/module/Application/src/Application/Controller/FileControllerFactory.php @@ -0,0 +1,18 @@ +getServiceLocator(); + $console = $serviceLocator->get('Console'); + $appConfig = $serviceLocator->get('config'); + + return new FileController($console, $appConfig); + } +} diff --git a/module/Application/src/Application/Controller/IndexController.php b/module/Application/src/Application/Controller/IndexController.php new file mode 100644 index 0000000..97d146c --- /dev/null +++ b/module/Application/src/Application/Controller/IndexController.php @@ -0,0 +1,21 @@ +id; + } + + /** + * Set client + * + * @param string $client + * + * @return FluxFilein + */ + public function setClient($client) + { + $this->client = $client; + + return $this; + } + + /** + * Get client + * + * @return string + */ + public function getClient() + { + return $this->client; + } + + /** + * Set name + * + * @param string $name + * + * @return FluxFilein + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set depottype + * + * @param string $depottype + * + * @return FluxFilein + */ + public function setDepottype($depottype) + { + $this->depottype = $depottype; + + return $this; + } + + /** + * Get depottype + * + * @return string + */ + public function getDepottype() + { + return $this->depottype; + } + + /** + * Set depotdate + * + * @param \DateTime $depotdate + * + * @return FluxFilein + */ + public function setDepotdate($depotdate) + { + $this->depotdate = $depotdate; + + return $this; + } + + /** + * Get depotdate + * + * @return \DateTime + */ + public function getDepotdate() + { + return $this->depotdate; + } + + /** + * Set depotfile + * + * @param string $depotfile + * + * @return FluxFilein + */ + public function setDepotfile($depotfile) + { + $this->depotfile = $depotfile; + + return $this; + } + + /** + * Get depotfile + * + * @return string + */ + public function getDepotfile() + { + return $this->depotfile; + } + + /** + * Set depotfilesize + * + * @param integer $depotfilesize + * + * @return FluxFilein + */ + public function setDepotfilesize($depotfilesize) + { + $this->depotfilesize = $depotfilesize; + + return $this; + } + + /** + * Get depotfilesize + * + * @return integer + */ + public function getDepotfilesize() + { + return $this->depotfilesize; + } + + /** + * Set nblines + * + * @param integer $nblines + * + * @return FluxFilein + */ + public function setNblines($nblines) + { + $this->nblines = $nblines; + + return $this; + } + + /** + * Get nblines + * + * @return integer + */ + public function getNblines() + { + return $this->nblines; + } + + /** + * Set dateinsert + * + * @param \DateTime $dateinsert + * + * @return FluxFilein + */ + public function setDateinsert($dateinsert) + { + $this->dateinsert = $dateinsert; + + return $this; + } + + /** + * Get dateinsert + * + * @return \DateTime + */ + public function getDateinsert() + { + return $this->dateinsert; + } + + /** + * Set dateexecute + * + * @param \DateTime $dateexecute + * + * @return FluxFilein + */ + public function setDateexecute($dateexecute) + { + $this->dateexecute = $dateexecute; + + return $this; + } + + /** + * Get dateexecute + * + * @return \DateTime + */ + public function getDateexecute() + { + return $this->dateexecute; + } +} diff --git a/module/Application/src/Application/Entity/FluxFileout.php b/module/Application/src/Application/Entity/FluxFileout.php new file mode 100644 index 0000000..365154f --- /dev/null +++ b/module/Application/src/Application/Entity/FluxFileout.php @@ -0,0 +1,407 @@ +id; + } + + /** + * Set client + * + * @param string $client + * + * @return FluxFileout + */ + public function setClient($client) + { + $this->client = $client; + + return $this; + } + + /** + * Get client + * + * @return string + */ + public function getClient() + { + return $this->client; + } + + /** + * Set name + * + * @param string $name + * + * @return FluxFileout + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set nblines + * + * @param integer $nblines + * + * @return FluxFileout + */ + public function setNblines($nblines) + { + $this->nblines = $nblines; + + return $this; + } + + /** + * Get nblines + * + * @return integer + */ + public function getNblines() + { + return $this->nblines; + } + + /** + * Set datebegin + * + * @param \DateTime $datebegin + * + * @return FluxFileout + */ + public function setDatebegin($datebegin) + { + $this->datebegin = $datebegin; + + return $this; + } + + /** + * Get datebegin + * + * @return \DateTime + */ + public function getDatebegin() + { + return $this->datebegin; + } + + /** + * Set dateend + * + * @param \DateTime $dateend + * + * @return FluxFileout + */ + public function setDateend($dateend) + { + $this->dateend = $dateend; + + return $this; + } + + /** + * Get dateend + * + * @return \DateTime + */ + public function getDateend() + { + return $this->dateend; + } + + /** + * Set fileout + * + * @param string $fileout + * + * @return FluxFileout + */ + public function setFileout($fileout) + { + $this->fileout = $fileout; + + return $this; + } + + /** + * Get fileout + * + * @return string + */ + public function getFileout() + { + return $this->fileout; + } + + /** + * Set depotfilesize + * + * @param integer $depotfilesize + * + * @return FluxFileout + */ + public function setDepotfilesize($depotfilesize) + { + $this->depotfilesize = $depotfilesize; + + return $this; + } + + /** + * Get depotfilesize + * + * @return integer + */ + public function getDepotfilesize() + { + return $this->depotfilesize; + } + + /** + * Set depottype + * + * @param string $depottype + * + * @return FluxFileout + */ + public function setDepottype($depottype) + { + $this->depottype = $depottype; + + return $this; + } + + /** + * Get depottype + * + * @return string + */ + public function getDepottype() + { + return $this->depottype; + } + + /** + * Set depotdir + * + * @param string $depotdir + * + * @return FluxFileout + */ + public function setDepotdir($depotdir) + { + $this->depotdir = $depotdir; + + return $this; + } + + /** + * Get depotdir + * + * @return string + */ + public function getDepotdir() + { + return $this->depotdir; + } + + /** + * Set depotdate + * + * @param \DateTime $depotdate + * + * @return FluxFileout + */ + public function setDepotdate($depotdate) + { + $this->depotdate = $depotdate; + + return $this; + } + + /** + * Get depotdate + * + * @return \DateTime + */ + public function getDepotdate() + { + return $this->depotdate; + } + + /** + * Set depotdateread + * + * @param \DateTime $depotdateread + * + * @return FluxFileout + */ + public function setDepotdateread($depotdateread) + { + $this->depotdateread = $depotdateread; + + return $this; + } + + /** + * Get depotdateread + * + * @return \DateTime + */ + public function getDepotdateread() + { + return $this->depotdateread; + } + + /** + * Set transfertdate + * + * @param \DateTime $transfertdate + * + * @return FluxFileout + */ + public function setTransfertdate($transfertdate) + { + $this->transfertdate = $transfertdate; + + return $this; + } + + /** + * Get transfertdate + * + * @return \DateTime + */ + public function getTransfertdate() + { + return $this->transfertdate; + } +} diff --git a/module/Application/src/Application/Repository/FluxFileinRepository.php b/module/Application/src/Application/Repository/FluxFileinRepository.php new file mode 100644 index 0000000..5052a03 --- /dev/null +++ b/module/Application/src/Application/Repository/FluxFileinRepository.php @@ -0,0 +1,8 @@ +getEntityManager()->createQuery($dql) + ->setParameter('dateEnd', '0000-00-00 00:00:00') + ->setParameter('depotDate', '0000-00-00 00:00:00'); + + return $query->getResult(); + } +} \ No newline at end of file diff --git a/module/PhpSettings/Module.php b/module/PhpSettings/Module.php new file mode 100644 index 0000000..f7e3e0d --- /dev/null +++ b/module/PhpSettings/Module.php @@ -0,0 +1,63 @@ + array( + 'display_startup_errors' => false, + 'display_errors' => false, + 'max_execution_time' => 60, + 'date.timezone' => 'Europe/London', + 'mbstring.internal_encoding' => 'UTF-8', + ), + * + */ + +class Module +{ + /** + * {@inheritDoc} + */ + public function onBootstrap(Event $e) + { + $app = $e->getParam('application'); + $config = $app->getConfiguration(); + if(array_key_exists('phpSettings', $config)) { + $phpSettings = $config['phpSettings']; + if(is_array($phpSettings)) { + foreach($phpSettings as $key => $value) { + ini_set($key, $value); + } + } + } + } + + /** + * {@inheritDoc} + */ + public function getConfig() + { + return include __DIR__ . '/config/module.config.php'; + } + + /** + * {@inheritDoc} + */ + public function getAutoloaderConfig() + { + return array( + 'Zend\Loader\StandardAutoloader' => array( + 'namespaces' => array( + __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, + ), + ), + ); + } +} \ No newline at end of file diff --git a/module/PhpSettings/config/module.config.php b/module/PhpSettings/config/module.config.php new file mode 100644 index 0000000..dad330e --- /dev/null +++ b/module/PhpSettings/config/module.config.php @@ -0,0 +1,2 @@ +