« first day (1845 days earlier)      last day (3097 days later) » 

12:06 AM
uhm… Are there anywhere constants for use with fstat()["mode"] ?
Or alternatively the XY: How can I try to figure out whether I'm most likely in a terminal
Might not have a tty or be on windows… posix_isatty() isn't an option.
 
@bwoebi Why do you need that?
 
@kelunik well, displaying a warning… that there's -d mode for you.
 
Don't do that. That's a bad idea.
 
mmmmh
so what then?
 
Either default to debug mode or document it better.
Magic debug mode might have security issues. Maybe we should switch off that behavior completely.
 
12:16 AM
@kelunik only if you go production with that.
But I think we really shouldn't default to debug mode.
 
12:42 AM
I want to encrypt strings in an irreversible way but the encryption should always give same result.. For example, if I encrypt "test" today and it gives $asdfg as the encrypted string, then if I were to encrypt it again 2 days later, it should still give $asdfg as the key. Also, it should only have letters and numbers....
 
1:20 AM
So I am working with wordpress (yeah, yeah I know lol). and I want to pass an object through a filter. But I don't want the entire object to be modifiable, just 1 property. Normally you'd pass in the object by reference (&$this), but I want only 1 of the properties to be modifiable. How would one approach this? I tried doing &$foo->bar, but it doesnt work
 
@Hybridwebdev Initial instinct, is that I'd encapsulate it in another object, and use the magic __get/__set functions on that object.
Why would the other properties of the object be being modified other than the one the filter is meant to be setting?
 
@Danack I'd really like to avoid a bunch of extra layers.
 
It wouldn't be a layer.
 
@Danack because when you pass (&$this) you're passing the entire object. Which means they have access to and can modify the entire object
 
Instead of $filter->doYourThing($object); it would be $filter->doYourThing(new Encapse($object));
Where the Encapse class has the rules about which properties can be modified in it.
@Hybridwebdev "Which means they have access to and can modify the entire object" - why is this a problem.
 
1:25 AM
@Danack because I don't want them to have access to the entire object, just the property I want to pass through the filter
 
If you're doing that as a security method, it sounds like a false sense of security, and I can't think of other real use cases......but there again it is wordpress.
 
actually, no security/validation is done within the class itself. I just need to be able to
apply_filters to modify paramaters
 
apply_filters doesn't take parameters by reference (I believe). Instead it returns the filtered value.
 
@Danack yeah, that's an alternative.
 
@Hybridwebdev I have news for you. Passing $this with or without reference still gives you access to any of the object's public properties. Also call-time-pass-by-reference has been removed from PHP for years.
 
1:32 AM
It's not an alternative.....that's the way the function is meant to be called, and calling it by reference seems completely wrong and not likely to work.
$this->bar_property = apply_filters('a_filter', $this->bar_property) ;
 
that's what I had originally. I guess just had the idea in my head there was a better method. Overthinking it I guess
 
@Hybridwebdev $this->bar passes a value to the function, which is very different from passing an object.
 
@Sherif but when you pass via reference, the returned data SHOULD override the passed property. At least that's what makes logical sense to me anyways
 
@Hybridwebdev Like I said, call-time-pass-by-reference was removed from PHP years ago. Unless you're using an unsupported version of PHP it's a fatal error.
 
removed in php 5.4
 
1:36 AM
Correct.
 
wp faciliates that with a wrapper however
 
Facilitates an unsupported language feature?
 
wp do_action_ref_array
 
That's not call time pass by reference.
I think the entire idea that you're missing here is that you really don't need references at all.
 
well I appreciate the feedback
will just go with the filter method
 
1:41 AM
Sounds like a smarter choice. Just wanted to chime in anyway.
 
@Sherif appreciated :)
 
2:00 AM
Man these netflix reviews are so helpful!
> that entire side plot made me want to rip my eyes out, stab them with a fork and set them on fire...
 
 
1 hour later…
3:03 AM
h
 
> In just over 4 years, 30 years ago will mean the 90s.
 
3:23 AM
@MaryDaisySanchez are you a flipino?
 
Hi, guys!
Could you suggest me an Drupal 8 OSS project which use custom modules and views?
 
@user882813 The vast majority of people here despise frameworks... and I especially despise Symfony so will never touch Drupal 8 even if my paycheck depends on it... so no. I will give you a bit of good advice, though: Go find people who like Drupal.
There's always drupal.stackexchange.com ... or even drupal.org which I understand hosts their own chat...
 
3:57 AM
amphp.org/docs/aerys/middleware.html — I like putting thick fat warnings in docs :-D
 
4:21 AM
 $nodes = $xpath->query("//li[@class != 'children']//span[@class = 'grandchildren']");
what's wrong with this query?
I am trying to retrieve value from a span called grandchildren where parent is not 'children'
 
4:37 AM
  $nodes = $xpath->query("//li[@class = 'children']//span[@class = 'grandchildren']");  This query however works alright
 
 
1 hour later…
5:53 AM
@bwoebi Hey! Do you have any advice on 'what happens next?' with the class constants RFC/PR ?
Or who I should track down to get it into the shape it should be for master
 
googletag.defineSlot('/9098/end_of_article_fusioni', [[300,250],[300,600]],'div-gpt-ad-994278665968673255-1').setTargeting('pos',['top']).addService(googletag.pubads());

Hello
Can anyone tell me here what is meaning of setTargeting('pos',['top']) and '/9098/end_of_article_fusioni'. This ad is showing on whole site but i want to show on only specific page like www.xyz.com/news/football then what changes require?
 
6:27 AM
@Micaela
 
@MaryDaisySanchez
 
morninng
 
morning guys
 
6:54 AM
moin
 
googletag.defineSlot('/9098/end_of_article_fusioni', [[300,250],[300,600]],'div-gpt-ad-994278665968673255-1').setTargeting('pos',['top']).addService(googletag.pubads());

Hello
Can anyone tell me here what is meaning of setTargeting('pos',['top']) and '/9098/end_of_article_fusioni'. This ad is showing on whole site but i want to show on only specific page like www.xyz.com/news/football then what changes require?
 
@Micaela y u ask i'm a singaporean la
2
 
7:11 AM
misses code example in the readme @KamranAhmed
 
Well there was nothing code related to add there :)
Just a simple CSV editor utility
 
Morn
 
@MaryDaisySanchez ah okay.. I thought you're filipino
 
7:39 AM
I wish it would rain more so I could sing more often.
 
@Micaela ur a female dev?
 
Can anyone explain to me why the next release of MS Windows 8 was MS Windows 10.... at least PHP had some thought behind trying to pretend PHP6 never happened..... sadly I've come across two instances of PHP6 running in production environments over the past year... telling people to upgrade from PHP6 to PHP 5.6 feels weird — Mark Baker yesterday
@MarkBaker really ?
 
8:00 AM
@MaryDaisySanchez how 'bout you? are you a female?
 
There are NO females on the internet.
 
I thought @Maurize is a female?
hahahaha
 
@Epodax obviously untrue ...
 
@JoeWatkins How so?
 
I don't understand the question
 
8:06 AM
Why is it untrue?
 
because its obviously untrue. right @JoeWatkins?
 
right
some of the most gifted programmers I know are female ...
why shouldn't they be ...
 
yeah. why not? @Epodax
 
@Epodax whats? ur obviously have no idea dont ya? :(
 
Never heard of the whole "there are no females on the internet" before?... I feel odd now, but do rest assured that I'm quiet aware that there are females on the internet.
No idea of what?
 
8:11 AM
oh I see ...
can you nsfw things like that please, just a heads up ... kids running round the house, and can read ...
 
Ah sure, how do I do that?
 
erh, I think it's too late for me to edit it.
 
also, that's really horrible ...
 
8:12 AM
moin ...
 
@JoeWatkins Yea, not the best clarification I could've found.
 
if I don't get internet jokes anymore, am I old ?
 
@JoeWatkins Do you get annoyed by teenagers?
If yes, then yes.
 
I don't have any contact with any irl ... I have a teenager in training for a daughter ... 11 going on 15 ...
hehe ...
 
Hehe, well, if it's any comfort, I don't get them anymore either, the "no females" part is just so old that I remembered it. - And can I poke PeeHaa to delete messages / trash them?
 
8:15 AM
I could ...
I already closed the window now, too late ... no point ...
in future tag it so that I, and others, can scan room for kids/boss ...
 
Will do, but in any case, do feel free to purge the link.
 
morning!
 
@JoeWatkins - sadly all too real, fortunately now 2 less sites using PHP6 in production
 
it must be difficult to program while underneath a rock ...
 
They poked their heads out when they hit problems with it.... both (interestingly) on Windows Server
 
8:23 AM
@JoeWatkins you are already training a teenage boy for your daughter? :D wth? :P
 
no silly ... 11 year olds fancy themselves teenagers already I'm saying ...
/me goes on school run
 
aaaah.. I was imagining you, training a young boy as your future daughter's husband :P can't be too carefull these days :D
 
9:13 AM
 
@Jimbo o/
 
Hi Guys
0
Q: how to get multiple Query String values from URL?

Ram SinghI am very new bee in PHP, i am passing query string to a ajax call using the below code. i want to get these on another php page. but not getting how i can get these: $("#saveForm").click(function(e){ var test =$("#Field4").val(); alert(test); $.ajax({ url: 'mytest.php?firstname=ram&lastname=...

please help me
 
@RamSingh var_dump($_GET) and see what you get ;)
 
@RamSingh you are a bee?
 
@Naruto Ay! New Bee!
 
9:33 AM
Can I become one? Tell me! I'll do anything! :P
 
Ping @salathe - Just went to use the Open Source PHPStorm license with PHPStorm 10 - it wants me to convert it to a new format. It's asking for name/email etc, I'm assuming it will email a new format license, so probably better if you do it.
 
@Naruto typo mistake
 
@Leigh I'm waiting on a response from the JetBrains open source people.
 
@Duikboot shall I namechange to Maja? :P That could be a first good step right?
@RamSingh Yes I know, just making some fun :)
 
moin
 
9:49 AM
@JoeWatkins wb
 
kthnx lol omfg pmsl
I am so hip ... kids still say hip, right ?
 
pekpek lalat
 
@MaryDaisySanchez is that some kind of spell ??
 
:'D
 
9:54 AM
@Jimbo I totally went out in the wet, on purpose ... nothing bad happened ...
 
sorry wrong type
 
@JoeWatkins Still have to be so careful on corners, coming off roundabouts, grids... all it takes is a tiny blip and bam
 
posted on November 04, 2015 by nlecointre

/* by Marwen */

 
:D haha @Naruto
 
yeah
 
10:01 AM
Damn im going to eat my shoe
'put this project on a new host' ... makes use of mysql_connect >> All I see is "
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in "
And it wants to make use of mysql_filter blah
 
10:24 AM
Good. You should have migrated from mysql_* a long time ago now
With all the campaigning people have done this shouldn't come as a surprise anymore
 
1
Q: How can I implement a simplified version of the PKI in PHP

wyredA composer package exists for PKI encryption, but I'm looking to do a simplified version of it. Most other encryption solutions I've seen uses the same key to encrypt and decrypt it. Example, A message comes in for User. The server encrypts the message with the user's public key. When User wa...

 
@PeeHaa Exactly. But it's not my project that's the -bleh- part about it. I have to migrate it to another host.
@PeeHaa The thing is im not looking for the best fix, im looking for the fastest fix to keep this thing up and running again. When it messages : Deprecated and also : Fatal error: Call to undefined method stdClass::mysql_filter() ... Doess that mean mysql_filter is not usable because there is a recent version of PHP in use?
 
10:40 AM
@salathe alright. I spoke to one of the JB people at PHPNW, she assured me OS licenses would continue even with the new subscription model.
 
@Duikboot I know a reeeeeeeeeeally dirty fix, but it involves installing @JoeWatkins's uopz extension
But you don't want to do that I think
But if you are desperate and willing to do dirty things go for it :P
 
It just has to be working /accessible :p
No future devleopment anymore
 
You might have a look at github.com/krakjoe/uopz, but if anybody asks who's idea it was -> not me :P
 
Method overriding ^^
That's realllllyyy dirty :P
 
Although now I am better looking at your actual question. What is mysql_filter and why is it not available?
I mean mysql_ is still available even though it throws deprecation messages
 
10:57 AM
Well noramlly there was a cms thing coupled but the guy who wrote it said: hey just change this class and make only a DB connection in it.
$cms = new cms(); And I did in the class paste.ee/p/w2JD6 Which returns me an empty obj.
 
That doesn't match with your problem description stdClass::mysql_filter()
You have some stdclass somewhere / somehow
 
Yeah now it says: Fatal error: Call to undefined method cms::mysql_filter() in
I made a class for my connection now
 
Show it
If that class is this paste.ee/p/w2JD6 there is no method named mysql_filter
 
Indeed, that's the thing I have no idea where it comes from :P
Because the class initialiy linked to an external class which I have no access to.
 
Why don't you have access to it?
The application is running somewhere right?
 
11:03 AM
I have access to a FTP dir and the database, but the class is included on a higher level. And I have no access to it.
 
Well you need access to it
 
I just mailed the old dev.
There are more methods linking to their system : data_from_app etc...
where I have no access to.
 
Fairly certain that is spam somehow
 
reads more like a conference talk abstract
 
@Gordon It was the text + username that triggered my spamfilter
 
'Allo!
 
hola o/
@Gordon As in a excerpt of this 8subjects.com/php-coding-standards to drive traffic somehow
 
11:43 AM
Is stackoverflow.com/questions/33520645/… the challenge of the day?
 
@SeanDuBois well, yeah, ensure everything is fixed and then ping someone to merge it…
 
@MarkBaker "migrated from ru.stackoverflow.com". Only thing missing is a dashcam crash video :-)
 
pfff why are character encodings assholes -.- (cries) ;-( ;-(
100% sure my charset = utf-8 yet € == question mark (blurgh)
 
461
Q: UTF-8 all the way through

mercutioI'm setting up a new server, and want to support UTF-8 fully in my web application. I have tried in the past on existing servers and always seem to end up having to fall back to ISO-8859-1. Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL and...

Somewhere in your chain it is broken
 
My header still returns utf-8
gonna check what the db returns. ;-(
 
11:50 AM
The entire chain
db, db connection, response headers, page encoding, your mother
 
wait,
db doesn't return that character.
Headers says it is utf8
page encoding is set to utf8
 
Somewhere in there is the problem :-)
 
The weird part is, the other page which is almost exactly the same, no difference between encodings DOES show it correctly.
like bargh
 
:P Well at least you have a pointer as to where to look
 
Pfff shusz it ain't funny :-)
 
11:54 AM
:-D
 
above all the PHP: header('Content-Type: text/html; charset=utf-8');
HTML: <meta charset="utf-8">
like GAWD DAMNIT -.-
 
How do you set up the db connection?
 
god ffs
fucking notepad++ encoded the file as ansi
AGAIN -.-
 
lol
 
@MarkBaker I could imagine the real code is a Singleton or something
 
11:56 AM
That was literally the problem. FFS -.- yet I set the encoding to default to utf-8 -.- grrr
 
You suck and you should feel bad :P
 
@Gordon - though a private constructor is enough to make it a singleton; the thrown exception in the constructor is what makes it impossible to instantiate using any normal means, and is certainly not part of the singleton pattern - this feels more like a contrived problem that somebody has posted as seemingly impossible
@Gordon - like a version of Sara Golemon's incrementor that jumps from 5 to 7 to demonstrate PHP versioning
 
Just extend the class and add a public constructor to the child class. And call the method as usual. — PeeHaa 29 secs ago
More normal than using reflection imo
 
@MarkBaker yeah, true.
 
I hope the poster wins his bet
 
12:01 PM
:P
 
@PeeHaa didn't know my mom had to be utf-8, I think she's still ASCII I think
 
That explains the problem!
 
@Naruto ASCIIcking
 
12:16 PM
@PeeHaa gawd stop talking about yourself PeeHaa :-D
 
@SergeyTelshevsky ^^
@MikeM. Well what to do if you like youself so much? :P
 
@MikeM. that's so much like him
 
:-D ...
Sorry @PeeHaa I am not hating ... :-P
 
;-)
 
Abe
o/
 
12:22 PM
3 attempts for 1 high five?
Abe, wake up buddy :-P
 
Abe
imagine how it will be at the end of the day
 
I think he's still drunk?
 
@Abe Pretty much like this: o----\//^7/
and then more like a deskpalm instead of a facepalm...
 
Abe
i will be avoiding grenades or something
 
@Abe CATCH!
atleast I TRIED...
EXCEPT abe didn't CATCH the grenade in my TRY...
 
Abe
12:25 PM
wat
why would i catch a grenade :D
 
-,-
Read the last sentence only the captical words, from right to left(the words not letters).
 
Abe
why are you trying to kill me
thought we were friends
 
Indeed you thought that ^_^ (sorry that was really rude) anyways the words: TRY, CATCH & EXCEPT(ion)...
 
Abe
hahaha i'm joking
 
I don't have friends, I am forever alone :-)
 
Abe
12:30 PM
i read try catch three times, i didn't realize you were referring to try{}catch{}
i guess i need a coffee
 
@Abe, tonight, sleep at 8PM at latest...
it's not mondays mate...
 
Abe
i swear for a moment i thought it was monday
and i thought i time traveled somehow
 
no my banana just felt on the keyboard so it entered it, now my keyboard is bananaish
 
Abe
okay it's time to start working :D
 
indeed, I am back to working aswell. Somehow I am retarded enough to ask too low for websites as I am still a college student, I bet if I said the price, you guys would kill me
 
Abe
12:34 PM
i wont, because i was a college student 10 years ago, and i'm still asking too low
 
@Abe I bet not as low as me :P
 
hi i want to display all the month of the year in option box here is my code
<?php
$m=date('M');
echo "<option value=$m>$m</option>";

?>
should i use loop here??
 
user image
11
 
@AlmaDo stop forgetting the damn --no-preserve-root
2
 
@SajjadKhan Doesn't that only return the current month?
 
12:39 PM
@bwoebi on my system it will work (:
 
hmh
 
yaeh @MikeM.
 
Why do you want to loop through 1 month? :P
 
@MikeM. i just want to display 12 months. how i do that??
any idea
 
The answer is in the answers of stackoverflow.com/questions/7020821/…
 
12:43 PM
@MikeM. honestly i saw that link already and i like that array method but try to do it using date function.. thanks
 
And even that is in one of the non accepted answers :-)
If you search something in the manual, will you also read only 1 page of it or would you read most referenced pages to know more information about the method...?
 
according to what i get you.. you're right but documentation is just a way to start it is not possible that all the problem are mention in manual??
 
damnit.
Did I link you the manual?
No, it's an example.
 
Hi guys... How do I create an ecommerce unique order number generator with PHP?
 
@moh.ABK What is an "ecommerce unique order number"?
 
12:49 PM
If you read about the DateTime class, you're not looking into what possible formats you can use?

Exactly the same as not looking through the answers given and only look to the accepted answer in a SO question.
@PeeHaa Maybe the primary key of the order? or well something like unique "T324dfdfnsf3223" bullcrap in orders. He probably means the invoice number.
 
@PeeHaa How do ecommerce websites generate order numbers that are unique and never repeat? I'm guessing they're not using rand()
 
@moh.ABK auto increment field?
 
@moh.ABK You can just use your primary key for that, it's always unique (using AI)
 
@MikeM. thanks
@PeeHaa thanks
 
Abe
or UUID if you are a hipster
 
12:53 PM
Hahaha @PeeHaa #REKT
 
UUID doesn't make you a hipster.... it makes you somebody that perhaps needs to transfer data between databases without worrying about PK clashes, or who wants non-predictable PKs to stop people from simply incrementing values in URLs
 
@Abe I'll look into that.. Any info on how to implement this with PHP..
 
@Abe Client calls customer support: Could you please give me your order number?
 
What's the best way to handle carts for ecommerce; $_SESSION or $_COOKIE
 
@moh.ABK Cookies.
 
12:55 PM
@moh.ABK Depends
 
Abe
@PeeHaa 00101000101001001010010100110100010101
*128
 
Most likely carts shall be remembered even when you close your browser.
sessions would only remember it till the browser closes.
 
@MikeM. thanks
 
Ahahah @PeeHaa #REKT again :-P
 
:)
FWIW you don't want to store the actual basket contents in cookies
Just store some id
Cookies are sent at every request
 
12:59 PM
so store the ids of the items, then vat, subtotal, total etc.
correct?
 
Just the id
 
Hello :) I am in need of someone to teach me PHP Data Objects. Can someone help?
 
And retrieve the info from db based on id
 
yup but that's common sense if you ask me XD
 

« first day (1845 days earlier)      last day (3097 days later) »