'Executes task phase, ie. call all enabled plugins on the task.
Fires events:
* task.execute.before_plugin
* task.execute.after_plugin
:param string phase: Name of the phase'

def __run_task_phase(self, phase):

    if (phase not in phase_methods):
        raise Exception((u'%s    is    not    a    valid    task    phase' % phase))
    if (phase in [u'input', u'filter', u'output']):
        if (not self.manager.unit_test):
            for p in self.plugins(phase):
                if (not p.builtin):
                    break
            else:
                if (phase not in self.suppress_warnings):
                    if (phase == u'filter'):
                        log.warning(u'Task    does    not    have    any    filter    plugins    to    accept    entries.    You    need    at    least    one    to    accept    the    entries    you        want.')
                    else:
                        log.warning((u"Task    doesn't    have    any    %s    plugins,    you    should    add    (at    least)    one!" % phase))
    for plugin in self.plugins(phase):
        if (phase in self.disabled_phases):
            return
        self.current_phase = phase
        self.current_plugin = plugin.name
        if (plugin.api_ver == 1):
            args = (self,)
        else:
            args = (self, copy.copy(self.config.get(plugin.name)))
        with Session() as session:
            self.session = session
            try:
                fire_event(u'task.execute.before_plugin', self, plugin.name)
                response = self.__run_plugin(plugin, phase, args)
                if ((phase == u'input') and response):
                    for e in response:
                        e.task = self
                    self.all_entries.extend(response)
            finally:
                fire_event(u'task.execute.after_plugin', self, plugin.name)
            self.session = None
    if (phase == u'prepare'):
        self.check_config_hash()
