|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-05-31 17:50 UTC] greg at chiaraquartet dot net
the createModify parameter specification allows files separated by spaces, or a single filename. This does not take into account the possibility of directories with spaces in them. The best solution is to change the space to an impossible OS character, such as : or ; (this is why include_path uses : instead of spaces). This affects all aspects of the pear packaging process as well, so changes here will require changes elsewhere that Archive_Tar is used. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 23:00:02 2025 UTC |
Actually, that is almost what it is doing. It accepts a string (space-delimited) or an array of path/filenames. So, if you have something that contains spaces, all you have to do is put them into an array. $foo->createModify(array('path/with spaces/to/file')); I suggest leaving it as-is, because it would break BC otherwise. Quoting/escaping would be nice, but is not really neccessary, i think. One easy thing that one could do though is introducing a 5th parameter (optional) specifying the delimiter for the filelist, defaulting to a space. Assigning this to the maintainer, he should decide what do to.Vincent, It's always nice when everyone can be correct :) I did a full-text search for createModify, and it is used in PEAR_Packager::package() on line 138 of Packager.php. All one needs to do is add an array() around $newpkgfile in: $ok = $tar->createModify($newpkgfile, '', $tmpdir); to get: $ok = $tar->createModify(array($newpkgfile), '', $tmpdir); In addition (and this is minor), I would suggest changing the PHPDoc @param for createModify() (which is by the way extremely useful and well-written, a pleasure to read). instead of @param string <description> try @param string|array <description>, this will allow people glancing at it to figure out what the exact types allowed are. Otherwise, I'm changing this bug's summary to match what is really going on.