From: avl Date: Thu, 11 Sep 2008 00:42:13 +0000 (+0300) Subject: Image Thumbnailer X-Git-Tag: 0.6~174 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=96ac88c7b3eedac28bcd40d79b1ff3e4b903d783;p=ipf-legacy-orm.git Image Thumbnailer --- diff --git a/ipf/orm/import/builder.php b/ipf/orm/import/builder.php index 542594e..9f72a89 100644 --- a/ipf/orm/import/builder.php +++ b/ipf/orm/import/builder.php @@ -661,7 +661,7 @@ class IPF_ORM_Import_Builder extends IPF_ORM_Builder null ); - IPF_ORM_Utils::makeDirectories($path); + IPF_Utils::makeDirectories($path); $writePath = $path . DIRECTORY_SEPARATOR . $className . $this->_suffix; @@ -716,12 +716,12 @@ class IPF_ORM_Import_Builder extends IPF_ORM_Builder // If we have a writePath from the if else conditionals above then use it if (isset($writePath)) { - IPF_ORM_Utils::makeDirectories($writePath); + IPF_Utils::makeDirectories($writePath); $writePath .= DIRECTORY_SEPARATOR . $fileName; // Otherwise none of the conditions were met and we aren't generating base classes } else { - IPF_ORM_Utils::makeDirectories($this->_path); + IPF_Utils::makeDirectories($this->_path); $writePath = $this->_path . DIRECTORY_SEPARATOR . $fileName; } diff --git a/ipf/orm/utils.php b/ipf/orm/utils.php index 5664c70..5b2afc6 100644 --- a/ipf/orm/utils.php +++ b/ipf/orm/utils.php @@ -103,75 +103,6 @@ class IPF_ORM_Utils { } } - public static function makeDirectories($path, $mode = 0777) - { - if ( ! $path) { - return false; - } - - if (is_dir($path) || is_file($path)) { - return true; - } - - return mkdir(trim($path), $mode, true); - } - - public static function removeDirectories($folderPath) - { - if (is_dir($folderPath)) - { - foreach (scandir($folderPath) as $value) - { - if ($value != '.' && $value != '..') - { - $value = $folderPath . "/" . $value; - - if (is_dir($value)) { - self::removeDirectories($value); - } else if (is_file($value)) { - unlink($value); - } - } - } - - return rmdir($folderPath); - } else { - return false; - } - } - - public static function copyDirectory($source, $dest) - { - // Simple copy for a file - if (is_file($source)) { - return copy($source, $dest); - } - - // Make destination directory - if ( ! is_dir($dest)) { - mkdir($dest); - } - - // Loop through the folder - $dir = dir($source); - while (false !== $entry = $dir->read()) { - // Skip pointers - if ($entry == '.' || $entry == '..') { - continue; - } - - // Deep copy directories - if ($dest !== "$source/$entry") { - self::copyDirectory("$source/$entry", "$dest/$entry"); - } - } - - // Clean up - $dir->close(); - - return true; - } - public static function getTableAsString(IPF_ORM_Table $table) { $r[] = "
";