php-general Digest 7 Jun 2011 13:55:50 -0000 Issue 7349
Topics (messages 313417 through 313438):
Can't use class "'DOMDocument"
313417 by: Adam Tong
313419 by: Jim Lucas
313423 by: admin.buskirkgraphics.com
Re: Going crazy with include & require not working
313418 by: tedd
313425 by: Richard Quadling
php hide menu
313420 by: Chris Stinemetz
313421 by: Joshua Kehn
313422 by: admin.buskirkgraphics.com
313430 by: Chris Stinemetz
313433 by: Jay Blanchard
Re: PHP download page blocking other HTTP requests
313424 by: Pete Ford
313426 by: Richard Quadling
What do you get for ...
313427 by: Richard Quadling
313428 by: Jason
313429 by: admin.buskirkgraphics.com
313431 by: Richard Quadling
313432 by: Stuart Dallas
313434 by: Richard Quadling
313435 by: Geoff Lane
313436 by: Richard Quadling
313437 by: Vitalii Demianets
313438 by: Steve Staples
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 ---
Hi,
When I try using DOMDocument I get the following error:
Fatal error: Class 'DOMDocument' not found in ...
I guess something has to be fixed in my php.ini?
Here is my php version:
# php -version
PHP 5.3.6 (cli) (built: Mar 17 2011 20:58:15)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
I also noticed when I click reply in gmail it does not reply to the
list. Sorry for that inconvenience for poeple who tried to help me
while the previous issue was already resolved.
Thank you
--- End Message ---
--- Begin Message ---
On 6/6/2011 6:49 PM, Adam Tong wrote:
Hi,
When I try using DOMDocument I get the following error:
Fatal error: Class 'DOMDocument' not found in ...
I guess something has to be fixed in my php.ini?
Here is my php version:
# php -version
PHP 5.3.6 (cli) (built: Mar 17 2011 20:58:15)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
I also noticed when I click reply in gmail it does not reply to the
list. Sorry for that inconvenience for poeple who tried to help me
while the previous issue was already resolved.
Thank you
http://us.php.net/manual/en/dom.setup.php
--- End Message ---
--- Begin Message ---
Did you install the php-xml ?
Richard L. Buskirk
-----Original Message-----
From: Adam Tong [mailto:adam.to...@gmail.com]
Sent: Monday, June 06, 2011 9:49 PM
To: php-gene...@lists.php.net
Subject: [PHP] Can't use class "'DOMDocument"
Hi,
When I try using DOMDocument I get the following error:
Fatal error: Class 'DOMDocument' not found in ...
I guess something has to be fixed in my php.ini?
Here is my php version:
# php -version
PHP 5.3.6 (cli) (built: Mar 17 2011 20:58:15)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
I also noticed when I click reply in gmail it does not reply to the
list. Sorry for that inconvenience for poeple who tried to help me
while the previous issue was already resolved.
Thank you
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
At 5:50 PM -0700 6/6/11, Brian Dunning wrote:
Here's my code:
error_reporting(E_ALL);
require_once('/var/www/mysite/includes/fpdi.php');
require_once('/var/www/mysite/includes/fpdf.php');
I have used fpdf many times and never had a problem with it. I've
double checked my pathnames until I'm blue in the face. But for some
reason, the script just STOPS at these lines. I've tried include,
include_once, require, require_once and no error gets reported, it
just stops. Help?
--
Try placing at the top of the include:
echo('fdi');
If you see it, then it's working up to there.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
On 7 June 2011 04:05, tedd <tedd.sperl...@gmail.com> wrote:
> At 5:50 PM -0700 6/6/11, Brian Dunning wrote:
>>
>> Here's my code:
>>
>> error_reporting(E_ALL);
Not all errors are reported using E_ALL.
Try error_reporting(-1);
Also, check the include files don't then set error_reporting(0) or
something like that.
--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
--- End Message ---
--- Begin Message ---
I have three drop down menus in my form. How do I make it so the
second and third menus are only visible once the prior menu was
selected?
Below is the first two drop down menus.
Thanks in advance.
// Generating first menu using array.
$markets = array('MCI' => 'Kansas City',
'STL' => 'ST. Louis',
'ICT' => 'Wichita',
'OMA' => 'Omaha',
'LIN' => 'Lincoln');
echo "<select name='term'><option value=''>Choose Market</option>\n";
foreach ($markets as $key => $market) {
echo "<option value='$key'>$market</option>\n";
}
echo "</select>";
// This will evaluate to TRUE so the text will be printed.
if (isset($markets)) {
echo "This var is set so I will print.";
}
// Then, later, validating the menu
if (! array_key_exists($_POST['Market'], $choices)) {
echo "You must select a market.";
}
$query="SELECT cell_sect FROM sector_list order by cell_sect";
$result = mysql_query ($query);
echo "<select name='cat'><option value=''>Choose Cell Sector</option>";
// printing the list box select command
while($cellSect=mysql_fetch_array($result)){//Array or records stored
in $cellSect
echo "<option value=$cellSect[cell_sect]>$cellSect[cell_sect]</option>";
/* Option values are added by looping through the array */
}
echo "</select>";// Closing of list box
// This will evaluate to TRUE so the text will be printed.
if (isset($cellSect)) {
echo "This var is set so I will print.";
}
--- End Message ---
--- Begin Message ---
Sounds like a good job for client side JavaScript.
Regards,
-Josh
____________________________________
Joshua Kehn | josh.k...@gmail.com
http://joshuakehn.com
On Jun 7, 2011, at 12:40 AM, Chris Stinemetz wrote:
> I have three drop down menus in my form. How do I make it so the
> second and third menus are only visible once the prior menu was
> selected?
>
> Below is the first two drop down menus.
>
> Thanks in advance.
>
> // Generating first menu using array.
> $markets = array('MCI' => 'Kansas City',
> 'STL' => 'ST. Louis',
> 'ICT' => 'Wichita',
> 'OMA' => 'Omaha',
> 'LIN' => 'Lincoln');
> echo "<select name='term'><option value=''>Choose Market</option>\n";
> foreach ($markets as $key => $market) {
> echo "<option value='$key'>$market</option>\n";
> }
> echo "</select>";
>
> // This will evaluate to TRUE so the text will be printed.
> if (isset($markets)) {
> echo "This var is set so I will print.";
> }
>
>
>
> // Then, later, validating the menu
> if (! array_key_exists($_POST['Market'], $choices)) {
> echo "You must select a market.";
> }
>
> $query="SELECT cell_sect FROM sector_list order by cell_sect";
>
> $result = mysql_query ($query);
> echo "<select name='cat'><option value=''>Choose Cell Sector</option>";
> // printing the list box select command
>
> while($cellSect=mysql_fetch_array($result)){//Array or records stored
> in $cellSect
> echo "<option value=$cellSect[cell_sect]>$cellSect[cell_sect]</option>";
> /* Option values are added by looping through the array */
> }
> echo "</select>";// Closing of list box
>
> // This will evaluate to TRUE so the text will be printed.
> if (isset($cellSect)) {
> echo "This var is set so I will print.";
> }
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Dynamically changing displays can be done with JavaScript.
First thing I want you to think of is whether or not your 2nd and 3rd menus
require information from the first menu to display or sort.
According to what I see they do not.
If they do not :
We start off wrapping each of the second and 3rd menus in a DIV element and
turning them off to display. I am using 2 options pick which one is best for
you.
We can display them individually by "ID" or by the group of "class". Now we
give an ID attribute to the first menu.
echo "<select ID='market' name='term'><option value=''>Choose
Market</option>\n";
<DIV ID=Menu2 class=other_menus style="display: none;"> Put your 2nd menu
in here </DIV>
<DIV ID=Menu3 class=other_menus style="display: none;"> Put your 3nd menu
in here </DIV>
In this example I will utilize JQuery.js IF you do not have it you can
download it from www.jquery.com .
Please do not use both function if you use a class use the class if you use
and ID base use the ID
<script type="text/javascript" src="jquery.js"></script>
<script>
$(document).ready(function(){
// this will display them by ID
$('#market').change(
Function() {
Val marketvalue = $(This).val(); // I am doing this because
what if they change the menu back to the default value of ''
If(marketvalue >= 1)
{
$('#Menu2').show();
$('#Menu3').show();
}else{
$('#Menu2').hide();
$('#Menu3').hide();
}
}
);
// this will display them by the class
$('#market').change(
Function() {
Val marketvalue = $(This).val(); // I am doing this because
what if they change the menu back to the default value of ''
If(marketvalue >= 1)
{
$('.other_menus').show();
}else{
$('.other_menus').hide();
}
}
);
});
</script>
This will display the menu items as soon as they pick from the first menu
NOT requiring a submit.
If you do require the value from the first menu to be passed to the select
statements for the other menus let me know I will explain how that is done,
it is a little more complex.
Richard L. Buskirk
-----Original Message-----
From: Chris Stinemetz [mailto:chrisstinem...@gmail.com]
Sent: Tuesday, June 07, 2011 12:41 AM
To: php-gene...@lists.php.net
Subject: [PHP] php hide menu
I have three drop down menus in my form. How do I make it so the
second and third menus are only visible once the prior menu was
selected?
Below is the first two drop down menus.
Thanks in advance.
// Generating first menu using array.
$markets = array('MCI' => 'Kansas City',
'STL' => 'ST. Louis',
'ICT' => 'Wichita',
'OMA' => 'Omaha',
'LIN' => 'Lincoln');
echo "<select name='term'><option value=''>Choose Market</option>\n";
foreach ($markets as $key => $market) {
echo "<option value='$key'>$market</option>\n";
}
echo "</select>";
// This will evaluate to TRUE so the text will be printed.
if (isset($markets)) {
echo "This var is set so I will print.";
}
// Then, later, validating the menu
if (! array_key_exists($_POST['Market'], $choices)) {
echo "You must select a market.";
}
$query="SELECT cell_sect FROM sector_list order by cell_sect";
$result = mysql_query ($query);
echo "<select name='cat'><option value=''>Choose Cell Sector</option>";
// printing the list box select command
while($cellSect=mysql_fetch_array($result)){//Array or records stored
in $cellSect
echo "<option value=$cellSect[cell_sect]>$cellSect[cell_sect]</option>";
/* Option values are added by looping through the array */
}
echo "</select>";// Closing of list box
// This will evaluate to TRUE so the text will be printed.
if (isset($cellSect)) {
echo "This var is set so I will print.";
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
> If you do require the value from the first menu to be passed to the select
> statements for the other menus let me know I will explain how that is done,
> it is a little more complex.
>
I would like to pass the value from the prior menu to the next. Would
you please show me how to handle this?
Thank you,
Chris
--- End Message ---
--- Begin Message ---
[snip]
I would like to pass the value from the prior menu to the next. Would
you please show me how to handle this?
[/snip]
As several have mentioned, this is a job for AJAX and JavaScript. Here
is a good tutorial:
http://www.yourinspirationweb.com/en/how-to-create-chained-select-with-p
hp-and-jquery/
--- End Message ---
--- Begin Message ---
On 06/06/11 21:07, Richard Quadling wrote:
On 6 June 2011 13:55, Pete Ford<p...@justcroft.com> wrote:
Is there something on the Apache/PHP end that might be causing this
blocking? (Apache 2.2.10, PHP 5.2.14)
The browser and / or OS may be obeying the settings about the number
of simultaneous connections per host.
http://support.microsoft.com/kb/183110 /
http://www.ietf.org/rfc/rfc2616.txt 8.1.4 Practical Considerations ...
" Clients that use persistent connections SHOULD limit the number of
simultaneous connections that they maintain to a given server. A
single-user client SHOULD NOT maintain more than 2 connections with
any server or proxy. A proxy SHOULD use up to 2*N connections to
another server or proxy, where N is the number of simultaneously
active users. These guidelines are intended to improve HTTP response
times and avoid congestion."
Also, (from googling)
http://forums.serverbeach.com/showthread.php?6192-Max-Concurrent-Connections-Per-Host,
mod_throttle and/or mod_bandwidth may be capable of restricting the
number and/or speed of connections.
Thanks Richard,
There's no mod_throttle or mod_bandwidth, but I SHOULD have remembered RFC2616.
I'll look into working with that, although I'm having trouble reproducing the
problem since my dev machine sits on the same network as the server and the
files come down too quickly!
Maybe I can use a redirect or something to force a new connection...
--
Peter Ford, Developer phone: 01580 893333 fax: 01580 893399
Justcroft International Ltd. www.justcroft.com
Justcroft House, High Street, Staplehurst, Kent TN12 0AH United Kingdom
Registered in England and Wales: 2297906
Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 1XS
--- End Message ---
--- Begin Message ---
On 7 June 2011 09:24, Pete Ford <p...@justcroft.com> wrote:
> On 06/06/11 21:07, Richard Quadling wrote:
>>
>> On 6 June 2011 13:55, Pete Ford<p...@justcroft.com> wrote:
>>>
>>> Is there something on the Apache/PHP end that might be causing this
>>> blocking? (Apache 2.2.10, PHP 5.2.14)
>>
>> The browser and / or OS may be obeying the settings about the number
>> of simultaneous connections per host.
>> http://support.microsoft.com/kb/183110 /
>> http://www.ietf.org/rfc/rfc2616.txt 8.1.4 Practical Considerations ...
>>
>> " Clients that use persistent connections SHOULD limit the number of
>> simultaneous connections that they maintain to a given server. A
>> single-user client SHOULD NOT maintain more than 2 connections with
>> any server or proxy. A proxy SHOULD use up to 2*N connections to
>> another server or proxy, where N is the number of simultaneously
>> active users. These guidelines are intended to improve HTTP response
>> times and avoid congestion."
>>
>> Also, (from googling)
>>
>> http://forums.serverbeach.com/showthread.php?6192-Max-Concurrent-Connections-Per-Host,
>> mod_throttle and/or mod_bandwidth may be capable of restricting the
>> number and/or speed of connections.
>>
>
> Thanks Richard,
>
> There's no mod_throttle or mod_bandwidth, but I SHOULD have remembered
> RFC2616. I'll look into working with that, although I'm having trouble
> reproducing the problem since my dev machine sits on the same network as the
> server and the files come down too quickly!
> Maybe I can use a redirect or something to force a new connection...
>
One option may be to use a sub-domain for the downloads, that way,
you could allow the main site to run as fast as needed and have
downloads on a different setup and not subject to the same limit.
--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
--- End Message ---
--- Begin Message ---
Hi.
What do you get for ...
php -r "var_dump(realpath(null));"
I'm wondering if the result should be a boolean false.
But I'm getting very different results for different versions of PHP
for Windows.
For PHP5+ (upto lastest 5.3.7-dev), the output is always the same as getcwd()
For PHP4, some very interesting differences ...
V4.0.0 : string(5) "Z:\\/"
V4.0.1 : string(5) "z:\\/"
V4.0.1pl1 : string(5) "z:\\/"
V4.0.2 : bool(false)
V4.0.3 : bool(false)
V4.0.4 : string(3) "z:\"
V4.0.4pl1 : string(3) "z:\"
V4.0.5 : string(3) "z:\"
V4.0.6 : string(3) "z:\"
V4.1.0 : string(3) "z:\"
V4.1.1 : string(3) "z:\"
V4.1.2 : string(3) "z:\"
V4.2.0 : string(98) "D:\Personal
Files\Downloads\Software\Programming\PHP\Official
Releases\PHP4.x.x\PHP4.2.x\php-4.2.0"
V4.2.1 : string(3) "z:\"
V4.2.2 : string(3) "z:\"
V4.2.3 : string(3) "z:\"
V4.2.3RC1 : string(3) "z:\"
V4.2.3RC2 : string(3) "z:\"
V4.3.0 : string(3) "z:\"
V4.3.0pre2 : string(102) "D:\Personal
Files\Downloads\Software\Programming\PHP\Official
Releases\PHP4.x.x\PHP4.3.x\php-4.3.0pre2"
V4.3.0RC1 : string(101) "D:\Personal
Files\Downloads\Software\Programming\PHP\Official
Releases\PHP4.x.x\PHP4.3.x\php-4.3.0RC1"
V4.3.0RC2 : string(101) "D:\Personal
Files\Downloads\Software\Programming\PHP\Official
Releases\PHP4.x.x\PHP4.3.x\php-4.3.0RC2"
V4.3.0RC3 : string(101) "D:\Personal
Files\Downloads\Software\Programming\PHP\Official
Releases\PHP4.x.x\PHP4.3.x\php-4.3.0RC3"
V4.3.0RC4 : string(3) "z:\"
V4.3.1 : string(3) "z:\"
V4.3.10 : string(3) "z:\"
V4.3.11 : string(3) "z:\"
V4.3.2 : string(3) "z:\"
V4.3.2RC1 : string(3) "z:\"
V4.3.2RC2 : string(3) "z:\"
V4.3.2RC3 : string(3) "z:\"
V4.3.3 : string(3) "z:\"
V4.3.3RC1 : string(3) "z:\"
V4.3.3RC2 : string(3) "z:\"
V4.3.3RC3 : string(3) "z:\"
V4.3.3RC4 : string(3) "z:\"
V4.3.4 : string(3) "z:\"
V4.3.4RC1 : string(3) "z:\"
V4.3.4RC2 : string(3) "z:\"
V4.3.4RC3 : string(3) "z:\"
V4.3.5 : string(3) "z:\"
V4.3.5RC1 : string(3) "z:\"
V4.3.5RC2 : string(3) "z:\"
V4.3.5RC3 : string(3) "z:\"
V4.3.5RC4 : string(3) "z:\"
V4.3.6 : string(3) "z:\"
V4.3.6RC1 : string(3) "z:\"
V4.3.6RC2 : string(3) "z:\"
V4.3.6RC3 : string(3) "z:\"
V4.3.7 : string(3) "z:\"
V4.3.7RC1 : string(3) "z:\"
V4.3.8 : string(3) "z:\"
V4.3.9 : string(3) "z:\"
V4.3.9RC1 : string(3) "z:\"
V4.4.0 : string(3) "z:\"
V4.4.1 : string(3) "z:\"
V4.4.2 : string(3) "z:\"
V4.4.3 : string(3) "z:\"
V4.4.4 : string(3) "z:\"
V4.4.5 : string(3) "z:\"
V4.4.6 : string(3) "z:\"
V4.4.7 : string(3) "z:\"
V4.4.8 : string(3) "z:\"
V4.4.9 : string(3) "z:\"
Z:\ is essentially the equivalent of __DIR__ in this example.
What output do you get on non Windows setups?
php -r "var_dump(realpath(null));"
If the current releases on other OS's all have output equivalent to
getcwd(), then I'll change the documentation to at least mention that
a null or empty path equates to the current working directory for V5+.
Richard.
--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
--- End Message ---
--- Begin Message ---
>-----Original Message-----
>From: Richard Quadling [mailto:rquadl...@gmail.com]
>Sent: 07 June 2011 11:35
>To: PHP General list
>Subject: [PHP] What do you get for ...
>
>Hi.
>
>What do you get for ...
>
>php -r "var_dump(realpath(null));"
>
>I'm wondering if the result should be a boolean false.
>
>But I'm getting very different results for different versions of PHP
>for Windows.
>
>For PHP5+ (upto lastest 5.3.7-dev), the output is always the same as getcwd()
>
[snip]
I get the following in Win7 Pro x64 SP1 running PHP 5.3.6:
--- BEGIN OUTPUT ---
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
D:\>php -r "var_dump(realpath(null));"
string(3) "D:\"
D:\>
-- END OUTPUT ---
HTH
J
--- End Message ---
--- Begin Message ---
Microsoft Windows Version 5.1.2600
E:\>php -r "var_dump(realpath(null));"
string(41) "E:\"
E:\>
Richard L. Buskirk
-----Original Message-----
From: Richard Quadling [mailto:rquadl...@gmail.com]
Sent: Tuesday, June 07, 2011 6:35 AM
To: PHP General list
Subject: [PHP] What do you get for ...
Hi.
What do you get for ...
php -r "var_dump(realpath(null));"
I'm wondering if the result should be a boolean false.
But I'm getting very different results for different versions of PHP
for Windows.
For PHP5+ (upto lastest 5.3.7-dev), the output is always the same as getcwd()
For PHP4, some very interesting differences ...
V4.0.0 : string(5) "Z:\\/"
V4.0.1 : string(5) "z:\\/"
V4.0.1pl1 : string(5) "z:\\/"
V4.0.2 : bool(false)
V4.0.3 : bool(false)
V4.0.4 : string(3) "z:\"
V4.0.4pl1 : string(3) "z:\"
V4.0.5 : string(3) "z:\"
V4.0.6 : string(3) "z:\"
V4.1.0 : string(3) "z:\"
V4.1.1 : string(3) "z:\"
V4.1.2 : string(3) "z:\"
V4.2.0 : string(98) "D:\Personal
Files\Downloads\Software\Programming\PHP\Official
Releases\PHP4.x.x\PHP4.2.x\php-4.2.0"
V4.2.1 : string(3) "z:\"
V4.2.2 : string(3) "z:\"
V4.2.3 : string(3) "z:\"
V4.2.3RC1 : string(3) "z:\"
V4.2.3RC2 : string(3) "z:\"
V4.3.0 : string(3) "z:\"
V4.3.0pre2 : string(102) "D:\Personal
Files\Downloads\Software\Programming\PHP\Official
Releases\PHP4.x.x\PHP4.3.x\php-4.3.0pre2"
V4.3.0RC1 : string(101) "D:\Personal
Files\Downloads\Software\Programming\PHP\Official
Releases\PHP4.x.x\PHP4.3.x\php-4.3.0RC1"
V4.3.0RC2 : string(101) "D:\Personal
Files\Downloads\Software\Programming\PHP\Official
Releases\PHP4.x.x\PHP4.3.x\php-4.3.0RC2"
V4.3.0RC3 : string(101) "D:\Personal
Files\Downloads\Software\Programming\PHP\Official
Releases\PHP4.x.x\PHP4.3.x\php-4.3.0RC3"
V4.3.0RC4 : string(3) "z:\"
V4.3.1 : string(3) "z:\"
V4.3.10 : string(3) "z:\"
V4.3.11 : string(3) "z:\"
V4.3.2 : string(3) "z:\"
V4.3.2RC1 : string(3) "z:\"
V4.3.2RC2 : string(3) "z:\"
V4.3.2RC3 : string(3) "z:\"
V4.3.3 : string(3) "z:\"
V4.3.3RC1 : string(3) "z:\"
V4.3.3RC2 : string(3) "z:\"
V4.3.3RC3 : string(3) "z:\"
V4.3.3RC4 : string(3) "z:\"
V4.3.4 : string(3) "z:\"
V4.3.4RC1 : string(3) "z:\"
V4.3.4RC2 : string(3) "z:\"
V4.3.4RC3 : string(3) "z:\"
V4.3.5 : string(3) "z:\"
V4.3.5RC1 : string(3) "z:\"
V4.3.5RC2 : string(3) "z:\"
V4.3.5RC3 : string(3) "z:\"
V4.3.5RC4 : string(3) "z:\"
V4.3.6 : string(3) "z:\"
V4.3.6RC1 : string(3) "z:\"
V4.3.6RC2 : string(3) "z:\"
V4.3.6RC3 : string(3) "z:\"
V4.3.7 : string(3) "z:\"
V4.3.7RC1 : string(3) "z:\"
V4.3.8 : string(3) "z:\"
V4.3.9 : string(3) "z:\"
V4.3.9RC1 : string(3) "z:\"
V4.4.0 : string(3) "z:\"
V4.4.1 : string(3) "z:\"
V4.4.2 : string(3) "z:\"
V4.4.3 : string(3) "z:\"
V4.4.4 : string(3) "z:\"
V4.4.5 : string(3) "z:\"
V4.4.6 : string(3) "z:\"
V4.4.7 : string(3) "z:\"
V4.4.8 : string(3) "z:\"
V4.4.9 : string(3) "z:\"
Z:\ is essentially the equivalent of __DIR__ in this example.
What output do you get on non Windows setups?
php -r "var_dump(realpath(null));"
If the current releases on other OS's all have output equivalent to
getcwd(), then I'll change the documentation to at least mention that
a null or empty path equates to the current working directory for V5+.
Richard.
--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> What output do you get on non Windows setups?
Hmmm. I really should have asked what the non windows users get.
Oh. Look. I did.
;-)
--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
--- End Message ---
--- Begin Message ---
On Tue, Jun 7, 2011 at 12:10 PM, Richard Quadling <rquadl...@gmail.com>wrote:
> > -----Original Message-----
> > What output do you get on non Windows setups?
>
OSX 10.6.7
PHP 5.3.4
OSX Server 10.6
PHP 5.3.0
Linux 2.6.35.4-rscloud (Rackspace cloud)
PHP 5.3.6
Linux 2.6.18 (CentOS)
PHP 5.2.10
Linux 2.6.18 (CentOS)
PHP 5.2.13
All return __DIR__.
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--- End Message ---
--- Begin Message ---
On 7 June 2011 12:25, Stuart Dallas <stu...@3ft9.com> wrote:
> On Tue, Jun 7, 2011 at 12:10 PM, Richard Quadling <rquadl...@gmail.com>
> wrote:
>>
>> > -----Original Message-----
>> > What output do you get on non Windows setups?
>
> OSX 10.6.7
> PHP 5.3.4
> OSX Server 10.6
> PHP 5.3.0
> Linux 2.6.35.4-rscloud (Rackspace cloud)
> PHP 5.3.6
> Linux 2.6.18 (CentOS)
> PHP 5.2.10
> Linux 2.6.18 (CentOS)
> PHP 5.2.13
> All return __DIR__.
> -Stuart
> --
> Stuart Dallas
> 3ft9 Ltd
> http://3ft9.com/
Thank you. I'll update the documentation appropriately.
--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
--- End Message ---
--- Begin Message ---
On Tuesday, June 7, 2011, Richard Quadling wrote:
> What do you get for ...
> php -r "var_dump(realpath(null));"
PHP 5.3.5-1ubuntu7.2 on Ubuntu 11.04 kernel 2.6.18 returns the same
value as __DIR__
However, PHP 5.1.6 on CentOS 5.6 kernel 2.6.18 returns bool(false).
Doing php -r "var_dump(__DIR__);" on this machine shows that __DIR__
is undefined. Executing both commands in an intranet-visible, php
script shows the same thing.
HTH,
--
Geoff
--- End Message ---
--- Begin Message ---
On 7 June 2011 13:04, Geoff Lane <ge...@gjctech.co.uk> wrote:
> On Tuesday, June 7, 2011, Richard Quadling wrote:
>
>> What do you get for ...
>
>> php -r "var_dump(realpath(null));"
>
> PHP 5.3.5-1ubuntu7.2 on Ubuntu 11.04 kernel 2.6.18 returns the same
> value as __DIR__
>
> However, PHP 5.1.6 on CentOS 5.6 kernel 2.6.18 returns bool(false).
__DIR__ was introduced in PHP5.3.0.
When I mentioned it, I meant the value would be the directory of the
script path.
dirname(__FILE__) or __DIR__. Same difference.
But the surprising issue is that your 5.1.6 returns bool(false). So
far, that's the only report I've got that shows inconsistent behaviour
for PHP5+
--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
--- End Message ---
--- Begin Message ---
On Tuesday 07 June 2011 13:35:06 Richard Quadling wrote:
> Hi.
>
> What do you get for ...
>
> php -r "var_dump(realpath(null));"
>
1.
PHP 5.3.6 @ Gentoo Linux(x86_64)
tmp $ php -r "print getcwd();"
/var/tmp
tmp $ php -r "var_dump(realpath(null));"
string(8) "/var/tmp"
2.
PHP 5.2.14 @ Linux(ARM)
tmp $ php -r "print getcwd();"
/var/tmp
tmp $ php -r "var_dump(realpath(null));"
string(8) "/var/tmp"
--
Vitalii
--- End Message ---
--- Begin Message ---
On Tue, 2011-06-07 at 16:09 +0300, Vitalii Demianets wrote:
> On Tuesday 07 June 2011 13:35:06 Richard Quadling wrote:
> > Hi.
> >
> > What do you get for ...
> >
> > php -r "var_dump(realpath(null));"
> >
>
> 1.
> PHP 5.3.6 @ Gentoo Linux(x86_64)
>
> tmp $ php -r "print getcwd();"
> /var/tmp
>
> tmp $ php -r "var_dump(realpath(null));"
> string(8) "/var/tmp"
>
> 2.
> PHP 5.2.14 @ Linux(ARM)
>
> tmp $ php -r "print getcwd();"
> /var/tmp
>
> tmp $ php -r "var_dump(realpath(null));"
> string(8) "/var/tmp"
>
> --
> Vitalii
>
sstaples@webdev01:~$ php -v
PHP 5.2.10-2ubuntu6.4 with Suhosin-Patch 0.9.7 (cli) (built: Jan 6 2010
22:41:56)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
sstaples@webdev01:~$
sstaples@webdev01:~$ pwd
/home/sstaples
sstaples@webdev01:~$ php -r "var_dump(realpath(null));"
string(14) "/home/sstaples"
sstaples@webdev01:~$
I am running Ubuntu 9.10
Steve.
--- End Message ---