Inbuilt ZIP support

Announcements and description of general changes in kPlaylist

Inbuilt ZIP support

Postby aba » Tue Mar 25, 2008 5:00 am

There has been alot of problems regarding generation of archives (multidownload), especially under Win32. So, in the newest dev release (from 469), kP supports the inbuilt ZIP extension. (www.php.net/zip)

To get it running, you need PHP version 5.2.0 or newer and the
extension loaded:

Enable the extension (php.ini):

Code: Select all
extension=php_zip.dll


After doing so, you should have a new option in the list of 'preferred archivers' under 'Options'.

Let me know of any problems.
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Postby jmelhus » Sat Mar 29, 2008 2:32 pm

Hi Aba,

Tried it without success, the scripts reports archive is deleted. Could be some settings on my side?

Here is my system:

Apache HTTPD 2.2.8 + Openssl 0.9.8g
MySQL 5.0.51a
PHP 5.2.5
KP build 470
Win XP Pro SP2

It creates an archive with a totally different name that appears in the script, is it supposed to be that way?

I also removed the other archivers to be sure to have the right ZIP included from PHP. And the ZIP feature is enabled in the PHP settings. The permissions should be sufficient as well, since this is on a windows system with an admin user...
jmelhus
 
Posts: 128
Joined: Sat Jan 01, 2005 1:10 pm

Postby aba » Sat Mar 29, 2008 2:39 pm

jmelhus wrote:Hi Aba,

Tried it without success, the scripts reports archive is deleted. Could be some settings on my side?

Here is my system:

Apache HTTPD 2.2.8 + Openssl 0.9.8g
MySQL 5.0.51a
PHP 5.2.5
KP build 470
Win XP Pro SP2

It creates an archive with a totally different name that appears in the script, is it supposed to be that way?

I also removed the other archivers to be sure to have the right ZIP included from PHP. And the ZIP feature is enabled in the PHP settings. The permissions should be sufficient as well, since this is on a windows system with an admin user...


Yes, that's completely OK. However, I've noticed that PHP has starting take some liberties under Windows. It does not use the temporary directory that is specified when using tempnam(), and it instead uses the system temp directory which can differ alot.

There is an code for bypassing this, it looks like this:

Code: Select all
   if (isphp5() && function_exists('sys_get_temp_dir'))
                        {
                           $file = sys_get_temp_dir() . $_POST['file'];
                           if (file_exists($file))
                           {
                              kplay_archivedownload($file, $_POST['mime'], $filename);
                              @unlink($file);
                              $fileok = true;
                           }
                        }


Can you add some debugging here, and see if that code runs? Try also to echo what it is getting from 'sys_get_temp_dir()'.
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Postby jmelhus » Sun Mar 30, 2008 11:56 am

Hi again,

I've tried to debug some, but my php knowledge is rather bad... so after playing around for some hours, i'll have to give up. Sorry... Maybe someone else could support with some debug here?

Or an option is, if you have some code you will have me to try, just post it here... and I'll put it in the script and see if it works or not...
jmelhus
 
Posts: 128
Joined: Sat Jan 01, 2005 1:10 pm

Postby aba » Sun Mar 30, 2008 3:40 pm

jmelhus wrote:Hi again,

I've tried to debug some, but my php knowledge is rather bad... so after playing around for some hours, i'll have to give up. Sorry... Maybe someone else could support with some debug here?

Or an option is, if you have some code you will have me to try, just post it here... and I'll put it in the script and see if it works or not...


I've rewritten the archiver, can you try with the latest build? (472). If it shoulden't work, switch the $cfg['archivemodedebug'] to true. I've added some more details there.
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Postby jmelhus » Sun Mar 30, 2008 7:31 pm

Perfect! It's working now, tried a number of different combinations and everyone worked... Nice! Thanks! :)
jmelhus
 
Posts: 128
Joined: Sat Jan 01, 2005 1:10 pm


Return to Announcement



cron