public function addRoute($path, $cb)
    {
        $routeName = ltrim($path, '/');
        if (isset($this->routes[$routeName])) {
            Daemon::log(__METHOD__ . ': Route \'' . $path . '\' is already defined.');
            return false;
        }
        $this->routes[$routeName] = $cb;
        return true;
    }
public function addRoute($path, $cb)
    {
        $routeName = ltrim($path, '/');
        if (isset($this->routes[$routeName])) {
            Daemon::log(__METHOD__ . ': Route \'' . $path . '\' is already defined.');
            return false;
        }
        $this->routes[$routeName] = $cb;
        return true;
    }
public function addRoute ( $ path , $ cb ) { $ routeName = ltrim ( $ path , '/' ) ; if ( isset ( $ this -> routes [ $ routeName ] ) ) { Daemon :: log ( __METHOD__ . ': Route \'' . $ path . '\' is already defined.' ) ; return false ; } $ this -> routes [ $ routeName ] = $ cb ; return true ; }
Adds a route if it doesn't exist already.
@param  string $path Route name.
@param  callable $cb Route's callback.
@callback $cb ( )
@return boolean        Success.
Adds a route if it doesn t exist already .