Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ticket/12784] Allow the extensions to add a custom auto loader #2674

Merged
merged 2 commits into from Jul 3, 2014

Conversation

@Nicofuma
Copy link
Member

Nicofuma commented Jun 28, 2014

@@ -103,6 +103,8 @@
require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
$phpbb_container->get('dispatcher')->dispatch('core.auto_loader', null);

This comment has been minimized.

Copy link
@nickvergessen

nickvergessen Jun 28, 2014

Contributor

dispatch() does not need the second parameter?

This comment has been minimized.

Copy link
@Nicofuma

Nicofuma Jun 28, 2014

Author Member
 * @param Event $event The event to pass to the event handlers/listeners.
 *                          If not supplied, an empty Event instance is created.
@@ -90,6 +90,8 @@
$phpbb_extension_manager = $phpbb_container->get('ext.manager');
$phpbb_subscriber_loader = $phpbb_container->get('event.subscriber_loader');
$phpbb_container->get('dispatcher')->dispatch('core.auto_loader');

This comment has been minimized.

Copy link
@bantu

bantu Jun 29, 2014

Member

I am not sure at all about having extension code in the avatar path.

This comment has been minimized.

Copy link
@Nicofuma

Nicofuma Jun 29, 2014

Author Member

Currently the extensions are loaded here.

This comment has been minimized.

Copy link
@nickvergessen

nickvergessen Jun 29, 2014

Contributor

extensions might want to restrict access to attachments, not sure about avatars though

@bantu

This comment has been minimized.

Copy link
Member

bantu commented Jun 29, 2014

This looks good to me. @nickvergessen What do you think?

@nickvergessen

This comment has been minimized.

Copy link
Contributor

nickvergessen commented Jun 29, 2014

Wanted to test with my extension first, will report back tomorrow

@nickvergessen

This comment has been minimized.

Copy link
Contributor

nickvergessen commented Jul 1, 2014

Okay, so an extension just does something similar to require(__DIR__ . '/vendor/autoload.php'); in the event listener.
Seems to work just fine then.

@nickvergessen

This comment has been minimized.

Copy link
Contributor

nickvergessen commented Jul 1, 2014

We should use the finder, instead of an event, otherwise if you need a vendor in the constructor of your listener it won't work

@bantu

This comment has been minimized.

Copy link
Member

bantu commented Jul 1, 2014

We should use the finder, instead of an event, otherwise if you need a vendor in the constructor of your listener it won't work

I am not sure I understand what that means.

@Nicofuma

This comment has been minimized.

Copy link
Member Author

Nicofuma commented Jul 1, 2014

updated. Now i use a "finder" instead of an event.
So now we are able to define a service which use a class added by a vendor.

),
\RecursiveIteratorIterator::SELF_FIRST
);
$iterator->setMaxDepth(3);

This comment has been minimized.

Copy link
@bantu

bantu Jul 1, 2014

Member

mindepth is also 3?

This comment has been minimized.

Copy link
@Nicofuma

Nicofuma Jul 2, 2014

Author Member

yes but there is no setMinDepth(int) method in the RecursiveIteratorIterator class.

nickvergessen added a commit to nickvergessen/phpbb that referenced this pull request Jul 3, 2014
[ticket/12784] Allow the extensions to add a custom auto loader

* Nicofuma/ticket/12784:
  [ticket/12784] Allow the extensions to add a custom auto loader
… files

PHPBB3-12784
nickvergessen added a commit to nickvergessen/phpbb that referenced this pull request Jul 3, 2014
[ticket/12784] Allow the extensions to add a custom auto loader

* Nicofuma/ticket/12784:
  [ticket/12784] Shearch the "vendor" folders and then the autoload.php files
  [ticket/12784] Allow the extensions to add a custom auto loader
@nickvergessen nickvergessen merged commit 520f3b3 into phpbb:develop-ascraeus Jul 3, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.