service.yml location - newbe question

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
johnh530
Registered User
Posts: 2
Joined: Sat Jun 08, 2019 12:42 pm

service.yml location - newbe question

Post by johnh530 » Sat Jun 08, 2019 1:31 pm

In the tutorial for authentication at:
https://area51.phpbb.com/docs/dev/3.2.x ... ation.html

====
An authentication provider that comes with phpBB requires a minimum of two files: a class and an entry in a config/auth.yml file. Authentication providers that are part of an extension must provide their own YAML file defining the service in addition to all normal requirements of an extension.
====

The config directory on the distribution shows directories:
====
default installer production
====

It appears that production directory has links to default directory
The config.yml file in default directory has:
====
# phpBB's config file (This line is needed because of the packager)
====

There is also a container directory in default directory which has service.yml with a number of included service_...yml files.

Later in the tutorial is states:
====
For proper dependency injection the provider must be added to services.yml. The name of the
====

Questions:

Am I in the right area for the service.yml file I need to create?
Do I need to make any changes to config.yml?
The services.yml file I need to create - Do I create a file in config/default/container and include it in config/default/container/services.yml?

johnh...

rxu
Extensions Development Team
Posts: 2911
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: service.yml location - newbe question

Post by rxu » Sun Jun 09, 2019 4:52 am

You shouldn't change phpBB core files ever. That's about your extension's directory, so your custom config.yml has to be located in your extension's /config subdirectory (not in phpBB core), so you just create /config/config.yml file in your extension, then you add some services into it.

johnh530
Registered User
Posts: 2
Joined: Sat Jun 08, 2019 12:42 pm

Re: service.yml location - newbe question

Post by johnh530 » Tue Jun 11, 2019 4:28 am

Thanks for your reply - I found the skeleton extension and created an auth extension - enabled it - and it shows up on authentication lists in the general tab of the ACP.

I still am confused by the documentation and don't seem to be able to get into the constructor of the class.

In my post I quoted the documentation about needing to add an entry to config/auth.yml then later talks about services.yml. I mistakenly switched config/auth.yml to config/config.yml - my bad.

I think you are indicating I need create the config/auth.yml file and add some service to it.
I have a services.yml file following the tutorial.

When I enable the authentication extension and select it as the authentication on the General->Client Communication->Authentication I am unable to login and any logging even in the constructor of the class does not occur. I'm pretty sure the object is not being created.
I see no errors in the apache logs.

Questions:
1) if config/auth.yml needs to be created exactly what does it need to look like? - what is it's relation to the services.yml file?
2) If making a change to an extension - either php or yml - is a disable and re enabling enough to get the changes be effective?
3) If there is an issue with config - are there any logs which record this issue?

johnh...

Post Reply

Return to “Extension Writers Discussion”