Adds the requested file to cache.

@param string $path path to the file to be cached.
@param string $cachefsPath path for the cached file(under 'cachefs://').
766738
protected function cacheFile($path, $cachefsPath)
    {
        if (array_key_exists($path, $this->cachedFiles)) {
            return;
        }

        if (file_exists($path)) {
            $contents = file_get_contents($path);
            file_put_contents($cachefsPath, $contents);

            $this->cachedFiles[$path] = $cachefsPath;
        }
    }
379847
protected function rebuildClassPathCache($path, $cacheFile)
	{
		if ($cacheFile!==false) {
			$tmp = $this->classPath;
			$this->classPath = array();
		}

		// iterates over all files/folders
		$list = glob(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*');
		if (is_array($list)) {
			foreach ($list as $f) {
				if (is_dir($f)) {
					$this->rebuildClassPathCache($f, false);
				} else {
					$this->classPath[str_replace(array('function.','block.','modifier.','outputfilter.','filter.','prefilter.','postfilter.','pre.','post.','output.','shared.','helper.'), '', basename($f, '.php'))] = $f;
				}
			}
		}

		// save in file if it's the first call (not recursed)
		if ($cacheFile!==false) {
			if (!file_put_contents($cacheFile, serialize($this->classPath))) {
				throw new Dwoo_Exception('Could not write into '.$cacheFile.', either because the folder is not there (create it) or because of the chmod configuration (please ensure this directory is writable by php), alternatively you can change the directory used with $dwoo->setCompileDir() or provide a custom loader object with $dwoo->setLoader()');
			}
			$this->classPath += $tmp;
		}
	}
1007742
public function setPath(string $path) : void
    {
        if (!is_writable($path)) {
            throw new Exception("The path to the cache is not writable.");
        }

        $this->cachePath = $path;
    }
1158331
protected function setCacheDir($path)
    {
        if (!is_dir($path)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Cache directory at %s could not be found',
                    $path
                )
            );
        }
        if (!is_readable($path)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Cache directory at %s is not readable',
                    $path
                )
            );
        }
        if (!is_writable($path)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Cache directory at %s is not writable',
                    $path
                )
            );
        }

        $this->cacheDir = realpath($path);
    }
590718
public function add_path(string $path)
    {
        $path = \trailingslashit($path);
        $this->paths[] = $path;
        $this->parse_files($path);
    }
104368
public function addPath($path, $namespace = self::MAIN_NAMESPACE)
    {
        // invalidate the cache
        $this->cache = [];

        $this->paths[$namespace][] = rtrim($path, '/\\');
    }
251528
public function cache_init($file_path)
	{
		$cache_key = md5($file_path);
		$cache_path = \Config::get('parser.View_Jade.cache_dir', null)
			.substr($cache_key, 0, 2).DS.substr($cache_key, 2, 2);

		if ($cache_path !== null AND ! is_dir($cache_path))
		{
			mkdir($cache_path, 0777, true);
		}

		static::$_cache = $cache_path;
	}
330025
public function add($path)
    {
        if (!file_exists($this->cwd . '/' . $path)) {
            throw new NotFoundException(sprintf('Path %s not found', $this->cwd . '/' . $path));
        }

        $result = $this->status($path);

        foreach ($result as $fileInfo) {
            if ($fileInfo->getStatus() === Status::UNVERSIONED) {
                $this->svn->execute('add', array($fileInfo->getPathname()), $this->cwd);
            }
        }
    }
1056333
public function addPath($path, $namespace = self::MAIN_NAMESPACE)
    {
        // invalidate the cache
        $this->cache = array();

        if (!is_dir($path)) {
            throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path));
        }

        $this->paths[$namespace][] = rtrim($path, '/\\');
    }
150216
protected function build_cache( $path, $builder, $view_path )
	{
		CCFile::write( $path, CCView_Builder::compile( $builder, $view_path ) );
	}
1136859
public function addFile($path)
    {
        $config = $this->loadFile($path);
        if (is_array($config)) {
            $this->merge($config);
        }
        return $this;
    }
497242
public function setCachePath($cachePath)
    {
        if (!is_dir($cachePath)) {
            throw new Exception\CachePathNotFoundException(sprintf('Cache Path, %s does not exists', $cachePath));
        }
        $this->cachePath = $cachePath;

        return $this;
    }
1570
public function addPath($path)
    {
        if (empty($path) || false === ($real_path = realpath($path))) {
            throw new FileNotFoundException(null, 0, null, $path);
        }
        $this->paths[] = $real_path;

        return $this;
    }
1135916
public function addPath($path)
    {
        // just force to array
        settype($path, 'array');

        // loop through the path directories
        foreach ($path as $dir) {
            // no surrounding spaces allowed!
            $dir = trim($dir);

            // remove trailing slash
            if (substr($dir, -1) == DIRECTORY_SEPARATOR) {
                $dir = substr_replace($dir, '', -1);
            }

            // add to the top of the search dirs
            array_unshift($this->_paths, $dir);
        }
    }
1060022
public function removeCacheForFile($file_path)
    {
        $cache_path = $this->getCacheLocationForPath($file_path);

        if (file_exists($cache_path)) {
            unlink($cache_path);
        }
    }
159091
public static function add($key, $path)
    {
        self::$_registeredNamespaces[$key] = true;
        self::$_options['loader']->addPsr4($key, $path);
    }
390482
public function resetPath(string $path)
    {
        foreach ($this->cache as &$cache) {
            unset($cache[$path], $cache);
        }
    }