예제 #1
0
// * Make a .htaccess file for the cache dir.
// */
//
//$htaccess_filename = $cache_dir_name . '/.htaccess';
//
//if (file_exists($htaccess_filename)) {
//    if (!$silent) {
//        echo "The \"$htaccess_filename\" already exists!\n";
//    }
//} else {
//    if (!$silent) {
//        echo "Creating \"$htaccess_filename\"\n";
//    }
//
//    if ($fh = fopen($htaccess_filename, 'w')) {
//        $date = date('Y-m-d');
//
//        fwrite($fh, "# File to restrict acccess to the cache dir.\n");
//        fwrite($fh, "# $date\n");
//        fwrite($fh, "\n");
//
//        fwrite($fh, "Order Deny,Allow\n");
//        fwrite($fh, "Deny from all\n");
//
//        fclose($fh);
//    } else {
//        throw new Exception("Unable to open \"$htaccess_filename\" for writing!\n");
//    }
//}
Caching_CacheDirectoryCreator::create_cache_directory($cache_dir_name, $restrict_access = TRUE, $silent);
 public function do_actions()
 {
     $cache_dir_name = PROJECT_ROOT . '/hc-database-img-cache';
     Caching_CacheDirectoryCreator::create_cache_directory($cache_dir_name, $restrict_access = FALSE, $silent = TRUE);
 }