Просмотр исходного кода

Add initial set of files

master
Evgeniy Ierusalimov 1 год назад
Сommit
39b2f4aba0

+ 20
- 0
.env Просмотреть файл

@@ -0,0 +1,20 @@
1
+# In all environments, the following files are loaded if they exist,
2
+# the latter taking precedence over the former:
3
+#
4
+#  * .env                contains default values for the environment variables needed by the app
5
+#  * .env.local          uncommitted file with local overrides
6
+#  * .env.$APP_ENV       committed environment-specific defaults
7
+#  * .env.$APP_ENV.local uncommitted environment-specific overrides
8
+#
9
+# Real environment variables win over .env files.
10
+#
11
+# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
12
+# https://symfony.com/doc/current/configuration/secrets.html
13
+#
14
+# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
15
+# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
16
+
17
+###> symfony/framework-bundle ###
18
+APP_ENV=dev
19
+APP_SECRET=433b91b597b7ee4854b62c68fd2f5174
20
+###< symfony/framework-bundle ###

+ 10
- 0
.gitignore Просмотреть файл

@@ -0,0 +1,10 @@
1
+
2
+###> symfony/framework-bundle ###
3
+/.env.local
4
+/.env.local.php
5
+/.env.*.local
6
+/config/secrets/prod/prod.decrypt.private.php
7
+/public/bundles/
8
+/var/
9
+/vendor/
10
+###< symfony/framework-bundle ###

+ 21
- 0
bin/console Просмотреть файл

@@ -0,0 +1,21 @@
1
+#!/usr/bin/env php
2
+<?php
3
+
4
+use App\Kernel;
5
+use Symfony\Bundle\FrameworkBundle\Console\Application;
6
+
7
+if (!is_dir(dirname(__DIR__).'/vendor')) {
8
+    throw new LogicException('Dependencies are missing. Try running "composer install".');
9
+}
10
+
11
+if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
12
+    throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
13
+}
14
+
15
+require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
16
+
17
+return function (array $context) {
18
+    $kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
19
+
20
+    return new Application($kernel);
21
+};

+ 68
- 0
composer.json Просмотреть файл

@@ -0,0 +1,68 @@
1
+{
2
+    "type": "project",
3
+    "license": "proprietary",
4
+    "minimum-stability": "stable",
5
+    "prefer-stable": true,
6
+    "require": {
7
+        "php": ">=8.2",
8
+        "ext-ctype": "*",
9
+        "ext-iconv": "*",
10
+        "symfony/console": "7.1.*",
11
+        "symfony/dotenv": "7.1.*",
12
+        "symfony/flex": "^2",
13
+        "symfony/framework-bundle": "7.1.*",
14
+        "symfony/runtime": "7.1.*",
15
+        "symfony/yaml": "7.1.*"
16
+    },
17
+    "require-dev": {
18
+    },
19
+    "config": {
20
+        "allow-plugins": {
21
+            "php-http/discovery": true,
22
+            "symfony/flex": true,
23
+            "symfony/runtime": true
24
+        },
25
+        "sort-packages": true
26
+    },
27
+    "autoload": {
28
+        "psr-4": {
29
+            "App\\": "src/"
30
+        }
31
+    },
32
+    "autoload-dev": {
33
+        "psr-4": {
34
+            "App\\Tests\\": "tests/"
35
+        }
36
+    },
37
+    "replace": {
38
+        "symfony/polyfill-ctype": "*",
39
+        "symfony/polyfill-iconv": "*",
40
+        "symfony/polyfill-php72": "*",
41
+        "symfony/polyfill-php73": "*",
42
+        "symfony/polyfill-php74": "*",
43
+        "symfony/polyfill-php80": "*",
44
+        "symfony/polyfill-php81": "*",
45
+        "symfony/polyfill-php82": "*"
46
+    },
47
+    "scripts": {
48
+        "auto-scripts": {
49
+            "cache:clear": "symfony-cmd",
50
+            "assets:install %PUBLIC_DIR%": "symfony-cmd"
51
+        },
52
+        "post-install-cmd": [
53
+            "@auto-scripts"
54
+        ],
55
+        "post-update-cmd": [
56
+            "@auto-scripts"
57
+        ]
58
+    },
59
+    "conflict": {
60
+        "symfony/symfony": "*"
61
+    },
62
+    "extra": {
63
+        "symfony": {
64
+            "allow-contrib": false,
65
+            "require": "7.1.*"
66
+        }
67
+    }
68
+}

+ 2427
- 0
composer.lock
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 5
- 0
config/bundles.php Просмотреть файл

@@ -0,0 +1,5 @@
1
+<?php
2
+
3
+return [
4
+    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
5
+];

+ 19
- 0
config/packages/cache.yaml Просмотреть файл

@@ -0,0 +1,19 @@
1
+framework:
2
+    cache:
3
+        # Unique name of your app: used to compute stable namespaces for cache keys.
4
+        #prefix_seed: your_vendor_name/app_name
5
+
6
+        # The "app" cache stores to the filesystem by default.
7
+        # The data in this cache should persist between deploys.
8
+        # Other options include:
9
+
10
+        # Redis
11
+        #app: cache.adapter.redis
12
+        #default_redis_provider: redis://localhost
13
+
14
+        # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
15
+        #app: cache.adapter.apcu
16
+
17
+        # Namespaced pools use the above "app" backend by default
18
+        #pools:
19
+            #my.dedicated.cache: null

+ 16
- 0
config/packages/framework.yaml Просмотреть файл

@@ -0,0 +1,16 @@
1
+# see https://symfony.com/doc/current/reference/configuration/framework.html
2
+framework:
3
+    secret: '%env(APP_SECRET)%'
4
+    #csrf_protection: true
5
+
6
+    # Note that the session will be started ONLY if you read or write from it.
7
+    session: true
8
+
9
+    #esi: true
10
+    #fragments: true
11
+
12
+when@test:
13
+    framework:
14
+        test: true
15
+        session:
16
+            storage_factory_id: session.storage.factory.mock_file

+ 10
- 0
config/packages/routing.yaml Просмотреть файл

@@ -0,0 +1,10 @@
1
+framework:
2
+    router:
3
+        # Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
4
+        # See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
5
+        #default_uri: http://localhost
6
+
7
+when@prod:
8
+    framework:
9
+        router:
10
+            strict_requirements: null

+ 5
- 0
config/preload.php Просмотреть файл

@@ -0,0 +1,5 @@
1
+<?php
2
+
3
+if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
4
+    require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
5
+}

+ 5
- 0
config/routes.yaml Просмотреть файл

@@ -0,0 +1,5 @@
1
+controllers:
2
+    resource:
3
+        path: ../src/Controller/
4
+        namespace: App\Controller
5
+    type: attribute

+ 4
- 0
config/routes/framework.yaml Просмотреть файл

@@ -0,0 +1,4 @@
1
+when@dev:
2
+    _errors:
3
+        resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
4
+        prefix: /_error

+ 24
- 0
config/services.yaml Просмотреть файл

@@ -0,0 +1,24 @@
1
+# This file is the entry point to configure your own services.
2
+# Files in the packages/ subdirectory configure your dependencies.
3
+
4
+# Put parameters here that don't need to change on each machine where the app is deployed
5
+# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
6
+parameters:
7
+
8
+services:
9
+    # default configuration for services in *this* file
10
+    _defaults:
11
+        autowire: true      # Automatically injects dependencies in your services.
12
+        autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
13
+
14
+    # makes classes in src/ available to be used as services
15
+    # this creates a service per class whose id is the fully-qualified class name
16
+    App\:
17
+        resource: '../src/'
18
+        exclude:
19
+            - '../src/DependencyInjection/'
20
+            - '../src/Entity/'
21
+            - '../src/Kernel.php'
22
+
23
+    # add more service definitions when explicit configuration is needed
24
+    # please note that last definitions always *replace* previous ones

+ 9
- 0
public/index.php Просмотреть файл

@@ -0,0 +1,9 @@
1
+<?php
2
+
3
+use App\Kernel;
4
+
5
+require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
6
+
7
+return function (array $context) {
8
+    return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
9
+};

+ 0
- 0
src/Controller/.gitignore Просмотреть файл


+ 11
- 0
src/Kernel.php Просмотреть файл

@@ -0,0 +1,11 @@
1
+<?php
2
+
3
+namespace App;
4
+
5
+use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
6
+use Symfony\Component\HttpKernel\Kernel as BaseKernel;
7
+
8
+class Kernel extends BaseKernel
9
+{
10
+    use MicroKernelTrait;
11
+}

+ 58
- 0
symfony.lock Просмотреть файл

@@ -0,0 +1,58 @@
1
+{
2
+    "symfony/console": {
3
+        "version": "7.1",
4
+        "recipe": {
5
+            "repo": "github.com/symfony/recipes",
6
+            "branch": "main",
7
+            "version": "5.3",
8
+            "ref": "1781ff40d8a17d87cf53f8d4cf0c8346ed2bb461"
9
+        },
10
+        "files": [
11
+            "bin/console"
12
+        ]
13
+    },
14
+    "symfony/flex": {
15
+        "version": "2.4",
16
+        "recipe": {
17
+            "repo": "github.com/symfony/recipes",
18
+            "branch": "main",
19
+            "version": "1.0",
20
+            "ref": "146251ae39e06a95be0fe3d13c807bcf3938b172"
21
+        },
22
+        "files": [
23
+            ".env"
24
+        ]
25
+    },
26
+    "symfony/framework-bundle": {
27
+        "version": "7.1",
28
+        "recipe": {
29
+            "repo": "github.com/symfony/recipes",
30
+            "branch": "main",
31
+            "version": "7.0",
32
+            "ref": "6356c19b9ae08e7763e4ba2d9ae63043efc75db5"
33
+        },
34
+        "files": [
35
+            "config/packages/cache.yaml",
36
+            "config/packages/framework.yaml",
37
+            "config/preload.php",
38
+            "config/routes/framework.yaml",
39
+            "config/services.yaml",
40
+            "public/index.php",
41
+            "src/Controller/.gitignore",
42
+            "src/Kernel.php"
43
+        ]
44
+    },
45
+    "symfony/routing": {
46
+        "version": "7.1",
47
+        "recipe": {
48
+            "repo": "github.com/symfony/recipes",
49
+            "branch": "main",
50
+            "version": "7.0",
51
+            "ref": "21b72649d5622d8f7da329ffb5afb232a023619d"
52
+        },
53
+        "files": [
54
+            "config/packages/routing.yaml",
55
+            "config/routes.yaml"
56
+        ]
57
+    }
58
+}

Загрузка…
Отмена
Сохранить