I thought this issue already existed, but couldn't find it. If someone else knows where it is, please mark one or the other a duplicate and merge.

The path alias lookup system needs to turn into a self-encapsulated service object.

- It should be a single object that takes a database connection in its constructor.
- It should offer two public lookup methods: getSystemPath() and getAliasedPath() (or something). These map 1:1 to drupal_get_normal_path() and drupal_get_path_alias(), respectively.
- There should be basic crud methods on the object, too. These should mostly be a direct port from the current code in path.inc.
- There *must* be an interface defined for all of the above.
- The path object must be added to the DIC.
- The PathSubscriber object should be instantiated via the DIC, and have the path object injected into it via the DIC.
- PathSubscriber should be updated to use the injected object rather than the current hard-coded functions.

There should be unit (not system, unit) tests for all of the above classes.

Who wants it? :-)

Possibly Related:
#464164: Move URL alias functionality into a Path API module (still separate from the Path UI)

Comments

cosmicdreams’s picture

Sounds fun, I'll take a shot at this tomorrow night.

berdir’s picture

Actually, we might want to close this as a duplicate of that first one and check that the patch there already does what Crell defined above.

berdir’s picture

Actually, we might want to close this as a duplicate of that first one and check that the patch there already does what Crell defined above.

Crell’s picture

I knew that issue existed somewhere...

I've not looked at the patch there, but I am sure the code is quite stale now with the kernel refactoring. So I can go either way on merging the issues, but the list in the summary here should be retained either way (as should the tags).

catch’s picture

Status: Active » Closed (duplicate)

Marking this as a duplicate of #1269742: Make path lookup code into a pluggable class. I copied the summary/tags over.

catch’s picture

Issue summary: View changes

Add related issue link