Changeset 6022


Ignore:
Timestamp:
04/30/10 14:31:02 (9 years ago)
Author:
patdenice
Message:

prep21up must be compatible with php4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/prepare21upgrade/prep21up.php

    r6021 r6022  
    113113$dir = PHPWG_ROOT_PATH.'_data/'.md5(uniqid(rand(), true)); 
    114114 
    115 if (!mkdir($dir, 0777, true) 
     115if (!is_dir(PHPWG_ROOT_PATH.'_data') 
     116  and !mkdir(PHPWG_ROOT_PATH.'_data', 0777)) 
     117{ 
     118  die('Error: create a "_data" directory and add write access on "_data" directory (chmod 777).'); 
     119} 
     120 
     121if (!mkdir($dir, 0777) 
    116122  or !mkdir($dir.'/local') 
    117123  or !mkdir($dir.'/local/config') 
     
    121127{ 
    122128  deltree($dir); 
    123   die('Error: create a "_data" directory and add write access on "_data" directory (chmod 777).'); 
     129  die('Error: add write access on "_data" directory (chmod 777).'); 
    124130} 
    125131 
     
    156162?'.'>'; 
    157163  $new_config_file = $dir.'/local/config/database.inc.php'; 
    158   file_put_contents($new_config_file, $file_content); 
     164  $fp = @fopen($new_config_file, 'w'); 
     165  @fwrite($fp, $file_content); 
     166  @fclose($fp); 
    159167  @chmod($new_config_file, 0777); 
    160168} 
Note: See TracChangeset for help on using the changeset viewer.