Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Open sidebar
lolo888
ISPConfig 3
Commits
32814e88
Commit
32814e88
authored
Aug 20, 2007
by
pedro_morgan
Browse files
More php5 on install_base
parent
b0a1cc4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
install/lib/installer_base.lib.php
View file @
32814e88
...
...
@@ -37,43 +37,45 @@ class installer_base {
/*
*/
function
__construct
()
public
function
__construct
()
{
global
$conf
;
//TODO: maybe $conf should be passed to constructor
$this
->
conf
=
$conf
;
}
function
lng
(
$text
)
{
//TODO uh ?
public
function
lng
(
$text
)
{
return
$text
;
}
function
error
(
$msg
)
{
public
function
error
(
$msg
)
{
die
(
"ERROR: "
.
$msg
.
"
\n
"
);
}
function
simple_query
(
$query
,
$answers
,
$default
)
{
global
$conf
;
public
function
simple_query
(
$query
,
$answers
,
$default
)
{
$finished
=
false
;
do
{
$answers_str
=
implode
(
","
,
$answers
);
$answers_str
=
implode
(
','
,
$answers
);
swrite
(
$this
->
lng
(
$query
)
.
' ('
.
$answers_str
.
') ['
.
$default
.
']: '
);
$input
=
sread
();
// Stop the installation
//
*
Stop the installation
if
(
$input
==
'quit'
)
{
swriteln
(
$this
->
lng
(
'
Installation inte
rrupted.'
));
swriteln
(
$this
->
lng
(
"
Installation
term
in
a
te
d by user.
\n
"
));
die
();
}
// Select the default
//
*
Select the default
if
(
$input
==
''
)
{
$answer
=
$default
;
$finished
=
true
;
}
if
(
in_array
(
$input
,
$answers
))
{
//* Set answer id valid
if
(
in_array
(
$input
,
$answers
))
{
$answer
=
$input
;
$finished
=
true
;
}
...
...
@@ -83,31 +85,24 @@ class installer_base {
return
$answer
;
}
function
free_query
(
$query
,
$default
)
{
global
$conf
;
public
function
free_query
(
$query
,
$default
)
{
swrite
(
$this
->
lng
(
$query
)
.
' ['
.
$default
.
']: '
);
$input
=
sread
();
// Stop the installation
//
*
Stop the installation
if
(
$input
==
'quit'
)
{
swriteln
(
$this
->
lng
(
'
Installation
in
ter
rupted.'
));
die
();
swriteln
(
$this
->
lng
(
"
Installation ter
minated by user.
\n
"
));
die
();
}
// Select the default
if
(
$input
==
''
)
{
$answer
=
$default
;
}
else
{
$answer
=
$input
;
}
$answer
=
(
$input
==
''
)
?
$default
:
$input
;
swriteln
();
return
$answer
;
}
function
request_language
()
{
// TODO: this function is not used atmo I think - pedro
function
request_language
(){
swriteln
(
lng
(
'Enter your language'
));
swriteln
(
lng
(
'de, en'
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment