Re: [PHP-DEV] [RFC] Add is_cacheable() stream-wrapper operation

2015-01-05 Thread Martin Amps
Ah gotcha — ok, awesome. Good work!

 On Jan 4, 2015, at 8:09 PM, François Laupretre franc...@tekwire.net wrote:
 
 De : Martin Amps [mailto:ph...@rtin.so] 
 
 Did you mean to omit the “return” for is_cacheable_stream_path if
 !PHP_STREAMS_SUPPORT_IS_CACHEABLE?
 
 Right. Thanks for this one. Actually, conditionals will go away as it is
 going to the PHP7 branch only.
 


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



Re: [PHP-DEV] [RFC] Add is_cacheable() stream-wrapper operation

2015-01-04 Thread Derick Rethans
On Sun, 4 Jan 2015, François Laupretre wrote:

 I just wrote this RFC to propose a clean way for opcode caches to 
 decide if a given URI is cacheable or not :
 
 https://wiki.php.net/rfc/streams-is-cacheable
 
 Please comment.

I don't see why you need the define if it's always available. Extension 
that implement this can just check for #ifdef PHP_VERSION_ID  7.

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

RE: [PHP-DEV] [RFC] Add is_cacheable() stream-wrapper operation

2015-01-04 Thread François Laupretre
 De : Pierre Joye [mailto:pierre@gmail.com]

 Could you add tests please? A must before going any further :)

Three tests are included in the patch : one to check that phar uris are 
cacheable, one to check that plain files and 'file:' uris are cacheable, one to 
check that 'http' and 'https' uris are not cacheable.

An additional test should be added in the opcache tests dir to check that 
opcache is caching plain files, phar uris, but not other protocols. It is in my 
todo list, but I wanted your comments first, as it is more complex to implement.

 Please add the changes to UPGRADING.INTERNALS and UPGRADING as well.

Done

Regards

François


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



Re: [PHP-DEV] [RFC] Add is_cacheable() stream-wrapper operation

2015-01-04 Thread Andrea Faulds
Hi François,

 On 4 Jan 2015, at 01:36, François Laupretre franc...@tekwire.net wrote:
 
 I just wrote this RFC to propose a clean way for opcode caches to decide if
 a given URI is cacheable or not :
 
 https://wiki.php.net/rfc/streams-is-cacheable
 
 Please comment.

How would cache invalidation work? Is there already some mechanism to handle 
that with streams?

Thanks.
--
Andrea Faulds
http://ajf.me/





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



RE: [PHP-DEV] [RFC] Add is_cacheable() stream-wrapper operation

2015-01-04 Thread François Laupretre
 De : Andrea Faulds [mailto:a...@ajf.me]
 How would cache invalidation work? Is there already some mechanism to
 handle that with streams?

Sorry, I am not sure I understand what you mean with 'cache invalidation'.
Do you mean stat/mtime check to detect file changes ? This mechanism works
the same with stream wrappers through an url_stat() call.


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



RE: [PHP-DEV] [RFC] Add is_cacheable() stream-wrapper operation

2015-01-04 Thread François Laupretre
 De : Martin Amps [mailto:ph...@rtin.so] 

 Did you mean to omit the “return” for is_cacheable_stream_path if
!PHP_STREAMS_SUPPORT_IS_CACHEABLE?

Right. Thanks for this one. Actually, conditionals will go away as it is
going to the PHP7 branch only.


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



Re: [PHP-DEV] [RFC] Add is_cacheable() stream-wrapper operation

2015-01-04 Thread Martin Amps
Did you mean to omit the “return” for is_cacheable_stream_path if 
!PHP_STREAMS_SUPPORT_IS_CACHEABLE?

https://github.com/flaupretre/php-src/commit/d012ba6cb357df9fcb8f6669e3c7103018590b41?diff=unified#diff-f6d4b551c6233faa294ae9a97897c7d4R143
 
https://github.com/flaupretre/php-src/commit/d012ba6cb357df9fcb8f6669e3c7103018590b41?diff=unified#diff-f6d4b551c6233faa294ae9a97897c7d4R143



 On Jan 4, 2015, at 8:13 AM, François Laupretre franc...@tekwire.net wrote:
 
 De : Andrea Faulds [mailto:a...@ajf.me]
 How would cache invalidation work? Is there already some mechanism to
 handle that with streams?
 
 Sorry, I am not sure I understand what you mean with 'cache invalidation'.
 Do you mean stat/mtime check to detect file changes ? This mechanism works
 the same with stream wrappers through an url_stat() call.
 
 
 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php
 



[PHP-DEV] [RFC] Add is_cacheable() stream-wrapper operation

2015-01-03 Thread François Laupretre
Hi,

I just wrote this RFC to propose a clean way for opcode caches to decide if
a given URI is cacheable or not :

https://wiki.php.net/rfc/streams-is-cacheable

Please comment.

Regards

François



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



Re: [PHP-DEV] [RFC] Add is_cacheable() stream-wrapper operation

2015-01-03 Thread reeze
+1 for this PR.

On 4 January 2015 at 09:36, François Laupretre franc...@tekwire.net wrote:

 Hi,

 I just wrote this RFC to propose a clean way for opcode caches to decide if
 a given URI is cacheable or not :

 https://wiki.php.net/rfc/streams-is-cacheable

 Please comment.

 Regards

 François



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




Re: [PHP-DEV] [RFC] Add is_cacheable() stream-wrapper operation

2015-01-03 Thread Pierre Joye
hi,

On Sat, Jan 3, 2015 at 5:36 PM, François Laupretre franc...@tekwire.net wrote:
 Hi,

 I just wrote this RFC to propose a clean way for opcode caches to decide if
 a given URI is cacheable or not :

 https://wiki.php.net/rfc/streams-is-cacheable

 Please comment.

It looks like a good addtion, thanks :) I am all for it..

Could you add tests please? A must before going any further :)

Please add the changes to UPGRADING.INTERNALS and UPGRADING as well.

Cheers,
-- 
Pierre

@pierrejoye | http://www.libgd.org

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