@eui/cli 21.0.0-alpha.3 → 21.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.version.properties +1 -0
- package/bin/eui-cli.js +47 -0
- package/lib/build.js +155 -0
- package/lib/cli.js +123 -0
- package/lib/config.js +58 -0
- package/lib/generators.js +75 -0
- package/lib/install.js +45 -0
- package/lib/maven-build/build.xml +115 -0
- package/lib/maven-build/lib/ant-contrib-20061014.jar +0 -0
- package/lib/maven-build/pom.xml +64 -0
- package/lib/post-build.js +33 -0
- package/lib/skeletons/_angular/base/.browserslistrc +16 -0
- package/lib/skeletons/_angular/base/.editorconfig +16 -0
- package/lib/skeletons/_angular/base/.euirc.json +8 -0
- package/lib/skeletons/_angular/base/README.md +26 -0
- package/lib/skeletons/_angular/base/angular.json +158 -0
- package/lib/skeletons/_angular/base/gitignore_TO_REPLACE +51 -0
- package/lib/skeletons/_angular/base/mock/app/models/user.js +6 -0
- package/lib/skeletons/_angular/base/mock/app/routes/index.js +5 -0
- package/lib/skeletons/_angular/base/mock/app/routes/user_routes.js +44 -0
- package/lib/skeletons/_angular/base/mock/db/db.json +10 -0
- package/lib/skeletons/_angular/base/mock/server.js +23 -0
- package/lib/skeletons/_angular/base/package.json +38 -0
- package/lib/skeletons/_angular/base/proxy-mock.conf.json +6 -0
- package/lib/skeletons/_angular/base/proxy.conf.json +6 -0
- package/lib/skeletons/_angular/base/src/.eslintrc.json +121 -0
- package/lib/skeletons/_angular/base/src/app/app-starter.service.spec.ts +68 -0
- package/lib/skeletons/_angular/base/src/app/app-starter.service.ts +68 -0
- package/lib/skeletons/_angular/base/src/app/app.component.html +35 -0
- package/lib/skeletons/_angular/base/src/app/app.component.spec.ts +60 -0
- package/lib/skeletons/_angular/base/src/app/app.component.ts +35 -0
- package/lib/skeletons/_angular/base/src/app/app.config.ts +84 -0
- package/lib/skeletons/_angular/base/src/app/app.routes.ts +9 -0
- package/lib/skeletons/_angular/base/src/app/features/home/home.component.html +41 -0
- package/lib/skeletons/_angular/base/src/app/features/home/home.component.ts +17 -0
- package/lib/skeletons/_angular/base/src/app/features/home/home.routes.ts +6 -0
- package/lib/skeletons/_angular/base/src/app/features/module1/components/page1/page1.component.html +7 -0
- package/lib/skeletons/_angular/base/src/app/features/module1/components/page1/page1.component.ts +10 -0
- package/lib/skeletons/_angular/base/src/app/features/module1/components/page2/page2.component.html +7 -0
- package/lib/skeletons/_angular/base/src/app/features/module1/components/page2/page2.component.ts +10 -0
- package/lib/skeletons/_angular/base/src/app/features/module1/module1.component.html +7 -0
- package/lib/skeletons/_angular/base/src/app/features/module1/module1.component.ts +10 -0
- package/lib/skeletons/_angular/base/src/app/features/module1/module1.routes.ts +10 -0
- package/lib/skeletons/_angular/base/src/app/features/module2/module2.component.html +7 -0
- package/lib/skeletons/_angular/base/src/app/features/module2/module2.component.ts +10 -0
- package/lib/skeletons/_angular/base/src/app/features/module2/module2.routes.ts +6 -0
- package/lib/skeletons/_angular/base/src/app/shared/testing/router.mock.ts +18 -0
- package/lib/skeletons/_angular/base/src/assets/config/env-json-config-dev.json +8 -0
- package/lib/skeletons/_angular/base/src/assets/config/env-json-config-prod.json +8 -0
- package/lib/skeletons/_angular/base/src/assets/config/env-json-config.json +7 -0
- package/lib/skeletons/_angular/base/src/assets/i18n/en.json +7 -0
- package/lib/skeletons/_angular/base/src/assets/i18n/fr.json +7 -0
- package/lib/skeletons/_angular/base/src/config/global.ts +33 -0
- package/lib/skeletons/_angular/base/src/config/index.ts +8 -0
- package/lib/skeletons/_angular/base/src/config/modules.ts +7 -0
- package/lib/skeletons/_angular/base/src/dummy.spec.ts +6 -0
- package/lib/skeletons/_angular/base/src/environments/environment.prod.ts +11 -0
- package/lib/skeletons/_angular/base/src/environments/environment.ts +15 -0
- package/lib/skeletons/_angular/base/src/favicon.ico +0 -0
- package/lib/skeletons/_angular/base/src/index.html +20 -0
- package/lib/skeletons/_angular/base/src/karma.conf.js +7 -0
- package/lib/skeletons/_angular/base/src/main.ts +20 -0
- package/lib/skeletons/_angular/base/src/styles.scss +1 -0
- package/lib/skeletons/_angular/base/src/tsconfig.app.json +18 -0
- package/lib/skeletons/_angular/base/src/tsconfig.spec.json +14 -0
- package/lib/skeletons/_angular/base/tsconfig.json +27 -0
- package/lib/skeletons/_angular/base-mobile/angular.json +156 -0
- package/lib/skeletons/_angular/base-mobile/ionic.config.json +5 -0
- package/lib/skeletons/_angular/base-mobile/ngsw-config.json +33 -0
- package/lib/skeletons/_angular/base-mobile/package.json +27 -0
- package/lib/skeletons/_angular/base-mobile/src/app/app-routing.module.ts +18 -0
- package/lib/skeletons/_angular/base-mobile/src/app/app-starter.service.ts +73 -0
- package/lib/skeletons/_angular/base-mobile/src/app/app.component.html +47 -0
- package/lib/skeletons/_angular/base-mobile/src/app/app.component.ts +81 -0
- package/lib/skeletons/_angular/base-mobile/src/app/app.config.ts +81 -0
- package/lib/skeletons/_angular/base-mobile/src/app/app.module.ts +44 -0
- package/lib/skeletons/_angular/base-mobile/src/app/core/components/.gitkeep +0 -0
- package/lib/skeletons/_angular/base-mobile/src/app/core/core.module.ts +89 -0
- package/lib/skeletons/_angular/base-mobile/src/app/core/reducers/index.ts +32 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/about-routing.module.ts +45 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/about.component.html +70 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/about.component.ts +19 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/about.module.ts +30 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/change-log/changelog.component.html +11 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/change-log/changelog.component.ts +102 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/help-support/help-support.component.html +20 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/help-support/help-support.component.ts +75 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/legal-notice/legal-notice.component.html +12 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/legal-notice/legal-notice.component.ts +8 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/licence-details/licence-details.component.html +48 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/licence-details/licence-details.component.ts +7 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/opensource-licences/opensource-licences.component.html +11 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/opensource-licences/opensource-licences.component.ts +31 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/privacy-statement/privacy-statement.component.html +11 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/about/privacy-statement/privacy-statement.component.ts +103 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/home/home-routing.module.ts +15 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/home/home.component.html +11 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/home/home.component.ts +9 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/home/home.module.ts +18 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/components/page1/page1.component.html +11 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/components/page1/page1.component.ts +8 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/components/page2/page2.component.html +11 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/components/page2/page2.component.ts +8 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/module1-routing.module.ts +18 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/module1.component.html +15 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/module1.component.ts +17 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module1/module1.module.ts +21 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module2/module2-routing.module.ts +16 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module2/module2.component.html +11 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module2/module2.component.ts +7 -0
- package/lib/skeletons/_angular/base-mobile/src/app/features/module2/module2.module.ts +17 -0
- package/lib/skeletons/_angular/base-mobile/src/app/shared/shared.module.ts +16 -0
- package/lib/skeletons/_angular/base-mobile/src/app/shared/testing/router.mock.ts +18 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/docs/pdf-test.pdf +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/i18n/en.json +25 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/i18n/es.json +24 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/i18n/fr.json +25 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/i18n/tr.json +25 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-1024.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-114.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-120.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-128.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-144.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-152.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-16.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-180.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-192.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-32.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-36.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-384.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-48.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-512.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-57.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-60.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-72.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-76.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/app-icon-96.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1125-2436.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1170-2532.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1179-2556.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1242-2208.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1242-2688.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1284-2778.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1290-2796.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1488-2266.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1536-2048.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1620-2160.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1640-2360.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1668-2224.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-1668-2388.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-2048-2732.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-640-1136.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-750-1334.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-landscape-828-1792.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1125-2436.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1170-2532.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1179-2556.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1242-2208.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1242-2688.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1284-2778.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1290-2796.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1488-2266.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1536-2048.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1620-2160.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1640-2360.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1668-2224.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-1668-2388.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-2048-2732.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-640-1136.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-750-1334.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/icons/apple-splash-portrait-828-1792.png +0 -0
- package/lib/skeletons/_angular/base-mobile/src/assets/images/app-icon.svg +10 -0
- package/lib/skeletons/_angular/base-mobile/src/config/global.ts +39 -0
- package/lib/skeletons/_angular/base-mobile/src/config/index.ts +8 -0
- package/lib/skeletons/_angular/base-mobile/src/config/modules.ts +7 -0
- package/lib/skeletons/_angular/base-mobile/src/index.html +76 -0
- package/lib/skeletons/_angular/base-mobile/src/main.ts +23 -0
- package/lib/skeletons/_angular/base-mobile/src/manifest.webmanifest +66 -0
- package/lib/skeletons/_angular/base-mobile/src/tsconfig.app.json +20 -0
- package/lib/skeletons/_angular/options/ecl-ec/angular.json +181 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/app.component.html +237 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/app.component.ts +65 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/app.config.ts +84 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/home/home.component.html +71 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/home/home.component.ts +20 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module1/components/page1/page1.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module1/components/page1/page1.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module1/components/page2/page2.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module1/components/page2/page2.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module1/module1.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module1/module1.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module2/module2.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/app/features/module2/module2.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-ec/src/config/global.ts +23 -0
- package/lib/skeletons/_angular/options/ecl-eu/angular.json +181 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/app.component.html +203 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/app.component.ts +65 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/app.config.ts +84 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/home/home.component.html +71 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/home/home.component.ts +20 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module1/components/page1/page1.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module1/components/page1/page1.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module1/components/page2/page2.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module1/components/page2/page2.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module1/module1.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module1/module1.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module2/module2.component.html +1 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/features/module2/module2.component.ts +7 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/app/shared/shared.module.ts +19 -0
- package/lib/skeletons/_angular/options/ecl-eu/src/config/global.ts +23 -0
- package/lib/skeletons/web-maven/package.json +17 -0
- package/lib/skeletons/web-maven/pom.xml +55 -0
- package/lib/skeletons/web-maven/src/main/java/eu/europa/ec/digit/eui/angular2clistarter/servlet/SpringWebApplicationInitializer.java +22 -0
- package/lib/skeletons/web-maven/src/main/java/eu/europa/ec/digit/eui/angular2clistarter/spring/SpringRestConfiguration.java +24 -0
- package/lib/skeletons/web-maven/src/main/java/eu/europa/ec/digit/eui/angular2clistarter/spring/rest/UserDetailsResource.java +23 -0
- package/lib/skeletons/web-maven/src/main/resources/ecas-config-application-name.xml +7 -0
- package/lib/skeletons/web-maven/src/main/webapp/WEB-INF/dispatcher-servlet.xml +11 -0
- package/lib/skeletons/web-maven/src/main/webapp/WEB-INF/web.xml +38 -0
- package/lib/skeletons/web-maven/src/main/webapp/WEB-INF/weblogic.xml +16 -0
- package/lib/skeletons/web-maven/src/main/webapp/index.jsp +30 -0
- package/lib/skeletons/web-spring-boot/myapp-web/pom.xml +83 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/pom.xml +83 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/MyappApplication.java +46 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/domain/Address.java +65 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/domain/Building.java +44 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/repositories/BuildingRepository.java +11 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/resources/BuildingResource.java +26 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/resources/SwaggerConfig.java +16 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/resources/support/HateoasPageableHandlerMethodArgumentResolver.java +45 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/resources/support/HypermediaSupport.java +25 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/resources/support/PageJsonSerializer.java +17 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/security/CachingPreventionFilter.java +29 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/security/CsrfPreventionFilter.java +35 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/security/FakeAuthenticationFilter.java +372 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/security/SecurityConfig.java +47 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/services/BuildingSearchCriteria.java +26 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/services/BuildingService.java +10 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/java/myapp/services/BuildingServiceImpl.java +26 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/resources/application.properties +0 -0
- package/lib/skeletons/web-spring-boot/myapp-web-rest/src/main/resources/data.sql +11 -0
- package/lib/skeletons/web-spring-boot/pom.xml +30 -0
- package/lib/skeletons/web-symfony/myapp-web/angular.json +169 -0
- package/lib/skeletons/web-symfony/myapp-web/package.json +23 -0
- package/lib/skeletons/web-symfony/myapp-web/src/app/app-routing.module.ts +18 -0
- package/lib/skeletons/web-symfony/myapp-web/src/app/app.component.ts +77 -0
- package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/components/products.component.html +160 -0
- package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/components/products.component.scss +0 -0
- package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/components/products.component.ts +104 -0
- package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/models/product.model.ts +6 -0
- package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/products-routing.module.ts +16 -0
- package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/products.module.ts +16 -0
- package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/services/products.service.ts +29 -0
- package/lib/skeletons/web-symfony/myapp-web/src/environments/environment.ts +17 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/.env +28 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/bin/console +42 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/composer.json +67 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/composer.lock +3572 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/bootstrap.php +21 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/bundles.php +12 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/config.yml +0 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/cache.yaml +19 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/dev/routing.yaml +3 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/doctrine.yaml +29 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/doctrine_migrations.yaml +5 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/framework.yaml +17 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/prod/doctrine.yaml +32 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/routing.yaml +4 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/sensio_framework_extra.yaml +3 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/test/framework.yaml +4 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/test/routing.yaml +3 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/twig.yaml +4 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/routes/annotations.yaml +3 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/routes/dev/twig.yaml +3 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/routes.yaml +3 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/config/services.yaml +27 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/public/index.php +27 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/src/Controller/ProductController.php +196 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/src/Entity/Product.php +99 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/src/Kernel.php +53 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/src/Migrations/Version20190604101623.php +31 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/src/Migrations/Version20190604101638.php +35 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/src/Repository/ProductRepository.php +51 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/symfony.lock +274 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/templates/base.html.twig +12 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/templates/lucky/number.html.twig +1 -0
- package/lib/skeletons/web-symfony/myapp-web-rest/templates/product/index.html.twig +20 -0
- package/lib/utils.js +13 -0
- package/package.json +1 -1
- package/sonar-project.properties +14 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Symfony\Component\Dotenv\Dotenv;
|
|
4
|
+
|
|
5
|
+
require dirname(__DIR__).'/vendor/autoload.php';
|
|
6
|
+
|
|
7
|
+
// Load cached env vars if the .env.local.php file exists
|
|
8
|
+
// Run "composer dump-env prod" to create it (requires symfony/flex >=1.2)
|
|
9
|
+
if (is_array($env = @include dirname(__DIR__).'/.env.local.php')) {
|
|
10
|
+
$_ENV += $env;
|
|
11
|
+
} elseif (!class_exists(Dotenv::class)) {
|
|
12
|
+
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
|
|
13
|
+
} else {
|
|
14
|
+
// load all the .env files
|
|
15
|
+
(new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
$_SERVER += $_ENV;
|
|
19
|
+
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
|
|
20
|
+
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
|
|
21
|
+
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
return [
|
|
4
|
+
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
|
5
|
+
Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true],
|
|
6
|
+
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
|
|
7
|
+
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
|
|
8
|
+
Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
|
|
9
|
+
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
|
10
|
+
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
|
11
|
+
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
|
12
|
+
];
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
framework:
|
|
2
|
+
cache:
|
|
3
|
+
# Put the unique name of your app here: the prefix seed
|
|
4
|
+
# is used to compute stable namespaces for cache keys.
|
|
5
|
+
#prefix_seed: your_vendor_name/app_name
|
|
6
|
+
|
|
7
|
+
# The app cache caches to the filesystem by default.
|
|
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: ~
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
parameters:
|
|
2
|
+
# Adds a fallback DATABASE_URL if the env var is not set.
|
|
3
|
+
# This allows you to run cache:warmup even if your
|
|
4
|
+
# environment variables are not available yet.
|
|
5
|
+
# You should not need to change this value.
|
|
6
|
+
env(DATABASE_URL): ''
|
|
7
|
+
|
|
8
|
+
doctrine:
|
|
9
|
+
dbal:
|
|
10
|
+
# configure these for your database server
|
|
11
|
+
driver: 'pdo_mysql'
|
|
12
|
+
server_version: '5.7'
|
|
13
|
+
charset: utf8mb4
|
|
14
|
+
default_table_options:
|
|
15
|
+
charset: utf8mb4
|
|
16
|
+
collate: utf8mb4_unicode_ci
|
|
17
|
+
|
|
18
|
+
url: '%env(resolve:DATABASE_URL)%'
|
|
19
|
+
orm:
|
|
20
|
+
auto_generate_proxy_classes: true
|
|
21
|
+
naming_strategy: doctrine.orm.naming_strategy.underscore
|
|
22
|
+
auto_mapping: true
|
|
23
|
+
mappings:
|
|
24
|
+
App:
|
|
25
|
+
is_bundle: false
|
|
26
|
+
type: annotation
|
|
27
|
+
dir: '%kernel.project_dir%/src/Entity'
|
|
28
|
+
prefix: 'App\Entity'
|
|
29
|
+
alias: App
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
framework:
|
|
2
|
+
secret: '%env(APP_SECRET)%'
|
|
3
|
+
#default_locale: en
|
|
4
|
+
#csrf_protection: true
|
|
5
|
+
#http_method_override: true
|
|
6
|
+
|
|
7
|
+
# Enables session support. Note that the session will ONLY be started if you read or write from it.
|
|
8
|
+
# Remove or comment this section to explicitly disable session support.
|
|
9
|
+
session:
|
|
10
|
+
handler_id: ~
|
|
11
|
+
cookie_secure: auto
|
|
12
|
+
cookie_samesite: lax
|
|
13
|
+
|
|
14
|
+
#esi: true
|
|
15
|
+
#fragments: true
|
|
16
|
+
php_errors:
|
|
17
|
+
log: true
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
doctrine:
|
|
2
|
+
orm:
|
|
3
|
+
auto_generate_proxy_classes: false
|
|
4
|
+
metadata_cache_driver:
|
|
5
|
+
type: service
|
|
6
|
+
id: doctrine.system_cache_provider
|
|
7
|
+
query_cache_driver:
|
|
8
|
+
type: service
|
|
9
|
+
id: doctrine.system_cache_provider
|
|
10
|
+
result_cache_driver:
|
|
11
|
+
type: service
|
|
12
|
+
id: doctrine.result_cache_provider
|
|
13
|
+
|
|
14
|
+
services:
|
|
15
|
+
doctrine.result_cache_provider:
|
|
16
|
+
class: Symfony\Component\Cache\DoctrineProvider
|
|
17
|
+
public: false
|
|
18
|
+
arguments:
|
|
19
|
+
- '@doctrine.result_cache_pool'
|
|
20
|
+
doctrine.system_cache_provider:
|
|
21
|
+
class: Symfony\Component\Cache\DoctrineProvider
|
|
22
|
+
public: false
|
|
23
|
+
arguments:
|
|
24
|
+
- '@doctrine.system_cache_pool'
|
|
25
|
+
|
|
26
|
+
framework:
|
|
27
|
+
cache:
|
|
28
|
+
pools:
|
|
29
|
+
doctrine.result_cache_pool:
|
|
30
|
+
adapter: cache.app
|
|
31
|
+
doctrine.system_cache_pool:
|
|
32
|
+
adapter: cache.system
|
|
@@ -0,0 +1,27 @@
|
|
|
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/configuration.html#application-related-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: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'
|
|
19
|
+
|
|
20
|
+
# controllers are imported separately to make sure services can be injected
|
|
21
|
+
# as action arguments even if you don't extend any base controller class
|
|
22
|
+
App\Controller\:
|
|
23
|
+
resource: '../src/Controller'
|
|
24
|
+
tags: ['controller.service_arguments']
|
|
25
|
+
|
|
26
|
+
# add more service definitions when explicit configuration is needed
|
|
27
|
+
# please note that last definitions always *replace* previous ones
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use App\Kernel;
|
|
4
|
+
use Symfony\Component\Debug\Debug;
|
|
5
|
+
use Symfony\Component\HttpFoundation\Request;
|
|
6
|
+
|
|
7
|
+
require dirname(__DIR__).'/config/bootstrap.php';
|
|
8
|
+
|
|
9
|
+
if ($_SERVER['APP_DEBUG']) {
|
|
10
|
+
umask(0000);
|
|
11
|
+
|
|
12
|
+
Debug::enable();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
|
|
16
|
+
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
|
|
20
|
+
Request::setTrustedHosts([$trustedHosts]);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
|
|
24
|
+
$request = Request::createFromGlobals();
|
|
25
|
+
$response = $kernel->handle($request);
|
|
26
|
+
$response->send();
|
|
27
|
+
$kernel->terminate($request, $response);
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
namespace App\Controller;
|
|
3
|
+
use App\Entity\Product;
|
|
4
|
+
use App\Controller\OutputController;
|
|
5
|
+
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
6
|
+
use Symfony\Component\Routing\Annotation\Route;
|
|
7
|
+
use Symfony\Component\HttpFoundation\Response;
|
|
8
|
+
use Symfony\Component\HttpFoundation\Request;
|
|
9
|
+
use Symfony\Component\HttpFoundation\AcceptHeader;
|
|
10
|
+
use Doctrine\ORM\ORMException;
|
|
11
|
+
use Doctrine\DBAL\DBALException;
|
|
12
|
+
|
|
13
|
+
class ProductController extends AbstractController
|
|
14
|
+
{
|
|
15
|
+
/**
|
|
16
|
+
* @Route("/api/product", name="product_create", methods = {"OPTIONS","POST"})
|
|
17
|
+
*/
|
|
18
|
+
public function create()
|
|
19
|
+
{
|
|
20
|
+
try
|
|
21
|
+
{
|
|
22
|
+
$params = json_decode(file_get_contents('php://input'), true);
|
|
23
|
+
|
|
24
|
+
$request = Request::createFromGlobals();
|
|
25
|
+
|
|
26
|
+
if ($request->isMethod('POST')) {
|
|
27
|
+
//ENTITY MANAGER
|
|
28
|
+
$entityManager = $this->getDoctrine()->getManager();
|
|
29
|
+
$product = new Product();
|
|
30
|
+
$product->setName($params['name']);
|
|
31
|
+
$product->setPrice($params['price']);
|
|
32
|
+
$product->setDescription($params['description']);
|
|
33
|
+
|
|
34
|
+
$entityManager->persist($product);
|
|
35
|
+
$entityManager->flush();
|
|
36
|
+
|
|
37
|
+
//GET PRODUCT
|
|
38
|
+
$product = $this->getDoctrine()->getRepository(Product::class)->find($product->getProductId());
|
|
39
|
+
if (!$product) {
|
|
40
|
+
throw $this->createNotFoundException('error');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//OUTPUT
|
|
44
|
+
$response = new Response(json_encode($product->toArray()));
|
|
45
|
+
|
|
46
|
+
}else{
|
|
47
|
+
$response = new Response();
|
|
48
|
+
$response -> setStatusCode(Response::HTTP_OK);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
$response -> setStatusCode(Response::HTTP_OK);
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
catch (\Exception $e) {
|
|
57
|
+
$response = New Response(json_encode(array('error' => $e->getMessage())));
|
|
58
|
+
$response -> setStatusCode(Response::HTTP_BAD_REQUEST);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return $this->setheaders($response, "POST");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @Route("/api/product/update", name="product_udpate", methods = {"OPTIONS","POST"})
|
|
68
|
+
*/
|
|
69
|
+
public function update()
|
|
70
|
+
{
|
|
71
|
+
try
|
|
72
|
+
{
|
|
73
|
+
//PARAMS
|
|
74
|
+
$params = json_decode(file_get_contents('php://input'), true);
|
|
75
|
+
|
|
76
|
+
//GET PRODUCT
|
|
77
|
+
$request = Request::createFromGlobals();
|
|
78
|
+
if ($request->isMethod('POST')) {
|
|
79
|
+
$product = $this->getDoctrine()->getRepository(Product::class)->find($request->request->get('productId'));
|
|
80
|
+
if (!$product) {
|
|
81
|
+
throw $this->createNotFoundException('product not found');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
//ENTITY MANAGER
|
|
85
|
+
$entityManager = $this->getDoctrine()->getManager();
|
|
86
|
+
$product->setName($params['name']);
|
|
87
|
+
$product->setPrice($params['price']);
|
|
88
|
+
$product->setDescription($params['description']);
|
|
89
|
+
$entityManager->merge($product);
|
|
90
|
+
$entityManager->flush();
|
|
91
|
+
|
|
92
|
+
//OUTPUT
|
|
93
|
+
$response = new Response(json_encode($product->toArray()));
|
|
94
|
+
} else{
|
|
95
|
+
$response = new Response();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
$response -> setStatusCode(Response::HTTP_OK);
|
|
99
|
+
|
|
100
|
+
}
|
|
101
|
+
catch (\Exception $e) {
|
|
102
|
+
$response = New Response(json_encode(array('error' => $e->getMessage())));
|
|
103
|
+
$response -> setStatusCode(Response::HTTP_BAD_REQUEST);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return $this->setheaders($response,"POST");
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @Route("/api/product/delete/{id}", name="product_delete", methods = {"OPTIONS","DELETE"})
|
|
113
|
+
*/
|
|
114
|
+
public function delete($id)
|
|
115
|
+
{
|
|
116
|
+
|
|
117
|
+
try {
|
|
118
|
+
$request = Request::createFromGlobals();
|
|
119
|
+
|
|
120
|
+
if ($request->isMethod('DELETE')) {
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
//GET PRODUCT
|
|
124
|
+
$repository = $this->getDoctrine()->getRepository(Product::class);
|
|
125
|
+
$product = $repository->find($id);
|
|
126
|
+
if (!$product) {
|
|
127
|
+
throw $this->createNotFoundException('product not found');
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
//OUTPUT
|
|
131
|
+
$response = new Response(json_encode($product->toArray()));
|
|
132
|
+
|
|
133
|
+
//ENTITY MANAGER
|
|
134
|
+
$entityManager = $this->getDoctrine()->getManager();
|
|
135
|
+
$entityManager->remove($product);
|
|
136
|
+
$entityManager->flush();
|
|
137
|
+
|
|
138
|
+
}else{
|
|
139
|
+
$response = new Response();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
$response -> setStatusCode(Response::HTTP_OK);
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
catch (\Exception $e) {
|
|
146
|
+
$response = New Response(json_encode(array('error' => $e->getMessage())));
|
|
147
|
+
$response -> setStatusCode(Response::HTTP_BAD_REQUEST);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
return $this->setheaders($response,"DELETE");
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @Route("/api/products", name="products", methods = {"OPTIONS", "GET"})
|
|
158
|
+
*/
|
|
159
|
+
public function products()
|
|
160
|
+
{
|
|
161
|
+
|
|
162
|
+
$response = [];
|
|
163
|
+
try
|
|
164
|
+
{
|
|
165
|
+
//GET PRODUCTS
|
|
166
|
+
$repository = $this->getDoctrine()->getRepository(Product::class);
|
|
167
|
+
$products = $repository->findAll();
|
|
168
|
+
foreach ($products as $product) {
|
|
169
|
+
$response[] = $product->toArray();
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
//OUTPUT
|
|
173
|
+
$response = new Response(json_encode(array('items' => $response)));
|
|
174
|
+
$response -> setStatusCode(Response::HTTP_OK);
|
|
175
|
+
|
|
176
|
+
}
|
|
177
|
+
catch (\Exception $e) {
|
|
178
|
+
$response = New Response(json_encode(array('error' => $e->getMessage())));
|
|
179
|
+
$response -> setStatusCode(Response::HTTP_BAD_REQUEST);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
return $this->setheaders($response,"GET");
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
//CORS
|
|
187
|
+
function setheaders($response,$method) {
|
|
188
|
+
$response->headers->set('Content-Type', 'application/json');
|
|
189
|
+
$response->headers->set('Access-Control-Allow-Origin', 'http://localhost:4200');
|
|
190
|
+
$response->headers->set('Access-Control-Allow-Headers','Cache-Control,X-Requested-With,Content-Type');
|
|
191
|
+
$response->headers->set('Access-Control-Allow-Credentials','true');
|
|
192
|
+
$response->headers->set('Cache-Control','no-cache');
|
|
193
|
+
$response->headers->set('Access-Control-Allow-Methods',$method);
|
|
194
|
+
return $response;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace App\Entity;
|
|
4
|
+
|
|
5
|
+
use Doctrine\ORM\Mapping as ORM;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @ORM\Entity(repositoryClass="App\Repository\ProductRepository")
|
|
9
|
+
* @ORM\Table(name="product")
|
|
10
|
+
*/
|
|
11
|
+
class Product
|
|
12
|
+
{
|
|
13
|
+
/**
|
|
14
|
+
* @ORM\Id()
|
|
15
|
+
* @ORM\GeneratedValue()
|
|
16
|
+
* @ORM\Column(type="integer")
|
|
17
|
+
*/
|
|
18
|
+
private $productId;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @ORM\Column(type="string", length=255)
|
|
22
|
+
*/
|
|
23
|
+
private $name;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @ORM\Column(type="integer")
|
|
27
|
+
*/
|
|
28
|
+
private $price;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @ORM\Column(type="text", nullable=true)
|
|
32
|
+
*/
|
|
33
|
+
private $description;
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
public function getProductId(): ?int
|
|
37
|
+
{
|
|
38
|
+
return $this->productId;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public function setProductId(int $productId): self
|
|
42
|
+
{
|
|
43
|
+
$this->productId = $productId;
|
|
44
|
+
|
|
45
|
+
return $this;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public function getName(): ?string
|
|
49
|
+
{
|
|
50
|
+
return $this->name;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public function setName(string $name): self
|
|
54
|
+
{
|
|
55
|
+
$this->name = $name;
|
|
56
|
+
|
|
57
|
+
return $this;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public function getPrice(): ?int
|
|
61
|
+
{
|
|
62
|
+
return $this->price;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public function setPrice(int $price): self
|
|
66
|
+
{
|
|
67
|
+
$this->price = $price;
|
|
68
|
+
|
|
69
|
+
return $this;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public function getDescription(): ?string
|
|
73
|
+
{
|
|
74
|
+
return $this->description;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public function setDescription(?string $description): self
|
|
78
|
+
{
|
|
79
|
+
$this->description = $description;
|
|
80
|
+
|
|
81
|
+
return $this;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public function toArray() {
|
|
85
|
+
$vars = get_object_vars ( $this );
|
|
86
|
+
$array = array ();
|
|
87
|
+
foreach ( $vars as $key => $value ) {
|
|
88
|
+
$array [ltrim ( $key, '_' )] = $value;
|
|
89
|
+
}
|
|
90
|
+
return $array;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace App;
|
|
4
|
+
|
|
5
|
+
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
|
6
|
+
use Symfony\Component\Config\Loader\LoaderInterface;
|
|
7
|
+
use Symfony\Component\Config\Resource\FileResource;
|
|
8
|
+
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
9
|
+
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
|
|
10
|
+
use Symfony\Component\Routing\RouteCollectionBuilder;
|
|
11
|
+
|
|
12
|
+
class Kernel extends BaseKernel
|
|
13
|
+
{
|
|
14
|
+
use MicroKernelTrait;
|
|
15
|
+
|
|
16
|
+
private const CONFIG_EXTS = '.{php,xml,yaml,yml}';
|
|
17
|
+
|
|
18
|
+
public function registerBundles(): iterable
|
|
19
|
+
{
|
|
20
|
+
$contents = require $this->getProjectDir().'/config/bundles.php';
|
|
21
|
+
foreach ($contents as $class => $envs) {
|
|
22
|
+
if ($envs[$this->environment] ?? $envs['all'] ?? false) {
|
|
23
|
+
yield new $class();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public function getProjectDir(): string
|
|
29
|
+
{
|
|
30
|
+
return \dirname(__DIR__);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
|
|
34
|
+
{
|
|
35
|
+
$container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));
|
|
36
|
+
$container->setParameter('container.dumper.inline_class_loader', true);
|
|
37
|
+
$confDir = $this->getProjectDir().'/config';
|
|
38
|
+
|
|
39
|
+
$loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');
|
|
40
|
+
$loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');
|
|
41
|
+
$loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');
|
|
42
|
+
$loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
protected function configureRoutes(RouteCollectionBuilder $routes): void
|
|
46
|
+
{
|
|
47
|
+
$confDir = $this->getProjectDir().'/config';
|
|
48
|
+
|
|
49
|
+
$routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');
|
|
50
|
+
$routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');
|
|
51
|
+
$routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
namespace DoctrineMigrations;
|
|
6
|
+
|
|
7
|
+
use Doctrine\DBAL\Schema\Schema;
|
|
8
|
+
use Doctrine\Migrations\AbstractMigration;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Auto-generated Migration: Please modify to your needs!
|
|
12
|
+
*/
|
|
13
|
+
final class Version20190604101623 extends AbstractMigration
|
|
14
|
+
{
|
|
15
|
+
public function getDescription() : string
|
|
16
|
+
{
|
|
17
|
+
return '';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public function up(Schema $schema) : void
|
|
21
|
+
{
|
|
22
|
+
// this up() migration is auto-generated, please modify it to your needs
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public function down(Schema $schema) : void
|
|
27
|
+
{
|
|
28
|
+
// this down() migration is auto-generated, please modify it to your needs
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
namespace DoctrineMigrations;
|
|
6
|
+
|
|
7
|
+
use Doctrine\DBAL\Schema\Schema;
|
|
8
|
+
use Doctrine\Migrations\AbstractMigration;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Auto-generated Migration: Please modify to your needs!
|
|
12
|
+
*/
|
|
13
|
+
final class Version20190604101638 extends AbstractMigration
|
|
14
|
+
{
|
|
15
|
+
public function getDescription() : string
|
|
16
|
+
{
|
|
17
|
+
return '';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public function up(Schema $schema) : void
|
|
21
|
+
{
|
|
22
|
+
// this up() migration is auto-generated, please modify it to your needs
|
|
23
|
+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
|
24
|
+
|
|
25
|
+
$this->addSql('CREATE TABLE product (product_id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, price INT NOT NULL, description LONGTEXT DEFAULT NULL, PRIMARY KEY(product_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public function down(Schema $schema) : void
|
|
29
|
+
{
|
|
30
|
+
// this down() migration is auto-generated, please modify it to your needs
|
|
31
|
+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
|
32
|
+
|
|
33
|
+
$this->addSql('DROP TABLE product');
|
|
34
|
+
}
|
|
35
|
+
}
|