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/12508] phpbb(\extension)\finder should not depend on extension manager #2417

Merged
merged 9 commits into from
Jun 10, 2014

Conversation

nickvergessen
Copy link
Contributor

@Nicofuma
Copy link
Member

Nicofuma commented May 6, 2014

I thought you wanted to rename extensions to components in the finder.

@@ -7,7 +7,7 @@
*
*/

namespace phpbb\extension;
namespace phpbb;

/**
* The extension finder provides a simple way to locate files in active extensions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this comment be updated now?

The finder provides a simple way to locate files in the core and active extensions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@nickvergessen
Copy link
Contributor Author

@Nicofuma changing the word does not make too much sense, since we need to distinguish between core and extensions anyway.

if ($replace_list)
{
$this->extensions = array();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a line break for readability? At first glance I though this was if/else.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@imkingdavid
Copy link
Contributor

Code looks good.

new \phpbb\filesystem(),
dirname(__FILE__) . '/',
new phpbb_mock_cache()
);
$finder->set_extensions(array_keys($this->extension_manager->all_enabled()));
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't this using get_finder on the manager?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this is inside tests and we use a phpbb_mock_extension_manager

@nickvergessen
Copy link
Contributor Author

bump?

@nickvergessen
Copy link
Contributor Author

Rebased onto develop-ascraeus, so this should be ready for another review

@naderman
Copy link
Sponsor Member

I mentioned this on IRC before but can we please rename "set_extensions" to something like set_search_paths, and make the finder not have a reference to "extensions"?

@nickvergessen
Copy link
Contributor Author

@naderman I guess we want to keep the / hack for the core?
Or what is your idea to search for acp modules [path: 'includes/acp/'; prefix: 'acp_'; suffix: '.php'] for search path 1 (core) and in [path: 'acp/'; suffix: '_module.php'] for some other search paths?

@nickvergessen
Copy link
Contributor Author

@naderman fixed, can you take another look?

@bantu
Copy link
Collaborator

bantu commented Jun 4, 2014

@naderman

1 similar comment
@nickvergessen
Copy link
Contributor Author

@naderman

* @param string $core_path The path relative to phpbb_root_path
* @return \phpbb\extension\finder This object for chaining calls
* @param array $components A list of components that should be searched
* @param bool $replace_list Should the list be emptied before adding the components
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's called set, not append. Remove this parameter, if you want to "append" or "set" components there should be two separate methods.

@naderman
Copy link
Sponsor Member

naderman commented Jun 8, 2014

Missing param comments for the component option in a bunch of places, I still really don't like the architecture of this. You just renamed extensions to components for the finder. I think really the finder should just have to have a list of paths to search in, and not know anything about how components or core work etc. So maybe we should simply have one finder object contain a second core finder with different search paths? I mean you keep changing this around and putting a lot of work into it, I just don't see this improving the situation much?

@naderman
Copy link
Sponsor Member

naderman commented Jun 8, 2014

We should probably discuss what the real goal here is, before you continue?

@nickvergessen
Copy link
Contributor Author

@naderman bump again

@nickvergessen
Copy link
Contributor Author

Rebase and updated the CLI command from #2569

@naderman
Copy link
Sponsor Member

Working on this now :-) Will either replace with a new PR in a few hours or merge this, but one of those two is happening today!

@naderman
Copy link
Sponsor Member

Alright just merging this for now.

@naderman naderman merged commit 0134acd into phpbb:develop-ascraeus Jun 10, 2014
@nickvergessen nickvergessen deleted the ticket/12508 branch June 10, 2014 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants