=')) { die('Nothing to do here...'); } function initPHP5() { include(PHPWG_ROOT_PATH.'install/hosting.php'); $htaccess = PHPWG_ROOT_PATH.'.htaccess'; if ((file_exists($htaccess) and (!is_readable($htaccess) or !is_writable($htaccess))) or !($my_hostname = @gethostbyaddr($_SERVER['SERVER_ADDR']))) { return false; } foreach ($hosting as $hostname => $rule) { if (preg_match('!'.preg_quote($hostname).'$!',$my_hostname)) { if (false !== ($fh = @fopen($htaccess,"ab"))) { fwrite($fh,"\n".$rule); fclose($fh); return true; } } } return false; } function openPage() { global $script; $title = 'Piwigo '.PHPWG_VERSION.' - '.l10n(ucwords($script)); header('Content-Type: text/html; charset=UTF-8'); echo ' '.$title.'

'.$title.'

'; } function closePage() { echo '
'.sprintf(l10n('Need help ? Ask your question on Piwigo message board.'), PHPWG_URL.'/forum').'
'; } if (isset($_GET['setphp5'])) { // Try to configure php5 if (initPHP5()) { header('Location: '.$script.'.php?language='.$language); } else { openPage(); echo '

'.l10n('Sorry!').'

'.l10n('Piwigo was not able to configure PHP 5.').'
'.l10n("You may referer to your hosting provider's support and see how you could switch to PHP 5 by yourself.").'
'.l10n('Hope to see you back soon.').'

'; closePage(); } } else { openPage(); echo '
'.l10n('Language').'

'.l10n('PHP 5 is required').'

'.sprintf(l10n('It appears your webhost is currently running PHP %s.'), PHP_VERSION).'
'.l10n('Piwigo may try to switch your configuration to PHP 5 by creating or modifying a .htaccess file.').'
'.l10n('Note you can change your configuration by yourself and restart Piwigo after that.').'


'; closePage(); } exit(); ?>