The branch, master has been updated
via 04acac82359092ce374240fc9ee1665f7bfa4893 (commit)
via 9ce8bb0e87765afd0ec9b4e4c16b2e6f68f22c20 (commit)
via aa0e0b94a83a81c2c82495b701172568382ce6c2 (commit)
via 42cf4f8660f10b667765fa6767adcef39fbc52ca (commit)
from 4c1ee06bb3fce6f31cab584288509064868f14f4 (commit)
- Log -----------------------------------------------------------------
commit 04acac82359092ce374240fc9ee1665f7bfa4893
Author: Michal Čihař <mcihar(a)novell.com>
Date: Thu Feb 17 10:50:59 2011 +0100
More uses of standard function for PHP doc links
commit 9ce8bb0e87765afd0ec9b4e4c16b2e6f68f22c20
Author: Michal Čihař <mcihar(a)novell.com>
Date: Thu Feb 17 10:50:47 2011 +0100
This function needs to be in core.lib as it uses it
commit aa0e0b94a83a81c2c82495b701172568382ce6c2
Author: Michal Čihař <mcihar(a)novell.com>
Date: Thu Feb 17 10:46:57 2011 +0100
Standard link to PHP doc
commit 42cf4f8660f10b667765fa6767adcef39fbc52ca
Author: Michal Čihař <mcihar(a)novell.com>
Date: Thu Feb 17 10:44:16 2011 +0100
Factor out code for getting PHP documentation link
-----------------------------------------------------------------------
Summary of changes:
libraries/common.lib.php | 5 +----
libraries/core.lib.php | 18 +++++++++++++++++-
libraries/display_export.lib.php | 2 +-
setup/lib/index.lib.php | 4 ++--
4 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 5d04931..496d65b 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -457,10 +457,7 @@ function PMA_showDocu($anchor) {
* @access public
*/
function PMA_showPHPDocu($target) {
- /* l10n: Language to use for PHP documentation, please use only languages which do
exist in official documentation. */
- $lang = _pgettext('PHP documentation language', 'en');
-
- $url = 'http://php.net/manual/' . $lang . '/' . $target;
+ $url = PMA_getPHPDocLink($target);
if ($GLOBALS['cfg']['ReplaceHelpImg']) {
return '<a href="' . $url . '"
target="documentation"><img class="icon" src="' .
$GLOBALS['pmaThemeImage'] . 'b_help.png" width="11"
height="11" alt="' . __('Documentation') . '"
title="' . __('Documentation') . '" /></a>';
diff --git a/libraries/core.lib.php b/libraries/core.lib.php
index cb1a851..76d2c86 100644
--- a/libraries/core.lib.php
+++ b/libraries/core.lib.php
@@ -251,6 +251,22 @@ function PMA_fatalError($error_message, $message_args = null)
}
/**
+ * Returns a link to the PHP documentation
+ *
+ * @param string anchor in documentation
+ *
+ * @return string the URL
+ *
+ * @access public
+ */
+function PMA_getPHPDocLink($target) {
+ /* l10n: Language to use for PHP documentation, please use only languages which do
exist in official documentation. */
+ $lang = _pgettext('PHP documentation language', 'en');
+
+ return 'http://php.net/manual/' . $lang . '/' . $target;
+}
+
+/**
* Warn or fail on missing extension.
*
* @param string $extension Extension name
@@ -260,7 +276,7 @@ function PMA_fatalError($error_message, $message_args = null)
function PMA_warnMissingExtension($extension, $fatal = false, $extra = '')
{
$message = sprintf(__('The %s extension is missing. Please check your PHP
configuration.'),
- sprintf('[a@http://php.net/%1$s@Documentation][em]%1$s[/em][/a]',
$extension));
+ '[a@' . PMA_getPHPDocLink('book.' . $extension . '.php')
. '@Documentation][em]' . $extension . '[/em][/a]');
if ($extra != '') {
$message .= ' ' . $extra;
}
diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php
index ac223dc..10e8178 100644
--- a/libraries/display_export.lib.php
+++ b/libraries/display_export.lib.php
@@ -235,7 +235,7 @@ if(isset($_GET['sql_query'])) {
}
$message = new PMA_Message(__('This value is interpreted using
%1$sstrftime%2$s, so you can use time formatting strings. Additionally the following
transformations will happen: %3$s. Other text will be kept as is. See the %4$sFAQ%5$s for
details.'));
- $message->addParam('<a href="' .
PMA_linkURL('http://php.net/strftime') . '"
target="documentation" title="'
+ $message->addParam('<a href="' .
PMA_linkURL(PMA_getPHPDocLink('function.strftime.php')). '"
target="documentation" title="'
. __('Documentation') . '">', false);
$message->addParam('</a>', false);
$message->addParam($trans);
diff --git a/setup/lib/index.lib.php b/setup/lib/index.lib.php
index c8e7fbb..a90bc3d 100644
--- a/setup/lib/index.lib.php
+++ b/setup/lib/index.lib.php
@@ -258,7 +258,7 @@ function perform_config_checks()
$strGZipDumpWarning = __('%sGZip compression and decompression%s requires
functions (%s) which are unavailable on this system.');
$strGZipDumpWarning = sprintf($strGZipDumpWarning,
'[a@?page=form&formset=Features#tab_Import_export]', '[/a]',
'%s');
$strLoginCookieValidityWarning = __('%sLogin cookie validity%s greater than 1440
seconds may cause random session invalidation if %ssession.gc_maxlifetime%s is lower than
its value (currently %d).');
- $strLoginCookieValidityWarning = sprintf($strLoginCookieValidityWarning,
'[a@?page=form&formset=Features#tab_Security]', '[/a]',
'[a@http://www.php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime]',
'[/a]', ini_get('session.gc_maxlifetime'));
+ $strLoginCookieValidityWarning = sprintf($strLoginCookieValidityWarning,
'[a@?page=form&formset=Features#tab_Security]', '[/a]',
'[a@' .
PMA_getPHPDocLink('session.configuration.php#ini.session.gc-maxlifetime') .
']', '[/a]', ini_get('session.gc_maxlifetime'));
$strLoginCookieValidityWarning2 = __('%sLogin cookie validity%s should be set to
1800 seconds (30 minutes) at most. Values larger than 1800 may pose a security risk such
as impersonation.');
$strLoginCookieValidityWarning2 = sprintf($strLoginCookieValidityWarning2,
'[a@?page=form&formset=Features#tab_Security]', '[/a]');
$strLoginCookieValidityWarning3 = __('If using cookie authentication and %sLogin
cookie store%s is not 0, %sLogin cookie validity%s must be set to a value less or equal to
it.');
@@ -488,4 +488,4 @@ function perform_config_checks()
PMA_lang($strZipDumpExportWarning, 'gzcompress'));
}
}
-?>
\ No newline at end of file
+?>
hooks/post-receive
--
phpMyAdmin