php-general Digest 8 May 2008 07:24:31 -0000 Issue 5447

Topics (messages 273999 through 274027):

Re: Regex to catch <p>s (weird result)
        273999 by: Ryan S
        274000 by: Ryan S
        274001 by: Shawn McKenzie
        274002 by: Shawn McKenzie
        274004 by: Ryan S
        274005 by: Ryan S
        274008 by: Jon L.

ldap_search results limited
        274003 by: mburtch
        274006 by: Nathan Nobbe
        274007 by: Jay Blanchard
        274015 by: mburtch
        274016 by: Nathan Nobbe

php 5.2.6 make failure
        274009 by: Steven Perez

Re: $_SESSION v. Cookies
        274010 by: tedd
        274013 by: Robert Cummings
        274014 by: Nathan Nobbe
        274017 by: tedd
        274018 by: Robert Cummings
        274021 by: Nathan Nobbe
        274027 by: Németh Zoltán

Re: How to determine if file is writable and deletable
        274011 by: tedd
        274012 by: Richard Heyes
        274019 by: tedd
        274020 by: Richard Heyes

Re: Regex to catch <p>s
        274022 by: Aschwin Wesselius

Redirection
        274023 by: Ben
        274024 by: Kyle Browning
        274025 by: TG
        274026 by: Nathan Nobbe

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
<clip>


preg_match_all('|<p[^>]*>(.*)</p>|Ui', $myText, $myArray);
</clip>

Hey!

Thanks for replying.

Your preg_match_all works like a charm, but for some reason catches only 8 out 
of 9 paragraphs... its really weird. I have upped the test page to 
http://www.ezee.se/tests/para_regex2.php.txt  so you can have a look at it... 
didnt want to post such a lot of text to the list.

Thanks again,
R


      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

--- End Message ---
--- Begin Message ---
<clip>


preg_match_all('|<p[^>]*>(.*)</p>|Ui', $myText, $myArray);
</clip>

Hey!

Thanks for replying.

Your preg_match_all works like a charm, but for some reason catches only 8 out 
of 9 paragraphs... its really weird. I have upped the test page to 
http://www.ezee.se/tests/para_regex2.php.txt  so you can have a look at it... 
didnt want to post such a lot of text to the list.

Thanks again,
R


      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

--- End Message ---
--- Begin Message ---
Ryan S wrote:
<clip>


preg_match_all('|<p[^>]*>(.*)</p>|Ui', $myText, $myArray);
</clip>

Hey!

Thanks for replying.

Your preg_match_all works like a charm, but for some reason catches only 8 out 
of 9 paragraphs... its really weird. I have upped the test page to 
http://www.ezee.se/tests/para_regex2.php.txt  so you can have a look at it... 
didnt want to post such a lot of text to the list.

Thanks again,
R


      
____________________________________________________________________________________
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Yep, sorry...  Just add the s

preg_match_all('|<p[^>]*>(.*)</p>|Uis', $myText, $myArray);

--- End Message ---
--- Begin Message ---
Ryan S wrote:
<clip>


preg_match_all('|<p[^>]*>(.*)</p>|Ui', $myText, $myArray);
</clip>

Hey!

Thanks for replying.

Your preg_match_all works like a charm, but for some reason catches only 8 out 
of 9 paragraphs... its really weird. I have upped the test page to 
http://www.ezee.se/tests/para_regex2.php.txt  so you can have a look at it... 
didnt want to post such a lot of text to the list.

Thanks again,
R


      
____________________________________________________________________________________
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Yep, sorry...  Just add the s

preg_match_all('|<p[^>]*>(.*)</p>|Uis', $myText, $myArray);

--- End Message ---
--- Begin Message ---
<clip>
> http://www.ezee.se/tests/para_regex2.php.txt  

Yep, sorry...  Just add the s

preg_match_all('|<p[^>]*>(.*)</p>|Uis', $myText, $myArray);

</clip>

Sweeeeett! It works!
If you _do get time_, would love to know the actual meaning of 
|<p[^>]*>(.*)</p>|Uis
because although I do appreciate the help and the code, am learning to work a 
bit with regex
and this is still quite advanced for me.
So far I have gotten (correct me if I am wrong)
|<p[^>]*> = 1) Starts with "<p"  2) can have anything between till the next > 
3) end with ">"
(.*)</p>| = 1) can have whatever inbetween till the end which is "</p>"

Have no idea of the Uis switches...

Thanks again,
R



      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

--- End Message ---
--- Begin Message ---
<clip>
> http://www.ezee.se/tests/para_regex2.php.txt  

Yep, sorry...  Just add the s

preg_match_all('|<p[^>]*>(.*)</p>|Uis', $myText, $myArray);

</clip>

Sweeeeett! It works!
If you _do get time_, would love to know the actual meaning of 
|<p[^>]*>(.*)</p>|Uis
because although I do appreciate the help and the code, am learning to work a 
bit with regex
and this is still quite advanced for me.
So far I have gotten (correct me if I am wrong)
|<p[^>]*> = 1) Starts with "<p"  2) can have anything between till the next > 
3) end with ">"
(.*)</p>| = 1) can have whatever inbetween till the end which is "</p>"

Have no idea of the Uis switches...

Thanks again,
R



      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

--- End Message ---
--- Begin Message ---
Pretty close.

The only thing I'd suggest is a different way of wording step 2:
Can contain anything but '>' until step 3.

As for the switches/modifiers (Uis), check out:
http://us.php.net/manual/en/reference.pcre.pattern.modifiers.php

U = ungreedy
i = case-insensitive (|p| matches 'p' and/or 'P')
s = treat as single line

- Jon L.

On Wed, May 7, 2008 at 1:51 PM, Ryan S <[EMAIL PROTECTED]> wrote:

> <clip>
> > http://www.ezee.se/tests/para_regex2.php.txt
>
> Yep, sorry...  Just add the s
>
> preg_match_all('|<p[^>]*>(.*)</p>|Uis', $myText, $myArray);
>
> </clip>
>
> Sweeeeett! It works!
> If you _do get time_, would love to know the actual meaning of
> |<p[^>]*>(.*)</p>|Uis
> because although I do appreciate the help and the code, am learning to
> work a bit with regex
> and this is still quite advanced for me.
> So far I have gotten (correct me if I am wrong)
> |<p[^>]*> = 1) Starts with "<p"  2) can have anything between till the
> next > 3) end with ">"
> (.*)</p>| = 1) can have whatever inbetween till the end which is "</p>"
>
> Have no idea of the Uis switches...
>
> Thanks again,
> R
>
>
>
>
>  
> ____________________________________________________________________________________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile.  Try it now.
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
I am running into a problem with my queries returning a limited number of
result entries. The LDAP server is Kerio Mail Server, and I am verified that
the SIZELIMIT in the server's configuration is 0 (no limit). For some
reason, my server seems to be limited to 200 results if no limit is
specified in ldap_search(), or 201 (?!) if I specify a limit larger than
200.

// setting the protocol version
ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3); // returns TRUE

// getting & settings SIZELIMIT options
ldap_get_option($conn, LDAP_OPT_SIZELIMIT, $optVal); // returns 0
ldap_set_option($conn, LDAP_OPT_SIZELIMIT, 1000); // returns TRUE

// some example queries
$res = ldap_search($conn, "", "cn=*", $attrs, false, 0); // 200 results
$res = ldap_search($conn, "", "cn=*", $attrs, false, 1000); // 201 results
$res = ldap_search($conn, "", "cn=*", $attrs, false, 199); // 199 results

I am using MAMP with PHP 5.2.5. Any ideas?

- MB
-- 
View this message in context: 
http://www.nabble.com/ldap_search-results-limited-tp17112001p17112001.html
Sent from the PHP - General mailing list archive at Nabble.com.


--- End Message ---
--- Begin Message ---
On Wed, May 7, 2008 at 12:50 PM, mburtch <[EMAIL PROTECTED]> wrote:

>
> I am running into a problem with my queries returning a limited number of
> result entries. The LDAP server is Kerio Mail Server, and I am verified
> that
> the SIZELIMIT in the server's configuration is 0 (no limit). For some
> reason, my server seems to be limited to 200 results if no limit is
> specified in ldap_search(), or 201 (?!) if I specify a limit larger than
> 200.
>
> // setting the protocol version
> ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3); // returns TRUE
>
> // getting & settings SIZELIMIT options
> ldap_get_option($conn, LDAP_OPT_SIZELIMIT, $optVal); // returns 0
> ldap_set_option($conn, LDAP_OPT_SIZELIMIT, 1000); // returns TRUE
>
> // some example queries
> $res = ldap_search($conn, "", "cn=*", $attrs, false, 0); // 200 results
> $res = ldap_search($conn, "", "cn=*", $attrs, false, 1000); // 201 results
> $res = ldap_search($conn, "", "cn=*", $attrs, false, 199); // 199 results
>
> I am using MAMP with PHP 5.2.5. Any ideas?


hard to say if its a php issue..  have you tried using phpLdapAdmin ?  i
usually set that up on my ldap installs; kindofa nice failsafe.

-nathan

--- End Message ---
--- Begin Message ---
[snip]
> I am running into a problem with my queries returning a limited number
of
> result entries. 
[/snip]

Most LDAP servers set a limit, it is usually not a PHP problem. One way
to solve is to query by first letter of last name and throw into an
array (iterating through the alphabet).

function ldapUserList($username, $password, $ip="127.0.0.1"){

        $arrLetters = array("A", "B", "C", "D", "E", "F", "G", "H", "I",
"J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W",
"X", "Y", "Z");

        /* connect to AD server */
        if(!$ds=ldap_connect($ip)){
                echo "did not connect...please contact system
administrator or go back to try again";
        }

        /* set LDAP option */
        $un = "domain\\".$username;
        $upw = $password;
        ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
        ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
        ldap_set_option($ds, LDAP_OPT_SIZELIMIT, 0);

        /* bind to AD server */
        if(!$r=ldap_bind($ds, $un, $upw)){
            echo 'You are not authorized and or, your login information
was incorrect<br />';
            echo $un.": ".$upw."<br />\n";
        } else {
                $userArray = array();
                foreach($arrLetters as $letter){

                        /*
                         * search AD for users with surnames (sn), valid
e-mail addresses (mail)
                         * and make sure that they are valid
(msExchHideFromAddessLists)
                         */

                        $sr= @ldap_search($ds, "dc=domain, dc=local",
"(&(&(sn=".$letter."*)([EMAIL PROTECTED]))(!(msExchHideFromAddressLists=
TRUE)))");
                        $info = ldap_get_entries($ds, $sr);
                        if(0 != count($info)){
                                /* place all valid entries into a usable
array */
                                for ($i=0; $i<count($info); $i++) {
                                        /* make sure the item being
pushed into the array is not empty */
                                        if('' !=
$info[$i]["mailnickname"][0]){
                                                //array_push($userArray,
$info[$i]["mailnickname"][0] . "+".$info[$i]["cn"][0] .
"+".$info[$i]["mail"][0]);
                                                $fullname =
$info[$i]["cn"][0];
                                                $arrFN = explode("
",$fullname);
                                                $fullname = $arrFN[1].",
".$arrFN[0];
                                                $readname = $arrFN[0]."
".$arrFN[1];
                                                $tusername =
strtolower($info[$i]["samaccountname"][0]);
                                                $tempArray =
array("username"=>$tusername, "fullname"=>$fullname,
"readname"=>$readname);
                                                array_push($userArray,
$tempArray);
                                        }
                                }
                        }
                }       
        }
        /* sort the user array alphabetically and re-align numeric key
*/

        array_multisort($userArray[1], SORT_ASC, SORT_STRING);
        return $userArray;
}



$userArray = ldapUserList($_SESSION['user'], $_SESSION['password'],
"127.0.0.1");

Sorry about the funky line breaks

--- End Message ---
--- Begin Message ---
Thanks for the tips. phpLDAPAdmin was hanging while trying to authenticate,
but I'll give it a try again later.

Nathan: splitting up the search; I hadn't considered this! It is working
nicely for the time being, thanks.

- MB

On Wed, May 7, 2008 at 3:23 PM, Jay Blanchard <[EMAIL PROTECTED]> wrote:

> [snip]
> > I am running into a problem with my queries returning a limited number
> of
> > result entries.
> [/snip]
>
> Most LDAP servers set a limit, it is usually not a PHP problem. One way
> to solve is to query by first letter of last name and throw into an
> array (iterating through the alphabet).
>
> function ldapUserList($username, $password, $ip="127.0.0.1"){
>
>        $arrLetters = array("A", "B", "C", "D", "E", "F", "G", "H", "I",
> "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W",
> "X", "Y", "Z");
>
>        /* connect to AD server */
>        if(!$ds=ldap_connect($ip)){
>                echo "did not connect...please contact system
> administrator or go back to try again";
>        }
>
>        /* set LDAP option */
>        $un = "domain\\".$username;
>        $upw = $password;
>        ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
>        ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
>        ldap_set_option($ds, LDAP_OPT_SIZELIMIT, 0);
>
>        /* bind to AD server */
>        if(!$r=ldap_bind($ds, $un, $upw)){
>            echo 'You are not authorized and or, your login information
> was incorrect<br />';
>            echo $un.": ".$upw."<br />\n";
>        } else {
>                $userArray = array();
>                foreach($arrLetters as $letter){
>
>                        /*
>                         * search AD for users with surnames (sn), valid
> e-mail addresses (mail)
>                         * and make sure that they are valid
> (msExchHideFromAddessLists)
>                         */
>
>                        $sr= @ldap_search($ds, "dc=domain, dc=local",
> "(&(&(sn=".$letter."*)([EMAIL PROTECTED]))(!(msExchHideFromAddressLists=
> TRUE)))");
>                        $info = ldap_get_entries($ds, $sr);
>                        if(0 != count($info)){
>                                /* place all valid entries into a usable
> array */
>                                for ($i=0; $i<count($info); $i++) {
>                                        /* make sure the item being
> pushed into the array is not empty */
>                                        if('' !=
> $info[$i]["mailnickname"][0]){
>                                                //array_push($userArray,
> $info[$i]["mailnickname"][0] . "+".$info[$i]["cn"][0] .
> "+".$info[$i]["mail"][0]);
>                                                $fullname =
> $info[$i]["cn"][0];
>                                                $arrFN = explode("
> ",$fullname);
>                                                $fullname = $arrFN[1].",
> ".$arrFN[0];
>                                                $readname = $arrFN[0]."
> ".$arrFN[1];
>                                                $tusername =
> strtolower($info[$i]["samaccountname"][0]);
>                                                $tempArray =
> array("username"=>$tusername, "fullname"=>$fullname,
> "readname"=>$readname);
>                                                array_push($userArray,
> $tempArray);
>                                        }
>                                }
>                        }
>                }
>        }
>        /* sort the user array alphabetically and re-align numeric key
> */
>
>        array_multisort($userArray[1], SORT_ASC, SORT_STRING);
>        return $userArray;
> }
>
>
>
> $userArray = ldapUserList($_SESSION['user'], $_SESSION['password'],
> "127.0.0.1");
>
> Sorry about the funky line breaks
>

--- End Message ---
--- Begin Message ---
On Wed, May 7, 2008 at 2:26 PM, Matt Burtch <[EMAIL PROTECTED]> wrote:

> Thanks for the tips. phpLDAPAdmin was hanging while trying to
> authenticate, but I'll give it a try again later.
>
> Nathan: splitting up the search; I hadn't considered this! It is working
> nicely for the time being, thanks.


umm, that was jay who gave the tip, but ... youre welcome! :)

-nathan

--- End Message ---
--- Begin Message --- I am having a problem that I cannot seem to get through. Unfortunately, I was given the task of getting a working php binary for a modified redhat 7.2 box (I know I know). I got through the configure phase but I cannot seem to complete the make process. The following is what I get as an error:

ext/openssl/openssl.o: In function `zif_openssl_sign':
/home/sperez/php-5.2.6/ext/openssl/openssl.c:3525: undefined reference to `EVP_MD_CTX_cleanup'
ext/openssl/openssl.o: In function `zif_openssl_verify':
/home/sperez/php-5.2.6/ext/openssl/openssl.c:3565: undefined reference to `EVP_MD_CTX_cleanup'
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1


The version of openssl I am using is the following:

# ./openssl version
OpenSSL 0.9.6l 04 Nov 2003


My config statement is the following:

../configure --with-mysql=/usr/local/mysql --enable-sysvshm=yes --enable-sysvsem=yes --enable-debug=no --enable-safe-mode=yes --enable-track-vars=yes --enable-force-cgi-redirect=yes --enable-url-fopen-wrapper=yes --with-ttf=/usr/local --with-png-dir=/usr/local --with-zlib-dir=/usr/local --with-jpeg-dir=/usr/local --with-mhash=/usr/local --with-mcrypt=/usr/local --with-gdbm=/usr/local --enable-ftp --with-tiff-dir=/usr/local --with-curl=/usr/local --enable-memory-limit --enable-mbstring --with-expat-dir=/usr/local --enable-sockets --enable-wddx --with-mcal=/usr/local/mcal --with-freetype-dir=/usr/local --enable-bcmath --with-xsl=/usr/local --enable-mbstr-enc-trans --enable-mbregex --with-xsl=/usr/local --enable-exif --with-gd2 --enable-gd-native-ttf --enable-gd-imgstrttf --prefix=/usr/local/php5 --with-pear=/usr/local/php5/share/pear --enable-calendar --with-dom=/usr/local --with-openssl=/usr/local/ssl --with-zip=/usr/local --with-pdflib=/usr/local --with-iconv=/usr/local --with-imap=/usr/local/imap-2007a --with-pspell=/usr/local --enable-soap --with-gettext=/usr/local --with-mssql=/usr/local --with-imap-ssl=/usr/local/imap-2007a 2>&1 | tee configure.out


I updated to the latest imap, curl, etc. based on what I have been reading online. I have no idea what to do at this time. I do recall someone mentioning about php not working correctly with a specific openssl version. Can someone point me to the right direction as I am out of ideas.




--- End Message ---
--- Begin Message ---
At 12:34 PM -0400 5/7/08, Robert Cummings wrote:

The exception being when it performs cleanup. Cleanup should be
relegated to a cron job.

Rob:

What clean-up?

Cheers,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
On Wed, 2008-05-07 at 16:03 -0400, tedd wrote:
> At 12:34 PM -0400 5/7/08, Robert Cummings wrote:
> >
> >The exception being when it performs cleanup. Cleanup should be
> >relegated to a cron job.
> 
> Rob:
> 
> What clean-up?

All the inactive session files... inactive and garbage collection time
is denoted by the following php.ini settings:

session.gc_probability    = 1     ; percentual probability that the 
                                  ; 'garbage collection' process is
                                  ; started
                                  ; on every session initialization
session.gc_maxlifetime    = 1440  ; after this number of seconds,
                                  ; stored data will be seen as
                                  ; 'garbage' and cleaned up by the
                                  ; gc process

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


--- End Message ---
--- Begin Message ---
On Wed, May 7, 2008 at 2:22 PM, Robert Cummings <[EMAIL PROTECTED]>
wrote:

>
> On Wed, 2008-05-07 at 16:03 -0400, tedd wrote:
> > At 12:34 PM -0400 5/7/08, Robert Cummings wrote:
> > >
> > >The exception being when it performs cleanup. Cleanup should be
> > >relegated to a cron job.
> >
> > Rob:
> >
> > What clean-up?
>
> All the inactive session files... inactive and garbage collection time
> is denoted by the following php.ini settings:
>
> session.gc_probability    = 1     ; percentual probability that the
>                                  ; 'garbage collection' process is
>                                  ; started
>                                  ; on every session initialization
> session.gc_maxlifetime    = 1440  ; after this number of seconds,
>                                  ; stored data will be seen as
>                                  ; 'garbage' and cleaned up by the
>                                  ; gc process


so where is the setting, using the stock session handler, to relegate the gc
process to a cron job ?

-nathan

--- End Message ---
--- Begin Message ---
At 4:22 PM -0400 5/7/08, Robert Cummings wrote:
On Wed, 2008-05-07 at 16:03 -0400, tedd wrote:
 At 12:34 PM -0400 5/7/08, Robert Cummings wrote:
 >
 >The exception being when it performs cleanup. Cleanup should be
 >relegated to a cron job.

 Rob:

 What clean-up?

All the inactive session files... inactive and garbage collection time
is denoted by the following php.ini settings:

session.gc_probability    = 1     ; percentual probability that the
                                  ; 'garbage collection' process is
                                  ; started
                                  ; on every session initialization
session.gc_maxlifetime    = 1440  ; after this number of seconds,
                                  ; stored data will be seen as
                                  ; 'garbage' and cleaned up by the
                                  ; gc process

Cheers,
Rob.

Oh, Okay. That's an automatic practice taken from the php.ini settings. I was thinking that maybe one was supposed to do something after using sessions.

Thanks,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
On Wed, 2008-05-07 at 14:29 -0600, Nathan Nobbe wrote:
> On Wed, May 7, 2008 at 2:22 PM, Robert Cummings <[EMAIL PROTECTED]>
> wrote:
>         
>         On Wed, 2008-05-07 at 16:03 -0400, tedd wrote:
>         > At 12:34 PM -0400 5/7/08, Robert Cummings wrote:
>         > >
>         > >The exception being when it performs cleanup. Cleanup
>         should be
>         > >relegated to a cron job.
>         >
>         > Rob:
>         >
>         > What clean-up?
>         
>         
>         All the inactive session files... inactive and garbage
>         collection time
>         is denoted by the following php.ini settings:
>         
>         session.gc_probability    = 1     ; percentual probability
>         that the
>                                          ; 'garbage collection'
>         process is
>                                          ; started
>                                          ; on every session
>         initialization
>         session.gc_maxlifetime    = 1440  ; after this number of
>         seconds,
>                                          ; stored data will be seen as
>                                          ; 'garbage' and cleaned up by
>         the
>                                          ; gc process
> 
> so where is the setting, using the stock session handler, to relegate
> the gc process to a cron job ?

session.gc_probability = 0

Then do it yourself in a script called by cron.

Cheers,
Rob.

-- 
http://www.interjinn.com
Application and Templating Framework for PHP


--- End Message ---
--- Begin Message ---
On Wed, May 7, 2008 at 2:35 PM, Robert Cummings <[EMAIL PROTECTED]>
wrote:

>
> On Wed, 2008-05-07 at 14:29 -0600, Nathan Nobbe wrote:
> > On Wed, May 7, 2008 at 2:22 PM, Robert Cummings <[EMAIL PROTECTED]>
> > wrote:
> >
> >         On Wed, 2008-05-07 at 16:03 -0400, tedd wrote:
> >         > At 12:34 PM -0400 5/7/08, Robert Cummings wrote:
> >         > >
> >         > >The exception being when it performs cleanup. Cleanup
> >         should be
> >         > >relegated to a cron job.
> >         >
> >         > Rob:
> >         >
> >         > What clean-up?
> >
> >
> >         All the inactive session files... inactive and garbage
> >         collection time
> >         is denoted by the following php.ini settings:
> >
> >         session.gc_probability    = 1     ; percentual probability
> >         that the
> >                                          ; 'garbage collection'
> >         process is
> >                                          ; started
> >                                          ; on every session
> >         initialization
> >         session.gc_maxlifetime    = 1440  ; after this number of
> >         seconds,
> >                                          ; stored data will be seen as
> >                                          ; 'garbage' and cleaned up by
> >         the
> >                                          ; gc process
> >
> > so where is the setting, using the stock session handler, to relegate
> > the gc process to a cron job ?
>
> session.gc_probability = 0
>

but wont it still try to run sometimes since that setting determines whether
or not the gc will run *every* time ?  i would imagine if it was for *any*
time, setting session.gc_probability = 0 would effectively disable the stock
gc.

Then do it yourself in a script called by cron.


it would be nice if you could latch into the one they provide out of the box
and just invoke it via cron..

-nathan

--- End Message ---
--- Begin Message ---
> On Wed, May 7, 2008 at 2:35 PM, Robert Cummings <[EMAIL PROTECTED]>
> wrote:
>
>>
>> On Wed, 2008-05-07 at 14:29 -0600, Nathan Nobbe wrote:
>> > On Wed, May 7, 2008 at 2:22 PM, Robert Cummings <[EMAIL PROTECTED]>
>> > wrote:
>> >
>> >         On Wed, 2008-05-07 at 16:03 -0400, tedd wrote:
>> >         > At 12:34 PM -0400 5/7/08, Robert Cummings wrote:
>> >         > >
>> >         > >The exception being when it performs cleanup. Cleanup
>> >         should be
>> >         > >relegated to a cron job.
>> >         >
>> >         > Rob:
>> >         >
>> >         > What clean-up?
>> >
>> >
>> >         All the inactive session files... inactive and garbage
>> >         collection time
>> >         is denoted by the following php.ini settings:
>> >
>> >         session.gc_probability    = 1     ; percentual probability
>> >         that the
>> >                                          ; 'garbage collection'
>> >         process is
>> >                                          ; started
>> >                                          ; on every session
>> >         initialization
>> >         session.gc_maxlifetime    = 1440  ; after this number of
>> >         seconds,
>> >                                          ; stored data will be seen as
>> >                                          ; 'garbage' and cleaned up by
>> >         the
>> >                                          ; gc process
>> >
>> > so where is the setting, using the stock session handler, to relegate
>> > the gc process to a cron job ?
>>
>> session.gc_probability = 0
>>
>
> but wont it still try to run sometimes since that setting determines
> whether
> or not the gc will run *every* time ?  i would imagine if it was for *any*
> time, setting session.gc_probability = 0 would effectively disable the
> stock
> gc.
>

that setting is the chance (in percents) for the stock gc to run at any
request. so if it is set to 0, it does not have a chance ;)
of course it will try but it always decides not to run

greets,
Zoltán Németh

> Then do it yourself in a script called by cron.
>
>
> it would be nice if you could latch into the one they provide out of the
> box
> and just invoke it via cron..
>
> -nathan
>



--- End Message ---
--- Begin Message ---
At 11:16 AM -0400 5/7/08, Al wrote:
I need to determine if a file is truly deletable by a php script, Deleting permissions seem to be the same as writing, they probably have the same criteria.

is_writable() seems to virtually useless in most cases. It doesn't take into account the directory ownership/permissions; which, best I can tell, is the real determining factor.

I've resorted to having to determine the directory's ownership and then compare the directory's rights with the owner's and then the other ['world'].

E.g., Assume my script was loaded with ftp, so it's ownership is the site-name, and I want the scrip to be able to determine if it can delete a file. Thus, the file in question must have its "other" permissions include write.

Surely, there must be an easier way.

Thanks, Al........


Perhaps touch might help.

http://nl.php.net/manual/en/function.touch.php

Cheers,

tedd


--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
Perhaps touch might help.

Touch my ass.

ROFLMAO

(I've been waiting for years to use that one)

--
Richard Heyes

+----------------------------------------+
| Access SSH with a Windows mapped drive |
|    http://www.phpguru.org/sftpdrive    |
+----------------------------------------+

--- End Message ---
--- Begin Message ---
At 9:18 PM +0100 5/7/08, Richard Heyes wrote:
Perhaps touch might help.

Touch my ass.

ROFLMAO

(I've been waiting for years to use that one)


It won't work?

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
It won't work?

No idea, it was just a rather poor play on words.

--
Richard Heyes

+----------------------------------------+
| Access SSH with a Windows mapped drive |
|    http://www.phpguru.org/sftpdrive    |
+----------------------------------------+

--- End Message ---
--- Begin Message ---
Ryan S wrote:
Hey!

Thansk for replying!

<clip>
It is obvious I haven't had my caffeine yet. This is my last try to get the pattern straight:

<?php

$html = <<<END_OF_HTML

<b>hello</b>
<b class="blah">hello</b>
<p>those</p>
<p class="blah">hello</p>
<a>hello</a>
<a href="url">this</a>
<a>rose</a>
<a href="regex yo">hello</a>
<a>nose</a>
<a id="2" href="regex yo">hello</a>
<p>that</p>
<p class="blah" title="whatever">hello</p>
END_OF_HTML;

$tags = array();
$tags[] = 'p';
$tags[] = 'a';

$attr = array();
$attr[] = 'class';
$attr[] = 'href';

$vals = array();
$vals[] = 'blah';
$vals[] = 'url';
$vals[] = 'yo';

$text = array();
$text[] = 'hello';
$text[] = 'this';
$text[] = 'that';

$tags = implode('|', $tags);
$attr = implode('|', $attr);
$vals = implode('|', $vals);
$text = implode('|', $text);

$pattern = '/<('.$tags.')[^>]*('.$attr.')?[^>]*('.$vals.')?[^>]*>('.$text.')[^<\/]*<\/\1>/i';

echo $pattern."\n";
echo "--------------------\n";

preg_match_all($pattern, $html, $matches);

var_dump($matches);

?>
</clip>

I dont get why you added this
$tags[] = 'a';

Does that mean I will have to make tags like that for all the html tags that i think will be on the page?

Hi,

I said before that the example could be a little bit overkill, but it gives a quick example how to find any tag(s) given, with any attribute(s) given and with any text given in between the opening and closing tag.

And yes, it might be incomplete or maybe not even accurate, but it does give you a headstart on your solution. There always will be people who will give you a shorter, cleaner, more beautiful example, but I hope that it was helpful for you or will be helpful for someone else.

Cheers,

Aschwin Wesselius


--- End Message ---
--- Begin Message ---
Is there a way to take all the variables, no matter what their names and 
values are, from the parameters in a url and POST them to another URL so 
that they don't show up in the address bar?  I've noticed a huge increase in 
my bounce rate since I added some tracking parameters to my urls, but I need 
the tracking parameters so I don't trust a client-side redirect.  Thanks. 



--- End Message ---
--- Begin Message ---
Javascript can help you there.


On May 7, 2008, at 4:55 PM, Ben wrote:

Is there a way to take all the variables, no matter what their names and values are, from the parameters in a url and POST them to another URL so that they don't show up in the address bar? I've noticed a huge increase in my bounce rate since I added some tracking parameters to my urls, but I need the tracking parameters so I don't trust a client-side redirect. Thanks.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
I believe you can use cURL to create POST requests.

-TG

----- Original Message -----
From: "Ben" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Date: Wed, 7 May 2008 17:55:34 -0600
Subject: [PHP] Redirection

> Is there a way to take all the variables, no matter what their names and 
> values are, from the parameters in a url and POST them to another URL so 
> that they don't show up in the address bar?  I've noticed a huge increase 
in 
> my bounce rate since I added some tracking parameters to my urls, but I 
need 
> the tracking parameters so I don't trust a client-side redirect.  Thanks. 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
On Wed, May 7, 2008 at 5:55 PM, Ben <[EMAIL PROTECTED]> wrote:

> Is there a way to take all the variables, no matter what their names and
> values are, from the parameters in a url and POST them to another URL so
> that they don't show up in the address bar?  I've noticed a huge increase
> in
> my bounce rate since I added some tracking parameters to my urls, but I
> need
> the tracking parameters so I don't trust a client-side redirect.  Thanks.


maybe you could use mod_rewrite and remove the tracking vars from the urls ?

-nathan

--- End Message ---

Reply via email to