/** * Get an item from the cache, or cache and return the default value. * * <code> * // Get an item from the cache, or cache a value for 15 minutes * $name = Cache::remember('name', 'Taylor', 15); * * // Use a closure for deferred execution * $count = Cache::remember('count', function() { return User::count(); }, 15); * </code> * * @param string $key * @param mixed $default * @param int $minutes * @return mixed */ public function remember($key, $default, $minutes, $function = 'put') { if (!is_null($item = $this->get($key, null))) { Log::info('Cache hit for ' . $key); return $item; } $this->{$function}($key, $default = value($default), $minutes); Log::info('Cache miss for ' . $key); return $default; }
public static function set_app_installed() { // Set application config file index.php $config_path = path('app') . 'config' . DS . 'application' . EXT; $config = File::get($config_path); $newConfig = str_replace("'installed' => false,", "'installed' => true,", $config, $count); if (isset($newConfig) and $newConfig != '') { if ($count > 0) { File::put($config_path, $newConfig); Log::info('App flag installed set'); } } else { Log::error('App flag installed failed.'); } }
/** * Log that a message was sent. * * @param Swift_Message $message * @return void */ protected function logMessage($message) { $emails = implode(', ', array_keys($message->getTo())); Log::info("Pretending to mail message to: {$emails}"); }