/[drupal]/contributions/modules/module_builder/includes/update.inc
ViewVC logotype

Diff of /contributions/modules/module_builder/includes/update.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.24, Sat Oct 24 19:19:55 2009 UTC revision 1.1.2.25, Sat Oct 24 21:11:03 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: update.inc,v 1.1.2.23 2009/10/24 18:46:27 joachim Exp $  // $Id: update.inc,v 1.1.2.24 2009/10/24 19:19:55 joachim Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 8  Line 8 
8   * Fetches files from locations specified by hook_module_builder_info   * Fetches files from locations specified by hook_module_builder_info
9   * implementations (including our own).   * implementations (including our own).
10   *   *
11   * Convention: functions beginning with underscores are internal to this file.   * The main function here is module_builder_update_documentation().
12     * Other functions (beginning with underscores) are internal to this file.
13     *
14     * The data that gets passed around is an array keyed by filename. Filenames
15     * thus be unique; if there is a possibility of filename clash these must
16     * be rendered safe, for example by prefixing the module name.
17     * The keys to each item are:
18     *  - path: the full path to this file
19     *  - url: (internal to this file) URL to download this file from.
20     *  - destination: the module code file where the hooks from this hook data file
21     *    should be saved by code generation
22     *  - group: the group this file's hooks should be shown in the Drupal UI.
23     * Example:
24     *  [system.core.php] => array(
25     *    [path]        => /Users/you/data/drupal_hooks/6/system.core.php
26     *    [url]         => http://cvs.drupal.org/viewvc.py/drupal/contributions/docs/developer/hooks/core.php?view=co&pathrev=DRUPAL-6--1
27     *    [destination] => %module.module
28     *    [group]       => core
29   */   */
30    
   
31  /**  /**
32   * Updates hook documentation files.   * Updates hook documentation files.
33   *   *
# Line 25  Line 41 
41   * Just saying.   * Just saying.
42   *   *
43   * @return   * @return
44   *  Array of hook files.   *  Array of hook files suitable for passing to module_builder_process_hook_data().
45     *  See file documentation for details.
46   */   */
47  function module_builder_update_documentation() {  function module_builder_update_documentation() {
48    $directory = _module_builder_get_hooks_directory();    $directory = _module_builder_get_hooks_directory();
# Line 61  function module_builder_update_documenta Line 78  function module_builder_update_documenta
78   * @return   * @return
79   *   An array of data about the files to download, keyed by (safe) filename:   *   An array of data about the files to download, keyed by (safe) filename:
80      [system.core.php] => Array      [system.core.php] => Array
81          [path] => the full path this file should be saved to
82        [url] => URL        [url] => URL
83        [destination] => %module.module        [destination] => %module.module
84        [group] => core        [group] => core
# Line 104  function _module_builder_get_hook_file_u Line 122  function _module_builder_get_hook_file_u
122        );        );
123        // Create our own safe filename with module prefix.        // Create our own safe filename with module prefix.
124        $hook_file_safe_name = "$module.$hook_file";        $hook_file_safe_name = "$module.$hook_file";
125          $directory = _module_builder_get_hooks_directory();
126          $urls[$hook_file_safe_name]['path'] = $directory . '/' . $hook_file_safe_name;
127        $urls[$hook_file_safe_name]['url'] = $url;        $urls[$hook_file_safe_name]['url'] = $url;
128        $urls[$hook_file_safe_name]['destination'] = $destination;        $urls[$hook_file_safe_name]['destination'] = $destination;
129        if ($module_data['group'] == '#filenames') {        if ($module_data['group'] == '#filenames') {

Legend:
Removed from v.1.1.2.24  
changed lines
  Added in v.1.1.2.25

  ViewVC Help
Powered by ViewVC 1.1.2