« first day (720 days earlier)      last day (4222 days later) » 

user50049
5:00 AM
The zip headers should never be set unless there's a zip that is valid. That could fix your immediate problem
 
user50049
did you talk to register_shutdown_function() anywhere else in the code?
 
user895378
WOW ... two (!) w3schools references on one question. The only answer and the only comment suggest w3schools tutorials.
 
user895378
0
Q: Running PHP asynchronously

user1721941Given an input and a button in PHP, I need to enter an amount of time in the input and then press the button, it should execute a PHP function after that amount of time. How do I do this?

 
user50049
@rdlowrey Not recursively I hope
 
user895378
heh ... I guess bad questions get bad answers :)
 
5:01 AM
@chx101 if you yourself say that it's a fucking thread, then who else wanna look at that fucking thread
 
@rdlowrey always a good thing right
 
he keeps asking for answers but doesn't let us ask any questions about the code, so i'm done
no one can read that code without wondering what's going on elsewhere in it
and he doesn't want to cooperate. i gave it the old college try
 
@ChrisClower Sorry to bash on you, you seem not to know PHP because that is simple code.
 
is it? how come no one else here can figure out what the hell else is going on in unseen code that you're calling all over the place then?
i guess we're all retarded then
 
Oh boy... he is still here.
 
5:06 AM
Take a shot at it then Lusitanian, since I suck so bad
i tried
 
That's why you keep asking for more code to which I replied it doesn't have to do with the fact that there's something wrong with the way PHP is responding to the mobile browsers, except Opera.
 
user50049
@chx101 <h1>Nothing to export</h1> is in your output buffer when it should not be, and the reason for that is not obvious given the code you have posted.
 
user895378
tiny avatar night! wooooooo!
 
@ChrisClower I'm not referring to the question, just to your general attitude towards everyone in here.
 
5:07 AM
@TimPost that is why I said there's a bug in PHP. Because once you call exit(), the script should terminate but it doesn't
 
user50049
(You're also missing a content length header which is known to throw older mobile browsers)
 
dude, listen... me and 2 others tried helping this OP...
 
user50049
@chx101 Ok, test that. Switch it around as I suggested. Check if count is greater than zero instead of less than OR zero and call flush if it is
 
my attitude was very positive and i was the only one who tried for the first 10 minutes, you were nowhere to be found
 
user50049
otherwise, print <h1>Nothing to export</h1>
 
5:08 AM
@ChrisClower Considering I wasn't physically at my computer that could be why.
Anyway, back to the ignore list you go.
 
user50049
Then you know there's no way that string could possibly be in the output buffer. It's a trivial change to try.
 
@TimPost let me put it on my server and just make it dump all the vars ok
You'll see what's going on
 
@Lusitanian you funny
 
@chx101 Yeah, do whatever you want. Its not like the advice you have received is any good. We are all morons. Either that or...
 
he started insulting us for asking questions and yes, that pissed me off, because we're trying to help him and he doesn't help us help him, so yeah it's frustrating, while we sat here for another 10 minutes guessing about what he was doing and he kept going "you don't need to see that code, it works in windows" on an android question
 
user50049
5:10 AM
Just only call flush if you know there's something to send? It's like 3 lines of code to change dude.
 
user50049
Do you want to prove a point about PHP or do you want your code to work so you can do other stuff?
 
thanks, please ignore me, so i don't have to put up with your ignorance jumping into convos without knowing shit
 
This has really been a bad night for this chatroom.
 
user50049
@Lusitanian On the contrary, I'd say it was a rather successful test of its immune system :)
 
user895378
@Stephane I didn't bother with that answer once teresko said he'd cover it (which he did very well, BTW).
 
5:12 AM
@TimPost Let me try that.
 
maybe for you, but i've actually put effort into helping people while you've been busy afking when a question is asked
 
@TimPost heh, that's one way to look at it
 
i still want to help chx101
 
@rdlowrey maybe tomorrow if you have time I could ask a few follow-up questions... I'm going to sleep soon. I'm going to let that sit overnight.
 
It's now 1 hour into friday for me, by the way
 
5:13 AM
@Lusitanian Agreed. I think I'm starting to lose it. The atmosphere here is normally at least semi-professional. Tough things may be said technically, but personal attacks aren't the norm.
 
user50049
@ChrisClower You mean picking up my kid from the bus and making her lunch? Oh how dare I?
 
user895378
@Stephane Yeah sure -- I'm more inclined to answer chat questions. Full answers just take so much work :)
 
yeah
I get that
 
i really want to help, but i can't do it if he doesn't help US help HIM. so if he wants his question answered, an attitude adjustment is needed
 
@Paul I agree with you totally --- we both know who dragged that down. I hate to say this, but this was like an unmoderated IRC channel earlier (no offense @TimPost -- you're not an "unmoderator" :) ) <--- I hate putting emoticons in parentheses.
 
user895378
5:14 AM
@Stephane FYI, I do still think you can benefit from the use of a dependency injection container (DIC) to wire together all your application objects.
 
user50049
@Lusitanian No offense taken :) Nobody flagged a thing. Why would I lift a finger?
 
@rdlowrey @tereško whines when people mention DICs, at least sometimes
 
suddenly the trolls come back
 
i can tell
 
@TimPost To make your daughter's lunch!!
@Stephane Do you still have that link I gave you last night?
 
5:15 AM
@rdlowrey That's kind of what he created, yes? I'm going to paste some procedural code when I run into you tomorrow so you can see what I'm working with.
 
You should take a look at Pimple, it is a pretty simple and documented example of a DIC
 
the room was silent while i tried helping someone by myself and begged for help myself, but now that OP needs to change his attitude and i call him out, suddenly i'm the badguy again. thanks everyone
 
@Lusitanian I have so many tabs open from researching this stuff. Can you give it to me again?
 
i appreciate the team spirit here
 
user895378
@Lusitanian IMNSHO There's a very specific niche case where DIC's are extraordinarily useful. Anywhere else and they are generally at best overkill and at worst terrible Service Locator bastardizations.
 
@Lusitanian oh yeah, I saw that. I need to look at it again. Thank you
I did have it open
 
@rdlowrey IMHO any application with a large amount of services can benefit from them as long as they are true DICs and not service locators in disguise
 
let's get back to OP's question, please?
 
user895378
@Lusitanian agreed
 
@ChrisClower This is a chat room, we're allowed to talk about other subjects besides one person who came in here and asked a question an hour ago.
 
5:17 AM
What's the difference? DIC = factory instead of a pass-through?
 
none of you elitists who call the helpers trolls has contributed a thing, so let's go
 
user895378
@Stephane No, his example is just a simple factory.
 
user50049
@ChrisClower Only other thing I thought of was a browser sending a request twice. (seen buggy $().ajax{} calls do that)
 
@Stephane As @rdlowrey, a DIC "wires" your components together
 
@TimPost @Paul I'm glad you guys haven't disrespected me. I'm really trying
 
user895378
5:18 AM
@Stephane A factory is a hardcoded class that exists for the express purpose of creating an object. A DIC can usually (with the help of some definitions from you) instantiate pretty much anything.
 
@Lusitanian I probably need that. I have really complex interactions across data objects
 
The Symfony DIC is larger and has some more interesting features --- again, just don't use it as a service locator or you defeat the purpose of DI.
 
@Lusitanian @rdlowrey and DICs are seen as ... ok? Not violating principles?
 
It's hard for me to try to help an OP unless they help us help them. that was my only point. i wasn't bashing or trolling.
it wasn't a personal attack at all
 
Explain what a service locator does that might make a DIC turn into one?
 
5:20 AM
@ChrisClower Free help isn't the goal of most people in this chat. Learning is generally seen as more important by most. chx101 had to be cajoled into even trying out the good advice that was given to them. I don't need to hear that you are willing to help someone, especially someone who hasn't bothered to try the advice already given (or is busy trying @TimPost 's advice).
 
Service locator is pretty self-explanatory: it's an object that looks for things
As you know, in OOP, you shouldn't look for things
 
@Stephane i understand
 
$this->locator->get('emailing.service'); <------ bad
 
sorry
 
user895378
@Stephane DICs are like alcohol -- used appropriately they're awesome. But if you use a DIC/alcohol irresponsibly you perpetrate terrible atrocities.
6
 
5:21 AM
Wow.. that Symfony code is pretty sweet
 
user50049
@ChrisClower He's right though when he says exit() should exit, and it does. @chx101 the other thing you could try is (if that didn't work) echo('nothing here'), then flush OB, then exit()
 
haha
 
@Paul i understand, i hit the wrong reply
@TimPost I didn't argue against exit()
 
@Lusitanian Ok, I get that in principle. I"ll probably make that mistake a few times.
 
never even mentioned it, were you replying to someone else?
 
user895378
5:22 AM
@Stephane One of the benefits of using Inversion of Control (IOC) is that you want your class APIs (i.e. the constructor method signatures) to be as explicit as possible.
 
function __construct(MailingService $mailingService) <--- good
 
user50049
@ChrisClower Oh I know, I was just giving context .. His major source of confusion was .. exit() is apparently not exiting (given the code he posted)
 
Yes, I love that.
And DICs allow that to happen?
 
I'll have to look this up and then ask questions
 
user895378
5:23 AM
@Stephane So if you inject a DIC (that can create any object in your application) into a class constructor, your API is now a lie. It doesn't tell you anything about what the class depends on.
 
Great
 
user50049
I'm going to regret this, but what precisely is a DIC ?
 
@rdlowrey that's what it sounded like
 
@TimPost Is there an implication there or are you referring to actual code?
 
user895378
@Stephane When you use a DIC that way it's loosely grouped into what's called the "Service Locator" anti-pattern.
 
5:24 AM
@Lusitanian I read a blog post recently that said Interfaces should generally be named: -able or -ing. So, maybe that could be Mailable?
 
@TimPost Thanks for your help.
 
user50049
@ChrisClower No it was something he mentioned
 
and suggestions
 
user50049
Any luck?
 
I'll keep that in mind
 
user895378
5:25 AM
So that's an example of how not to use a DIC. If you use one, it should only be to wire things together ... not as a magic bullet to give an object access to everything.
 
@TimPost it's an object (container) that holds definitions for all of the services in an application
and tracks their dependencies on each other and "wires them together"
So if you have a Mailer service which depends on a Templating service
It knows that, and when it injects the Mailer service into, say, a controller, it automatically injects the Templating service into the Mailer service first
 
user50049
@Lusitanian Ahhhh, ok. I've been calling that a thingamadongdong since I realized the concept could be implemented.
 
lol
 
@Stephane www.youtube.com/watch?v=RlfLCWKxHJ0
 
@TimPost Listen, i came here to help people, not as a source of entertainment, I'm not a troll although I do tend to "troll" trolls sometimes, but that was never my intention, I want to provide advice to people with questions. I don't know if these comments were troll attempts, but I have been badgered since I came here and have been on the defensive
 
5:27 AM
Being defensive on the internet isn't a good thing.
@TimPost But yeah, nothing too fancy; just dependency management. The problem is when they're misused and people inject the DIC into classes
instead of specific services from the DIC
 
@TimPost Nope. I just thought of a way. I'm going to use DropBox API.
 
however, i can see who the trolls are easily because some people provide help around here when questions are asked while other active members disappear
 
and then you wind up with the luxurious service locator anti-pattern
 
**Dropbox rather
 
@Keyne oh yeah! I watched that this week. I wanted to save the URL, thanks!
 
5:29 AM
but then they pop up at "appropriate times" and the chat room goes lively again to bash whoever is the easiest target
 
user895378
Can I put a bounty on a question that has an accepted answer?
 
people inject the DIC into classes

instead of specific services from the DIC
 
user50049
So today I learned what a term meant, and I should never use a thingamadongdong when drinking. Wow I love this room.
 
Thanks for that. Much clearer to me
 
but the chat goes dead when a question is asked that's not blatantly stupid
 
5:30 AM
@ChrisClower Congratulations, you just stated that @TimPost's question to me three minutes ago or so was blatantly stupid.
 
@TimPost Make sure your thingamadongdong doesn't have a leaky abstraction.
 
It's amazing how quiet and calm this chat is after using ignore
 
@Lusitanian nice
 
user50049
@ChrisClower You know we have a whole site where people can ask questions, right? Chat is just that, chat ... it's not focused. People can answer questions here, and other times people might be too tired to, or just not feel like helping, or busy, or whatever.
 
@Stephane You got it.
 
5:31 AM
Thanks for your help coders. Have a great night. Learned a lot and now it's time for the brain to rest and absorb
 
user895378
1 min ago, by rdlowrey
Can I put a bounty on a question that has an accepted answer?
 
user895378
^Dammit people, don't make me search the FAQ myself. I want to be lazy :)
 
@Stephane have a good night!
 
user50049
@Paul My thingamadongdong is garbage collected.
 
@rdlowrey Hello, and yes, I'm pretty sure that is possible.
 
user895378
5:32 AM
@Paul woot and thank you :)
 
Out of all the swelled and infalted elitist brains here... still no one knows the answer to the question i came here 2 hours ago for
 
What was that question?
 
user895378
It just occurred to me how stupendously lazy that was on my part.
 
user50049
@ChrisClower 42
5
 
you want to get rid of me so bad? then why haven't i got any help at all?
 
user895378
5:33 AM
All I had to do was open any question that had been answered and was asked more than 2 days ago.
 
@ChrisClower What's your question?
 
i made a login system... (cont'd)...
and it's 100% ajax based
 
user895378
@tereško I'm going to award a +100 bounty for your Dependency Injection: How to pass DB around? answer tomorrow once it becomes eligible. The other garbage answers were a blight on the SO PHP community and have rightly been stamped out. Good work.
 
it also does registration
 
okay
 
5:35 AM
it has very strict validation and bootstrap-inspired cues
 
for length, invalid chars, password stuff, and unique username and password
 
right
 
Sep 30 at 19:30, by PeeHaa
Fuck me I'm stupid
 
so it works great on localhost
 
user895378
5:36 AM
@Keyne lol yeah that's appropriate
 
=D
 
and, on a server, it does the validation and db checks for unique fine
but it doesn't submit
it submits, kinda, because it's ajax lol
 
Okay
 
@rdlowrey yeah, thanks
 
@ChrisClower are you using jQuery?
 
5:38 AM
somewhat, not completely
 
So what's the issue?
 
it gives a 500 on the production server on submit
for registration or for login
 
Okay, so check your error log
and see what the message is
 
nothing, just "an error"
 
That's PHP giving you an error but it's hidden because you have display_errors off on the production server
 
5:39 AM
it doesn't know
 
Yes it does, it's just hidden.
Either turn on PHP error logging or temporarly toggle display_errors and restart your FPM or web server
 
why does it work on localhost though?
 
If you have an .htaccess also check that
 
then check what the message is and then I can help you more
I don't know, because I haven't seen the error message.
@chx101 that wouldn't hold errors, it just provides directives
 
Yes it causes errors
 
5:40 AM
i ruled out .htaccess a while ago
 
500s
ok
 
it could be a db thing, i don't know
 
@ChrisClower trust me, just turn on display_errors and restart apache (which I'm assuming you're using) and try again, then read your response
 
user50049
@ChrisClower What's the actual response text from the AJAX request? (It's likely a CI error page)
 
well, i don't have access to php.ini on the server...
 
user50049
5:41 AM
Missing the XSRF cookie name perhaps? or value?
 
and localhost is strict, so it shows everything
 
Okay --- so it must have error logging setup somewhere
find your PHP error log -- also, you can toggle display_errors via an .htaccess file
 
the response from ajax in the console is 500
 
You can set the output to a file just for your domain
 
like so php_flag display_errors on
 
user50049
5:41 AM
@Lusitanian The absence of an error log usually means CI did not like the request, which is why I suspect cookie / XSRF naming.
 
in respinse to tim
 
@TimPost seems reasonable
 
user50049
@ChrisClower Not the code, the response text
 
user895378
 
user895378
lol ... there goes @Lusitanian again with his chat monologues. I wish he'd stop talking to himself :)
 
5:42 AM
@ChrisClower he means the response body, not the code
@rdlowrey lololol
 
user50049
It will likely contain the CI error page that would normally be shown had it been a normal browser request
 
what's XSRF?
i have CSRF off
it was on but i turned it off to see
 
user50049
@ChrisClower CSRF (x meaning 'cross')
 
ah yes, CSRF protect is off
currently
now, the login DOES do an update
 
Well, wait --- can you read the response text?
 
5:44 AM
for last_logged (DATE_ATOM())
 
Instead of the response code -- view the text -- that should help you determine the error.
 
i don't know how to do that
 
user50049
Yeah, if using jQuery it's in the xhr.responseText
 
user50049
or console.dir(xhr) in your error handler
 
5:44 AM
the ajax portion is (mostly) jquery
 
user50049
here:
 
how do i find this xhr?
 
THANKS TO YOU ALL, I MUST TAKE A BREAK FROM THIS SOFTWARE INDUSTRY SHIT AND PLAY BATTLEFIELD 3 FOR A MOMENT. THANK YOU ALL
 
user50049
error: function(xhr, desc, err) {
            $('#loader').hide();
            hudMsg('error', 'The request to communicate with the server failed.');
            console.log(xhr.responseText);
            return false;
        }
 
@TimPost Why is your nickname blue? o.O (is it just here?)
 
user50049
5:45 AM
^^^ from live code
 
BF3 ftw, have fun :)
 
@Keyne he's a moderator
 
yeah he's blue, he's a mod lol
 
@Lusitanian That explains a lot =P
 
ok so that will print out the xmlhttp error?
 
user50049
5:46 AM
So @ChrisClower Just toss console.log(xhr.responseText); in your error: handler and watch the console. You'll see the HTML of the CI error page
 
Yes
 
but i think it might be a db error, not sure
 
user50049
Yes, you will see what CI actually sent, which will have been an error page telling you what the issue is
 
it's so hard to tell with 500's
but it seems like anything with an insert throws it
 
user50049
It's always a 500 if you reach that part of CI (stupid, I know)
 
5:48 AM
if reading the db, it works, the same basic request
that's why the ajax works when checking the db for unique user or email
but if it has to insert, it tosses an error
 
user50049
It's probably something very stupid.
 
it probably is
what really confuses me is why it works on localhost and not on production
this is for a client...
 
user50049
And please turn the CSRF cookie once you get it working :) You can use the jquery cookie plugin to get its value easily.
 
and i'm REALLY close to giving up on it, lol, because it works perfect on my computer but not in production, and i feel like i can't figure it out, it's so frustrating
i wrote a p[lugin for cookies already, although i only use cookies on localhost....
because they never get far enough ont he server to set lol
but my cookie script is a plugin
for jquery
 
@TimPost are you one of those jquery plugin addicts?
 
5:52 AM
it sets a cookie if localstorage isn't an option
and if localstorage won't work, it uses a cookie as a fallback
all tokenized
no passwords stoerd locally, no worries
stored*
 
@TimPost Lusitanian seems you were trying to guide him. What made him give such a comment and even contempt with his profession finally? @chx101 Are you there?
 
why not use a premade cms or auth system for CI? because the client needs a custom cms and also because i want to do this to learn
i could use a premade cms maybe (a simple one) that i wouldn't have to strip much out of, and could mod further to do what the client needs
but why go through all that when i still want the learning experience, personally, or doing it all from scratch (even with a framework)?
 
I'm going to bed y'all.
 
i want to do it all from scratch using CI
 
@ChrisClower good luck figuring this stuff out, you're in good hands with @TimPost [maybe ;)]
 
5:58 AM
@Lusitanian thanks, i don't need luck though, i need skill
 
Heh, then gain it :)
 
working on it
i have until december 31st to finish it
 
yup, good stuff
that's plenty of time
 
complete with blogs and forums
 
meh, i'm falling asleep sitting up
 
5:59 AM
and it has to work on the production server haha
 
gotcha
if i see ya around tomorrow and you're still having this issue
 
well, good night
 

« first day (720 days earlier)      last day (4222 days later) »