Commits

Anonymous committed c4dbbb4 Merge

Merge branch 'master' of https://bitbucket.org/ThomasWeinert/carica-io into dio

  • Participants
  • Parent commits 41749e4, 1cc7bb6

Comments (0)

Files changed (10)

example/Http/ajax/ajax.php

 <?php
-include('../../../src/Carica/Io/Loader.php');
+include(__DIR__.'/../../../src/Carica/Io/Loader.php');
 Carica\Io\Loader::register();
 
 use Carica\Io\Network\Http;

example/Http/hello-world.php

 <?php
-include('../../src/Carica/Io/Loader.php');
+include(__DIR__.'/../../src/Carica/Io/Loader.php');
 Carica\Io\Loader::register();
 
 $server = new Carica\Io\Network\Server();

example/Http/route.php

 <?php
-include('../../src/Carica/Io/Loader.php');
+include(__DIR__.'/../../src/Carica/Io/Loader.php');
 Carica\Io\Loader::register();
 
 use Carica\Io\Network\Http;

example/MySQL/parallel.php

 <?php
-include('../../src/Carica/Io/Loader.php');
+include(__DIR__.'/../../src/Carica/Io/Loader.php');
 Carica\Io\Loader::register();
 
 use Carica\Io;

example/Serial/monitor.php

 <?php
-include('../../src/Carica/Io/Loader.php');
+include(__DIR__.'/../../src/Carica/Io/Loader.php');
 Carica\Io\Loader::register();
 
 use Carica\Io;
   }
 }
 
-include('../src/Carica/Io/Loader.php');
+include(__DIR__.'/../src/Carica/Io/Loader.php');
 Carica\Io\Loader::register();
 use Carica\Io;
 
 <?php
 
-include('../src/Carica/Io/Loader.php');
+include(__DIR__.'/../src/Carica/Io/Loader.php');
 Carica\Io\Loader::register();
 use Carica\Io\Event\Loop;
 

example/stream-read.php

 <?php
 
-include('../src/Carica/Io/Loader.php');
+include(__DIR__.'/../src/Carica/Io/Loader.php');
 Carica\Io\Loader::register();
 
 use Carica\Io\Event\Loop;
 use Carica\Io\Stream;
 
 $loop = Loop\Factory::get();
-$write = fopen('c:/temp/sample.txt', 'w');
+$write = fopen('c:/tmp/sample.txt', 'w');
 
-$stream = new Stream\File('c:/temp/sample.txt');
+$stream = new Stream\File('c:/tmp/sample.txt');
 $stream->events()->on(
   'read-data',
   function($data) {
   }
 );
 
-if ($stream->open()) {
-  $loop->setInterval(
-    function () use ($write) {
-      fwrite($write, microtime(TRUE)."\n");
-    },
-    1000
-  );
+$loop->setInterval(
+  function () use ($write) {
+    fwrite($write, microtime(TRUE)."\n");
+  },
+  1000
+);
 
-  $loop->run();
-}
+$stream->open();
+$loop->run();

example/timetalk.php

 <?php
 
-include('../src/Carica/Io/Loader.php');
+include(__DIR__.'/../src/Carica/Io/Loader.php');
 Carica\Io\Loader::register();
 use Carica\Io;
 

src/Carica/Io/Event/Loop/StreamSelect.php

 
     private function tick() {
       if ($this->_running) {
-        if ($this->_hasStreams) {
+        if ($this->_hasResources) {
           $read = $this->_resources['read'];
           $write = $this->_resources['write'];
           $except = $this->_resources['except'];
     }
 
     private function updateStreamStatus() {
-      $this->_hasStreams = (
+      $this->_hasResources = (
         count($this->_resources['read']) > 0 ||
         count($this->_resources['write']) > 0 ||
         count($this->_resources['except']) > 0