diff options
author | redmatrix <git@macgirvin.com> | 2016-06-02 16:45:00 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-06-02 16:45:00 -0700 |
commit | 4a3ec65409f1b89f7f96ca0b102716735be2108e (patch) | |
tree | 49193f185c4de903b80894f10da2da7c63dbf4f6 | |
parent | 0f1fcd97433cd3b1251daee8a9064a189cb5c132 (diff) | |
download | volse-hubzilla-4a3ec65409f1b89f7f96ca0b102716735be2108e.tar.gz volse-hubzilla-4a3ec65409f1b89f7f96ca0b102716735be2108e.tar.bz2 volse-hubzilla-4a3ec65409f1b89f7f96ca0b102716735be2108e.zip |
adjust algorithm to ensure new system apps are installed.
-rw-r--r-- | Zotlabs/Lib/Apps.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 7e232af02..fd713a3f8 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -70,16 +70,25 @@ class Apps { } } + /** + * Install the system app if no system apps have been installed, or if a new system app + * is discovered, or if the version of a system app changes. + */ + static public function check_install_system_app($app) { if((! is_array(self::$installed_system_apps)) || (! count(self::$installed_system_apps))) { return true; } + $notfound = true; foreach(self::$installed_system_apps as $iapp) { - if(($iapp['app_id'] == hash('whirlpool',$app['name'])) && ($iapp['app_version'] != $app['version'])) { - return true; + if($iapp['app_id'] == hash('whirlpool',$app['name'])) { + $notfound = false; + if($iapp['app_version'] != $app['version']) { + return true; + } } } - return false; + return $notfound; } |