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
|
#!/bin/bash
PROJECT_ROOT=`dirname $0`
# echoes commands as they're executed
set -x
# exits on error
set -e
# Tries to infer the web user from a running Apache instance
WEB_USER=`ps axho user,comm|grep -E "httpd|apache"|uniq -d|awk '{print $1}'`
# This will drop your database, your data, and recreate everything anew
# This file should only be used for development of Sahana Agasti, as you
# can see the models, forms and filters are specific to Agasti (prefix ag)
# Tries to prompt for sudo password early on
# so as not to interrupt the process later
sudo -u $WEB_USER echo
# reverses exit-on-error behavior, since some errors might be expected
set +e
# This section removes all old models, forms and
rm -rf $PROJECT_ROOT/lib/model/doctrine/ag*
rm -rf $PROJECT_ROOT/lib/model/doctrine/base/Baseag*
rm -rf $PROJECT_ROOT/lib/form/doctrine/ag*
rm -rf $PROJECT_ROOT/lib/form/doctrine/base/Baseag*
rm -rf $PROJECT_ROOT/lib/filter/doctrine/base/Baseag*
rm -rf $PROJECT_ROOT/lib/filter/doctrine/ag*
# The following lines run symfony and doctrine commands to generate new models
# forms and filters from the yml files
$PROJECT_ROOT/symfony cc
$PROJECT_ROOT/symfony doctrine:clean --no-confirmation
$PROJECT_ROOT/symfony doctrine:build-model
$PROJECT_ROOT/symfony doctrine:drop-db --no-confirmation
$PROJECT_ROOT/symfony doctrine:create-db
sudo -u $WEB_USER $PROJECT_ROOT/symfony doctrine:build-sql
$PROJECT_ROOT/symfony doctrine:insert-sql
$PROJECT_ROOT/symfony doctrine:build-forms
$PROJECT_ROOT/symfony doctrine:build-filters
# This loads all sample data and fixtures in from yml files existing in
# the data directory
sudo -u $WEB_USER $PROJECT_ROOT/symfony doctrine:data-load -t
|