src/Server.php
private function executeCoreComponent($component, $action)
    {
        // define component namespace
        $ns = "\\Plinker\\".ucfirst($component);

        if (class_exists($ns)) {
            //
            $response = $this->execute($ns, $action);
        } elseif (class_exists($ns."\\".ucfirst($component))) {
            //
            $ns = "\\Plinker\\".ucfirst($component)."\\".ucfirst($component);
            $response = $this->execute($ns, $action);
        } else {
            if (empty($component) && $action === "info") {
                $response = $this->info();
            } else {
                $response = sprintf(Server::ERROR_EXT_COMPONENT, $component);
            }
        }
        
        return $response;
    }
private function executeCoreComponent($component, $action)
    {
        // define component namespace
        $ns = "\\Plinker\\".ucfirst($component);

        if (class_exists($ns)) {
            //
            $response = $this->execute($ns, $action);
        } elseif (class_exists($ns."\\".ucfirst($component))) {
            //
            $ns = "\\Plinker\\".ucfirst($component)."\\".ucfirst($component);
            $response = $this->execute($ns, $action);
        } else {
            if (empty($component) && $action === "info") {
                $response = $this->info();
            } else {
                $response = sprintf(Server::ERROR_EXT_COMPONENT, $component);
            }
        }
        
        return $response;
    }
private function executeCoreComponent ( $ component , $ action ) { // define component namespace $ ns = "\\Plinker\\" . ucfirst ( $ component ) ; if ( class_exists ( $ ns ) ) { // $ response = $ this -> execute ( $ ns , $ action ) ; } elseif ( class_exists ( $ ns . "\\" . ucfirst ( $ component ) ) ) { // $ ns = "\\Plinker\\" . ucfirst ( $ component ) . "\\" . ucfirst ( $ component ) ; $ response = $ this -> execute ( $ ns , $ action ) ; } else { if ( empty ( $ component ) && $ action === "info" ) { $ response = $ this -> info ( ) ; } else { $ response = sprintf ( Server :: ERROR_EXT_COMPONENT , $ component ) ; } } return $ response ; }
Execute core component
Execute core component