php-general Digest 20 Jan 2013 21:07:19 -0000 Issue 8101
Topics (messages 320096 through 320097):
Re: [PHP-DEV] new FTP function
320096 by: tamouse mailing lists
same php file, different day...worked 3-4 times in the past in the past
320097 by: Fred Silsbee
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 9:26 PM, tamouse mailing lists
<tamouse.li...@gmail.com> wrote:
> 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.
Although on further thought, if $currentDir actually points to a
non-directory, that will still pass, won't it. Might have to go with
ftp_rawlist and parse it out to ensure it is a directory... Check the
first character of each line to see if it's 'd', then the file name
will be the last field in the line.
--- End Message ---
--- Begin Message ---
Fatal error: Call to undefined function mysqli__connect() in
/var/www/html/log_book_MySQLnew_i.php on line 116
phpinfo.php shows mysqli
Additional .ini files parsed
/etc/php.d/curl.ini,
/etc/php.d/fileinfo.ini,
/etc/php.d/json.ini,
/etc/php.d/mysql.ini,
/etc/php.d/mysqli.ini,
/etc/php.d/pdo.ini,
/etc/php.d/pdo_mysql.ini,
/etc/php.d/pdo_sqlite.ini,
/etc/php.d/phar.ini,
/etc/php.d/sqlite3.ini,
/etc/php.d/zip.ini
maybe a mysqli.ini is required containing mysqli.so
but
[root@localhost php.d]# locate mysqli.so
[root@localhost php.d]#
[root@localhost php.d]# locate mysqli
/usr/bin/mysqlimport
/usr/share/man/man1/mysqlimport.1.gz
[root@localhost php.d]#
--- End Message ---