« first day (1128 days earlier)      last day (3814 days later) » 

12:00 AM
Yeah, just don't.
 
I do understand that, and I don't use singleton in my design ,however it's just an argument in my mind. and I wanted to ask about it.
 
Can you rephrase your question?
 
> @mamdouhalramadan What is eager instantiation and what is a singleton
If you have answered both you will have your answer
 
well, eager instantiation for a singleton in my case is:
class Singleton {
private static $instance = new Singleton();

public static getInstance() {
return instance;
}
}
 
he does not have a question ... only a burning need to be appropriated
 
12:07 AM
apparently this will resolve an error in PHP
 
for same reason the class Foo{ public $x = strtolower('aaa'); } is an error
 
Welll doesn't that answer your question
 
so I have to go with the SingletonTest example I already posted, which will do double instances if two threads invoked get_instance() method at the same time
yes, but why?! and is there a workaround for it,?
 
12:11 AM
 
people like this is the reason why others see me as "evil"
 
Brutally true is not evil.
We're all ass* sometimes.
Some more than others :P
 
well guys, there's no need to be sarcastic.
 
How else can they retain their sanity?
 
hahaha, buy being sarcastic you retain your sanity?!
 
12:22 AM
Yes.
 
Your question doesn't really make any sense.
Or I'm just stupid, but I tip on first.
Including recommendations in resume? [Y/n]
 
12:46 AM
 
@webarto "Including recommendations in resume?" Short answer, no. Long answer - nooooooooooooooooooooooooooo.
 
Hmmm, can you elaborate a bit? @Danack
I know, but, please.
 
1) Reading CVs sucks. The more words in it, the more likely it is someone will skip over and miss the important information in it. 2) Most people lie on their CV, so most stuff that's not a verifiable fact will probably just get ignored anyone.
Though if you can get recommendations from PHP core developers, they might be worth putting on the CV.
 
I just feel that recommendation is a summary of my work, so I don't have to bullshit much (at all).
First one is owner of Envato, second is gigapixel world recorder.
Yes, you're right.
 
1:02 AM
If it wasn't down - the link of you on people.php.net would be worth way more.
Oh 3) The point of a resume isn't to get you the job, or to get you the salary you want - it's to get you through the front door for an interview.
 
It doesn't say that I pwned master.php.net :P
Yes, agreed on 3., but I'm seeing "modern" CV's, and my gosh, they suck hard.
 
"rm * .tmp /rf" - le oops
 
So I'm going to keep short and concise, if that doesn't work, it's better that way.
 
@webarto Yes - shorter is almost always better.
 
I can re-apply for facebook, but only jobs in USA are available, and I think I won't pass famous "programming challenge".
Re: programming challenge, it basically wants you to know how to solve tower of hanoi (and many other problems) programatically.
Big bite in any case.
 
1:10 AM
Hi Guys!
Someone here using Yii Framework?
 
Nope.
 
:/
 
At least he/she won't admit publicly.
You won't find much framework love here.
 
why not?
 
We're hardcore.
Hardcore.
 
1:12 AM
lol
Its amazing framework
 
*It's
@tereško ^
 
Yes It Is hehe
 
:)
 
@Kefka Because it's really hard to measure houses - youtube.com/watch?v=arsK-CN5YDg
 
You can't really compare Yii to all frameworks, it has different purpose.
You can't really compare frameworks.
 
1:14 AM
14
A: migration to Yii framework

tereškoTL;DR : Don't do it. It's a really horrible idea. The Rant .. "Framework" is not a magic sauce, that you add to a project, to make it better and shinier. Doing some research i found Yii turns out to be one of the best frameworks out there. What a strange research you have done .. I woul...

 
@Danack I dont understant it
 
I don't compare frameworks, I only have a fast question about it
 
Ask on main site :)
 
Allright
*all right
 
1:16 AM
@Kefka , I had to use it for almost a year. And only reason why I am not calling it "the worst framework in PHP" is because CakePHP and CodeIgniter are even more atrocious.
 
I disagree
but, is my opinion
 
Is it possible to just echo out all filled out form fields
 
how many php frameworks have you used extensively ?
 
@Kefka Yes, and you're of course entitled to it.
Yii is the new Codeigniter
 
@tereško
I used ZendFramework
 
1:19 AM
1?
 
opinions are like assholes: everyone has one and everyone is convinced that others stink
@webarto wrong. Laravel is the new CodeIgniter
 
@tereško Yes, forgot about that precious. Have you used it?
 
nope, but I have read the code, docs and seen the aftermath of it in stream
 
Meant, reviewed it... what do you think?
 
@webarto it is closest analog for Rails that PHP currently has
 
1:25 AM
Thought so. Some of the makers seem legit.
 
a decent option for prototyping and mayfly sites .. obviously used exclusively for everything but its usecase
 
You don't think, therefore I am.
2
 
1:53 AM
Thank you to @ComunidadDePHP and all the attendees for the blushing elephpant birthday cake at #phpdaymx2013 #php http://t.co/Tpd3NgSZc0
Cute.
 
Wish I had cake :(
 
Wish I had attended ZendCon :\
 
Was there cake?
 
IDK, but I know there's beer.
 
How do I preserve session information after I call session_regenerate_id()? I've tried copying $_SESSION and putting the data back in $_SESSION after calling session_regenerate_id(), but on the next request $_SESSION is empty.
 
2:06 AM
Use your own session handler.
 
What about if I wanted to use session_regenerate_id()? Are you saying it's always destructive?
"session_regenerate_id() will replace the current session id with a new one, and keep the current session information." seems to imply that the information should still be there, but I can't seem to figure out why this isn't happening.
 
@Stephane There is an example on the page - php.net/manual/en/function.session-regenerate-id.php
 
2:21 AM
In the comments? I read through the example. What specifically are you referring to?
 
you shouldn't need to do anything more than that, but you do need to call that before any output has started (I think).
 
The same code on my dev server is performing correctly. The only difference I'm aware of is it's running a newer version of php. Both are 5.3+
But that's a good thought. I don't believe output is starting before this, but I will check.
 
"The same code on my dev server is performing correctly." check - the output buffering settings. Dev php.ini usually has it enabled for some unknown reason.
 
ah, that's helpful, thank you
 
Can someone please open up webarto.com/dm@php.net.pdf and check if it's displayed like this
 
2:27 AM
<?php
session_start();

if (isset($_SESSION['foo']) == false ){
$_SESSION['foo'] = 0;
}
else {
$_SESSION['foo'] += 1;
}

session_regenerate_id();

echo "foo is ".$_SESSION['foo'].", sessionid = ".session_id();
@Stephane That works for me - incrementing var and regenerating session id
@webarto ^^ yep
 
@Danack what's interesting is on the same page I get the output correctly. I can echo out $_SESSION after regenerating just fine. On subsequent requests, it's no longer available. And just commenting out regenerate fixes that.
 
@Danack That's about right, thank you very much mate.
 
@webarto np
@Stephane Copy and paste the header from the response thats setting the cookie originally, and after it's been regenerated,to here?
 
2:43 AM
Hmm, I'm having trouble getting the set-cookie value for the initial login. This is what I have so far: pastebin.com/Ukg3rBub
Here's the initial one: pastebin.com/Gd8BkkHC @Danack
 
@Stephane Well - it looks valid. No funny paths or domain settings.
 
Thanks. I'll check the buffering next. You've been very helpful.
 
@Stephane If the cookie headers are sent ok (and they seem to be) then it's unlikely to be the buffering. I'd suggest just searching all the similar questions on stackoverflow - but it may be simpler just to debug it by looking at the directory where the session files are stored, delete them all and watch as they're created and what's in them.
anyway - I'm off. laters.
 
g'night
 
3:01 AM
no, @user1524441 , we will NOT look at your question
... oh, wait ... he wasn't finished typing
 
Where did 3am come from :(
 
time is an illusions
lunchtime - doubly so
 
That wouldn't fly if you rocked up to work late.
 
3:17 AM
I have an idea to develop open source in php but i am not so expert , i want to know how to get other people involved. While using currently developed open sources like wordpress, joomla, magento, etc, I feel restrictions. I like core php but then I have to start from beginning. I like library like jquery not framework. I have many more ideas.
Jquery is like use it what you want, else write javascript, it should be same with php
 
lol
 
@tereško :P .. i have vague idea at this time so i don't dare to ask at stactoverflow now
 
user1642018
3:43 AM
hello all.,
 
user1642018
is this possible to get valid encoded string from lowercase base 64 string ?
 
user1642018
i have mistakenly strtolower the base 64 sting and now when i decode it , i am getting wrong results.
 
@tereško did you major in cs
 
I tried .. 4 times
 
@tereško what happened?
 
3:49 AM
work
 
I would've bet insulting the professor.
 
@tereško I wonder if its worth it these days anymore; if you could major in something else what would it be
lol
@Fabien I was thinking about that lol
 
@Jaigus neuroscience, genetics, microbiology, robotics
pick one
 
robotics
 
@tereško Maybe you can work in robotics in a programming capacity, working on embedded systems. I don't know, Im really beginning to get tired of this web stuff
I especially hate front end dev
 
4:02 AM
my current background lends itself only either to physics or some aspects of computer science
 
What's wrong with programming?
 
Nothing; I was just talking about web development :P
theres much more to it than just web dev, but the other areas dont generate as much buzz
whats your background fabien
 
Well I have a degree in Psychology that I don't use.
 
you decided you didn't like it?
 
Not dislike but simply not what I wanted to do for a living. It never really was. Just picked it without much thought.
 
4:10 AM
do you do web dev now?
 
Yes
 
dunno ... programming seems line a good area: it has large and interconnected community, there is always something new and it keeps your mind busy
hell ... in past 5 years I have actually seen a rise in my IQ, which is kinda awesome
 
@tereško - taking a look at your answers, you do know about software engineering more than, IDK, millions of CS bachelor's degree holders...
I really enjoy reading your answers and this is not a b*** kissing here :D
 
wow thats cool
I wasn't saying programming was a bad thing. Im just looking at more interesting areas of it as opposed to web development.
 
@Jaigus try queries like "machine learning", "data aggregation" and "predictive algorithms"
 
4:30 AM
@Jaigus How about AI Psychology?
The mix between neuroscience and CS
 
@Fabien not till 40s
 
@Fabien That sounds really cool. Is that what you plan on doing since you have a background in both?
 
I've only been professionally developing for 3 years. So no plans to change yet. But As far as I can tell everyone gets to that point of "I don't want to be doing this anymore".
Hopefully by then I'll be a millionaire and it won't matter. Unlikely though.
 
Best of luck to you :P
yeah its "burn out"
I think perhaps the best companion for CS is electrical engineering
It seems like web dev should be over saturated but theres always seems to be vacant positions. What with that whole learn to code movement and I even see "web programming for teens" books in the book store
 
from people who graduated with me in the same year, only ~10% are actually capable of programming (and I think, I taught half of them) and from those, only ~5 are actually earning money this way
 
4:43 AM
jebus 4:42am
thats bed time
 
@tereško wow really? Maybe its because it turned out to be something different than what they originally thought. Seems common that people don't like certain majors (especially the engineering ones) when they really get into the hard stuff : /
 
 
2 hours later…
6:24 AM
0
A: Where should http headers be set?

kishinmanglaniIt almost definitely should not be in the view. If it makes sense, it should be fine in the controller. If you are trying to set something globally, it may make sense to look into something like middleware. Middleware processes each request and can modify the request or response based on some con...

gods below how tired I am of those retards
 
 
3 hours later…
user652649
 
10:02 AM
Moooooornina
 
10:19 AM
moin
 
morning everybuddy!
 
@JoeWatkins do you want silly bug report as seg faults on setting a break without having set execution path?
(PHPDbg)
Morrrningaaa @crypticツ
 
10:36 AM
@tereško so would this be wrong to do in Silex, since it is not coming from my view? Which I assume is my Twig template.
$app->after(function (Request $request, Response $response) use ($app) {

    $response->headers->set('X-Frame-Options', 'deny');
    ....
});
 
@AlmaDo laruence fixed the bug with unregister_tick_function();
 
10:53 AM
 
@AlmaDo Mooornina
 
user652649
11:14 AM
headers are part of the page contents therefore they should come from the view (i guess)
/me waits for the insults and cracks his knuckles
 
user652649
also morning
 
@Wesabi @tereško said the view is part of the response, so above I am using the response object to send the headers, but not sure what part of the response it needs to be set from. Not sure if I can even set a header from a Twig template.
 
@crypticツ If you are using templates, the view has more than just one class, right? So the headers, inclusive escaping their values, would be part of the view class that calls the template.
 
user652649
@crypticツ nope, response is part of the view, not the contrary
 
user652649
then it's the view responsible of sending headers as is responsible of sending http body
 
user652649
11:27 AM
anyway as usual, i could be totally wrong and i'm pretty sure teresko will point out how dumb i am xD so wait for his answer
 
11:43 AM
@bwoebi so, is it merged? I.e. in which version will it be included?
 
12:00 PM
@crypticツ you are not using a "mvc" framework are you?
 
@RonniSkansing Silex
 
12:13 PM
@RonniSkansing yes
 
@JoeWatkins ok. I was playing around with it yesterday (and will abit later today also). gj
 
@RonniSkansing pull first might be fixed already ...
 
@JoeWatkins ok
 
hi @web2students.com
 
12:18 PM
hi @RonniSkansing
 
hi @cryptic ツ
 
(:
 
@AlmaDo next version. it's in PHP 5.4 to master
 
morning
 
1:05 PM
@crypticツ maybe look at stackphp.com
 
@igorw which would I use to set global response headers? Also what is wrong regarding using $response->headers->set()?
 
@crypticツ stack is just a different approach where the code that deals with adding stuff to the response 'globally' does not depend on the framework.
the result is that it can then be used with anything that uses HttpKernelInterface.
in other words, you don't win much by doing things this way, but if you release your solution, everybody else does.
 
1:20 PM
ah ok. Will use it for any public code then. Thanks! You're always providing me helpful links and info =o)
 
user652649
how about this

class BaseView{
function blah(){ $this->response->headers->set("X-Pwned-By", "teresko"); }
}

class ActualView extends BaseView{
function blah(){ parent::blah(); /* moar code here */ }
}
 
user652649
do you meant something like that?
 
@Wesabi I'm setting global headers sidewide, usually security headers like CSP, X-Frame-Option, etc. For page specific headers like mimetype I set via the Response object in the controller method for that page.
/**
 * @param Application $app
 * @return Response
 */
public function opensearchAction(Application $app)
{
    /** @var $app \Twig_Environment[] */
    return new Response($app['twig']->render('Main/opensearch.xml.twig'), 200, [
        'Content-Type' => 'application/opensearchdescription+xml; charset=utf-8',
    ]);
}
like that for instance
 
phpdbg is in the list ...
 
great
 
1:31 PM
@JoeWatkins github.com/trending/developers?l=c you're also listed there =oP
 
0
Q: Structure for a multilingual website

Lucas BI'm building a hosting company meant to be global, I'm 20 years old without investor, so I've faced many issues along the way. Now I'm almost done, I have the website almost complete and ready to be released in 13 countries, yet I have some serious doubts about my current website. My current tr...

 
Joe is a machine.
 
user652649
1:48 PM
$headers = array_merge( $this->configs->baseHeaders, ['Content-Type' => 'application/opensearchdescription+xml; charset=utf-8']);
return new Response($app['twig']->render('Main/opensearch.xml.twig'), 200, $headers);
 
morningin room
 
user652649
sup!
 
whee, I think I just found a bug in PHPPHP
 
@Wesabi but I would have to put that in every page method for every controller. I'm setting globally via the Application object in app.php
 
I am working with regex regexr.com?377p1 to replace two space indentation with four spaces. If you clear multiline checkbox and replace (^ ) with (\n ) it doesn't work.. any ideas?
 
user652649
1:55 PM
@crypticツ override Response::__construct
 
user652649
class MyResponse extends Response{ function __construct($body, $statuscode, $headers){ $headers = array_merge($......., $headers); parent::__construct($body, $statuscode, $headers); }
 
user652649
anyway i don't know how your framework works, maybe there's a better way to do that :\
 
@Annie it's using \r
([\r] )
 
([\r] ) without multiline flag? its not capturing -> "newline followed by 2 spaces"
 
also what are you trying to do? prettify CSS?
 
2:05 PM
Wesabi: http headers do not have to be unique, think about set-cookie
 
yes replacing 2 space indentation with 4 spaces
 
@Annie why are you re-inventing the wheel? There are plenty of libraries that will format CSS.
 
user652649
when did i say that have to be unique?
 
array_merge()
 
user652649
yeah but that's an array already
 
user652649
2:07 PM
and i didn't make that method :P
 
user652649
in fact it's weird, @crypticツ how can $headers be an array?
 
@Wesabi huh?
 
@crypticツ, this code is part of a library. I am just experimenting.. with multiline switch it works, with single line, it doesn't work
 
@Wesabi that's how Silex accepts the headers
 
2:11 PM
as a key=>value array?
 
yep
 
user652649
you shouldn't use that as @ThomasWeinert pointed out
 
use Symfony\Component\HttpFoundation\Response;
 
user652649
so nvm same thing but using this "$this->response->headers->set()"
 
user652649
maybe it's just not meant to accept values such as set-cookie
 
user652649
only simpler headers, like content-type etc
 
github.com/symfony/symfony/blob/master/src/Symfony/Component/… it allows multiple headers with same name, just need to make mulidimensional
so 'Header-Name' = array('value1', value2')`
 
Is travis getting slower starting tests after a push for everyone or just me?
 
user652649
ah ok, so you just need to array_merge in a more complicated way :P
 
2:26 PM
Good afternoon =)
 
@crypticツ, I ended up with (\r( *)) regexr.com?377pp.
thanks for your help :)
 
hey everyone! just scored 20+ points. I can chat now :)
 
@alexsummers gratz
 
@alexsummers, welcome to the club :)
 
hey, so what are you guys developing as of now?
 
2:54 PM
@alexsummers At this specific moment or the last x weeks?
 
im good at android, recently started learning php.
@peeh
@PeeHaa last x weeks, at the moment., which ever is exciting. :)
 
Was there every a real reason given on internals for not aliasing/fixing the core functions to a naming and parameter ordering convention?
It seems that the only answer ever given was just
 
@DanLugg nope
@alexsummers hmmm let's see. I'm now working on the phpoauthlib. Once that is done I'm going to start the work on the phpoauthservicelib and I have created the awesome requestable webservice ;)
 
@DanLugg I'm sure it is all about BC
 
@PeeHaa Just started learning php, looks interesting. Im learning php basically so that I can do the backend of my android apps too. Going thru tutorials by the-new-boston. Anybody familiar with him?
 
3:00 PM
@alexsummers no, but link us
 
@alexsummers Nope.
@alexsummers Are you a professional android developer?
 
@crypticツ learnt all of code online, thru his tutorials, from java>android>now php
 
@DanLugg PHP is a glue language, it most often just exposes the underlying C functions with whatever naming/arguments they have. The functions aren't "broken" per say, they just don't all follow a unified convention. I don't believe it would suit PHP to go through the effort of "fixing" the userland API and the re-education that that will require.
 
@alexsummers yeah, don't follow those tutorials they are teaching you wrong.
 
@PeeHaa im currently a student. Learning code online. Have published 1 game so far on play. And am gonna start work on my next project soon.
@PeeHaa learning how to program out of interest. Does not have anything to do with my course etc. So not a professional .
 
3:04 PM
@alexsummers :( too bad. I am thinking about creating some paid service for backends of mobile apps. I'm just not sure whether it will be worth it
 
@crypticツ Could you please elaborate. Ive just done the first 10 videos .
@PeeHaa Something llke google app engine?
 
@alexsummers Sort of, but not really
 
Evening
 
I want to build the backend so that you can just use it and it just works. No need to build anything yourself
@MadaraUchiha jo
 
@PeeHaa Sounds interesting. If it can dumb down things for people who dont have an idea about backend programming , could really do well.
Indie developers who know only the front end , would use it heavily. If the interface of the backend is good and is easy to set up
 
3:09 PM
@alexsummers That was the idea. I was thinking about useful things like user management, storage management, push notifications and stuff like that with an easy to use API
 
@PeeHaa Sounds great.
:)
 
PHP is the best C framework.
8
 
@alexsummers Yep think so. Just want to finish up other projects first and get people on the team
 
@PeeHaa sure, but end needs to be graphical and easy to set up though.
 
3:13 PM
@MadaraUchiha Hanging, chilling, you know, cool.
 
@alexsummers thenewboston.org/watch.php?cat=11&number=33 teaches you to use global, laughable word censoring thenewboston.org/watch.php?cat=11&number=52 This has you get untrusted user IPs thenewboston.org/watch.php?cat=11&number=66 the only one to trust is REMOTE_ADDR, thenewboston.org/watch.php?cat=11&number=96 tells you to use MD5 for encrypting passwords.
that's just a few
 
@alexsummers Yeah setting it up would be as easy as registering for an account
 
@crypticツ Good lawd :o
 
MD5 Encryption :mindblown:
 
strongest most unbreakable encryption in da world evar!
 
@salathe @crypticツ That's not a fair reason, namely, because it's not a glue language anymore. PHP doesn't simply forward HTTP elsewhere, it handles it. BC breaks are easily mitigated though a controlled release process.
The whole "because I said so" reasoning that seems to crop up on internals is pure negligence in my opinion, and I think we as a community deserve far better; for either implementation or justification.
 
@PeeHaa Great, Idea sounds good. Do a little RnD on what exits, and get started. :)
 
@alexsummers SQL injection in login form >.< thenewboston.org/watch.php?cat=11&number=138
 
@crypticツ O_O
 
@crypticツ Ive just learnt how to echo out "Hello World" so far :)
 
3:23 PM
@alexsummers yeah stop where you are at and don't learn from that site anymore. It's easier to learn the right way than to unlearn the wrong way.
 
@crypticツ any links that would help? Also, im just learning this to get the backend of my android app done. Would it be a problem still?
 
@crypticツ noice short list!
 
@alexsummers for the SO links stick to the top voted answers, they tend to be better peer reviewed than the others.
@PeeHaa basically just copied some links from my SO favorites =oP
 
@crypticツ nice list :)
 
3:28 PM
Good morning
 
@ircmaxell monring
 
Good Morning @ircmaxell
 
morning
 
how goes it?
 
morning @ircmaxell! now that you have time to work on important stuff, how about we make PHPPHP more better? :D
 
3:29 PM
nah
 
@crypticツ thanks a lot! :) will go thru them .
not a problem, wanna just get started .
 
@alexsummers first start out reading the PHP manual at php.net
 
ok :)
 
@DanLugg You're absolutely entitled to your own opinion on what PHP is / isn't.
 
3:31 PM
@igorw any reason the reactphp event loop isn't a singleton besides that singletons are bad? :-)
 
@igorw </ironic> :D
 
@igorw I'm going to enjoy this long vacation for a little while :-P
 
@ircmaxell well, if you feel like giving me some Ptrs later, that'd be cool. started looking into Closure/invokable support today. :p
 
@crypticツ @PeeHaa time for college. will see you guys soon. :)
 
@DanLugg you can always fork it =oD
 
3:32 PM
@alexsummers later
 
@ThomasWeinert no other reason. and in fact, I am re-thinking that aspect because it makes for really clunky APIs all over the place.
 
@crypticツ or provide a userland "nice API". /cc @DanLugg
 
@igorw yeah, good luck. I tried for a little while, and I think the whole object system needs to be rewritten to support that
 
@salathe I have been, it's just frustrating, having a massive function library dependency for something that should be native.
 
@igorw I stumbled over it - using Ratchet and Carica Chip to push sensor data to the browser
 
3:37 PM
@ircmaxell yeah, didn't get far yet. basically messing around with InitFCallByName and Executor::getCallback()
 
yeah
Well, good luck. I am off to go have lunch with my parents. Later
 
:)
@ThomasWeinert I've stumbled across carica io
 
the chip thing looks nice :)
 
3:42 PM
 
Still a lot of work
 
If I do an exit(0xC0), is there a way to recover that value in a function registered via register_shutdown_function()?
 
@DanLugg not that I know of
 
Phooey.
 
@salathe @nikic at what time next year 5.3 will be eol. End of the year somewhere?
 
3:47 PM
Stupid table structure. half the fields check for a presence of something the other half store the omission.
 
@igorw have you seen the video I posted today?
 
That went over quick!
 
@ThomasWeinert nope
 
@vascowhite True
 
3:53 PM
@webarto Not much rep considering the amount of time I've been here, but most of the time I can't be arsed answering :)
 
> member for 3 years, 3 months
Yeah, similar here :)
Number of crappy questions/answers grew exponentially.
 
It did indeed. 95% in are just close vote fodder.
 

« first day (1128 days earlier)      last day (3814 days later) »