Last active
January 21, 2019 13:34
-
-
Save stefpe/022d07260ef7813bc00ecf305e964a0e to your computer and use it in GitHub Desktop.
FilesystemStack
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
<?php | |
/** | |
* This is project's console commands configuration for Robo task runner. | |
* | |
* @see http://robo.li/ | |
*/ | |
class RoboFile extends \Robo\Tasks | |
{ | |
/** | |
* Prepare file system structure. | |
* @return mixed | |
*/ | |
public function prepareFs() | |
{ | |
$collection = $this->collectionBuilder(); | |
$collection->taskFilesystemStack() | |
->mkdir('g') | |
->touch('g/g.txt'); | |
$collection->taskFilesystemStack() | |
->mkdir('g/h') | |
->touch('g/h/h.txt'); | |
$collection->taskFilesystemStack() | |
->mkdir('g/h/i/c') | |
->touch('g/h/i/i.txt'); | |
$collection->rollback( | |
$this->taskDeleteDir('g') | |
); | |
$collection->run(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment