summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2010-04-30 08:04:01 +0000
committerLester Caine <lester@lsces.co.uk>2010-04-30 08:04:01 +0000
commit0992f5d65f92beb33530715b559a57d12095fa46 (patch)
treee09f96d3d6814e19b3450ef3fb4e88a693fd09c9
parent8c65b9e0159d3fe73568c5219abcb7efa7c43480 (diff)
downloadliberty-0992f5d65f92beb33530715b559a57d12095fa46.tar.gz
liberty-0992f5d65f92beb33530715b559a57d12095fa46.tar.bz2
liberty-0992f5d65f92beb33530715b559a57d12095fa46.zip
Recursive mkdir does not work on windows, and we need to tidy the '/\' mess
-rw-r--r--liberty_lib.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/liberty_lib.php b/liberty_lib.php
index 53ad9e3..4171638 100644
--- a/liberty_lib.php
+++ b/liberty_lib.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_liberty/liberty_lib.php,v 1.53 2010/03/16 00:42:52 spiderr Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_liberty/liberty_lib.php,v 1.54 2010/04/30 08:04:01 lsces Exp $
* @package liberty
* @subpackage functions
*/
@@ -574,6 +574,11 @@ function liberty_process_generic( &$pFileHash, $pMoveFile = TRUE ) {
$ret = NULL;
$destBase = $pFileHash['dest_path'].$pFileHash['name'];
$actualPath = BIT_ROOT_PATH.$destBase;
+ if ( is_windows() ) {
+ $destBase = str_replace( '/', "\\", str_replace( "\\", '/', $destBase ) );
+ $actualPath = str_replace( '//', '\\', str_replace( "\\", '\\', $actualPath ) );
+ mkdir_p(str_replace('/','',BIT_ROOT_PATH).$pFileHash['dest_path']);
+ }
if( is_file( $pFileHash['source_file']) ) {
if( $pFileHash['source_file'] == $actualPath ) {
// do nothing if source and dest are the same
@@ -584,6 +589,9 @@ function liberty_process_generic( &$pFileHash, $pMoveFile = TRUE ) {
rename( $pFileHash['source_file'], $actualPath );
}
} else {
+ if ( is_windows() ) {
+
+ }
copy( $pFileHash['source_file'], $actualPath );
}
$ret = $destBase;