RFC-6 Namespace: State of change and ORM namespace introduction

67 views
Skip to first unread message

Damian Mooyman

unread,
Jun 26, 2016, 10:54:55 PM6/26/16
to SilverStripe Core Development
Hey all, we have begun implementation of the RFC-6 (https://github.com/silverstripe/silverstripe-framework/issues/4562) which was posted quite some time ago.

We have been hard at work to not only implement this namespacing, but also ensure that users upgrading to SilverStripe 4.0 will have the tools available to adapt their code to the changed class structure. To this effect we've developed a silverstripe-upgrader tool which users can run to automatically resolve about 90% of all changed code references. https://github.com/silverstripe/silverstripe-upgrader. This is, itself, the tool we have used to perform the namespace addition on various parts of the framework, so hopefully it'll be well tested by the time beta is ready for public use.

For instance, renamed classes (such as ArrayList -> SilverStripe\ORM\ArrayList) will be detected within code references (such as string or class literals) and the appropriate name substitutions and/or use statements will be automatically added to user code. In cases where string literals contain values which happen to match renamed classes, but aren't actually class references, users can add a `/** @skipUpgrade */` flag before any such codeblocks to control the behaviour of the tool.

Another feature developed to assist with this upgrade is the new `table_name` config, which may be applied to namespaced classes to prevent their table names from undesirably being changed. https://github.com/silverstripe/silverstripe-framework/pull/5646

The first pull request for namespacing is ready for public review at https://github.com/silverstripe/silverstripe-framework/pull/5734, and addresses the namespacing of the `ORM` section, which was renamed from the previous `Model` section.

Subsequent work on namespacing will focus on the Security section, and hopefully will be available for review later this week.

Please post your feedback on the pull request above.

Thank you all for your contributions! :D

Kind regards,

Damian

Damian Mooyman

unread,
Jun 28, 2016, 8:30:09 PM6/28/16
to SilverStripe Core Development
As a follow up to this, we have now raised a pull request for the security subsystem.


The upgrade process for this will follow the same process as previously posted.

Damian Mooyman

unread,
Aug 9, 2016, 12:21:39 AM8/9/16
to SilverStripe Core Development
Hello all!

As we are continuing to add namespaces to the rest of the framework, I have drafted up an updated plan for the subsequent classes.


If anyone would like to have a say in how we apply these namespaces, please let me know your feedback on this issue directly.

Kind regards,

Damian
Reply all
Reply to author
Forward
0 new messages