]> git.andy128k.dev Git - ipf-legacy-orm.git/commitdiff
Image Thumbnailer
authoravl <alex.litovchenko@gmail.com>
Thu, 11 Sep 2008 00:42:13 +0000 (03:42 +0300)
committeravl <alex.litovchenko@gmail.com>
Thu, 11 Sep 2008 00:42:13 +0000 (03:42 +0300)
ipf/orm/import/builder.php
ipf/orm/utils.php

index 542594e442a7464c8daa5110b72fea6d3d522984..9f72a894ce85a2eab9974942c056f746b4c74ad1 100644 (file)
@@ -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;
         }
index 5664c70d1ce711743b28dba263e15a70c6a83fb5..5b2afc6e2d4b4c6262873320dfaef98b6fd3506b 100644 (file)
@@ -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[] = "<pre>";