src/Classes/Module.php
public static function getInstance()
    {
        $args = func_get_args();
        if (count($args) == 2)
        {
            $author = $args[0];
            $name = $args[1];
        }

        elseif (count($args) == 1)
        {
            list($author, $name) = explode('\\', $args[0]);
        }
        else
            throw  new \Exception();
        // check module is exist in host
        if (!self::checkOnDisk($author, $name))
            return null;
        if (!isset(self::$instance[$author . '*' . $name]))
        {
            // get class namespace
            $class = strval(\App::getNamespace() . 'Modules\\' . $author . '\\' . $name . '\\Module');
            $object = new $class;
            self::$instance[$author . '*' . $name] = $object;

            // get data from database

        }
        return self::$instance[$author . '*' . $name];
    }
public static function getInstance()
    {
        $args = func_get_args();
        if (count($args) == 2)
        {
            $author = $args[0];
            $name = $args[1];
        }

        elseif (count($args) == 1)
        {
            list($author, $name) = explode('\\', $args[0]);
        }
        else
            throw  new \Exception();
        // check module is exist in host
        if (!self::checkOnDisk($author, $name))
            return null;
        if (!isset(self::$instance[$author . '*' . $name]))
        {
            // get class namespace
            $class = strval(\App::getNamespace() . 'Modules\\' . $author . '\\' . $name . '\\Module');
            $object = new $class;
            self::$instance[$author . '*' . $name] = $object;

            // get data from database

        }
        return self::$instance[$author . '*' . $name];
    }
public static function getInstance ( ) { $ args = func_get_args ( ) ; if ( count ( $ args ) == 2 ) { $ author = $ args [ 0 ] ; $ name = $ args [ 1 ] ; } elseif ( count ( $ args ) == 1 ) { list ( $ author , $ name ) = explode ( '\\' , $ args [ 0 ] ) ; } else throw new \ Exception ( ) ; // check module is exist in host if ( ! self :: checkOnDisk ( $ author , $ name ) ) return null ; if ( ! isset ( self :: $ instance [ $ author . '*' . $ name ] ) ) { // get class namespace $ class = strval ( \ App :: getNamespace ( ) . 'Modules\\' . $ author . '\\' . $ name . '\\Module' ) ; $ object = new $ class ; self :: $ instance [ $ author . '*' . $ name ] = $ object ; // get data from database } return self :: $ instance [ $ author . '*' . $ name ] ; }
get instance of module object
@param $author
@param $name
@return bool|Module
get instance of module object