@param array $urls

@return bool
503517
public function purgeUrls(array $urls)
    {
        // prefix urls
        $zoneUrls = array_map(function ($url) {
            return $this->zoneUrl . $url;
        }, $urls);

        return $this->sendRequest('DELETE', 'purgeurl', [
                'urls' => $zoneUrls
            ]
        );
    }
987825
public function deleteFiles(array $files) : bool
    {
        if (empty($files)) {
            return false;
        }

        $status = true;

        foreach ($files as $file) {
            if (file_exists($file)) {
                $status = $status && unlink($file);
            }
        }

        return $status;
    }
904356
protected function getOptionLinks(array $urls)
    {
        $html = '';

        foreach ($urls as $page => $url) {
            $html .= $this->getOption($url, $page);
        }

        return $html;
    }
75083
protected function canAll(array $permissions)
    {
        foreach ($permissions as $permission) {
            if (!$this->hasPermission($permission)) {
                return false;
            }
        }

        return true;
    }
173844
public function contains($url)
	{
		$url = trim($url, '/');

		foreach ($this->entries as $entry) {
			if ($entry['loc'] == $url) {
				return TRUE;
			}
		}

		return FALSE;
	}
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;
        });
    }
996723
public function match($patterns)
    {
        if (!is_array($patterns)) {
            $patterns = [$patterns];
        }

        //Remove scheme and query
        $long_url = preg_replace('|^(\w+://)|', '', (string) $this);
        $short_url = preg_replace('|(\?.*)?$|', '', $long_url);

        foreach ($patterns as $pattern) {
            if ($pattern[0] === '?') { // ?hello=world => *?hello=world
                $pattern = '*' . $pattern;
            }

            $pattern = str_replace('\\*', '.*', preg_quote($pattern, '|'));

            if (strpos($pattern, '?') === false) {
                $url = $short_url;
            } else {
                $pattern = str_replace('\\?&', '[\\?&]', $pattern);
                $url = $long_url;
            }

            if (preg_match('|^'.$pattern.'$|i', $url)) {
                return true;
            }
        }

        return false;
    }
300783
protected function hasParentAccess(array $url): bool
    {
        $config = new ModuleConfig(ConfigType::MODULE(), Inflector::camelize($url['controller']));
        $moduleConfig = $config->parseToArray();

        if (! isset($moduleConfig['table']['permissions_parent_modules'])) {
            return false;
        }

        $parents = $moduleConfig['table']['permissions_parent_modules'];

        return !empty($parents);
    }
1247596
public function supports($url, array $params = array())
    {
        $links = $this->discoverLinks($url, $params);

        return !empty($links);
    }
320005
protected function findServices(array $urls = array())
    {
        $return = array();
        $this->extractCustomParams($this->config['custom_params']);
        foreach (array_unique($urls) as $u) {

            try {
                $host = $this->getHost($u);
                if (isset($this->services[$host])) {
                    $provider = new \ReflectionClass($this->services[$host]);
                    $return[$u] = $provider->newInstance($u, $this->config, $this->oembed);

                    if (isset($this->customParams[$host])) {
                        $return[$u]->appendParams($this->customParams[$host]);
                    }
                }
            } catch (\Exception $e) {
                //echo $e->getMessage() . PHP_EOL;
            }
        }

        return $return;
    }
1300487
public function matches($url, array $annotations)
	{
		foreach ( $annotations as $annotation ) {
			if ( preg_match($annotation->regexp, $url) ) {
				return true;
			}
		}

		return false;
	}
1071253
public function meet(array $nodeUrls)
    {
        $current = $this->stream->getNodeUrl();

        return array_filter($nodeUrls, function($url) use ($current) {
            if ($url === $current) {
                return true;
            }

            $parts = parse_url($url);

            try {
                $response = $this->send(['CLUSTER', 'MEET', $parts['host'], (int) $parts['port']]);
                $this->log->debug('CLUSTER MEET', ['host' => $url, 'response' => $response]);
                return 'OK' === $response;
            } catch (Exception $e) {
                $this->log->error($e->getMessage(), array('url' => $url, 'exception' => $e));
                return false;
            }
        });
    }
638918
public function setReturnUrls(array $returnUrls)
    {
        foreach ($returnUrls as $key => $returnUrl) {
            $this->returnUrls[$key] = $this->parseUrl($returnUrl);
        }
    }
140661
public function checkController($controllers)
    {
        if (!$this->controller) {
            return false;
        }

        if (in_array($this->controller, (array)$controllers)) {
            return true;
        }

        return false;
    }
1115038
protected function _urlMatch($patterns)
    {
        if (empty($patterns)) {
            return false;
        }

        $url = urldecode($this->_View->request->url);
        $path = str_starts_with($url, '/') ? str_replace_once('/', '', $url) : $url;

        if (option('url_locale_prefix')) {
            $patterns = explode("\n", $patterns);
            $locales = array_keys(quickapps('languages'));
            $localesPattern = '(' . implode('|', array_map('preg_quote', $locales)) . ')';

            foreach ($patterns as &$p) {
                if (!preg_match("/^{$localesPattern}\//", $p)) {
                    $p = I18n::locale() . '/' . $p;
                    $p = str_replace('//', '/', $p);
                }
            }

            $patterns = implode("\n", $patterns);
        }

        // Convert path settings to a regular expression.
        // Therefore replace newlines with a logical or, /* with asterisks and  "/" with the front page.
        $toReplace = [
            '/(\r\n?|\n)/', // newlines
            '/\\\\\*/', // asterisks
            '/(^|\|)\/($|\|)/' // front '/'
        ];

        $replacements = [
            '|',
            '.*',
            '\1' . preg_quote($this->_View->Url->build('/'), '/') . '\2'
        ];

        $patternsQuoted = preg_quote($patterns, '/');
        $patterns = '/^(' . preg_replace($toReplace, $replacements, $patternsQuoted) . ')$/';

        return (bool)preg_match($patterns, $path);
    }
1352147
public function checkUri($uris)
    {
        if (!$this->request) {
            return false;
        }

        foreach ((array)$uris as $uri) {
            if ($this->uri == $uri) {
                return true;
            }
        }

        return false;
    }
1251991
public static function hasUrl($string, &$matches = array(), $ifAll = false) {
		return 0 < self::validateByRegExp('/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/', $string, $matches, $ifAll);
	}