Determines whether the current handler is appropriate for the given
path components.
@param array $components The path components as an array.
@return boolean Returns true if the handler is appropriate and false
otherwise.
162233
public function isAppropriate($components)
    {
        $components = array_values(array_filter(array_map('trim', $components), 'strlen'));
        $this->options = array();
        if (count($components) < 5) {
            return false;
        }

        if ($components[1] !== '--task' || $components[3] !== '--action') {
            return false;
        }
        $this->options['task'] = $components[2];
        $this->options['action'] = $components[4];

        try {
            // ensure we have this task registered
            $this->getServiceProvider()->get($this->options['task']);
        } catch (Exception $e) {
            return false;
        }

        return true;
    }
732190
public function checkPath($path)
    {
        $path = realpath($path);

        return ($path !== false && is_dir($path)) ? $path : false;
    }
862715
public static function hasBehavior($component, $behavior)
    {
        if ($behavior instanceof Behavior) {
            $behavior = (string)$behavior->className();
        } else {
            if (is_string($behavior)) {
                $behavior = (string)$behavior;
            }
        }

        if (!method_exists($component, 'getBehaviors')) {
            return false;
        }

        $hasBehaviors = $component->getBehaviors();

        foreach ($hasBehaviors as $hasBehavior) {
            if ($hasBehavior instanceof $behavior) {
                return true;
            }
        }

        return false;
    }
10108
protected function _hasAllowedChildren(array $children): bool
    {
        foreach ($children as $child) {
            if ($this->Auth->urlAllowed($child['url'])) {
                return true;
            }
        }

        return false;
    }
1110542
public static function is_empty_subsystem($component) {
        if (strpos($component, 'core_') === 0) {
            if (null === \core_component::get_subsystem_directory(substr($component, 5))) {
                // This is a subsystem without a directory.
                return true;
            }
        }

        return false;
    }
1042570
protected static function formatAuthComponent(array $components)
    {
        if (!is_null($components['scheme'])
            && is_null($components['host'])
            && !empty($components['path'])
            && strpos($components['path'], '@') !== false
        ) {
            $tmp = explode('@', $components['path'], 2);
            $components['user'] = $components['scheme'];
            $components['pass'] = $tmp[0];
            $components['path'] = $tmp[1];
            $components['scheme'] = null;
        }

        return $components;
    }
77233
public function isComponentInstalled( $componentName )
    {
        $root = $this->xml->deps->packages->package;

        foreach ( $root as $package )
        {
            if ( (string) $package['name'] == $componentName )
            {
                return true;
            }
        }
        return false;
    }
23383
public function isRoute($routes)
    {
        $routes = is_array($routes) ? $routes : func_get_args();

        return call_user_func_array([$this->router, 'is'], $routes);
    }
211744
public function parse($component = false)
    {
        $parts = parse_url($this->RAW());

        if (!$component) {
            return $parts;
        } elseif (!empty($parts[$component])) {
            return $parts[$component];
        } else {
            return false;
        }
    }
1016827
public function isRequestAllHeadersSupported(array $headers): bool
	{
		if (isset($this->settings[self::KEY_ALLOWED_HEADERS][self::VALUE_ALLOW_ALL_HEADERS])) {
			return true;
		}

		foreach ($headers as $header) {
			if (!isset($this->settings[self::KEY_ALLOWED_HEADERS][\strtolower($header)])) {
				return false;
			}
		}

		return true;
	}
475777
private function allowedUpdate($component, $hits)
  {
    $globalCheck    = ($this->getCounter() + $hits) <= $this->getGlobalThreshold();
    $componentCheck = true;
    if (null !== $this->getComponentThreshold()) {
      $componentCheck = ($this->getComponentCounter($component) + $hits) <= $this->getComponentThreshold();
    }
    return $globalCheck && $componentCheck;
  }
1144483
protected function isAllModulesLoaded( array $modules )
    {
        foreach ( $modules as $module )
        {
            if ( ! $this->isModuleLoaded( $module ) )
            {
                return false;
            }
        }

        return true;
    }
1011439
public function autoload(array $paths = [])
    {
        if (empty($paths)) {
            return;
        }
        spl_autoload_register(function (string $class) use ($paths) {

            $file = DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';

            foreach ($paths as $path) {
                if (is_file($path . $file)) {
                    include($path . $file);
                    return true;
                }
            }
            return false;
        });
    }
381280
private function validate_components( $components )
    {
        foreach( $components as $component )
        {
            if( ! $component instanceof UI\AbstractComponent )
            {
                throw new WrongTypeException( \gettype( $component ) );
            }
            
            if( $component instanceof UI\Components\Composite )
            {
                $this->validate_components( $component->components );
                continue;
            }
            
            if( $component instanceof UI\ValueComponentInterface && in_array( $component->name, $this->names ) )
            {
                throw new DuplicateNameException( $component->name );
            }
            
            $this->names[] = $component->name;
        }
    }
1198902
public function has(string $path)
    {
        $path = Util::normalizePath($path);

        return $path === '' ? false : (bool) $this->adapter->has($path);
    }
237688
public function isComponentInstalled( $componentName )
    {
        @$packageInfo = $this->registry->packageInfo( $componentName, null, 'components.ez.no' );
        return is_array( $packageInfo );
    }
343469
public function isWritableList(array $paths)
    {
        $permissionDeniedList = array();

        $result = true;
        foreach ($paths as $path) {
            $rowResult = $this->isWritable($path);
            if (!$rowResult) {
                $permissionDeniedList[] = $path;
            }
            $result &= $rowResult;
        }

        if (!empty($permissionDeniedList)) {
            $this->permissionDeniedList = $this->getPermissionUtils()->arrangePermissionList($permissionDeniedList);
        }

        return (bool) $result;
    }