NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Problems with ZipArchive class in PhpED 4.6.3


Joined: 28 Mar 2007
Posts: 53
Reply with quote
Hello,

I have tried to use ZipArchive class in my application (to create/extract zip archives) and I have come across with problem.

By first time PhpED was generating error, something like ‘ZipArchive() unknown class’. That means zip extension was not enabled by default so I go to php.ini file to enable it but I can not find corresponding line in extension list (extension=php_zip.dll) for PHP5. A bit later I have checked php.ini for PHP4 and found it there, so I just copied it.

After all of this the first problem (unknown class) seemed to be solved. Based on watch list I have checked the state of $zip variable and it looks correct (I think)
$zip = new ZipArchive();

The next step which I have done was: to create archive file as it was written on examples on www.php.net web site:
$zip->open($zipPath, ZIPARCHIVE::CREATE);

After about 10 sec PhpED generates fatal error with following message:
‘CGI / FastCGI has encountered a problem and needs to close. We are sorry for the inconvenience’.

Furthermore when I was typing ‘$zip->’ it did not gave me any hint (methods or properties of ZipArchive class). All these brought me to the point that may be PhpED could not use Zip extension.

Could you please help me?

Kindest regards

Vitali Simsive
View user's profileFind all posts by DelphiSend private messageICQ Number
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
all embedded classes (the classes that come with php extensions in binary form, not in php files) require prototypes.
Feel free to add them the same way as suggested there
http://forum.nusphere.com/code-completion-for-php-spl-dom-pdo-and-dom-t1733.html

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 28 Mar 2007
Posts: 53
Reply with quote
Thank you very much for the answer.

As I understand from you post (I have already downloaded that zip file) this is prototype of original class (but without implementation), as soon as it will be in project, PhpED will use it as original one and will show all hints. If so then there is another question, is there any ready prototype of ZipArchive class and where I can download it?

p.s. Sorry for the first part of the question, there were errors in my own class.
View user's profileFind all posts by DelphiSend private messageICQ Number


Joined: 28 Mar 2007
Posts: 53
Reply with quote
Could you pleas help me with this messages and hints, I have tried to do the same but it does not work and I have no idea why Sad. Here is the simple code example

Code:
class ZipArchive {
  /*
  * @brief Adds a file to a ZIP archive from the given path
  * @return Returns TRUE on success or FALSE on failure
  */         
  function addFile(string $filename, string $localname=’’);
}


I have no idea how can I show hint like this addFile(string $filename [, string $localname]);

And the last question, what about class constants declarations? How should I declare them? For example ZIPARCHIVE::CREATE?
View user's profileFind all posts by DelphiSend private messageICQ Number
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Prototype MUST be a correct php file anyway, for example:

Code:
<?php
class ZipArchive {
  const CREATE;
  /*
  * @brief Adds a file to a ZIP archive from the given path
  * @param string
  * @param string
  * @return Returns TRUE on success or FALSE on failure
  */         
  function addFile($filename, $localname='') {}
}
?>

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 28 Mar 2007
Posts: 53
Reply with quote
Still does not work Sad
View user's profileFind all posts by DelphiSend private messageICQ Number


Joined: 28 Mar 2007
Posts: 53
Reply with quote
dmitri, could you please give me working example? Where all hints shown in correct way?

Thanks

p.s. Almost half month pass and I have not receive any meaningful answer.
View user's profileFind all posts by DelphiSend private messageICQ Number
Veteran

Joined: 24 Jan 2006
Posts: 311
Reply with quote
Hi there - the problem is in bad formatting of the comments, it is essential that it starts with /** and not just /*
Here it is:

and in PHP 5 style:

View user's profileFind all posts by yfaktorSend private message


Joined: 28 Mar 2007
Posts: 53
Reply with quote
yfaktor wrote:
Hi there - the problem is in bad formatting of the comments, it is essential that it starts with /** and not just /*

Thanks a lot, it's really works now Wink
View user's profileFind all posts by DelphiSend private messageICQ Number
Problems with ZipArchive class in PhpED 4.6.3
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic