Changeset 6206 for extensions/autoupdate


Ignore:
Timestamp:
May 17, 2010, 6:19:42 PM (14 years ago)
Author:
patdenice
Message:

Keep compatibility with php4 for branch 1.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/autoupdate/branches/1.7/include/functions.inc.php

    r6205 r6206  
    205205  $path = $conf['local_data_dir'].'/autoupdate';
    206206
    207   if (mkgetdir($path)
     207  if (mkgetdir($conf['local_data_dir'])
     208    and mkgetdir($path)
    208209    and ($zip = tempnam($path, 'zip'))
    209210    and ($archive = new pclZip($zip))
     
    246247  $path = $conf['local_data_dir'].'/autoupdate';
    247248
    248   if (@mkgetdir($path)
     249  if (mkgetdir($conf['local_data_dir'])
     250    and mkgetdir($path)
    249251    and ($backupFile = tempnam($path, 'sql'))
    250252    and ($dumper = new MySQLDump($conf['db_base'],$backupFile,false,false)))
     
    320322    $path = $conf['local_data_dir'].'/autoupdate';
    321323    $filename = $path.'/'.$code.'.zip';
    322     @mkgetdir($path);
     324    mkgetdir($conf['local_data_dir']);
     325    mkgetdir($path);
    323326
    324327    $chunk_num = 0;
     
    385388          {
    386389            array_push($page['infos'], sprintf(l10n('autoupdate_success'), $upgrade_to));
    387             $step = 3;
     390            $step = 4;
    388391          }
    389392          else
     
    564567  {
    565568    $umask = umask(0);
    566     $mkd = @mkdir($dir, 0755, ($flags&MKGETDIR_RECURSIVE) ? true:false );
     569    $mkd = @mkdir($dir, 0755 );
    567570    umask($umask);
    568571    if ($mkd==false)
    569572    {
    570       !($flags&MKGETDIR_DIE_ON_ERROR) or fatal_error( "$dir ".l10n('no write access'));
     573      !($flags&MKGETDIR_DIE_ON_ERROR) or die( "$dir ".l10n('no write access'));
    571574      return false;
    572575    }
    573     if( $flags&MKGETDIR_PROTECT_HTACCESS )
    574     {
    575       $file = $dir.'/.htaccess';
    576       file_exists($file) or @file_put_contents( $file, 'deny from all' );
    577     }
    578     if( $flags&MKGETDIR_PROTECT_INDEX )
    579     {
    580       $file = $dir.'/index.htm';
    581       file_exists($file) or @file_put_contents( $file, 'Not allowed!' );
    582     }
    583576  }
    584577  if ( !is_writable($dir) )
    585578  {
    586     !($flags&MKGETDIR_DIE_ON_ERROR) or fatal_error( "$dir ".l10n('no write access'));
     579    !($flags&MKGETDIR_DIE_ON_ERROR) or die( "$dir ".l10n('no write access'));
    587580    return false;
    588581  }
Note: See TracChangeset for help on using the changeset viewer.