This seems like a small detail, but it may be important later.
In PHP 5.3 land, there are only two projects using lower-case for namespaces that I know of: Aura and Lithium. I.e., we have vendor\package\ClassName.
All the others (Zend, Symfony and its attached projects, Fuel, etc) are using capitals for their names: Vendor\Package\ClassName.
I'm thinking, to stay with what appears to be a community standard, we should use capitals as well. It probably means renaming the Git repos from aura.package to Aura.Package to keep with that.
Does anyone here have strong feelings about it one way or the other?
--
Paul M. Jones
http://paul-m-jones.com/
By not having those first few characters uppercase Aura might not
(strictly) correspond to the PSR-0 and thus some picky auto-loaders
might have trouble with it.
And I think it looks prettier; but that is personal ;)
+1 from my point of view.
By not having those first few characters uppercase Aura might not
(strictly) correspond to the PSR-0 and thus some picky auto-loaders
might have trouble with it.
And I think it looks prettier; but that is personal ;)
On Tue, 2011-06-07 at 15:09 -0500, Paul M Jones wrote:
> Hi all,
>
> This seems like a small detail, but it may be important later.
>
> In PHP 5.3 land, there are only two projects using lower-case for namespaces that I know of: Aura and Lithium. I.e., we have vendor\package\ClassName.
>
> All the others (Zend, Symfony and its attached projects, Fuel, etc) are using capitals for their names: Vendor\Package\ClassName.
>
> I'm thinking, to stay with what appears to be a community standard, we should use capitals as well. It probably means renaming the Git repos from aura.package to Aura.Package to keep with that.
> I am ok with it . So +1 . But some thoughts below .
>
> On Tue, 2011-06-07 at 15:09 -0500, Paul M Jones wrote:
> > Hi all,
> >
> > This seems like a small detail, but it may be important later.
> >
> > In PHP 5.3 land, there are only two projects using lower-case for namespaces that I know of: Aura and Lithium. I.e., we have vendor\package\ClassName.
> >
> > All the others (Zend, Symfony and its attached projects, Fuel, etc) are using capitals for their names: Vendor\Package\ClassName.
>
> OK. So namespace will be caps for first word .
>
> Eg : Vendor\Package\ClassName.
Correct.
> > I'm thinking, to stay with what appears to be a community standard, we should use capitals as well. It probably means renaming the Git repos from aura.package to Aura.Package to keep with that.
>
> But what about naming Aura.packge ? p as small letter itself ?
>
> My thoughts are because in this case ucfirst() and strtolower() will work . Else we may want to use some function to deal with it .
I thought about that, but the package name is part of the namespace name. For consistency between the package names and the namespace names, the namespace Vendor\Package should be represented as Vendor.Package (note the capital p) in the filesystem.
Regarding transformations between package and namespace names, I don't imagine it's going to be a big deal. In all cases I can think of, we have explicit mappings in config for that kind of thing. Is there something in particular you had in mind that presents a problem?
> Also capitalization doesn't looks good after the dot ( Personal opinion ) .
Yeah, I hear you. Personally I prefer the "lowercase namespace, capital class" convention, but that does not appear to have taken hold in the community. (What has taken hold is a direct translation of the PEAR_Naming_Convention from underscores to backslashes.) Sometimes you have to give up the little things. :-/
> I am ok with it ,
>
> But what about naming Vendor/Package ( two directory ) directory than Vendor.Package ( single directory )
Having a two-directory structure was my initial desire. In a lot of ways I prefer it, the same way I prefer having a single include-path and symlinking packages into it: it suits my organizational compulsions.
However, the 2-dir structure means you have to go through at least one more step when bringing in a package from another vendor. You have to make a directory for that vendor, make sure it's named properly, and then put the vendor package in place. With a 1-dir structure, you can download a package directly from Github and drop it into place. Much as I like the 2-dir idea, the 1-dir is easier all around, at little cost to the organizational structure.
Many Frameworks and/or Libraries require a top level folder (TLF); take
for example Zend Framework, which has Zend as TLF. Not to mention
symfony which requires you to create lib/vendor/symfony and then run an
installation script.
What I am trying to say is: People are used to placing their libraries
in a predefined folder structure.
If we really want to make it simple then drop-in distribution as a phar
archive combined with a 'aura install <package>' like command might mean
less hassle for developers. Though I do not know how feasable that is
(and how far off that is from the PEAR way of things).
My 2 cents
> Although I can see your point about reducing the effort needed to add
> packages I think that adding one additional directory won't make the
> difference.
>
> Many Frameworks and/or Libraries require a top level folder (TLF); take
> for example Zend Framework, which has Zend as TLF.
One difference here is that ZF is a monolithic distribution. You download the whole thing all at once, not several packages individually to mix-and-match.
> Not to mention
> symfony which requires you to create lib/vendor/symfony and then run an
> installation script.
I'd rather avoid an installation script. We have `update.php` right now, but that's specifically for while we're in development. The plan is to make the system use Git submodules if possible.
> What I am trying to say is: People are used to placing their libraries
> in a predefined folder structure.
Sure. All I'm saying is that the 2-level structure isn't free, even though I like it better in some ways.
There are other considerations as well. For example, I'd like for people to be able to match their Github (or whatever) repos to the package directory. In a 2-dir structure, that might mean the username and then the repo name; in a 1-dir structure, it's just the repo name.
> If we really want to make it simple then drop-in distribution as a phar
> archive combined with a 'aura install <package>' like command might mean
> less hassle for developers. Though I do not know how feasable that is
> (and how far off that is from the PEAR way of things).
PHAR performance is not that fantastic. And that adds a little extra development work; you have to PHAR up your package for distribution, vs. making it a plain download from Github. (Tradeoffs, always with the tradeoffs.)
Per the outcome of this discussion, I am about to rename all the "aura.package" Github repositories to "Aura.Package". I will email the list when it's done, and provide what notes I can about upgrading your systems.
> Per the outcome of this discussion, I am about to rename all the "aura.package" Github repositories to "Aura.Package". I will email the list when it's done, and provide what notes I can about upgrading your systems.
It is accomplished! You should be able to upgrade like so, from your Aura system directory:
# get rid of lower-case aura packages
rm -rf package/aura.*
# get the newest system updates
git pull
# run update.php to get the upper-case Aura packages
php update.php
At the worst, you can clone the system again and run `php update.php` to get the new packages.
Note that the Exceptions used to be Exception_Whatever, and are now Exception\Whatever. Similarly, web\hello_world (and the like) are now Web\HelloWorld.
Please let me know if you have any problems.