noalyss Version-9
Public Member Functions
Package_Plugin Class Reference

Manage the installation of plug. More...

+ Inheritance diagram for Package_Plugin:
+ Collaboration diagram for Package_Plugin:

Public Member Functions

 can_install ()
 Check the NOALYSS_PLUGIN is writeable. More...
 
 install ()
 
- Public Member Functions inherited from Package_Noalyss
 __construct ($name, $description, $full_path)
 
 can_download ()
 check that NOALYSS_HOME exists and is writable More...
 
 can_install ()
 
 download ()
 
 get_description ()
 
 get_file ()
 
 get_name ()
 
 get_path ()
 
 install ()
 
 set_description ($description)
 
 set_file ($file)
 
 set_name ($name)
 
 set_path ($path)
 

Detailed Description

Manage the installation of plug.

Definition at line 31 of file package_plugin.class.php.

Member Function Documentation

◆ can_install()

Package_Plugin::can_install ( )

Check the NOALYSS_PLUGIN is writeable.

Reimplemented from Package_Noalyss.

Definition at line 55 of file package_plugin.class.php.

56 {
57 if (is_writable(NOALYSS_PLUGIN))
58 {
59 return TRUE;
60 }
61 return FALSE;
62 }

◆ install()

Package_Plugin::install ( )

Reimplemented from Package_Noalyss.

Definition at line 34 of file package_plugin.class.php.

35 {
36 $zip=new ZipArchive ();
37 // open the file
38 if ($zip->open(NOALYSS_HOME."/tmp/".$this->get_file()))
39 {
40 // try to unzip and overwrite current
41 if (!$zip->extractTo(NOALYSS_PLUGIN))
42 {
43 throw new Exception(_("Echec installation plugin "), 1);
44 }
45 }
46 else
47 {
48 throw new Exception(_("Ce n'est pas un fichier valide"), 2);
49 }
50 }

The documentation for this class was generated from the following file: