I want to create custom events called user_logged so that i can attach my listeners to those events.
I want to execute few functions whenever user has logged in.
I'm experimenting in building CLI tools using the Symfony2 console library. I've got something basic working and now I want to package it as a phar. I've read a few examples but the ones I've seen are very simple (3 files, no namespaces, etc).
In my…
I'm using symfony/dependency-injection component (note: not using the full stack framework)
When registering a new service i want to inject in the constructor a new instance of a class. Example:
$container->register('session',…
I use Symfony Standard Edition and try to get Symfony Finder component like a service, but not found it. To use the Finder, I need to create it manually like:
$finder = new Symfony\Component\Finder\Finder();
Why I can't get it from service…
I ran php artisan queue:listen and after about 27 minutes, it stops processing any more jobs. In my error log, I see the error:
exception 'Symfony\Component\Process\Exception\RuntimeException' with message 'The process timed out.' in…
By default Symfony Finder Component sorts files by ASC order.
//sorting by ASC order
$finder->files()->in($this->getDumpPath())->sortByModifiedTime();
How can I sort files by DESC?
I'm scraping from a UTF-8 site, using Goutte, which internally uses Guzzle. The site declares a meta tag of UTF-8, thus:
However, the content type header is thus:
Content-Type:…
I have two commands defined in a Symfony console application, clean-redis-keys and clean-temp-files. I want to define a command clean that executes these two commands.
How should I do this?
I need allow types that implement two interfaces (Foo and Bar), not one of them.
interface Foo {};
interface Bar {};
class Foz implements Foo {};
class Baz implements Bar {};
class Foobar implements Foo, Bar {};
$resolver = new…
I want to develop an interactive command based php application, so I did some research and bumped into the Symfony\Console component. This is great, because it lets met run
php script.php command --option
However, the script then runs the command…
I'm currently integrating the Symfony Validator Component into a custom PHP Application. So far, everything has been working pretty nice and I can validate my User input.
Now I want to translate the validation messages to another locale and have…
I am using Symfony's console component, in a command with 1 required option and 1 required argument.
However, upon execution the option and argument are NOT required.
Am I missing something? Relevant code below.
protected function configure()
{
…
I want to integrate Doctrine ORM into my (non-Symfony) project. I already done this in another project and used the famous cli-config.php into the project root directory.
But now, in my new project, I use the Symfony Console component and the…
I am currently creating a bundle which can rename fooAction into fooAjaxAction if request is an Ajax Request.
As the answer of that question says, I have to extend the controller resolver class.
I have a ResourceNotFoundException if I change the…
I would like to be able to use nested parameters defined in one configuration file in another for examle
# config/config.yaml (my custom configuration file)
database:
driver: pdo_mysql
host: localhost
user: dev
password: dev
…