$migration->displayWarning("***** Install process of plugin TIMELINETICKET *****"); } else { $migration->displayWarning("***** Update process of plugin TIMELINETICKET *****"); } $migration->displayWarning("Current Timelineticket version: {$current_version}"); $migration->displayWarning("Version to update: " . PLUGIN_TIMELINETICKET_VERSION); // To prevent problem of execution time ini_set("max_execution_time", "0"); ini_set("memory_limit", "-1"); $mess = ''; if ($current_version != PLUGIN_TIMELINETICKET_VERSION and $current_version != '0') { $mess = "Update done."; } else { if ($current_version == PLUGIN_TIMELINETICKET_VERSION) { $mess = "No migration needed."; } else { $mess = "installation done."; } } $plugin->getFromDBbyDir("timelineticket"); $plugin->install($plugin->fields['id']); plugin_timelineticket_install(); $migration->displayWarning($mess); $plugin->load("timelineticket"); $plugin->activate($plugin->fields['id']); $plugin->load("timelineticket"); if (in_array('--optimize', $_SERVER['argv'])) { $migration->displayTitle("Optimizing tables"); DBmysql::optimize_tables($migration); $migration->displayWarning("Optimize done."); }
public function install($position = 0) { parent::install($position); $this->createXML(); }
public function install($position = 0) { parent::install($position); $this->ping(); }
require "session_cp.inc.php"; $plugin_model = new Plugins(); $plugin = new Plugin(); $conditions = null; $tpl_file = "plugin"; if (isset($_GET['do'])) { $do = trim($_GET['do']); if (!empty($_GET['id'])) { $id = intval($_GET['id']); } if ($do == "uninstall" && !empty($id)) { $plugin_model->del($id); } if ($do == "install" && !empty($_GET['entry'])) { $entry = trim($_GET['entry']); $last_id = $plugin->install($entry); if ($plugin->need_config) { flash("plugin_installed_and_config", "plugin.php?do=edit&id=" . $last_id, 0); } else { flash("success"); } } if ($do == "edit") { if (!empty($id)) { $row = $plugin_model->read("*", $id); if (!empty($row['pluginvar'])) { $plugin_var = unserialize($row['pluginvar']); unset($row['pluginvar']); $item = array_merge($row, $plugin_var); } else { $item = $row;
$catalog->uninstall(); /* Show Confirmation */ $url = AmpConfig::get('web_path') . '/admin/modules.php?action=show_catalog_types'; $title = T_('Plugin Deactivated'); $body = ''; show_confirmation($title, $body, $url); break; case 'install_plugin': /* Verify that this plugin exists */ $plugins = Plugin::get_plugins(); if (!array_key_exists($_REQUEST['plugin'], $plugins)) { debug_event('plugins', 'Error: Invalid Plugin: ' . $_REQUEST['plugin'] . ' selected', '1'); break; } $plugin = new Plugin($_REQUEST['plugin']); if (!$plugin->install()) { debug_event('plugins', 'Error: Plugin Install Failed, ' . $_REQUEST['plugin'], '1'); $url = AmpConfig::get('web_path') . '/admin/modules.php?action=show_plugins'; $title = T_('Unable to Install Plugin'); $body = ''; show_confirmation($title, $body, $url); break; } // Don't trust the plugin to this stuff User::rebuild_all_preferences(); /* Show Confirmation */ $url = AmpConfig::get('web_path') . '/admin/modules.php?action=show_plugins'; $title = T_('Plugin Activated'); $body = ''; show_confirmation($title, $body, $url); break;
$xmlPath = ADMIN . '/plugins' . urldecode($_GET['xml_path']); $install = new AdminFrontend(); $install->main(array("time" => time(), "page_title" => "Install", "page_template" => "dashboard")); if (!file_exists($xmlPath)) { $install->addMessage(l("Plugin not found"), "error"); $install->render(); exit; } foreach (getPlugins() as $plugin) { if ($plugin instanceof OrongoPluggableObject == false) { continue; } if ($plugin->getInfoPath() == $xmlPath) { $install->addMessage(l("Plugin already installed"), "warning"); $install->render(); exit; } } try { Plugin::install($xmlPath); } catch (Exception $e) { try { Plugin::deinstall($xmlPath); } catch (Exception $ex) { } $install->addMessage($e->getMessage(), "error"); $install->render(); exit; } header("Location: " . orongoURL("orongo-admin/manage.php?obj=plugins&msg=3")); exit;
public function create(&$force) { // // Does this commit have a release directory already? If so, do nothing // if (!$force && file_exists($this->release_dir)) { return false; } // there's no point in forcing a non-existant release if ($force && !file_exists($this->release_dir)) { $force = false; } // Got whippet.{json,lock} or plugins.lock? if (is_file($this->project_dir . '/whippet.json') && is_file($this->project_dir . '/whippet.lock')) { $factory = new \Dxw\Whippet\Factory(); $installer = new \Dxw\Whippet\Dependencies\Installer($factory, new \Dxw\Whippet\ProjectDirectory($this->project_dir)); } elseif ($this->plugins_lock_file && file_exists($this->plugins_lock_file)) { $installer = new Plugin(); } else { echo "Couldn't find plugins.lock in the project directory. (Did you run whippet plugins install?)\n"; die(1); } // // If we're here, we must deploy // // 1. Clone WP // 2. Delete wp-content etc // 3. Make sure wp-content is up to date // 4. Copy our wp-content, omitting gitfoo // 5. ?? Theme/plugin build steps ?? (Makefile-esque thing?) // 6. Symlink required files from shared dir // Assuming we're not forcing, create a new directory for this release, or use only an empty existing dir if (!$force) { $this->check_and_create_dir($this->release_dir, true); } else { $this->release_dir = dirname($this->release_dir) . '/forced_release_tmp_' . sha1(microtime()); } // Clone WP and remove things we don't want $wp = new \Dxw\Whippet\Git\Git($this->release_dir); $wp->clone_repo($this->application_config->wordpress->repository); $wp->checkout($this->application_config->wordpress->revision); foreach (['wp-content', '.git', 'readme.html', 'wp-config-sample.php'] as $delete) { if (is_dir("{$this->release_dir}/{$delete}")) { $this->recurse_rmdir("{$this->release_dir}/{$delete}"); } else { unlink("{$this->release_dir}/{$delete}"); } } // Make sure wp-content is up to date $result = $installer->install(true); if ($result->isErr()) { echo sprintf("ERROR: %s\n", $result->getErr()); exit(1); } // Copy over wp-content $this->recurse_copy("{$this->project_dir}/wp-content", "{$this->release_dir}/wp-content"); if (file_exists("{$this->release_dir}/wp-content/uploads")) { $this->recurse_rm("{$this->release_dir}/wp-content/uploads"); } // // Remove unwanted git/test foo // $plugins = scandir("{$this->release_dir}/wp-content/plugins"); foreach ($plugins as $dir) { $path = "{$this->release_dir}/wp-content/plugins/{$dir}"; if ($dir === '.' || $dir === '..' || !is_dir($path)) { continue; } // Remove git files from all plugins foreach (['.git', '.gitmodules', '.gitignore'] as $delete) { $this->recurse_rm("{$this->release_dir}/wp-content/plugins/{$dir}/{$delete}"); } // Remove test files from whippet plugins if ($this->is_whippet_plugin($path)) { foreach (['tests', 'Makefile', '.drone.yml'] as $delete) { $this->recurse_rm("{$this->release_dir}/wp-content/plugins/{$dir}/{$delete}"); } } } // // Copy public assets // if (is_dir("{$this->project_dir}/public")) { $this->recurse_copy("{$this->project_dir}/public", "{$this->release_dir}"); } // // TODO: theme and plugin build steps // // Symlinkery symlink(realpath("{$this->release_dir}/../../shared/wp-config.php"), "{$this->release_dir}/wp-config.php"); symlink(realpath("{$this->release_dir}/../../shared/uploads"), "{$this->release_dir}/wp-content/uploads"); // FIN }
<?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $error = false; if (!empty($_POST['install'])) { if (!Utils::CSRF_check('install_plugin')) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { Plugin::install(Utils::post('to_install'), false); Utils::redirect('/admin/config/plugins.php'); } catch (UserException $e) { $error = $e->getMessage(); } } } if (Utils::post('delete')) { if (!Utils::CSRF_check('delete_plugin_' . Utils::get('delete'))) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { $plugin = new Plugin(Utils::get('delete')); $plugin->uninstall(); Utils::redirect('/admin/config/plugins.php'); } catch (UserException $e) { $error = $e->getMessage(); } } }