[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/ckeditor/includes/ -> ckeditor.drush.inc (source)

   1  <?php
   2  // $Id: ckeditor.drush.inc,v 1.1.2.2 2010/03/10 10:26:38 mephir Exp $
   3  
   4  /**
   5   * @file
   6   * Drush integration for the ckeditor module.
   7   */
   8  
   9  /**
  10   * Implements hook_drush_command().
  11   */
  12  function ckeditor_drush_command() {
  13    $items['ckeditor-download'] = array(
  14      'callback' => 'ckeditor_drush_download',
  15      'description' => dt('Downloads the required CKEditor library from svn.fckeditor.net.'),
  16      'arguments' => array(
  17        'path' => dt('Optional. A path to the download folder. If omitted Drush will use the default location (sites/all/libraries/ckeditor).'),
  18      ),
  19    );
  20    return $items;
  21  }
  22  
  23  /**
  24   * Downloads
  25   */
  26  function ckeditor_drush_download() {
  27    $args = func_get_args();
  28    if ($args[0]) {
  29      $path = $args[0];
  30    }
  31    else {
  32      $path = drush_get_context('DRUSH_DRUPAL_ROOT') . '/sites/all/libraries/ckeditor';
  33    }
  34  
  35    if (drush_shell_exec('svn checkout http://svn.fckeditor.net/CKEditor/releases/stable/ ' . $path)) {
  36      drush_log(dt('CKEditor has been downloaded to @path.', array('@path' => $path)), 'success');
  37    }
  38    else {
  39      drush_log(dt('Drush was unable to download the CKEditor to @path.', array('@path' => $path)), 'error');
  40    }
  41  }
  42  
  43  /**
  44   * Implements drush_MODULE_post_COMMAND().
  45   */
  46  function drush_ckeditor_post_enable() {
  47    $modules = func_get_args();
  48    if (in_array('ckeditor', $modules)) {
  49      ckeditor_drush_download();
  50    }
  51  }


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7