src/Phastlight/System.php
public function import($name)
    {
        $object = null;
        if (!isset($this->modules[$name])) {
            if (isset($this->moduleMap[$name])) {
                $object_class = $this->moduleMap[$name];
                $object = new $object_class();
                $object->setSystem($this);
                $object->setEventLoop($this->eventLoop);
                $this->modules[$name] = $object;
            }
        }
        else{
            $object = $this->modules[$name]; 
        }

        return $object;

    }
public function import($name)
    {
        $object = null;
        if (!isset($this->modules[$name])) {
            if (isset($this->moduleMap[$name])) {
                $object_class = $this->moduleMap[$name];
                $object = new $object_class();
                $object->setSystem($this);
                $object->setEventLoop($this->eventLoop);
                $this->modules[$name] = $object;
            }
        }
        else{
            $object = $this->modules[$name]; 
        }

        return $object;

    }
public function import ( $ name ) { $ object = null ; if ( ! isset ( $ this -> modules [ $ name ] ) ) { if ( isset ( $ this -> moduleMap [ $ name ] ) ) { $ object_class = $ this -> moduleMap [ $ name ] ; $ object = new $ object_class ( ) ; $ object -> setSystem ( $ this ) ; $ object -> setEventLoop ( $ this -> eventLoop ) ; $ this -> modules [ $ name ] = $ object ; } } else { $ object = $ this -> modules [ $ name ] ; } return $ object ; }
import a module based on name, similar to node.js's require
import a module based on name similar to node . js s require