: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Nextend\Framework\Url;
use Nextend\Framework\Filesystem\Filesystem;
abstract class AbstractPlatformUrl {
* @var string It can be relative or absolute uri. It must not end with /
* @example https://asd.com/wordpress
protected $_currentbase = '';
protected $scheme = 'http';
public function getUris() {
protected function getUriByIndex($i, $protocol = true) {
return preg_replace('/^http:/', '', $this->uris[$i]);
public function setBaseUri($uri) {
public function getSiteUri() {
public function getBaseUri() {
public function getFullUri() {
public function pathToUri($path, $protocol = true) {
$basePath = Filesystem::getBasePath();
if ($basePath != '/' && $basePath != "\\") {
$from[] = DIRECTORY_SEPARATOR;
return ($protocol ? $this->_baseuri : preg_replace('/^http:/', '', $this->_baseuri)) . str_replace($from, $to, str_replace('/', DIRECTORY_SEPARATOR, $path));
public function ajaxUri($query = '') {
public function fixrelative($uri) {
if (substr($uri, 0, 1) == '/' || strpos($uri, '://') !== false) return $uri;
return $this->_baseuri . $uri;
public function relativetoabsolute($uri) {
if (strpos($uri, '://') !== false) return $uri;
if (!empty($this->_baseuri) && strpos($uri, $this->_baseuri) === 0) {
$uri = substr($uri, strlen($this->_baseuri));
return $this->_currentbase . $uri;
public function addScheme($url) {
return $this->scheme . ':' . $url;