Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4083250
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:17:21+00:00 2026-05-20T18:17:21+00:00

I am working with a plugin in symfony 1.4, and would like to add

  • 0

I am working with a plugin in symfony 1.4, and would like to add a listener for a task from another plugin. When the user does php symfony doctrine:build I want my plugin to run a task of its own. Where/how do I register the listener? I did not have any success with http://www.symfony-project.org/gentle-introduction/1_4/en/17-Extending-Symfony

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:17:22+00:00Added an answer on May 20, 2026 at 6:17 pm

    Actually you can hook your code to any symfony task. Have a look at sfBaseTask::doRun method. Any task, when is executed, emits 2 events: command.pre_command and command.post_command.

    Create a class to store you code, for example:

    class toolkitEvents
    {
      static public function commandPostEventHook(sfEvent $event)
      {
        $task = $event->getSubject();
        if ($task->getFullName() === 'doctrine:build')
        { 
         //do stuff or call another task
        }
    }
    

    and connect this method to a dispatcher when initializing your plugin:

    class yourPluginConfiguration extends sfPluginConfiguration
    {
      public function initialize()
      {
        $this->dispatcher->connect('command.post_command', array('toolkitEvents', 'commandPostEventHook'));  
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i use Symfony 1.4 and Doctrine 1.2. I installed plugin http://www.symfony-project.org/plugins/sfCkPlugin if i add
I'm currently working on a jQuery plugin and I'm wondering if it would be
Does anyone here has working nbgit plugin with Netbeans 6.9? I've seen some patches
I had the comment plugin working fine, along with the like button and then
I have AS (as a plugin) working in another app just fine (I dont
I finally got the DelayedJobs plugin working for Rails 2, and it does indeed
I have the fullcalendar jQuery plugin working, but I'd like to show more data
I've got a (mostly) working plugin developed, but since its function is directly related
I've got my autocomplete plugin working perfectly... except I have certain info that I
I am trying to get this awesome JQuery plugin working with SQL Server. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.