Fixed merge conflict.

pull/202/head
Cédric Bonhomme 2019-10-31 11:58:42 +01:00
commit 0cc498dcb9
No known key found for this signature in database
GPG Key ID: A1CB94DE57B7A70D
17 changed files with 170 additions and 327 deletions

1
.gitignore vendored
View File

@ -16,6 +16,7 @@ public/js/
public/img/
public/flags/
public/views/
scripts/public
module/
npm-debug.log
node_modules/

View File

@ -69,10 +69,10 @@ Clone the repository and invoke composer
Backend
$ mkdir module
$ cd module/
$ ln -s ./../vendor/monarc/core Monarc\Core
$ ln -s ./../vendor/monarc/frontoffice Monarc\FrontOffice
$ cd module/Monarc
$ ln -s ./../../vendor/monarc/core Core
$ ln -s ./../../vendor/monarc/frontoffice FrontOffice
$ cd ../..
Frontend
@ -128,4 +128,4 @@ Set file ownership for monarc installation
Header always set X-Frame-Options SAMEORIGIN
</IfModule>
SetEnv APPLICATION_ENV "development"
SetEnv APP_ENV "development"

View File

@ -49,7 +49,7 @@ Especially by setting a strong root password.
Header always set X-Frame-Options SAMEORIGIN
</IfModule>
SetEnv APPLICATION_ENV "development"
SetEnv APP_ENV "development"
</VirtualHost>
@ -88,10 +88,10 @@ You must create modules with symbolic links to libraries.
Create two symbolic links:
$ mkdir module
$ cd module/
$ ln -s ./../vendor/monarc/core Monarc/Core
$ ln -s ./../vendor/monarc/frontoffice Monarc/FrontOffice
$ cd module/Monarc
$ ln -s ./../../vendor/monarc/core Core
$ ln -s ./../../vendor/monarc/frontoffice FrontOffice
$ cd ../..
There are 2 parts:

View File

@ -50,7 +50,7 @@ Especially by setting a strong root password.
Header always set X-Frame-Options SAMEORIGIN
</IfModule>
SetEnv APPLICATION_ENV production
SetEnv APP_ENV "development"
</VirtualHost>
@ -84,10 +84,10 @@ The back-end is using the Zend Framework 3.
Create two symbolic links:
$ mkdir module
$ cd module/
$ ln -s ./../vendor/monarc/core Monarc/Core
$ ln -s ./../vendor/monarc/frontoffice Monarc/FrontOffice
$ cd module/Monarc
$ ln -s ./../../vendor/monarc/core Core
$ ln -s ./../../vendor/monarc/frontoffice FrontOffice
$ cd ../..
There are 2 parts:

View File

@ -18,7 +18,6 @@
"monarc/core": "dev-feature/upgrade-to-zf3",
"monarc/frontoffice": "dev-feature/upgrade-to-zf3",
"monarc/phpword": "dev-master",
"zendframework/zend-component-installer": "^2.1",
"zendframework/zend-mvc": "^3.1",
"zendframework/zend-di": "^3.1",
"zendframework/zend-permissions-rbac": "^3.0",
@ -26,7 +25,8 @@
"zendframework/zend-i18n": "^2.9"
},
"require-dev": {
"roave/security-advisories": "dev-master"
"roave/security-advisories": "dev-master",
"zendframework/zend-component-installer": "^2.1"
},
"config": {
"bin-dir": "bin/"

187
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "067fa4026b84e73549b355eab7b79e8c",
"content-hash": "9b89601d661994ac8c683fe67996c859",
"packages": [
{
"name": "cakephp/cache",
@ -443,16 +443,16 @@
},
{
"name": "doctrine/cache",
"version": "v1.8.0",
"version": "v1.8.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "d768d58baee9a4862ca783840eca1b9add7a7f57"
"reference": "d4374ae95b36062d02ef310100ed33d78738d76c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/d768d58baee9a4862ca783840eca1b9add7a7f57",
"reference": "d768d58baee9a4862ca783840eca1b9add7a7f57",
"url": "https://api.github.com/repos/doctrine/cache/zipball/d4374ae95b36062d02ef310100ed33d78738d76c",
"reference": "d4374ae95b36062d02ef310100ed33d78738d76c",
"shasum": ""
},
"require": {
@ -487,6 +487,10 @@
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
@ -495,10 +499,6 @@
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
@ -514,7 +514,7 @@
"cache",
"caching"
],
"time": "2018-08-21T18:01:43+00:00"
"time": "2019-10-28T09:31:32+00:00"
},
{
"name": "doctrine/collections",
@ -1448,12 +1448,12 @@
"source": {
"type": "git",
"url": "https://github.com/monarc-project/zm-core.git",
"reference": "d0f105d87a0833aa1a89e934815b7717c74c95e7"
"reference": "ff88326a7365bbb952ce7f90454938a727d6276e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/monarc-project/zm-core/zipball/d0f105d87a0833aa1a89e934815b7717c74c95e7",
"reference": "d0f105d87a0833aa1a89e934815b7717c74c95e7",
"url": "https://api.github.com/repos/monarc-project/zm-core/zipball/ff88326a7365bbb952ce7f90454938a727d6276e",
"reference": "ff88326a7365bbb952ce7f90454938a727d6276e",
"shasum": ""
},
"require": {
@ -1519,7 +1519,7 @@
}
],
"description": "Core for monarc/monarc application",
"time": "2019-10-17T14:21:57+00:00"
"time": "2019-10-28T12:21:56+00:00"
},
{
"name": "monarc/frontoffice",
@ -1527,12 +1527,12 @@
"source": {
"type": "git",
"url": "https://github.com/monarc-project/zm-client.git",
"reference": "87fa5f87b5215ce13e41b1f9ba6e61fb2875490a"
"reference": "d9bd6e39f02d0238712502e9e81337b6e659d369"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/monarc-project/zm-client/zipball/87fa5f87b5215ce13e41b1f9ba6e61fb2875490a",
"reference": "87fa5f87b5215ce13e41b1f9ba6e61fb2875490a",
"url": "https://api.github.com/repos/monarc-project/zm-client/zipball/d9bd6e39f02d0238712502e9e81337b6e659d369",
"reference": "d9bd6e39f02d0238712502e9e81337b6e659d369",
"shasum": ""
},
"require": {
@ -1577,7 +1577,7 @@
}
],
"description": "Frontoffice for monarc/monarc application",
"time": "2019-10-18T06:00:52+00:00"
"time": "2019-10-28T10:33:23+00:00"
},
{
"name": "monarc/phpword",
@ -2036,16 +2036,16 @@
},
{
"name": "psr/log",
"version": "1.1.0",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd"
"reference": "bf73deb2b3b896a9d9c75f3f0d88185d2faa27e2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
"reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
"url": "https://api.github.com/repos/php-fig/log/zipball/bf73deb2b3b896a9d9c75f3f0d88185d2faa27e2",
"reference": "bf73deb2b3b896a9d9c75f3f0d88185d2faa27e2",
"shasum": ""
},
"require": {
@ -2054,7 +2054,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "1.1.x-dev"
}
},
"autoload": {
@ -2079,7 +2079,7 @@
"psr",
"psr-3"
],
"time": "2018-11-20T15:27:04+00:00"
"time": "2019-10-25T08:06:51+00:00"
},
{
"name": "psr/simple-cache",
@ -3070,58 +3070,6 @@
],
"time": "2019-10-05T23:18:22+00:00"
},
{
"name": "zendframework/zend-component-installer",
"version": "2.1.2",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-component-installer.git",
"reference": "56871c43e40f92324b25d5a4d50ff51f9f556910"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-component-installer/zipball/56871c43e40f92324b25d5a4d50ff51f9f556910",
"reference": "56871c43e40f92324b25d5a4d50ff51f9f556910",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0",
"php": "^7.1"
},
"require-dev": {
"composer/composer": "^1.5.2",
"malukenho/docheader": "^0.1.6",
"mikey179/vfsstream": "^1.6.7",
"phpunit/phpunit": "^7.5.15 || ^8.3.4",
"zendframework/zend-coding-standard": "~1.0.0"
},
"type": "composer-plugin",
"extra": {
"branch-alias": {
"dev-master": "2.1.x-dev",
"dev-develop": "2.2.x-dev"
},
"class": "Zend\\ComponentInstaller\\ComponentInstaller"
},
"autoload": {
"psr-4": {
"Zend\\ComponentInstaller\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"description": "Composer plugin for injecting modules and configuration providers into application configuration",
"keywords": [
"ZendFramework",
"component installer",
"composer",
"plugin",
"zf"
],
"time": "2019-09-04T19:10:43+00:00"
},
{
"name": "zendframework/zend-config",
"version": "3.3.0",
@ -4058,16 +4006,16 @@
},
{
"name": "zendframework/zend-modulemanager",
"version": "2.8.2",
"version": "2.8.4",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-modulemanager.git",
"reference": "394df6e12248ac430a312d4693f793ee7120baa6"
"reference": "b2596d24b9a4e36a3cd114d35d3ad0918db9a243"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-modulemanager/zipball/394df6e12248ac430a312d4693f793ee7120baa6",
"reference": "394df6e12248ac430a312d4693f793ee7120baa6",
"url": "https://api.github.com/repos/zendframework/zend-modulemanager/zipball/b2596d24b9a4e36a3cd114d35d3ad0918db9a243",
"reference": "b2596d24b9a4e36a3cd114d35d3ad0918db9a243",
"shasum": ""
},
"require": {
@ -4077,7 +4025,7 @@
"zendframework/zend-stdlib": "^3.1 || ^2.7"
},
"require-dev": {
"phpunit/phpunit": "^6.0.8 || ^5.7.15",
"phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.16",
"zendframework/zend-coding-standard": "~1.0.0",
"zendframework/zend-console": "^2.6",
"zendframework/zend-di": "^2.6",
@ -4094,8 +4042,8 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev",
"dev-develop": "2.8-dev"
"dev-master": "2.8.x-dev",
"dev-develop": "2.9.x-dev"
}
},
"autoload": {
@ -4108,13 +4056,12 @@
"BSD-3-Clause"
],
"description": "Modular application system for zend-mvc applications",
"homepage": "https://github.com/zendframework/zend-modulemanager",
"keywords": [
"ZendFramework",
"modulemanager",
"zf"
],
"time": "2017-12-02T06:11:18+00:00"
"time": "2019-10-28T13:29:38+00:00"
},
{
"name": "zendframework/zend-mvc",
@ -4639,16 +4586,16 @@
},
{
"name": "zendframework/zend-validator",
"version": "2.12.1",
"version": "2.12.2",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-validator.git",
"reference": "7b870a7515f3a35afbecc39d63f34a861f40f58b"
"reference": "fd24920c2afcf2a70d11f67c3457f8f509453a62"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-validator/zipball/7b870a7515f3a35afbecc39d63f34a861f40f58b",
"reference": "7b870a7515f3a35afbecc39d63f34a861f40f58b",
"url": "https://api.github.com/repos/zendframework/zend-validator/zipball/fd24920c2afcf2a70d11f67c3457f8f509453a62",
"reference": "fd24920c2afcf2a70d11f67c3457f8f509453a62",
"shasum": ""
},
"require": {
@ -4708,7 +4655,7 @@
"validator",
"zf"
],
"time": "2019-10-12T12:17:57+00:00"
"time": "2019-10-29T08:33:25+00:00"
},
{
"name": "zendframework/zend-view",
@ -4805,12 +4752,12 @@
"source": {
"type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git",
"reference": "eb59d9f35a47f567ae15e7179d7c666489cd4b85"
"reference": "f8c8349a4b12a26edfa8b21d07d3dbeb6dcedcfa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/eb59d9f35a47f567ae15e7179d7c666489cd4b85",
"reference": "eb59d9f35a47f567ae15e7179d7c666489cd4b85",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/f8c8349a4b12a26edfa8b21d07d3dbeb6dcedcfa",
"reference": "f8c8349a4b12a26edfa8b21d07d3dbeb6dcedcfa",
"shasum": ""
},
"conflict": {
@ -5013,7 +4960,59 @@
}
],
"description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
"time": "2019-10-09T14:04:58+00:00"
"time": "2019-10-29T22:11:03+00:00"
},
{
"name": "zendframework/zend-component-installer",
"version": "2.1.2",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-component-installer.git",
"reference": "56871c43e40f92324b25d5a4d50ff51f9f556910"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-component-installer/zipball/56871c43e40f92324b25d5a4d50ff51f9f556910",
"reference": "56871c43e40f92324b25d5a4d50ff51f9f556910",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0",
"php": "^7.1"
},
"require-dev": {
"composer/composer": "^1.5.2",
"malukenho/docheader": "^0.1.6",
"mikey179/vfsstream": "^1.6.7",
"phpunit/phpunit": "^7.5.15 || ^8.3.4",
"zendframework/zend-coding-standard": "~1.0.0"
},
"type": "composer-plugin",
"extra": {
"branch-alias": {
"dev-master": "2.1.x-dev",
"dev-develop": "2.2.x-dev"
},
"class": "Zend\\ComponentInstaller\\ComponentInstaller"
},
"autoload": {
"psr-4": {
"Zend\\ComponentInstaller\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"description": "Composer plugin for injecting modules and configuration providers into application configuration",
"keywords": [
"ZendFramework",
"component installer",
"composer",
"plugin",
"zf"
],
"time": "2019-09-04T19:10:43+00:00"
}
],
"aliases": [],

View File

@ -11,6 +11,7 @@
* file.
*/
use Doctrine\DBAL\Driver\PDOMySql\Driver;
use Monarc\Core\Service\DoctrineCacheServiceFactory;
use Monarc\Core\Service\DoctrineLoggerFactory;
@ -32,7 +33,7 @@ return array(
'doctrine' => array(
'connection' => array(
'orm_default' => array(
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
'driverClass' => Driver::class,
'params' => array(
'host' => 'localhost',
'port' => 3306,
@ -48,7 +49,7 @@ return array(
),
),
'orm_cli' => array(
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
'driverClass' => Driver::class,
'params' => array(
'host' => 'localhost',
'port' => 3306,

View File

@ -1,18 +0,0 @@
#!/bin/bash
checkout_if_exists() {
if [ -d $1 ]; then
pushd $1 >/dev/null
git checkout $2
popd >/dev/null
fi
}
checkout_if_exists . $1
checkout_if_exists module/Monarc/Core $1
checkout_if_exists module/Monarc/BackOffice $1
checkout_if_exists module/Monarc/FrontOffice $1
checkout_if_exists node_modules/ng_backoffice $1
checkout_if_exists node_modules/ng_client $1
checkout_if_exists node_modules/ng_anr $1

View File

@ -1,19 +1,5 @@
#!/bin/bash
if [ -d node_modules/ng_backoffice ]; then
pushd node_modules/ng_backoffice
grunt compile_translations
grunt concat
if [ -d po ]; then
for i in $(ls po/*\.po); do
l=$(basename $i .po)
msgfmt -o ./po/$l.mo -v ./po/$l.po
done;
fi
fi
if [ -d node_modules/ng_client ]; then
pushd node_modules/ng_client
grunt compile_translations
grunt concat
@ -24,4 +10,3 @@ if [ -d node_modules/ng_client ]; then
msgfmt -o ./po/$l.mo -v ./po/$l.po
done;
fi
fi

View File

@ -1,17 +1,5 @@
#!/bin/bash
if [ -d node_modules/ng_backoffice ]; then
pushd node_modules/ng_backoffice
if [ -f node_modules/.bin/grunt ]; then
node_modules/.bin/grunt extract_translations
else
grunt extract_translations
fi
fi
if [ -d node_modules/ng_client ]; then
pushd node_modules/ng_client
if [ -f node_modules/.bin/grunt ]; then
@ -19,4 +7,3 @@ if [ -d node_modules/ng_client ]; then
else
grunt extract_translations
fi
fi

View File

@ -37,41 +37,7 @@ else
find -L public/img -type l -exec rm {} \;
fi
# Link modules resources
if [ -d node_modules/ng_backoffice ]; then
cd public/views/ && find ../../node_modules/ng_backoffice/views -maxdepth 1 -name "*.html" -exec ln -s {} \; 2>/dev/null
cd dialogs/ && find ../../../node_modules/ng_backoffice/views/dialogs -maxdepth 1 -name "*.html" -exec ln -s {} \; 2>/dev/null
cd ../partials/ && find ../../../node_modules/ng_backoffice/views/partials -maxdepth 1 -name "*.html" -exec ln -s {} \; 2>/dev/null
cd ../../js/ && find ../../node_modules/ng_backoffice/src -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null
cd ../css/ && find ../../node_modules/ng_backoffice/css -name "*" -exec ln -s {} \; 2>/dev/null
cd ../img/ && find ../../node_modules/ng_backoffice/img -name "*" -exec ln -s {} \; 2>/dev/null
cd ../flags/ && find ../../node_modules/ng_backoffice/node_modules/ng-country-flags/dist/flags -mindepth 1 -type d -exec ln -s {} \; 2>/dev/null
if [ -d ../../node_modules/ng_anr ]; then
cd ../js/
mkdir -p anr
cd anr && find ../../../node_modules/ng_anr/src -type f -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null
cd ..
cd ../views/
mkdir -p anr
cd anr && find ../../../node_modules/ng_anr/views -type f -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null
cd ..
cd ../css/
mkdir -p anr
cd anr && find ../../../node_modules/ng_anr/css -type f -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null
cd ..
fi
cd ../..
pushd node_modules/ng_backoffice
grunt concat
popd
fi
if [ -d node_modules/ng_client ]; then
# Link modules resources. TODO: Replace with Grunt tasks to minify the JS and CSS.
cd public/views/ && find ../../node_modules/ng_client/views -name "*.html" -exec ln -s {} \; 2>/dev/null
cd dialogs/ && find ../../../node_modules/ng_client/views/dialogs -maxdepth 1 -name "*.html" -exec ln -s {} \; 2>/dev/null
cd ../../js/ && find ../../node_modules/ng_client/src -name "*" -exec ln -s {} \; 2>/dev/null
@ -79,7 +45,6 @@ if [ -d node_modules/ng_client ]; then
cd ../img/ && find ../../node_modules/ng_client/img -name "*" -exec ln -s {} \; 2>/dev/null
cd ../flags/ && find ../../node_modules/ng_client/node_modules/ng-country-flags/dist/flags -mindepth 1 -type d -exec ln -s {} \; 2>/dev/null
if [ -d ../../node_modules/ng_anr ]; then
cd ../js/
mkdir -p anr
cd anr && find ../../../node_modules/ng_anr/src -type f -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null
@ -94,11 +59,9 @@ if [ -d node_modules/ng_client ]; then
mkdir -p anr
cd anr && find ../../../node_modules/ng_anr/css -type f -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null
cd ..
fi
cd ../..
pushd node_modules/ng_client
grunt concat
popd
fi

View File

@ -1,12 +0,0 @@
#!/bin/bash
npm install
cd node_modules/ng_backoffice
npm install
cd ../..
# Compile stuff needed for the minified frontend
./scripts/compile_translations.sh
./scripts/link_modules_resources.sh

View File

@ -1,14 +1,5 @@
#!/bin/bash
if [ -d module/Monarc/Core ]; then
php ./vendor/robmorgan/phinx/bin/phinx seed:run -c ./module/Monarc/Core/migrations/phinx.php
fi
if [ -d module/Monarc/BackOffice ]; then
php ./vendor/robmorgan/phinx/bin/phinx seed:run -c ./module/Monarc/BackOffice/migrations/phinx.php
fi
if [ -d module/Monarc/FrontOffice ]; then
php ./vendor/robmorgan/phinx/bin/phinx seed:run -c ./module/Monarc/FrontOffice/migrations/phinx.php
fi

View File

@ -108,18 +108,6 @@ else
pathFO="vendor/monarc/frontoffice"
fi
if [[ -d node_modules && -d node_modules/ng_anr ]]; then
if [[ -d node_modules/ng_anr/.git ]]; then
pull_if_exists node_modules/ng_backoffice
pull_if_exists node_modules/ng_client
pull_if_exists node_modules/ng_anr
else
npm update
fi
else
npm install
fi
if [[ $bypass -eq 0 ]]; then
if [ -e data/backup/credentialsmysql.cnf ]; then
backupdir=data/backup/$(date +"%Y%m%d_%H%M%S")
@ -136,17 +124,9 @@ if [[ $bypass -eq 0 ]]; then
migrate_module $phpcommand $pathFO
fi
if [ -d node_modules/ng_backoffice ]; then
cd node_modules/ng_backoffice
npm install
cd ../..
fi
if [ -d node_modules/ng_client ]; then
cd node_modules/ng_client
npm install
cd ../..
fi
./scripts/link_modules_resources.sh
./scripts/compile_translations.sh

View File

@ -2,10 +2,4 @@
php ./vendor/robmorgan/phinx/bin/phinx migrate -c ./module/Monarc/Core/migrations/phinx.php
if [ -d module/Monarc/BackOffice ]; then
php ./vendor/robmorgan/phinx/bin/phinx migrate -c ./module/Monarc/BackOffice/migrations/phinx.php
fi
if [ -d module/Monarc/FrontOffice ]; then
php ./vendor/robmorgan/phinx/bin/phinx migrate -c ./module/Monarc/FrontOffice/migrations/phinx.php
fi

View File

@ -14,6 +14,5 @@ oldurl_if_exists . $1
oldurl_if_exists module/Monarc/Core $1
oldurl_if_exists module/Monarc/BackOffice $1
oldurl_if_exists module/Monarc/FrontOffice $1
oldurl_if_exists node_modules/ng_backoffice $1
oldurl_if_exists node_modules/ng_client $1
oldurl_if_exists node_modules/ng_anr $1

View File

@ -1,8 +1,8 @@
#! /usr/bin/env bash
TAG=''
PATH_TO_MONARC='/home/ubuntu/monarc'
APPENV='local'
ENVIRONMENT='development'
DBHOST='localhost'
@ -30,22 +30,16 @@ locale-gen en_US.UTF-8
dpkg-reconfigure locales
echo -e "\n--- Installing now… ---\n"
echo -e "\n--- Updating packages list… ---\n"
apt-get update
apt-get update && apt-get upgrade
echo -e "\n--- Install base packages… ---\n"
apt-get -y install vim zip unzip git gettext curl gsfonts > /dev/null
echo -e "\n--- Install MariaDB specific packages and settings… ---\n"
# echo "mysql-server mysql-server/root_password password $DBPASSWORD_ADMIN" | debconf-set-selections
# echo "mysql-server mysql-server/root_password_again password $DBPASSWORD_ADMIN" | debconf-set-selections
apt-get -y install mariadb-server mariadb-client > /dev/null
# Secure the MariaDB installation (especially by setting a strong root password)
systemctl restart mariadb.service > /dev/null
@ -73,7 +67,7 @@ expect -f - <<-EOF
send -- "y\r"
expect eof
EOF
sudo apt-get purge -y expect > /dev/null 2>&1
sudo apt-get purge -y expect php-xdebug > /dev/null 2>&1
echo -e "\n--- Configuring… ---\n"
sed -i "s/skip-external-locking/#skip-external-locking/g" $MARIA_DB_CFG
@ -83,9 +77,7 @@ echo -e "\n--- Setting up our MariaDB user for MONARC… ---\n"
mysql -u root -p$DBPASSWORD_ADMIN -e "CREATE USER '$DBUSER_MONARC'@'%' IDENTIFIED BY '$DBPASSWORD_MONARC';"
mysql -u root -p$DBPASSWORD_ADMIN -e "GRANT ALL PRIVILEGES ON * . * TO '$DBUSER_MONARC'@'%';"
mysql -u root -p$DBPASSWORD_ADMIN -e "FLUSH PRIVILEGES;"
systemctl restart mariadb.service > /dev/null
echo -e "\n--- Installing PHP-specific packages… ---\n"
apt-get -y install php apache2 libapache2-mod-php php-curl php-gd php-mysql php-pear php-apcu php-xml php-mbstring php-intl php-imagick php-zip php-xdebug > /dev/null
@ -98,6 +90,7 @@ done
echo -e "\n--- Configuring Xdebug for development ---\n"
cat > $X_DEBUG_CFG <<EOF
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.idekey=IDEKEY
@ -111,12 +104,6 @@ a2enmod headers > /dev/null 2>&1
echo -e "\n--- Allowing Apache override to all ---\n"
sudo sed -i "s/AllowOverride None/AllowOverride All/g" /etc/apache2/apache2.conf
#echo -e "\n--- We want to see the PHP errors, turning them on ---\n"
#sed -i "s/.*error_reporting.*/error_reporting = E_ALL/g" $PHP_INI
#sed -i "s/.*display_errors.*/display_errors = On/g" $PHP_INI
echo -e "\n--- Installing composer… ---\n"
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer > /dev/null 2>&1
@ -126,28 +113,16 @@ if [ $? -ne 0 ]; then
fi
composer self-update
echo -e "\n--- Installing MONARC… ---\n"
cd $PATH_TO_MONARC
git config core.fileMode false
if [ "$TAG" != '' ]; then
# Checkout the latest tag
#latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $TAG
fi
echo -e "\n--- Retrieving MONARC libraries… ---\n"
# Back-end
echo -e "\n--- Installing the dependencies… ---\n"
composer install -o
mkdir -p module/Monarc/Proxy
mkdir -p data/cache
mkdir -p data/LazyServices/Proxy
# Make modules symlinks.
mkdir -p module/Monarc
cd module/Monarc
ln -s ./../../vendor/monarc/core Core
ln -s ./../../vendor/monarc/frontoffice FrontOffice
@ -157,12 +132,12 @@ cd $PATH_TO_MONARC
# Front-end
mkdir node_modules
cd node_modules
git clone https://github.com/monarc-project/ng-client.git ng_client > /dev/null 2>&1
git clone --config core.fileMode=false https://github.com/monarc-project/ng-client.git ng_client > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "\nERROR: unable to clone the ng-client repository\n"
exit 1;
fi
git clone https://github.com/monarc-project/ng-anr.git ng_anr > /dev/null 2>&1
git clone --config core.fileMode=false https://github.com/monarc-project/ng-anr.git ng_anr > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "\nERROR: unable to clone the ng-anr repository\n"
exit 1;
@ -174,8 +149,6 @@ chgrp -R www-data $PATH_TO_MONARC
chmod -R 700 $PATH_TO_MONARC
echo -e "\n--- Add a VirtualHost for MONARC ---\n"
cat > /etc/apache2/sites-enabled/000-default.conf <<EOF
<VirtualHost *:80>
@ -195,7 +168,7 @@ cat > /etc/apache2/sites-enabled/000-default.conf <<EOF
Header always set X-Frame-Options SAMEORIGIN
</IfModule>
SetEnv APPLICATION_ENV $ENVIRONMENT
SetEnv APP_ENV $ENVIRONMENT
SetEnv APP_DIR $PATH_TO_MONARC
</VirtualHost>
EOF