[Gnucash-changes] r12818 - htdocs/trunk : GLOBALS

Neil Williams linux at codehelp.co.uk
Tue Jan 17 05:51:33 EST 2006


On Tuesday 17 January 2006 2:32 am, Joshua Sled wrote:
> Author: jsled
> Date: 2006-01-16 21:32:44 -0500 (Mon, 16 Jan 2006)
> New Revision: 12818
> Trac: http://svn.gnucash.org/trac/changeset/12818
>
> Added:
>    htdocs/trunk/images/

This PHP snippet is required if the webhost trying to demo the svn htdocs is 
running an updated / default / secured PHP installation where GLOBALS is not 
registered:

<?php
 // Emulate register_globals on
 if (!ini_get('register_globals')) {
    $superglobals = array($_SERVER, $_ENV,
        $_FILES, $_COOKIE, $_POST, $_GET);
    if (isset($_SESSION)) {
        array_unshift($superglobals, $_SESSION);
    }
    foreach ($superglobals as $superglobal) {
        extract($superglobal, EXTR_SKIP);
    }
 }
?>

http://uk.php.net/manual/en/faq.misc.php#faq.misc.registerglobals

I've created a file: emulate_globals_on.php in the top level trunk/ and 
patched en/index.phtml to use it:

neil at garfield:trunk$ svn diff en/index.phtml
Index: en/index.phtml
===================================================================
--- en/index.phtml      (revision 12818)
+++ en/index.phtml      (working copy)
@@ -1,4 +1,8 @@
 <?php $title = "Open Source Accounting Software"; ?>
+<?php if (!ini_get('register_globals')) {
+ include("../emulate_globals_on.php");
+}
+?>
 <?php include($GLOBALS['DOCUMENT_ROOT']."/en/components/header.phtml"); ?>
 <?php include($GLOBALS['DOCUMENT_ROOT']."/en/menu/menu-main.phtml"); ?>
        </td>

Note the absolute path.

I'll commit emulate_globals_on.php and the patches for the other index files 
later.

Also, I get problems with the news/ directory:

News

 Warning: dir(news/): failed to open dir: No such file or directory 
in /opt/svn/trunk/php-scripts/news-script.php on line 26
 
 Fatal error: Call to a member function on a non-object 
in /opt/svn/trunk/php-scripts/news-script.php on line 30

in svn, news contains only:
$ ls news/
old  oldnews.txt

-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20060117/d175f8a0/attachment.bin


More information about the gnucash-devel mailing list