Returns true if the zip file represents an SEC package
{@inheritDoc}
@see XBRL_IPackage::isPackage()
508965
public function isPackage()
	{
		// A simple package does not have a manifest file
		try
		{
			// There must be just one root folder with the format 'us-gaap-yyyy-mm-dd'
			if ( count( $this->contents ) != 1 ) return false;

			$root = $this->getFirstFolderName();
			$matches = false;
			if ( ! preg_match( "/^us-gaap-(?<date>(?<year>\d{4,4})-\d{2,2}-\d{2,2})$/", $root, $matches ) )
			{
				return false;
			}

			$this->publicationDate = $matches['date'];

			$found = false;
			$this->traverseContents( function( $path, $name, $type ) use( &$found )
			{
				if ( $type == PATHINFO_DIRNAME ) return true;
				$found = $name == XBRL_SEC_XML_Package::manifestFilename || XBRL::endsWith( $name, '.json' );
				return ! $found;
			} );

			if ( $found )
			{
				throw XBRL_TaxonomyPackageException::withError( "tpe:metadataFileFound", "The package contains a manifest.xml file or JSON manifest file." );
			}

			if ( isset( XBRL_US_TaxonomyPackage::$defaultEntryPoints[ $this->publicationDate ] ) )
			{
				$this->schemaFile = XBRL_US_TaxonomyPackage::$defaultEntryPoints[ $this->publicationDate ];
				$this->actualSchemaFilename = $this->getActualUri( $this->schemaFile );
				// $this->schemaNamespace = XBRL_US_TaxonomyPackage::namespacePrefix . "{$matches['date']}/";
			}
			else
			{
				$this->schemaFile = XBRL_US_TaxonomyPackage::filePrefix . "{$this->taxonomyYear}/elts/us-gaap-{$matches['date']}.xsd";
				$this->actualSchemaFilename = "{$root}/elts/us-gaap-{$matches['date']}.xsd";
			}

			$this->taxonomyYear = $matches['year'];
			$contents = $this->getFile( $this->actualSchemaFilename );
			if ( ! $contents )
			{
				throw XBRL_TaxonomyPackageException::withError( "tpe:noSchemaFileFound", "The package must contain a schema file (.xsd)." );
			}

			$this->schemaNamespace = $this->getTargetNamespace( $this->actualSchemaFilename, $contents );
			// $this->schemaNamespace = XBRL_US_TaxonomyPackage::namespacePrefix . "{$matches['date']}/";

			return true;
		}
		catch ( Exception $ex )
		{
			$code = $ex instanceof XBRL_TaxonomyPackageException ? $ex->error : $ex->getCode();
			$this->errors[ $code ] = $ex->getMessage();
		}

		return false;
	}
1212897
function checkPackageMaintainer( $package, &$persistentData )
    {
        $roleList = eZPackage::fetchMaintainerRoleIDList( $this->packageType( $package, $persistentData ), true );
        if ( count( $roleList ) > 0 )
        {
            if ( $package instanceof eZPackage )
            {
                $maintainerPerson = false;
                $user = eZUser::currentUser();
                   $userObject = $user->attribute( 'contentobject' );
                if ( $userObject )
                    $maintainerPerson = $userObject->attribute( 'name' );

                $maintainers = $package->attribute( 'maintainers' );
                foreach ( $maintainers as $maintainer )
                {
                    if ( $maintainer['person'] == $maintainerPerson )
                    {
                           return false;
                    }
                }
            }
            return true;
        }
        return false;
    }
117324
public function hasComposerPackage($vendor, $dev = false)
    {

        $packages = !$dev
            ? $this->composer->getRequire()
            : $this->composer->getRequireDev();

        return isset($packages[$vendor]);
    }
586740
public function is(string $mode): bool
    {
        $rel_dir = $this->getUtilities()->fileSystem->relativeDir();

        return
            ('package' === $mode && $rel_dir) ||
            ('theme' === $mode && !$rel_dir);
    }
540399
public function packageExists($namespace, $package)
    {
        $folder = $this->vendorFolder . $namespace;
        $folderExists = file_exists($folder);

        if (!$folderExists) {
            return false;
        }

        $packageFolder = $folder . '/' . $package;
        $packageFolderExists = file_exists($packageFolder);

        return $packageFolderExists;
    }
288549
protected boolean checkExcludePackages(String classPackageName) {
		if (excludePackages != null && excludePackages.length > 0) {
			WildcardHelper wildcardHelper = new WildcardHelper();

			// we really don't care about the results, just the boolean
			Map<String, String> matchMap = new HashMap<String, String>();

			for (String packageExclude : excludePackages) {
				int[] packagePattern = wildcardHelper.compilePattern(packageExclude);
				if (wildcardHelper.match(matchMap, classPackageName, packagePattern)) {
					return false;
				}
			}
		}
		return true;
	}
394535
public function checkRegisterRoles($packageId = '', $carrier = '', $isPackage = FALSE)
    {
        $packageSettings           = $this->packageSettings;
        $currentSessionListPackage = $this->getListUserPackageId();
        if (is_array($currentSessionListPackage)) {
            if (in_array($packageId, $currentSessionListPackage)) {
                return TRUE;
            }
            if ($isPackage !== TRUE) {
                foreach ($currentSessionListPackage as $params) {
                    $packageGroup = $packageSettings[$carrier][$params]['category_group'];
                    if (in_array($packageId, $packageGroup)) {
                        return TRUE;
                    }
                }
            }
        }
        if ($isPackage !== TRUE) {
            $packageGroup = $packageSettings[$carrier][$packageId]['category_group'];
            if (in_array($currentSessionListPackage, $packageGroup)) {
                return TRUE;
            }
        }
        if ($packageId == $currentSessionListPackage) {
            return TRUE;
        }

        return FALSE;
    }
582509
public function isPackageFrozen($packageKey)
    {
        if (!isset($this->packages[$packageKey])) {
            return false;
        }
        $composerName = $this->packages[$packageKey]->getComposerName();

        return (
            $this->bootstrap->getContext()->isDevelopment()
            && isset($this->packageStatesConfiguration['packages'][$composerName]['frozen'])
            && $this->packageStatesConfiguration['packages'][$composerName]['frozen'] === true
        );
    }
676145
public function isPackage()
	{
		if ( ! parent::isPackage() ) return false;

		$url = "http://www.esma.europa.eu/";

		// If it is a package then is it an ESMA taxonomy package?
		// It is if the publisher url is the ESMA url
		if ( $this->publisherURL == $url ) return true;

		// Or any one of the entry points starts with the url
		foreach ( $this->getSchemaEntryPoints() as $entryPoint )
		{
			// if ( XBRL::startsWith( $entryPoint, $url ) ) return true;
		}

		// Now check the schema file to see if it references a recognized namespace
		return $this->getIsExtensionTaxonomy();
	}
1048691
public boolean validatePackageNameType(String packageNameType, DiagnosticChain diagnostics, Map<Object, Object> context) {
		return true;
	}
1005414
public function isPackage()
	{
		// A simple package does not have a manifest file
		try
		{
			$found = false;

			$this->traverseContents( function( $path, $name, $type ) use( &$found )
			{
				if ( $type == PATHINFO_DIRNAME ) return true;
				$found = $name == XBRL_SEC_XML_Package::manifestFilename || XBRL::endsWith( $name, '.json' );
				return ! $found;
			} );

			if ( $found )
			{
				throw XBRL_TaxonomyPackageException::withError( "tpe:metadataFileFound", "The package contains a manifest.xml file or JSON manifest file." );
			}

			// Look for the schema file
			$this->traverseContents( function( $path, $name, $type ) use( &$found )
			{
				if ( $type == PATHINFO_DIRNAME ) return true;
				$found = $name == XBRL::endsWith( $name, '.xsd' );
				if ( $found ) $this->schemaFile = XBRL::normalizePath( ( $path ? "$path/" : "" ) . $name );
				return ! $found;
			} );

			if ( ! $found )
			{
				throw XBRL_TaxonomyPackageException::withError( "tpe:noSchemaFileFound", "The package must contain a schema file (.xsd)." );
			}

			return true;
		}
		catch ( Exception $ex )
		{
			$code = $ex instanceof XBRL_TaxonomyPackageException ? $ex->error : $ex->getCode();
			$this->errors[ $code ] = $ex->getMessage();
		}

		return false;
	}
497056
public static boolean isValidJavaPackage(String packageName) {
        if (isBlank(packageName)) {
            return false;
        }
        final String[] parts = packageName.split("\\.");
        for (String part : parts) {
            if (!isValidJavaIdentifier(part)) {
                return false;
            }
        }
        return true;
    }
49789
public static function exists($package)
	{
		if (array_key_exists($package, static::$packages))
		{
			return static::$packages[$package];
		}
		else
		{
			$paths = \Config::get('package_paths', array());
			empty($paths) and $paths = array(PKGPATH);

			foreach ($paths as $path)
			{
				if (is_dir($path.$package))
				{
					return $path.$package.DS;
				}
			}
		}

		return false;
	}
312834
protected function isDrupalPackage($package)
    {
        if (isset($package) && $package instanceof PackageInterface && strstr($package->getName(), 'drupal/')) {
            return true;
        }
        return false;
    }
336528
private boolean hasPrintedPackageIndex(PackageElement pkg) {
        for (PackageElement printedPkg : printedPackageHeaders) {
            if (utils.getPackageName(pkg).startsWith(utils.parsePackageName(printedPkg))) {
                return true;
            }
        }
        return false;
    }
275675
private function isInstalledGlobally($package)
    {
        if (!isset($this->globalList)) {
            $this->globalList = $this->shell->execute(
                ['npm', 'ls', '--global', '--no-progress', '--depth=0']
            );
        }

        return $this->globalList && strpos($this->globalList, $package . '@') !== false;
    }
972924
public function installed(string $package): bool
    {
        $manifest = $this->files->get('composer.json');
        $manifest = json_decode($manifest, true);

        return collect($manifest['require'])
            ->merge($manifest['require-dev'])
            ->keys()
            ->contains($package);
    }