@param mixed $resource

@return bool
12522
protected static function isCertificateResource($resource): bool {
        if(!is_resource($resource)) {
            return FALSE;
        }
        if(get_resource_type($resource) != 'OpenSSL X.509') {
            return FALSE;
        }
        return TRUE;
    }
297355
public static function toObject($resource) {
		if (self::isObject($resource)) {
			return $resource;

		} else if (self::isArray($resource)) {
			return self::buildObject($resource);

		} else if (self::isJson($resource)) {
			return json_decode($resource);

		} else if ($ser = self::isSerialized($resource)) {
			return self::toObject($ser);

		} else if ($xml = self::isXml($resource)) {
			return $xml;
		}

		return $resource;
	}
966604
public function isFresh(array $resources)
    {
        if (!file_exists($this->file)) {
            return false;
        }

        $timestamp = filemtime($this->file);

        foreach ($resources as $resource) {
            if ($resource instanceof FileResource && $timestamp < $resource->getMetadata()->getModificationTime()) {
                return false;
            }
        }

        return true;
    }
1131429
public static function getResourceParser($resource)
    {
        if(self::$_resourceLoader) {
            $type = preg_replace("/[^A-Za-z0-9_]/", " ", get_resource_type($resource));
            $type = str_replace(" ","", ucwords($type));
            return self::$_resourceLoader->load($type);
        }
        return false;
    }
378210
public function hasFailedResource(ResourceNode $resource)
    {
        return !is_null($this->failedResourceIds) && in_array($resource->getId(), $this->failedResourceIds);
    }
109960
public function deleteAction( $resource )
	{
		$response = $this->createAdmin( $resource )->delete( $this->getPsrRequest(), new Response() );
		return $this->setPsrResponse( $response );
	}
538965
public function hasExclusiveLock($resource = null): bool
    {
        if (null !== $resource) {
            return $this->exclusiveLock === $this->getResourceId($resource);
        }

        return null !== $this->exclusiveLock;
    }
232866
public function resolveURL($resource)
    {
        // Skip blank resources
        if (empty($resource)) {
            return null;
        }

        // Resolve resource to reference
        $resource = $this->resolveResource($resource);

        // Resolve resource to url
        /** @var ResourceURLGenerator $generator */
        $generator = Injector::inst()->get(ResourceURLGenerator::class);
        return $generator->urlForResource($resource);
    }
43527
public function supports($resource, $type = null)
    {
        try {
            $path = $this->locator->locate($resource);
        } catch (\Exception $e) {
            return false;
        }

        return 'module' === $type && is_string($resource) && is_dir($path);
    }
1347386
public function getIssue($resource)
    {
        $hashPosition = strpos($resource, '#');
        if ($hashPosition !== false) {
            $resource = substr($resource, 0, $hashPosition);
        }

        $url = $this->host . '/browse/';

        if (strncmp($resource, $url, strlen($url)) === 0) {
            return substr($resource, strlen($url));
        }
    }
338728
function remove($resource)
    {
        $rid = spl_object_hash($resource);
        if (!isset($this->resourcePool[$rid]))
        {
            return false;
        }
        //从resourcePool中删除
        unset($this->resourcePool[$rid]);
        $this->resourceNum--;
        return true;
    }
15653
public function isAllowed($resource = null, $privilege = null)
    {
        if (is_array($privilege)) {
            foreach ($privilege as $privilegeSingular) {
                if ($this->isAllowed($resource, $privilegeSingular)) {
                    return true;
                }
            }
            return false;
        }
        try {
            $result = $this->getContextualAcl()->isAllowed($this->getContextId(), $resource, $privilege);
        } catch (InvalidArgumentException $e) {
            return false;
        }
        return $result;
    }
250007
public function setResource($resource)
    {
        $this->resource = $resource;

        if (null !== $resource) {
            $this->stopPropagation();
        }

        return $this;
    }
46540
public function remove( Resource $resource )
    {
        $cnt = 0;
        if( false !== $key = array_search( $resource, $this->instances, true ) ) {
            unset( $this->instances[$key] );
            $cnt++;
        }
        return $cnt;
    }
1223419
public function isGranted($resource, $action = 'view')
    {
        return $this->aclOperator->isAccessGranted($resource, $this->getPermission($action));
    }
723028
protected function isPublic(string $resource, $methods = null)
    {
        if (($this->authentication ?? null) === null) {
            return true;
        }

        $resource_data = $this->resources[$resource] ?? null;
        if ($resource_data === null) {
            return false;
        }

        $public = $resource_data['public'] ?? $this->default_publicity;
        if (is_string($public)) {
            $public = [$public];
        }

        $methods = (array) ($methods ?? $this->method);

        return (is_array($public))
            ? !empty(array_intersect($public, $methods))
            : (bool) $public;
    }
1231821
public function optionsAction( $resource )
	{
		$response = $this->createAdmin( $resource )->options( $this->getPsrRequest(), new Response() );
		return $this->setPsrResponse( $response );
	}