* @license PHP License * @package WB * @subpackage base */ WBClass::load('WBEvent_Handler'); /** * WBEvent_Handler_Touch * * Touch file * * @version 1.0.0 * @package Wombat * @subpackage base */ class WBEvent_Handler_Touch extends WBEvent_Handler { /** * handler config * * Parameters: * - "path" absolute path, use %s to include wb/dir/base * * @var array */ protected $config = array( 'path' => '%s/var/tmp/touch', ); /** * Touch file * * * @param WBEvent $e * @return bool true to continue, false to stop processing * @throws Exception in case of error */ public function process(WBEvent $e) { if (empty($this->config['path'])) { WBClass::load('WBException_File'); throw new WBException_File('Configuration error: set path for file to touch', 1, __CLASS__); } $path = sprintf($this->config['path'], WBParam::get('wb/dir/base')); touch($path); return true; } }