$checks[] = array(i18n::s('XML'), $value, $check); // ensure we can handle ZIP files if (!is_callable('zip_open')) { $context['text'] .= '<p>' . i18n::s('WARNING: You will not be able to upload zip files.') . "</p>\n"; $context['text'] .= '<p class="details"><a href="setup.php">' . i18n::s('Check the ZIP PHP extension again') . "</a></p>\n"; // check $value = i18n::s('Absent'); $check = i18n::s('WARNING'); } else { $value = i18n::s('Present'); $check = i18n::s('OK'); } // check $checks[] = array(i18n::s('zip'), $value, $check); // show evidence of safe mode if (Safe::ini_get('safe_mode')) { $context['text'] .= '<p>' . i18n::s('WARNING: This server runs in safe mode, and YACS may be prevented to perform a number of key operations.') . "</p>\n"; // check $value = i18n::s('Yes'); $check = i18n::s('WARNING'); } else { $value = i18n::s('No'); $check = i18n::s('OK'); } // check $checks[] = array(i18n::s('Safe mode'), $value, $check); // test our ability to write to files $can_write = TRUE; // actual attempt to write to representative files $files = array(); $files[] = './parameters/agents.include.php';
$menu = array('scripts/' => i18n::s('Server software')); $context['text'] .= Skin::build_list($menu, 'menu_bar'); // scripts are ready for update } else { $context['text'] .= sprintf(i18n::ns('%d file has been downloaded from the reference server.', '%d files have been downloaded from the reference server.', $staging_files), $staging_files) . "</p>\n"; // forward to the update script $context['text'] .= '<form method="get" action="' . $context['url_to_root'] . 'scripts/update.php">' . "\n" . '<p>' . Skin::build_submit_button(i18n::s('Review staged scripts before the update')) . '</p>' . "\n" . '</form>' . "\n"; } } } // ask for something to process, except on error } elseif (!count($context['error'])) { // the splash message $context['text'] .= '<p>' . i18n::s('This script allows you to stage new scripts that will then be used to update your YACS server.') . "</p>\n"; // warning if safe mode of limited time if (Safe::ini_get('safe_mode') || !is_callable('set_time_limit')) { Logger::error(sprintf(i18n::s('Extended processing time is not allowed on this server. In case of trouble, please upload individual files manually to the <code>scripts/staging</code> directory, using your preferred FTP tool or equivalent. When this is completed, jump to %s to complete the software update.'), Skin::build_link('scripts/update.php', i18n::s('the update script'), 'basic'))); } // option #1 - in-band upload $context['text'] .= Skin::build_block(i18n::s('Direct upload'), 'title'); // upload an archive $context['text'] .= '<p>' . i18n::s('Pick-up and upload the archive file to use for the upgrade.') . '</p>'; // the form to post an file $context['text'] .= '<form method="post" action="' . $context['script_url'] . '" enctype="multipart/form-data"><div>'; // the file $context['text'] .= '<input type="file" name="upload" id="focus" size="30" />' . ' (< ' . $context['file_maximum_size'] . i18n::s('bytes') . ')'; // the submit button $context['text'] .= '<p>' . Skin::build_submit_button(i18n::s('Submit'), i18n::s('Press [s] to submit data'), 's') . '</p>' . "\n"; // end of the form $context['text'] .= '</div></form>'; // this may take several minutes
/** * extends execution time * * Set the number of seconds a script is allowed to run. * * @param int number of seconds */ public static function set_time_limit($duration) { // ensure call is allowed -- safe mode is a special case if (is_callable('set_time_limit') && !Safe::ini_get('safe_mode')) { @set_time_limit($duration); } }