All one have to do in Plesk to fix this problem is to add to the open_basedir “:/dev/urandom“. So it looks like this {WEBSPACEROOT}{/}{:}{TMP}{/}:/dev/urandom
All one have to do in Plesk to fix this problem is to add to the open_basedir “:/dev/urandom“. So it looks like this {WEBSPACEROOT}{/}{:}{TMP}{/}:/dev/urandom
Service needs to look like this
services: user.listener: class: AppBundle\EventListener\UserListener arguments: [ "@security.password_encoder" ] tags: [ { name: doctrine.event_listener, event: prePersist } ]
Listener should look like that
// AppBundle\EventListener\UserListener.php namespace AppBundle\EventListener; use Doctrine\ORM\Event\LifecycleEventArgs; use AppBundle\Entity\User; use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface; class UserListener { protected $container; public function __construct(UserPasswordEncoderInterface $encoder) { $this->encoder = $encoder; } public function prePersist(LifecycleEventArgs $args) { $entity = $args->getEntity(); $encodedPassword = $this->encoder->encodePassword($entity, $entity->getPassword()); $entity->setPassword($encodedPassword); } }
In a production environment you’ll eventually want to load assets (images, CSS and JS) from a different server. Perhaps you’re running your own asset server or you’re even using a CDN. This will require the files to be linked with an absolute URL. But in your development environment you don’t want this – you want assets to be loaded directly from the same server.
Read More
Ok, so I’m moving project from non framework PHP to Symfony2, and it goes very nice, except of Doctrine, I’m sure it’s me. I’ve been using MySQL for last 8 years and DQL vs SQL to me feels like i.e. taking snowboard for the first time, after skiing for 30 years. What I do after 30 min. of trying. I’m going back to rental place and I switch to skis. Below one can find skis.
Read More