I have a dxp_installer installation profile.
I want to use the container injection for a service which I use in hook_install_tasks_alter()
to verify the installation requirements. Note that I inject this service in one of my custom install forms construct, and not directly from the dxp_installer.install file.
I have defined this service in the dxp_installer.services.yml file. Now when I add container->get('dxp_installer.service')
, I get an error about calling a non-existent service. Note that Drupal isn't installed yet at this stage. Are service files only usable after Drupal is installed?
Meanwhile, the actual service class is accessible with $service = new InstallerService()
, which means the class is reachable by the class loader.
hook_install_tasks_alter
. I have made the correction in the original question. I'm also actually running this on Drupal 10, I've also updated the tags. So then areservice.yml
files allowed in Installation Profiles?