« first day (2109 days earlier)      last day (2830 days later) » 

Wes
1:03 AM
mornings
 
@Wes Yo .. :-)
 
1:21 AM
morning
 
can someone help me with an issue I'm having?
 
@Hybridwebdev What's the issue?
 
I have a base parent class called parent
I also extend parent functionality with modules aka class module extends parent
the parent class has some setup routines it does, such as defining file paths and what not
that are fired when the parent class is instantiated
so now i want to make a grandparent class which will override some of the setup routines
let me codepen
ala that
perhaps i just dont understand inheritance properly, but it seems as if any config i run in the grandparent class doesnt alter the parent behavior
 
Run parent::__construct(): php.net/manual/en/keyword.parent.php
 
1:33 AM
I'm also pretty sure that it's supposed to be called a child class.
 
well excluding semantics, and considering the fact I do in fact run function __construct() {

parent::__construct();

}
woops
function __construct() {

		parent::__construct();

	}
 
You also cannot use Parent as a class name.
 
well it's an example
it doesn't reflect the actual code ive written
 
okay 1 sec let me send a new one here based on what you did
oh shit sec
okay check it
 
1:41 AM
@Machavity HEY! stackoverflow.com/documentation/proposed/changes/47268 … I have unresolved comments on that proposal…
 
now in that example, echo $Child->foo will actually echo the foo from the parent, not the child
which is not what i wan
t
 
@bwoebi Sorry man. Read over it and missed the isset thing. Stupid thing lets one reject + one accept
 
@Machavity yeah…
 
@Machavity now at least correct it then :-P
 
1:45 AM
@Hybridwebdev: Which version of php are you using?
 
5.4 something
just a local apache install on a linux mint vm
 
@Hybridwebdev On php 7.0.9 (Arch Linux) it works the way you're expecting.
 
Yeah but for the projects I do 7's not an option
gotta be 5.x
 
So it must be a thing with php 5.
 
how would I apply this in php 5.x
I would think there should be a way as this is the entire point of class extends
 
1:48 AM
Do you have access to something with php 5.6?
Perhaps it's different in that version.
And honestly, I was surprised that it worked that way on my machine since you are calling the function technically from the parent.
Also, AFAIK, 5.4 isn't supported anymore anyways.
 
i think i know what the issue is
 
@Machavity this one you can reject: stackoverflow.com/documentation/proposed/changes/… (see comments)
 
Wes
 
@Wes stop headbanging so much :-P
 
Wes
headbanging involves head movement :B that's just waving
 
1:59 AM
@Wes no. you bang your arms against your head.
(not your head against your arms… but nobody said that...)
 
Wes
:B
 
2:12 AM
@bwoebi Rejected
 
2:27 AM
2
A: PHP MVC - How can Controller and View access same instance of Model?

tereškoWell .. fists of all, there are no "models". Model in MVC and MVC-inspired design patterns is a layer, that contains multitude of structures, just like presentation layer contains controllers, views and some other things. That part aside, your issue is that you are having separate instances of t...

can someone explain why the ServiceFactory described there isn't a service locator?
 
2:42 AM
@Machavity yea, great, you rejected it after he revised it… hmpf … stackoverflow.com/documentation/proposed/changes/47474 now.
 
Writing PHP extensions: Just when you feel good about yourself because you fixed a seg fault... BAM here comes another one and this one's trickier to find.
 
2:57 AM
@MarkWeiman tell me news… I have an extension and I cannot find the issue after hours and hours of debugging… still not found :-(
 
is it okay (architecturally) for me to pass my injector to the service factory? or is it secretly an anti-pattern?
 
@bwoebi Then you find it and you just want to kill yourself because it was so simple.
 
hehe
@Jeremy It depends on the service factory.
 
@bwoebi: There was something a little bit missing (more like a lot missing): github.com/markzz/php-alpm/blob/master/alpm.c#L277
 
@bwoebi looks like: viper-7.com/dbsh4G
i'm worried about potential smells & service locators
 
3:10 AM
@Jeremy It depends on what you do with that. But it smells like a service locator
 
@bwoebi i see. i am confused why the service factory mentioned here is not a locator
 
@Jeremy This alone is not yet a locator. As said, depends on what you do with it.
 
@bwoebi The factory i sent in viper-7 is being used to create service instances so my controller & view will both have the same instance of said service
 
@Jeremy If you use it at top-level, just to actually always provide the same instance, that's fine … but Auryn is already quite doing that for you. (injector->share())
If you already have Auryn, no need for a ServiceFactory. Auryn defacto can work as a ServiceFactory by itself.
 
i see. but then i will need to create a config for every resource
 
3:14 AM
@Jeremy why?
 
controller & view a might use one service, but controller & view b use a different service. i will need to share a different service in both instances
so every route will have its own set of instances to share
 
oh, sure. so, just share the specific dependencies you need in the root callables of the individual routes?
 
@bwoebi can you elaborate? I don't quite understand :o
 
@Jeremy Can you please show me your current route handlers file?
 
{
	"primary": {
		"notation": "message-board",
		"defaults": {
			"resource": "MessageBoard",
			"action": "index"
		}
	},
	"post-message": {
		"notation": "message-board/post",
		"defaults": {
			"resource": "Message",
			"action": "post"
		}
	}
}
 
3:22 AM
@Jeremy yep, so, then add there "service": "foo/bar" and instruct Auryn to share this service for this route
 
@bwoebi cool.
thanks
very helpful
 
@bwoebi: I think I should just quit now while i'm ahead... github.com/php/php-src/blob/…
 
@MarkWeiman look at zend_vm_def.h. zend_vm_execute.h is autogenerated from that one.
 
Wes
morning v2
 
@Wes morning v-2
 
3:25 AM
Muuuchhh better
 
@Jeremy The goal is really to avoid Auryn inside the individual routes. The general philosophy is: Tell the caller [route dispatcher here] what you need and he has to give it to you.
 
yes, brilliant.
 
Yep, another seg fault that was similar to the last one but not easy to find...
Nevermind, another silly mistake that I'm not even sure how it caused that issue...
Also, @bwoebi, I think there's something wrong with the add_next_index_string and add_next_index_stringl functions/macros, where's the best place to file a bug (after I do a little bit more investigation)?
 
3:44 AM
@MarkWeiman just tell me or Nikita
 
This was a note for myself, but I guess it's a start: github.com/markzz/php-alpm/issues/2
It also links to the commit that fixed it.
 
 
2 hours later…
6:01 AM
mornin
 
@bwoebi why did you approve stackoverflow.com/documentation/proposed/changes/47165? that note about getters is pointless and confusing. method chaining by the given definition doesn't work on getters.
 
Wes
6:19 AM
yeah it's a useless note
 
@Gordon Which he is pointing out…?
 
mornings
 
@bwoebi I dont think so
 
@Gordon yeah, think you're right
It was obvious to me, so thought it's fine
 
Wes
> Command Query Separation is a design principle brought forth by Bertrand Meyer. It states that methods mutating state (commands) should not return anything.
 
6:28 AM
and it's actually obvious because it's redundant and thus unnecessary and confusing…
yeah…
feel free to edit it out…
 
Wes
This definition evolved slightly. Command methods should not make assumptions on what the user wants in return and instead they should provide feedback on the result of the operation. It is ok to return true or false.
 
@Wes any source for that?
otherwise I'll stick with the linked Fowler article
 
Wes
common sense? :P i've read it somewhere though. it is as fine as returning nothing for success or throw for error
searching..
 
@Wes I'd argue that it's not common sense to do because it results in if (command) { do this } style of code whereas in OOP you'd favor exceptions and tell dont ask.
 
6:37 AM
don't ask if an exception is thrown, just take it like a pro. :)
 
Wes
could be gordon
i hate when people remove messages. it's so unpolite
 
I find that hard to believe, the message itself could be much more unpolite than removing it.
/me was just trying to make a sentence with "could" in it ^ ^
 
Wes
i'd at least have the chance to answer impolitely too :P
 
okay, return values suck. sometimes you can't prevent them, but if a method has a return value, you need to care about it.
It's similar as with method parameters.
 
Wes
TIL it's impolite not unpolite
 
6:44 AM
me too, me too ^ ^
 
7:09 AM
mogrnigng
 
Wes
 
@Gon SE API (OAuth) api.stackexchange.com/docs/authentication, take the user's ID, scrape http://chat.stackoverflow.com/users/{id}, get a list of rooms that user is owner of. Any actual admin functionality that we may eventually have (access to logs/deployment tools?) would be done with a list of hardcoded IDs probably. I'm doing some more experiments today.
moin
 
@DaveRandom moin
 
I hate Mondays. not only because it's monday but our office becomes a sauna after a weekend of baking in the sun.
 
@DaveRandom there's an easter egg for you in PHP documentation (on SO)
 
Wes
7:13 AM
> In British English, dependent is the adjective, and dependant is the noun. TIL2
 
@Epodax I thought you nordic people are crazy over saunas
 
@DaveRandom stackoverflow.com/documentation/… [this was me, with you intentionally in mind… :-D]
 
:-P
 
Wes
@Gordon aren't those asians? :B
 
@bwoebi heh, I saw that on friday already and wondered
 
7:15 AM
Also I actually used to know someone called Amy Pond :-O
 
@Wes umm?
 
@Gordon but said nothing? tzzzzzk
 
@Gordon We are, but we prefer it to be cold outside too, at least I do.
 
@DaveRandom [That's obviously not a coincidence]
 
7:22 AM
Reminder (for anyone who has been putting it off but "will do it eventually" like myself): Win 10 Upgrade deadline in 4 days
 
Wes
@Gordon en.wikipedia.org/wiki/Sent%C5%8D never heard of them?
 
o/
 
@Wes nope
 
7:39 AM
!!is today monday
 
Yes.
 
Anonymous
Moins
 
morning
 
7:55 AM
Morning
 
posted on July 25, 2016

New Cyanide and Happiness Comic

 
!!wotd
 
chiasmus: a reversal in the order of words in two otherwise parallel phrases, as in “He went to the country, to the town went she.”
 
@Gordon you'r german? :D
 
8:00 AM
Nein, zie ist einen wiener schnitzel
 
@ceed yepp
 
na dann :)
 
@Fabor I am not a she. And Vienna is in Austria ;)
 
toast huawai :)
 
Surprisingly close seeing as I haven't done German in like 15 years.
 
8:04 AM
I am wondering whether to make an experiment
kinda to check, if people are against theory of evolution .. which most likely would end up with me being banned
 
Anonymous
How are you going to check if people are against it?
 
@tereško you're going to delete all the topics in docs?
 
Anonymous
Genius.
 
naah .. meet me in Doc's room
 
@Gordon He'd need some friends, or multiple accounts to do that. :)
 
Anonymous
8:09 AM
omfg..
 
Anonymous
Well @tereško pretty sure you're getting banned..
 
wtf @tereško? how is that an experiment?
that is not a proper way to prove your theory :)
science class should have taught you that
 
Why I don't contribute Laravel? Yes, because of Graham. Yes, just another egoist core developer in PHP community. https://twitter.com/taylorotwell/status/757329787400523776
 
@AdilIlhan graham who?
 
graham campbell
a core laravel developer
 
8:16 AM
oh that graham…
"core developer" made me think of php-src core…
 
@AdilIlhan then you should have said in Laravel community
 
@AdilIlhan he's a bit infamous for his tone…
 
@Gordon I now have a theory that PHP drives people to do very weird things :p
 
@JonClements To the Science-mobile!
 
@JonClements maybe programming has this long term effect. C++ apparently makes people degenerate into hostile teenagers… and Python makes people talk in vegetables. PHP makes people into, well, whatever you wanna call it.
 
8:24 AM
lol
 
> This account is temporarily suspended to cool down. The suspension period ends in 7 days.
lol?! @tereško
 
Anonymous
He did say it would get him banned, I don't know how that idea popped into his head xD
 
Quick @tereško is banned. Post invalid MVC examples!
15
 
@JonClements if that suspension is for his "experiment" only I find a bit too harsh given the context.
 
What did he do?
 
8:28 AM
What he said was flag-baity.
 
Anonymous
Posted a comment that, out of context, comes across racist. Then after a minute, posted the context
 
I miss all the fun, come back soon @tereško!
 
@Fabor see chat.stackoverflow.com/transcript/message/31899019#31899019. flag bait comment was after the first one and is not shown in transcript
 
Anonymous
8:31 AM
o/
 
I guess that was as close to a brainfart than can gets
 
What he has done now o__o
 
Hmm, I guess it's maybe not a good thing to add a constructor deceleration on an interface
 
@Sean indeed
 
I thought you could modify the constructor arguments on child classes if the parent class which implements the interface still has the correct arguments
Turns out you can't ¯\_(ツ)_/¯
 
8:40 AM
that is just quirky behavior in PHP then. The main reason not to put ctors in interfaces is that ctors are concrete implementation whereas interfaces should not care about implementation details
 
Huh, well that's fun. Full paths failed and relative works. Interesting.
 
if an interface is in the constructor, I don't see this as wrong
as in, a class implementing an interface must be instantiated with such and such argument
 
@FlorianMargaine another hint is: separate beween creation of objects and using them.
 
@hakre still, where you configure your DiC, you maybe want to enforce an interface there
 
8:44 AM
@FlorianMargaine but that is an implementation detail. Consider interface Logger { public function log() } You will need different ctors in the implementing classes, like FileLogger takes a file resource, DbLogger takes a db connection, etc.
if you want a specific ctor use an abstract type instead
 
Aye, when I think about it, it makes sense. If you're using an interface to type restrict arguments why should the methods care about the constructor? At that point the object is already instantiated.
 
an abstract type?
 
yes, an abstract class
 
ah
meh
I don't see why the constructor would be a different kind of method than the other methods
 
Sure wish swift mailer used generic interfaces
 
pce
8:49 AM
Morning!
 
@FlorianMargaine because it's not part of the contract. it also doesnt apply in LSP for this reason.
 
@Gordon why isn't it part of the contract?
 
@FlorianMargaine because it implies a concrete implementation
 
your DiC configuration code is still part of your code
 
pce
[PHP-Security] Deserialization of user-input is still harmful, unserialize, json_decode and XML(Hash-Table Collision) affected, while simple GET and POST are protected. (paragonie.com/blog/2016/04/…)
 
Wes
8:51 AM
@FlorianMargaine would you do: $existingObject->__construct(10, 20); ?
 
Anonymous
http://chat.stackoverflow.com/transcript/11?m=31875549#31875549
Nice. I thought the site provided the cheapest price along with the build. Anyway, that's a good news because I can search locally for each part here.
 
@Wes I would configure my DiC to do so, yes.
 
Anonymous
I'm thinking I might even slash the price by $200 that way
 
Wes
how about using factories?
 
@FlorianMargaine Having a DIC is also concrete implementation.
 
Adi
8:54 AM
hi guys
 
Hey @rdlowrey and amp guys.. why should one use amp framework over nodejs? Or why was it even created =) I dont really understand the need
=p
and mornings
 
Adi
can I ask you what is the problem in my query?
 
@FlorianMargaine what if you wanted to add that interface to an existing class with an already existing ctor?
 
Adi
the error is Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given
 
Anonymous
@JayIsTooCommon What was the racist comment?
 
8:56 AM
@Adi read the error message out loud to yourself, then make an educated guess what it means
 
Man, I'm going to need to find a cheap hosting provider now that I can't keep using the work servers.
 
@Adi then find out why your code is passing a boolean instead of the expected mysql_stmt and fix it
 
Adi
my query before is SELECT * FROM then I change it to specific column only
 
@Epodax what are you hosting?
 
@Gordon then that existing class is incompatible with the interface
 
Adi
8:57 AM
the SELECT * FROM is working @Gordon
 
it's like telling me "what if you wanted to add the Logger interface to a class that already has the log method?"
 
@Naruto Everything and anything I can get started.
 
@Epodax I have good experience with host europe. couple of my friends are happy with uberspace
 
@Epodax OVH has good reputation all around, and a VPS can be as cheap as 2EUR/mo
 
@FlorianMargaine no, its incompatible with a concrete type definition. not incompatible with the contract. after all, you can add a log method to whatever class you want. A class implementing an interface does not necessarily mean it will get a dedicated class of its own.
 

« first day (2109 days earlier)      last day (2830 days later) »