« first day (1475 days earlier)      last day (3459 days later) » 

1:02 AM
@DaveRandom What feels wrong about it to you? I have one in my own shittily designed data access layers
 
@cspray Mostly the fact that a Person and an Address (from an OOP PoV) are unrelated, they don't seem like the sort of things that should have a common parent
(example entities)
 
@DaveRandom Yea, that's a good point
 
I have been considering a trait
 
Well, what is your base class doing?
 
Still not sure what I think about that
 
1:05 AM
Because thinking about what mine is doing and it could easily be converted into a trait imo
 
@cspray horrible things. I will be throwing this entire model out and starting again (probably several times)
 
Yea, I do that a lot :P
 
Software design is an iterative process, or in other words:
while (true) {
    if (!$design->isShit()) {
        break;
    }
}
// never reached
 
Well, right now my entities are little more than value objects for the most part
gist.github.com/cspray/5d1fe77a32e60f2bb718 is typical of what I wind up gravitating towards
I haven't decided if I like it or not because I can never take the idea far enough to actually build something with it
Because I keep thinking it is shitty
Not necessarily just this
But the entire thing
 
@cspray That would be the general approach I would want to stick to, at the moment I have User->hasPermission() for simplicity but I don't really like that
 
1:11 AM
My general approach has been to keep the data mapper's simple with CRUD operations taking either some identifier for reading or a <Entity> for other operations. The mutation operations are on the entity objects themselves.
 
@cspray Yeh that's roughly similar to what I had at one point, with a bit of extra logic for tracking what has changed so that it can be written back if necessary. I particularly don't like that part.
 
I've been thinking about starting off with "immutable entities" by design... so it starts out that all entities are just immutable. As time goes on and you need to make changes you modify the entity to have the appropriate domain specific mutators.
@DaveRandom Yea, I've thought about that
Right now my thought has just been "don't do that". Fetch the entire entity, update the pieces, then write the entity back. However, I know that this is an incredibly lazy approach and probably has all kinds of drawbacks I haven't looked far enough into yet
 
I do think that immutability is likely to be a good thing here, the entity represents the record as it exists in the back end right now, when you start changing it things get weird
 
However, I do like @Danack's idea of having specific methods for specific pieces
Only mine would be on the BlogPost entity instead of its mapper
 
But then I'm not sure what kind of API to expose for passing the data to write back
Turns out that DB manipulation, that thing that you learned on almost day one of programming, is one of the hardest things to do right
 
1:15 AM
$blogPost = BlogPostMapper::fetchById($id);
$blogPost->changeBody($newText);
$blogPost = BlogPostMapper::update($blogPost);
But like I said a lot of this is more theoretical and "I wonder if it would work out ok this way"
 
@cspray When you do that, what happens when you do $blogPost->getBody() before the write back?
That's what bothers me about mutable entities
 
Yea
And I get that
I don't know
This point is where I always just throw my hands up and go do work on some other project
 
There's an argument that it shouldn't matter because you shouldn't need to read it at that stage, I suppose
 
Yea
 
So maybe just "explode" is an acceptable thing to happen
brb
 
1:18 AM
That does seem to be the approach with some of the Ruby things I've been doing
They seem to take an approach where "Don't do stupid shit and stupid shit doesn't happen to you" it feels like
Also, ultimately entities are often actually mutable
I think it is just that you start off with everything immutable and only make the things mutable that you really gotta change
 
Whats up guys
I just wanted to know how ya feel about framework, I here a lot of laravel this codeignter that ...
 
@cspray I don't mind that approach, that's the approach I take with JS and it's the approach I take when writing for PHP4 (which I still very occasionally do)
 
@meda It depends entirely on what you're trying to do and the requirements you have. Generally frameworks are not liked around these here parts
 
I think I'm going to play around with "updates" as a separate entity type, so I have a User and a UserUpdate, and I do $mapper->updateUser($userEntityOrID, $userUpdate)
Where entities are read only and updates are write only
 
@DaveRandom I have actually thought about doing something like that
I didn't think about making the data to update an object though
I kept wanting to just make it an array
But I think I like your idea better
 
1:25 AM
Well an array would work as well, it's effectively just a struct
 
Yea, but... I don't know
 
I like the idea of rigidly defined fields though
 
I like seeing well named interfaces and classes as typehints
 
@cspray You are right , it seems to be something with the pHP community not embracing frameworkss
 
@meda Well, frameworks have their issues
Particularly the ones you mentioned
I can't speak to Laravel... I never drank the "It isn't static... facades!" hand-wavy magic stuff
But I can speak to CI
Because I currently make a living maintaining a legacy CI codebase
That is substantial in size
CI is total balls. Like... really, really bad. And if you don't know how to work in anything but that framework your code is gonna start being balls too.
 
1:27 AM
It's substantial in size before you even write a line of application code
 
And that's the problem with frameworks imo. You wind up getting yourself caught to where you can't actually do anything without it.
 
At the moment my "views" are encapsulated entirely in a render_html_template() function
That will need to change, though
 
All that being said. Know how I started into PHP? Hobby CakePHP applications.
Know how I make a living? RoR and CI.
I've written two of my own frameworks
 
Meh, I started writing PHP4 code, I still occasionally write PHP4 code, and I also occasionally write VB
 
I wrote VBA once
 
1:30 AM
Everyone has their embarrassing little secrets
 
Oh man it was sooo bad
Like, even for VB it was bad
 
I also have been down that road
 
@DaveRandom That's one thing I'm thankful for actually. I got into PHP at 5.3
 
Access VBA, which is probably the least of that particular set of evils (or worst, depends how you look at it)
I made Access talk to MySQL once
I basically had to write a driver from scratch, because (surprise!) the Oracle ones suck
 
haha, wow
I was just scraping an internal website for raw data and then running some calculations for a report
But at the time I had no friggin' clue what I was doing at all.
 
1:32 AM
@cspray Oh when I started 5.3 was available, it's just a specific system that uses PHP4
Recently I've started just using another box which runs a sane PHP version though, with a pretty mature API in PHP4 that I can call to do things that need to be actually executed on the box
 
Then I guess I'm fortunate that I haven't had a job that used PHP4. That might actually be too much for me. You're a stronger man than I am.
 
PHP4 actually has good things about it though, it's quite nice not to have type hints in a way because it makes you write code like:
16 mins ago, by cspray
They seem to take an approach where "Don't do stupid shit and stupid shit doesn't happen to you" it feels like
References suuuuuuuuuck though
 
@cspray if you were to built a large website would you use a framework
what about you @DaveRandom do you use any tools or code from scratch
 
@meda Size is not relevant to that question, only speed
 
@meda I don't really speculate about performance and scaling
show me real profiling and benchmark numbers or gtfo
so to speak
 
1:36 AM
If you need it working yesterday then probably you should use a framework because it will be faster to get it up and running. if you have time to develop then you should probably design your application properly
 
I guess I did not mean performance, its more about reinventing the wheel
 
Not using a framework doesn't mean you have to write everything from scratch
There's a whole world of components out there...
You just have to write the wiring
 
And if you do happen to like some piece of a framework most of the modern ones allow you to pull those individual pieces out
 
s/modern/worthwhile/
 
Tha'ts true @cspray you just opened my eyes on that, at the end of the day it s all code
 
1:39 AM
<?php echo 'hello world!'; // look ma, no framework!
 
I really don't think frameworks are all bad. But I do think that you can't just write code in a framework only and consider yourself a developer.
 
Except for PHP, of course, which is sort of a ridiculously complex C framework
 
You need to be able to design and build an application without a framework imo
 
This got to me recently It might not be the case for you guys but I sometimes find myself starting a website neat then it turns into spaghetti :(
 
@DaveRandom Yes. My definition of "framework" includes PHP as a "programming language"
 
1:41 AM
/me needs to go to bed, it's 1:41AM
nitey nite @all
 
bye bro
 
 
2 hours later…
3:44 AM
Can anyone help me out with this stackoverflow.com/questions/26635478/…
 
 
4 hours later…
7:14 AM
@bwoebi ping
 
@cspray why the hell is your mapper responsible or creation of an instance ?
 
7:32 AM
 
user652649
8:21 AM
morning
 
user652649
is someone using php.net/dom with html5?
 
8:34 AM
good meurning
 
oi
 
8:49 AM
mood gurning
 
moin @salathe && all
 
hi there
does anyone have ever deserialized a xml by the specification of GS1? thanks
 
Morning
 
hiya @Fabien
 
Hi all
 
9:06 AM
moin @Fabien
 
Hello joe
 
good mourning
 
morning
 
do you care about benchmarks if you are running symfony @FlorianMargaine ?
 
@JoeWatkins I read it was 30MB instead of 3MB consumption
missed a digit...
 
9:10 AM
3.1% would be quite a hit, in performance sensitive software. Symfony, with it's 26 classes to abstract a session, is not performance sensitive software :D
 
moin @Jimbo
 
@FlorianMargaine it is 30MB
 
but it was more or less that before the patch ...
 
3.1% more or less :P
 
9:12 AM
You guys know of any apps that are designed for logging across many servers, both general warnings (like logstash) but also alerts for fatals etc. Something with a GUI that we can choose email recipients etc.
 
@Fabien monolog
oh no gui ...
sorry didn't finish reading ... well there might be a gui, but we don't use one ...
 
new relic
 
@salathe ah the last column is time ...
 
@Fabien graylog2
 
it's not much of a hit really ... although 1000 might not be enough of a sample ...
 
9:15 AM
But for something that you'll never* use? (*probably)
 
cheers.
 
@salathe I think the marked difference in the symfony benchmark is because it does use "use", right ?
 
@JoeWatkins yeah that would be my first guess
 
0.04-0.7% seems to be the hit for code not using it, which I assume wp doesn't ... which is still not ideal actually ... but not enough to reject it over I guess ...
 
Hey guys I need some help in modifying a script. Can I use your help?
 
9:22 AM
It's not quite Friday but this might make that a little better.
 
ha
I think I'll write a new cache for php7 and leave apc in the past where it belongs ...
such a pile-o-crap ...
 
I am having troble
 
posted on October 30, 2014 by kbironneau

/* by Laze Janev */

 
help me
 
9:32 AM
/cc @DaveRandom ^
 
$url="https://google.com";
$xml = file_get_contents("$url);
echo $xml;
 
@AsheshKumar Use a pastie service
 
like..
 
pastie
Also use a proper IDE
 
like pastebin?
 
9:33 AM
PhpStorm
 
Can someone star that for me
 
I am having trouble modifying a script..help me
3
Q: Specified Text getting converted into icons while posting but doesnt do the same while receiving

AyanI tried modifying a chat script. (The original script is from Eliza Witkowska link.) I mainly tried converting some text into emoticons. So far I can only convert text into emoticons properly. But, the text gets converted to icons only when I send the message but doesn't get converted when I rec...

 
@Fabien Whey this is not working pastebin.com/DnkFDsDT
 
Get a proper IDE and you will see why.
 
@Fabien UPDATED: now again not working pastebin.com/DnkFDsDT
@Jimbo Help
@Fabien help
 
9:38 AM
Try http:// instead of https://
And don't ping people directly asking for help. If they want to they will help.
 
@Fabien Its not
@Fabien because it only accepts https://
i get 403 forbidden when visiting http://
@Fabien actually i dont want google.com , i am trying another url which only accepts https://
 
Use Artax
 
He doesn't use composer and he's a newbie. He won't understand Artax.
 
Still, I enjoy promoting Artax. :P
 
@Jimbo Falgged! :P
 
9:44 AM
Aww bless
 
I use CURL
 
@AsheshKumar Not bothered, I could have flagged you for spamming @ messages, but I didn't :-)
 
@Jimbo please edit that gist and add .md to the file name so it renders the markdown ;-)
 
I am still salty about my sexy-hitler image getting flagged a few months ago :(
 
@Jimbo I dodn't wanted to bother you, i am following rules, but you are not
 
9:45 AM
@AsheshKumar No you're not, you @ spammed people with messages.
 
Morning
People are already encouraged to post comments on downvotes. And people not commenting on downvotes might just have a good reason for not doing hence the reason it is not mandatory. So imho asking for comments on downvotes just introduces noise. — PeeHaa 24 secs ago
 
MornHaa
 
MornPee
 
:)
 
MorGaa
 
9:45 AM
@Jimbo :)
@Jimbo Forget that :D
 
@PeeHaa downvoted for being obnoxious
 
E_INDIAN | E_CACTUS /cc @DanLugg
 
@ziGi Don't forget to comment on it then :P
 
You guys make or buy lunch usually?
Or perhaps it's supplied.
 
9:54 AM
I bring my own stuff in and make it at the beginning of lunch
Usually a low-fat soup from asda, then make a ham salad sandwich
Why?
 
Does soup need to be low fat? -_-
I always talk food when I am hungry.
 
@Jimbo What is this?
 
@AsheshKumar Amazingness.
 
9:57 AM
@AsheshKumar Do you use mysql_query() in your code?
 
@Jimbo Yes
 
@AsheshKumar Cool. Do you use md5() for your passwords?
 
@Jimbo yes, of course
 
E_INDIAN then!
 
@jimbo just kidding
I use prepared statements
and use shartcar sha md5
all 3 !
@Jimbo i use mysqli
@Jimbo Now????
 
9:59 AM
@AsheshKumar You should check out PDO, it's really nice actually once you get your head around it
 
@Jimbo All data access and mutation goes through a stringent Command Query Responsibility Segregation (CQRS) framework for centralized auditing, authentication, and authorization.
This framework utilizes strong typing and parameterization to eliminate SQL Injection attacks, as well as enforcing the presence of an anti-CSRF token prior to any data mutation.
We utilize a strict Content Security Policy and a safe-by-default templating language to effectively neutralize Cross-Site Scripting (XSS).
We encrypt all network communications with HTTPS accompanied with Perfect Forward Secrecy and HTTP
I know many thinks :O
 
@AsheshKumar On the password side, have you seen: github.com/ircmaxell/password_compat
 
@Jimbo :)
@jimbo ?
@Jimbo no,
 
PHP 5.5 has password hashing functions built into the language itself. If you're not on php 5.5 yet, for example with work, you can use that library which does the same stuff, then when you upgrade to 5.5, you simply remove the library and it all still works
 
@jimbo i am in PHP5
 
10:01 AM
@AsheshKumar We all are. But not .5
5.5
 
@Jimbo Yes!
 
@AsheshKumar What O/S you running?
 
@Jimbo Unix
 
@AsheshKumar In terminal, type php -v, what does it say?
 
10:03 AM
@AsheshKumar What else?
 
PHP 5.5.12 (cli) (built: Apr 30 2014 11:20:11)
Copyright (c) 1997-2014 The PHP Group
 
Cool, mine's:
> PHP 5.5.9-1ubuntu4.4 (cli) (built: Sep 4 2014 06:56:34)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
 
@Jimbo thats old right?
 
@AsheshKumar Mine? Latest ubuntu has in their repos
 
@Jimbo can you help me once
 
10:05 AM
@AsheshKumar If it's about the http/https thing and apache setup, you might want to post on ServerFault:
 
> and use shartcar sha md5
all 3 !
2
lolwut
 
$query = mysql_query("SELECT `url` FROM `url` WHERE `url`='".$se."'");

if (mysql_num_rows($query) == 0)
{
//will this return true if that url already exists

arr($rr,$part);

}else{

// or this one

}
@Jimbo this is my problem
 
@AsheshKumar I thought you used parametrised queries and mysqli?
 
@Jimbo any help
@Jimbo i use it in my live version, this is localhost!
@Jimbo for personal use
@Jimbo any help
 
@AsheshKumar What's arr($rr,$part);
 
10:08 AM
@Jimbo a function never mind
 
@AsheshKumar Then at first glance it looks like, if the query went through fine, that if the numbers of rows is either zero or false then the first part of the if statement will execute
I would prefer mysql_num_rows($query) === 0
 
@Jimbo if first part executes, does that means that url already exists?
 
@AsheshKumar No, it means that the url does not exist
 
Then why my code is not woking for 90 min>>!?!!>?!!
 
What you could do, to understand this easier, is this:
$query = mysql_query("SELECT `url` FROM `url` WHERE `url`='".$se."'");

$urlExists = (mysql_num_rows($query) === 0);

if ($urlExists)
{
// Do something with the url
}
else
{
// It doesn't exist
}
@AsheshKumar Debugging 101. First thing to check is your query. var_dump(); the query string and see what it looks like. Try it in terminal with mysql directly. Does it return what you expect?
 
10:17 AM
@Jimbo Why my page takes 8900000000 hours to load pastebin.com/S02skibH
@Jimbo Any help?
 
@AsheshKumar Put: curl_setopt($ch, CURLOPT_TIMEOUT_MS, 1500); before you make your curl call
 
@Jimbo still it takes 898989e hours
 
@AsheshKumar Have you put that curl setopt bit in that limits the curl call time?
 
yes
i think i am in a loop
recusive funcyion call
@Jimbo any help
 
Hi
@Jimbo I have a problem in mysql query
 
10:31 AM
@JoeWatkins pong
 
@Mubeen1992 What?
 
need to revert these changes, see internals @bwoebi
 
I have a table with two dates and price
startdate, enddate and price
i need to give a date and select price i date is within the range
 
@Jimbo Better to (bool) mysql_num_rows($query); since it can return false or 0.
Better not to use it at all.
 
for example if startdate = 2014-10-14 and enddate = 2014-10-17 and `price = 20;
 
10:34 AM
@JoeWatkins no..........
 
and my date is 2014-10-15 i want to select that record
because my date is within the range
 
Great.
 
@bwoebi ?
did you read internals ?
 
yes. But today I won't have time for that. Probably not until Tuesday
Ah, they want to revert all changes?
 
the xml and protocol stuff
 
10:46 AM
Just these? They also had complained about webhlper.
for xml stuff, I'd just consider to #if 0 them out, that won't create merge issues...
 
all of it, all that stuff needs to be done in the open, with the approval of and involvement of everybody
it needs to be actually removed completely from 5.6, since it is not something we can include there at all ... merge issues aren't a problem since we cannot use it in it's current form anyway ... best to just remove it and branch ... if I were you, I would start again actually, work with Derick as he suggested to extend dbgp, then start working on an implementation of dbgp from the ground up ...
 
I just sent a mail to internals and asked to only remove from current tag, but not from 5.6 branch. I need more time to look at what to do
Time I don't have for the next 4 days
^ wrong window…
 
11:15 AM
@webarto Fair point, gotta force that bool
 
When one sees later that the compiler didn't warn me about a possibly uninitialized value…
 
11:57 AM
someone used doctrine entities with faker?
is it possible to define custom faker generator for an entity property instead of faker guessing it?
 

« first day (1475 days earlier)      last day (3459 days later) »