Task/Collect/HooksCollector6.php
function getHookFileUrls($directory) {
    // Get our data.
    $data = $this->getHookInfo();

    foreach ($data as $module => $module_data) {
      $branch = $module_data['branch'];
      foreach ($module_data['hook_files'] as $hook_file => $destination) {
        $url = str_replace(
          array('%file', '%branch'),
          array($hook_file, $branch),
          $module_data['url']
        );
        // Create our own safe filename with module prefix.
        $hook_file_safe_name = "$module.$hook_file";
        $urls[$hook_file_safe_name]['path'] = $directory . '/' . $hook_file_safe_name;
        $urls[$hook_file_safe_name]['url'] = $url;
        $urls[$hook_file_safe_name]['destination'] = $destination;
        if (isset($module_data['hook_destinations'])) {
          $urls[$hook_file_safe_name]['hook_destinations'] = array();
          foreach ($module_data['hook_destinations'] as $destination => $hooks) {
            $urls[$hook_file_safe_name]['hook_destinations'] += array_fill_keys($hooks, $destination);
          }
        }
        if ($module_data['group'] == '#filenames') {
          $urls[$hook_file_safe_name]['group'] = str_replace('.php', '', $hook_file);
        }
        else {
          $urls[$hook_file_safe_name]['group'] = $module_data['group'];
        }
      }
    }

    //print_r($urls);

    return $urls;
  }
function getHookFileUrls($directory) {
    // Get our data.
    $data = $this->getHookInfo();

    foreach ($data as $module => $module_data) {
      $branch = $module_data['branch'];
      foreach ($module_data['hook_files'] as $hook_file => $destination) {
        $url = str_replace(
          array('%file', '%branch'),
          array($hook_file, $branch),
          $module_data['url']
        );
        // Create our own safe filename with module prefix.
        $hook_file_safe_name = "$module.$hook_file";
        $urls[$hook_file_safe_name]['path'] = $directory . '/' . $hook_file_safe_name;
        $urls[$hook_file_safe_name]['url'] = $url;
        $urls[$hook_file_safe_name]['destination'] = $destination;
        if (isset($module_data['hook_destinations'])) {
          $urls[$hook_file_safe_name]['hook_destinations'] = array();
          foreach ($module_data['hook_destinations'] as $destination => $hooks) {
            $urls[$hook_file_safe_name]['hook_destinations'] += array_fill_keys($hooks, $destination);
          }
        }
        if ($module_data['group'] == '#filenames') {
          $urls[$hook_file_safe_name]['group'] = str_replace('.php', '', $hook_file);
        }
        else {
          $urls[$hook_file_safe_name]['group'] = $module_data['group'];
        }
      }
    }

    //print_r($urls);

    return $urls;
  }
function getHookFileUrls ( $ directory ) { // Get our data. $ data = $ this -> getHookInfo ( ) ; foreach ( $ data as $ module => $ module_data ) { $ branch = $ module_data [ 'branch' ] ; foreach ( $ module_data [ 'hook_files' ] as $ hook_file => $ destination ) { $ url = str_replace ( array ( '%file' , '%branch' ) , array ( $ hook_file , $ branch ) , $ module_data [ 'url' ] ) ; // Create our own safe filename with module prefix. $ hook_file_safe_name = "$module.$hook_file" ; $ urls [ $ hook_file_safe_name ] [ 'path' ] = $ directory . '/' . $ hook_file_safe_name ; $ urls [ $ hook_file_safe_name ] [ 'url' ] = $ url ; $ urls [ $ hook_file_safe_name ] [ 'destination' ] = $ destination ; if ( isset ( $ module_data [ 'hook_destinations' ] ) ) { $ urls [ $ hook_file_safe_name ] [ 'hook_destinations' ] = array ( ) ; foreach ( $ module_data [ 'hook_destinations' ] as $ destination => $ hooks ) { $ urls [ $ hook_file_safe_name ] [ 'hook_destinations' ] += array_fill_keys ( $ hooks , $ destination ) ; } } if ( $ module_data [ 'group' ] == '#filenames' ) { $ urls [ $ hook_file_safe_name ] [ 'group' ] = str_replace ( '.php' , '' , $ hook_file ) ; } else { $ urls [ $ hook_file_safe_name ] [ 'group' ] = $ module_data [ 'group' ] ; } } } //print_r($urls); return $ urls ; }
Get list of hook file URLS from any modules that declare them.

@param $directory
The path to the module builder hooks directory.

@return
An array of data about the files to download, keyed by (safe) filename:
[system.core.php] => Array
[path] => the full path this file should be saved to
[url] => URL
[destination] => %module.module
[group] => core
Get list of hook file URLS from any modules that declare them .