https://github.com/fadilxcoder/sf6-sqlite-mongodb
Symfony 6 - SQLite - MongDB
https://github.com/fadilxcoder/sf6-sqlite-mongodb
docker graphql-client mongodb sqlite symfony xdebug
Last synced: about 2 months ago
JSON representation
Symfony 6 - SQLite - MongDB
- Host: GitHub
- URL: https://github.com/fadilxcoder/sf6-sqlite-mongodb
- Owner: fadilxcoder
- Created: 2023-03-02T18:34:54.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-18T19:05:55.000Z (almost 3 years ago)
- Last Synced: 2025-02-28T20:40:26.928Z (about 1 year ago)
- Topics: docker, graphql-client, mongodb, sqlite, symfony, xdebug
- Language: PHP
- Homepage:
- Size: 186 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Notes
- URL : `http://127.0.0.1:8881/`
- Profiler : `http://127.0.0.1:8881/_profiler`
- Permission issues on cache repo : `chown -R root:root var/cache/`
- Forcing cache clear : `rm -rf ./src/var/cache/dev/`
- MongoUI : `http://localhost:4321/`
- CLI
- - `php bin/console dba:cache:init`
- - `php bin/console app:mongo:init clear`
- - `php bin/console app:mongo:find`
- - `php bin/console app:mongo:find 645e6f7d0429d100de0c5a77`
- - `php bin/console app:graphql:query`
## MongoDB
- `docker-compose.yml` - added `mongo-db` & `mongo-gui`
- `Dockerfile` - php extension : `mongodb`
- Install composer package : `composer require doctrine/mongodb-odm-bundle`
- `AppController` - Persisting in MongoDB
```php
public function index(DocumentManager $dm): JsonResponse
{
$product = new Product();
$product
->setName('A Foo Bar')
->setPrice('19.99')
;
$dm->persist($product);
$dm->flush();
...
```
## DBA
- Pak8ge : `https://github.com/fadilxcoder/dba-php-packagist.git`
---
## Xdebug / VS Code
```
zend_extension=xdebug
[xdebug]
xdebug.mode=develop,debug
xdebug.client_host=host.docker.internal
xdebug.start_with_request=yes
```
- `docker-compose.yml`
```
extra_hosts:
- "host.docker.internal:host-gateway"
```
- `launch.json`
```
{
"version": "0.2.0",
"configurations": [
{
"name": "Xdebug Symfony MVP",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/html/": "${workspaceFolder}/src/"
}
}
]
}
```