protected function setup()
 {
     $this->app = $this->getApp();
     $this->extension = new Extension($this->app);
     $this->app['extensions']->register($this->extension);
     $this->extension->dbCheck();
     // Register the database table.
     $this->app['integritychecker']->repairTables();
     Redirect::$dbConnection = $this->app['db'];
     Redirect::$tableName = $this->extension->getTableName();
 }
 public function initialize()
 {
     Redirect::$dbConnection = $this->app['db'];
     Redirect::$tableName = $this->getTableName();
     $extension = $this;
     // Register this extension's actions as an early event.
     $this->app->before(function (Request $request) use($extension) {
         if ($extension->dbCheck()) {
             return $extension->handleRequest($request);
         }
     }, SilexApplication::EARLY_EVENT);
 }