Browse Source

Actualización a 7.4

master
mapescador 3 weeks ago
parent
commit
af7ec61636
  1. BIN
      .cd.swp
  2. 2
      .env
  3. 4
      assets/controllers.json
  4. 81
      assets/controllers/csrf_protection_controller.js
  5. 16
      assets/controllers/hello_controller.js
  6. 2
      assets/stimulus_bootstrap.js
  7. 120
      composer.json
  8. 7829
      composer.lock
  9. 12
      config/bundles.php
  10. 3
      config/packages/sensio_framework_extra.yaml
  11. 15
      symfony.lock

BIN
.cd.swp

2
.env

@ -28,7 +28,7 @@ MAILER_DSN=smtp://localhost
# #
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" # DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7" # DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
DATABASE_URL="mysql://root:Pichi23Pichi23@127.0.0.1:3306/sgdpa?serverVersion=5.7"
DATABASE_URL="mysql://root:Pichi23Pichi23@127.0.0.1:3306/faceira?serverVersion=5.7"
###< doctrine/doctrine-bundle ### ###< doctrine/doctrine-bundle ###
###> nelmio/cors-bundle ### ###> nelmio/cors-bundle ###

4
assets/controllers.json

@ -0,0 +1,4 @@
{
"controllers": [],
"entrypoints": []
}

81
assets/controllers/csrf_protection_controller.js

@ -0,0 +1,81 @@
const nameCheck = /^[-_a-zA-Z0-9]{4,22}$/;
const tokenCheck = /^[-_/+a-zA-Z0-9]{24,}$/;
// Generate and double-submit a CSRF token in a form field and a cookie, as defined by Symfony's SameOriginCsrfTokenManager
// Use `form.requestSubmit()` to ensure that the submit event is triggered. Using `form.submit()` will not trigger the event
// and thus this event-listener will not be executed.
document.addEventListener('submit', function (event) {
generateCsrfToken(event.target);
}, true);
// When @hotwired/turbo handles form submissions, send the CSRF token in a header in addition to a cookie
// The `framework.csrf_protection.check_header` config option needs to be enabled for the header to be checked
document.addEventListener('turbo:submit-start', function (event) {
const h = generateCsrfHeaders(event.detail.formSubmission.formElement);
Object.keys(h).map(function (k) {
event.detail.formSubmission.fetchRequest.headers[k] = h[k];
});
});
// When @hotwired/turbo handles form submissions, remove the CSRF cookie once a form has been submitted
document.addEventListener('turbo:submit-end', function (event) {
removeCsrfToken(event.detail.formSubmission.formElement);
});
export function generateCsrfToken (formElement) {
const csrfField = formElement.querySelector('input[data-controller="csrf-protection"], input[name="_csrf_token"]');
if (!csrfField) {
return;
}
let csrfCookie = csrfField.getAttribute('data-csrf-protection-cookie-value');
let csrfToken = csrfField.value;
if (!csrfCookie && nameCheck.test(csrfToken)) {
csrfField.setAttribute('data-csrf-protection-cookie-value', csrfCookie = csrfToken);
csrfField.defaultValue = csrfToken = btoa(String.fromCharCode.apply(null, (window.crypto || window.msCrypto).getRandomValues(new Uint8Array(18))));
}
csrfField.dispatchEvent(new Event('change', { bubbles: true }));
if (csrfCookie && tokenCheck.test(csrfToken)) {
const cookie = csrfCookie + '_' + csrfToken + '=' + csrfCookie + '; path=/; samesite=strict';
document.cookie = window.location.protocol === 'https:' ? '__Host-' + cookie + '; secure' : cookie;
}
}
export function generateCsrfHeaders (formElement) {
const headers = {};
const csrfField = formElement.querySelector('input[data-controller="csrf-protection"], input[name="_csrf_token"]');
if (!csrfField) {
return headers;
}
const csrfCookie = csrfField.getAttribute('data-csrf-protection-cookie-value');
if (tokenCheck.test(csrfField.value) && nameCheck.test(csrfCookie)) {
headers[csrfCookie] = csrfField.value;
}
return headers;
}
export function removeCsrfToken (formElement) {
const csrfField = formElement.querySelector('input[data-controller="csrf-protection"], input[name="_csrf_token"]');
if (!csrfField) {
return;
}
const csrfCookie = csrfField.getAttribute('data-csrf-protection-cookie-value');
if (tokenCheck.test(csrfField.value) && nameCheck.test(csrfCookie)) {
const cookie = csrfCookie + '_' + csrfField.value + '=0; path=/; samesite=strict; max-age=0';
document.cookie = window.location.protocol === 'https:' ? '__Host-' + cookie + '; secure' : cookie;
}
}
/* stimulusFetch: 'lazy' */
export default 'csrf-protection-controller';

16
assets/controllers/hello_controller.js

@ -0,0 +1,16 @@
import { Controller } from '@hotwired/stimulus';
/*
* This is an example Stimulus controller!
*
* Any element with a data-controller="hello" attribute will cause
* this controller to be executed. The name "hello" comes from the filename:
* hello_controller.js -> "hello"
*
* Delete this file or adapt it for your use!
*/
export default class extends Controller {
connect() {
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js';
}
}

2
assets/stimulus_bootstrap.js

@ -0,0 +1,2 @@
// register any custom, 3rd party controllers here
// app.register('some_controller_name', SomeImportedController);

120
composer.json

@ -4,72 +4,75 @@
"minimum-stability": "stable", "minimum-stability": "stable",
"prefer-stable": true, "prefer-stable": true,
"require": { "require": {
"php": ">=8.0.0",
"php": "^8.3",
"ext-ctype": "*", "ext-ctype": "*",
"ext-iconv": "*", "ext-iconv": "*",
"api-platform/core": "^2.6",
"api-platform/core": "^3.3|^4.0",
"appaydin/pd-user": "^3.0", "appaydin/pd-user": "^3.0",
"composer/package-versions-deprecated": "1.11.99.2",
"doctrine/annotations": "^1.0",
"doctrine/doctrine-bundle": "^2.4",
"doctrine/doctrine-migrations-bundle": "^3.1",
"doctrine/orm": "^2.9",
"nelmio/api-doc-bundle": "^4.4",
"nelmio/cors-bundle": "^2.1",
"phpdocumentor/reflection-docblock": "^5.2",
"sensio/framework-extra-bundle": "^6.1",
"sonata-project/admin-bundle": "dev-master",
"sonata-project/doctrine-orm-admin-bundle": "dev-master",
"doctrine/doctrine-bundle": "^2.11",
"doctrine/doctrine-migrations-bundle": "^3.3",
"doctrine/orm": "^2.18|^3.0",
"nelmio/api-doc-bundle": "^4.19",
"nelmio/cors-bundle": "^2.4",
"phpdocumentor/reflection-docblock": "^5.3",
"sonata-project/admin-bundle": "^4.28",
"sonata-project/doctrine-orm-admin-bundle": "^4.14",
"symfony/apache-pack": "^1.0", "symfony/apache-pack": "^1.0",
"symfony/asset": "5.3.*",
"symfony/console": "5.3.*",
"symfony/dotenv": "5.3.*",
"symfony/expression-language": "5.3.*",
"symfony/flex": "^1.3.1",
"symfony/form": "5.3.*",
"symfony/framework-bundle": "5.3.*",
"symfony/http-client": "5.3.*",
"symfony/intl": "5.3.*",
"symfony/mailer": "5.3.*",
"symfony/maker-bundle": "^1.32",
"symfony/mime": "5.3.*",
"symfony/monolog-bundle": "^3.1",
"symfony/notifier": "5.3.*",
"symfony/process": "5.3.*",
"symfony/property-access": "5.3.*",
"symfony/property-info": "5.3.*",
"symfony/proxy-manager-bridge": "5.3.*",
"symfony/runtime": "5.3.*",
"symfony/security-bundle": "5.3.*",
"symfony/serializer": "5.3.*",
"symfony/string": "5.3.*",
"symfony/translation": "5.3.*",
"symfony/twig-bundle": "^5.3",
"symfony/validator": "5.3.*",
"symfony/web-link": "5.3.*",
"symfony/yaml": "5.3.*",
"tattali/calendar-bundle": "^1.2",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0",
"vich/uploader-bundle": "^1.18"
"symfony/asset": "^7.4",
"symfony/console": "^7.4",
"symfony/dotenv": "^7.4",
"symfony/expression-language": "^7.4",
"symfony/flex": "^2.4",
"symfony/form": "^7.4",
"symfony/framework-bundle": "^7.4",
"symfony/http-client": "^7.4",
"symfony/intl": "^7.4",
"symfony/mailer": "^7.4",
"symfony/maker-bundle": "^1.53",
"symfony/mime": "^7.4",
"symfony/monolog-bundle": "^3.10",
"symfony/notifier": "^7.4",
"symfony/process": "^7.4",
"symfony/property-access": "^7.4",
"symfony/property-info": "^7.4",
"symfony/runtime": "^7.4",
"symfony/security-bundle": "^7.4",
"symfony/serializer": "^7.4",
"symfony/string": "^7.4",
"symfony/translation": "^7.4",
"symfony/twig-bundle": "^7.4",
"symfony/validator": "^7.4",
"symfony/web-link": "^7.4",
"symfony/yaml": "^7.4",
"tattali/calendar-bundle": "^1.3",
"twig/extra-bundle": "^3.8",
"twig/twig": "^3.8",
"vich/uploader-bundle": "^2.3"
}, },
"require-dev": { "require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.4",
"phpunit/phpunit": "^9.5",
"symfony/browser-kit": "^5.3",
"symfony/css-selector": "^5.3",
"symfony/debug-bundle": "^5.3",
"symfony/phpunit-bridge": "^5.3",
"symfony/stopwatch": "^5.3",
"symfony/var-dumper": "^5.3",
"symfony/web-profiler-bundle": "^5.3"
"doctrine/doctrine-fixtures-bundle": "^3.5",
"phpunit/phpunit": "^10.5|^11.0",
"symfony/browser-kit": "^7.4",
"symfony/css-selector": "^7.4",
"symfony/debug-bundle": "^7.4",
"symfony/phpunit-bridge": "^7.4",
"symfony/stopwatch": "^7.4",
"symfony/var-dumper": "^7.4",
"symfony/web-profiler-bundle": "^7.4"
}, },
"config": { "config": {
"optimize-autoloader": true, "optimize-autoloader": true,
"preferred-install": { "preferred-install": {
"*": "dist" "*": "dist"
}, },
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"symfony/flex": true,
"symfony/runtime": true
},
"platform": {
"php": "8.3.0"
}
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@ -84,7 +87,12 @@
"replace": { "replace": {
"symfony/polyfill-ctype": "*", "symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*", "symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*"
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*",
"symfony/polyfill-php74": "*",
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*",
"symfony/polyfill-php82": "*"
}, },
"scripts": { "scripts": {
"auto-scripts": { "auto-scripts": {
@ -104,7 +112,7 @@
"extra": { "extra": {
"symfony": { "symfony": {
"allow-contrib": false, "allow-contrib": false,
"require": "5.3.*"
"require": "7.4.*"
} }
} }
} }

7829
composer.lock
File diff suppressed because it is too large
View File

12
config/bundles.php

@ -1,8 +1,9 @@
<?php <?php
return [ return [
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
Pd\UserBundle\PdUserBundle::class => ['all' => true], Pd\UserBundle\PdUserBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true], Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
@ -10,13 +11,11 @@ return [
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true], Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
Nelmio\ApiDocBundle\NelmioApiDocBundle::class => ['all' => true], Nelmio\ApiDocBundle\NelmioApiDocBundle::class => ['all' => true],
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Sonata\Doctrine\Bridge\Symfony\SonataDoctrineSymfonyBundle::class => ['all' => true],
Sonata\Twig\Bridge\Symfony\SonataTwigSymfonyBundle::class => ['all' => true],
Sonata\Doctrine\Bridge\Symfony\SonataDoctrineBundle::class => ['all' => true],
Sonata\Twig\Bridge\Symfony\SonataTwigBundle::class => ['all' => true],
Sonata\Form\Bridge\Symfony\SonataFormBundle::class => ['all' => true], Sonata\Form\Bridge\Symfony\SonataFormBundle::class => ['all' => true],
Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true], Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
Sonata\Exporter\Bridge\Symfony\SonataExporterSymfonyBundle::class => ['all' => true],
Sonata\Exporter\Bridge\Symfony\SonataExporterBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Sonata\AdminBundle\SonataAdminBundle::class => ['all' => true], Sonata\AdminBundle\SonataAdminBundle::class => ['all' => true],
Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle::class => ['all' => true], Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle::class => ['all' => true],
@ -27,4 +26,5 @@ return [
CalendarBundle\CalendarBundle::class => ['all' => true], CalendarBundle\CalendarBundle::class => ['all' => true],
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
Vich\UploaderBundle\VichUploaderBundle::class => ['all' => true], Vich\UploaderBundle\VichUploaderBundle::class => ['all' => true],
Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true],
]; ];

3
config/packages/sensio_framework_extra.yaml

@ -1,3 +0,0 @@
sensio_framework_extra:
router:
annotations: false

15
symfony.lock

@ -634,6 +634,21 @@
"symfony/service-contracts": { "symfony/service-contracts": {
"version": "v2.4.0" "version": "v2.4.0"
}, },
"symfony/stimulus-bundle": {
"version": "2.36",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "2.25",
"ref": "9b51a69079f3629061dfe0e5d7e20f5a9b20752c"
},
"files": [
"assets/controllers.json",
"assets/controllers/csrf_protection_controller.js",
"assets/controllers/hello_controller.js",
"assets/stimulus_bootstrap.js"
]
},
"symfony/stopwatch": { "symfony/stopwatch": {
"version": "v5.3.4" "version": "v5.3.4"
}, },

Loading…
Cancel
Save