Skip to content

Instantly share code, notes, and snippets.

@WyriHaximus
Created September 14, 2014 20:34
Show Gist options
  • Save WyriHaximus/8801c55a4e828014162d to your computer and use it in GitHub Desktop.
Save WyriHaximus/8801c55a4e828014162d to your computer and use it in GitHub Desktop.
Directory.php
public function ls() {
$deferred = new Deferred();
$this->filesystem->ls($this->path)->then(function($result) use ($deferred) {
$this->filesystem->getLoop()->futureTick(function() use ($result, $deferred) {
$this->processLsContents($result, $deferred);
});
}, function($error) use ($deferred) {
$deferred->reject($error);
});
return $deferred->promise();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment