protected function private_core()
 {
     /// ¿El usuario tiene permiso para eliminar en esta página?
     $this->allow_delete = $this->user->admin;
     /**
      * Cargamos las variables del cron
      */
     $fsvar = new fs_var();
     $cron_vars = $fsvar->array_get(array('cron_exists' => FALSE, 'cron_lock' => FALSE, 'cron_error' => FALSE));
     if (isset($_GET['fix'])) {
         $cron_vars['cron_error'] = FALSE;
         $cron_vars['cron_lock'] = FALSE;
         $fsvar->array_save($cron_vars);
     } else {
         if (isset($_GET['clean_cache'])) {
             /// borramos los archivos php del directorio tmp
             foreach (scandir(getcwd() . '/tmp') as $f) {
                 if (substr($f, -4) == '.php') {
                     unlink('tmp/' . $f);
                 }
             }
             if ($this->cache->clean()) {
                 $this->new_message("Cache limpiada correctamente.");
             }
         } else {
             if (!$cron_vars['cron_exists']) {
                 $this->new_advice('Nunca se ha ejecutado el <a href="http://www.facturascripts.com/comm3/index.php?page=community_item&tag=cron" target="_blank">cron</a>,' . ' te perderás algunas características interesantes de FacturaScripts.');
             } else {
                 if ($cron_vars['cron_error']) {
                     $this->new_error_msg('Parece que ha habido un error con el cron. Haz clic <a href="' . $this->url() . '&fix=TRUE">aquí</a> para corregirlo.');
                 } else {
                     if ($cron_vars['cron_lock']) {
                         $this->new_advice('Se está ejecutando el cron.');
                     }
                 }
             }
         }
     }
     if (isset($_REQUEST['json'])) {
         /// desactivamos el motor de plantillas
         $this->template = FALSE;
         $fslog = new fs_log();
         echo json_encode($fslog->all(0, 10000));
     } else {
         $this->share_extensions();
     }
 }
示例#2
0
 public function get_fs_log()
 {
     $fslog = new fs_log();
     return $fslog->all();
 }