svn: /pear2/Pyrus/trunk/src/Pyrus/Package/ Remote.php
| From: | Brett Bieber | Date: | Tue, 23 Mar 2010 14:09:07 +0000 |
| Subject: | svn: /pear2/Pyrus/trunk/src/Pyrus/Package/ Remote.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-9319@lists.php.net to get a copy of this message | ||
saltybeagle Tue, 23 Mar 2010 14:09:07 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=296671
Log:
If writing the package file failed, let us know that was the specific error.
Changed paths:
U pear2/Pyrus/trunk/src/Pyrus/Package/Remote.php
Modified: pear2/Pyrus/trunk/src/Pyrus/Package/Remote.php
===================================================================
--- pear2/Pyrus/trunk/src/Pyrus/Package/Remote.php 2010-03-23 13:57:50 UTC (rev 296670)
+++ pear2/Pyrus/trunk/src/Pyrus/Package/Remote.php 2010-03-23 14:09:07 UTC (rev 296671)
@@ -200,7 +200,9 @@
mkdir($dir, 0755, true);
}
- file_put_contents($dir . DIRECTORY_SEPARATOR . $name, $response->body);
+ if (false === file_put_contents($dir . DIRECTORY_SEPARATOR . $name,
$response->body)) {
+ throw new Exception('Unable to save package '.$name.' to downloads
directory, '.$dir.'. Do we have permission to write there?');
+ }
// whew, download worked!
$a = new \pear2\Pyrus\Package($dir . DIRECTORY_SEPARATOR . $name);