note 103893 added to phar.using.stream

From: Date: Mon, 09 May 2011 19:12:42 +0000
Subject: note 103893 added to phar.using.stream
Groups: php.notes 
Request: Send a blank email to php-notes+get-179568@lists.php.net to get a copy of this message
Some Examples of how to use the stream wrapper would be really helpful. My floundering attempts reveal only the following: $p = new PharData(dirname(__FILE__).'/phartest.zip', 0,'phartest',Phar::ZIP) ; $p->addFromString('testfile.txt', 'this is just some test text'); // This works echo file_get_contents('phar://phartest.zip/testfile.txt'); //This Fails file_put_contents('phar://phartest.zip/testfile.txt', 'Thist is text for testfile.txt'); $context = stream_context_create( array('phar' =>array('compress' =>Phar::ZIP)) ) ; //This Fails file_put_contents( 'phar://phartest.zip/testfile.txt', 'Thist is text for testfile.txt',0,$context); // This works but only with 'r' readonly mode. $f = fopen( 'phar://C:\\Inetpub\\wwwroot\\PACT\\test\\phartest.zip\\testfile.txt', 'r') ; ---- Server IP: 69.147.83.197 Probable Submitter: 71.148.52.123 ---- Manual Page -- http://www.php.net/manual/en/phar.using.stream.php Edit -- https://master.php.net/note/edit/103893 Del: integrated -- https://master.php.net/note/delete/103893/integrated Del: useless -- https://master.php.net/note/delete/103893/useless Del: bad code -- https://master.php.net/note/delete/103893/bad+code Del: spam -- https://master.php.net/note/delete/103893/spam Del: non-english -- https://master.php.net/note/delete/103893/non-english Del: in docs -- https://master.php.net/note/delete/103893/in+docs Del: other reasons-- https://master.php.net/note/delete/103893 Reject -- https://master.php.net/note/reject/103893 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#179568) next »