public function whichModule($object){
        $reflection = new \ReflectionClass($object);
        $ns = explode('\\', $reflection->getNamespaceName());
        
        if (class_exists($ns[0] . '\Module')) {
            $reflection = new \ReflectionClass($ns[0] . '\Module');
            return strtolower(basename(dirname($reflection->getFileName())));
        } else {
            $path = $reflection->getFileName();
            $dirs = $this->getOption('module_dirs');
             
            foreach($dirs as $dir){
                $dir = realpath($dir);
            
                if(strpos($path, $dir) === 0){
                    $dir = substr($path, strlen($dir));
                    $dir = ltrim($dir, DIRECTORY_SEPARATOR);
            
                    $a = explode(DIRECTORY_SEPARATOR, $dir);
                    return strtolower($a[0]);
                }
            }
        }

        return null;
    }