Modules and themes (and engines) would have a namespace such as
namespace drupal\taxonomy;
or
namespace drupal\bartik;
Function prefixes, such as 'taxonomy_' would be dropped.
However, this makes Drupal code really ugly.
Calling functions not in a module from a module would look like this:
\drupal\set_message();
Calling a db function would look like this:
\drupaldb\select('node');
Calling an API function in another module would look like:
\drupal\taxonomy\select_nodes();
The solution? Namespace importing.
Every PHP file in a module would need to declare which namespaces it needs to access, e.g.
Proposal for fixing PHP namespacing in Drupal 8 | Blog post | Blue Droplet Media
I am nobody's puppet.
Disclaimer: My blogs are not a reflection of my employer's opinions, but are my own, and often unfiltered. Also, some links on this site may be part of an Amazon Associates program, so by clicking on them you help me pay for my independence.
[[{"type":"media","view_mode":"media_preview","fid":"25","link_text":null,"attributes":{"alt":"Acquia Certified Developer","title":"I am an Acquia Certified Developer","height":147,"width":147,"style":"width: 60px; height: 60px;","class":"media-image media-element file-media-preview"}}]] [[{"type":"media","view_mode":"media_preview","fid":"15","link_text":null,"attributes":{"height":180,"width":180,"style":"width: 60px; height: 60px;","class":"media-image media-element file-media-preview"}}]]
[[{"type":"media","view_mode":"media_original","fid":"13","link_text":null,"attributes":{"height":68,"width":310,"style":"width: 190px; height: 42px;","class":"media-image media-element file-media-original"}}]]
- Thanks again, Steve. I hope14 years 1 month ago
- Hi - bit late responding here14 years 1 month ago
- Should have added...14 years 2 months ago
- Hi Ryan,14 years 2 months ago
- Ryan,14 years 2 months ago
- It is happening and you are14 years 5 months ago
- In close future I want to14 years 8 months ago
- the article has been14 years 9 months ago
- I think it's a great coup for14 years 9 months ago
- My hardware box acts as an14 years 10 months ago
