src/Server.php
private function executeUserComponent($component, $action)
    {
        $ns = null;
        
        //
        if (!empty($this->config["classes"][$component][0])) {
            $ns = $this->config["classes"][$component][0];
        }

        //
        if (!empty($this->config["classes"][$component][1])) {
            $this->config['config'] = array_merge(
                $this->config['config'],
                $this->config["classes"][$component][1]
            );
        }

        //
        if (!empty($ns) && !file_exists($ns)) {
            $this->response = serialize([
                "error" => sprintf(Server::ERROR_USR_COMPONENT, $component),
                "code"  => 422
            ]);
            return;
        }

        //
        require($ns);

        //
        if (!class_exists($component)) {
            $this->response = serialize([
                "error" => sprintf(Server::ERROR_USR_COMPONENT, $component),
                "code"  => 422
            ]);
            return;
        }

        //
        return $this->execute($component, $action);
    }
private function executeUserComponent($component, $action)
    {
        $ns = null;
        
        //
        if (!empty($this->config["classes"][$component][0])) {
            $ns = $this->config["classes"][$component][0];
        }

        //
        if (!empty($this->config["classes"][$component][1])) {
            $this->config['config'] = array_merge(
                $this->config['config'],
                $this->config["classes"][$component][1]
            );
        }

        //
        if (!empty($ns) && !file_exists($ns)) {
            $this->response = serialize([
                "error" => sprintf(Server::ERROR_USR_COMPONENT, $component),
                "code"  => 422
            ]);
            return;
        }

        //
        require($ns);

        //
        if (!class_exists($component)) {
            $this->response = serialize([
                "error" => sprintf(Server::ERROR_USR_COMPONENT, $component),
                "code"  => 422
            ]);
            return;
        }

        //
        return $this->execute($component, $action);
    }
private function executeUserComponent ( $ component , $ action ) { $ ns = null ; // if ( ! empty ( $ this -> config [ "classes" ] [ $ component ] [ 0 ] ) ) { $ ns = $ this -> config [ "classes" ] [ $ component ] [ 0 ] ; } // if ( ! empty ( $ this -> config [ "classes" ] [ $ component ] [ 1 ] ) ) { $ this -> config [ 'config' ] = array_merge ( $ this -> config [ 'config' ] , $ this -> config [ "classes" ] [ $ component ] [ 1 ] ) ; } // if ( ! empty ( $ ns ) && ! file_exists ( $ ns ) ) { $ this -> response = serialize ( [ "error" => sprintf ( Server :: ERROR_USR_COMPONENT , $ component ) , "code" => 422 ] ) ; return ; } // require ( $ ns ) ; // if ( ! class_exists ( $ component ) ) { $ this -> response = serialize ( [ "error" => sprintf ( Server :: ERROR_USR_COMPONENT , $ component ) , "code" => 422 ] ) ; return ; } // return $ this -> execute ( $ component , $ action ) ; }
Execute user component
Execute user component