« first day (1871 days earlier)      last day (3077 days later) » 

Abe
12:00 PM
@salathe probably the visibility identifier on constants rfc?
 
@Sean O(n) denotes complexity rises with items processed, O(1) denotes constant complexity
 
@Abe um, wha?
 
Abe
@salathe or is that php 7.1? i meant "private const CONSTANT = 10"
 
@Abe what does that have to do at all with the code I showed? :/
 
Abe
12:01 PM
@salathe no idea, just guessing...
 
looks like a mistake
 
@Abe Haha, okay
 
@MadaraUchiha but.. but....
 
@JoeWatkins A "mistake" that Laruence is saying isn't a bug, and is now a documentation problem :(
 
maybe look at history for zend_do_inheritance, it was probably changed introduced by ng by accident ...
 
12:03 PM
(I usually ignore his "not a bug" comments, but this one intrigues me)
I might just mail internals saying "this changed, do we want it, give me teh whys" or something to that effect
 
most of history disagrees, it seems to be a bug ...
 
@JoeWatkins Thanks!
 
Abe
overriding a constant is probably the worst thing one can do with php's inheritance :D
 
might be a lsb thing too, I'm not sure ... but it looks wrong whatever ...
 
@JoeWatkins is the plural intentional here? :-D
 
12:11 PM
hehe ...
 
@salathe Looks like a bug… I'm guessing static is accidentally also inlined here…?!
mh, not inlined…
 
fml, my cat just jumped onto my bed and he had poop all over his paws =o(
 
@crypticツ you'll learn to appreciate when you got kids
 
Abe
too much information @crypticツ :D
 
@salathe looks like someone fucked the called scope up…
 
12:19 PM
@bwoebi cool, I mailed internals so you guys can go wild there :)
 
@salathe a simple bug report would have been enough…
 
@bwoebi there is one, it's "not a bug" apparently
Hence, asking more people for a decision one way or the other.
 
I think I've heard something here… I'm not sure whether I agree with him (think no; that's after all the point of LSB)
lxr.php.net/xref/PHP_7_0/Zend/zend_vm_def.h#3128 … doesn't look like a bug though… rather than intentional behavior… but let's see what they reply @internals
 
@crypticツ and just as a related fun fact: pooped diapers have the same falling behavior as bread with butter
6
 
Someone knows CakePHP 3?
 
Abe
12:34 PM
@Gordon youtube.com/watch?v=8geLnpGmQAQ could be worse
 
1:02 PM
Good morning
Sometimes you hard work is not appreciated at all. But some times - it is :)
So, I'm an official Release Sheriff now :)
 
@AlmaDo Nice :D
 
@Abe That's pretty much how I imagine having a kid.
 
Abe
lol
 
@Gordon and that's why I'll never make the mistake of having a kid. I don't mind adopting an older one, but I'll pass on all the bodily fluids and excrement.
 
@crypticツ that's the marvellous thing about having kids… you don't mind anymore. in fact, you might actually enjoy getting spit on :D
 
1:07 PM
@Oldskool though one time I managed to kill live cluster for couple of minutes :(
 
@Gordon Yeah, hormonal brainwashing isn't high on my list either.
 
@Gordon so you basically give up?
 
@AlmaDo at least not for hours…
 
@crypticツ when my boy had a cold recently, I looked like a paper issue by the end of the day. so what? can wash the shirt
 
@bwoebi even that costed more than 20.000 EUR :\
 
1:08 PM
I held my friend's baby and he vomited all over me =o\
 
@crypticツ I don't hold people's babies
Partially because of that
 
lol
 
@MadaraUchiha I strongly advise against that project now that you got elected. Tthere is a direct correlation between diaper changing and flag handling. You cannot do both.
 
lol
 
@Gordon Yeah, that wouldn't be a problem in the near future...
 
1:10 PM
@crypticツ ah, the joys of getting puked on by your baby. makes you feel so warm … from the outside AND the inside
 
Although I might be able to automate both with the same process.
Dealing with shit is the same everywhere.
 
LOL
 
@Gordon If a baby pukes on me, there's absolutely no guarantee I won't puke on it.
 
^ eye for an eye
 
while ($shit) { $this->dealWith($shit); }
 
1:11 PM
@crypticツ Stomach fluids for stomach fluids.
And with that, let's drop the subject :D
 
@MadaraUchiha not so supervillaintough as you think, eh?
 
2 mins ago, by Madara Uchiha
Partially because of that
The other reason is that I keep imagining throwing them like American footballs.
And too afraid I might one day act on it by accident >,<
 
It's not that bad really. Ironically diapers are pretty easy to deal with. The problem is eventually they learn to move, walk and then talk. And one day you look at them, and realize they are a miniature you, which is both awesome and terrifying at the same time
 
@Machavity awww, nicely said
 
1:28 PM
And you can make them do the household chores.
 
and they're always asking to borrow money
 
@Fabor not really…
 
@bwoebi Depends on how well you train them.
A very simple trick is to use a hash of today's date as the WiFi password, and hook up a RPi to the washing machine or something so that it only gives it away after a chore was completed.
 
@MadaraUchiha Hahaha, you are evil! :)
But I like your style.
 
@Oldskool Nah, just practical. Plenty of parents do it manually.
 
1:32 PM
@MadaraUchiha these tricks sometimes just work until the child gets too clever for you ;-D
 
@bwoebi That's also a win-win
 
win:win, they either learn how to get around it or do it.
 
If my kid can calculate the hash of the day at 8, I'll be a very proud parent.
 
@MadaraUchiha a first issue is the child doing a hotspot with their phone…
 
@bwoebi Hide the charger
 
1:33 PM
With their nokia 3210, unlikely :P
 
And then you also must not have some public wifi outside…
@Fabor bah, they all want iPhones today :-D
 
Kids these days have so many fancy toys. All I had was a care bear...I still have it =o)
 
@MadaraUchiha In general, these tricks work from 7-11 … the age where they're old enough to help and too young to outsmart you ^^
 
@bwoebi Again, if my kid is smart enough at 12 to calculate a hash, I'd be very proud.
Also, you can fairly easily add things like secret seeds and whatever similar to how 2FA works.
 
@MadaraUchiha they won't calculate the hash, but learn your password and look it up.
 
1:36 PM
You could have done that from the beginning, but I want the kid to be able to calculate the hash on their own as well :D
@bwoebi Password changes daily, that's the point
 
no, the password of your computer/user account
 
@bwoebi At best, they'll find a script that does that.
And if they find a script and deactivate it, still proud :D
 
yeah, finding the script could be harder…
 
@bwoebi I'd even leave it in a relatively obvious location for them to tinker with it.
The chores are important not just for my own laziness, but for them to learn how to do those chores
 
After all, I think setting passwords you can circumvent with a bit of work etc. is a good way to introduce your child in fiddling with computers :-D
 
1:39 PM
But if they develop the computer skills to move beyond the closed box App Store and prettified UI, and actually manage to alter a script, I'm fine with them not doing their chores for a while until I figure out an alternative.
@bwoebi Exactly, that's the point.
 
Abe
hey, wanna know how it feels browsing the internet like it was 1990? check this time machine simulator
5
 
I can encrypt and use ridiculous passwords and hide my files and revoke permissions
But I'd much much rather leave it out in the open for them to tinker with
 
@MadaraUchiha uhm… I learned it the hard way when I came to uni… but it's not that difficult (okay, I admit, I had a @kelunik to help me when I did things wrong ^^)
 
@Abe lol
 
@bwoebi Yeah, we didn't do chores as kids at the house either.
 
1:40 PM
@Abe wtf???
 
@bwoebi yeeep, that was definitely too late.
 
Made moving out a bit of a challenge but I got over it.
My brother is still hopeless though :P
 
@kelunik pffff :-P
 
He'll learn how to clean in the army, that's for sure
But he won't learn to cook basic stuff or do laundry.
 
@Abe LOL
 
1:42 PM
> Congrats! You’re using the latest version of Firefox
=o(
 
Abe
haha ^ shame on you :D
 
@Abe In that same vein, there's a Win10 preview change that will basically plead with you to give Edge another chance before changing the default browser. "It's Edge, not IE12! Why don't you like meeeeee?"
 
Abe
lol. msie11 and edge aren't bad at all... edge lacks of some features. as a developer i would prefer people using edge rather than firefox...
firefox is becoming an actual pita for frontend developers...
 
@Abe Does emulation of older IEs work for you in Edge?
 
Abe
1:52 PM
and from what i can see, it can only get worse. they seem to not care their browser feels like it's a decade old...
 
@crypticツ They didn't even try to create a new logo. ;-)
 
Abe
@kelunik i have no idea... wouldn't be surprised if they removed it though
 
@Abe The feature is there, it just does nothing in my Windows 10 VM.
 
@crypticツ that blonde guy looks a lot like Prince Adam/He-Man
 
I wanted to create a Windows 8 VM, but I need Windows to download the .iso. Now the .iso is inside my Windows 10 VM and the shared folder doesn't work. :-D
 
1:54 PM
@Gordon *gasps* are you saying you've never seen Scooby-Doo?
Also, I think it's the same studio that made both, so probably reusing characters.
 
@crypticツ not that often. Though now that you say it, I remember the dog
 
@kelunik set up http server inside your VM, point it to the folder with your file, forward the port you used for http server from VM to host machine
 
does anyone knows how to hide the border of an input when using mpdf?
 
> The more you take, the more you leave behind.
~ Riddle OTD
 
@nikita2206 Yes, that was also my plan, I'm just too lazy to actually do it. ^^
 
2:04 PM
How come the output is always 2?

function ping($host)
{
$outcome = array();
$status = array();
exec("/bin/ping -c2 -w2 " . $host . " 2>&1", $outcome, $status);
if ($status == 0) {
echo "1";
return true;
}
echo "2";
return false;
}

ping("127.0.0.1");
 
@Tredged Because the command always runs.
Ping doesn't return a different exit code if the pings timeout.
It still completed the command.
 
posted on November 30, 2015 by nlecointre

/* by Alfwed */

2
 
@Oldskool How can I find a solution then, its supposed to ping a local adress which outputs always 2 .. if its live it should be 1
 
Hmm, wait I might've talked too soon. Quick test gives me an exit code of 2 when ping times out.
@Tredged Might be because you initialize $status as array, rather than int
According to php.net/manual/en/function.exec.php only $output should be array. $status is just a plain int
 
@Oldskool Would a count arround if work?
Count around my status in if* Thanks btw ;-)
 
2:15 PM
Im new to here, does anyone know how should I pass $_POST from controller to service :((( ?
 
@Andrew What framework?
 
@Oldskool no framework involved haha....just learning my way of MVC
 
@Andrew Oh OK, well I'm not too familiar with the technicalities, but I believe Symfony makes the Request stack a service as well, so you can inject it into other services like @app.request, so it passes the request from one place to another. Something like that should work. But if you're looking for technical details I'd just peek at the source code of existing frameworks and see how they handle it.
Then just give your service a constructor that takes the request as parameter and pass it from the controller.
 
@Andrew you shouldn't be accessing superglobals inside controller to begin with
 
@tereško unless it's a toy application or he doesn't intend to test the controllers or call them from anything else but HTTP anway
 
2:25 PM
@Oldskool oh ok, what framework would you suggest ?? maybe Lavarel?? thanks btw
 
@Andrew Well, frameworks all have their pros/cons and it's mostly just a matter of personal preference. So I'd just pick whatever works for you.
 
@Gordon sure, if you are just throwing up a quick experiment, then who cares about superglobals
but it's not really about testing .. it's more to do with getting rid of all the repeated conditional all over the class
 
how should I handle the superglobals like $_GET and $_POST ??
 
@Andrew if its for a serious project, encapsulate them in a Request object
 
@Andrew Make them relative to your Request object. The request respresents something passed to the controller, from there you can dig deeper into the GET/POST stuff.
 
2:28 PM
@Andrew you create a Request instance somewhere at the bootstrap stage which collects data from superglobals.
 
oh man, this chat room has so many legend here
9
 
I wish our workplace used a Request object ._.
We were discussing relevant code standards and not using superglobals came up.
 
I also like to not distinguish between post and get variable in the Request, because it makes it a bit cleaner API
 
They just said that there was no use in not using superglobals due to how far along the codebase is
 
its just a personal learning curve :D
 
2:30 PM
@Sean Refactoring is always an option and many times a reality.
 
@Sean so the rot from excessive technical debt has already set in
 
People that don't want to refactor stuff into something better and still call themselves developers should slap themselves.
 
@Oldskool In a sort-of tit-for-tat tradeoff, they said the effort to correct the code would be too much compared to the actual gain
@tereško Yep ^
 
@Sean well you also be maintaining that project or is it a one-off thing?
 
@tereško Which wins if there's a GET and a POST variable of the same name?
 
2:31 PM
@tereško It's in-house software, so it's my life right now, and will be for my career here. :P
 
@tereško eeeew
 
@MadaraUchiha I have it rising a WARNING if there is a variable with same name
 
@tereško Eh, I usually separate them because they have different meanings.
 
@MadaraUchiha do they really have those "different meanings"?
 
@MadaraUchiha How would one have a combined GET/POST Request? If you're POSTing to something like dostuff.php?action=doThis, rather than POSTing the action field with doThis as value, you should be facepalming... hard!
 
Anonymous
2:33 PM
@tereško wrong
 
@Oldskool The question is not whether you do it in your app or not
I can issue requests that are unrelated to your UI
And an untreated case might be a security vulnerability.
 
Hmm, true.
 
sorry for the slowing read, so perhaps a request object would handle superglobal in controller layer and pass them to model layer?
 
The main thing about it that makes me shiver would be able to login via url.com/page?email=...&password=... :V
Unless proper nonces were in place ,etc.
Speaking of nonces, is there a nice message to show to the user if a nonce is wrong, expired or otherwise invalid?
 
@Andrew The standard way of doing it is to do it even before the Controller layer.
 
2:36 PM
@Andrew Was said earlier up, it should be on the bootstrap layer
 
@Sean I fail to see the problem. Why would something that bypass CSRF check?
 
Before the controller layer there's routing, for example.
 
@MadaraUchiha can you actually give an example?
 
$request = new Request($_GET, $_POST, $_COOKIE, ....);
$response = new Response($request);

$route = $router->route($request, $response);

$controller = $controllerFactor($route, $request, $response);
@tereško No, I can't.
But smarter people than me might, and I'd rather not have this rather obvious case untreated.
 
> $response = new Response($request);
 
2:38 PM
You say you throw a warning and let one of them win, that's treated in my books, which is fine.
 
request -> response?
What's the purpose of $response?
 
@MadaraUchiha it has all the same "vulnerabilities" as a standard POST forgery
 
The output of the app/page?
 
@Sean Yes, an abstraction over output, headers, redirects, etc.
 
2:39 PM
@Gordon that depends on server's config.
 
It represents the response you're about to send out to the user.
 
@Sean a lot of framework pass Response objects around to be 'filled' in...
 
@tereško Yeah I agree, I don't think it would be an explicit vunerability, it just seems weird to me.
 
@tereško Again, I'm not saying there's anything specific with your approach
But untreated cases that involve user input makes the hair on the back of my neck stand.
 
@tereško yes, but if you overwrite them the same way in a userland request object it has potentially similar problems as using $_REQUEST
48
A: What's wrong with using $_REQUEST[]?

GordonI've been digging through some newsgroup posts on PHP Internals and found an interesting discussion about the topic. The initial thread was about something else, but a remark by Stefan Esser, a (if not the) security expert in the PHP world turned the discussion towards the security implications o...

so it does make sense to separate them
 
2:40 PM
@MadaraUchiha I know. You just have that feeling of "there should be something wrong with this"
 
Ewww, $_REQUEST ... shivers
 
@tereško Yes, and there may or may not be something wrong with it, I haven't tested it.
Once you treat it in some way (i.e. POST always wins, plus a E_WARNING)
 
thus, "the vague feeling"
 
Then it's fine.
But then you need to look at your solution and see if it has problems
Like @Gordon noted, it has the same problems as $_REQUEST.
 
thanks for all the sharing info !!!! really !! learn alot from just reading legend MVC post
 
2:42 PM
To which the solution was to separate into $_GET and $_POST to begin with :P
 
$_REQUEST has shitload of other problems
 
@tereško Agreed.
 
@MadaraUchiha No, the solution was to exclude cookies and env data from get/post.
 
and uploads
 
an alternative would be to use a mapper that takes the superglobals and maps them to a specific application request fit for the controller. if you use a generic request object, you'll often need a second one when you intend to use a controller that doesnt speak http, e.g. cliRequest, httpRequest
or you just use two controllers, e.g. httpcontroller and clicontroller.
 
2:52 PM
that can be done by few just swapping couple builders/factories in the bootstrap, if call comes in from CLI
 
@Sean ....the controller for logging in should only be called if the request is via a POST method, and it should be checking the CSRF token first.....the ability to set variables via the query param, to override those in the form body doesn't appear to be a vulnerability if those two things are done.
 
@Danack Man, you are ON THE BALL for responding.
Just a bit of meta, but it happens every time :P
20 mins ago, by Sean
@tereško Yeah I agree, I don't think it would be an explicit vunerability, it just seems weird to me.
 
I could see it being a really nice hack for integration testing.....you could write tests that don't need to alter forms, but can force particular fields to be set invalid values.
 
@MadaraUchiha just dropping in to say congrats :) you were the only reason i bothered voting in this election
 
@CarrieKendall Cheers, it means a lot :)
 
3:08 PM
@CarrieKendall Considering he won by like one vote, I'd say you're the reason he's a mod ;)
 
@Machavity Oi
 
@MadaraUchiha Just giving you a hard time. I was surprised it went down to the wire like it did
 
@Machavity Me too
3rd place is always close, but this one was very close
I think the closest was 23 votes or so
 
Can I just generate new certs whenever I want / feel like it @kelunik re LE
Or is there some limit / throttling?
 
@MadaraUchiha how do you see the vote difference for the final round?
 
3:14 PM
I was actually wondering about how the proofing process works
@AwalGarg Check the RESULTS meta post
 
@PeeHaa Currently 10 certificates / main domain / 59 days.
 
There's a breakdown of the elections there
 
@kelunik ty
 
that sounds like too much work to do
 
@kelunik What guarantee do you have that the domain I say I have is actually mine?
Does the client/server expect some file to be accessible from the domain or something like that?
Or does it create the file itself?
 
3:16 PM
@MadaraUchiha I don't understand your question.
 
@kelunik I want to create a certificate for madara.ninja
 
"three examples above" or "three above examples" ?
 
How do you prove that the domain is really mine?
@Shafizadeh Either is fine.
 
@MadaraUchiha Domains are validated via files, yes. That's one of the 4 possible challenges, but I think only tls-sni-01 and http-01 are currently allowed for LE.
 
@MadaraUchiha tnx
 
3:16 PM
@Shafizadeh first one sounds better
 
ok tnx :-)
 
@MadaraUchiha If you use http-01 as challenge type, you just have to provide a specific payload at /.well-known/acme-challenge/$token.
 
"element considered" or "considered element" ? (I want to say: the element which is assumed in our minds)
 
^ depends on context
what's the full sentence?
 
wait please
 
3:19 PM
@MadaraUchiha To be specific: The payload is the token concatenated with a sha256 of your public key (JWT thumbprint)
 
damn, the consumer portal for my mobile operator is down, and I have to pay the bill today
 
@tereško I have some nested elements and my HTML structure doesn't has any discipline. Also there is not any classname for selecting element considered. So, the only clue that I have is containing specific element.
 
"doesn't has any discipline"?
shouldn't it be "doesn't have any semantic meaning" or something like that?
 
@tereško no I meant was I have a robot which generates different html codes for each request.
discipline = regularity
 
well, "discipline" is the wrong word, because it usually applies only to living beings
I think you mean "order"
 
3:24 PM
I see, ok
@tereško yes yes, order is good for my target
 
> Also there is no classname to use for selecting such an element.
 
what I sent is not full of context. there is some attached codes.
 
or ".. selecting that element"
 
ahh! ok
well, "element considered" is fine? or should I change their position?
 
I have code that was running perfectly fine so far.. now it is says Class 'PDO' not found.. I did not change anything .. I am on shared hosting..
 
3:27 PM
@Shafizadeh didnt you notice that I rewrote the entire sentence few lines above?
 
@salathe DO EEEEEEET!!!!!
 
@whatever did you add namespaces? You probably need to write $foo = new \PDO(...);, because the "built in" classes reside in the global namespace.
 
@tereško I can not see it ...
 
3 mins ago, by tereško
> Also there is no classname to use for selecting such an element.
 
As I said I did nothing... The code was perfectly fine .. I run now and it said PDO missing
 
3:29 PM
@crypticツ I usually put 'Test' into the top-level namespace, as it avoids confusion so ./tests/AcmeTest/Rockets/FooTest.php
 
@tereško ah, I got your point now :-) tn
x
 
@JoeWatkins You should phone them, and tell them you are being forced to leave the property, and ask them if they want to transfer the connection to the new property. That is a massive incentive for them to give you a deal.
 
@tereško I thought "such an" means "for example" ..! is it not? (but in your sentence it has different concept. I think "that" could be more better (as you mentioned it))
 
@Danack I already deeeeeed!!!!
 
I should check before posting !!!!!
 
3:35 PM
Screw that!!!!!
 
you have to use "it" instead of "that". I heard it already. you have to say: "screw it"
... or maybe both of them are true, I don't know
 
E_ENGRISH_LESSONS?
 
I don't get your point, but yes, what I said was a small English lesson :-)
 
E_DOES_NOT_COMPIUTE
 
Thanks @teresko it worked.. but why would it happen as I did nothign .. no namespaces etc
 
3:42 PM
@ircmaxell please tell me what are those words with capital letters and starts with "E"? are you coding here? is it a new language/method?
 
it's a joke on the error constants
 
E_* are PHP error type constants
 
owww. alright then :-)
 
thanks Sean
I don't know I pressed what buttons that were made an inner-shadow around this question:
what is the story?
were made has made *
 
3:54 PM
@Machavity the power is riveting :P
 
is there an equivalent way to "toggle" 1/0 in php like in javascript?
eg in javascript : !1+0==0 and !0+0==1
 
> php -r "echo !1+0;"
0
> php -r "echo !0+0;"
1
So, the same way presumably? :p
 
posted on November 30, 2015 by nlecointre

/* by Saulenco */

 
As a statement, $n = !$n+0, so long as $n is either 1 or 0.
or just $n = (int) !$n
 
would multiple string function call slower than regex ?? just wondering which would create more overhead :D
 
4:08 PM
@Andrew Seems pretty context specific, you should test it yourself if you're applying it to real code ^^
 
@r3wt $val = 1 - $val;
no booleans or casting required
 
@Sean you are right. sometimes I just see in php tag with string manipulation; most answer offer preg_* function :S
 
@Andrew none of them are going to create enough overhead to worry about unless you're doing them in a tight loop
 
@ircmaxell thanks for the head up and link :D
 
:-)
 
4:14 PM
I am glad this chat room exists :D, I got a lot of wonderful answer from here today !! :D
 
$roomCollection->getRoom(11) == $beeCollection->getAll('knees'); // true
 
Mornings11
 
.. God it's a slow day.
@RonniSkansing Morning!
 
yes.. feel the same =)
much slow day today
 
With the above, you can evaluate that Room 11 is the bees' knees.
.. ha. Haha.
 
4:18 PM
@Sean LOL
 
4:35 PM
@Danack I usually avoid putting Test into the namespace because Acme\User\Controller and Acme\User\ControllerTest are both part of the Acme\User package. But I guess it boils down to preference.
 
5:02 PM
@Gordon do you put the unit test in the same directory as the src files?
 
@RonniSkansing no. I have test and src at the same level and mimic the src structure in test. but when it comes to namespaces I dont care for folders. Namespaces are to logically group components.
 
yea okay.. that is more like what I thought =) but you never know, always like peeking at how people organize their projects
naming + relations + structure ..
I tend to almost start a new convention for each, whenever I start a new project
User/UserController vs User/Controller vs User/Controller/SingleAction and etc
 
@RonniSkansing I am still very much fiddling with the "right" way to organize stuff, too. So I can relate to that
 
I am running into cache trouble.. I have page where I check dynamically whether a user has some interest or not but the page is getting cached and does not load data from mysql..
<?php
error_reporting(E_ALL);
ini_set('display_errors',1);
include_once('include/db.php');
ob_start();
header("Cache-Control:max-age=0");
function check2interest($mysqli, $userid)
{
$query="select * from registration_steps where UserId=$userid";
$result=$mysqli->query($query);
$row=$result->fetch_assoc();
echo $row['Interest'];
 
@RonniSkansing it also depends on whether any convention was already in place when I arrived at the project
@whatever ctrl-k your code please
 
5:10 PM
ctrl-k?
 
yea.. If I pick up a project, I "always"follow the existing rules .. for new projects I come to the conclusion so far that it is context based... and worse it changes as the project spec changes
 
<?php
error_reporting(E_ALL);
ini_set('display_errors',1);
include_once('include/db.php');
ob_start();
header("Cache-Control:max-age=0");
function check2interest($mysqli, $userid)
{
$query="select * from registration_steps where UserId=$userid";
$result=$mysqli->query($query);
$row=$result->fetch_assoc();
echo $row['Interest'];
}

?>
<!doctype html>
<html>
<body>
<?php
if(check2interest($mysqli, 1))
{ echo "hello";} ob_flush();
?>
</body>
</html>
 
I like having it separate at least in part so the stubs are clearly not part of the project .... AcmeTest\Stub\UserRepo
 
@whatever wait? you mean, you really dont have indentation in those curly braced blocks?
 
'morning and happy monday
 
5:13 PM
does it matter... I am copying and pasting the code in pages to get it right so did not format it properly\
 
yes it does matter @whatever :)
 
@whatever yes, it matters, no one wants to look at badly indented/formatted code
readability FTW
 
Sorry about that
 
anyways, I dont have my diamond powahz anymore, so I cannot format it for you.
 
there are indentation on my editor ..
the copy and paste in this chat window removed those I think
 
5:15 PM
well, good enough for this time I guess
 
@Gordon I think the code is not that confusing.. I need to know what can possibly cause the caching..
Sorry about the formatting..
 
there is nothing in the code that would suggest any caching to be active
 
@whatever do you use chrome.. if so have you tried in the network tab clicking "Disable Cache"?
 
anyways … driving home now. see you tmr
 
later @Gordon
 
5:21 PM
yes.. I just did and then its fine
@Ronni
 
if enable the cache again (in chrome) ..
 
when I remove the check then It does not load the new data
 
have you inspected the request in the network tab
 
no did not
 
ok
you should do that. Click on the specific request in the network tab. Check the request / response headers if they are like you expect
 
5:23 PM
okay.. but is this default feature of php to cache?
 
I thought you where talking about clientside caching
and no, php does not cache the output
it "runs" the script every time it is requested. Which webserver do you use?
 
apache
 
are you sure it is getting cached?
 
yes of course.. I change the field in database then i refresh 4 times and it does nothing on fifth time it does refresh.. when disable cache then it get refreshed evertime..
I have set the header to disable the cache but not working
 

« first day (1871 days earlier)      last day (3077 days later) »