« first day (1529 days earlier)      last day (3402 days later) » 

9:00 AM
@crypticツ its url encoded thats why it wouldn't work
 
...
 
@DaveRandom Did you book your flight to belgium yet for fosdem?
 
@crypticツ ?
 
@PeeHaa I can't do that weekend, otherwise I would totally be up for that :-(
I will have a word with Her In Charge and see if I can be allowed out
I doubt it though, somehow, family wedding (her family)
 
@DaveRandom :(
 
9:10 AM
has anyone seen @rdlowrey lately?
 
@Patrick Nope. He is doing his midlife crisis thing again, He needs to get away for a while sometimes to slack
 
I see, good to know. Thanks
Can anyone else here tag a new artax version?
 
@Patrick Leaving him a message in here usually works.
@Patrick Maybe @bwoebi ?
 
moin
 
mogguh joe
 
9:15 AM
Mornjoe
 
@PeeHaa I think he's family-christmas-etc-ing atm
 
yeah @Patrick ^ that
 
@mojoernwatingkins
 
9:16 AM
@phpRTBot, 127.0.0.1
I retweet a tweet about PHP every minute! Made by @jdf221
4.1k tweets, 189 followers, following 1.3k users
lad is 14
 
Mornings are devolving in to a keyboard mash.
 
the only rule is it has to start with mo to be a greeting ...
 
morning
 
mohaa (the @PeeHaa greeting) sounds like it might actually be a word ...
 
It's just that an amp change broke the last artax version (but it's already fixed in dev-master). I can't push to production without a version. So if nobody here can tag versions I'll fork it.
 
Mojito.
 
@Patrick I think that is your best short term bet
 
@PeeHaa lol
 
lol
 
9:22 AM
heheheh
 
You guys ever use Doctrine?
 
I sometimes use the dbal
*try to use
 
@Patrick Do you actually need the latest Artax? If not, recommend using older version of that rather than screwing up the dep tree. And if you do go ahead and fork it, don't post it on Packagist...
 
I use doctrine
 
@DaveRandom Post it on packagist and use replace for shits and giggles!
 
9:27 AM
@nikita2206 Ever had issues with it pulling a blank array on findAll()
 
@Fabor no. But anyway look at the logs what query was issued
If it's a symfony you can go to profiler
 
@DaveRandom I tried a few versions back but they all have a ~ dependency on amp so that doesn't help. We changed the code now to work with dev master, all I need is a stable tag.
 
http://thecodinglove.com/post/105950600447
The coding love
When the client asks how the project is going
kbironneau
1419327029
 
Cheers @nikita2206
 
@Patrick You could just manually adjust composer.lock... dirty hack but forking it would be as well so...
(to change the amp dependency)
 
9:41 AM
^ but then the next guy running a composer update will break everything again?
 
@Patrick By that point there will be another amp release. It's a temporary fix
Also @Patrick you should almost never run composer update anyway, update specific packages ;-)
 
you know if you open an issue on the github repo daniel might find five minutes to fix it for you ...
 
pshaw
 
9:45 AM
o i c
 
@Fabor so what was the problem?
 
@nikita2206 Stupidly just Product instead of Products.
First time with Doctrine, so checking it out.
 
Anybody knows of a decent vanilla PHP queue / worker thing?
 
@PeeHaa Beanstalkd + Pheanstalk works well enough.
Not vanilla PHP obviously as it's Beanstalkd.
 
I would love a plain php solution if possible
 
9:48 AM
@PeeHaa they broke a long time ago. "we are going to fix them next year" (read as never)
 
yay for temporary permanent issues \o/
 
9:59 AM
is that better or worse than permanent temporary solutions?
 
the same, permanency doesn't exist ... we made it up, probably because afraid of dying if I had to guess why ...
ergo everything is temporary, and so temporary permanent and permanent temporary are the same thing; temporary ...
 
@JoeWatkins you already had some beers didn't you? :P
 
I don't drink ...
 
He's a robot you see.
Every now and then we ship him some WD40 but that's about as much liquid as he needs.
 
10:04 AM
hehe
we could design a q @PeeHaa ...
it's semi interesting ...
I'm looking for a distraction because stuck on other things, and tired of thinking about them ...
 
@JoeWatkins yeh
 
if I mention threads, will it start an argument ?
 
Well if you guys do... please include an option to select single a batch jobs.
Or you could work on something to solve that select and lock issue I discussed with you Joe :P
 
The definitive list of things Apple cares about, in order --> http://t.co/vzhQfuDspJ
 
@JoeWatkins yes. Please mention them.
 
10:17 AM
I don't want to argue ... but the consumer can make really good use of parallelism, it even makes it simpler to program assuming that multiprocessing is the only other option, you need one or the other whatever ...
 
@JoeWatkins you mean to make it consume messages in batches?
 
producers don't need anything complicated, a producer need only insert a row into a table (or whatever chosen data store is), so they don't need pthreads ... but I really would thread the consumer, it obviously offers superior scaling in this circumstance ... I got a rough idea of how you might scale out, not as clear as the queue itself ... but I've thought about it for 20 minutes or whatever ...
@nikita2206 in parallel, batches or individual, the main thing is that you need to be able to consume faster than you produce for it to scale at all ...
if you have one process consuming and many many many processes producing then that won't go anywhere ...
 
@JoeWatkins usually it's just solved with many consumers on one message-channel
But this doesn't work when you need to insert into DB some heavy shit
Then batches is the way to go
 
@SergeyTelshevsky It's funny because it's true
 
@DaveRandom it is
 
10:25 AM
many consumers are difficult to program if those many consumer are distinct processes or even siblings, they cannot easily share, there are many ways around it but none of them superior to being in the same address space ...
if many consumers are just many threads, it's exceedingly easy to program ... it's also exceedingly easy to control (read be tolerant of errors, recover from disaster etc) 1 process with 32 threads vs 32 processes ...
 
@JoeWatkins probably you had such cases but I can tell that I didn't. What about managing threads you are right, not sure about PHP fatals tho - how pthreads works with it
 
a fatal error in a worker will not terminate the worker thread, only the current task executing ...
nor will uncaught ex.
 
okay then, it should at least lower memory consumption. (btw does pthreads share resources like zend_class_entry and func table between threads?)
 
@NikiC "I’ll only ue" <- typo
otherwise, excellent article
 
no, that's not allowed, shared nothing remember ... that always has to be true ...
it copies them as fast as opcache/apc does/did ...
nothing is ever shared, even when it seems like it ... there is just the right amount of magic to make it work safely, but we don't break rules ...
 
10:47 AM
Hello! Does anyone could solve me a doubt about Dependency Injection Containers ?
 
@korima Don't ask to ask just ask if somebody is here and wants to help they will
 
@NikiC "There are a number of advantages to this approach, some of them listen in the following:" - makes no sense. Not sure what you were going for there, maybe "some of which are:"?
 
@PeeHaa Ok, thanks! I didn't know. I'm user of this community a little time ago and I'm not very familiar with the "rules" xD
 
Mornings
 
BTW reading back my sentence there needs to be some punctuation in between "ask" and "if" @korima
@RonniSkansing Mornings
 
10:51 AM
@korima there is a link to the chat guidelines below the room name room-11.github.io
 
My question is about if there are some limits about what a dependency injection container should have? If a depepdency injection container too big it's a some king of code smell... If a dependency injection container should create all the objects that an app manages...
 
checks to see if it's friday
 
My doubts comes because a time ago, a friend, gave me an example code about that and it had a big di container that created all possible classes of the app. It was like a factory that instantiate all possible object with his dependencies.
 
@korima It builds objects on request I hope?
 
10:55 AM
@PaulCrovella it's not Friday
 
@PeeHaa Yes. My friend created a long list of dependencies.
For example, the container which create a view, behind of that, created her dependenies, a controller.
 
@korima I heard using a container is a anti pattern
Even heard it is almost as bad as just having globals
 
@korima that's all fine as long as you don't have a dependency on the container
obligatory Auryn
 
@RonniSkansing Is an anti-pattern if you pass to an object, in her constructor, the container, but if you give it the concrete dependencies, it's ok
 
@Gordon the sound is too terrible
 
10:59 AM
@Gordon Never mind xmas song, that is the most awesome thing evah
 
@Patrick you can use symfony's DiC like that too...
the docs only use it like that btw
 
@Patrick But what happens if your app has 500 classes. This classes are views, controllers, domain, data... Your DI container should create all her dependencies?
 
@FlorianMargaine what do you mean? docs here they are injecting it ($mailer = $this->get('my_mailer');)
 
Your class that represent that container will be huge if it creates all of them
 
@Patrick uh, didn't look at the same docs...
 
11:02 AM
@korima I would rather look into auto-wiring where possible
 
@Patrick there's even a section for it symfony.com/doc/current/components/dependency_injection/…
> Avoiding your Code Becoming Dependent on the Container
 
@korima if you are passing a container, how would you give it the concrete dependencies, aren't you pulling the dependencies out of a box inside X?
 
@PeeHaa Cannot help but read that as if you prefer screwing with the wiring in your car
 
@Fabor no, @rdlowrey has to… – I cannot.
 
@bwoebi Ah fair enough. Patrick was after it.
 
11:04 AM
@FlorianMargaine yeah as long as you do it properly, nothing wrong with the symfony container I guess. But the framework docs advocate bad practices (extends Controller + service locator). But to be fair there is a note for "advanced devs"
 
@DaveRandom better? or still an utterly confused brit?
 
how to add codeigniter view file
 
@RonniSkansing The error is passing a container when you should pass the concrete dependency. I call to the container for to it make me the instance of the object.
 
@PeeHaa E_PERPETUAL_CONFUSION
 
@korima so you do not pass the container to the controlller for example?
 
11:05 AM
@AniketDeshmukh rtfm and don't use codeigniter in 2014 unless it's a legacy app
 
@Patrick honestly though, the controller is already dependent on symfony, isn't it?
 
@FlorianMargaine it doesn't have to be
 
and by avoiding the service locator you at least make the dependencies clear
 
@RonniSkansing From what I understand, that is correct. The container what have to do is create the controller with her concrete dependencies. Not the controller access to the container to get her dependencies.
 
11:06 AM
ok @Patrick
but now i need help
 
@AniketDeshmukh why are you working on a codeigniter project when you don't even know how to make a view?
 
@Patrick this is by first aap i like too do that i don't know
 
@korima, okay, I thought you where talking about something else then. But it sounds like the container construction has alot of responsibilities
 
@AniketDeshmukh If it's your first app, please do not use CodeIgniter... It is completely outdated
 
@RonniSkansing Exactly. That was my initial question. If my app has 500 classes including views, controllers, domain objects, data objects... Should the DI container create all dependencies graph?
 
For example, if a call to my container to get a view, it will also call to controller but if a call to a controller, I will have also call to a business object, and if I call to a business object I will have to call a data object. It creates a long chain that I don't know if is correct on the container
 
@korima Yes where possible
Also note that a decent DIC is not just one file with 1000 responsibilities
Also note: that you simply don't always need a dic
 
@korima you don't have to define the chain for each "controller". you only define the dependencies for each class and the container resolves everything for you. your controller should not care about what your FooWriter class is using to save something. That's the point of dependency inversion
 
@PeeHaa TWSS
 
11:14 AM
:D
 
35
A: Dependency Hell — how does one pass dependencies to deeply nested objects?

GordonIt's a common misconception that dependencies need to be passed through the object graph. To summarize the example Miško Hevery gives in Clean Code: Don't look for things, a House that needs a Door, doesnt need to know about the Lock in the Door: class HouseBuilder { public function buildHou...

 
This other question talks about it: stackoverflow.com/questions/16461846/…
 
It's funny, because the only tool I've found to properly allow me to use DI whenever I want at just the right place, is Auryn.
Also,
 
Monring @Jimbo
 
That question I posted says that a DIC container too big it's a some kind smell that some goes wrong.
 
11:22 AM
@Jimbo laravel's DiC is similar, actually :)
 
@SergeyTelshevsky Bullshit, link?
@korima What's the question?
 
4
Q: When can Dependency Injection Containers become too big, and what can I do about it?

JimboWe all know the why Dependency Injection is awesome because it makes code less coupled, easier to test, and much nicer to read! And then some decide to use a Dependency Injection Container like pimple for PHP to assist with the Dependency Inversion principle in SOLID. So when creating your DiC u...

 
Yeah, that was my question @korima :P
@SergeyTelshevsky App::bind(
 
@Jimbo in no way do I say it's better or something like that, I liked the bindings though
 
11:23 AM
Already it can get the fck
 
@Jimbo true
 
@Jimbo Oh!!!!!! it's true!!!! xDDDDD jajajajja
 
@korima It was a fundamental problem with Di "container"
A container holds things, right? But if you shove all your objects into this container, and then pull one out when you need it within your object, that's a service locator, which is an anti pattern
 
@Jimbo but despite the statics, it still allows resolution and removes the need to pass everything everywhere
 
@SergeyTelshevsky I like the fact they now have auto resolution
 
11:26 AM
@Jimbo But then, in your question, if a DIC not have to create all objects, in some place I will have to do. Where?
 
@korima Yep, which you shouldn't do
 
@Jimbo it's there at least from 4.0, that was the time when I had to work with it
 
Any know JavaScript?
 
@SergeyTelshevsky Is it recursively instantiating?
 
@Jimbo yes
 
11:27 AM
My program is about VOTE, this is ok, one vote by user.
github.com/ulisescontreras/Votes

I can saveVote, but "I don't know show this vote when refresh page."
http://stackoverflow.com/questions/27342069/localstorage-loadvote-when-refresh-page
 
@Jimbo But then, in your question, if a DIC not have to create all objects, in some place I will have to do. Where?
 
@korima It has to instantiate: Your controllers.
 
@Jimbo I had an idea to implement the same for anonymous functions, but it ended up in an answer on SO: stackoverflow.com/questions/21779805/…
 
But if my controller instantiate a class, not breaks DI?
 
@korima Yep, so your controller can't instantiate a class, your injector reads the constructor / method signatures of your controllers and injects them when creating the controller (via reflection)
 
11:29 AM
@korima depends on how you register it IMO
and how you instantiate it
 
Just reading laravel docs:
> All controllers are resolved through the IoC container, meaning you can type-hint dependencies in a controller constructor, and they will automatically be injected.
 
And that, the process of inject dependecies to the controllers, not is a DIC?
 
What I just quoted - is how it should work
It's such a shame that a lot of the rest of Laravel is so terrible, with statics everywhere
@SergeyTelshevsky I can't see aliasing abstracts / interfaces to concrete implementations - they not got that yet?
 
@Jimbo But then, IoC resolves all dependencies of my app. Every object. Views, controllers... So I'm on the start of my question. :( That is what I don't understand well...
 
@SergeyTelshevsky My program is about VOTE, this is ok, one vote by user.
github.com/ulisescontreras/Votes

I can saveVote, but I don't know show this vote when refresh page.
http://stackoverflow.com/questions/27342069/localstorage-loadvote-when-refresh-page
 
11:32 AM
@UlisesContreras please don't ping me
 
@korima Yep, your injector does resolve all your dependencies. But only when it real them with reflection
 
@Jimbo there are, one sec
 
It doesn't create everything, and then inject it when it's needed. It reads, via reflection, what an object needs, then injects it
@UlisesContreras Try JavaScript chat room. This is PHP.
 
@Jimbo What does mean "But only when it real them with reflection"?
 
@Jimbo if I understood you right, then you may bind an interface to a class that implements it
(you bind them in the bootstrap-type-o-file depending on the environment etc.)
 
11:34 AM
@SergeyTelshevsky Yep. Auryn uses $injector->alias('Interface', 'Concrete'); so when it encounters a type hint for an Interface, it injects the Concrete
 
@UlisesContreras please stop spamming the same link in all chat rooms you are in.
 
@korima So, you do your request. It hits the part of your framework where your controller is chosen and the action is chosen within it
 
@Jimbo laravel.com/docs/4.2/ioc#automatic-resolution ctrl+f "Binding An Interface To An Implementation"
 
Your injector uses reflection to read the constructor arguments of the Controller
Creates the objects, any via reflection any of their dependencies
Then passes them into the Controller - and you have your controller created with all it's dependencies
 
@Jimbo I read through auryn, it's much more than that. It's like Laravel's IoC done right
and as in no way am I going to use laravel again in the nearest future, I desperately wait for a new project to implement auryn
 
11:36 AM
Excuse me sir, do you have time to talk about our lord and savior Auryn
@SergeyTelshevsky A step along the line is Arya which uses Auryn.
 
@Jimbo In that case you don't have to create a resolver for that dependencies because the IOC makes for you?
 
@korima What?
 
@Fabor seen that too, but I really hate all the routers I've seen, so I usually write my own :(
 
@SergeyTelshevsky NikiC wrote that router.
 
11:38 AM
@Jimbo When you said: "Creates the objects, any via reflection any of their dependencies" do you mean when you use @inject?
 
@Fabor yeah, it's fast, but that's not a priority most of the time
 
What did you dislike about it?
 
@SergeyTelshevsky the router is pretty barebone, just write a abstraction over it =]
 
@korima I don't know what @inject is, I'm guessing it's an annotation... but anyway, your injector sees the controller, uses reflection to get it's dependencies, uses reflection on those objects to create their dependencies, etc etc, then passes them all into each other until it passes them finally in the controller it makes
 
And caches it all for speedy resolvement.
 
11:40 AM
@Fabor I like to have controller classes and never store route logic in a closure
 
Resolvement isn't a real word apparently.
 
lol
 
@Jimbo But then, the ioc is creating all object dependencies. Returning to your question, if you have 1000 classes, your IOC resolve all classes dependencies
 
the only one I liked, though: github.com/auraphp/Aura.Router
 
@korima Yep. But it doesn't create all the objects at once and store them. It only creates the objects required for the controller and action etc
It doesn't create everything
It creates what you need depending on what objects it hits, it doesn't create everything in your application needlessly. There's a difference
So it's not a container, as it doesn't "contain" anything except cached reflections. It's an injector
 
11:43 AM
Um IOC is the principle. DIC is thing that helps you achieve it.
 
@Fabor People have been calling them IoC Containers... -.-
 
Really?
 
Yeah
 
Ummm I think I'm starting to understand...
 
@korima to get a better understanding you may see Pimple code, it's clean, short and simple
 
11:43 AM
Dependency Injection Containers, Inversion of Control Containers. Dependency Inversion Containers...
Fml
 
SOAP is literally the worst thing ever designed by anyone ever.
8
 
@Jimbo Let's not perpetuate that.
 
@Gordon Actually, without her horrible voice, it sounds pretty good
 
@DaveRandom :D. There's some legacy SOAP stuff at my current place I avoid as much as possible.
 
Dependency Inversion Control Containers
 
Isn't Pimple supposed to be terrible?
 
Pimple is bad
It's a glorified associative array
 
Plus no one likes pimples.
 
It does hold objects. You have to place them in. Then pull them out when you need them
 
@SergeyTelshevsky I'm going to that. I used Pimple but I think that it doesn't meets what @Jimbo said. I think that Pimple create everything.
 
11:45 AM
Why would anyone call their library "Pimple"?
@Fabor That
 
good enough to get a better understanding
 
@Jimbo Yo mama is a etc etc
 
@korima no, it does create only on request
 
@SecondRikudo Actually, without your horrible lack of taste, your taste would be pretty good :P
 
As much as it sucks how unpopular Auryn is, can you imagine how badly someone might/will abuse it if/when it gains popularity?
Murphy's Law
 
11:47 AM
@Fabor a static wrapper for auryn is on my todo list already!
 
heh
 
@SergeyTelshevsky A what
 
:D
@SergeyTelshevsky Ooh, you work in Latvia. Do you know Teresko?
 
Know 'of'
 
11:49 AM
@Jimbo no, but looks like we worked in the same building about a year ago
 
Wow, small world
 
small city
 
I'm going to Latvia in March
 
Latvia is a city?
 
Plus, in @Jimbo's case, small penis
 
11:50 AM
@DaveRandom Dammit, I told your mum not to go telling everyone!
 
@Jimbo Riga, basically in Latvia every other city is a village
 
I might try and assault @tereško with a hug.
 
@Jimbo I'm not sure how to respond to that. You sort of insulted both of us in one go.
 
@DaveRandom Yeah.. I didn't think that one through
 
@Fabor we may organize a meetup
@Fabor why do you visit Latvia anyway? :)
 
11:52 AM
hello all
 
business trip?
 
If you type in "latvian village" on google images, I always knew it was like the 4th picture there, with Teresko in the middle shouting profanity
 
My friend randomly asked if I fancied a trip there. He probably saw some cheap flights. We're there for four days with no plans so far.
 
do you guys know how to convert an array to object?
 
@АйменАхмед (object) ['foo' => 'bar']
 
11:53 AM
@Jimbo I want to unsee every second image there. Well it's not that bad, but I don't know any IT company that is based in another city other than Riga
 
I think flights were < £100 return
brb
 
@Fabor I know people found roundtrips to UK for ~50 pounds
 
@Jimbo Reading again your auto-answer on your question about huge container... You mean that objects dependencies should not be created on a container, like pimple, because your are hiding class dependencies? The only place where you should read the dependencies should be the class constructor?
 
@korima I mean that people pass their 'container' or injector into their objects, like their controllers, and then say $container->get('Object'); within their code to resolve and create it
That's a service locator, because it should be your Controller class constructor and methods that define dependencies required (via type hints)
And that's what pimple advocates
Pimple advocates shoving stuff in at the beginning, and then pulling them out when you need it
 
@Patrick then wht i use
 
11:58 AM
@Jimbo But if what I do is: $container->get("Controller"), and it returns me a fully resolved controller with their dependencies?
 
Did anyone know about zend framework 2 ?
 
@korima Well... if we forget the "get" bit, then sure... your Controller Resolver is where you need to use your injector to make the controllers
 
@korima where is your $container->get called? Sounds like you just passed a service locator to something before your controller.
 
@Gordon thanks
 
@RonniSkansing For example, in my index.php I call to $app = new App(); $app->start(), and inside, I create the $container and then I call to $container->get to obtain the controller where my app will start. Maybe is on that on what I'm confussing. In the start of my app I use as service locator.
 
12:05 PM
@korima the ->get is confusing me, it is getting anything? or somewhat of a factory.. ->create() ?
 
@RonniSkansing Sorry, $container->get("MainView")
And then, $containers returns me a view object with all her dependencies resolved
 
@korima so in your $app you call directly for a view?
 
@RonniSkansing Yes, was a example. I'm not having a real project on my hands. Only testing.
 
@korima try Auryn, write some code
=]
 
@RonniSkansing Then I must forget for full Pimple. I understand her work but maybe it doesn't help me to understand IoC
 
12:09 PM
Yeah.. forget Pimple
 
@LeviMorrison Yeah ... no ... linked list is always the worst you can do in terms of perf, pretty much
 
Ok, guys, thanks A LOT you all for your great patience because I was heavy with my doubts
 
I was more thinking about some kind of structure that consists of two arrays (basically two stacks in different directions). Though I'm not entirely clear how you'd combine them ^^
And yeah, of course it doesn't matter for autoloading, was just wondering in general
 
@AniketDeshmukh you don't need a framework, see this tutorial. If you use a framework anyways, use something very small like silex
 
(or Arya) ^ [=
 
12:23 PM
@RonniSkansing WARNING: Arya is still under development
 
...would it be better if it was no longer under development?
 
it would be better if it had a stable release... But I also dislike a few things about it (fluent interface, request class, ...) so I definitely prefer to just use a few components and wire things together myself
 
who may tell me what are the downsides for using exceptions for user error messages? except for performance
 
@Patrick when things have a fluent interface, you're always free to not use it…
 
12:42 PM
That's like saying "Laravel has statics, you are free to not use them"
Sometimes, they just shouldn't be there :-)
 
@bwoebi which is exactly what I do when I have the option, I don't use things with fluent interfaces ;-)
 
@Jimbo it's different
@Jimbo "supports" and "built around" are different things :)
 
Was there not a post recently about frameworks supporting 5.2 and how bad that was?
 
Yeah, by ircmaxell iirc
but it's bad only for the community
you may tell as well that PHP is a bad product as it supports obsolete md5 hashing
 
@Patrick i was just reading your tutorial.. and in chapter 6 you write: "MVC can't be implemented properly in PHP anyway, at least not in the way it was originally conceived." May I ask you why it can't be properly implemented?
 
12:57 PM
@SergeyTelshevsky And bad for whoever runs on 5.2, because of unimportant things like security
 

« first day (1529 days earlier)      last day (3402 days later) »