php-general Digest 15 Apr 2012 10:46:04 -0000 Issue 7775

Topics (messages 317546 through 317552):

Re: case-insensitive $_REQUEST,$_GET,$_POST keys?
        317546 by: David OBrien
        317550 by: tamouse mailing lists

Upcoming Outage: php.net
        317547 by: Daniel Brown
        317548 by: Govinda

tempnam() not working as expected...
        317549 by: tamouse mailing lists
        317551 by: Matijn Woudt

strict nannying ...
        317552 by: Lester Caine

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Fri, Apr 13, 2012 at 1:13 PM, tamouse mailing lists <
tamouse.li...@gmail.com> wrote:

> Anyone have a quick-and-dirty way to check $_REQUEST keys that is
> case-insensitive?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
this what you asking?

foreach ( $_REQUEST as $key => $value ) {
      if ( strtolower($key) in array('name','username','password')) $data[
strtolower($key) ] = $value;
}

--- End Message ---
--- Begin Message ---
On Fri, Apr 13, 2012 at 12:22 PM, David OBrien <dgobr...@gmail.com> wrote:
> On Fri, Apr 13, 2012 at 1:13 PM, tamouse mailing lists
> <tamouse.li...@gmail.com> wrote:
>>
>> Anyone have a quick-and-dirty way to check $_REQUEST keys that is
>> case-insensitive?
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> this what you asking?
>
> foreach ( $_REQUEST as $key => $value ) {
>       if ( strtolower($key) in array('name','username','password')) $data[
> strtolower($key) ] = $value;
> }

That would do it! Thanks.

--- End Message ---
--- Begin Message ---
    Greetings, all;

    This coming Monday, 16 April, 2012, between the hours of 18:00 and
20:00 EDT (22:00 to 00:00 GMT), the one of the primary php.net servers
will be undergoing a critical preventative maintenance operation.  In
this two-hour maintenance window, we do expect a period of
interruption lasting up to thirty minutes, during which certain core
services will be partially or totally unavailable.

    The system that will experience the downtime is OSU1PHP.PHP.NET
which, among other things, is the primary system for our mail exchange
and master database.  As such, a sample of services that will likely
be unavailable for a short period of time will include:

        * Email (including mailing lists)
        * Events, user, and mirror management
        * User note submissions from userland
        * Et cetera

    We are informed by the on-site staff in Oregon State University's
Open Source Lab, who quite generously provide this system
free-of-charge, that while the maintenance is anticipated to take up
to thirty minutes, they will be making all attempts to limit the
downtime to a period of just five to ten minutes.

    My apologies for any inconvenience this may cause any of you, but
as stated, this is critical preventative maintenance that is required
to protect the integrity of the system, and to ensure that these
services are not negatively impacted in the future.

    Please contact me directly if you have any questions or concerns.

    Thanks, all, and have a great weekend.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
>    This coming Monday, 16 April, 2012, between the hours of 18:00 and
> 20:00 EDT (22:00 to 00:00 GMT), the one of the primary php.net servers
> will be undergoing a critical preventative maintenance operation.
> [snip]


thanks for the heads up!
:-)


--- End Message ---
--- Begin Message ---
Can someone explain the following to me:


<?php
$d=tempnam(".","dir");          /* create a temp named file */
unlink($d);                     /* unlink it because we're going to make it a 
directory */
mkdir($d,777,true);             /* make the directory */
echo "$d is ". (is_dir($d)?'':'NOT')." a directory\n";


$f=tempnam($d,"file");          /* using the first directory, create a new
temp named file */
unlink($f);                     /* unlink it as we're going to make it a 
directory */
mkdir($f,777,true);             /* make the directory */
echo "$f is ". (is_dir($f)?'':'NOT')." a directory\n";
?>

/Users/tamara/Sites/gallery/lib/common/t/dirGuWOLW is  a directory
/private/var/folders/pI/pIx-p0mhH5eEQ64yAiDQmE+++TI/-Tmp-/fileC7Rnzg
is  a directory

Why isn't the second tempnam using the directory path I pass to it?

The strange thing I notice is that if I pass in a directory path to
tempnam that was NOT created initially by tempnam, it works:

miishka:t tamara$ mkdir a
miishka:t tamara$ php -r 'echo
tempnam("/Users/tamara/Sites/gallery/lib/common/t/a","file").PHP_EOL;'
/Users/tamara/Sites/gallery/lib/common/t/a/filepSwRzF
miishka:t tamara$

--- End Message ---
--- Begin Message ---
On Sat, Apr 14, 2012 at 12:05 AM, tamouse mailing lists
<tamouse.li...@gmail.com> wrote:
> Can someone explain the following to me:
>
>
> <?php
> $d=tempnam(".","dir");          /* create a temp named file */
> unlink($d);                     /* unlink it because we're going to make it a 
> directory */
> mkdir($d,777,true);             /* make the directory */
> echo "$d is ". (is_dir($d)?'':'NOT')." a directory\n";
>
>
> $f=tempnam($d,"file");          /* using the first directory, create a new
> temp named file */
> unlink($f);                     /* unlink it as we're going to make it a 
> directory */
> mkdir($f,777,true);             /* make the directory */
> echo "$f is ". (is_dir($f)?'':'NOT')." a directory\n";
> ?>
>
> /Users/tamara/Sites/gallery/lib/common/t/dirGuWOLW is  a directory
> /private/var/folders/pI/pIx-p0mhH5eEQ64yAiDQmE+++TI/-Tmp-/fileC7Rnzg
> is  a directory
>
> Why isn't the second tempnam using the directory path I pass to it?
>
> The strange thing I notice is that if I pass in a directory path to
> tempnam that was NOT created initially by tempnam, it works:
>
> miishka:t tamara$ mkdir a
> miishka:t tamara$ php -r 'echo
> tempnam("/Users/tamara/Sites/gallery/lib/common/t/a","file").PHP_EOL;'
> /Users/tamara/Sites/gallery/lib/common/t/a/filepSwRzF
> miishka:t tamara$
>

Can you check what the permissions of $d are?

--- End Message ---
--- Begin Message ---
OK

I've got a machine set up with PHP5.4 and left the strict errors showing, and I'm falling at the first hurdle :)

The functions for generating URL's are used both statically and as part of the class. STRICT complains because they are not marked 'static' ( and I'm assuming 'public static' is the correct addition here ) but then of cause the $this fallback fails because '$this' is not allowed IN the static use of the function?

How do others get around this problem? I've some 120 static instances to fix in parallel with about the same number of class uses across about 40 odd functions. Do I really have to duplicate the code and rename every static use?

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--- End Message ---

Reply via email to