-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from mmoreram/feature/temporary-and-specific-di…
…rectories Added temporary and specific directories
- Loading branch information
Showing
21 changed files
with
341 additions
and
68 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
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 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 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,27 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Extractor package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* Feel free to edit as you please, and have fun. | ||
* | ||
* @author Marc Morera <[email protected]> | ||
*/ | ||
|
||
namespace Mmoreram\Extractor\Filesystem\Interfaces; | ||
|
||
/** | ||
* Interface DirectoryInterface | ||
*/ | ||
interface DirectoryInterface | ||
{ | ||
/** | ||
* Get directory path | ||
* | ||
* @return string Directory path | ||
*/ | ||
public function getDirectoryPath(); | ||
} |
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,59 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Extractor package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* Feel free to edit as you please, and have fun. | ||
* | ||
* @author Marc Morera <[email protected]> | ||
*/ | ||
|
||
namespace Mmoreram\Extractor\Filesystem; | ||
|
||
use Mmoreram\Extractor\Filesystem\Interfaces\DirectoryInterface; | ||
|
||
/** | ||
* Class SpecificDirectory | ||
*/ | ||
class SpecificDirectory implements DirectoryInterface | ||
{ | ||
/** | ||
* @var string | ||
* | ||
* Directory path | ||
*/ | ||
public $directoryPath; | ||
|
||
/** | ||
* Construct method | ||
* | ||
* @param string $directoryPath Directory path | ||
*/ | ||
public function __construct($directoryPath) | ||
{ | ||
$this->directoryPath = realpath($directoryPath); | ||
} | ||
|
||
/** | ||
* Get directory path | ||
* | ||
* @return string Directory path | ||
*/ | ||
public function getDirectoryPath() | ||
{ | ||
return $this->directoryPath; | ||
} | ||
|
||
/** | ||
* String representation of the object | ||
* | ||
* @return string Directory path | ||
*/ | ||
public function __toString() | ||
{ | ||
return $this->getDirectoryPath(); | ||
} | ||
} |
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,57 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Extractor package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* Feel free to edit as you please, and have fun. | ||
* | ||
* @author Marc Morera <[email protected]> | ||
*/ | ||
|
||
namespace Mmoreram\Extractor\Filesystem; | ||
|
||
use Mmoreram\Extractor\Filesystem\Interfaces\DirectoryInterface; | ||
|
||
/** | ||
* Class TemporaryDirectory | ||
*/ | ||
class TemporaryDirectory implements DirectoryInterface | ||
{ | ||
/** | ||
* @var string | ||
* | ||
* Directory path | ||
*/ | ||
public $directoryPath; | ||
|
||
/** | ||
* Construct method | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->directoryPath = sys_get_temp_dir() . "/" . uniqid(time()); | ||
} | ||
|
||
/** | ||
* Get directory path | ||
* | ||
* @return string Directory path | ||
*/ | ||
public function getDirectoryPath() | ||
{ | ||
return $this->directoryPath; | ||
} | ||
|
||
/** | ||
* String representation of the object | ||
* | ||
* @return string Directory path | ||
*/ | ||
public function __toString() | ||
{ | ||
return $this->getDirectoryPath(); | ||
} | ||
} |
Oops, something went wrong.