noalyss
Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
include
class
package_noalyss.class.php
Go to the documentation of this file.
1
<?php
2
3
/*
4
* This file is part of NOALYSS.
5
*
6
* PhpCompta is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
10
*
11
* NOALYSS is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with PhpCompta; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
*/
20
// Copyright (2018) Author Dany De Bontridder <dany@alchimerys.be>
21
22
/**
23
* @file
24
* @brief package noalyss is the mother class of the class to install and download package
25
*/
26
/**
27
* @class Package_Noalyss
28
* @brief package noalyss is the mother class of the class to install and download package
29
*/
30
31
abstract
class
Package_Noalyss
32
{
33
34
private
$file
;
35
private
$path
;
36
private
$name
;
37
private
$description
;
38
39
function
__construct
(
$name
,
$description
, $full_path)
40
{
41
$this->file=basename(trim($full_path));
42
$this->path=dirname(trim($full_path));
43
44
$this->description=
$description
;
45
$this->
name
=
$name
;
46
}
47
48
public
function
get_path
()
49
{
50
return
$this->path
;
51
}
52
53
public
function
set_path
(
$path
)
54
{
55
$this->path=
$path
;
56
return
$this;
57
}
58
59
public
function
get_file
()
60
{
61
return
$this->file
;
62
}
63
64
public
function
get_name
()
65
{
66
return
$this->name
;
67
}
68
69
public
function
get_description
()
70
{
71
return
$this->description
;
72
}
73
74
public
function
set_file
(
$file
)
75
{
76
$this->file=
$file
;
77
return
$this;
78
}
79
80
public
function
set_name
(
$name
)
81
{
82
$this->
name
=
$name
;
83
return
$this;
84
}
85
86
public
function
set_description
(
$description
)
87
{
88
$this->description=
$description
;
89
return
$this;
90
}
91
92
/**
93
* check that NOALYSS_HOME exists and is writable
94
*/
95
function
can_download
()
96
{
97
$download_dir=NOALYSS_HOME.
"/tmp"
;
98
if
(is_dir($download_dir)&&is_writable($download_dir))
99
{
100
return
TRUE;
101
}
102
return
FALSE;
103
}
104
105
function
download
()
106
{
107
if
( ! $this->
can_download
() )
return
false
;
108
// If install is writable then download
109
110
111
$full=$this->
get_path
().
"/"
.$this->
get_file
();
112
$file
= file_get_contents(NOALYSS_PACKAGE_REPOSITORY.
"/"
.$full);
113
$fh_file=fopen(NOALYSS_HOME.
"/tmp/"
.$this->get_file(),
"w+"
);
114
115
fwrite($fh_file,
$file
);
116
fclose($fh_file);
117
return
TRUE;
118
119
}
120
121
abstract
function
install
();
122
123
abstract
function
can_install
();
124
}
name
$from_poste name
Definition
balance.inc.php:163
Package_Noalyss
package noalyss is the mother class of the class to install and download package
Definition
package_noalyss.class.php:32
Package_Noalyss\get_name
get_name()
Definition
package_noalyss.class.php:64
Package_Noalyss\set_name
set_name($name)
Definition
package_noalyss.class.php:80
Package_Noalyss\get_description
get_description()
Definition
package_noalyss.class.php:69
Package_Noalyss\can_download
can_download()
check that NOALYSS_HOME exists and is writable
Definition
package_noalyss.class.php:95
Package_Noalyss\set_path
set_path($path)
Definition
package_noalyss.class.php:53
Package_Noalyss\$name
$name
Definition
package_noalyss.class.php:36
Package_Noalyss\get_path
get_path()
Definition
package_noalyss.class.php:48
Package_Noalyss\$file
$file
Definition
package_noalyss.class.php:34
Package_Noalyss\set_description
set_description($description)
Definition
package_noalyss.class.php:86
Package_Noalyss\set_file
set_file($file)
Definition
package_noalyss.class.php:74
Package_Noalyss\install
install()
Package_Noalyss\$path
$path
Definition
package_noalyss.class.php:35
Package_Noalyss\can_install
can_install()
Package_Noalyss\__construct
__construct($name, $description, $full_path)
Definition
package_noalyss.class.php:39
Package_Noalyss\get_file
get_file()
Definition
package_noalyss.class.php:59
Package_Noalyss\$description
$description
Definition
package_noalyss.class.php:37
Package_Noalyss\download
download()
Definition
package_noalyss.class.php:105
Generated on Wed Jun 25 2025 09:57:48 for noalyss by
1.13.2