/** * Comprueba actualizaciones de los plugins y del núcleo. * @return boolean */ public function check_for_updates2() { if (!$this->user->admin) { return FALSE; } else { $fsvar = new fs_var(); /// comprobamos actualizaciones en los plugins $updates = FALSE; foreach ($this->plugin_advanced_list() as $plugin) { if ($plugin['version_url'] != '' and $plugin['update_url'] != '') { /// plugin con descarga gratuita $internet_ini = @parse_ini_string($this->curl_get_contents($plugin['version_url'])); if ($internet_ini) { if ($plugin['version'] < intval($internet_ini['version'])) { $updates = TRUE; break; } } } else { if ($plugin['idplugin']) { /// plugin de pago/oculto if ($plugin['download2_url'] != '') { /// download2_url implica que hay actualización $updates = TRUE; break; } } } } if (!$updates) { /// comprobamos actualizaciones del núcleo $version = file_get_contents('VERSION'); $internet_version = $this->curl_get_contents('https://raw.githubusercontent.com/NeoRazorX/facturascripts_2015/master/VERSION'); if (floatval($version) < floatval($internet_version)) { $updates = TRUE; } } if ($updates) { $fsvar->simple_save('updates', 'true'); return TRUE; } else { $fsvar->name = 'updates'; $fsvar->delete(); return FALSE; } } }