本文整理汇总了PHP中Environment::try_to_increase_max_execution_time方法的典型用法代码示例。如果您正苦于以下问题:PHP Environment::try_to_increase_max_execution_time方法的具体用法?PHP Environment::try_to_increase_max_execution_time怎么用?PHP Environment::try_to_increase_max_execution_time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Environment
的用法示例。
在下文中一共展示了Environment::try_to_increase_max_execution_time方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @desc Builds a Backup object
*/
public function __construct()
{
$this->list_db_tables();
//Liste toutes les tables de PHPBoost.
//On modifie le temps d'exécution maximal si le serveur le permet
//parce que les opérations sont longues
Environment::try_to_increase_max_execution_time();
$this->db_querier = PersistenceContext::get_querier();
}
示例2: dump
private function dump($file_path, $tables)
{
Environment::try_to_increase_max_execution_time();
$file = new File($file_path);
$file_writer = new BufferedFileWriter($file);
if ($tables == null) {
PersistenceContext::get_dbms_utils()->dump_phpboost($file_writer, DBMSUtils::DUMP_STRUCTURE_AND_DATA);
} else {
PersistenceContext::get_dbms_utils()->dump_tables($file_writer, $tables, DBMSUtils::DUMP_STRUCTURE_AND_DATA);
}
CLIOutput::writeln('Tables dumped to file ' . $file_path);
}
示例3: add_newsletter
public static function add_newsletter(array $streams, $subject, $contents, $language_type)
{
Environment::try_to_increase_max_execution_time();
$newsletter_streams = NewsletterStreamsCache::load()->get_streams();
foreach ($newsletter_streams as $id => $stream) {
if (in_array($id, $streams)) {
//Send mail
NewsletterMailFactory::send_mail(self::list_subscribers_by_stream($id), $language_type, NewsletterConfig::load()->get_mail_sender(), $subject, $contents);
//Add archive
NewsletterDAO::add_archive($id, $subject, $contents, $language_type);
}
}
}
示例4: restore_db
private function restore_db($file_name)
{
Environment::try_to_increase_max_execution_time();
PersistenceContext::get_dbms_utils()->parse_file(new File($file_name));
CLIOutput::writeln('Dump restored from file ' . $file_name);
}
示例5: execute
public function execute()
{
$this->get_update_token();
AppContext::get_cache_service()->clear_cache();
Environment::try_to_increase_max_execution_time();
// Mise en maintenance du site s'il ne l'est pas déjà
$this->put_site_under_maintenance();
// Suppression des fichiers qui ne sont plus présent dans la nouvelle version pour éviter les conflits
$this->delete_old_files();
// Suppression du captcha PHPBoostCaptcha
$this->delete_phpboostcaptcha();
// Désinstallation des anciens menus (dans /menus)
$this->delete_old_menus();
// Mise à jour des tables du noyau
$this->update_kernel_tables();
// Mise à jour de la version du noyau
$this->update_kernel_version();
// Mise à jour des modules
$this->update_modules();
// Mise à jour des thèmes
$this->update_themes();
// Mise à jour des langues
$this->update_langs();
// installation du module UrlUpdater pour la réécriture des Url des modules mis à jour
ModulesManager::install_module('UrlUpdater');
// Fin de la mise à jour : régénération du cache
$this->delete_update_token();
$this->generate_cache();
HtaccessFileCache::regenerate();
}
示例6: foreach
$tpl->put_all(array('C_FILES' => true, 'L_INFO' => $LANG['db_restore_file']));
foreach ($filelist as $file) {
$tpl->assign_block_vars('file', array('FILE_NAME' => $file['file_name'], 'WEIGHT' => $file['weight'], 'FILE_DATE' => $file['file_date']));
}
}
} else {
//Sauvegarde
if ($action == 'backup') {
$backup_type = $request->has_postparameter('backup_type') && $request->get_postvalue('backup_type') != 'all' ? $request->get_postvalue('backup_type') == 'data' ? DBMSUtils::DUMP_DATA : DBMSUtils::DUMP_STRUCTURE : DBMSUtils::DUMP_STRUCTURE_AND_DATA;
$selected_tables = $request->get_postarray('table_list');
if (empty($selected_tables)) {
AppContext::get_response()->redirect(HOST . DIR . url('/database/admin_database.php?error=empty_list'));
}
$file_name = 'backup_' . PersistenceContext::get_dbms_utils()->get_database_name() . '_' . str_replace('/', '-', Date::to_format(Date::DATE_NOW, 'y-m-d-H-i-s')) . '.sql';
$file_path = PATH_TO_ROOT . '/cache/backup/' . $file_name;
Environment::try_to_increase_max_execution_time();
PersistenceContext::get_dbms_utils()->dump_tables(new BufferedFileWriter(new File($file_path)), $selected_tables, $backup_type);
AppContext::get_response()->redirect(HOST . DIR . url('/database/admin_database.php?error=backup_success&file=' . $file_name));
}
if ($tables_backup) {
$tables = PersistenceContext::get_dbms_utils()->list_tables(true);
$tpl->put_all(array('C_DATABASE_BACKUP' => true, 'NBR_TABLES' => count($tables), 'TARGET' => url('admin_database.php?token=' . AppContext::get_session()->get_token()), 'SELECT_ALL' => $LANG['select_all'], 'SELECT_NONE' => $LANG['select_none'], 'L_BACKUP_DATABASE' => $LANG['db_backup_database'], 'L_EXPLAIN_BACKUP' => $LANG['db_backup_explain'], 'L_SELECTION' => $LANG['db_selected_tables'], 'L_BACKUP_ALL' => $LANG['db_backup_all'], 'L_BACKUP_STRUCT' => $LANG['db_backup_struct'], 'L_BACKUP_DATA' => $LANG['db_backup_data'], 'L_BACKUP' => $LANG['db_backup']));
$selected_tables = array();
$i = 0;
foreach ($tables as $table) {
if ($table == $get_table || $request->has_postparameter('table_' . $table) && $request->get_postvalue('table_' . $table) == 'on') {
$selected_tables[] = $table;
}
$tpl->assign_block_vars('table_list', array('NAME' => $table, 'SELECTED' => in_array($table, $selected_tables) ? 'selected="selected"' : '', 'I' => $i));
$i++;
}