Ignore:
Timestamp:
Jun 29, 2014, 4:17:09 PM (10 years ago)
Author:
mistic100
Message:

use new maintain class

Location:
extensions/BatchDownloader
Files:
1 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/BatchDownloader/admin/config.php

    r25932 r28834  
    2121    'last_clean'      => $conf['batch_download']['last_clean'],
    2222    );
    23   $conf['batch_download_comment'] = trim($_POST['archive_comment']);
    2423
    25   conf_update_param('batch_download', serialize($conf['batch_download']));
    26   conf_update_param('batch_download_comment', $conf['batch_download_comment']);
     24  conf_update_param('batch_download', $conf['batch_download']);
     25  conf_update_param('batch_download_comment', trim($_POST['archive_comment']), true);
    2726
    2827  $page['infos'][] = l10n('Information data registered in database');
  • extensions/BatchDownloader/include/BatchDownloader.class.php

    r28627 r28834  
    524524        else
    525525        {
    526           $src_image = new SrcImage($row); // don't give representive_ext
     526          $src_image = new SrcImage($row); // don't give representative_ext
    527527
    528528          // no-image files
     
    536536          {
    537537            $derivative = new DerivativeImage($this->data['size'], $src_image);
     538           
     539            if (!file_exists($derivative->get_path()))
     540            {
     541              // we shouldn't be here
     542              // TODO : generate missing derivative (if generation where not performed) or remove
     543            }
    538544
    539545            $zip->addFile($derivative->get_path(), $this->getFilename($row, $filesizes[ $row['id'] ]));
     
    577583      {
    578584        if ($this->conf['one_archive']) $this->updateParam('status', 'done');
    579         $done = true;
    580585
    581586        // over estimed
    582587        $this->updateParam('nb_zip', $this->data['last_zip']);
    583588      }
    584 
    585589      // under estimed
    586       if (!isset($done) && $this->data['status'] != 'done' && $this->data['last_zip'] == $this->data['nb_zip'])
     590      else if ($this->data['status'] != 'done' && $this->data['last_zip'] == $this->data['nb_zip'])
    587591      {
    588592        $this->updateParam('nb_zip', $this->data['last_zip']+1);
  • extensions/BatchDownloader/include/events.inc.php

    r25932 r28834  
    252252
    253253  $conf['batch_download']['last_clean'] = $time;
    254   conf_update_param('batch_download', serialize($conf['batch_download']));
     254  conf_update_param('batch_download', $conf['batch_download']);
    255255
    256256  // set old sets as done and clean images table
  • extensions/BatchDownloader/main.inc.php

    r25932 r28834  
    1313global $conf, $prefixeTable;
    1414
    15 defined('BATCH_DOWNLOAD_ID') or define('BATCH_DOWNLOAD_ID', basename(dirname(__FILE__)));
     15define('BATCH_DOWNLOAD_ID',      basename(dirname(__FILE__)));
    1616define('BATCH_DOWNLOAD_PATH',    PHPWG_PLUGINS_PATH . BATCH_DOWNLOAD_ID . '/');
    1717define('BATCH_DOWNLOAD_TSETS',   $prefixeTable . 'download_sets');
     
    2121define('BATCH_DOWNLOAD_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . BATCH_DOWNLOAD_ID);
    2222define('BATCH_DOWNLOAD_PUBLIC',  get_absolute_root_url() . make_index_url(array('section' => 'download')) . '/');
    23 define('BATCH_DOWNLOAD_VERSION', 'auto');
    2423
    2524
     
    5958  global $conf;
    6059
    61   include_once(BATCH_DOWNLOAD_PATH . 'maintain.inc.php');
    62   $maintain = new BatchDownloader_maintain(BATCH_DOWNLOAD_ID);
    63   $maintain->autoUpdate(BATCH_DOWNLOAD_VERSION, 'install');
    64 
    65   $conf['batch_download'] = unserialize($conf['batch_download']);
     60  $conf['batch_download'] = safe_unserialize($conf['batch_download']);
    6661  $conf['batch_download']['file_pattern'] = isset($conf['batch_download_file_pattern']) ? $conf['batch_download_file_pattern'] : '%id%_%filename%_%dimensions%';
    6762  $conf['batch_download']['allowed_ext'] = $conf['picture_ext'];
Note: See TracChangeset for help on using the changeset viewer.