How to user symfony-cmf/simple-cms-bundle in symfony3 - symfony

I want to use symfony-cmf/simple-cms-bundle in symfony3.2 but It's support only symfony2. So I am looking to avoid check version at the time of development and will update on production.
Is it possible by pass validation through any configuration or command for temporary basis into composer or any other place.

Related

How can I change application secret in a production orocommerce installation?

In the docs for Symfony 4.4, for the 'secret' configuration option https://symfony.com/doc/4.4/reference/configuration/framework.html#secret, it mentions:
As with any other security-related parameter, it is a good practice to
change this value from time to time. However, keep in mind that
changing this value will invalidate all signed URIs and Remember Me
cookies. That’s why, after changing this value, you should regenerate
the application cache and log out all the application users.
Is this also the preferred practice for orocommerce production instances? Can I be sure that my application will still run the same after clearing and warming up the production cache?
I found no information about the involved processes in the orocommerce docs.
I am using OroCommerce version 4.1 with Symfony 4.4.
You can set the application secret using the environment variable ORO_SECRET, and changing the variable later in runtime will not affect the application cache at all.
Alternatively, if you don't want to use environment variables, you can hardcode the secret value in the parameters.yml file.
The "secret" is not documented in OroCommerce, because it's already mentioned in Symfony framework documentation.
As for the second question, clearing the cache on the production instance is not safe. You should put the application to the maintenance mode before doing that. The full procedure is described in the OroCommerce upgrade guide.

Add requirement to Symfony system

In my Symfony project I'm using OpenSSL to encrypt/decrypt data. I can check if the cipher method that I want to use is avilable using openssl_get_cipher_methods(), but I dont want to perform this check everytime I run my code.
On the other hand Symfony has a way to check the system requirementes needed to run the project: https://symfony.com/doc/3.4/reference/requirements.html.
Is there a way I can add a new system requiremente to be checked? This way I could check for the available cipher just once and not everytime.
Symfony requirements checker is part of Symfony distribution bundle and it is static.
However you can use Composer scripts to perform required tasks upon install update or you can implement Symfony cache warmer that will perform required tests during Symfony cache building process that is essential part of every Symfony application.

Map an entity in symfony 4

How about, I have a problem and it is before in symfony3 was run in the console:
php bin/console doctrine:mapping:import MiBundle yml
and generated and map an entity of the database but in Symfony 4 the command in the console is always the same, but the bundles are no longer occupied in the latest version so the previous command as it is does not work anymore, Someone could help me...
likewise generate the get and set
When using the new Symfony 4 directory structure without bundles the commands for importing the mapping and creating entities from an existing schema in the DoctrineBundle will no longer work properly. There is currently an ongoing discussion whether to update them, but the Doctrine team considers those tools counterproductive. You are not meant to blindly map the schema 1:1 to your domain model.
The best advice I can give for now is to temporarily create a bundle and then move the resulting files. This is also the workaround suggested in the github-issue regarding this: https://github.com/doctrine/DoctrineBundle/issues/729
The Symfony team is moving some of those commands into their own MakeBundle, but I don't think this command is already in there. Maybe you want to follow their progress.

Equivalent of Laravel Seeders on Symfony?

I'm developing a web site with Symfony. I'm new on this framework. Before i used Laravel 5.0 and I need to have a database with rows.
I create my db with command prompt but now I don't find how to seed it.
There is a equivalent of Laravel seeders on Symfony?
No. Seeding was a feature added by Laravel. You’ll need to use a third-party package to load seeds/fixtures into your application: http://www.sitepoint.com/data-fixtures-symfony2/
All the answers here are a bit outdated and this question is the first result on google so for future readers:
Since Symfony 3 there is an official bundle for this very purpose
Installation: composer require --dev doctrine/doctrine-fixtures-bundle
Then write your fixtures in src/DataFixtures and run php bin/console doctrine:fixtures:load
Try this package https://packagist.org/packages/evotodi/seed-bundle. Looks like it's what you need.
Their readme
Symfony/Doctrine Seed Bundle
Used to load/unload seed data from the database. Example would be to load a table with a list of states and abbreviations, or populate the users table with initial admin user(s). Unlike the DoctrineFixturesBundle which is mainly for development this bundle is for seeding the database before the initial push to production.

Installing sfGuard without changing db

I am to integrate sfGuard plugin with existing application. What I want to do is to keep as much code as possible untouched. Any guides? It'd be perfect if I can use actual database schema, or bind it somehow to be used by sfGuard. I know about setting userProfile class but I'm not sure how should I get to it, not to destroy my app.
Greetings
Just install plugin. And try make migrations. doctrine::generate-migrations-diff
php symfony doctrine:generate-migrations-diff
And migrate php symfony doctrine:migrate :
php symfony doctrine:migrate
Check out question: Rebuild model without loss data in MySQL for Symfony

Resources