symfony4

composer could not resolve dependencies for hwi/oauth-bundle

烂漫一生 提交于 2019-12-11 17:18:04
问题 If I do $ composer require hwi/oauth-bundle I get this: Using version ^0.6.3 for hwi/oauth-bundle ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Restricting packages listed in "symfony/symfony" to "4.2.*" Your requirements could not be resolved to an installable set of packages. Problem 1 - Installation request for hwi/oauth-bundle ^0.6.3 -> satisfiable by hwi/oauth-bundle[0.6.3]. - hwi/oauth-bundle 0.6.3

PersisCollection in EntityType Form

拈花ヽ惹草 提交于 2019-12-11 16:54:51
问题 I am saving all of data from forms to JSON_arrays in DB. Now i got a problem with EventListeners. When i taking a data from $event->getClientsShippings() and try to pass it to 'choices' in another related Entity this gives me a error that: Catchable Fatal Error: Object of class App\Entity\ClientsShippings could not be converted to string I`ll try this: $shipping->getJson()["clients_shippings"]["name"] but there is another error that: Attempted to call an undefined method named "getJson" of

Access Liip Imagine bundle from Controller - assign service to variable (Symfony 4)

妖精的绣舞 提交于 2019-12-11 16:44:55
问题 On (Symfony 4) How do I access the Liip Imagine bundle from within PHP code? I found a solution to use the Liip Imagine Cache but I can't get it to work. Two solutions, neither of them work for me. I have absolutely no Idea why. When I try harmstyler's solution with $imagineCacheManager = $this->get('liip_imagine.cache.manager'); in my Controller then I get a ServiceNotFoundException Service "liip_imagine.cache.manager" not found: even though it exists in the app's container, the container

How to select a link using its id or its label with the symfony dom crawler?

自作多情 提交于 2019-12-11 15:51:42
问题 Is it possible to select a link using its id or its class with the symfony crawler? I tried: $crawler()->selectLink('#return-button')->link(); $crawler()->selectLink('.btn.return')->link(); But I have the error: InvalidArgumentException: The current node list is empty. Does the selector only works using the content of the a tag? 回答1: Yes, it only works with the link text or alt attribute if your link is an image. The filter() method uses the CssSelector component to transform a selector into

No error and no user in session after login form is validated in Symfony 4

不想你离开。 提交于 2019-12-11 15:47:12
问题 I'm trying to make a simple login form in Symfony 4 (followed this documentation: https://symfony.com/doc/current/security/form_login_setup.html). I have a user in database. If I enter wrong credentials in the login form, I get wrong credentials error messages. But if I enter right credentials I get redirected to home (default behaviour) but no sessions is started, the user is not in session. This is the SecurityController I'm using: <?php namespace App\Controller; use Symfony\Bundle

JMSSerializer Bundle - Circular Reference Error (Only on Prod Azure Environment) - Symfony4/Doctrine2 REST API

梦想的初衷 提交于 2019-12-11 14:49:43
问题 So I know somewhat similar issues have been discussed numerous times before but I haven't had any luck finding a solution with this specific issue. Running locally (using MAMP) I have no issues with my API responses. However once deployed to the production Azure server (via Ansible) I run into the dreaded error: request.CRITICAL: Uncaught PHP Exception Symfony\Component\Serializer\Exception\CircularReferenceException: "A circular reference has been detected when serializing the object of

MySQL in Docker returns “The server requested authentication method unknown to the client”

…衆ロ難τιáo~ 提交于 2019-12-11 10:47:04
问题 I use a Docker web stack for Symfony 4 project. MySQL configuration is : mysql: image: mysql container_name: sf4_mysql volumes: - .docker/data/db:/var/lib/mysql environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: *** MYSQL_USER: *** MYSQL_PASSWORD: *** The pulled image from Docker Hub is MySQL 8 and when I tried to create database with doctrine:database:create I received this message : 2018-09-17T11:53:51+00:00 [error] Error thrown while running command "doctrine:database:create". Message:

The BrowserKit component is not available

ε祈祈猫儿з 提交于 2019-12-11 10:44:19
问题 I've got an error when i try to launch my functional tests. "The BrowserKit component is not available." php ./bin/phpunit #!/usr/bin/env php PHPUnit 6.5.14 by Sebastian Bergmann and contributors. Testing Project Test Suite E.. 3 / 3 (100%) Time: 367 ms, Memory: 16.00MB There was 1 error: 1) App\Tests\Controller\DefaultControllerTest::testLoginPage LogicException: You cannot create the client used in functional tests if the BrowserKit component is not available. Try running "composer require

How configure php symfony4 app inside site subfolder (routing problem)

冷暖自知 提交于 2019-12-11 09:58:12
问题 I need to configure a symfony app inside a subfolder of a hosted domain. The app registers some route, for example /hello . The directory structure is: / (http root) /myapp (symfony app) /myapp/.htaccess (invisible redirect) /myapp/public /myapp/src /myapp/vendor /myapp/... With Apache mod-rewrite I redirect internally all urls from www.mysite.test/myapp/... to www.mysite.test/myapp/public/... . <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ myapp/public/$1 [L] </IfModule> Then

Allowing Symfony 4 and Doctrine for duplicate ManyToMany relations

只谈情不闲聊 提交于 2019-12-11 07:54:45
问题 I want to create ManyToMany relation with duplicate options. One USER can have many CARS and many CARS can belong to various USERs. At the same time, one USER can own many cars of the same type. How do I solve this in Symfony 4 and Doctrine? 回答1: Presumably you have two entities, as described, User and Car , and define a ManyToMany relation between them. It could look like this: User.php class User { // ... /** * @ManyToMany(targetEntity="App\Entity\Car", inversedBy="users") */ private $cars;