[Miniwiki-commits] SF.net SVN: miniwiki: [239] trunk/miniwiki/lib/ext/core/filesystem.ext.php
Status: Beta
Brought to you by:
src
From: <sr...@us...> - 2006-11-18 22:03:58
|
Revision: 239 http://svn.sourceforge.net/miniwiki/?rev=239&view=rev Author: src Date: 2006-11-18 14:03:56 -0800 (Sat, 18 Nov 2006) Log Message: ----------- * filesystem.ext.php fixed bug when status was not correctly returned from create/update_resource() fixed bug in mkdirs implementation Modified Paths: -------------- trunk/miniwiki/lib/ext/core/filesystem.ext.php Modified: trunk/miniwiki/lib/ext/core/filesystem.ext.php =================================================================== --- trunk/miniwiki/lib/ext/core/filesystem.ext.php 2006-11-18 19:06:56 UTC (rev 238) +++ trunk/miniwiki/lib/ext/core/filesystem.ext.php 2006-11-18 22:03:56 UTC (rev 239) @@ -328,11 +328,11 @@ } function create_resource($dataspace, $resource) { - $this->update_resource_internal($dataspace, $resource, true); + return $this->update_resource_internal($dataspace, $resource, true); } function update_resource($dataspace, $resource) { - $this->update_resource_internal($dataspace, $resource, false); + return $this->update_resource_internal($dataspace, $resource, false); } function update_resource_internal($dataspace, $resource, $should_create) { @@ -374,12 +374,13 @@ /** @private */ function mkdirs_for_path($path) { - $dir = dirname($path); - if (!is_dir($dir)) { - if (!$this->mkdirs_for_path($dir)) { - return false; - } - return mkdir($dir); + $dirs = explode('/', dirname($path)); + $dir = ''; + foreach ($dirs as $part) { + $dir .= $part.'/'; + if (!is_dir($dir) && !mkdir($dir)) { + return false; + } } return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |