Beispiel #1
0
 /**
  * Show Raw immport hook file
  *
  * @return  void
  */
 public function rawTask()
 {
     // get request vars
     $id = Request::getVar('id', array());
     if (is_array($id)) {
         $id = !empty($id) ? $id[0] : null;
     }
     // create hook model object
     $hook = Hook::oneOrFail($id);
     // get path to file
     $file = $hook->fileSpacePath() . DS . $hook->get('file');
     // default contents
     $contents = '';
     // if we have a file
     if (file_exists($file)) {
         // get contents of file
         $contents = file_get_contents($file);
     }
     // output contents of hook file
     highlight_string($contents);
     exit;
 }