« first day (1944 days earlier)      last day (2993 days later) » 

12:04 AM
@Ocramius how do I use composer in a core php environment?
 
@acoder just like in any project
not sure what part of composer is not "core php" :P
 
i hand code everything, and don't know how to do a manual install in a composer enviroment
core php - php.net
@Ocramius so i can just do an include, and everything will line up?
@Oldskool i like the id
 
@acoder yes
basically require_once __DIR__ . '/vendor/autoload.php
then use anything you may have required via composer
 
k, maybe i'll try that way since i don't work inside any cms
 
 
1 hour later…
1:25 AM
i'm using WideImage and gd to process and upload an image on my php site, but I can't manage to properly rotate the images uploaded from mobile phones; they show up with the wrong orientation. I'm using this code from this stack overflow question but it doesn't seem to make a difference:
17
Q: How to detect shot angle of photo, and auto rotate for website display like desktop apps do on viewing?

Pentium10If I take a photo with a camera it stores the orientation/angle of the apparatus so when I view the image on the PC with a good app, it shows auto-rotated to 0. But when I upload to a website it shows the original angle, so the image doesn't look good. How can I detect this with PHP and rotate ...

pastebin.com/b42qejKp How can I make the image appear in the proper portrait view?
 
1:43 AM
Aside from creating an entirely new session handler, any way to perform an action/call a function when a user exits a session? E.g., I close the browser window, a function gets called along with the default session handler destroy() ?
 
2:20 AM
@JoeWatkins the main issue is that the most important improvements are not really compatible with older version
this means that majority of composer-shit will be only "php 7 compatible"
which makes me wonder if switch to 7 as the "default" will take more than mover from 4 to 5
 
Wes
3:03 AM
gah. programming for me: 10% of time actual programming, 90% naming what i've programmed
 
@Wes just run github.com/pcrov/wordle a few times and pick what looks best
 
Wes
lol
 
3:22 AM
Took me 6 months to come up with php-ds
Usually by the time something's finished a decent name will come up
But it's usually 1. Come up with cool idea 2. Buy domain 3. Realise it's stupid 4. goto 1
 
Wes
lol
i sometimes take days just to name a class or a method. and most of times i'm not happy with the result
 
with facebook oauth, if i'm working with localhost how do I get past this:
Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
 
3:38 AM
Set your domain as localhost temporarily
 
do you know where?
 
In the app settings
 
giving me a bug since it's on "localhost"
tried putting localhost in as one of the domains
@rtheunissen still getting the error :(
 
Do you have a port as well?
 
do i need one?
@rtheunissen i just copied the login script then entered my app id
 
3:48 AM
But are you accessing localhost like localhost:8000 ?
 
@rtheunissen just the base layer
do you mind me pinging for help?
 
Hi to all
 
Well I'm already here so pinging doesn't matter.
 
!!welcome johnnyq
 
@acoder Hi there
 
3:51 AM
Should work if you use localhost in the Facebook app settings.
OAuth1 or OAuth2?
 
That's all javascript on the front end related
 
first i thought i needed that to work
@rtheunissen what should i post in the domains if localhost isn't working?
got it past that point now, tried putting it in the wrong spot
 
4:08 AM
morning
 
@bwoebi night
 
nah, I got just up
 
morning
 
@bwoebi it's 10PM here
 
these people 6000 km away…
 
4:11 AM
I know, you greeted me with morning, so greeted you with night
 
it is always morning on the internetz
5
 
=D
 
Morning @JoeWatkins
 
'nin
 
hi guys. just updated to php7. but problem is my files are set to user:group vagrant.
my php7 runs as "www-data"
do you guys recall where to change that?
 
4:15 AM
depends what you mean by "my php7" ?
 
php7-fpm
 
fpm.conf
 
ok checking.
awesome! Thanks
i found it here /etc/php/7.0/fpm/pool.d/www.conf
my app used to complete at 300ms. Now it's ~100ms awesome!
 
@rtheunissen still trending above linus
 
Woo!
 
4:22 AM
Jan 13 at 16:09, by Joe Watkins
me too, we should put php 5 in a box, burn the box, forget it happened and move on ...
 
@JoeWatkins the problem is just php doesn't just burn. only the box does …
 
php-ds is trending higher than node.js ... quick take a screenshot, and reply to every question with screenshot @rtheunissen
 
hehe
 
can someone help me knock out the basics of the facebook sdk?
login
 
@bwoebi we'll use the same kind of box they incinerate people in, also I can think of a few people we should chuck in ...
 
4:27 AM
@JoeWatkins I … tried to not laugh … but failed ^^
 
hehe ...
 
I am doing a cURL POST request and expecting a response. I have couple of other things which happen based on the cURL's response. the problem is that the script doesn't wait for the cURL's response and passes through to the next statement. How do i stop the script until the cURL receives a response.
 
4:43 AM
@JoeWatkins I've prefixed what I could with ds_. Should that include static functions? How would you recommend prefixing something like struct Vector?
 
well mixed case struct names are a bit strange for me ... I prefer php_ds_vector_t or ds_vector_t
 
ds_vector is fine
 
Coming from CamelCase class names I guess
is the _t for type?
 
the _t is redundant if you ask me
 
ds_vector and ds_vector_obj?
 
4:45 AM
yes, some people (@bwoebi) don't like it ...
@rtheunissen huh, no obj ?
 
Well there's the object, with zend_object, then there's just the raw internal vector
That stack uses etc
 
some of us would expect ds_vector to be ds_vector_t* ...
 
ugh, can't seem to get the dump from the facebook oauth
 
@JoeWatkins huh?
 
it's kind of convention @bwoebi
 
4:47 AM
I'm always utterly confused when someone does typedef a pointer…
 
cases still confuse me
 
@JoeWatkins If you need a pointer, just specify the asterisks yourself… don't hide it in a typedef :-/
 
well, you used to be able to take it as a hint that struct* is expected on the heap rather than on the stack (so at some point you need to free it) ... then you can declare you accept struct* and it's expected on the heap with just a type name ...
/**
 * An internal zval vector that can be used by other data structures.
 */
typedef struct _Vector {
    zval       *buffer;
    zend_long   capacity;  // Buffer length
    zend_long   size;      // Number of values in the buffer
} Vector;

/**
 * Custom PHP object wrapped around an internal vector
 */
typedef struct _VectorObj {
    zend_object   std;
    Vector       *vector;
} VectorObj;
is there some performance or other reason for that @rtheunissen ?
 
Just figured you don't need the std if you're using it outside of the Vector class context
Didn't really think about it very hard.
 
imo, the first is ds_vector_t and the second is php_ds_vector_t
 
4:52 AM
Why the php_?
 
because the struct is only for php ...
 
The first one also.
 
I mean it's only for internals ...
 
Oo.
Makes sense.
Could combine them..
 
Also, don't use _t :-P
 
4:53 AM
I might use ds_vector_t as part of something else, another extension for example ... ordinarily, all of the library code would be just that (think timelib/libxml/libcurl whatever) ...
but I may not want to use your object or handlers, or zends store ... so don't need the second structure, only the first ...
I probably would have written them combined, but there are benefits to them being separate ...
also ...
 
Hmm ds_vector_init creates the first, ds_vector_create_object would do all the class stuff.
So if you don't want to use the handlers etc, you don't have to touch them.
 
you might want to benchmark the buffer as the first element ...
 
There would just be an unused zend_object in the struct.
 
@rtheunissen kind of important for perf sensitive stuff though ...
 
Not having the zend_object you mean?
Or the buffer's order in the struct?
 
4:58 AM
yeah, if I got a graph of maps or something, then I don't want to waste anything ...
I'm on two trains of thought, sorry ...
 
Fair enough.
With the buffer being the first, would that mean accessing size and capacity would have to scan past the buffer (or whatever the correct term is)
 
yeah actually, I was trying to dig around in the code to see if it's worth it ... I jumped off that train of thought ...
so, just refactor the struct, I'd make it one really, KISS ...
when it comes to names ...
anything used by only internals prefix with php_, exported API functions can omit the php_ prefix ...
this is going to be quite a big API to remember, internal API, so anything you can do to make it easy for any other ext dev coming along is going to be a big help ...
 
Okay, I'll do my best. "Anything used by only internals" this goes beyond php-ds though, right? Other exts too?
 
the _t thing doesn't really matter, so long as consistent ...
@rtheunissen no I mean really only used by internals, such as object handlers ... you're going to export an API for ext's ... the internals stuff need not be exported at all ...
we don't invoke object handlers from outside directly, or shouldn't ...
 
Okay might create a branch for this..
If zend_object is the first in the struct, could handlers.offset be 0?
 
5:11 AM
handlers.offset is 0 by default, yeah
(copied from std object handlers)
say I have another extension depending on ds, and I want to create a Vector([1,2,3]), it is extremely cumbersome to execute Z_OBJ_HT_P(v)->create_object(), or even object_init_ex ... I then have to invoke the ctor with HT_P(v)->get_constructor and a bunch of boilerplate ... that's the business of ds to create objects, so you export ds_create(zval *result, zval *array) or whatever you want to call it ... so the create_object handler is really never used outside of internals ...
making sense ?
 
So zend_object *ds_vector_create_object(zend_class_entry *ce) should be internal only?
I think the entire project could be structured better..
And named better.
 
yeah, and prefixed php_
yeah, it could, but people on the outside don't care, it's the API that matters to them, and that's good ...
 
Matters to me.
 
sure, and it should matter to you :)
if you want to feel better ... go look at reflection extension sources ...
there ... that's all of it ...
:o
 
o_O
I'm going to start over with this refactor, actually plan it first :p
 
5:23 AM
yeah planning is good, I think I probably said enough words
 
Might be a good candidate for live code
Also now my most starred repo heh
 
it's an excellent thing, you did good :)
 
Close second being github.com/rockets/rockets
It's a good feeling to have a new flagship.
What I'll do is come up with the plan, then run it by you?
Then regex replace for a few hours
 
@rtheunissen sure thing ... we can squeeze in some screen time if required ...
moin @AnmolRaghuvanshiVersion1.0
did you create that logo @rtheunissen ?
 
5:26 AM
@rtheunissen you … should redo that with aerys =D
 
My friend Ken drew it.
I added the animation and came up with the idea
But I can't draw..
 
me neither, I'm very jealous of people with graphical talents ...
stuff I make that you look at, looks really shit ...
I'm terrible at that ...
 
@JoeWatkins well… you also make code which isn't shit at all :-)
 
You're about the code, which I respect.
We can't all be producers.
 
it's what I enjoy most too, but in our line of work people do expect you to be able to do certain things which I can't really do ... well I can, but you'll regret asking me to do them ...
 
5:31 AM
That's when you ask someone else to help out, bet they can't do the other half as well. Ken doesn't know programming, but he can draw cool stuff.
Would be dull otherwise.
Anyway, time for some fistful of frags before hunting for some dinner.
 
@JoeWatkins like doing frontend work?
 
I'll work on the refactoring branch later in the weekend.
 
yeah, I only just realized in the last couple of years that people are pretty useful, I have worked on my own forever before that ... I would super struggle with anything not programming and there's a lot of it ...
 
Laters until then.
 
@bwoebi yeah
laters @rtheunissen
 
5:32 AM
Let me know if you ever want some UI assistance @JoeWatkins ;)
 
I don't really consider playing with javascript and css programming, it doesn't work like programming I recognize ...
 
@JoeWatkins yeah, CSS isn't programming…
 
@rtheunissen I will ... but I'm not actually allowed to make stuff you look at any more anyway, @PeeHaa forbids it ...
 
and javascript is javascript.
@JoeWatkins why?
 
5:46 AM
@JoeWatkins looks nice
who did that interface?
 
me
I think you suffer from the same affliction I do ...
apparently, it's not very good ...
0
Q: new vs newInstance() in PHP

Dhairya Lakheraclass A { function __construct($vr) { echo "you called Constructor $vr<br/>"; } } $RC=new ReflectionClass('A'); $obj1=$RC->newInstance('by newInstance'); $obj2= new A('by new'); $RC->newInstance() and new A() both work same. Is there any difference between them so that we can...

how does this even happen !?
 
6:04 AM
@JoeWatkins "The premise of your question is fucking stupid." needs to be a canned close-vote reason
 
@JoeWatkins bah… that's just UI designers who are having a very special taste and are absolutely disconnected from reality what simple people like ;-P
@JoeWatkins panic(wtf);
@Andrea please… just write a proper PHP-to-JS transpiler which just fucking works.
 
it must be earlier in the morning for that guy than it is for us ... it has to be ... or they are drunk, and are right now preparing to post the question "We're good friends right, I fucking love you man, where can I find a bucket?"
 
@JoeWatkins thanks for the image in my head … of someone puking in a bucket …
 
welcome :D
 
6:21 AM
I begin to wonder whether we really need a garbage collector in PHP ^^ after all, if you have cycles, that's anyway bad for your perf
 
good morning
 
just properly break your cycles when necessary
@SergeyTelshevsky morning
 
@bwoebi perf is our problem, not the programmers ...
if it were the programmers problem, they would not be using php ...
 
heh, I know … just complaining, because properly breaking cycles may make 15-20% improvement in runtime...
 
moin @Sergey
 
6:41 AM
\o/
so much work to do, I hope to return to aerys on weekend :(
 
7:14 AM
I think the first thing I'll try to do is do some integration with slack & maybe a mail service
 
@YourCommonSense do you recommend always using transaction ?? I'm reading through phpdelusion.net but can't find any clue :D
 
Good morning
 
Guys, which one do you prefer;
1. $tomorrow = date('l, d M Y', strtotime("+1 days"));
or
2. $tomorrow = date('l, d M Y', time() + 86400);
 
I like 1 better simply becoz readability and ... I suck at math :D
 
7:26 AM
the first one as well, readability, unless you need "precision" down to seconds.
 
Yay.. thx guys
 
well ...
 
@JoeWatkins hmm?
 
I prefer:

$tomorrow = date('whatever', time() + CONSTANT_VALUE);
as a convention ...
strtotime can get it wrong and cause weird edge cases, you don't need to use it here, ONE_DAY is simple ...
 
7:41 AM
@JoeWatkins I don't get any weird edge cases. Any example cases? Btw, I preferred the first one because not every day is 86400 seconds like during daylight savings. Or my assumption is totally wrong?
 
take your pick :)
 
@choz that depends on which tz you use…
 
@JoeWatkins Thx for the link
 
the number of seconds in 24 hours is constant ...
 
@JoeWatkins leap seconds? ;-D
 
7:46 AM
grr ...
the number of seconds in 24 hours is nearly constant ...
 
that's fine.
 
hehe
 
=D
@JoeWatkins but it actually is constant on the unix timescale
 
yeah, even timelib wants to call 24 hours a day SECS_IN_DAY ...
 
as leap seconds just repeat a second or make the second be actually a tiny bit longer or shorter
 
7:49 AM
time is ... not very precise ...
 
oh, it is. Just the measurements (sun… bah.) aren't.
 
Now it feels like I hate strtotime more than time.
 
Universal time (ut) is nice…
 
anyway use strtotime when you are parsing input in some strange format, very useful then and nearly always right, but when you are just programming it doesn't seem necessary ...
 
time will tell..XD
the php psr-7 doc is so long............
 
7:53 AM
@Andrew I have a solution to that, I've been using it for a while now, it's working great ...
ignore it ...
 
@Andrew indeed … just don't use psr-7 ^^
 
1 min ago, by Joe Watkins
ignore it ...
 
Hello everyone!

Quick OOP question - please, help me find better place for helper functions.

Currently I have monolithic static class StringUtils, where I have various methods which manipulates with strings, including ones which normalizes class/method names.
These functions are used in more than one place, such as in Web and Console dispatchers, and is needed for converting user input like this:
"php script.php self-update" to "\App\Command\SelfUpdate"
or
"/api/get-products" to "\App\Controller\Api::getProducts()"
 
@bwoebi but it considers good practice :(
 
@Andrew who says it's good practice?
 
7:57 AM
@bwoebi hmm, didn't they collaborate and summarize a standard guild line ??
 
not with me ...
or @bwoebi ...
 
@Andrew oh, they did … and the result was suboptimal.
too many compromises in it.
 
and they were told this ... very very loudly by a lot of people ...
 
You don't need interoperability for HTTP messages. a) you don't just switch the framework anyway … and b) you should not pass raw HTTP message data to libraries, but give them what they need.
which is why I strongly think every framework should do what best fits it here.
 
afk school run ...
 
8:01 AM
basically: do PSRs for library interoperability, not framework interoperability…
 
@bwoebi that make sense :D
 
because the latter is an oxymoron … or did you ever run two frameworks in the same app!?
 
it will be very unlikely
 
and HTTP message wrapping is definitely a framework responsibility.
 
agree
oh well, I am not dealing with HTTP message at the moment, guess I will just pass it
 
8:05 AM
What is PHP HTTP messages for? Is it like SignalR in ASP.NET?
 
@choz I think the fewest people in here know ASP.NET…
 
@choz Isn't signalr a websocket library?
Morning all
 
[this is definitely a tag : morning ;D]
 
@PeeHaa Yeah, It makes web chat lots and much faster.
 
mornin'
 
8:14 AM
Than no. http messages are not like some websocket library
@Ekin Mogguh
@JoeWatkins lol :D
 
@PeeHaa morning
 
morning @PeeHaa
 
I just got CIV3 Complete +4 +5 & Beyond Earth for $35 :>
at the end of a 16 hour work day
 
16 hours o.O
 
yeah and it's 5:26am down here in Uruguay
 
8:27 AM
its near Argentina :)
 
@Ekin The time is 5:26am now?
 
@Shafizadeh that's what he said
 
Well the difference is pretty much than the time in our country ...
 
05:29am
 
12:01 pm (Iran)
 
8:29 AM
Morning
 
4:29pm (Hong Kong)
 
@Oldskool Yo
 
morning
 
@Andrew Hong Kong is in China?
 
@Shafizadeh yup ;)
since 1997
 
8:30 AM
and are you from there ?
 
err, you can say that
 
Nice .. I never chat with a person from China :-)
 
although I was born in Canada
 
:)
 
8:33 AM
most Canadians I met were from Québec
 
Their first language is French, if I rmb right, then Engish :)
 
yep
 
don't rmb, but back when I was in high school in Vancouver, French class is mandatory. I think
 
Would make sense, since half of the country (if not more) speaks it
 
maybe, but I think English is more common in communication
going back to Canada at the end of this month :) for school, and hopefully can find junior web dev job ?!
 
8:46 AM
Hi guys :)
Check out my question.
0
Q: Insert into with same IDs

Vintage BeefI want insert into data with same IDs. EXAMPLE: tbl_products +------------+--------------+-----------+-------+ | product_id | product_name | vendor_id | price | +------------+--------------+-----------+-------+ | P1 | A | 1 | 500 | | P2 | B | ...

 
@Andrew Cool, good luck with that :)
 
@Oldskool thanks :)
 
Moin. Is an SSL .key file per-server or per-domain?
 
domain / ip
 
@Sean Per domain. Because if you move the domain from server A to server B, you'll want to migrate the key along. But you don't want to have 2 servers having the same private key. (And there are probably more reasons, but this is the first that pops to mind).
Technically you should be able to generate multiple CSR's with a single private key, but it makes things a little less mobile.
 
8:52 AM
Makes sense. Setting up an SSL cert for the first time, but we use a load balancer across two servers / IPs
Just to make things difficult
 
8
A: Any reason not to use same key for multiple SSL domains on one server?

D.W.I can see two primary reasons why you might not want to re-use the same key: Compromise resilience: If the private key gets leaked, and if you've re-used it for multiple domains, then multiple domains will be affected. If you use separate private keys and store each on a separate server, then ...

Also has some good reasons :)
@Sean In that case it's usually best to handle SSL on the load balancer and then redirect the request with HTTP internally. Look into SSL termination, that explains some more on the topic. Stuff like HAproxy and Nginx can help you achieve that.
 
Cheers ^^
 
moin
 

« first day (1944 days earlier)      last day (2993 days later) »