« first day (1833 days earlier)      last day (3131 days later) » 

10:00 PM
Wouldn't having such naming make troubles in a future, e.g, in case of classes become first class objects or anything epic like this (or not so epic)?
 
ThW
@zaq178miami It often works out that way, but it really depends on the semantics you want to build
 
ping @NikiC ^
 
@zaq178miami It's not a problem from compat perspective
I do that often (i.e. use namespaces as is-a rather than belongs-to)
The most annoying thing about it is the namespace X\Y\Z; use X\Y\Z; you often have to do
 
Yeah, me too.
 
ThW
for the parent class?
 
10:07 PM
I also noted that we can internally define classes with reserved keywords as it name, i guess it is by-design so and keeping internal class names to not conflict with reserved keywords is developer responsibility, right?
It may be a bit surprising for newcomer that smth like new \Acmee\Null() works but one can't declare class with Null as it name.
 
@NikiC you can inline, I didn't say remove and stuff :D
 
@Ocramius inline with type guards, yes
 
class Foo {
    public function bar() { return $this->baz(); }
    private function baz() { return 'tab'; }
}
this could be inlined afaik
can't be inlined if it uses anything outside private scope
(includes exceptions/warnings)
 
@Ocramius It can only be inlined with a check for $this being instanceof Foo beforehand
 
ah, you mean bar could be re-bound?
 
10:10 PM
@NikiC just !== NULL is okay
 
hmm, good point
 
with current opcodes anyway
 
wait, is this again about ReflectionMethod#getClosure()?
 
can someone maybe help me with that?
0
Q: woocommerce change the dropdown rating to stars

user4571629I'm designing my online store with woocommerce and when I'm entering to the product page there are description and rating tabs, when I click on the rating I have the option to rate like this: How can I change this layout to the rating stars layout?

 
@Ocramius or ::
 
10:12 PM
can we just drop that method? There is no need for ReflectionMethod#getClosure(), like ever :-D
@Andrea you can't call bar with :: unless you stupid (and warning)
 
@user4571629 you're essentially asking for us to do the work for you
look into how it is implemented
 
you funny
you think i didn't look?
 
Okay, what have you tried?
 
that layout that I have is a <select> dropdown
 
Sure. I don't think there's any way to style that as a star rating
 
10:14 PM
I thought to style it, but I think it's wrong
yeah
I look at the most of the themes, it's with <a>
for example:
 
if you changed the HTML to, say, radio buttons, it might be doable
you might need JS for this
 
yeah, I'm trying to figure out how to change the layout
 
@NikiC how huge would the BC break be if PHP fataled when calling instance methods as static methods?
 
@Ocramius didn't 7 break that already? Can't remember
 
10:17 PM
@Ocramius Another person raised a fuss on internals about the break we did do (forbid scope rebinding)
People seem to be using this "feature" for AOP
 
Yes, I do it for that stuff too, but as I said, I don't use ReflectionMethod#getClosure(), as it is broken anyway
I just create a new closure
 
@Ocramius For their use case they need the rebinding
 
@user4571629 look for where the <select> is generated?
 
Or so they say
 
I'd rather create a new closure with the original function AST, @NikiC
yeah, I understand kind-of why. @lisachenko is doing quite advanced stuff with that
 
@user4571629 okay, replace that with some other tag you can style
I think you might be able to do this with radio buttons and clever CSS
 
ohhh
@andrea You're right, thank you
 
Glad I could help :)
what was confusing you?
 
I appreciate it
when it's becoming more of a PHP code, i'm not a believer
haha
 
ah :)
 
10:27 PM
I need to learn it, I haven't find my teacher yet
 
in this case the PHP seems to just be outputting plain HTML though
so as long as you only change what's inside the quotes, you should be fine
 
yes, I just thought that if I'll change it it wouldn't work, and it's really not working, but then you told me that idea of the radio buttons, and I remember I did something like that before, so I'm going to try that now
 
ah
there might need to be some clever CSS for this but it's definitely doable
Oh, here's an example of it being done: jsfiddle.net/ghvNn/261
 
the css isn't my problem
right now that I'm thinking of it again
 
Alright
 
10:32 PM
how will this form will know to take the radio button
value
that's my problem, all the php funcitons and stuff
 
Ah, that's simple enough
 
so let's say I'm changing the <option>...</option> to
 
all the form elements just result in some 'name=value' string in the HTTP request
so long as it has the same name/value it'll work
 
<input type="radio">
oh..
let me check
 
ThW
even that, image and file would be the exceptions
 
10:35 PM
@user4571629 in this case the <select> has the name 'rating' so all the radio buttons need that name
 
let's say I'm changing the option to input
what will wrap the inputs? instead of the select
 
okay
 
div?
 
@user4571629 nothing, you don't need to wrap inputs
you might have a span or something for CSS and labelling
 
so where I'm putting this? name="rating" id="rating"
 
ThW
10:37 PM
@user4571629 whatever html element you're using, a div or possibly a fieldset
 
so you're saying it will work? just a sec let me check
 
@ThW you'd put the id= on the wrapper, but the name= is for the individual inputs
 
ThW
true id attributes need to beunique and they are for addressing stuff in the browser dom
 
@user4571629 name= is used for form data, it would go on the <input>s. But id= is only used by CSS, JS and the <label> tag
@ThW they do, but these inputs aren't going to have ids
 
ThW
name attributes define how the browser sends values to the server
 
10:39 PM
I guess I'm right
it's not working
i think the select has some defaults
that the div doesn't
 
@user4571629 what's your code now?
 
Can someone help me with this SQL query sqlfiddle.com/#!9/ad81a/1
Why Im i getting null for last 3 result?
there is insert for comment and comment should be 1
 
@FarhadNezhad your left join is on votes, if a left join fails you get null
 
For all? @Andrea
 
ssllabs.com/ssltest/analyze.html?d=kelunik.com Let's Encrypt is now live on kelunik.com @PeeHaa \o/
 
10:42 PM
I don't think so
 
@Andrea that's my code now:
Let me know if you figured something... bummer that I need to leave now, but I'll be here in 35 minutes
 
@user4571629 you need to put the name= on the individual <input type=radio> elements
they don't work like <option> in <select> does
 
ohh thanks!
<input type="radio" name="rating" value="">
working!
 
yeah
 
thanks man
 
10:45 PM
awesome!
 
can I pay you?
take my money dude, take it!
haha, I'm glad you helped me
 
nah, don't worry about it :p
You can answer your own SO question now if you want
 
I don't understand sorry
 
ThW
:-)
@FarhadNezhad a LEFT JOIN is an outer join, it will return all the matching records from the left table and the field filled by the right table might be NULL.
 
So I should use FULL OUTER JOIN? @ThW
but MYSQL don't support FULL OUTER JOIN
Sorry I suck at MYSQL, show me a direction and I will go read
lol
 
ThW
10:57 PM
I don't think so, but I still don't understand the expected result
 
numberOfComments should be 1
cause 1 comment has been inserted, but if you uncomment INSERT VOTES you get correct result
I believe I have to do a FULL OUTER JOINIm going to try it now
 
ThW
I am not sure about COUNT(post) it is kind of ambiguous with VT.post
have you tried using CT.post ?
 
That fail as well
 
11:30 PM
@JoeWatkins should I be using zend_ulong for values that would always be positive?
 
Here's an interesting question (interesting for the security folks). Can I cache (with headers) a page that unsets a cookie (by setting its expiration in the past)?
I'm quite puzzled by this one
 
@FarhadNezhad see sqlfiddle.com/#!9/da7fc/1
 
I need the WHERE clause @staabm
 
ThW
@Ocramius I don't understand that. Any response can be cached on the server and the client and this includes the headers. Unset a cookie is basically setting a past expires time using a set cookie http header
 
ok, so I'm going to clarify the use-case first. Basically, I'm writing a replacement for ext/session: if the session data is empty, I want to un-set the cookie. This makes the load balancer/http cache much more efficient
The fact is that the session may be empty every time => "unset cookie" goes out every time
I may also unset the cookie only if the cookie is present, btw
 
11:45 PM
@Ocramius Yes, just unset it when it existed but has been emptied.
 
Yeah, I guess I just needed to rubber-duck it
alright, another middleware it is then
 
@Ocramius Why would that be the case, unless you were automatically creating a session each time? If you only automatically do your equivalent of session start when the cookie headers are sent, then most of the time the session would exist when something has written data to it.
 
(separate class)
 
It's the same thing aerys-session does.
 
@Danack I'm creating a "session container" every time (even if it is empty)
there's no I/O involved, so it is fine
@kelunik oh? got linkie?
 
11:47 PM
> * Opens an existing session.
*
* Opens and returns the data for an existing session, if and only if the
* client sent a valid existing session ID. Otherwise returns null.
 
@Danack right. I create a session container even if no cookie is given
then skip pushing the cookie if no data was pushed to the session container
thanks, @kelunik
oh, so the aerys driver still uses the FS or a storage for this
 
Oh Wow I feel litalted!
my Query was correct I just had problem with WHERE
 
@Ocramius Currently only Redis
 
Yeah
I'm building something to not have session storage at all
simply pushing everything to a JWT token, should be much better for async too
 
11:56 PM
Session contents on the client side >_>
 
yup, actually looked at it multiple times and didn't find any particular problem with it
encryption will be optional, but signing will be mandatory
 
Why should it be better for async?
 
because there is no server-side I/O except for the crypto randomness I/O
and it also gets rid of silly problems such as sticky sessions and similar
 

« first day (1833 days earlier)      last day (3131 days later) »