« first day (1832 days earlier)      last day (3122 days later) » 

8:00 PM
is it safe to call any codeigniter app a legacy app?
 
All code is legacy.
 
Why frowny face? It just means that there is no fundamental difference between code you've written today, and code that was written 6 months ago.
 
ok, let me rephrase
is it a good idea to start writing a new app with codeigniter? considering its status.
 
NO.
Symfony/zend/laravel are all kind of equivalent, and if you are starting a project, and are asking the question 'which one should you use' one of them would be 'fine'. CodeIgniter would not be a valid choice, as it has all the downsides of using a framework, without the upside of having a good ecosystem for plugins/developers who know how to use it etc.
 
8:08 PM
Can anyone help me with general code layout? I am developing a new app, built on top of the laravel lumen framework
 
@EquinoxMatt "Discussion for all things PHP. Don't ask to ask, just ask. Chat Guidelines "
 
My problem is I am using analogue ORM, which is the dataamapper version of eloquent. I have my controller, I have my respositories
This is also going to be a pure API
 
Happy pre friday all
 
say I want to have a request users/{id}
 
@Danack I get your point. I'm asking because I've seen job posts where they need "codeignitor developers" and all I can think is "that app was written a long time ago"
 
8:10 PM
The aim of this is to retrieve a json format of the user. Where do I call the respository?
In the controller? In the users entity?
 
not in the entity for sure.
 
But it feels wrong to put it in the controller... because than the controller would know about the persistence layer
 
your controller would make use of a model (service layer)
and your model would call your repository
 
ok, so I end up having 4 files involved in the process? Controller -> Model (Service Layer) -> Repository -> which returns a entity object
I think that makes sense
 
just out of curiosity, aren't you using a framework?
 
8:13 PM
I think this is where studying well written libraries doesn't help, they never deal with a database
well rarely
yes, Lumen
 
Ok, this is annoying me...
I have my form which when submitted shows a confirmation on the same page but, I'm still trying to work out the "confirm form resubmission" on refresh issue
 
@benlevywebdesign - You should redirect your posts requests to a GET request
Post/Redirect/Get (PRG) is a web development design pattern that prevents some duplicate form submissions, creating a more intuitive interface for user agents (users). PRG supports bookmarks and the refresh button in a predictable way that does not create duplicate form submissions. == Duplicate form submissionsEdit == When a web form is submitted to a server through an HTTP POST request, a web user that attempts to refresh the server response in certain user agents can cause the contents of the original HTTP POST request to be resubmitted, possibly causing undesired results, such as a duplicate...
 
Yeah I've read that but I'm still confused
@EquinoxMatt this is my line of code for the form: <form id="form1" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>#projectrequest" method="POST" novalidate>
 
You should only POST data in a POST request. WHen you have finished submitting the information to the data storage, redirect to the relavant GET request, maybe with a flash message
 
I have an include like this: <?php include("contactmeform.php"); ?>
in contactmeform.php is where I have the code to submit the data to my db and to send an email to the person who filled out the form plus me.
 
8:18 PM
What are you doing when you have submitted the form?
What do you do with the post request?
 
let me pastebin my code for that
one sec
 
brb need to eat some food, if no one else can help you when I am back I will take a look
 
me too. I need food
 
ok so the contactme.php is contained as in include
 
8:28 PM
so when you submit the form, the page loads the rest of the content on a page request. Therefore, when you press F5, you are effectivly saying, I want to re-submit the POST request e.g form
so at the end of hte contactmeform.php do something like header('Location: contactform.php')
this will send the user to the form as a GET request
 
Anonymous
It is common to put your photo on a Letter of Motivation?
 
the key bit to take from this is, a POST request is for submitting data, a GET request is for getting page content, or to put it really simply, never display page content, on a POST request
 
@EquinoxMatt at the very end? so what can I put inside header('Location: ')
can I put the same page or does it have to be a different page
 
Yes, when you have 'finished' dealing with the form submission.
You can go to the same page
header('Location: yourcontactformfilenamegoeshere');
 
header('Location: index.php')
 
8:33 PM
yes, if that is what your main file is called
 
so my contact form is on index.php
Ok let me try it
so all I do is header('Location: index.php') after lines 64
 
yes
and for a bit of reading, I thouroughly recommend www.phptherightway.com
 
so do I have to touch my form action: action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>#projectrequest" at all?
brb
 
No, that should be fine. However as I said I would strongly recommend looking at the link above for a guide to best practices. I appreciate you may be starting out and that is a great way to learn better ways of coding e.g code seperation etc
I have to go for a while now, so best of luck!
 
8:49 PM
OK
 
@bwoebi I went to Zendcon 2008 and I'd say there were 300-400 there. I would expect there to be more this year
 
No that didn't work and I already new that wouldn't
 
Morning room
 
9:05 PM
Ello
 
@Danack (equivalently shitty? :-D)
 
9:28 PM
Observables seem like an interesting abstraction, but is there a reason for them to exist in a world with Coroutines?
It seems like a replacement for the lack of a notify callback on promises, sort of like the watch() method on Amp's promises.
 
@Trowski where did you see that abstraction?
 
@Trowski that's a pretty heavy thing…
 
@bwoebi I thought about how I would implement it, and my first thought was a coroutine where you could attach a callback when a value was yielded... but what's the point in that?
 
@benlevywebdesign - what did you mean by - 'I new that wouldn't work'
 
9:36 PM
@Trowski eih…?!
 
Unless I'm missing some obvious use case...
I am a bit burned out this week :P
 
@EquinoxMatt well I think my include was messing it up. So I tried taking it out and using the action as contactmeform.php and it worked minus my confirmation message that would show up when it went through
echo("<div id='contactform'> <p class='contactformsentname'>" .$_POST['managername'].",</p> <p class=contactformsent> Your request has been sent. You should receive a confirmation email for your records shortly. Thank you!</p> </div>");
 
@Trowski "a coroutine where you could attach a callback when a value was yielded" < well, I have no idea what you're talking about
 
@benvleywebdesign - yeah, there is that, but you are still not redirecting to a GET request, that was the original question ;)
 
@bwoebi An observable is like a stream of async values, so like a stream of promises where you can attach a single callback that is invoked each time a value is available.
At least if I'm understanding them, correct me if I'm wrong.
 
9:40 PM
Well, I guess in Icicles spirit, I'd implement observables as something you can pass a Generator to and then send() the async values into each Generator?
 
@EquinoxMatt well the action as contactmeform worked and no confirm form resubmission message but I loose my form sent confirmation
 
@bwoebi Hmm... that could make sense.
 
@EquinoxMatt I would still like to have that
 
to do a form sent confirmation
store the message on the POST request in a session variable
 
9:43 PM
and retreive it upon redirection on the GET requestr
otherwise known as a 'Flash' Message
or Flash Session
 
@EquinoxMatt I am not a beginner web designer but I don't do many complex php things
 
Hi, what is the most apropriate way to handle OOM errors in php extension? Assume we have separate case for cli and fpm/cgi, apache modue.
While the question is very general, I really appreciate any thoughts about it.
 
9:59 PM
@zaq178miami what have you tried
 
I'm writing php extension and there are situation when OOM may occurs.
 
I believe the 'best' way is to increase the memory limit and then throw an exception as soon as possible.
 
@Danack, assume we are talking about 1.5G and assume we can increase it to, say, 80G
so the question is more about what behavior is less disappointing and more predictable in case we are already in OOM
 
No...I meant increase it by 10 meg to make sure that the exception doesn't trigger another out of memory error immediately.
But to otherwise trigger an 'unhandle-able' exception.
 
i totally agree that this is the best way, but what if we already in such situation.
currently, whole process abruptly terminated
 
10:02 PM
I haven't tested this against PHP RCs - you might be interested in github.com/Danack/MemTrigger
 
let's clarify, i'm integraing v8 into php
 
@zaq178miami Sorry, I'm not sure exactly what you're asking. There's two different cases i) when mallocs start failing, and the answer to that is you are buggered and can't do anything. ii) When PHP reaches it's set memory limit - in which case you can just change that, and try to do a clean shutdown through throwing an exception.
You shouldn't increase the memory limit that much....but most people would prefer it being increased a little to allow a clean shutdown. If that doesn't cover what you're asking, perhaps you can clarify the exact scenario?
 
I probably didn't write correctly what i mean, sorry for that. I mean situation when memory allocated out of zend control (no ecalloc/emalloc/erealloc/safe_emalloc/estrdup/estrndup calls)
In case of malloc() starts failing, I guess it mean that we can go forth and multiply.
so termination is the least evil
 
Should value objects validate their own data?
 
@Danack nice extension. You are using ticks, right?
 
10:12 PM
@EquinoxMatt No.
 
+1 to no because of SRP
 
hmm, so where should I validate the value I am trying to give it? I thought the idea behind value objects was they would have their own methods...
 
@zaq178miami I honestly can't remember. I was very slightly out of it when I wrote that code.
 
@Danack - might be a good idea
Basically the value object is a ID made up of 3 paramaters
so when I create the value object, I wanted to validate that the three paramaters can be used to make up the ID
so I assumed the construct would call a isValidID() method on the value object
it seems a bit wrong writing a function to do that on the service layer
blog.sznapka.pl/immutable-value-objects-in-php - this article says it is OK to validate on the construct
so confusing
 
You can still have absolute sanity checks on the data. But those checks inside the value objects are going to be "TheseShouldNeverHappen" type exceptions. All of the validation of the input data should be domain specific and happen without needing exceptions before the object is made.
@zaq178miami yeah....actually pretty sure it does use ticks.....it's just that I was confused when I was writing that code, as I'd hooked into the wrong place, and it was being called every tick (or something) which lead me to getting confused about what was going on.
 
10:21 PM
@SeanDuBois hehe, nice job on the rfc =D
 
@rdlowrey At what point do you see yourself increasing the PHP version requirements for Auryn?
(It's not pressing, like at all. Just curious what the criteria would be.)
 
There's no reason to arbitrarily increase the version. There's just some point where you won't bother respecting the old version.
 
I wonder when PHP 5.3 will fall below <25% market share (or if it already has).
 
user895378
@LeviMorrison I honestly haven't thought about it.
 
user895378
I don't have a problem with dropping 5.3 support at all. But I also don't see any reason to do so unless it starts hampering new development.
 
10:32 PM
@Ja͢ck thank you!
 
@rdlowrey I think one reason is, the more that people keep supporting 5.3 with libraries, the less reason they have to upgrade
 
It was all accidental, eventually fumbled into it working
 
:)
good moaning, rest of room!
 
@EquinoxMatt But are we to the point where bumping the requirements is helpful or just annoying?
@rdlowrey What version of PHP is used at Grovo?
 
Well how long as 5.3 been out of support
over a year now?
 
10:35 PM
@EquinoxMatt Some Linux distributions still backport security patches for it though because they have LTS support for it.
 
yeah, but BC is good until it starts holding people back
a perfect example is, I was writing a module for magento
 
my local dev (my fault) was running 5.5, I was using the short array syntax
deployed
and sure enough, broke on our server running 5.3
frustrating.
 
I really don't understand non-rolling release. Instead of having many small bugs, you have breaking painful bugs everyone 6 months
 
@ircmaxell - This looks entertaining
@ircmaxell - I found this the other day, if you haven't already seen it - youtube.com/watch?v=BKorP55Aqvg
 
10:37 PM
@rdlowrey Yeah, it doesn't use generators. I consider generators to be the best feature added to PHP 5 since PHP 5.3.
 
@SeanDuBois yup :-)
 
@LeviMorrison ahem, are you forgetting about the power operator?
 
@Ja͢ck :D
I have used the power operator... exactly 0 times.
Sorry, buddy.
 
nice, keep it up! hehe
it takes effort to turn a 0 into 1
 
you don't know they finished because there is no semi-colon! @ircmaxell - superb find!
 
10:53 PM
@SeanDuBois Some people/companies don't have developers continually working on a project. Instead they will have someone come in, or allocate an internal resource to work on the project every time it's absolutely needed. The rest of the time the application is just sitting there doing it's thing.
 
@Danack but if you had an easy continuous deploy getting new devs up and running is way easier. At Etsy we have projects that sit idle, but I realize has an issue. I can check it out, fix it and deploy in one day.
As long as the tests pass, and I get a sign off from the original author I am good to go
 
Yeah.....and if you didn't have comprehensive tests?
 
Yea that would be awful
No confidence to make a change, but we have a really good culture of 'as long as you are doing the right thing no one will fault you'
 
i like that culture :D
 

« first day (1832 days earlier)      last day (3122 days later) »