Skip to content

Commit

Permalink
add doctrine orm support
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisGalliano committed May 7, 2019
1 parent d2dd52d commit 98a3e97
Show file tree
Hide file tree
Showing 27 changed files with 1,941 additions and 88 deletions.
4 changes: 3 additions & 1 deletion .idea/composerJson.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,36 @@
6. Explore :)


---


# Gulp
## Watching changes
By default, gulp is running in production mode. The "watching changes" feature is available in developer mode.
If you want to run gulp in developer mode please add the following environment variable: `PION_EXMPL_DEBUG=1`.
If you want to run gulp in developer mode please add the following environment variable: `PION_EXMPL_DEBUG=1`.


# Docker
### most used commands
`docker-compose up --build` - build images & start containers.

`docker container ls` - show all containers (default shows just running).

`docker stop $(docker ps -q)` - stop all running containers.

`docker-compose stop` - stop all containers is current directory.

`docker rm $(docker ps -a -q -f status=exited)` - remove stopped containers.

`docker exec -it <container_id> bash` - get a bash shell in the container.


# Doctrine
# Command line tools
https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/tools.html#command-overview

### most used commands (should be executed inside php container)
`vendor/bin/doctrine orm:schema-tool:update --force` - processes the schema and update the database schema of EntityManager Storage Connection

### helpful guides
https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/getting-started.html
23 changes: 21 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
version: '3'

services:
mariadb:
image: mariadb:10.3
restart: always
volumes:
- ./mariadb:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: example_pwd

phpmyadmin:
image: phpmyadmin/phpmyadmin
links:
- mariadb:db
ports:
- 8021:81
environment:
MYSQL_ROOT_PASSWORD: example_pwd
depends_on:
- mariadb

php:
build:
context: ./
dockerfile: php/Dockerfile
volumes:
- ./web-app:/usr/share/nginx/html
depends_on:
- mariadb

composer:
image: composer/composer:php7
Expand All @@ -24,8 +45,6 @@ services:
volumes:
- ./web-app:/web-app
- ./gulp:/gulp
depends_on:
- php
environment:
- PION_EXMPL_DEBUG

Expand Down
Binary file added mariadb/aria_log.00000001
Binary file not shown.
Binary file added mariadb/aria_log_control
Binary file not shown.
197 changes: 197 additions & 0 deletions mariadb/ib_buffer_pool
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
7,2
4,3
4,2
4,1
4,0
3,6
3,5
3,4
3,3
3,2
3,1
3,0
2,2
1,2
0,322
0,243
1,1
1,3
1,0
7,1
7,3
7,0
2,1
2,3
2,0
0,9
0,310
0,305
0,308
0,304
0,303
0,302
0,307
0,12
0,10
0,8
0,0
0,300
0,299
0,298
0,297
0,296
0,295
0,294
0,293
0,292
0,291
0,290
0,289
0,288
0,287
0,286
0,285
0,284
0,283
0,282
0,281
0,280
0,279
0,278
0,277
0,276
0,275
0,274
0,273
0,272
0,271
0,270
0,269
0,268
0,267
0,266
0,265
0,264
0,263
0,262
0,261
0,260
0,259
0,258
0,257
0,256
0,255
0,254
0,253
0,252
0,251
0,250
0,249
0,248
0,247
0,246
0,245
0,244
0,242
0,241
0,240
0,239
0,238
0,237
0,236
0,235
0,234
0,233
0,232
0,231
0,230
0,229
0,228
0,227
0,226
0,225
0,224
0,223
0,222
0,221
0,220
0,219
0,218
0,217
0,216
0,215
0,214
0,213
0,212
0,211
0,210
0,209
0,208
0,207
0,206
0,205
0,204
0,203
0,202
0,333
0,201
0,332
0,200
0,331
0,199
0,330
0,198
0,329
0,197
0,196
0,328
0,195
0,194
0,193
0,192
0,327
0,63
0,326
0,62
0,325
0,61
0,323
0,60
0,321
0,59
0,324
0,58
0,57
0,320
0,56
0,319
0,55
0,318
0,54
0,317
0,53
0,316
0,52
0,315
0,51
0,314
0,50
0,313
0,49
0,312
0,48
0,311
0,47
0,309
0,46
0,306
0,45
0,301
0,6
0,5
0,1
0,11
0,4
0,2
0,3
0,7
Binary file added mariadb/ib_logfile0
Binary file not shown.
Binary file added mariadb/ib_logfile1
Binary file not shown.
Binary file added mariadb/ibdata1
Binary file not shown.
Binary file added mariadb/ibtmp1
Binary file not shown.
Empty file added mariadb/multi-master.info
Empty file.
Binary file added mariadb/tc.log
Binary file not shown.
21 changes: 21 additions & 0 deletions web-app/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Setup;

require __DIR__ . '/vendor/autoload.php';

define('ENV_IS_DEV_MODE', true);
define('ROOT_DIR', __DIR__);
define('SRC_DIR', __DIR__ . '/src');

/** @noinspection PhpUnhandledExceptionInspection */
$entityManager = EntityManager::create([
'driver' => 'pdo_mysql',
'user' => 'root',
'password' => 'example_pwd',
'dbname' => 'pion_example',
'host' => 'mariadb',
'db_port' => null,
'charset' => 'utf8',
], Setup::createAnnotationMetadataConfiguration([SRC_DIR], ENV_IS_DEV_MODE));
7 changes: 7 additions & 0 deletions web-app/cli-config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

use Doctrine\ORM\Tools\Console\ConsoleRunner;

require_once 'bootstrap.php';

return ConsoleRunner::createHelperSet($entityManager);
5 changes: 4 additions & 1 deletion web-app/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
}
},
"require-dev": {
"roave/security-advisories": "dev-master",
"filp/whoops": "2.3.1"
},
"require": {
"chrisgalliano/pion": "^1.0.0"
"chrisgalliano/pion": "^1.0.0",
"doctrine/orm": "^2.6.2",
"symfony/yaml": "2.*"
}
}
Loading

0 comments on commit 98a3e97

Please sign in to comment.