移除资源
@param $resource
@return bool
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;
    }
139976
public function contains($resource)
    {
        foreach ($this->resources as $containedResource) {
            if (is_string($containedResource) && $containedResource == $resource) {
                return true;
            }

            if ($containedResource instanceof Finder && $this->directoryContains($containedResource, $resource)) {
                return true;
            }
        }

        return false;
    }
227201
public static function isEmpty($resource)
    {
        if (!self::isValid($resource) &&
            null !== $resource) {
            return false;
        }

        return String::isEmpty($resource);
    }
588335
public function load($resource)
    {
        if ($this->cacher->check($resource)) {
            return $this->cacher->retrieve($resource);
        }

        $this->reader->open($resource);

        /** @var \Yosmanyga\Validation\Resource\Definition\ObjectDefinition[] $definitions */
        $definitions = [];
        /** @var \Yosmanyga\Validation\Validator\ObjectValidator[] $validators */
        $validators = [];
        while ($data = $this->reader->current()) {
            /** @var \Yosmanyga\Validation\Resource\Definition\ObjectDefinition $definition */
            $definition = $this->normalizer->normalize($data, $resource);

            $definitions[$definition->class] = $definition;
            $validators[$definition->class] = $this->compiler->compile($definition);

            $this->reader->next();
        }

        $validators = $this->fillObjectValidators($definitions, $validators);

        $this->cacher->store($validators, $resource);

        return $validators;
    }
1230075
protected function resourceExists($resource)
    {
        if (!$resource) {
            return false;
        }
        if ($resource instanceof ModuleResource) {
            return $resource->exists();
        }
        $base = rtrim(Director::baseFolder(), '/');
        return file_exists($base . '/' . $resource);
    }
243278
protected function matchType(DomainResource $resource)
    {
        foreach ($this->getOperations() as $operation => $name) {
            if ($resource->type === $this->type . "_$operation") {
                return $operation;
            }
        }

        return false;
    }
843956
public function supports($resource, $type = null){
		$resolver = $this->getResolverForResource($resource, $type);
		return $resolver->resolve($resource, $type) !== false;
	}
1305102
public function hash($resource)
    {
        rewind($resource);
        $context = hash_init($this->algo);
        hash_update_stream($context, $resource);
        fclose($resource);

        return hash_final($context);
    }
450456
protected function resourceExists($resource)
    {
        /** @var \DreamFactory\Core\Contracts\ServiceResponseInterface $rs */
        $rs = ServiceManager::handleRequest($this->service->getName(), Verbs::GET, $resource);
        if ($rs->getStatusCode() === HttpStatusCodes::HTTP_NOT_FOUND) {
            return false;
        }

        return true;
    }
424765
public function release($resource)
    {
        $this->idlePool->enqueue($resource);
        //有任务要做
        if (count($this->taskQueue) > 0)
        {
            $this->doTask();
        }
    }
1031741
private function getIssue($resource)
    {
        if (strncmp($resource, 'jira:', 5) === 0) {
            return substr($resource, 5);
        }

        return $this->jiraService->getIssue($resource);
    }
1158782
public function equals( core_kernel_classes_Resource $resource)
    {
        $returnValue = (bool) false;
        $returnValue = $this->getUri() == $resource->getUri();
        return (bool) $returnValue;
    }
1373132
protected function isGDResource($resource)
    {
        if (!is_resource($resource)) {
            return false;
        }

        if (strtolower(get_resource_type($resource) != 'gd')) {
            return false;
        }

        return true;
    }
84122
public function isLocked($resource = null): bool
    {
        return $this->hasSharedLock($resource) || $this->hasExclusiveLock($resource);
    }
693102
public function resolveLoader($resource)
    {
        foreach ($this->loaders as $loader) {
            if ($loader->supports($resource)) {
                return $loader;
            }
        }

        return null;
    }
366440
protected function hasError($resource)
    {
        // No error if no resource
        if (empty($resource)) {
            return false;
        }

        // If the error code is empty the statement / connection has not been run yet
        $code = $resource->errorCode();
        if (empty($code)) {
            return false;
        }

        // Skip 'ok' and undefined 'warning' types.
        // @see http://docstore.mik.ua/orelly/java-ent/jenut/ch08_06.htm
        return $code !== '00000' && $code !== '01000';
    }
55905
private function getResourceData($resource)
    {
        $data = false;
        if(!is_null($resource) && $resource->exists()) {
            $resourceTypes = array_keys($resource->getTypes());
            $data = [
                'uri'        => $resource->getUri(),
                'classUri'   => $resourceTypes[0],
                'label'      => $resource->getLabel(),
                'type'       => 'instance'
            ];
        }
        return $data;
    }