eviL3 wrote:IMO the code base of AutoMOD needs to be cleaned up. There needs to be better separation of concerns, less dependencies between the components. The MODX parser should use SimpleXML and XPath. There should be an API that can be used to install MODs programatically without having to load the whole phpBB environment with $template, trigger_error, etc.
Yes, yes, and yes.
Since this is a new addition to phpBB, there's a lot you can do with it. You can use dependency injection (passing information into classes instead of depending on globals).
Dependency injection is an interesting idea, especially for things like the $db and $user objects...
You can use Exceptions instead of trigger_error, which means you don't have to worry that trigger_error will mess up your CLI output.
Another reasonable idea.
The file writing API is frankly a bit of a mess. Since there is a proper storage abstraction planned for 3.1, it may be possible to use that too for FTP, SFTP, etc.
Before I could fully comment, I'd need more information on what exactly will be implemented as this "storage abstraction."
First I've heard about this. Someone care to elaborate?
====================
nn' wrote:I would like a facility to convert modx files to patch files and sql files.
I'm not seeing the broad applicability of a feature like this.
====================
code reader wrote:recently we switched to git. it is very reasonable to assume that every MOD developer has a full repo of the code.
Git is irrelevant, because it provides nothing (with regards to creating diffs) that could not be done with SVN or even CVS.
====================
nn- wrote:A patch with colored additions/removals, configurable amount of context, line numbers and ability to view new and old version of the file is very readable.
If you, the person reading this, consider patch files unreadable I suggest reading some diffs in trac.
This has been the default view for patches in web interfaces for years, and while its nicer than the pure .diff file, it is still not intended for human application. This is a stated goal of phpBB for the forseeable future. Furthermore, I don't think anyone has the will to force another completely new format on MOD authors. (And for what its worth, I would argue not all MOD authors, probably not even a majority, are familiar with patches, so it would be new to them)
===================
imkingdavid wrote:I just think that having to first apply all the code changes with one program and then apply the sql with another is too much. Personally it isn't too big of a deal, but I think that the majority of admins would appreciate a more single-step approach. So if it is split into multiple files I think that the other file should still be run by AutoMOD to decrease the amount of steps required.
In principle, I agree.
=================
nn- wrote:Even if patch can't express inline finds, at the moment of installation automod locates the lines it's going to modify and alter them. If in fact modx inline finds cannot be translated to patch hunks using modx information only, then patch generation is actually domain of automod as opposed to modx tools contrary to what was stated earlier.
I don't think I follow the logic. What does patch generation have to do with installing a MOD?