IRCloggy #auraphp 2013-03-27

Logs Search ←Prev date Next date→ Channels Documentation

Provider of IRC logs since 2005.
WARNING: As Freenode became unjoinable and lost all warnings in topics, we cannot log channels on Freenode anymore.

2013-03-27

stanlemon joined00:25
pmjones well hi there stanlemon00:33
nice to see you :-)00:33
stanlemon hey pmjones - nice to see you as well00:33
harikt joined00:45
harikt Hey good day guys00:45
Good day pmjones :)00:45
pmjones well hello there harikt :-)00:45
nice to see you dude00:45
harikt I just saw your mail regarding the Package oriented autoloader .00:45
pmjones ah so?00:45
harikt wondering what is your intention making like that00:46
pmjones frankly, it was how the aura packages used to be set up ;-)00:46
harikt yes I recall it :)00:46
pmjones and it *does* reduce the number of directories/depth/hierarchy in packages00:46
i realized that PSR-0 came out of "a single central include path"00:47
harikt But you already have the directories on top00:47
pmjones and since we don't have that any more with composer, it seemed to make sense to update the related ideas00:47
"you already have directories on top" -- and?00:47
dropping two off the bottom makes it a lot easier when looking at the packages in, e.g., a browser or a text editor00:47
harikt so the depth hierarchy will not reduce .00:48
pmjones it does reduce it, by two, when looking in (e.g.) src00:48
and it gets rid of the repeated naming00:48
harikt So the remaining namespace will be having a directory itself as in PSR-0 ?00:48
pmjones vendor/package/src/Vendor/Package00:48
yes00:49
so for a class Vendor/Package/ClassName, it would be in (e.g.) vendor/package/src/ClassName00:49
.php00:49
harikt I was thinking for Vendor\Package\Hello\World\ClassName => vendor/package/src/Hello/World/ClassName.php00:50
pmjones yes, that works under the proposed system00:51
harikt and may be I wonder whether we could add a single file many classes also to the proposed one.00:51
Let me give you an example.00:51
Here is the gist pmjones https://gist.github.com/harikt/525068600:56
pmjones not sure what you're trying to do there00:56
harikt We don't need to write so many classes for Exceptions00:58
a single file helps.00:58
normally the extended Exceptions doesn't have any code and is similar to require a single file.00:59
pmjones so your argument is that there should be a way to say "there are also lots of classes in this file here, load it if you don't find the class file elsewhere" ?00:59
harikt yes01:00
pmjones thinks01:00
harikt see an example of the issue https://github.com/nette/nette/blob/master/Nette/common/exceptions.php01:00
pmjones in a way, that may defeat the purpose of autoloading01:00
if you're going to have a file with a lot of classes in it, perhaps the thing to do is to compile all your classes into a single file and load just that01:00
voila, no need to autoloading, just include the file01:00
harikt But I am not sure if there is nothing in the class, will that also make trouble ?01:01
may be we want to make a benchmark.01:01
:)01:01
pmjones benchmarking here would not show much01:02
harikt See the above one, you can see the classes has no methods nor properties01:02
pmjones in production, you'd have everything loaded into memory anyway01:02
so the number of files would not be a factor01:02
harikt ok.01:03
one more question for you.01:03
In aura, how does the drop functionality of package work when you bring vendor/package/src/ClassName.php . You will move the src and tests to inside the vendor/package ?01:04
I was asking about the github01:05
github.com/auraphp/Aura.Package/aura/package/src , github.com/auraphp/Aura.Package/aura/package/tests ?01:05
pmjones the proposal specifically makes an allowance for PSR-0 packages, provided they have at least 2 namespace levels and no underscores in classes01:06
you would addPackage('Aura\Sql', '/path/to/Aura.Sql/src/Aura/Sql') in that case01:06
so the aura packages as they are would not have to change01:07
harikt no I was not asking about how you add .01:07
pmjones now, future releases (version 2 releases maybe?) could take advantage01:07
harikt ok I got it now.01:07
pmjones ah ok01:07
harikt and also I don't know whether composer will reduce this vendor/package name01:08
so the composer still will be having vendor/aura/package/aura/package/src/ClassName.php also01:08
pmjones no, it would be vendor/aura/package/src/ClassName.php01:09
as vs what we have now, which is vendor/aura/package/src/Aura/Package/ClassName.php01:09
harikt ok, may be there is some configuration to remove the aura/package on installation ?01:10
pmjones why?01:10
it'd work both ways01:10
all that would be needed is to point the autoloader to the right directory01:11
harikt For eg : as I mentioned github.com/auraphp/Aura.Sql/aura/sql/src/ files01:11
pmjones i addressed that above01:11
harikt aah ok. You are assuming all have the vendor / package01:11
directory .01:11
pmjones correct01:11
harikt Thank you for clarifying .01:11
pmjones that's one of the rules listed :-)01:11
sure thing01:12
harikt I guess you will get enough time to make this one pass ;)01:12
pmjones ha!01:13
no, i'm not trying to "make it pass"01:13
i'm testing the water, so to speak, to see if anyone else thinks it's useful01:13
harikt It is gone to fig :-) , we can see the thread going01:13
pmjones esp. given the reasons why we have PSR-0, and the idea that there's no more "main central directory" for source files01:13
harikt left01:18
pmjones left01:26
harikt joined01:30
harikt I typed something but was put from irc .01:31
for the record I mentioned about01:32
Previously ralph mentioned in a comment01:32
The toplevel vendor/package name for tests makes the editors itellicence an issue .01:32
For eg : when the tests/ClassTest.php also sharing the same namespace .01:32
So he was using a Vendor/PackageTest as namespace .01:32
Do you have any thoughts addressing the same .01:32
harikt left01:33
stanlemon left01:49
stanlemon joined01:56
stanlemon left02:43
pmjones joined15:08
agentile_agentile18:47

Logs Search ←Prev date Next date→ Channels Documentation