php-general Digest 19 Jan 2013 03:26:39 -0000 Issue 8100
Topics (messages 320093 through 320095):
Re: Patch: Specify temp directory
320093 by: Matijn Woudt
Re: [PHP-DEV] new FTP function
320094 by: Daniel Brown
320095 by: tamouse mailing lists
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
----------------------------------------------------------------------
--- Begin Message ---
On Fri, Jan 18, 2013 at 12:03 PM, ALeX <lists....@tx0.eu> wrote:
> Hi,
>
> some time ago I created a small patch to make it possible to specify
> the temp dir by the php.ini.
>
> It can be found here:
> https://bugs.php.net/bug.php?id=60524
> (my latest patch (against 5.4.3) also works for 5.4.11 and 5.5.0a3)
>
> Now I do wonder if anything will happen or if that's it?
>
> I would really appreciate if the patch would be included and hopefully
> also some other people.
>
> Regards,
> ALeX.
Hi Alex,
There's a special PHP developers list, you should discuss that question
there. This list is for PHP programming questions.
- Matijn
--- End Message ---
--- Begin Message ---
On Fri, Jan 18, 2013 at 10:33 AM, KISE <wowk...@gmail.com> wrote:
> Paul Dragoonis,
>
> Actually it wont work i did tried it before, if the dir end with / it will
> list the directories inside the path you gave it and if it doesn't have any
> directories it will return false since there is no directories to return.
>
> you have to take out the last / and then remove the directory in question
> and list the files in the parent directory and check if the dir exists
> otherwise it will return false, i spent 3hrs yesterday thinking why its
> returning false even though the directory exists.
The discussion is now getting more into the general coding realm
than internals, so let's move it over there in case anyone wants to
mention something like:
function ftp_dir_exists($conn, $currentDir) {
$currentDir = (substr($currentDir,-1,1) == '/') ?
substr($currentDir,0,-1) : $currentDir;
$list = ftp_nlist($conn, '-dF '. $currentDir);
return in_array($currentDir, $list);
}
--- End Message ---
--- Begin Message ---
On Fri, Jan 18, 2013 at 9:43 AM, Daniel Brown <danbr...@php.net> wrote:
> On Fri, Jan 18, 2013 at 10:33 AM, KISE <wowk...@gmail.com> wrote:
>> Paul Dragoonis,
>>
>> Actually it wont work i did tried it before, if the dir end with / it will
>> list the directories inside the path you gave it and if it doesn't have any
>> directories it will return false since there is no directories to return.
>>
>> you have to take out the last / and then remove the directory in question
>> and list the files in the parent directory and check if the dir exists
>> otherwise it will return false, i spent 3hrs yesterday thinking why its
>> returning false even though the directory exists.
>
> The discussion is now getting more into the general coding realm
> than internals, so let's move it over there in case anyone wants to
> mention something like:
>
> function ftp_dir_exists($conn, $currentDir) {
> $currentDir = (substr($currentDir,-1,1) == '/') ?
> substr($currentDir,0,-1) : $currentDir;
> $list = ftp_nlist($conn, '-dF '. $currentDir);
> return in_array($currentDir, $list);
> }
Haven't played with ftp functions at all, but wondering what if you
gave it dirname($currentDir) instead of $currentDir? (Still have to do
the trailing '/'-ectomy)
$list = ftp_nlist($conn, dirname($currentDir));
untested, just a thought.
--- End Message ---