ElggFileCache::createFile PHP Méthode

createFile() protected méthode

Create and return a handle to a file.
protected createFile ( string $filename, string $rw = "rb" ) : mixed
$filename string Filename to save as
$rw string Write mode
Résultat mixed
    protected function createFile($filename, $rw = "rb")
    {
        // Create a filename matrix
        $matrix = "";
        $depth = strlen($filename);
        if ($depth > 5) {
            $depth = 5;
        }
        // Create full path
        $path = $this->getVariable("cache_path") . $matrix;
        if (!is_dir($path)) {
            mkdir($path, 0700, true);
        }
        // Open the file
        if (!file_exists($path . $filename) && $rw == "rb") {
            return false;
        }
        return fopen($path . $filename, $rw);
    }