Created
September 14, 2014 13:27
-
-
Save anonymous/f215a229e46a1674c78d to your computer and use it in GitHub Desktop.
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 | |
require 'vendor/autoload.php'; | |
$loop = \React\EventLoop\Factory::create(); | |
$filesystem = new \React\Filesystem\Filesystem($loop); | |
$loop->addTimer(0.0001, function() use ($filesystem) { | |
$file = $filesystem->file(__FILE__); | |
$file->exists()->then(function() use ($file) { | |
echo __FILE__ . ' exists', PHP_EOL; | |
$file->size()->then(function($size) use ($file) { | |
var_export($size); | |
echo PHP_EOL; | |
$file->time()->then(function($time) { | |
var_export($time); | |
echo PHP_EOL;g | |
}); | |
}); | |
}); | |
$rm = $filesystem->file('./test_rm'); | |
$rm->exists()->then(function() use ($rm) { | |
$rm->remove()->then(function() { | |
echo 'test_rm removed', PHP_EOL; | |
}, function() { | |
echo 'test_rm note removed', PHP_EOL; | |
}); | |
}); | |
}); | |
$loop->run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment