null
);
- IPF_ORM_Utils::makeDirectories($path);
+ IPF_Utils::makeDirectories($path);
$writePath = $path . DIRECTORY_SEPARATOR . $className . $this->_suffix;
// 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;
}
}
}
- 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>";