[Owncloud] namespacing

Bart Visscher bartv at thisnet.nl
Thu Jul 26 12:37:24 UTC 2012


On Wed, Jul 25, 2012 at 06:33:06PM +0200, Arthur Schiwon wrote:
> A follow up on this.
> 
> The suggestion was actually to use \OCA_appid\ as namespace, what i
> did was to support the pattern \OCA\appid\ in the autoloader.
> 
> The first pattern is e.g. used in the app files_version
> 
> namespace OCA_Versions;
> class Hooks { .. }
> 
> Having two different approaches is of course bad style and should be
> avoided. Frank and I wonder now, what the better and more intuitive
> way is: \OCA_appid\ or \OCA\appid\
> 
> Thoughts, opinions?

\OCA\appid\ cleaner and simpler to parse

Bart

> 
> Cheers
> Arthur
> 
> 
> On 07/25/2012 01:05 PM, Arthur Schiwon wrote:
> >Digging up this...
> >
> >On 04/23/2012 05:23 PM, Frank Karlitschek wrote:
> ><....>
> >>>So lets use the OC, OCP and OCA_<appid> namespaces.
> >>
> >>I heard that this wasn??t clear enough.
> >>Yes. We use the PHP namespaces :-)
> >
> ><....>
> >
> >I refactored my LDAP app a bit and while doing so i extended our
> >autoload function with support for the OCA namespace.
> >
> >E.g. i can have now stuff like this in apps/user_ldap/ and this way
> >extend a class in apps/user_ldap/lib/
> >
> >namespace OCA\user_ldap;
> >
> >class USER_LDAP extends lib\Access { ... }
> >
> >
> >It is not forced to use a namespace, other apps will work as they did
> >before. Nevertheless, since we agreed some time ago on using those
> >namespaces it's not a bad idea to switch to this pattern, betimes.
> >
> >Cheers
> >Arthur
> 
> _______________________________________________
> Owncloud mailing list
> Owncloud at kde.org
> https://mail.kde.org/mailman/listinfo/owncloud



More information about the Owncloud mailing list