Create a simple redirect to a page / path.

@deprecated Deprecated since 3.0, to be removed in 4.0.

@param string $path
@param bool   $abort

@return string
557823
public static function simpleredirect($path, $abort = false)
    {
        Deprecated::method(3.0);

        if (empty($path)) {
            $path = '/';
        }
        header("location: $path");
        echo "<p>Redirecting to <a href='$path'>$path</a>.</p>";
        echo "<script>window.setTimeout(function () { window.location='$path'; }, 500);</script>";
        if (!$abort) {
            return $path;
        }

        throw new HttpException(Response::HTTP_SEE_OTHER, "Redirecting to '$path'.");
    }
1008600
public function to($path, $status = 302, $headers = array(), $secure = null)
    {
        $path = $this->generator->to($path, array(), $secure);

        return $this->createRedirect($path, $status, $headers);
    }
495990
protected function makePath($path)
    {
        // Log
        $this->info("Attempting to make path: {$path}");

        // Make
        if (!is_dir($path)) {
            if (mkdir($path) === false) {
                $this->error("Error in making path: {$path}");
                return false;
            }
        }

        // Make writable
        if (!is_writable($path)) {
            if (chmod($path, 0777) === false) {
                $this->error("Error in making path writable: {$path}");
                return false;
            }
        }

        return true;
    }
1099546
public function dispatch($path) {

            $found  = false;
            $params = [];

            if (isset($this->routes[$path])) {

                $found = $this->render_route($path, $params);

            } else {

                foreach ($this->routes as $route => $callback) {

                    $params = [];

                    /* e.g. #\.html$#  */
                    if (substr($route,0,1)=='#' && substr($route,-1)=='#'){

                        if (preg_match($route, $path, $matches)){
                            $params[':captures'] = array_slice($matches, 1);
                            $found = $this->render_route($route, $params);
                            break;
                        }
                    }

                    /* e.g. /admin/*  */
                    if (strpos($route, '*') !== false){

                        $pattern = '#^'.str_replace('\*', '(.*)', preg_quote($route, '#')).'#';

                        if (preg_match($pattern, $path, $matches)){

                            $params[':splat'] = array_slice($matches, 1);
                            $found = $this->render_route($route, $params);
                            break;
                        }
                    }

                    /* e.g. /admin/:id  */
                    if (strpos($route, ':') !== false){

                        $parts_p = explode('/', $path);
                        $parts_r = explode('/', $route);

                        if (count($parts_p) == count($parts_r)){

                            $matched = true;

                            foreach($parts_r as $index => $part){
                                if (':' === substr($part,0,1)) {
                                    $params[substr($part,1)] = $parts_p[$index];
                                    continue;
                                }

                                if ($parts_p[$index] != $parts_r[$index]) {
                                    $matched = false;
                                    break;
                                }
                            }

                            if ($matched){
                                $found = $this->render_route($route, $params);
                                break;
                            }
                        }
                    }
                }
            }

            return $found;
    }
662606
public static function make(string $path, array $data = [], bool $return = false)
  {
    $path = self::getPath($path);

    /**
     * Render error page if this is a whoops call
     */
    if (self::isCalledByWhoops()) {
      return Accessor::view($path, $data, $return)->render();
    }

    return Accessor::view($path, $data, $return);
  }
1164392
protected static function _realpath($path)
    {
        $realPath = realpath($path);
        if ($realPath !== false) {
            $path = $realPath;
        }

        return rtrim($path, '/\\');
    }
998187
protected function redirectRoute($path, $isUpdate = false)
    {
        $indexPos = strpos($path,'index');
        $dotPos = strpos($path,'.');
        $slug = getModelSlug($this->model);

        // İlişkisiz yalın sayfalardan index hariç
        if ( $indexPos === false && $dotPos === false ) {
            return redirect( lmbRoute("admin.{$slug}.{$path}", ['id' => $this->model->id]) );
        }

        // İlişkili sayfalardan index hariç
        if( $indexPos === false ) {
            $id = $isUpdate && ! is_null($this->model->category_id) && is_null($this->relatedId) ? $this->model->category_id : ( $isUpdate && is_null($this->relatedId) ? $this->model->categories->first()->id : $this->relatedId);
            return redirect( lmbRoute("admin.{$path}", [
                'id'                => $id,
                $this->routeRegex   => $this->model->id
            ]) );
        }

        // İlişkisiz sayfalardan index
        if ($dotPos === false) {
            return redirect( lmbRoute("admin.{$slug}.{$path}") );
        }

        // İlişkili sayfalardan index
        return redirect( lmbRoute("admin.{$path}", ['id' => $this->relatedId]) );
    }
1025990
public function makeUrl($path) {
		if ($path{0} == '/') $path = substr($path, 1);
		$dsn = explode('/', $path, 2);
		$size = count($dsn);
		
		$controller = $dsn[0];
		$action = '';
		if ($size > 0) {
			$action = $dsn[1];
		}
		
		$param_array = array();
		if ($size > 1) {
			for ($i = 2; $i <= $size; $i+=2) {
				$param_array[$names[$size]] = isset($names[$size + 1]) ? $names[$size + 1] : '';
			}
		}
		
		$url = $controller;
		if ($action != '') {
			$url.= '/' . $action;
		}
		
	}
512739
private function realPath($path)
    {
        $result = realpath($path);
        if ($result === false) {
            throw new \InvalidArgumentException(sprintf('Failed to run realpath(\'%s\')', $path));
        }

        return $result;
    }
516763
protected function _abspath($path) {
		return $path == $this->separator ? $this->root : $this->root.$this->separator.$path;
	}
429739
public function redirectIntended($path, $status = 302, $headers = [], $secure = null)
    {
        return Redirect::intended($this->uri() . '/' . $path, $status, $headers, $secure);
    }
374503
public function redirectTo($path, $status = 302, $headers = array(), $secure = null)
	{
		return $this->redirector->to($path, $status, $headers, $secure);
	}
2866
public function getPublicUrl($path, $absolute = false)
    {
        return sprintf('%s/%s', $absolute ? $this->root : null, ltrim($path, '/'));
    }
747422
public function redirect($path)
    {
        $args = func_get_args();
        $url = call_user_func_array([$this, 'getUrl'], $args);
        $this->response = $this->createRedirectResponse($url);
        $this->disableRendering();
        return $this;
    }
532977
protected function makeAbsolutePath($path)
    {
        $path = $this->serverUrlHelper->__invoke($this->basePathHelper->__invoke($path));
        return $path;
    }
167550
public function withPath($path)
    {
        if (!is_string($path) || strpos($path, '#') !== false || strpos($path, '?') !== false) {
            throw new \InvalidArgumentException('Path must be a string and cannot contain a fragment or query string');
        }

        if (!empty($path) && '/' !== substr($path, 0, 1)) {
            $path = '/' . $path;
        }

        return $this->_clone('path', $this->filterPath($path));
    }
884337
protected function _relpath($path) {
	
		
		$newpath = $path;
		
		
		if (substr($path, 0, 1) != '/') {
			$newpath = "/$newpath";
		}
		
		$newpath =  preg_replace("/\/$/", "", $newpath);
	
		$ret = ($newpath == $this->root) ? '' : substr($newpath, strlen($this->root)+1);
		
		return $ret;
	}