本文整理汇总了PHP中rex::getServer方法的典型用法代码示例。如果您正苦于以下问题:PHP rex::getServer方法的具体用法?PHP rex::getServer怎么用?PHP rex::getServer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex
的用法示例。
在下文中一共展示了rex::getServer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: replaceVars
static function replaceVars($template, $er = array())
{
$r = rex_extension::registerPoint(new rex_extension_point('YFORM_EMAIL_BEFORE_REPLACEVARS', ['template' => $template, 'search_replace' => $er, 'status' => false]));
$template = $r['template'];
$er = $r['search_replace'];
$status = $r['status'];
if ($status) {
return true;
}
$er['REX_SERVER'] = rex::getServer();
$er['REX_ERROR_EMAIL'] = rex::getErrorEmail();
$er['REX_SERVERNAME'] = rex::getServerName();
$er['REX_NOTFOUND_ARTICLE_ID'] = rex_article::getNotfoundArticleId();
$er['REX_ARTICLE_ID'] = rex_article::getCurrentId();
$template['body'] = rex_var::parse($template['body'], '', 'yform_email_template', $er);
$template['body_html'] = rex_var::parse($template['body_html'], '', 'yform_email_template', $er);
// rex_vars bug: sonst wird der Zeilenumbruch entfernt - wenn DATA_VAR am Ende einer Zeile
if (rex_string::versionCompare(rex::getVersion(), '5.0.1', '<')) {
$template['body'] = str_replace("?>\r", "?>\r\n\r", $template['body']);
$template['body'] = str_replace("?>\n", "?>\n\r\n", $template['body']);
$template['body_html'] = str_replace("?>\r", "?>\r\n\r", $template['body_html']);
$template['body_html'] = str_replace("?>\n", "?>\n\r\n", $template['body_html']);
}
$template['body'] = rex_file::getOutput(rex_stream::factory('yform/email/template/' . $template['name'] . '/body', $template['body']));
$template['body_html'] = rex_file::getOutput(rex_stream::factory('yform/email/template/' . $template['name'] . '/body_html', $template['body_html']));
return $template;
}
示例2: testGetServer
public function testGetServer()
{
$origServer = rex::getProperty('server');
rex::setProperty('server', 'http://www.redaxo.org');
$this->assertEquals('http://www.redaxo.org/', rex::getServer());
$this->assertEquals('https://www.redaxo.org/', rex::getServer('https'));
$this->assertEquals('www.redaxo.org/', rex::getServer(''));
rex::setProperty('server', $origServer);
}
示例3: execute
public function execute()
{
include_once rex_path::addon('import_export', 'functions/function_import_export.php');
include_once rex_path::addon('import_export', 'functions/function_import_folder.php');
$filename = $this->getParam('filename', self::DEFAULT_FILENAME);
$filename = str_replace('%REX_SERVER', parse_url(rex::getServer(), PHP_URL_HOST), $filename);
$filename = str_replace('%REX_VERSION', rex::getVersion(), $filename);
$filename = strftime($filename);
$file = $filename;
$dir = getImportDir() . '/';
$ext = '.sql';
if (file_exists($dir . $file . $ext)) {
$i = 1;
while (file_exists($dir . $file . '_' . $i . $ext)) {
++$i;
}
$file = $file . '_' . $i;
}
if (rex_a1_export_db($dir . $file . $ext)) {
$message = $file . $ext . ' created';
if ($this->sendmail) {
if (!rex_addon::get('phpmailer')->isAvailable()) {
$this->setMessage($message . ', mail not sent (addon "phpmailer" isn\'t activated)');
return false;
}
$mail = new rex_mailer();
$mail->AddAddress($this->mailaddress);
$mail->Subject = rex_i18n::msg('im_export_mail_subject');
$mail->Body = rex_i18n::msg('im_export_mail_body', rex::getServerName());
$mail->AddAttachment($dir . $file . $ext, $filename . $ext);
if ($mail->Send()) {
$this->setMessage($message . ', mail sent');
return true;
}
$this->setMessage($message . ', mail not sent');
return false;
}
$this->setMessage($message);
return true;
}
$this->setMessage($file . $ext . ' not created');
return false;
}
示例4: rex_fragment
<dt>MySQL</dt><dd>' . rex_sql::getServerVersion() . '</dd>
<dt>' . rex_i18n::msg('name') . '</dt><dd>' . $dbconfig[1]['name'] . '</dd>
<dt>' . rex_i18n::msg('host') . '</dt><dd>' . $dbconfig[1]['host'] . '</dd>
</dl>';
$fragment = new rex_fragment();
$fragment->setVar('content', $content, false);
$content = $fragment->parse('core/page/grid.php');
$fragment = new rex_fragment();
$fragment->setVar('title', rex_i18n::msg('system_features'));
$fragment->setVar('body', $content, false);
echo $fragment->parse('core/page/section.php');
$content = [];
$formElements = [];
$n = [];
$n['label'] = '<label for="rex-id-server">' . rex_i18n::msg('server') . '</label>';
$n['field'] = '<input class="form-control" type="text" id="rex-id-server" name="settings[server]" value="' . htmlspecialchars(rex::getServer()) . '" />';
$formElements[] = $n;
$n = [];
$n['label'] = '<label for="rex-id-servername">' . rex_i18n::msg('servername') . '</label>';
$n['field'] = '<input class="form-control" type="text" id="rex-id-servername" name="settings[servername]" value="' . htmlspecialchars(rex::getServerName()) . '" />';
$formElements[] = $n;
$n = [];
$n['label'] = '<label for="rex-id-error-email">' . rex_i18n::msg('error_email') . '</label>';
$n['field'] = '<input class="form-control" type="text" id="rex-id-error-email" name="settings[error_email]" value="' . htmlspecialchars(rex::getErrorEmail()) . '" />';
$formElements[] = $n;
$fragment = new rex_fragment();
$fragment->setVar('elements', $formElements, false);
$content[] = $fragment->parse('core/form/form.php');
$elements = '';
$formElements = [];
$n = [];
示例5:
<?php
/**
* REDAXO customizer.
*
* Codemirror by : http://codemirror.net/
* Marijn Haverbeke <marijnh@gmail.com>
*/
if (rex::isBackend() && rex::getUser()) {
$config = $this->getConfig();
rex_view::addCssFile($this->getAssetsUrl('css/styles.css'));
if ($config['codemirror']) {
rex_view::addCssFile($this->getAssetsUrl('vendor/codemirror/codemirror.css'));
rex_view::addCssFile($this->getAssetsUrl('vendor/codemirror/theme/' . $config['codemirror_theme'] . '.css'));
if ($config['codemirror_theme'] != '') {
rex_view::setJsProperty('customizer_codemirror_defaulttheme', $config['codemirror_theme']);
}
rex_view::addJsFile($this->getAssetsUrl('vendor/codemirror/codemirror-compressed.js'));
}
if ($config['labelcolor'] != '') {
rex_view::setJsProperty('customizer_labelcolor', $config['labelcolor']);
}
if ($config['showlink']) {
rex_view::setJsProperty('customizer_showlink', '<h1 class="be-style-customizer-title"><a href="' . rex::getServer() . '" target="_blank">' . rex::getServerName() . '</a><i class="fa fa-external-link"></i></h1>');
}
rex_view::addJsFile($this->getAssetsUrl('js/main.js'));
}
示例6: rex_request
*/
// Für größere Exports den Speicher für PHP erhöhen.
if (rex_ini_get('memory_limit') < 67108864) {
@ini_set('memory_limit', '64M');
}
$success = '';
$error = '';
// ------------------------------ Requestvars
$function = rex_request('function', 'string');
$exportfilename = rex_post('exportfilename', 'string');
$exporttype = rex_post('exporttype', 'string');
$exportdl = rex_post('exportdl', 'boolean');
$EXPTABLES = rex_post('EXPTABLES', 'array');
$EXPDIR = rex_post('EXPDIR', 'array');
if ($exportfilename == '') {
$server = parse_url(rex::getServer(), PHP_URL_HOST);
$exportfilename = strtolower($server) . '_rex' . rex::getVersion() . '_' . date('Ymd_Hi');
}
if (rex_post('export', 'bool')) {
// ------------------------------ FUNC EXPORT
$exportfilename = strtolower($exportfilename);
$filename = preg_replace('@[^\\.a-z0-9_\\-]@', '', $exportfilename);
if ($filename != $exportfilename) {
$success = rex_i18n::msg('backup_filename_updated');
$exportfilename = $filename;
} else {
$hasContent = false;
$header = '';
$ext = $exporttype == 'sql' ? '.sql' : '.tar.gz';
$export_path = rex_backup::getDir() . '/';
if (file_exists($export_path . $filename . $ext)) {