public function __construct() { $this->info = $this->info(); $slug = isset($this->info['slug']) ? trim($this->info['slug']) : FALSE; if (empty($slug)) { $this->info['slug'] = $this->slug(); } //version check $ver = get_app_version(true); $min_ver = $this->get_info('min_ver'); if (!empty($min_ver)) { $min_ver = format_version($min_ver, true); if ($ver < $min_ver) { //not required version, disallow! $plg = Plugin::factory()->get_by_slug($this->get_info('slug')); if ($plg->exists()) { $plg->active = FALSE; $plg->save(); } $ver = format_version($ver); $min_ver = format_version($min_ver); $lnk = site_url('administration/dashboard'); $plglnk = anchor($this->get_info('url'), $this->get_info('name')); show_error("Version mismatch for plugin {$plglnk}! " . "You are running version {$ver} and minimum required version is {$min_ver}. " . "Plugin is disabled, please <a href='{$lnk}'>click here</a>!"); } } }
highlightLineColor: '#f2d7ba', spotRadius: 3 } ); if (ping) { $.ajax({ url: "http://instant-update.com/ping.php", dataType: "jsonp", data: { domain: '<?php echo get_domain(site_url()); ?> ', version: '<?php echo get_app_version(); ?> ' }, success: function( response ) { //alert(response.version); } }); } }); </script> <!-- Title area --> <div class="titleArea">
public function sql() { //we cannot install if database config file is empty if (!is_db_conf_empty()) { //if config file exists, load libraries $this->load->database(); $this->load->library('datamapper'); $this->load->library('multiquery'); DataMapper::$config['prefix'] = $this->db->dbprefix; } else { redirect("setup/help/database-config-missing"); } //check connection if ($this->db->dbdriver == 'mysql') { $conn = mysql_connect($this->db->hostname, $this->db->username, $this->db->password); if (!$conn) { $this->session->set_flashdata('dberror', mysql_error()); redirect('setup/database/error'); } else { $dbsel = mysql_select_db($this->db->database); if (!$dbsel) { $this->session->set_flashdata('dberror', mysql_error()); redirect('setup/database/error'); } } } else { if ($this->db->dbdriver == 'mysqli') { $conn = mysqli_connect($this->db->hostname, $this->db->username, $this->db->password, $this->db->database); if (mysqli_connect_errno()) { $this->session->set_flashdata('dberror', mysqli_connect_error()); redirect('setup/database/error'); } } } //set db prefix for multiquery $this->multiquery->assign('prefix', DataMapper::$config['prefix']); //tell template if we're upgrading $this->templatemanager->assign('upgrade', $this->upgrade); if (!$this->upgrade) { //clean install $ok = $this->multiquery->execute_file(realpath(FCPATH . "install/sql/tables.sql")); $errors = $this->multiquery->errors; if (!$ok) { $this->templatemanager->assign('errors', $errors); } } else { //upgrade $old_version = get_app_version(true); $new_version = format_version(CS_SETUP_VERSION, true); for ($i = $old_version + 1; $i <= $new_version; $i++) { $step = format_version($i); $steps = array(); $step_has_sql = is_file(FCPATH . "install/sql/{$step}.sql"); $step_has_php = is_file(FCPATH . "install/php/{$step}.php"); $step_has_clear_sql = is_file(FCPATH . "install/sql/{$step}-clear.sql"); //execute sql upgrade (if exists) if ($step_has_sql) { $ok = $this->multiquery->execute_file(realpath(FCPATH . "install/sql/{$step}.sql")); $steps[$step]['ver'] = $step; if ($ok) { $steps[$step]['ok'] = true; } else { $steps[$step]['ok'] = false; $steps[$step]['errors'] = $this->multiquery->errors; } } //execute php upgrade logic (if exists) if ($step_has_php) { ob_start(); require_once FCPATH . "install/php/{$step}.php"; $steps[$step]['upgrade-output'] = ''; while (ob_get_level()) { $steps[$step]['upgrade-output'] .= ob_get_clean(); } } //clear sql if ($step_has_clear_sql) { $this->multiquery->execute_file(realpath(FCPATH . "install/sql/{$step}-clear.sql")); } //write upgraded version to "installed.txt" if ($step_has_sql || $step_has_php) { file_put_contents(FCPATH . "installed.txt", $step); } $this->templatemanager->assign('steps', $steps); } } $this->templatemanager->show_template("sql"); }
</div> <?php if ($template->config['has_footer']) { ?> <!-- Footer line --> <div id="footer"> <?php $first = Setting::value('custom_footer_text', ''); $second = Setting::value('custom_footer_text2', ''); if (empty($first)) { $first = 'Content Management System provided by <a href="http://instant-update.com">Instant Update ' . get_app_version() . '</a>'; } if (empty($second)) { $second = 'You can brand Instant Update as your own software (Settings > Branding).'; } ?> <div class="left"><?php echo $first; ?> </div> <div class="right"><?php echo $second; ?> </div> </div> <?php } ?> <?php