This commit is contained in:
Michael RICOIS 2016-07-08 13:53:21 +02:00
parent bdbb4aa81a
commit 60d9d7575f
34 changed files with 2743 additions and 89 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/.settings/ /.settings/
/.buildpath /.buildpath
/.project /.project
/vendor/

View File

@ -1,41 +0,0 @@
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initConfig()
{
$config = new Zend_Config($this->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);
}*/
}
}

View File

@ -1,6 +0,0 @@
<?php
class Application_Model_Sdv1FluxFileIn extends Zend_Db_Table_Abstract
{
protected $_name = 'flux_filein';
protected $_schema = 'sdv1';
}

View File

@ -1,6 +0,0 @@
<?php
class Application_Model_Sdv1FluxFileOut extends Zend_Db_Table_Abstract
{
protected $_name = 'flux_fileout';
protected $_schema = 'sdv1';
}

17
cli.php Normal file
View File

@ -0,0 +1,17 @@
<?php
/**
* This makes our life easier when dealing with paths. Everything is relative
* to the application root now.
*/
chdir('.');
// Decline static file requests back to the PHP built-in webserver
if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) {
return false;
}
// Setup autoloading
require 'init_autoloader.php';
// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();

View File

@ -1,18 +1,15 @@
{ {
"name": "scores/batchflux", "name": "zendframework/skeleton-application",
"description": "Gestion des flux", "description": "Skeleton Application for ZF2",
"license": "BSD-3-Clause",
"keywords": [
"framework",
"zf2"
],
"homepage": "http://framework.zend.com/",
"require": { "require": {
"zendframework/zendframework1": "^1.12" "php": ">=5.3.3",
}, "zendframework/zendframework": "2.4.10",
"autoload": { "doctrine/doctrine-orm-module": "dev-master"
"classmap": [ }
"application/"
]
},
"authors": [
{
"name": "Scores et Decisions",
"email": "supportdev@scores-decisions.com"
}
]
} }

1035
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,66 @@
<?php
return array(
// This should be an array of module namespaces used in the application.
'modules' => 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(),
);

2
config/autoload/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
local.php
*.local.php

View File

@ -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.

View File

@ -0,0 +1,3 @@
<?php
return array(
);

View File

@ -0,0 +1,34 @@
<?php
/**
* Local Configuration Override
*
* This configuration override file is for overriding environment-specific and
* security-sensitive configuration information. Copy this file without the
* .dist extension at the end and populate values as needed.
*
* @NOTE: This file is ignored from Git by default with the .gitignore included
* in ZendSkeletonApplication. This is a good practice, as it prevents sensitive
* credentials from accidentally being committed into version control.
*/
return array(
'doctrine' => 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'
),
),
),
),
);

View File

@ -0,0 +1,16 @@
<?php
/**
* Global Configuration Override
*
* You can use this file for overriding configuration values from modules, etc.
* You would place values in here that are agnostic to the environment and not
* sensitive to security.
*
* @NOTE: In practice, this file will typically be INCLUDED in your source
* control, so do not include passwords or other sensitive information in this
* file.
*/
return array(
// ...
);

View File

@ -0,0 +1,15 @@
<?php
/**
* Local Configuration Override
*
* This configuration override file is for overriding environment-specific and
* security-sensitive configuration information. Copy this file without the
* .dist extension at the end and populate values as needed.
*
* @NOTE: This file is ignored from Git by default with the .gitignore included
* in ZendSkeletonApplication. This is a good practice, as it prevents sensitive
* credentials from accidentally being committed into version control.
*/
return array(
);

View File

@ -0,0 +1,166 @@
<?php
return array(
'presta' => 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(),
),
),
),
),
);

2
data/cache/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
doc/README-DEV Normal file
View File

@ -0,0 +1,2 @@

64
doc/TODO Normal file
View File

@ -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)
}

54
init_autoloader.php Normal file
View File

@ -0,0 +1,54 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* This autoloading setup is really more complicated than it needs to be for most
* applications. The added complexity is simply to reduce the time it takes for
* new developers to be productive with a fresh skeleton. It allows autoloading
* to be correctly configured, regardless of the installation method and keeps
* the use of composer completely optional. This setup should work fine for
* most users, however, feel free to configure autoloading however you'd like.
*/
// Composer autoloading
if (file_exists('vendor/autoload.php')) {
$loader = include 'vendor/autoload.php';
}
if (class_exists('Zend\Loader\AutoloaderFactory')) {
return;
}
$zf2Path = false;
if (is_dir('vendor/ZF2/library')) {
$zf2Path = 'vendor/ZF2/library';
} elseif (getenv('ZF2_PATH')) { // Support for ZF2_PATH environment variable or git submodule
$zf2Path = getenv('ZF2_PATH');
} elseif (get_cfg_var('zf2_path')) { // Support for zf2_path directive value
$zf2Path = get_cfg_var('zf2_path');
}
if ($zf2Path) {
if (isset($loader)) {
$loader->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.');
}

View File

@ -0,0 +1,69 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Application;
use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
use Zend\ModuleManager\Feature\ConsoleUsageProviderInterface;
use Zend\Console\Adapter\AdapterInterface as Console;
class Module implements
AutoloaderProviderInterface,
ConfigProviderInterface,
ConsoleUsageProviderInterface
{
public function onBootstrap(MvcEvent $e)
{
$eventManager = $e->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] <filepath>' => "Action sur évenement reception (SD => Client)",
'send [--debug] <filepath>' => "Action sur évenement envoi (Client => SD)",
'read [--debug] <filepath>' => "Action sur évenenent lecture fichier",
'tck [--debug] <filepath>' => "Action sur réception fichier .tck (Transfert ChecK)",
'clean --cron [--verbose|-v]' => "Nettoyage des repertoires",
'trigger <filepath> event <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 <type>' => "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" ),
);
}
}

View File

@ -0,0 +1,173 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
return array(
'router' => 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] <filepath>',
'defaults' => array(
'controller' => 'Application\Controller\File',
'action' => 'read'
),
),
),
'file-tck' => array(
'options' => array(
'route' => 'tck [--verbose|-v] [--dry-run|-n] <filepath>',
'defaults' => array(
'controller' => 'Application\Controller\File',
'action' => 'tck'
),
),
),
'file-recv' => array(
'options' => array(
'route' => 'recv [--verbose|-v] [--dry-run|-n] <filepath>',
'defaults' => array(
'controller' => 'Application\Controller\File',
'action' => 'recv'
),
),
),
'file-send' => array(
'options' => array(
'route' => 'send [--verbose|-v] [--dry-run|-n] <filepath>',
'defaults' => array(
'controller' => 'Application\Controller\File',
'action' => 'send'
),
),
),
'file-trigger' => array(
'options' => array(
'route' => 'trigger [--verbose|-v] [--dry-run|-n] <filepath> event <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 <type>',
'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',
),
),
),
),
);

View File

@ -0,0 +1,25 @@
<?php
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Zend\Console\Request as ConsoleRequest;
class ConfigController extends AbstractActionController
{
public function indexAction()
{
return new ViewModel(); // display standard index page
}
public function incronAction()
{
$request = $this->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!');
}
}
}

View File

@ -0,0 +1,147 @@
<?php
namespace Application\Controller;
use Zend\Console\Adapter\AdapterInterface as Console;
use Zend\Console\Request as ConsoleRequest;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\Stdlib\RequestInterface;
use Zend\Stdlib\ResponseInterface;
class FileController extends AbstractActionController
{
/**
* @var \Zend\Console\Adapter\AdapterInterface console object
*/
protected $console;
/**
* @var array associative array represents app config
*/
protected $appConfig;
/**
* @param Console $console
* @param array $appConfig
*/
public function __construct(Console $console, array $appConfig)
{
$this->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);
}
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace Application\Controller;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
class FileControllerFactory implements FactoryInterface
{
public function createService(ServiceLocatorInterface $serviceLocator)
{
$serviceLocator = $serviceLocator->getServiceLocator();
$console = $serviceLocator->get('Console');
$appConfig = $serviceLocator->get('config');
return new FileController($console, $appConfig);
}
}

View File

@ -0,0 +1,21 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
class IndexController extends AbstractActionController
{
public function indexAction()
{
return new ViewModel();
}
}

View File

@ -0,0 +1,314 @@
<?php
namespace Application\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* FluxFilein
*
* @ORM\Table(name="flux_filein", indexes={@ORM\Index(name="name_2", columns={"name", "depotFile"})})
* @ORM\Entity(repositoryClass="Application\Repository\FluxFileinRepository")
*/
class FluxFilein
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="client", type="string", length=50, nullable=false)
*/
private $client;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=50, nullable=false)
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="depotType", type="string", nullable=false)
*/
private $depottype;
/**
* @var \DateTime
*
* @ORM\Column(name="depotDate", type="datetime", nullable=false)
*/
private $depotdate = '0000-00-00 00:00:00';
/**
* @var string
*
* @ORM\Column(name="depotFile", type="string", length=100, nullable=false)
*/
private $depotfile;
/**
* @var integer
*
* @ORM\Column(name="depotFileSize", type="integer", nullable=false)
*/
private $depotfilesize = '0';
/**
* @var integer
*
* @ORM\Column(name="nbLines", type="integer", nullable=false)
*/
private $nblines;
/**
* @var \DateTime
*
* @ORM\Column(name="dateInsert", type="datetime", nullable=false)
*/
private $dateinsert = '0000-00-00 00:00:00';
/**
* @var \DateTime
*
* @ORM\Column(name="dateExecute", type="datetime", nullable=false)
*/
private $dateexecute = '0000-00-00 00:00:00';
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->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;
}
}

View File

@ -0,0 +1,407 @@
<?php
namespace Application\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* FluxFileout
*
* @ORM\Table(name="flux_fileout")
* @ORM\Entity(repositoryClass="Application\Repository\FluxFileoutRepository")
*/
class FluxFileout
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="client", type="string", length=50, nullable=false)
*/
private $client;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=50, nullable=false)
*/
private $name;
/**
* @var integer
*
* @ORM\Column(name="nbLines", type="integer", nullable=false)
*/
private $nblines;
/**
* @var \DateTime
*
* @ORM\Column(name="dateBegin", type="datetime", nullable=false)
*/
private $datebegin = '0000-00-00 00:00:00';
/**
* @var \DateTime
*
* @ORM\Column(name="dateEnd", type="datetime", nullable=false)
*/
private $dateend = '0000-00-00 00:00:00';
/**
* @var string
*
* @ORM\Column(name="fileOut", type="string", length=100, nullable=false)
*/
private $fileout;
/**
* @var integer
*
* @ORM\Column(name="depotFileSize", type="integer", nullable=false)
*/
private $depotfilesize = '0';
/**
* @var string
*
* @ORM\Column(name="depotType", type="string", nullable=false)
*/
private $depottype;
/**
* @var string
*
* @ORM\Column(name="depotDir", type="string", length=20, nullable=false)
*/
private $depotdir;
/**
* @var \DateTime
*
* @ORM\Column(name="depotDate", type="datetime", nullable=false)
*/
private $depotdate = '0000-00-00 00:00:00';
/**
* @var \DateTime
*
* @ORM\Column(name="depotDateRead", type="datetime", nullable=false)
*/
private $depotdateread = '0000-00-00 00:00:00';
/**
* @var \DateTime
*
* @ORM\Column(name="transfertDate", type="datetime", nullable=false)
*/
private $transfertdate = '0000-00-00 00:00:00';
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->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;
}
}

View File

@ -0,0 +1,8 @@
<?php
namespace Application\Repository;
use Doctrine\ORM\EntityRepository;
class FluxFileinRepository extends EntityRepository
{
}

View File

@ -0,0 +1,20 @@
<?php
namespace Application\Repository;
use Doctrine\ORM\EntityRepository;
class FluxFileoutRepository extends EntityRepository
{
/**
* List des flux non envoyés
*/
public function getNotSent()
{
$dql = "SELECT f FROM Application\Entity\FluxFileout f WHERE f.dateend!=:dateEnd AND f.depotdate=:depotDate";
$query = $this->getEntityManager()->createQuery($dql)
->setParameter('dateEnd', '0000-00-00 00:00:00')
->setParameter('depotDate', '0000-00-00 00:00:00');
return $query->getResult();
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace PhpSettings;
use Zend\EventManager\Event;
/**
* Enable this global module in /config/application.config.php
*
* To load configuration, just plage phpSettings key into a configuraton file
* and put all required PHP ini directives as its subkeys.
* Ex :
* return array(
'phpSettings' => 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__,
),
),
);
}
}

View File

@ -0,0 +1,2 @@
<?php
return array();