You are here

private function FileCache::createPathIfNeeded in Plug 7

Create path if needed.

Parameters

string $path:

Return value

bool TRUE on success or if path already exists, FALSE if path cannot be created.

1 call to FileCache::createPathIfNeeded()
FileCache::writeFile in lib/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php
Writes a string content to file in an atomic way.

File

lib/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php, line 167

Class

FileCache
Base file cache driver.

Namespace

Doctrine\Common\Cache

Code

private function createPathIfNeeded($path) {
  if (!is_dir($path)) {
    if (false === @mkdir($path, 0777, true) && !is_dir($path)) {
      return false;
    }
  }
  return true;
}