/
applications.gtw
82 lines (50 loc) · 4.89 KB
/
applications.gtw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
~~LANG:FR@frman:installation/application~~
This chapter explains how to install an existing application developed with Jelix. We're going to take the TestApp application availabled in the download section of jelix.org. It is an application which contains some examples and some unit tests for Jelix (It is useful for developers who modify jelix).
The explanations are of course valid for any application based on Jelix.
===== Files installations =====
Depending of the project, you may have an archive (zip or tar.gz) which contains all files. Or you may have to retrieve files from a source code repository (based an subversion, mercurial, git). The second solution is pretty good, because updates are easiers.
When the archive is decompressed, or source code retrieved from the repository, you get the following directories:
testapp/ application directory
install/ script to install the application
modules/ modules of the application
responses/ common responses for the application
plugins/ plugins of the application
var/ contain all the files created or that can be modified by Jelix during execution
config/ configuration files of the application
log/ log files of jelix and of the application
www/ root of the site of the application (document root)
You may have too a @@F@lib/@@ and a @@F@temp/@@ directory, provided into the source code. If not, you have to retrieve an archive of Jelix, and to create a temp directory.
All these directories could be in a same @@F@mysite/@@ directory. You then have:
mysite/
lib/
temp/
testapp/
The tree structure of the sources is by default organized in order to install the application on a server on which you can specify the public root directory of the site (document root). This directory is @@F@mysite/testapp/www@@ .
You will of course be able to change the place of these directories but it is not recommended, for security reasons.
You will notice that the files of the application and those of the framework are separated. This way, you can share the lib directory with several applications.
===== Configuration files renaming =====
In @@F@testapp/var/config@@, you have @@F@*.dist@@ files. Rename them by removing this '.dist' suffix. You have certainly some things to modify in this new files, like database configuration in @@F@profiles.ini.php@@ etc. We will see how exactly below.
===== Creating the temporary directory =====
Create the @@F@mysite/temp/testapp@@ directory. Perhaps your application contains different @@F@*.init.php@@ files, similar to the @@F@application.init.php@@, but declaring different temporary folders. So create the corresponding folders.
===== Configuring the server =====
You have to configure the web server (virtual host, with a document root..), and to configure certainly a SQL database.
Read [[/server-configuration|the corresponding chapter]] before continuing.
===== Installing the application =====
There is three ways to install the application, depending what is providing with your application.
==== With a wizard ====
If there is a @@F@testapp/www/install.php@@ script, this is certainly a script, a wizard, to launch with your browser. So open your browser, and go to the url of this script, for instance @@http://www.mysite.com/install.php@@. Follow instructions and that's it. The wizard will probably modify configuration file for you (database access etc), after asking you informations about it. The installation is then done.
It is recommended to remove the @@F@install.php@@ file (save it in a protected folder), so it is not accessible anymore from the web.
==== With the application installer ====
If there is a @@F@testapp/install/installer.php@@ script, this is a script to execute in a
console. So first fill all needed parameters in @@F@profiles.ini.php@@ and in
@@F@mainconfig.ini.php@@ (read the documentation of the application to know what exactly
change). Then open a console, go into the @@F@testapp/install/@@ directory, and then type
@@php.exe installer.php@@.
==== With the jelix installer ====
If there isn't wizard or dedicated installation script, you have to configure
@@F@profiles.ini.php@@ and in @@F@mainconfig.ini.php@@, then, with a console, go into the
@@F@testapp/@@ directory and type @@php.exe cmd.php installapp@@. Read
[[/jelix-scripts|the chapter about jelix commands]] to have more informations about this
command line.
==== If the installation system is deactivated into the configuration ====
In some project, especially on internal projects where the installation process is very specific, a choice has probably be made to deactivate the installation system (@@disableInstallers=on@@). In this case, no need to launch the application installer or the jelix installer. However, you have to install all things needed by the application, "by hand", or by your own scripts of your installation process.