You are here

function shrinktheweb_createCacheDirectory in ShrinkTheWeb 8

Same name and namespace in other branches
  1. 6 shrinktheweb.api.inc \shrinktheweb_createCacheDirectory()
  2. 7 shrinktheweb.api.inc \shrinktheweb_createCacheDirectory()

Create cache directory if it doesn't exist.

3 calls to shrinktheweb_createCacheDirectory()
ShrinkTheWebCallbackController::receiveScreenshot in src/Controller/ShrinkTheWebCallbackController.php
shrinktheweb_getNoResponseImage in ./shrinktheweb.api.inc
Gets the account problem image and returns the relative path to the cached image.
shrinktheweb_getThumbnail in ./shrinktheweb.api.inc
Gets the thumbnail for the specified website, stores it in the cache, and then returns the relative path to the cached image.

File

./shrinktheweb.api.inc, line 640

Code

function shrinktheweb_createCacheDirectory() {

  // Create cache directory if it doesn't exist.
  if (!file_exists(THUMBNAIL_DIR)) {
    @mkdir(THUMBNAIL_DIR, 0777, TRUE);
  }
  else {

    // Try to make the directory writable.
    @chmod(THUMBNAIL_DIR, 0777);
  }
}