//not supported since 2.0 $list = array(); $urls = array(); foreach ($list as $target => $item) { if (isset($item['target'])) { $target = $item['target']; } $urls[] = array('source' => $item['download_url'], 'target' => $target, 'slug' => $item['slug']); if (preg_match('@wa-apps/([\\w\\d\\-]+)$@', $target, $matches)) { $apps[] = $matches[1]; } } } } $installer_apps = new waInstallerApps(); waInstallerApps::setLocale($t->getLocale()); $installer = new waInstaller(waInstaller::LOG_DEBUG); if ($urls && $installer->update($urls)) { foreach ($apps as $app) { $installer_apps->installWebAsystApp($app); if (!empty($plugins[$app])) { foreach ($plugins[$app] as $plugin) { $installer_apps->updateAppPluginsConfig($app, $plugin); } } } } else { $state = $installer->getState(); if (isset($state['stage_status']) && $state['stage_status'] == waInstaller::STATE_ERROR) { throw new Exception($state['error']); }
$apps[] = $matches[1]; } } } } else { if (preg_match('/^([\\w\\%0-9\\-!]+)\\.tar\\.gz$/', $path, $matches)) { $decoded = urldecode($matches[1]); $urls[] = array('source' => $local_path . $path, 'target' => $decoded, 'slug' => $decoded); if (preg_match('/wa-apps\\/([\\w\\d\\-]+)$/', $decoded, $matches)) { $apps[] = $matches[1]; } } } } } waInstallerApps::setLocale($lang); $installer_apps = new waInstallerApps(); if (!count($urls)) { $list = $installer_apps->getSystemList(); $urls = array(); foreach ($list as $target => $item) { if (isset($item['target'])) { $target = $item['target']; } $urls[] = array('source' => $item['download_link'], 'target' => $target, 'slug' => $item['slug']); if (preg_match('/wa-apps\\/([\\w\\d\\-]+)$/', $target, $matches)) { $apps[] = $matches[1]; } } } }