Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 343d66a7

Přidáno uživatelem Tomáš Ballák před asi 4 roky(ů)

new changes

Zobrazit rozdíly:

build/php-fpm/dev/Dockerfile
25 25
    docker-php-ext-enable xdebug && \
26 26
    apk del --purge autoconf g++ make
27 27
RUN echo zend_extension="$(find / -name 'xdebug.so')" >> /etc/php7/conf.d/xdebug.ini
28
RUN echo -e "\n" >> /usr/local/etc/php/php.ini-development
29
RUN echo -e "\n" >> /usr/local/etc/php/php.ini-production
30
RUN echo -e "extension=mongodb.so" >> /usr/local/etc/php/php.ini-development
31
RUN echo -e "extension=mongodb.so" >> /usr/local/etc/php/php.ini-production
website/composer.json
7 7
        "php": "^7.2.5",
8 8
        "ext-ctype": "*",
9 9
        "ext-iconv": "*",
10
        "alcaeus/mongo-php-adapter": "^1.1",
11
        "doctrine/mongodb-odm": "^2.0",
10 12
        "doctrine/mongodb-odm-bundle": "^4.1",
11 13
        "symfony/console": "5.0.*",
12 14
        "symfony/dotenv": "5.0.*",
......
22 24
        "preferred-install": {
23 25
            "*": "dist"
24 26
        },
25
        "sort-packages": true
27
        "sort-packages": true,
28
        "platform": {
29
            "ext-mongo": "1.6.16"
30
        }
26 31
    },
27 32
    "autoload": {
28 33
        "psr-4": {
website/composer.lock
4 4
        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5 5
        "This file is @generated automatically"
6 6
    ],
7
    "content-hash": "89f5356e79d07af8f66a1d7aa412c992",
7
    "content-hash": "c3005e8bd1ce383e1ee58d624e0eb875",
8 8
    "packages": [
9
        {
10
            "name": "alcaeus/mongo-php-adapter",
11
            "version": "1.1.11",
12
            "source": {
13
                "type": "git",
14
                "url": "https://github.com/alcaeus/mongo-php-adapter.git",
15
                "reference": "43b6add94c8b4cb9890d662cba4c0defde733dcf"
16
            },
17
            "dist": {
18
                "type": "zip",
19
                "url": "https://api.github.com/repos/alcaeus/mongo-php-adapter/zipball/43b6add94c8b4cb9890d662cba4c0defde733dcf",
20
                "reference": "43b6add94c8b4cb9890d662cba4c0defde733dcf",
21
                "shasum": ""
22
            },
23
            "require": {
24
                "ext-ctype": "*",
25
                "ext-hash": "*",
26
                "ext-mongodb": "^1.2.0",
27
                "mongodb/mongodb": "^1.0.1",
28
                "php": "^5.6 || ^7.0"
29
            },
30
            "provide": {
31
                "ext-mongo": "1.6.14"
32
            },
33
            "require-dev": {
34
                "phpunit/phpunit": "^5.7.27 || ^6.0 || ^7.0",
35
                "squizlabs/php_codesniffer": "^3.2"
36
            },
37
            "type": "library",
38
            "extra": {
39
                "branch-alias": {
40
                    "dev-master": "1.1.x-dev"
41
                }
42
            },
43
            "autoload": {
44
                "psr-0": {
45
                    "Mongo": "lib/Mongo"
46
                },
47
                "psr-4": {
48
                    "Alcaeus\\MongoDbAdapter\\": "lib/Alcaeus/MongoDbAdapter"
49
                },
50
                "files": [
51
                    "lib/Mongo/functions.php"
52
                ]
53
            },
54
            "notification-url": "https://packagist.org/downloads/",
55
            "license": [
56
                "MIT"
57
            ],
58
            "authors": [
59
                {
60
                    "name": "alcaeus",
61
                    "email": "alcaeus@alcaeus.org"
62
                },
63
                {
64
                    "name": "Olivier Lechevalier",
65
                    "email": "olivier.lechevalier@gmail.com"
66
                }
67
            ],
68
            "description": "Adapter to provide ext-mongo interface on top of mongo-php-libary",
69
            "keywords": [
70
                "database",
71
                "mongodb"
72
            ],
73
            "time": "2019-11-11T20:47:32+00:00"
74
        },
9 75
        {
10 76
            "name": "doctrine/annotations",
11 77
            "version": "1.10.1",
......
3879 3945
        "ext-iconv": "*"
3880 3946
    },
3881 3947
    "platform-dev": [],
3948
    "platform-overrides": {
3949
        "ext-mongo": "1.6.16"
3950
    },
3882 3951
    "plugin-api-version": "1.1.0"
3883 3952
}
website/config/packages/doctrine_mongodb.yaml
7 7
            options: 
8 8
                username: root
9 9
                password: root
10
                authSource: test
11 10
    default_database: '%env(resolve:MONGODB_DB)%'
12 11
    document_managers:
13 12
        default:
website/src/Controller/IndexController.php
7 7
use Symfony\Component\HttpFoundation\Response;
8 8
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
9 9

  
10
class IndexController extends AbstractController {
11
    public function index(DocumentManager $dm): Response {
10
class IndexController extends AbstractController
11
{
12
    public function index(DocumentManager $dm): Response
13
    {
12 14
        $number = random_int(0, 100);
13

  
15
        $test = new Test();
16
        $test->setName('A Foo Bar');
17
    
18
        $dm->persist($test);
19
        $dm->flush();
14 20
        $test = $dm->getRepository(Test::class)->findAll();
15

  
16 21
        return new Response(
17
            '<html><body>Lucky number: '.$number.'</body></html>'
22
            '<html><body>Lucky number: '. ($test ? 'not null' : 'null') .'</body></html>'
18 23
        );
19 24
    }
20 25
}
website/src/Document/Test.php
17 17
     * @MongoDB\Field(type="string")
18 18
     */
19 19
    protected $name;
20

  
21
    public function setName(string $name) {
22
        $this->name = $name;
23
    }
24

  
25
    public function getName(): string {
26
        return $this->name;
27
    }
20 28
}
website/symfony.lock
1 1
{
2
    "alcaeus/mongo-php-adapter": {
3
        "version": "1.1.11"
4
    },
2 5
    "composer/semver": {
3 6
        "version": "1.5.1"
4 7
    },

Také k dispozici: Unified diff