-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adicionada capa do livro e melhorado detalhes na lista e vizualização…
… única.
- Loading branch information
Showing
224 changed files
with
135 additions
and
101,467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
/** | ||
* Class FileManipulator | ||
*/ | ||
class FileManipulator | ||
{ | ||
|
||
private $path; | ||
|
||
/** | ||
* @param null $path | ||
*/ | ||
public function __construct($path = null) | ||
{ | ||
$this->path = dirname(__DIR__) . '/webroot/files'; | ||
if (!empty($path)) { | ||
$this->path = $path; | ||
} | ||
} | ||
|
||
/** | ||
* @param string $key | ||
* @todo: Validate image | ||
*/ | ||
public function doTheUpload(array $file) | ||
{ | ||
$destinationFile = $this->path . '/' . $file['name']; | ||
move_uploaded_file($file['tmp_name'], $destinationFile); | ||
} | ||
|
||
/** | ||
* @param $fileName | ||
* @param null $path | ||
*/ | ||
public function removeFile($fileName) | ||
{ | ||
$fileToRemove = $this->path . '/' . $fileName; | ||
unlink($fileToRemove); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.