php-general Digest 20 Jun 2013 09:26:46 -0000 Issue 8270

2013-06-20 Thread php-general-digest-help

php-general Digest 20 Jun 2013 09:26:46 - Issue 8270

Topics (messages 321423 through 321424):

Re: Hoping nobody notices it isn't Friday.
321423 by: Daniel Brown

json stream filter
321424 by: Markus Staab

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


--
---BeginMessage---
On Tue, Jun 18, 2013 at 1:36 PM, Richard Quadling rquadl...@gmail.com wrote:
 Hi.

 We've all been told that 'free software' is to be thought of as 'free
 speech', not 'free beer'.

 Well, I hope to muddy the waters with this link.

 https://www.facebook.com/TheFreeBeerApp

I'd say that I'd make an exception, but since it appears to only
be available for you Redcoats, I'll remind you that today is Tuesday,
and admonish you for making the week feel that much longer for all of
us.
---End Message---
---BeginMessage---
Hi!

first post on the list, so please bare with me ;-)

we are handling a lot of cache files in our apps and use json to persist
those contents on the filesystem, because it seems to be the fastest
possible way to read/write files with PHP.

Since I discovered stream-filters, http://www.php.net/manual/en/filters.php,
we use those also for base64 encoding files before sending them over the
wire, which preserves a lot of memory and allows even bigger files.

Would it make sense to also have a native stream filter for fileformats
like JSON, to get maximum performance for reading/writing those (and also
to be able to write big files)?

Thanks,
Markus
---End Message---


php-general Digest 20 Jun 2013 23:12:43 -0000 Issue 8271

2013-06-20 Thread php-general-digest-help

php-general Digest 20 Jun 2013 23:12:43 - Issue 8271

Topics (messages 321425 through 321439):

A Strange Problem
321425 by: Tedd Sperling
321426 by: Matijn Woudt
321427 by: Bastien
321428 by: Tedd Sperling
321429 by: Tedd Sperling
321430 by: Marc Guay
321432 by: Tedd Sperling
321434 by: Bastien
321435 by: Bastien
321436 by: Daniel Brown
321437 by: Tedd Sperling
321439 by: Stuart Dallas

PHP 5.3.18RC1 and 5.4.8RC1 Released for Testing!
321431 by: Johannes Schlüter

[PHP-DEV] PHP 5.3.27RC1 and 5.4.17RC1 Released for Testing!
321433 by: Johannes Schlüter

PHP 5.5.0 final has been released!
321438 by: Julien Pauli

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


--
---BeginMessage---
Hi gang:

I have a very strange problem.

I can use this statement in one folder:

$fcontents = file('docs/admin-email.txt');

But in a different folder with an exact path having 'docs/admin-email.txt', I 
get:

Warning: file(/docs/admin-email.txt) [function.file]: failed to open stream: No 
such file or directory in cut on line 83

This has got me really puzzled.

I have confirmed these are the exact same folders and files, except only in two 
different places on the server. Both are one level down from root.

Any ideas as to what is going on?

Cheers,

tedd


_
t...@sperling.com
http://sperling.com

---End Message---
---BeginMessage---
On Thu, Jun 20, 2013 at 7:39 PM, Tedd Sperling t...@sperling.com wrote:

 Hi gang:

 I have a very strange problem.

 I can use this statement in one folder:

 $fcontents = file('docs/admin-email.txt');

 But in a different folder with an exact path having
 'docs/admin-email.txt', I get:

 Warning: file(/docs/admin-email.txt) [function.file]: failed to open
 stream: No such file or directory in cut on line 83


Are you sure it is the same string? It looks like this one has an extra '/'
at the beginning?


 This has got me really puzzled.

 I have confirmed these are the exact same folders and files, except only
 in two different places on the server. Both are one level down from root.

 Any ideas as to what is going on?

 Cheers,

 tedd



Else it could be permission item, I think the user executing the PHP script
(www-user or such for apache), needs to have execute rights on all
directories up to the file, to be able to read the file listing.

- Matijn
---End Message---
---BeginMessage---

On 2013-06-20, at 1:39 PM, Tedd Sperling t...@sperling.com wrote:

 Hi gang:
 
 I have a very strange problem.
 
 I can use this statement in one folder:
 
$fcontents = file('docs/admin-email.txt');
 
 But in a different folder with an exact path having 'docs/admin-email.txt', I 
 get:
 
 Warning: file(/docs/admin-email.txt) [function.file]: failed to open stream: 
 No such file or directory in cut on line 83
 
 This has got me really puzzled.
 
 I have confirmed these are the exact same folders and files, except only in 
 two different places on the server. Both are one level down from root.
 
 Any ideas as to what is going on?
 
 Cheers,
 
 tedd

It sounds like a current working directory issue. Try running a getcwd() in 
both places to see how they are set

Bastien---End Message---
---BeginMessage---
Matijin:

My mistake in posting -- I have tried it several different ways including 
absolute.

Nothing works.

Cheers,

tedd

---
On Jun 20, 2013, at 1:43 PM, Matijn Woudt tijn...@gmail.com wrote:

 
 
 
 On Thu, Jun 20, 2013 at 7:39 PM, Tedd Sperling t...@sperling.com wrote:
 Hi gang:
 
 I have a very strange problem.
 
 I can use this statement in one folder:
 
 $fcontents = file('docs/admin-email.txt');
 
 But in a different folder with an exact path having 'docs/admin-email.txt', I 
 get:
 
 Warning: file(/docs/admin-email.txt) [function.file]: failed to open stream: 
 No such file or directory in cut on line 83
 
 
 Are you sure it is the same string? It looks like this one has an extra '/' 
 at the beginning?
  
 This has got me really puzzled.
 
 I have confirmed these are the exact same folders and files, except only in 
 two different places on the server. Both are one level down from root.
 
 Any ideas as to what is going on?
 
 Cheers,
 
 tedd
 
 
 
 Else it could be permission item, I think the user executing the PHP script 
 (www-user or such for apache), needs to have execute rights on all 
 directories up to the file, to be able to read the file listing.
 
 - Matijn 
 

---End Message---
---BeginMessage---
On Jun 20, 2013, at 1:44 PM, Bastien phps...@gmail.com wrote:
 
 It sounds like a current working directory issue. Try running a getcwd() in 
 

[PHP] json stream filter

2013-06-20 Thread Markus Staab
Hi!

first post on the list, so please bare with me ;-)

we are handling a lot of cache files in our apps and use json to persist
those contents on the filesystem, because it seems to be the fastest
possible way to read/write files with PHP.

Since I discovered stream-filters, http://www.php.net/manual/en/filters.php,
we use those also for base64 encoding files before sending them over the
wire, which preserves a lot of memory and allows even bigger files.

Would it make sense to also have a native stream filter for fileformats
like JSON, to get maximum performance for reading/writing those (and also
to be able to write big files)?

Thanks,
Markus


[PHP] A Strange Problem

2013-06-20 Thread Tedd Sperling
Hi gang:

I have a very strange problem.

I can use this statement in one folder:

$fcontents = file('docs/admin-email.txt');

But in a different folder with an exact path having 'docs/admin-email.txt', I 
get:

Warning: file(/docs/admin-email.txt) [function.file]: failed to open stream: No 
such file or directory in cut on line 83

This has got me really puzzled.

I have confirmed these are the exact same folders and files, except only in two 
different places on the server. Both are one level down from root.

Any ideas as to what is going on?

Cheers,

tedd


_
t...@sperling.com
http://sperling.com


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



Re: [PHP] A Strange Problem

2013-06-20 Thread Matijn Woudt
On Thu, Jun 20, 2013 at 7:39 PM, Tedd Sperling t...@sperling.com wrote:

 Hi gang:

 I have a very strange problem.

 I can use this statement in one folder:

 $fcontents = file('docs/admin-email.txt');

 But in a different folder with an exact path having
 'docs/admin-email.txt', I get:

 Warning: file(/docs/admin-email.txt) [function.file]: failed to open
 stream: No such file or directory in cut on line 83


Are you sure it is the same string? It looks like this one has an extra '/'
at the beginning?


 This has got me really puzzled.

 I have confirmed these are the exact same folders and files, except only
 in two different places on the server. Both are one level down from root.

 Any ideas as to what is going on?

 Cheers,

 tedd



Else it could be permission item, I think the user executing the PHP script
(www-user or such for apache), needs to have execute rights on all
directories up to the file, to be able to read the file listing.

- Matijn


Re: [PHP] A Strange Problem

2013-06-20 Thread Bastien

On 2013-06-20, at 1:39 PM, Tedd Sperling t...@sperling.com wrote:

 Hi gang:
 
 I have a very strange problem.
 
 I can use this statement in one folder:
 
$fcontents = file('docs/admin-email.txt');
 
 But in a different folder with an exact path having 'docs/admin-email.txt', I 
 get:
 
 Warning: file(/docs/admin-email.txt) [function.file]: failed to open stream: 
 No such file or directory in cut on line 83
 
 This has got me really puzzled.
 
 I have confirmed these are the exact same folders and files, except only in 
 two different places on the server. Both are one level down from root.
 
 Any ideas as to what is going on?
 
 Cheers,
 
 tedd

It sounds like a current working directory issue. Try running a getcwd() in 
both places to see how they are set

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



Re: [PHP] A Strange Problem

2013-06-20 Thread Tedd Sperling
Matijin:

My mistake in posting -- I have tried it several different ways including 
absolute.

Nothing works.

Cheers,

tedd

---
On Jun 20, 2013, at 1:43 PM, Matijn Woudt tijn...@gmail.com wrote:

 
 
 
 On Thu, Jun 20, 2013 at 7:39 PM, Tedd Sperling t...@sperling.com wrote:
 Hi gang:
 
 I have a very strange problem.
 
 I can use this statement in one folder:
 
 $fcontents = file('docs/admin-email.txt');
 
 But in a different folder with an exact path having 'docs/admin-email.txt', I 
 get:
 
 Warning: file(/docs/admin-email.txt) [function.file]: failed to open stream: 
 No such file or directory in cut on line 83
 
 
 Are you sure it is the same string? It looks like this one has an extra '/' 
 at the beginning?
  
 This has got me really puzzled.
 
 I have confirmed these are the exact same folders and files, except only in 
 two different places on the server. Both are one level down from root.
 
 Any ideas as to what is going on?
 
 Cheers,
 
 tedd
 
 
 
 Else it could be permission item, I think the user executing the PHP script 
 (www-user or such for apache), needs to have execute rights on all 
 directories up to the file, to be able to read the file listing.
 
 - Matijn 
 


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



Re: [PHP] A Strange Problem

2013-06-20 Thread Tedd Sperling
On Jun 20, 2013, at 1:44 PM, Bastien phps...@gmail.com wrote:
 
 It sounds like a current working directory issue. Try running a getcwd() in 
 both places to see how they are set
 
 Bastien

I think you have something, here's the reports:

Works:

/home/content/64/cut/html/sdi/tedd/php-mail

Does NOT work:

/home/content/64/cut/html/sdi

The one that does not work should be:

   /home/content/64/cut/html/sdi/includes/

How do I fix it?

Cheers,

tedd

PS: All cut's were identical.


_
t...@sperling.com
http://sperling.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP 5.3.18RC1 and 5.4.8RC1 Released for Testing!

2013-06-20 Thread Johannes Schlüter
Hi!

We've released PHP 5.3.27RC1 and 5.4.17RC1 which can be found here:

   5.3.27RC1:
   http://downloads.php.net/johannes/php-5.3.27RC1.tar.bz2
   http://downloads.php.net/johannes/php-5.3.27RC1.tar.gz

   5.4.17RC1:
   http://downloads.php.net/stas/php-5.4.17RC1.tar.bz2
   http://downloads.php.net/stas/php-5.4.17RC1.tar.gz

Windows binaries for both as always are at:
http://windows.php.net/qa/

These are release candidates for regular bugfix releases, the full list
of issues fixed can be found in the NEWS files. Please test and report
if anything is broken.

Mind that PHP 5.3.27 is supposed to be the last regular PHP 5.3 release
before entering in extended support providing security fixes only.
Please double check there is nothing broken in it.

If no critical issues are found in these RCs, the final versions will be
released in two weeks.

Regards,
Stas Malyshev  Johannes Schlüter
PHP 5.4 Release Master PHP 5.3 Release Master



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



Re: [PHP] A Strange Problem

2013-06-20 Thread Tedd Sperling
Bastien:

You were right on - by changing the directory to what I needed, everything 
works.

My follow-up question is Why?

I have *never* had to specifically tell any script to chdir() -- why with that 
one?

Cheers and Thanks!

tedd


_
tedd.sperl...@gmail.com
http://sperling.com


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



[PHP] [PHP-DEV] PHP 5.3.27RC1 and 5.4.17RC1 Released for Testing!

2013-06-20 Thread Johannes Schlüter
Hi!

We've released PHP 5.3.27RC1 and 5.4.17RC1 which can be found here:

   5.3.27RC1:
   http://downloads.php.net/johannes/php-5.3.27RC1.tar.bz2
   http://downloads.php.net/johannes/php-5.3.27RC1.tar.gz

   5.4.17RC1:
   http://downloads.php.net/stas/php-5.4.17RC1.tar.bz2
   http://downloads.php.net/stas/php-5.4.17RC1.tar.gz

Windows binaries for both as always are at:
http://windows.php.net/qa/

These are release candidates for regular bugfix releases, the full list
of issues fixed can be found in the NEWS files. Please test and report
if anything is broken.

Mind that PHP 5.3.27 is supposed to be the last regular PHP 5.3 release
before entering in extended support providing security fixes only.
Please double check there is nothing broken in it.

If no critical issues are found in these RCs, the final versions will be
released in two weeks.

Regards,
Stas Malyshev  Johannes Schlüter
PHP 5.4 Release Master PHP 5.3 Release Master



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php




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



Re: [PHP] A Strange Problem

2013-06-20 Thread Bastien


Bastien Koert

On 2013-06-20, at 1:57 PM, Tedd Sperling t...@sperling.com wrote:

 On Jun 20, 2013, at 1:44 PM, Bastien phps...@gmail.com wrote:
 
 It sounds like a current working directory issue. Try running a getcwd() in 
 both places to see how they are set
 
 Bastien
 
 I think you have something, here's the reports:
 
 Works:
 
/home/content/64/cut/html/sdi/tedd/php-mail
 
 Does NOT work:
 
/home/content/64/cut/html/sdi
 
 The one that does not work should be:
 
   /home/content/64/cut/html/sdi/includes/
 
 How do I fix it?
 
 Cheers,
 
 tedd
 
 PS: All cut's were identical.
 
 
 _
 t...@sperling.com
 http://sperling.com

Chdir() could work. 

The interesting thing is to see why the two calls start in diff directories.

Thanks ,

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



Re: [PHP] A Strange Problem

2013-06-20 Thread Bastien


Bastien Koert

On 2013-06-20, at 2:14 PM, Tedd Sperling tedd.sperl...@gmail.com wrote:

 Bastien:
 
 You were right on - by changing the directory to what I needed, everything 
 works.
 
 My follow-up question is Why?
 
 I have *never* had to specifically tell any script to chdir() -- why with 
 that one?
 
 Cheers and Thanks!
 
 tedd
 
 
 _
 tedd.sperl...@gmail.com
 http://sperling.com
 

The calls from the code are occurring in diff dirs as the starting point. Is 
the call in an include file?

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



Re: [PHP] A Strange Problem

2013-06-20 Thread Daniel Brown
On Thu, Jun 20, 2013 at 2:14 PM, Tedd Sperling tedd.sperl...@gmail.com wrote:
 Bastien:

 You were right on - by changing the directory to what I needed, everything 
 works.

 My follow-up question is Why?

 I have *never* had to specifically tell any script to chdir() -- why with 
 that one?

Sounds like either a chroot or virtual environment (such as,
execution of the script in a separate directory) issue.  Check the
output of this:

?php
if (phpversion() = 5.3) {
echo __DIR__.PHP_EOL;
} else {
echo getcwd().PHP_EOL;
}
?

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

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



Re: [PHP] A Strange Problem

2013-06-20 Thread Tedd Sperling
Daniel:

I placed it at root and it reports:

/home/content/64/cut/html/sdi

That's the same path that had problems.

tedd

_
tedd.sperl...@gmail.com
http://sperling.com





On Jun 20, 2013, at 2:22 PM, Daniel Brown danbr...@php.net wrote:

 On Thu, Jun 20, 2013 at 2:14 PM, Tedd Sperling tedd.sperl...@gmail.com 
 wrote:
 Bastien:
 
 You were right on - by changing the directory to what I needed, everything 
 works.
 
 My follow-up question is Why?
 
 I have *never* had to specifically tell any script to chdir() -- why with 
 that one?
 
Sounds like either a chroot or virtual environment (such as,
 execution of the script in a separate directory) issue.  Check the
 output of this:
 
 ?php
 if (phpversion() = 5.3) {
echo __DIR__.PHP_EOL;
 } else {
echo getcwd().PHP_EOL;
 }
 ?
 
 --
 /Daniel P. Brown
 Network Infrastructure Manager
 http://www.php.net/


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



Re: [PHP] A Strange Problem

2013-06-20 Thread Marc Guay
Never used it but searching turned up
http://php.net/manual/en/function.chdir.php
Marc


On 20 June 2013 12:57, Tedd Sperling t...@sperling.com wrote:
 On Jun 20, 2013, at 1:44 PM, Bastien phps...@gmail.com wrote:

 It sounds like a current working directory issue. Try running a getcwd() in 
 both places to see how they are set

 Bastien

 I think you have something, here's the reports:

 Works:

 /home/content/64/cut/html/sdi/tedd/php-mail

 Does NOT work:

 /home/content/64/cut/html/sdi

 The one that does not work should be:

/home/content/64/cut/html/sdi/includes/

 How do I fix it?

 Cheers,

 tedd

 PS: All cut's were identical.


 _
 t...@sperling.com
 http://sperling.com
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


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



[PHP] PHP 5.5.0 final has been released!

2013-06-20 Thread Julien Pauli
Hello!

The PHP Development Team would like to announce the immediate release of
PHP 5.5.0. This release includes a large number of new features and bug
fixes.

A separate release announcement is also available. For changes in PHP
5.5.0 since PHP 5.4, please consult the PHP 5 ChangeLog.

Release Announcement: http://www.php.net/release_5_5_0.php
Downloads:http://www.php.net/downloads.php#v5.5
Changelog:http://www.php.net/ChangeLog-5.php#5.5.0

Thanks to all contributors that made this new version available.

regards,

David Soria Parra  Julien Pauli


Re: [PHP] A Strange Problem

2013-06-20 Thread Stuart Dallas
On 20 Jun 2013, at 18:39, Tedd Sperling t...@sperling.com wrote:

 Hi gang:
 
 I have a very strange problem.
 
 I can use this statement in one folder:
 
   $fcontents = file('docs/admin-email.txt');
 
 But in a different folder with an exact path having 'docs/admin-email.txt', I 
 get:
 
 Warning: file(/docs/admin-email.txt) [function.file]: failed to open stream: 
 No such file or directory in cut on line 83
 
 This has got me really puzzled.
 
 I have confirmed these are the exact same folders and files, except only in 
 two different places on the server. Both are one level down from root.
 
 Any ideas as to what is going on?
 
 Cheers,
 
 tedd

Whatever the reason for this, I'd recommend you always specify a path relative 
to the current script.

In PHP 5.3+:

$fcontents = file(__DIR__.'/docs/admin-email.txt');

Prior to 5.3:

$fcontents = file(dirname(__FILE__).'/docs/admin-email.txt');

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] A Strange Problem

2013-06-20 Thread Tedd Sperling
On Jun 20, 2013, at 7:12 PM, Stuart Dallas stu...@3ft9.com wrote:
 Whatever the reason for this, I'd recommend you always specify a path 
 relative to the current script.
 
 In PHP 5.3+:
 
 $fcontents = file(__DIR__.'/docs/admin-email.txt');
 
 Prior to 5.3:
 
 $fcontents = file(dirname(__FILE__).'/docs/admin-email.txt');
 
 -Stuart

-Stuart:

Thats' an excellent idea -- I will do that.

I just don't know why after so many years this problem came up -- I never 
experienced it before -- AND when I am really up against it.

Maybe someone smarter than me (open to many) will explain why it happened.

Cheers,

tedd

_
t...@sperling.com
http://sperling.com

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



[PHP] Re: [PHP-DEV] PHP 5.5.0 final has been released!

2013-06-20 Thread Marco Pivetta
Well done! Congratulations!
On 20 Jun 2013 23:23, Julien Pauli jpa...@php.net wrote:

 Hello!

 The PHP Development Team would like to announce the immediate release of
 PHP 5.5.0. This release includes a large number of new features and bug
 fixes.

 A separate release announcement is also available. For changes in PHP
 5.5.0 since PHP 5.4, please consult the PHP 5 ChangeLog.

 Release Announcement: http://www.php.net/release_5_5_0.php
 Downloads:http://www.php.net/downloads.php#v5.5
 Changelog:http://www.php.net/ChangeLog-5.php#5.5.0

 Thanks to all contributors that made this new version available.

 regards,

 David Soria Parra  Julien Pauli