Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61962 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6055 invoked from network); 2 Aug 2012 12:34:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Aug 2012 12:34:08 -0000 Authentication-Results: pb1.pair.com header.from=rich@richgray.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rich@richgray.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain richgray.com from 74.125.82.54 cause and error) X-PHP-List-Original-Sender: rich@richgray.com X-Host-Fingerprint: 74.125.82.54 mail-wg0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:35679] helo=mail-wg0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8F/23-21438-DB37A105 for ; Thu, 02 Aug 2012 08:34:06 -0400 Received: by wgx1 with SMTP id 1so6074763wgx.11 for ; Thu, 02 Aug 2012 05:34:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=KZXZijLVGE/A7zW3Sg041O3Ux4BwrfwlZkbEw5Sxvqc=; b=WALVh9o+HvgIvXy/fYBXu/pMV48ZZyxBWzeYDJvxla6XMorQCUfX2ZOKglUzYxJGAD SxuLWXhTSK4KC+vWgfRFpOUEsyY0p7fXDxSywuHwYe3pq2DnrVBWNO1jdR5/c8mjGfvm FJ8qLOAD+KW/aXzgMziio88gsUiNbYfoKHpyBffNeuIwME6BS0DQA6KvzJ64zQ+X3a5t gfQG1kXHuzoHL4GYeHg/ukD3b0PnT59kQajGf/cu7QncpjHZ8NfngaEKkbyRVtiVzlL8 OJHhoDOq14Vwxs29Yl2bt2H6nooRJjNxEyd8zb5R4wC2qP98L7Wl0XBsKS9dIesfLyN2 MOAQ== Received: by 10.216.24.85 with SMTP id w63mr11140355wew.145.1343910842869; Thu, 02 Aug 2012 05:34:02 -0700 (PDT) Received: from LeMans.local (125.129.10.93.rev.sfr.net. [93.10.129.125]) by mx.google.com with ESMTPS id ck9sm16963159wib.2.2012.08.02.05.34.01 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 02 Aug 2012 05:34:02 -0700 (PDT) Message-ID: <501A73B8.3030009@richgray.com> Date: Thu, 02 Aug 2012 14:34:00 +0200 Reply-To: rich@richgray.com User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Lester Caine CC: "internals@lists.php.net" References: <501A69B4.4040401@lsces.co.uk> In-Reply-To: <501A69B4.4040401@lsces.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlBu/YBRBXZn1XigmpoSpm67ctd4XeMiD8OUzsHxP5uz+04RBRtINiA+mhOnWC2n4yGZwMW Subject: Re: [PHP-DEV] register_globals work arounds From: rich@richgray.com (rich gray) On 02/08/2012 13:51, Lester Caine wrote: > OK > > No discussions on why register_globals has been removed we all > understand why and now have to live with that ... I'm not winging here! > > The question is "Does anybody have an 'elegant' fix to quickly update > a legacy site that relies on globals to pass variables between page > views?" > My original quick thought was simply to remap these variables as > $_SESSION['var'] so as not to get too deeply into the code base. I've > used that in a few quick fixes, but I'm not sure that it is > acceptable? I have been passing the variables via $_REQUEST but that > obviously needs a lot more work in the html generated, so the session > approach would seem better? But needs to observe the European rules on > use of cookies :( > > I'm thinking that what is needed is a sort of PEAR package that would > simply be added to every page and be provided with a list of variables > to manage, so all we need to do is scan the site for variables and > establish which need to be remembered. I've got all sorts of stuff > from google/bing searches, but I'm obviously not yet asking the right > question ;) Has anybody already been down that track? > IMO - this should be posted on PHP general not internals -- have you tried extract() ? http://fr2.php.net/extract Rich