noalyss Version-9
Public Member Functions
Package_Core Class Reference

Class Package Core to install the core , if possible. More...

+ Inheritance diagram for Package_Core:
+ Collaboration diagram for Package_Core:

Public Member Functions

 can_install ()
 check if it is possible to install Are the folder html and include writeable ? More...
 
 install ()
 Unzip the file and overwrite current implementation, the databases and modele are not upgraded. More...
 
- 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

Class Package Core to install the core , if possible.

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

Member Function Documentation

◆ can_install()

Package_Core::can_install ( )

check if it is possible to install Are the folder html and include writeable ?

Reimplemented from Package_Noalyss.

Definition at line 38 of file package_core.class.php.

39 {
40 if (! is_writable(NOALYSS_HOME)) {
41 return 0;
42 }
43 if ( !is_writable(NOALYSS_INCLUDE)) {
44 return 0;
45 }
46 return 1;
47 }

Referenced by install().

◆ install()

Package_Core::install ( )

Unzip the file and overwrite current implementation, the databases and modele are not upgraded.

It must be done after. In this package the install is given and must be delete manually

Exceptions
Exception1 : cannot extract content of the zip , 2: cannot open zip file

Reimplemented from Package_Noalyss.

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

56 {
57 if ( $this->can_install() == 0 )
58 {
59 throw new Exception(sprintf(_("Permission incorrecte : ne peut écrire dans %s ou %s"),NOALYSS_HOME,NOALYSS_INCLUDE),3);
60 }
61 $zip=new ZipArchive ();
62 // open the file
63 if ($zip->open(NOALYSS_HOME."/tmp/".$this->get_file()))
64 {
65 // try to unzip and overwrite current
66 if (!$zip->extractTo(NOALYSS_HOME."/../"))
67 {
68 throw new Exception(_("Echec mise à jour"), 1);
69 }
70 }
71 else
72 {
73 throw new Exception(_("Ce n'est pas un fichier valide"), 2);
74 }
75
76 }
can_install()
check if it is possible to install Are the folder html and include writeable ?

References can_install().

+ Here is the call graph for this function:

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