wCMF 4.1
Guides
Getting started
Architecture
Model
Persistence
Presentation
Configuration
Security
I18n & l10n
Tests
Versions
4.1.x
4.0.x
API
Classes
Hierarchy
Code
Support
home
travis
build
iherwig
wcmf
docs
api-src
framework_description
en
gettingstarted.doxy
1
/*!
2
\page gettingstarted Getting started
3
<div class="has-toc"></div>
4
5
# Getting started # {#getting_started}
6
7
The wCMF project mainly consists of two parts, the application framework and an
8
application template.
9
10
## wCMF Framework ## {#framework}
11
12
The wCMF framework provides the foundation for creating PHP web applications based
13
on the model-view-controller pattern. The project's source code is hosted on
14
[GitHub](https://github.com/iherwig/wcmf) and can be forked or downloaded from there.
15
16
If you manage your dependencies using [Composer](https://getcomposer.org/) you just need
17
add the following lines to your `composer.json`:
18
19
<div class="json">
20
```
21
{
22
"require": {
23
"wcmf/wcmf": "dev-master"
24
}
25
}
26
```
27
</div>
28
29
## Default Application ## {#app}
30
31
The default application is a fully functional data managing application based on the
32
wCMF framework. Besides interfaces for create/read/update/delete (CRUD) operations
33
on all entity types defined in the domain model, it features user, role and
34
permission management as well as a lucene based search.
35
36
The following screenshots show the list and detail view of an _Author_ entity type.
37
38
@image html wcmf-default-app1ws.png
39
40
@image html wcmf-default-app2ws.png
41
42
### Prerequisites ### {#app_pre}
43
44
To run the wCMF default application you will need the following environment:
45
46
- Web server (e.g. Apache)
47
- PHP >= 5.6
48
- MySQL
49
- [Composer](https://getcomposer.org/)
50
- [Apache Ant](http://ant.apache.org/) for code generation and deployment
51
52
To modify the demo model you additionally need:
53
54
- UML Modeling tool (e.g. [Eclipse Papyrus](http://www.eclipse.org/papyrus/) or
55
[Chronos Web Modeler](http://sourceforge.net/projects/olympos/))
56
57
@note A development environment based on Docker containers and the Eclipse IDE is
58
provided in the [wcmf-workspace](https://github.com/iherwig/wcmf-workspace) project.
59
60
### Installation ### {#app_install}
61
62
We assume that the application's root directory is accessible to your web server
63
and mapped to the url `http://localhost/wcmf-default-app`.
64
65
#### GitHub #### {#app_install_github}
66
67
The application's source code can be cloned from
68
[GitHub](https://github.com/iherwig/wcmf-default-app) using the following command:
69
70
<div class="shell">
71
```
72
$ git clone https://github.com/iherwig/wcmf-default-app
73
```
74
</div>
75
76
After that you should see the following directories:
77
78
- _app_
79
- _config_
80
- _locale_
81
- _public_
82
- _src_
83
- _build_
84
- _install_
85
- _model_
86
- _test_
87
- _tools_
88
89
The application uses Composer to manage external dependencies.
90
Execute the following command in the root directory of the application to fetch them:
91
92
<div class="shell">
93
```
94
$ composer install
95
```
96
</div>
97
98
#### Composer #### {#app_install_composer}
99
100
Alternatively you can also use Composer to install the source code together with
101
all dependencies:
102
103
<div class="shell">
104
```
105
$ composer create-project wcmf/wcmf-default-app wcmf-default-app
106
```
107
</div>
108
109
To get the __latest development version__ use the following command:
110
111
<div class="shell">
112
```
113
$ composer create-project wcmf/wcmf-default-app wcmf-default-app dev-master
114
```
115
</div>
116
117
### Model the domain ### {#app_model}
118
119
The application ships with a demo UML model that can be used as a quick start.
120
It's located in `model/model.uml`. Base models for those who want to start
121
from scratch are located in _model/base/cwm/_ and _model/base/papyrus/_. An
122
in-depth guide on modeling for wCMF is provided in the \ref model section.
123
124
### Generate the code ### {#app_gen}
125
126
A code \ref model_generator is used to generate class- and configuration files from the domain
127
model. Execute the following command in the _build_ directory of the application in
128
order to run the generator:
129
130
<div class="shell">
131
```
132
$ ant generate
133
```
134
</div>
135
136
### Setup the database connection ### {#app_db}
137
138
The database connection information is defined in the file `app/config/server.ini` and
139
defaults to
140
141
<div class="ini">
142
```
143
[Database]
144
dbType = mysql
145
dbHostName = 127.0.0.1
146
dbName = wcmf_testapp
147
dbUserName = root
148
dbPassword =
149
dbCharSet = utf8
150
```
151
</div>
152
153
Change these values to fit your local configuration. If privileges are granted,
154
the database will be created automatically in the next step. If not, you have
155
to create it beforehand.
156
157
### Run installation scripts ### {#app_db_init}
158
159
Open a web browser and navigate to `http://localhost/wcmf-default-app/install/`.
160
Click the buttons:
161
162
- _Update database_ to create the application tables
163
- _Initialize database_ to create the initial data (e.g. the _admin_ user)
164
165
### Open the application ### {#app_run}
166
167
Navigate to `http://localhost/wcmf-default-app/app/public/` to open the login screen.
168
Sign in using
169
170
- Username: _admin_
171
- Password: _admin_
172
*/