public function __construct($path = '', $fileLocking = false) { if (!$path) { require_once 'Solar/Dir.php'; $path = rtrim(Solar_Dir::tmp(), DIRECTORY_SEPARATOR); } $this->_locking = $fileLocking; $this->_path = $path; }
/** * * Sets the default directory to write emails to (the temp dir). * * @return void * */ protected function _preConfig() { parent::_preConfig(); if (Solar::$system) { $tmp = Solar::$system . '/mail/'; } else { $tmp = Solar_Dir::tmp('/Solar_Mail_Transport_Adapter_File/'); } $this->_Solar_Mail_Transport_Adapter_File['dir'] = $tmp; }
public function __construct($path = '', $exclude = array(), $locking = false, $flushTimeLimit = 0) { if (!$path) { require_once W3TC_LIB_MINIFY_DIR . '/Solar/Dir.php'; $path = rtrim(Solar_Dir::tmp(), DIRECTORY_SEPARATOR); } $this->_path = $path; $this->_exclude = $exclude; $this->_locking = $locking; $this->_flushTimeLimit = $flushTimeLimit; }
/** * * Setup; runs before each test method. * */ public function preTest() { if (is_null($this->_config['path'])) { $this->_config['path'] = Solar_Dir::tmp('/Solar_Cache_Testing/'); } parent::preTest(); /** * @todo remove requirement that deleteAll() actually work here */ // remove all previous entries $this->_adapter->deleteAll(); }
public function __construct($path = '', $exclude = array(), $locking = false, $flushTimeLimit = 0, $flush_path = null) { if (!$path) { w3_require_once(W3TC_LIB_MINIFY_DIR . '/Solar/Dir.php'); $path = rtrim(Solar_Dir::tmp(), DIRECTORY_SEPARATOR); } $this->_path = $path; $this->_exclude = $exclude; $this->_locking = $locking; $this->_flushTimeLimit = $flushTimeLimit; $this->_flush_path = is_null($flush_path) ? $path : $flush_path; if (!file_exists($this->_path . '/index.html')) { if (!is_dir($this->_path)) { w3_mkdir_from($this->_path, W3TC_CACHE_DIR); } @file_put_contents($this->_path . '/index.html', ''); } }
/** * * Sets the default cache directory location. * * @return void * */ protected function _preConfig() { parent::_preConfig(); $tmp = Solar_Dir::tmp('/Solar_Cache_File/'); $this->_Solar_Cache_Adapter_File['path'] = $tmp; }
function flush_minify_caches() { // flush minify caches on save try { $minpath = realpath(dirname(APPPATH)) . '/assets/min/'; require_once $minpath . 'lib/Solar/Dir.php'; $tmppath = rtrim(Solar_Dir::tmp(), DIRECTORY_SEPARATOR); $files = glob(rtrim($tmppath, '/') . '/minify_*'); foreach ($files as $file) { if (is_writable($file)) { unlink($file); } } } catch (Exception $e) { log_message('error', $e->getMessage()); } }
try { require_once 'Solar/Dir.php'; } catch (Exception $e) { if (! $setIncludeSuccess) { echo "Minify: set_include_path() failed. You may need to set your include_path " ."outside of PHP code, e.g., in php.ini."; } else { echo $e->getMessage(); } exit(); } require 'Minify.php'; $cachePathCode = ''; if (! isset($min_cachePath)) { $detectedTmp = rtrim(Solar_Dir::tmp(), DIRECTORY_SEPARATOR); $cachePathCode = "\$min_cachePath = " . var_export($detectedTmp, 1) . ';'; } ob_start(); ?> <!doctype html> <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]--> <!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]--> <!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]--> <!--[if gt IE 8]> <html class="no-js" lang="en"> <![endif]--> <title>Workless Minify URI Builder</title> <meta name="robots" content="noindex, nofollow">
/** * * Returns the OS-specific directory for temporary files, with a file * name appended. * * @param string $file The file name to append to the temporary directory * path. * * @return string The temp directory and file name. * */ public static function tmp($file) { // convert slashes to OS-specific separators, // then remove leading and trailing separators $file = str_replace('/', DIRECTORY_SEPARATOR, $file); $file = trim($file, DIRECTORY_SEPARATOR); // return the tmp dir plus file name return Solar_Dir::tmp() . $file; }