« first day (1629 days earlier)      last day (3310 days later) » 

2:43 AM
@NikiC Actually, I think the null object pattern makes sense here.
What does @ircmaxell think?
 
2:54 AM
Possibly a stupid question - isn't this an uninitialized variable lxr.php.net/xref/PHP_5_5/ext/spl/spl_directory.c#687 when the optional param is not passed in?
 
 
2 hours later…
4:55 AM
Hi all
Can someone please help me in my issue?
0
Q: Can some one please help me in correcting the mistake I'm making in HTML DOM parsing?

user2839497I've one sample string as follows : $feed_status = Nice to see you all back again <img src=\"http://52.1.47.143/file/pic/emoticon/default/smile.png\" alt=\"Smile\" title=\"Smile\" title=\"v_middle\" /><img src=\"http://52.1.47.143/file/pic/emoticon/default/smile.png\" alt=\"Smile\" title=\"Smile...

 
ThW
it is invalid HTML with the backslashes
 
5:13 AM
@user2839497 I provided a possible answer to your problem
 
anyone have tutorial on send email with attachment ?
PHP
 
@SavanPaun use PHPMailer
 
mine not working any solution :( stackoverflow.com/questions/29405407/…
where to download PHPMailer ?
 
any tutorial on phpmailer with attachment ?
 
5:15 AM
sure, plenty...
 
let me check thank you
 
you're welcome
 
@MarcelBurkhard hi
 
Hey guys,
Just a question.
What libraries/frameworks do you use when you develop applications in PHP?
 
ThW
5:30 AM
another problem is that the result of getElementsByTagName updates if the Dom is changed.
 
JavaScript in PHP!!
 
hi, can someone tell me at what point performacne issues come into play with PHP? for example, can I run a script 100k times a day and not have an issue? would it depend on the server?
 
I don't think you may have an issue.
Why not try?
 
i am potentially working with a client and i dont know 100% what i am getting into which is why i ask
 
It shouldn't be an issue, why not try it out?
lmao
 
5:45 AM
all right lol
 
I have to code super hard
For my client.
:/
Rich bastard, hired me for $200 to do a basic system.
 
dam...
 
good morning
 
hi
 
Awasome! Just seen the "chat" part of stackoverflow :D
 
5:56 AM
Anyone online who can help me out with Auryn?
Injection definition required for non-concrete parameter $interface of type Http\Request
This is my injection:
$injector->share('Http\HttpRequest');
$injector->define('Http\HttpRequest', [
    ':get' => $_GET,
    ':post' => $_POST,
    ':cookies' => $_COOKIE,
    ':files' => $_FILES,
    ':server' => $_SERVER,
]);
public function __construct(
    array $get,
    array $post,
    array $cookies,
    array $files,
    array $server
) {
    $this->parameters = array_merge($get, $post);
    $this->cookies = $cookies;
    $this->files = $files;
    $this->server = $server;
}
Let me hook you up with the whole repository.
 
@HassanAlthaf isn't it supposed to be Http\HttpRequest
 
you've type hinted Http\Request
 
Http\Request is an interface.
 
where and what do you instantiate that shows this error?
 
6:00 AM
$injector->alias('Http\Request', 'Http\HttpRequest');
Adding that helps.
But, it gives me another error.
Trying to get property of non-object
use Http\Request;
use Http\Response;
use \Twig_Environment;

class Homepage
{
	private $request;
	private $response;
	private $twig;

	public function __construct(Request $request, Response $response, Twig_Environment $twig)
	{
		$this->request = $request;
		$this->response = $response;
		$this->twig = $twig;
	}

	public function show()
	{

	}
}
That is where I type hint it.
It works fine in my other applications. :/
 
where exactly does this second error happen?
of course, you should alias, that is, bind interface to the class
 
/Applications/XAMPP/xamppfiles/htdocs/Projects/Dominic/vendor/rdlowrey/auryn/lib‌​/Executable.php
$reflection->getClosureScopeClass()->name
 
that way type hinting an interface, Auryn will inject it's bound class
 
Yeah.
But, it breaks and causes another error.
Auryn is ****ed up.
Worked like a charm before.
 
no, where does it throw 'trying to get property of non-object' in your code
?
 
6:09 AM
Server/Request Data
UNIQUE_ID VRzcSMCoAQQAAAvGg1oAAAAC
HTTP_HOST localhost
HTTP_CONNECTION keep-alive
HTTP_CACHE_CONTROL max-age=0
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_USER_AGENT Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36
HTTP_ACCEPT_ENCODING gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.8
PATH /usr/bin:/bin:/usr/sbin:/sbin
DYLD_LIBRARY_PATH /Applications/XAMPP/xamppfiles/lib:/Applications/XAMPP/xamppfiles/lib
All the data from Whoops.
It throws up this error when I access index.php
Auryn's new version was messed up.
I am using an old version and works fine.
 
moin
 
user4433485
Good morning everyone!
 
Now that's a refreshing start in the day :D
 
@HassanAlthaf I mean which line in the code does it point to? Where can't it get the object's property?
 
6:27 AM
No idea @SergeyTelshevsky
It doesn't say.
 
@HassanAlthaf it should say as this is an exception thrown
 
it doesnt.
I deleted that one, and I am using an old version
The old one works.
 
6:43 AM
moin
 
?
Hey Pat.
how hard is it to code a framework?
lel
 
way too easy, otherwise there wouldn't be thousands already...
 
Lmfao
I might do one
Cuz I cbf to import so many libraries in composer
I'll just put all libraries I use into one
lel
 
You want to create a framework because you can't be bothered to spend 5 minutes to set up things? Oh dear...
 
lmao yh
just kidding
 
6:52 AM
 
I will do one just for experience.
 
I will do one just for experience.
Lmao
Don't worry!: P
I cannot understand the logic behind Routing libraries.
 
That's fine, just dont go around marketing it as the next best thing that everyone should use ;)
 
Like, what do they actually do?
 
6:53 AM
Then write a routing library
 
I really love em
I really wanna code one
To understand them
 
Then do that, no need for a full framework
 
But, I don't understand much in NikiC's source. -.-
Oh.
Can you give me some sort of a headstart
 
@HassanAlthaf they dispatch the incoming http requests to methods in your code
 
On how it works?
Oh, do they match the REQUEST_URI thing in the $_SERVER
 
6:55 AM
Not even that, just a string
 
and if any of the routes define match that
Wait guys, gimme a sec, my bro annoying me.
 
You give a router a string, if it matches a defined route you return an callable
 
Oh.
How do you read the users URI?
$_SERVER['REQUEST_URI']?
Oh, well, I see.
How do you call the class?
Well the method?
 
That FastRoute dont make sense for me. -.-
 
6:59 AM
@HassanAlthaf then look at other routing libraries
 
Hey man, just see whether my logic is right
User defines the route like this:

Array(
'get', '/index', 'Foo/Bar', 'show'

)
So, they define if there is a GET request in the URI /index
We call the method Foo/Bar::show()
Am I right?
 
that sounds about right
 
But,
How do you make the code run the Foo/Bar::show()
Like, in FastRoute my methods are not static
So the code cannot call Foo/Bar::show()
It needs to create an instance
 
That is not the responsibility of the router
You don't know how that will be done
 
7:03 AM
Depends on the injector if one is used etc
 
So, you leave that to the user.
 
Oh, lmao!
I'm so stupid.
Thanks, @Patrick you have been extremely useful to me.
Btw, Patrick
Do you know anyway to get a GUI on a Command Line Ubuntu?
I bought a server, but it is command line. -.-
 
@HassanAlthaf Just learn how to use it (lots of good tutorials from digital ocean and linode if you google for something)
 
Yup, I can use it.
I bought it off DigitalOcean
It's pretty worth the price.
this twig rox.
 
7:27 AM
good meurning
@PeeHaa u already in?
 
Hey guys,
@Patrick $response->setStatusCode(404)
Should it not re-direct to a 404 ErrorDocument?
 
@HassanAlthaf that's up to you. github shows the 4o4 on any url for example
 
How do I define what it does?
 
8:00 AM
@Naruto ugggggh I am now
...
@HassanAlthaf no
If you made a typo you want to originally typed url
mornign
@HassanAlthaf Just set the correct http status code and render an error page in the same request
 
lol
okay.
 
@Patrick having trouble reading that, what's "in" the box?
 
@HassanAlthaf tbh it's like buying a car before taking the driving license -.-
 
What do you mean?
Oh.
Btw, anyone of you got experience with bootstrap?
 
Assuming you mean the css thing: I know enough to download a theme :P
 
8:05 AM
lol
I am experiencing a navigation problem
The mobile thing
Theme stuff is easy, i made my own theme
bootstrap saves a lot of time and headache
 
8:32 AM
posted on April 02, 2015 by kbironneau

/* by lamboule */

 
^ never knew about that, sent link to all my contacts
 
^^ just opened it and it did it's job, argh, no warning
 
Morning
 
glad I opened it in incognito
 
GH didn't bulge :)
 
8:40 AM
@PeeHaa sorry, I found it by now :P
 
kk :)
 
8:54 AM
0
Q: Vagrant - Unable to access the project website

Kamran AhmedI was having an issue similar to the issue at https://github.com/chaordic/act-acdc/issues/1 which I resolved by following the instructions provided in that i.e. by setting ansible.host_key_checking to true instead of false i.e. ansible.host_key_checking = true But, now I am having another iss...

 
9:09 AM
moin
 
@DaveRandom o/
 
Wait, @NikiC is talking at a conference?!
WOHOOO!
 
@PeeHaa I can't help remembering my EVE Online past everytime I see someone hailing with o/
 
:-)
 
@StefanoTorresi o7
 
9:14 AM
@Ocramius \o/
 
user4433485
Maybe someone here can help me out?:)
 
user4433485
function getMySQL() {
	$userrole = getUserrole();
	if($userrole == 3 || $userrole == 2) {
	if($userrole == 3) {
		return '<h1><a href="dashboard.php">Het Terras</a> &rsaquo; <a href="dashboard.php?app=mysql">Beheer Roosters</a></h1>
				<p><a href="#">Maak nieuwe data aan</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">Wijzig rooster van gebruiker</a></p>';

		//		<p>Op dit moment is het niet mogelijk om gegevens uit de database te halen. Probeer het later nog een keer.</p>';
				        // Display the results
 
user4433485
when logged in on user role 3 it returns what it supose to do, except the echo "hi"
 
user4433485
when logged in on user role 2 it returns the echo "hi"
 
@Katherina what is the question? do you want it to echo "hi" when the role is 3?
 
9:16 AM
@Ocramius where?
 
user4433485
I want to echo the hi when role 3 or 2
 
user4433485
and the return only when role 3, but that works
 
@Katherina then you need to put the echo somewhere before the return.
 
@Katherina that's because you are returning on line 4 before echoing 'hi'
 
user4433485
the thing is now, the echo hi is show to user role 2 but not 3
 
9:17 AM
if I scream loud enough, will that code go away ?
 
Speaker Of The Day: Nikita Popov aka @nikita_ppv > http://ow.ly/L4Bw7 #ipcspeaker http://t.co/bCxrDfEqA3
 
user4433485
but I don't want role 2 to see the return string
 
Now I want to go to IPC just because of that, but it collides with every schedule
 
@JoeWatkins nope, embrace it and die inside.
 
oh wow, we know what nikic looks like ...
 
9:19 AM
 
user4433485
when I do it this way
 
user4433485
if($userrole == 3 || $userrole == 2) {
		echo "hi";
		if($userrole == 3) {
			return
 
@JoeWatkins indeed. He switched from "random genius" to "evil computer science genius"
 
user4433485
the echo hi will be above the return :(
 
How do I improve this answer of mine?
0
A: Search html for a hardcoded JavaScript variable with php

Rahul DesaiYou can use RegEx for this. Regex: /TrackingCompany: \'([a-zA-Z\s]+)\'/ Try this working code: // comments inline // take all of the file contents into a string $subject $subject = <<<EOT <script type="text/javascript" language="javascript"><!-- var jobPopup145169852; var MONS_LOG_VARS = {...

 
9:22 AM
@Katherina yes, what's wrong with that?
 
user4433485
I don't want that to happen, the thing I return is for the admin only and have to be on top ;)
 
@Katherina, simply code it as follows: if (3 === $userrole) { echo "hi"; return; } if (2 === $userrole) { ...
 
user4433485
the thing is, this worked earlier on a different function
 
user4433485
	if($row['user_role'] = 3) {
		echo '<p><a href="?app=users&action=new">Maak nieuwe gebruiker aan</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="?app=users&action=edit">Wijzig bestaande gebruiker</a></p>';
	}
	echo getPagination();
	}
	else {
		header("Location: dashboard.php?error=403");
		exit;
	}
}
 
dude
 
9:23 AM
Nikita is speaking? That's pretty awesome. So we have at least 2 huge new speakers :)
 
Good morning people
 
@Ocramius honestly I don't even know how most of people finds the time to attend so many conferences during a year.
 
@Katherina because that code wasn't using return
 
user4433485
ah I see
 
user4433485
will figure it out
 
user4433485
9:24 AM
thanks
 
Wow, two revelations today. @NikiC has a face, and presumably a voice too if he's speaking at IPC!
 
user4433485
@JoeWatkins Don't ever say that again.. "dude" how rude to say that lol.
 
@StefanoTorresi good flights scheduling
And a lot of nerves. @GeeH is constantly on the limit of breaking down
 
@salathe not to mention, glasses
 
@JoeWatkins everyone wears glasses these days, if they need them or not 8)
 
9:28 AM
@Ocramius and I was talking just about attending, let alone being a speaker :D
 
@Katherina it's nice to pastebin code ... kthnx
 
user4433485
K
 
ha, now nobody can work, because you're all staring at the kitten
 
i felt the other way around, the kitten is staring at me!
 
True
However I'm a week ahead of schedule :p
 
9:33 AM
how do you detect that something is staring at you without staring at it ?
 
hmm there is a vsauce video on youtube actually explaining that :D
 
ThW
@JoeWatkins Image recognition
 
@ThW I have a pre 1990's brain, so no ...
 
@Andrea gmfdi
 
9:35 AM
@StefanoTorresi paranoia doesn't count ..
 
Hello, could somebody tell me, what this means? exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails
(`blog`.`comment`, CONSTRAINT `comment_ibfk_1` FOREIGN KEY (`entryID`) REFERENCES `entryID` (`entry`))' in ... ? Somehow my insert does not work anymore but i've changed nothing on the query ...
 
@JoeWatkins OMG THERE ARE KITTENS STARING AT ME, ALL THE TIME, GTG
 
@StefanoTorresi it's not that bad, but it's hard to follow if you're an employee
 
@JoeWatkins the kitten won our staring match :(
 
9:46 AM
@StefanoTorresi as a consultant, you really have to keep active, or you'll stop getting the (good) jobs
 
@Ocramius tbh I could hardly afford more than 1 conference a year. maybe i'm already not getting the good jobs ffs.
 
@StefanoTorresi your employer pays for the conferences, not YOU.
 
@Ocramius I am my employer...
 
And yes, I know that you live in Italy, and yes, that's one of the many reasons for leaving Italy
@PeeHaa yup :) Same here :P
 
9:52 AM
@Ocramius that's why i quit my previous employment, but didn't change much :D
 
but at least I plan that in my expenses
@StefanoTorresi choose: sun or money.
 
i want both ffs!
 
doesn't really work :P
maybe in a fiscal paradise...
 
@Ocramius yea, i still have to make my first fiscal accounting, so i'll probably kill myself next june
 
9:54 AM
@StefanoTorresi also, I would like to not that, if you did something paid-for in the sun, you would have to stay in the sun A LOT .. there is this fun thing called: "skin cancer"
 
Why would you even do that in Italy? :(
@tereško he probably isn't a mozzarella-skin like us
 
ahahahahah
 
well, there is that
 
Try any mods yet @tereško?
 
didn't have any time to play yesterday
finished my evening "eat-a-lot" and had to write some code for work =(
 
9:56 AM
@tereško there is one simple solution for that: first sunbath in late april/may, you get slight sunburn, but for rest of the summer you don't even bother with UV protection
unless you really are a mozzarella.
 
won't work
I dont get tanned. My two modes are white and red =/
 
ahahahahaah
 
too much nordic blood
 
I'm more like white and "lobster"
I also think that most of my color comes from my monitor, much like ghosting
 
Just make sure you use a good editor color scheme or your tan will look fake
 
10:06 AM
@tereško Same here
 
well, you get higher pays, i get sun tan for free. it all balances out. sort of.
 
I'm just going to leave this here...
Old but useful.. 10 awesome #PHP functions and snippets - Thx @devWasik http://j.mp/1NlmCRg http://t.co/Z2ddEgvA71
@StefanoTorresi Yeh, but he can afford the skin cancer treatment
 
wtf man get that out of my face...
 
@DaveRandom but i don't get cancer because of.... good food! :D
 
10:10 AM
I just love those "I will write it myself because I'm better than the community, I'm the master in the field"
 
@DaveRandom no way
 
@DaveRandom Sometimes I want to give up on PHP
 
this css-tricks.com/snippets/php/create-data-uris is useful but incomplete/brokn
 
@CSᵠ "save on http requests" this isn't the 90". Browsers can simultaneously download content now a days
 
10:14 AM
BAM nikita in your face / timeline
 
Is it possible (and what's the preferred way of doing it) to fill arguments in route patterns in FastRoute? I want to do something like buildRoute('/project/{projectId:[0-9]+}/user/{userId:[0-9]+}', 555, 666); that returns '/project/555/user/666'?
 
@HamZa still might have some good uses left
 
true
 
eg. very small image array
 
@SergeyTelshevsky Nope not possible with fastroute itself by default
 
10:16 AM
Data URIs are useful in email, old outlook doesn't understand content-disposition: inline
 
@PeeHaa yeah, I want to implement it, but currently I can't think of a proper way to do that
 
@PeeHaa Any recommendation of a shop to buy a new laptop?
 
should I substitute all {...} or is there a better way?
something like 'fill regexes'
the best way would be to fill arguments with checking if the regex fits as well
 
@SergeyTelshevsky I am curious, have you found a good usecase for "route building" ?
 
@tereško yes, named routes
 
10:19 AM
emm .. no, that is not a "usecase", that's mostly "implementation"
 
frontenders building routes in their view files
 
s/view/template
=P
 
sorry about that, yes)
 
@SergeyTelshevsky Doesn't the plague's fastroute wrapper already do that?
@HamZa Nope. Not really. They are all thiefs. I often just go to alternate, because it is close so I can just pick it up :)
 
IMO pretty clean way: <a href="<?php $router->build('user', 123);?>>User 123</a>
 
10:23 AM
@SergeyTelshevsky Yeah that is how it is done mostly
 
@PeeHaa hehe I see. I've got a low budget but I really want something good for the next few years
 
Buy an abacus
 
@PeeHaa which wrapper are you talking about?
 
@DaveRandom lel, I had to google that TIL
 
nvm found it
 
10:31 AM
@HamZa Cheap, difficult to break, easy to get spare parts, easy to carry, easy to learn how to use it... no down sides really.
 
sql question: can I use GREATEST() in GROUP BY argument ?
nevermind, seems MAX() will do what I need
 
MAX() is the aggregate operation usually isn't it? What SQL flavour?
 
@HamZa lol kids these days :P
 
the shit-tasting flavour: mysql
 
Ah yeh, well MySQL's max can handle anything with an underlying numeric representation (so, numeric types and dates/times). If you want lexicographic comparisons could get more interesting though
 
10:55 AM
@salathe You can also conclude that I'm not the same person as ircmaxell ;)
So, I bought a new PSU that has the right number of SATA connectors ... and now the cable is not long enough, bah
 

« first day (1629 days earlier)      last day (3310 days later) »