Re: [PHP] notices nightmare - looking for a regex solution

2011-06-01 Thread Hans Ã…hlin
2011/6/2 Merlin Morgenstern : > Hi there, > > I am working on a pretty huge site with thousands of files with php code. > Unfortunatelly the app throws a ton of notices du to missing '' in arrays. > Of course I could simply disable the output on the dev server to surpress > notices, but I would rat

Re: [PHP] notices nightmare - looking for a regex solution

2011-06-01 Thread Adam Richardson
On Wed, Jun 1, 2011 at 6:26 PM, Merlin Morgenstern wrote: > Hi there, > > I am working on a pretty huge site with thousands of files with php code. > Unfortunatelly the app throws a ton of notices du to missing '' in arrays. > Of course I could simply disable the output on the dev server to surpre

Re: [PHP] notices nightmare - looking for a regex solution

2011-06-01 Thread Matt Giddings
I was thinking about this a little more and thought that the method I sent before will work, but it has the potential of clobbering variables that are not related to this warning/notice. Best bet would be to create a list of file names that contain the offending variables then feed that to sed usi

Re: [PHP] notices nightmare - looking for a regex solution

2011-06-01 Thread Matt Giddings
You can put an @ symbol in front each item that is throwing the error. That may take some time though. You could use something like find /htdocs_folder -name \*.php -print | xargs sed -i s/\$array_name/@$array_name/g That might get you what you're looking for. But be cautious because this meth

Re: [PHP] notices nightmare - looking for a regex solution

2011-06-01 Thread Govinda
> I am working on a pretty huge site with thousands of files with php code. > Unfortunatelly the app throws a ton of notices du to missing '' in arrays. Of > course I could simply disable the output on the dev server to surpress > notices, but I would rather like to get it fixed. > > Has somebo