Re: [pmwiki-users] PHP 5.3 woes. Finally fixed

2009-10-24 Thread Vince Administration

On Oct 24, 2009, at 1:04 PM, rogu...@googlemail.com wrote:

> Vince Administration (2009-10-24 10:42):
>>
>> On Oct 24, 2009, at 5:34 AM, rogu...@googlemail.com wrote:
>>
>>> Vince Admin Account (2009-10-23 16:01):

 On Oct 19, 2009, at 5:13 PM, rogu...@googlemail.com wrote:

>
> The problem with pagelists lies in GlobToPCRE() function in
> pmwiki.php
> and is tracked at http://pmwiki.org/wiki/PITS/01149 . It concerns
> exclusion patterns (name=-Page) only.
>

>>>
>>> (:pagelist group=-PmWiki*,-Site*:) works fine here. Doesn't it
>>> work for
>>> you? Are you sure you've made the right changes to GlobToPCRE()? The
>>> line with str_replace call looks like this after changing:
>>>
>>> $pat = str_replace(array('\\*', '\\?', '\\[', '\\]', '\\^', '\\-'),
>>> array('.*',  '.',   '[',   ']',   '^', '-'), $pat);
>>>
>>
>> }
>
> You didn't answer my first question. Does the following work for you?
> (:pagelist group=-PmWiki*,-Site*:)
>
> There's no point pasting the entire function, because you should've
> changed only the two lines beginning with $pat = str_replace (which  
> look
> good above)... If you did more, I you've changed more than those, I'd
> suggest starting with a new pmwiki.php.
Well, first, it didn't work then. I had made two changes to the  
GlobToPCRE function,
the two lines i the str_replace function, and the change to the !   
entry as described in the PITS entry.
When I undid the second change, things started working.
Thanks again for all your help.  I will be more careful with my tests  
in the future.
   Vince





___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] PHP 5.3 woes.

2009-10-24 Thread rogutes
Vince Administration (2009-10-24 10:42):
> 
> On Oct 24, 2009, at 5:34 AM, rogu...@googlemail.com wrote:
> 
> >Vince Admin Account (2009-10-23 16:01):
> >>
> >>On Oct 19, 2009, at 5:13 PM, rogu...@googlemail.com wrote:
> >>
> >>>
> >>>The problem with pagelists lies in GlobToPCRE() function in
> >>>pmwiki.php
> >>>and is tracked at http://pmwiki.org/wiki/PITS/01149 . It concerns
> >>>exclusion patterns (name=-Page) only.
> >>>
> >>
> >
> >(:pagelist group=-PmWiki*,-Site*:) works fine here. Doesn't it
> >work for
> >you? Are you sure you've made the right changes to GlobToPCRE()? The
> >line with str_replace call looks like this after changing:
> >
> >$pat = str_replace(array('\\*', '\\?', '\\[', '\\]', '\\^', '\\-'),
> >  array('.*',  '.',   '[',   ']',   '^', '-'), $pat);
> >
> Well, I think I am sure. I can cut and paste, in case my eyes are
> too tired. Here is the entire function.
> function GlobToPCRE($pat) {
>   $pat = preg_quote($pat, '/');
>   $pat = str_replace(array('\\*', '\\?', '\\[', '\\]', '\\^', '\\-'),
>  array('.*',  '.',   '[',   ']',   '^', '-'),
> $pat);
>   $excl = array(); $incl = array();
>   foreach(preg_split('/,+\s?/', $pat, -1, PREG_SPLIT_NO_EMPTY) as $p) {
> if ($p{0} == '-'  ) $excl[] = '^'.substr($p, 0).'$';
> else $incl[] = "^$p$";
>   }
>   return array(implode('|', $incl), implode('|', $excl));
> }

You didn't answer my first question. Does the following work for you?
(:pagelist group=-PmWiki*,-Site*:)

There's no point pasting the entire function, because you should've
changed only the two lines beginning with $pat = str_replace (which look
good above)... If you did more, I you've changed more than those, I'd
suggest starting with a new pmwiki.php.

> Some other interesting things I found here.  We are running Apple
> Snow Leopard, PHP 5.3.0 and Apache 2.2.11.
> When I tried to test pieces of this code on my web page,  the line
> $pat = preg_quote($pat,'\');
> gave a syntax error.  It worked as in the manual with a few other
> characters instead of \. I did get it to work as advertised with
> $pat = preg_quote($pat,'\\');
> I tried that in GlobToPCRE, but it didn't help. So I am
> confused.  But at least I do have the workaround.
>  Vince

Compare
$pat = preg_quote($pat, '/');
to
$pat = preg_quote($pat, '\');

-- 
--  Rogutės Sparnuotos

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] PHP 5.3 woes.

2009-10-24 Thread Vince Administration


On Oct 24, 2009, at 5:34 AM, rogu...@googlemail.com wrote:


Vince Admin Account (2009-10-23 16:01):


On Oct 19, 2009, at 5:13 PM, rogu...@googlemail.com wrote:



The problem with pagelists lies in GlobToPCRE() function in  
pmwiki.php

and is tracked at http://pmwiki.org/wiki/PITS/01149 . It concerns
exclusion patterns (name=-Page) only.





(:pagelist group=-PmWiki*,-Site*:) works fine here. Doesn't it work  
for

you? Are you sure you've made the right changes to GlobToPCRE()? The
line with str_replace call looks like this after changing:

$pat = str_replace(array('\\*', '\\?', '\\[', '\\]', '\\^', '\\-'),
  array('.*',  '.',   '[',   ']',   '^', '-'), $pat);

Well, I think I am sure. I can cut and paste, in case my eyes are too  
tired. Here is the entire function.

function GlobToPCRE($pat) {
  $pat = preg_quote($pat, '/');
  $pat = str_replace(array('\\*', '\\?', '\\[', '\\]', '\\^', '\\-'),
 array('.*',  '.',   '[',   ']',   '^', '-'),  
$pat);

  $excl = array(); $incl = array();
  foreach(preg_split('/,+\s?/', $pat, -1, PREG_SPLIT_NO_EMPTY) as $p) {
if ($p{0} == '-'  ) $excl[] = '^'.substr($p, 0).'$';
else $incl[] = "^$p$";
  }
  return array(implode('|', $incl), implode('|', $excl));
}

Some other interesting things I found here.  We are running Apple Snow  
Leopard, PHP 5.3.0 and Apache 2.2.11.

When I tried to test pieces of this code on my web page,  the line
$pat = preg_quote($pat,'\');
gave a syntax error.  It worked as in the manual with a few other  
characters instead of \. I did get it to work as advertised with

$pat = preg_quote($pat,'\\');
I tried that in GlobToPCRE, but it didn't help. So I am confused.   
But at least I do have the workaround.

 Vince
 ___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] PHP 5.3 woes.

2009-10-24 Thread rogutes
Vince Admin Account (2009-10-23 16:01):
> 
> On Oct 19, 2009, at 5:13 PM, rogu...@googlemail.com wrote:
> 
> >
> >The problem with pagelists lies in GlobToPCRE() function in pmwiki.php
> >and is tracked at http://pmwiki.org/wiki/PITS/01149 . It concerns
> >exclusion patterns (name=-Page) only.
> >
> The suggested workaround for exclusion patterns (at least in my
> case)  allows the pagelist to work, but does not
> exclude anything.  A workaround for  this is to use $SearchPatterns
> in the config.php file.  This worked well for me.
> For example, to exclude all groups having a "-" in their name:
> $SearchPatterns['default'][] = '!^[A-Za-z]*-[A-Za-z]\.!;
> I know this will not work if the group names have special or
> international characters in their name, but it should be easy to
> adapt.
> Thanks for pointing out the PITS entry.
>Vince

(:pagelist group=-PmWiki*,-Site*:) works fine here. Doesn't it work for
you? Are you sure you've made the right changes to GlobToPCRE()? The
line with str_replace call looks like this after changing:

$pat = str_replace(array('\\*', '\\?', '\\[', '\\]', '\\^', '\\-'),
   array('.*',  '.',   '[',   ']',   '^', '-'), $pat);

-- 
--  Rogutės Sparnuotos

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] PHP 5.3 woes.

2009-10-23 Thread Vince Admin Account

On Oct 19, 2009, at 5:13 PM, rogu...@googlemail.com wrote:

>
> The problem with pagelists lies in GlobToPCRE() function in pmwiki.php
> and is tracked at http://pmwiki.org/wiki/PITS/01149 . It concerns
> exclusion patterns (name=-Page) only.
>
The suggested workaround for exclusion patterns (at least in my case)   
allows the pagelist to work, but does not
exclude anything.  A workaround for  this is to use $SearchPatterns in  
the config.php file.  This worked well for me.
For example, to exclude all groups having a "-" in their name:
$SearchPatterns['default'][] = '!^[A-Za-z]*-[A-Za-z]\.!;
I know this will not work if the group names have special or  
international characters in their name, but it should be easy to adapt.
Thanks for pointing out the PITS entry.
Vince


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] PHP 5.3 woes.

2009-10-19 Thread Vince Administration

On Oct 19, 2009, at 5:13 PM, rogu...@googlemail.com wrote:

> Vince Administration (2009-10-19 14:17):
>> On our system, Initially the pages more or less display, but not the
>> pagelists, with the default time zone warning either nicely
>> displayed near the end of the page, or one or several copies at the
>> top.
>> When I added the
>> date_default_timezone_set() = 'America/New_York';
>> to config.php, all the pages come up blank.
>> The session name line seems to have no effect.
>> We are running AuthUser.  Before I start deleting recipes, has
>> anyone got it to work yet?
>>
>> Thanks, Vince
>
> The line you are adding has syntax errors and error reporting is  
> turned
> off in your PHP config. It should read:
>  date_default_timezone_set('America/New_York');
>
> AuthUser seems to works here, but I didn't do much testing and didn't
> investigate beyond the workaround yet.
>
> The problem with pagelists lies in GlobToPCRE() function in pmwiki.php
> and is tracked at http://pmwiki.org/wiki/PITS/01149 . It concerns
> exclusion patterns (name=-Page) only.
>
> These two problems with PHP-5.3 are the only ones I've encountered so
> far.
>
> -- 
> --  Rogutės Sparnuotos
Thanks. I'll work out the error messages, but the fix to the date  
fixed most of the problems.
Thanks again for your help.
  Vince


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] PHP 5.3 woes.

2009-10-19 Thread rogutes
Vince Administration (2009-10-19 14:17):
> On our system, Initially the pages more or less display, but not the
> pagelists, with the default time zone warning either nicely
> displayed near the end of the page, or one or several copies at the
> top.
> When I added the
> date_default_timezone_set() = 'America/New_York';
> to config.php, all the pages come up blank.
> The session name line seems to have no effect.
> We are running AuthUser.  Before I start deleting recipes, has
> anyone got it to work yet?
> 
> Thanks, Vince

The line you are adding has syntax errors and error reporting is turned
off in your PHP config. It should read:
  date_default_timezone_set('America/New_York');

AuthUser seems to works here, but I didn't do much testing and didn't
investigate beyond the workaround yet.

The problem with pagelists lies in GlobToPCRE() function in pmwiki.php
and is tracked at http://pmwiki.org/wiki/PITS/01149 . It concerns
exclusion patterns (name=-Page) only.

These two problems with PHP-5.3 are the only ones I've encountered so
far.

-- 
--  Rogutės Sparnuotos

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users