Skip to content
This repository was archived by the owner on Mar 6, 2025. It is now read-only.

Commit 1601f59

Browse files
authored
Symfony 3.4, php 7.2 upgrade (#4)
1 parent 6720cb2 commit 1601f59

File tree

11 files changed

+103
-19
lines changed

11 files changed

+103
-19
lines changed

install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ git clone https://github.com/os2display/docs.git docs
2525
git clone https://github.com/os2display/admin.git admin
2626
git clone https://github.com/os2display/middleware.git middleware
2727
git clone https://github.com/os2display/screen.git screen
28+
2829
cd ..

playbook.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
- hosts: all
33
become: true
44
vars:
5-
php_version: "5.6"
5+
php_version: "7.2"
66
es_version: "1.7.1"
77
mysql_root_password: "vagrant"
88
node_major_version: 6
@@ -19,13 +19,12 @@
1919
roles:
2020
- common
2121
- mysql
22+
- php72
2223
- nginx
23-
- php56
2424
- composer
2525
- nodejs
2626
- memcached
2727
- redis
2828
- java7
2929
- elasticsearch
3030
# - mariadb_server
31-
# - php72

readme.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ Initialize the search indexes:
5252
/vagrant/scripts/search_initialize.sh
5353
</pre>
5454

55+
Initialize the shared search indexes:
56+
57+
<pre>
58+
/vagrant/scripts/shared_search_initialize.sh
59+
</pre>
60+
5561
## Fake certificate errors in browser
5662
Since we use self-signed certificated in this vagrant setup, you will need to accept the certificates in the browser, by visiting:
5763

@@ -152,6 +158,6 @@ SSH Key: ~/.vagrant.d/insecure_private_key
152158
</pre>
153159

154160
# Logs
155-
* The middleware and search node have logs in their logs folders _/vagrant/htdocs/search_node/logs_ and _/vagrant/htdocs/middleware/logs_
156-
* Nginx have logs in _/var/log/nginx_
157-
* Supervisor logs in _/var/log/supervisor_
161+
* The middleware and search node have logs in their logs folders _/vagrant/htdocs/search_node/logs_ and _/vagrant/htdocs/middleware/logs_
162+
* Nginx have logs in _/var/log/nginx_
163+
* Supervisor logs in _/var/log/supervisor_

roles/php72/tasks/php.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,11 @@
2727
- name: Configure opcache
2828
template: src=opcache.ini.j2 dest=/etc/php/7.2/mods-available/opcache.ini backup=yes
2929
tags: php7
30+
31+
- name: Configure xdebug
32+
template: src=xdebug.ini.j2 dest=/etc/php/7.2/mods-available/xdebug.ini backup=yes
33+
tags: php72
34+
35+
- name: Configure Debug Script
36+
template: src=debug.j2 dest=/usr/bin/debug mode=0777
37+
tags: php72

roles/php72/templates/debug.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
# for Symfony apps use following
4+
env PHP_IDE_CONFIG="serverName={{ ansible_fqdn }}" XDEBUG_CONFIG="idekey=PHPSTORM" SYMFONY_DEBUG="1" $@

roles/php72/templates/xdebug.ini.j2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
zend_extension=xdebug.so
2+
xdebug.max_nesting_level=256
3+
xdebug.remote_enable=1
4+
xdebug.remote_handler=dbgp
5+
xdebug.remote_host=192.168.50.1
6+
xdebug.remote_port=9000
7+
xdebug.remote_autostart=0

roles/php72/vars/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
extensions: [ 'php7.2-readline', 'php7.2-gd', 'php7.2-mysqlnd', 'php7.2-curl', 'php7.2-dev', 'php-memcached', 'php7.2-xml', 'php7.2-mbstring', 'php7.2-sqlite3', 'php7.2-zip', 'php7.2-intl' ]
2+
extensions: [ 'php7.2-readline', 'php7.2-gd', 'php7.2-mysqlnd', 'php7.2-curl', 'php7.2-dev', 'php-memcached', 'php7.2-xml', 'php7.2-mbstring', 'php7.2-sqlite3', 'php7.2-zip', 'php7.2-intl', 'php7.2-xdebug' ]

scripts/dev_config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ rm -rf $dir/vendor/os2display
3939
# Install packages.
4040
cd $dir
4141
COMPOSER=$dir/composer-dev.json php -d memory_limit=-1 $COMPOSER_PATH install
42-
app/console assets:install --symlink --relative
42+
bin/console assets:install --symlink --relative
4343
cd ../..

scripts/dev_setup.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ cd packages
1212
mkdir os2display
1313
cd os2display
1414

15+
GIT_ORGANIZATION=os2display
16+
1517
function clone_latest {
16-
git clone --branch=master https://github.com/os2display/$1.git
18+
git clone --branch=master https://github.com/$GIT_ORGANIZATION/$1.git
1719

1820
# If you can use ssh access to the git repository, you can do this instead:
19-
# git clone --branch=master [email protected]:os2display/$1.git
21+
# git clone --branch=master [email protected]:$GIT_ORGANIZATION/$1.git
2022

2123
cd $1
2224

scripts/shared_search_initialize.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env bash
2+
bold=$(tput bold)
3+
normal=$(tput sgr0)
4+
5+
JSON_RESULT=$(curl -s "http://127.0.1.1:3010/authenticate" -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data @<(cat <<EOF
6+
{
7+
"apikey": "88cfd4b277f3f8b6c7c15d7a84784067"
8+
}
9+
EOF
10+
) 2>/dev/null)
11+
12+
TOKEN=$(echo $JSON_RESULT|php -r 'echo json_decode(fgets(STDIN))->token;')
13+
14+
function initialise_type {
15+
curl -s "http://127.0.1.1:3010/api" -H "Authorization: Bearer $TOKEN" -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data @<(cat <<EOF
16+
{
17+
"index":"$2",
18+
"type":"$1",
19+
"id":1,
20+
"data": {
21+
"name": "test",
22+
"user": 1,
23+
"created_at": 0
24+
}
25+
}
26+
EOF
27+
)
28+
29+
curl -s "http://127.0.1.1:3010/api" -H "Authorization: Bearer $TOKEN" -H "Accept: application/json" -H "Content-Type:application/json" -X DELETE --data @<(cat <<EOF
30+
{
31+
"index":"$2",
32+
"type":"$1",
33+
"id":1
34+
}
35+
EOF
36+
)
37+
}
38+
39+
arr="Os2Display\\\\CoreBundle\\\\Entity\\\\Slide
40+
Os2Display\\\\CoreBundle\\\\Entity\\\\Channel
41+
Os2Display\\\\CoreBundle\\\\Entity\\\\Screen
42+
Os2Display\\\\MediaBundle\\\\Entity\\\\Media"
43+
44+
indexes="bibshare
45+
itkdevshare"
46+
47+
for INDEX in $indexes
48+
do
49+
(
50+
for TYPE in $arr
51+
do
52+
(
53+
initialise_type $TYPE $INDEX
54+
)
55+
done
56+
)
57+
done

0 commit comments

Comments
 (0)