forked from pigroupe/cmf-sfynx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresetProjectData.sh
executable file
·55 lines (53 loc) · 2.39 KB
/
resetProjectData.sh
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
#!/bin/sh
read -p "Are you sure you want to reset all data from the project ? (y/n) " RESP
if [ "$RESP" = "y" ]; then
echo "0- Clears all metadata cache for an entity manager"
php app/console doctrine:cache:clear-metadata
echo "1- Clears all query cache for an entity manager"
php app/console doctrine:cache:clear-query
echo "2- Clears result cache for an entity manager"
php app/console doctrine:cache:clear-result
echo "3- Drops the configured databases"
php app/console doctrine:database:drop --force
php app/console doctrine:database:create
echo "4- Executes (or dumps) the SQL needed to generate the database schema"
php app/console doctrine:schema:update --force
echo "5- Load data fixtures to your database."
php app/console doctrine:fixtures:load
echo "6- Extract a new user of the excel"
echo "7- Dumps all assets to the filesystem"
php app/console assetic:dump
echo "8- Installs bundles web assets under a public web directory"
php app/console assets:install
echo "9- Reset project cache"
php app/console cache:clear --env=prod --no-debug
php app/console cache:clear --env=dev --no-debug
sudo service apache2 reload
sudo chmod -R 777 app/logs/
sudo chmod -R 777 app/cache/
echo "10 - we generate documentations"
rm -rf doc/phpdocumentor/*
rm -rf web/phpdocumentor/*
rm -rf doc/uml/htmlnew/*
rm -rf doc/uml/html/*
rm -rf doc/uml/php/*
rm -rf doc/uml/xmi/*
mkdir -p doc/uml/xmi/auth-bundle
mkdir -p doc/uml/php/auth-bundle
mkdir -p doc/uml/html/auth-bundle
mkdir -p doc/uml/htmlnew/auth-bundle
mkdir -p doc/phpdocumentor/auth-bundle
mkdir -p web/phpdocumentor/auth-bundle
mkdir -p doc/phpmd/auth-bundle
mkdir -p doc/phpcpd/auth-bundle
phpuml vendor/sfynx-project/auth-bundle/Sfynx -n UMLsfynx_AUTH -o doc/uml/xmi
phpuml vendor/sfynx-project/auth-bundle/Sfynx -f php -o doc/uml/php/auth-bundle
phpuml vendor/sfynx-project/auth-bundle/Sfynx -f htmlnew -o doc/uml/htmlnew/auth-bundle
phpuml vendor/sfynx-project/auth-bundle/Sfynx -f html -o doc/uml/html/auth-bundle
phpdoc -d vendor/sfynx-project/auth-bundle/Sfynx -t doc/phpdocumentor --template responsive
cp -r doc/phpdocumentor/* web/phpdocumentor/
bin/phpmd vendor/sfynx-project/auth-bundle/Sfynx html unusedcode,codesize,design,naming > doc/phpmd/auth-bundle/report.html
bin/phpcpd vendor/sfynx-project/auth-bundle/Sfynx > doc/phpcpd/auth-bundle/report.txt
else
echo "Canceled"
fi