Changeset 19832


Ignore:
Timestamp:
Jan 5, 2013, 11:28:38 AM (12 years ago)
Author:
mistic100
Message:

make sure temp folder is created on the right place

Location:
extensions/pbase2piwigo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/pbase2piwigo/include/functions.inc.php

    r17434 r19832  
    346346     
    347347      curl_setopt($ch, CURLOPT_URL, $src);
    348       curl_setopt($ch, CURLOPT_HEADER, 0);
     348      curl_setopt($ch, CURLOPT_HEADER, false);
    349349      curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-language: en"));
    350350      curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)');
     
    365365      }
    366366     
    367       if (($out = curl_exec($ch)) === false)
     367      $out = curl_exec($ch);
     368      curl_close($ch);
     369     
     370      if ($out === false)
    368371      {
    369372        return 'file_error';
    370373      }
    371      
    372       curl_close($ch);
    373      
    374       if (!$return)
     374      else if (!$return)
    375375      {
    376376        fclose($newf);
  • extensions/pbase2piwigo/main.inc.php

    r17314 r19832  
    1313global $conf;
    1414
    15 define('PBASE_PATH', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
    16 define('PBASE_ADMIN', get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__)));
    17 define('PBASE_FS_CACHE', $conf['data_location'].'pbase_cache/');
     15define('PBASE_PATH',     PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
     16define('PBASE_ADMIN',    get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__)));
     17define('PBASE_FS_CACHE', PHPWG_ROOT_PATH . $conf['data_location'] . 'pbase_cache/');
     18
    1819
    1920if (defined('IN_ADMIN'))
     
    3132}
    3233
     34
    3335include_once(PBASE_PATH . 'include/ws_functions.inc.php');
    3436
  • extensions/pbase2piwigo/maintain.inc.php

    r17225 r19832  
    11<?php
    22if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    3 
    4 define(
    5   'pbase2piwigo_default_config',
    6   serialize(array(
    7     ))
    8   );
    93
    104
     
    137  global $conf;
    148 
    15   // conf_update_param('pbase2piwigo', pbase2piwigo_default_config);
    16  
    17   mkdir($conf['data_location'].'pbase_cache/', 0755);
     9  mkgetdir(PHPWG_ROOT_PATH . $conf['data_location'] . 'pbase_cache/', MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR);
    1810}
    1911
     
    2113{
    2214  global $conf;
    23 
    24   // if (empty($conf['pbase2piwigo']))
    25   // {
    26     // conf_update_param('pbase2piwigo', pbase2piwigo_default_config);
    27   // }
    2815 
    29   if (!file_exists($conf['data_location'].'pbase_cache/'))
     16  if (!file_exists(PHPWG_ROOT_PATH . $conf['data_location'] . 'pbase_cache/'))
    3017  {
    31     mkdir($conf['data_location'].'pbase_cache/', 0755);
     18    mkgetdir(PHPWG_ROOT_PATH . $conf['data_location'] . 'pbase_cache/', MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR);
    3219  }
    3320}
     
    3522function plugin_uninstall()
    3623{
    37   // pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "pbase2piwigo" LIMIT 1;');
     24  global $conf;
    3825 
    39   rrmdir($conf['data_location'].'pbase_cache/');
     26  rrmdir(PHPWG_ROOT_PATH . $conf['data_location'] . 'pbase_cache/');
    4027}
    4128
Note: See TracChangeset for help on using the changeset viewer.