I hereby claim:
- I am WyriHaximus on github.
- I am Wyrihaximus (https://keybase.io/Wyrihaximus) on keybase.
- I have a public key whose fingerprint is 40D0 D8C1 E5DD 7306 3892 149D ADF6 175A D7DA 8B95
To claim this, I am signing this object:
| <?php | |
| /** | |
| * AutoHelperView | |
| * Provides automatic helper loading for views. | |
| * | |
| * @author Joe Beeson <[email protected]> | |
| * @auther Cees-Jan Kiewiet <[email protected]> | |
| */ | |
| class AutoHelperView extends View { |
| upstream websocketdomain{ | |
| server 127.0.0.1:54321; | |
| } | |
| server { | |
| server_name domain; | |
| access_log /path/to/logs/domain.access_log; | |
| error_log /path/to/logs/domain.error_log; | |
| $buffer = ''; | |
| $request = $this->client->request($method, $url, $headers); | |
| $request->on('response', function($response) use (&$buffer) { | |
| $response->on('data', function($data) use (&$buffer) { | |
| $buffer .= $data; | |
| if (strpos($buffer, PHP_EOL) !== false) { | |
| $tweets = explode(PHP_EOL, $buffer); | |
| $buffer = array_pop($tweets); | |
| foreach ($tweets as $tweet) { | |
| if (strlen(trim($tweet)) > 0) { |
| <?php | |
| use Flysystem\FilesystemInterface; | |
| use Flysystem\PluginInterface; | |
| class MetadataSerializer implements PluginInterface { | |
| protected $filesystem; | |
| protected $fieldName; |
I hereby claim:
To claim this, I am signing this object:
| $buffer = ''; | |
| $conn->on('data', function($data, $conn) use (&$buffer) { | |
| $buffer .= $data; | |
| if (strpos($buffer, PHP_EOL) !== false) { | |
| $lines = explode(PHP_EOL, $buffer); | |
| $buffer = array_pop($lines); | |
| foreach ($lines as $line) { | |
| // do something with $line | |
| } | |
| } |
| 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); |
| public function chownRecursive($uid = -1, $gid = -1) { | |
| $deferred = new Deferred(); | |
| $this->ls()->then(function($list) use ($deferred, $uid, $gid) { | |
| $this->filesystem->getLoop()->futureTick(function() use ($list, $deferred, $uid, $gid) { | |
| $promises = []; | |
| foreach ($list as $node) { | |
| if ($node instanceof Directory) { |
| protected $recursiveInvoker; | |
| protected function getRecursiveInvoker() { | |
| if ($this->recursiveInvoker instanceof RecursiveInvoker) { | |
| return $this->recursiveInvoker; | |
| } | |
| $this->recursiveInvoker = new RecursiveInvoker($this); | |
| return $this->recursiveInvoker; |
| <?php | |
| require 'vendor/autoload.php'; | |
| $loop = \React\EventLoop\Factory::create(); | |
| function yieldPromiseA($promise) { | |
| while (true) { | |
| echo 'a', PHP_EOL; | |
| echo (yield \Async\Util::async($promise)), PHP_EOL; |