I got ozpost to install (step #1) with the following changes to /includes/modules/shipping/ozpost.php:
Code:
private function _get_cache_folder($folder) {
$cachefolder = DIR_FS_SQL_CACHE. "/ozpost/";
if ($folder == DIR_FS_ADMIN) {
//-bof-20140801-lat9-Drive letter fix
if (preg_match('/^[A-Z]:/i', $folder)) {
$folder = substr ($folder, 3);
}
//-eof-20140801-lat9
$elements = explode("/", $folder);
$cachefolder .= $elements[sizeof($elements) - 2] . "/";
}
return $cachefolder ;
}
private function writeTempFile($folder, $subfolder, $filename, $data) {
$err = false;
$oldperm = $this->_changePerms(DIR_FS_SQL_CACHE) ;
$cachefolder = $this->_get_cache_folder($folder) ;
//-bof-20140801-lat9-Fix for drive letter
if (preg_match('/^[A-Z]:/i', $subfolder)) {
$subfolder = substr ($subfolder, 3);
}
$myFolder = $cachefolder . $subfolder;
//-eof-20140801-lat9
if (!is_dir($myFolder)) {
if (!mkdir($myFolder, 0775, true)) $err = true; }
if (!$err) { // no error, write file
$file = $myFolder . $filename;
if (!(file_put_contents($file, $data))) $err = true; }
if ( isset($oldperm) && ("$oldperm" < "0775")) chmod(DIR_FS_SQL_CACHE , octdec($oldperm)) ;
return $err;
}
The basic idea was to remove the drive letter (and its colon and following forward- or trailing-slash) from a passed folder name if the name starts with a drive-letter followed by a colon.
I've still got a bunch of PHP warnings (all similar to the following) but I'm thinking that they're safe to ignore:
Code:
[02-Aug-2014 03:53:36 Australia/Victoria] PHP Warning: filemtime(): stat failed for C:/xampp/htdocs/zen_new/images/icons/ozpost/ozpost_regi.gif in C:\xampp\htdocs\zen_new\includes\modules\shipping\ozpost.php on line 4473
Bookmarks