We should support autoloading classes, and not hardcoding the paths to service classes so that they can live in contrib drush commands. This will require a fair bit of refactoring, and some work on: #1316322: Add PSR-0 autoloader to drush. We could re-factor to a PECL style naming of classes, or use PHP 5.3 and start using namespaces, or do the first, and then move to namespaced code later.

Thoughts?

Comments

Steven Jones’s picture

Title: Refactor code layout of classes using autoloaded » Refactor code layout of classes using autoloader
anarcat’s picture

Good idea.

Steven Jones’s picture

Status: Active » Needs review

Basically spent the day moving and renaming classes in the following branch:

dev/1318374-autoloader

Seems to be working, and supports extending provision services without putting your code in amongst provision code, hurrah!

This uses a slightly modified version of the Symfony2 autoloader, with the PHP 5.3 bits removed (one line) and I've renamed our classes to use a more PEAR like syntax where possible.

Steven Jones’s picture

Status: Needs review » Fixed

I've pulled this into the 6.x-2.x branch, and will now document this as fully as possible.

omega8cc’s picture

Category: task » bug
Status: Fixed » Needs work

There are major bugs introduced in the SSL templates, where you still have old, no longer existing paths like include('http/apache/vhost.tpl.php');

Steven Jones’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 2d6cfcd on 6.x-2.x, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by Steven Jones:
    Issue #1318374 by Steven Jones: Refactor code layout of classes using...