diff --git a/examples b/examples index 0592f34..3474cc6 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit 0592f344e2ed2bc85831007ebb8ddd3c21d947d3 +Subproject commit 3474cc69d4307ce2bf0e85b7ad5c3e48b9359320 diff --git a/lib/FroalaEditor/File.php b/lib/FroalaEditor/File.php index 8b7fafd..6f43b31 100644 --- a/lib/FroalaEditor/File.php +++ b/lib/FroalaEditor/File.php @@ -2,6 +2,8 @@ namespace FroalaEditor; +use FroalaEditor\Utils\DiskManagement; + class File { public static $defaultUploadOptions = array( 'fieldname' => 'file', @@ -30,7 +32,7 @@ public static function upload($fileRoute, $options = NULL) { $options = array_merge(File::$defaultUploadOptions, $options); } - return \FroalaEditor_DiskManagement::upload($fileRoute, $options); + return DiskManagement::upload($fileRoute, $options); } /** @@ -41,7 +43,7 @@ public static function upload($fileRoute, $options = NULL) { */ public static function delete($src) { - return \FroalaEditor_DiskManagement::delete($src); + return DiskManagement::delete($src); } } diff --git a/lib/FroalaEditor/Image.php b/lib/FroalaEditor/Image.php index 6a2b288..8f0a525 100644 --- a/lib/FroalaEditor/Image.php +++ b/lib/FroalaEditor/Image.php @@ -2,6 +2,8 @@ namespace FroalaEditor; +use FroalaEditor\Utils\DiskManagement; + class Image { public static $defaultUploadOptions = array( 'fieldname' => 'file', @@ -33,7 +35,7 @@ public static function upload($fileRoute, $options = NULL) { } // Upload image. - return \FroalaEditor_DiskManagement::upload($fileRoute, $options); + return DiskManagement::upload($fileRoute, $options); } /** @@ -44,7 +46,7 @@ public static function upload($fileRoute, $options = NULL) { */ public static function delete($src) { // Delete image. - return \FroalaEditor_DiskManagement::delete($src); + return DiskManagement::delete($src); } /** diff --git a/lib/FroalaEditor/Utils/DiskManagement.php b/lib/FroalaEditor/Utils/DiskManagement.php index d6a6c55..28d8466 100644 --- a/lib/FroalaEditor/Utils/DiskManagement.php +++ b/lib/FroalaEditor/Utils/DiskManagement.php @@ -2,6 +2,8 @@ namespace FroalaEditor\Utils; +use FroalaEditor\Utils\Utils; + class DiskManagement { /** * Upload a file to the specified location. @@ -20,14 +22,14 @@ public static function upload($fileRoute, $options) { $fieldname = $options['fieldname']; if (empty($fieldname) || empty($_FILES[$fieldname])) { - throw new Exception('Fieldname is not correct. It must be: ' . $fieldname); + throw new \Exception('Fieldname is not correct. It must be: ' . $fieldname); } if ( isset($options['validation']) && !Utils::isValid($options['validation'], $fieldname) ) { - throw new Exception('File does not meet the validation.'); + throw new \Exception('File does not meet the validation.'); } // Get filename.