public function getModuleIdFromZip($file)
    {
        $list = $this->getFilesFromZip($file);

        if (empty($list)) {
            return false;
        }

        $folder = reset($list);

        if (strrchr($folder, '/') !== '/') {
            return false;
        }

        $nested = 0;
        foreach ($list as $item) {
            if (strpos($item, $folder) === 0) {
                $nested++;
            }
        }

        if (count($list) != $nested) {
            return false;
        }

        return rtrim($folder, '/');
    }
public function getModuleIdFromZip($file)
    {
        $list = $this->getFilesFromZip($file);

        if (empty($list)) {
            return false;
        }

        $folder = reset($list);

        if (strrchr($folder, '/') !== '/') {
            return false;
        }

        $nested = 0;
        foreach ($list as $item) {
            if (strpos($item, $folder) === 0) {
                $nested++;
            }
        }

        if (count($list) != $nested) {
            return false;
        }

        return rtrim($folder, '/');
    }
public function getModuleIdFromZip ( $ file ) { $ list = $ this -> getFilesFromZip ( $ file ) ; if ( empty ( $ list ) ) { return false ; } $ folder = reset ( $ list ) ; if ( strrchr ( $ folder , '/' ) !== '/' ) { return false ; } $ nested = 0 ; foreach ( $ list as $ item ) { if ( strpos ( $ item , $ folder ) === 0 ) { $ nested ++ ; } } if ( count ( $ list ) != $ nested ) { return false ; } return rtrim ( $ folder , '/' ) ; }
Returns a module id from a zip file or false on error
@param string $file
@return boolean|string
Returns a module id from a zip file or false on error