Skip to content

Commit

Permalink
Use phramework/util
Browse files Browse the repository at this point in the history
  • Loading branch information
nohponex committed Mar 26, 2016
1 parent 96a8327 commit f113152
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 433 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"php": ">=7",
"ext-json": "*",
"phramework/validate": "dev-master#643f183ec41f5e87162d893be457bb98e62287bc",
"phramework/database": "dev-master#68299ecea5b1db0e256a34a6ec7892cff2b5f109"
"phramework/database": "dev-master#68299ecea5b1db0e256a34a6ec7892cff2b5f109",
"phramework/util": "dev-master"
},
"suggest": {
"ext-curl": "*"
Expand Down
7 changes: 4 additions & 3 deletions src/Models/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

use \Phramework\Models\Util;
use \Phramework\Exceptions\NotFoundException;
use Phramework\Util\File;

/**
* Upload class
Expand Down Expand Up @@ -60,7 +61,7 @@ public static function file(
throw new NotFoundException('File not found');
}
$filename = $file['name'];
$ext = Util::extension($filename);
$ext = File::extension($filename);
if (!in_array($ext, $allowedFiletypes)) {
return 'Incorrect file type';
}
Expand All @@ -77,7 +78,7 @@ public static function file(
} elseif ($parseExtension) {
$move['path'] .= '.' . $ext;
}
$destination = Util::get_path(
$destination = File::getPath(
isset($move['name'])
? [$move['path'], $move['name']]
: [$move['path']]
Expand Down Expand Up @@ -186,7 +187,7 @@ public static function image(

//If requires resize
if ($height > $value[0] || $width > $value[1]) {
$destinationName = \Util::get_path([ $destinationName, '_' . $key . ($PNG ? '.png' : 'jpg')]);
$destinationName = File::getPath([ $destinationName, '_' . $key . ($PNG ? '.png' : 'jpg')]);
$newheight = $value[0];
$newwidth = $value[1];
if ($width > $height) {
Expand Down
Loading

0 comments on commit f113152

Please sign in to comment.