Пример #1
0
 public function __construct($ctrl = null, $act = null)
 {
     Hooker::add(Record::EVENT_AFTER_DB_QUERY, function ($sql) {
         if (Query::isWriteOperation($sql)) {
             Logger::instance('CMS')->info(new CommonMessage('DB WRITE', array('sql' => $sql)));
         }
     });
 }
Пример #2
0
 public function __construct($ctrl = null, $act = null)
 {
     if ($ctrl && $act) {
         Auth::checkAuth($ctrl, $act);
     }
     //静态资源版本号
     Hooker::add(Router::EVENT_GET_STATIC_URL, function (RefParam $ref) {
         $url = $ref->get('url');
         if (strpos($url, '?') === false) {
             $ref->set('url', $ref->get('url') . '?v' . date('Ym'));
         }
     });
     $paginate = Paginate::instance();
     $paginate->setPageSize(15);
     Hooker::add(Record::EVENT_AFTER_DB_QUERY, function ($sql) {
         if (Query::isWriteOperation($sql)) {
             Logger::instance('CMS')->info(new CommonMessage('DB WRITE', array('sql' => $sql)));
         }
     });
     parent::__construct();
 }