3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace PortlandLabs\DomainMapper\Url; use Concrete\Core\Url\Components\Path; use Concrete\Core\Url\Resolver\PathUrlResolver; use Concrete\Core\Url\Resolver\UrlResolverInterface; use PortlandLabs\DomainMapper\Map\DomainMap; /** * Class Resolver * URL Resolver for handling domain mapped urls, this will intercept mapped paths and alter the outputted links to * remove the prefix and set the proper host. * * @package PortlandLabs\DomainMapper\Url */ class Resolver implements UrlResolverInterface { public function resolve(array $arguments, $resolved = null) { $args = $arguments; $path = array_shift($args); /** @var DomainMap $map */ $map = \Core::make('domain_mapper/config_map'); if ($path instanceof \Page) { $path = $path->getCollectionPath(); $arguments[0] = $path; } if (is_scalar($path) && $path) { $path = (string)$path; $resolved_url = $resolved; if (!$resolved) { /** @var PathUrlResolver $path_resolver */ $path_resolver = \URL::getResolver('concrete.path'); $resolved_url = $path_resolver->resolve($arguments); } $url = $resolved_url; if ($url) { if ($prefix = $map->getPath($url->getHost())) { $prefix_path = new Path($prefix); $real_path = $url->getPath(); if (substr(strtolower($real_path), 0, strlen($prefix_path)) === strtolower($prefix_path)) { $relative_path = $real_path->getRelativePath($prefix_path); $url = $url->setPath($relative_path); } else { $url = $url->setHost(\Config::get('concrete.seo.canonical_host')); } return $url; } if ($domain = $map->getDomain($url->getPath())) { $map_path = new Path(rtrim($map->getPath($domain), '/')); $url_path = new Path(rtrim($url->getPath(), '/')); foreach ($map_path->toArray() as $key => $path_node) { $url_path->offsetUnset($key); } $url = $url->setPath($url_path); $url = $url->setHost($domain); return $url; } } } return $resolved; } }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Interface "Concrete\Core\Url\Resolver\UrlResolverInterface" not found in /in/sJA4Z:16 Stack trace: #0 {main} thrown in /in/sJA4Z on line 16
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.59 ms | 401 KiB | 8 Q