Set magic env like __DIR__, __FILE__ for $path

@param  string $path
@access protected
@since  1.0.3
329515
protected function setMagicEnv(/*# string */ $path)
    {
        $real = realpath($path);
        putenv('__DIR__=' . dirname($real));
        putenv('__FILE__=' . basename($real));
    }
277193
private function setPath($path)
    {
        $this->info['path'] = $this->info['file'] = $this->info['extension'] = $this->info['content'] = null;

        if ($this->getScheme() === 'data') {
            $this->info['content'] = $path;

            return;
        }

        $file = substr(strrchr($path, '/'), 1);

        if (strlen($file)) {
            $path = substr($path, 0, -strlen($file));

            if (preg_match('/(.*)\.([\w]+)$/', $file, $match)) {
                $this->info['file'] = rawurldecode($match[1]);
                $this->info['extension'] = $match[2];
            } else {
                $this->info['file'] = rawurldecode($file);
            }
        }

        $this->info['path'] = [];

        foreach (explode('/', $path) as $dir) {
            $dir = rawurldecode($dir);

            if ($dir !== '') {
                $this->info['path'][] = $dir;
            }
        }
    }
838205
public function setCachePath($path) {
		$path = rtrim($path, DIRECTORY_SEPARATOR);
		$path = realpath($path);
		
		if ($path === false) {
			throw new NoPath('Invalid path: "' . func_get_arg(0) . '"');
		}
		
		if (! is_dir($path)) {
			throw new NoPath('Path must be a directory: "' . $path . '"');
		}
		
		if (! is_writeable($path)) {
			throw new NoPath('Path must be a writable: "' . $path . '"');
		}
		
		$this->path = $path;
	}
956782
public function setAsset($path)
	{		
		$url = $this->config['dir']['site'] . str_replace($this->config['dir']['asset'], '', $path);
		$this->assets[] = new Asset($path, $url);
	}
415190
public static function config($path)
    {
        $data = \UtilsSandboxLoader('application/Config/' . strtr($path, '.', '/') . '.php');

        foreach ($data as $key => $value) {
            self::env($key, $value);
        }

        $data = null;
    }
144394
private function setPath($path)
    {
        $this->path =  preg_replace_callback(
            '/(?:[^' . self::$charList . ':@\/%]+|%(?![A-Fa-f0-9]{2}))/',
            [$this, 'encode'],
            $path
        );

        return $this;
    }
1133176
public function setPath($path = '')
    {
        $userFolder = Str::normalizePath(config('cripfilesys.user_folder'));

        if ($userFolder !== '' && !starts_with($path, $userFolder)) {
            $path = empty($path) ? '' : $path;
            $path = $this->prefixPath($path, $userFolder);
        }

        $this->path = Str::normalizePath($path);

        return $this;
    }
342349
public function setPath($path)
    {
        if ($path) {
            $this->not_cleared_path = $path;
            $this->doClearPath();
        } else {
            $this->path = '';
        }

        return $this;
    }
859950
public function setPath(string $path): self
    {
        parent::setPath($path);
        $this->directory = new Directory(\dirname($path));

        return $this;
    }
421548
protected function setPathInfo($path)
    {
        $key = 'urlMapper.' . ltrim($this->request->getBaseUrl(), '/') . $this->request->getPathInfo();
        $this->request->setPathInfo($path);
        $this->statsD->increment($key);
    }
952666
public function setAssetsPath($path) {
		$path = realpath(rtrim($path, DIRECTORY_SEPARATOR));
		
		if ($path === false || ! is_readable($path)) {
			throw new InvalidPath('Path to the assets must exists and be readable');
		}
		
		$this->assetsPath = $path;
	}
7988
public function setFile($path)
    {
        $this->con->executeStep(
            sprintf('_sahi._setFile(%s, %s)', $this->getAccessor(), json_encode($path))
        );
    }
433190
public function setPath(?string $path): Configuration
    {
        $this->path = realpath($path) ?: $path;

        return $this;
    }
255781
public function setPath(string $path): ZipManager {

        try {
            foreach ( $this->zip_archives as $archive ) {
                $archive->setPath($path);
            }
            return $this;
        } catch (ZipException $ze) {
            throw $ze;
        }

    }
412009
public function setCachePath($path = null)
    {
        if (is_null($path)) {
            $this->path = __DIR__;
        } else {
            $this->path = filter_var($path, FILTER_SANITIZE_STRING);
        }
    }
1134943
protected function _setExportDir($path = null) {
		$path = (string)$path;
		if (file_exists($path)) {
			$this->_pathExportDir = $path;
		}
	}
472218
public function setPath($path)
	{
		if($path !== false)
			$path = trim($path, '/');

		$this->setProperty('path', $path);

		return $this;
	}