12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- // $Id$
- /**
- * @file
- * Fonctions de ligne de commande pour FGCF
- *
- * - importation de prestataires
- * - importation de fiches de formation
- *
- * Copyright 2010 Ouest Systemes Informatiques (OSInet)
- *
- * Licensed under the General Public License, version 2 or later
- */
- /**
- * Implements hook_drush_command().
- *
- * @return array
- */
- function fgcf_drush_command() {
- $items['fgcf-import-prestataires'] = array(
- // a short description of your command
- 'description' => "Importe des fiches de prestataires depuis un fichier",
- 'aliases' => array('fgcf-p'),
- );
- $items['fgcf-import-formations'] = array(
- // a short description of your command
- 'description' => "Importe des fiches de formation depuis un fichier",
- 'aliases' => array('fgcf-f'),
- );
- return $items;
- }
- /**
- * Implements hook_drush_help().
- *
- * @param string $section
- */
- function fgcf_drush_help($section) {
- $help = array(
- 'fgcf-import-prestataires' => dt('Importe toutes les fiches de prestataires trouvées dans le fichier passé en argument'),
- 'fgcf-import-formations' => dt('Importe toutes les fiches de formations trouvées dans le fichier passé en argument'),
- );
- $key = substr($section, strlen('drush:')); // drupal_substr() not available
- return array_key_exists($key, $help) ? $help[$key] : NULL;
- }
- /**
- * Command callback for fgcf-import-prestataire.
- *
- * @param string $filename
- */
- function drush_fgcf_import_prestataires($filename) {
- drush_print($filename);
- var_dump($GLOBALS);
- var_export(func_get_args());
- }
|