/[drupal]/contributions/modules/api/parser.inc
ViewVC logotype

Diff of /contributions/modules/api/parser.inc

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

revision 1.41.2.28 by drumm, Thu Oct 8 06:07:46 2009 UTC revision 1.41.2.29 by drumm, Thu Oct 15 05:52:59 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: parser.inc,v 1.41.2.27 2009/10/05 01:16:20 drumm Exp $  // $Id: parser.inc,v 1.41.2.28 2009/10/08 06:07:46 drumm Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 681  function api_shutdown() { Line 681  function api_shutdown() {
681      $path = file_create_path('api');      $path = file_create_path('api');
682      file_check_directory($path, FILE_CREATE_DIRECTORY);      file_check_directory($path, FILE_CREATE_DIRECTORY);
683      $date = gmdate('U');      $date = gmdate('U');
684      foreach (api_get_branches() as $branch_name => $branch) {      foreach (api_get_branches() as $branch) {
685        $new_json = api_autocomplete($branch_name, FALSE);        $new_json = api_autocomplete($branch->branch_name, FALSE);
686    
687        $old_file_path = variable_get('api_autocomplete_path_' . $branch_name, FALSE);        $old_file_path = variable_get('api_autocomplete_path_' . $branch->branch_name, FALSE);
688        if ($old_file_path !== FALSE) {        if ($old_file_path !== FALSE) {
689          if (md5($new_json) === md5(file_get_contents($old_file_path))) {          if (md5($new_json) === md5(file_get_contents($old_file_path))) {
690            continue; // No changes, no file write.            continue; // No changes, no file write.
# Line 693  function api_shutdown() { Line 693  function api_shutdown() {
693          job_queue_add('file_delete', t('Remove expired API JSON, %path.'), array('%path' => $old_file_path));          job_queue_add('file_delete', t('Remove expired API JSON, %path.'), array('%path' => $old_file_path));
694        }        }
695    
696        $file_name = $path . '/api-' . $branch_name . '-' . $date . '.json';        $file_name = $path . '/api-' . $branch->branch_name . '-' . $date . '.json';
697        file_save_data($new_json, $file_name, FILE_EXISTS_REPLACE);        file_save_data($new_json, $file_name, FILE_EXISTS_REPLACE);
698        variable_set('api_autocomplete_path_' . $branch_name, $file_name);        variable_set('api_autocomplete_path_' . $branch->branch_name, $file_name);
699      }      }
700    }    }
701    

Legend:
Removed from v.1.41.2.28  
changed lines
  Added in v.1.41.2.29

  ViewVC Help
Powered by ViewVC 1.1.3