I need to encrypt my php project but the ZendGuard was discontinued and not support php 7.4.
Exists another options?
Related
I tried to follow the following tutorial https://bitgandtter.wordpress.com/2015/09/10/symfony-a-restful-app-security-fosoauthserverbundle/ to install OAUTH2 on symfony.
Nevertheless, there is no more an AppKernel.php file (everything works very well with the server).
I think that this file has been renamed to Kernel.php, but with this new versions I can't follow the tutorial (write new FOS\OAuthServerBundle\FOSOAuthServerBundle() inside).
So, is this step is no more needed with newers versions of symfony or I have to do something else?
Check your config folder: there should be a bundles.php that also contains references to the other bundles you've installed.
But as the repository for FOSOAuthServerBundle hasn't seen that many commits in the last months, you should probably use any other OAuth bundle like knpuniversity/oauth2-client-bundle or hwi/oauth-bundle instead
I have an old Symfony website which is using the framework bundle but no database is required for the content. This works fine till 4.4.18 but upgrading to the latest version is giving the following error:
An exception occurred in driver: could not find driver
I haven't modified DATABASE_URL in .env or configured the driver in config/packages/doctrine.yaml. Is there anyway I can simple disable the use of database?
Thanks to the comment from #cerad, removing doctrine-migrations package from composer.json helped with the issue.
As I am not using a Database for the site, this is fine for me.
if your app doesn't use the database the best course of action is to remove the doctrine/doctrine-bundle and/or symfony/orm-pack (if you've installed the orm support via pack)
if that's not an option than set the DATABASE_URL= to nothing (like that, not the empty string), or if you've hit some bug in dbal dsn parsing give it the dummy sqlite until the issue gets resolved DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
We have multiple vendor bundles (both external and internally written) that are installed into Symfony via Composer. So an example from composer.json of one would be:
"repoName/ThisBundle" : "dev-release/1.1.2"
So in the controller in Symfony, how could I request the version of "ThisBundle" or "repoName/ThisBundle" to return "dev-release/1.1.2"?
One of the bundles serves a template to all our apps, and in one of the apps I want to display the template version being used.
you just type
composer.phar show
Will show all the currently installed packages and their version information.
To see more details, specify the name of the package as well:
composer.phar show bundle/bundlename
That will show many things, including commit MD5 hash, source URL, license type, etc.
If you have container object available (and it is the case if you're in a controller) then you can get array of the enabled bundles by
$this->container->getParameter('kernel.bundles');
but remember, just the enabled bundle in the appkernal.php
good luck
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.
I am making application with symfony2
I want to use Google API library in this application.
Google API has
src/config.php
/Google_Client.php
/and so on..
I need to load this script from the DefaultController.php.
Where should I put the library,and how could I load the library from the DefaultController?
If it doesnt have framework like symfony2.
it is very simple though..
put library in the same directory and load
require_once 'src/config.php'
you simply can run
php composer.phar install google/api-client
in your projectfolder. It should install the api-client to your vendors.
As you mentioned, default the config resists in another file. A proper way around that would be to create a little bundle with a nice config, register the api as a client, and pass the config to your service.
I think, since you are using Symfony2, the best way is to use composer and that would install the library inside the vendors directory and be added to the autoloader.
Symfony2 and Google API integration