« first day (1224 days earlier)      last day (3949 days later) » 

09:00
much
haha
user924016
true
whats your php tip of the week?
09:02
use your brain. tip of the millennium (:
user924016
Read and try, try and read
^ try and catch
user924016
oh I like that
not: common sense
how about "dont trust composer forks"
or "routing isnt faster in c"
user924016
okay, use the php chip
09:05
try { throw new Snow; } catch (Snow $ball) { echo "Winter time!"; }
sad.. I thought "use your brain" is very general and common tip..
user924016
Lol
user924016
I love that remark @AlmaDo
i asked about php, not common sense
@Jack while Snow is exception for you it is hm.. generator for us (:
09:06
e_error class snow not found
in PHP you also should use your brain. Well, at least 10% time
wow
so what language should you use it "90% of the time"?
in each language. The difference is only in percentage.
PHP Tip of the Week: Learn Python.
@salathe if things will go further, tip will be "learn hhvm" :p
09:08
@AlmaDo never!
such blasphemy, many amateurs, no skills, wow [doge]
you'll see (:
"Learn Zend VM" said no-one... ever.
@AlmaDo Hmm yes, SnowGenerator :)
hhvm is a niche
it might be good one day
09:09
@Jack it's climate-dependent, I think. Last month we've got -37 and so snow wasn't an exception - it was regular
but until i can apt-get install hhvm and my 300 websites run, it will be a niche
@AlmaDo but you are missing the scope
not sure
in the scope only 1% got to -37
well, below -35 it's near impossible to feel changes. So -37 will be almost same as -50
there is, however, good benchmarking routine to check
but 99% were -20, so who cares?
09:13
Note to self: don't drink on thursdays, you're not 20 anymore
user924016
lol
thats no fun
so whats new @PeeHaa?
@Petah Bat shit busy day today, but that's not really new :)
is there a "this is totally, and blatantly incorporate" flag i can issue?
@PeeHaa well im glad you made it through
only the weekend to look forward to now
user1607528
Hey folks, I need a guidance. I am trying to build an app which you can build forms then it can be integrated to other sites and submitted. I have a drag drop form builder right now. But how should I handle submit for each created form ?
09:19
Yes luckily. Only couple of hours to go
inappropriate*
@Muhammet JotForms?
@Muhammet What do you mean in specific?
user1607528
I mean the forms built in my site will be used in other sites and the submitted data should come to my db
user1607528
I was thinking to create an id for each form and put it in form action url
The simplest approach would be an iframe
09:23
although iframes have height issues off the bat
but they work
user1607528
I am just fine handling out the html code of the form
user1607528
And like <form action="mysite.com/index.php?id=343434"></form>
user1607528
smth like that
user924016
@Muhammet you can make the form go to your site, and use a hidden field to specific the redirect back to the users site
You would also need a "thanks page" url
09:24
@Muhammet so what is the specific problem?
user1607528
@Petah I am just asking which way to do it. I am not sure
user924016
like with payment gateways
user1607528
@RonniSkansing that seems to make it a lot easier
imho it is insert your from code via a script tag
that way you have full control
and in a sense too much control
user924016
@Muhammet <input type="hidden" value="yourCallbackUrl" or use the php referrer url if you dare =]
user1607528
09:27
@RonniSkansing haha i will think about it. php referrer url doesn't always work, does it
user924016
@Muhammet not really, it depeands on the browser
user924016
it is not mandatory
user924016
so just use the input field or a iframe, whichever suits your use case best =]
user924016
that way the client can also themself choose to override a specific "when done" page, instead of be default redirecting to where they came from.
but why use an iframe over a script?
user924016
09:30
script?
@Muhammet Don't depend on it
as in <script src="mydomain.com/domyform.php"></script>
user1607528
@PeeHaa got it
user924016
@Petah why not just the hidden field?
because the script can insert a hidden field
and what ever else you want
i.e. thats how google analytics work
user924016
09:33
Then he would have to set up for cors
no, because the script can insert a form that posts to another domain
user924016
But the script will not be executed unless cross origin is setup?
@Petah No the script doesn't know what the thanks page is
but the script is loaded from another domain in the first place
user924016
As I understand it, you are talking XSS
user924016
09:36
the script can not be loaded unless origins have be setup to support cors? Please correct me so I understand what you mean right
@PeeHaa the backend can send the user to where ever it wants, including the referrer, or a hidden input passed form the original page
@RonniSkansing You can include external scripts without having to worry about SOP
its not xss because the page voluntarily loaded the script, if the script was loaded via user input it would be xss
user924016
ah yea, I am mixing it with ajax
user924016
thanks
09:41
it makes you think if GA ever got hacked what they could do to your website
@Petah GA, one of the CDN's (think jquery), facebook etc
mayhem I tells ya
we do put a lot of trust in them
yeap
note to self, if im going to hack some one, hack a cdn
user1607528
09:45
What's wrong with this

`<form action="http://mysite.com/submit.php" method="post">`
<input type="hidden" name="id" value="123123">
</form>
2
A: Absolute vs relative URLs

PeeHaaShould I use absolute or relative URLs? If by absolute URLs you mean URLs including scheme (e.g. http / https) and the hostname (e.g. yourdomain.com) don't ever do that (for local resources) because it will be terrible to maintain and debug. Let's say you have used absolute URL everywhere in yo...

you should use root relative urls
user1607528
Can I hand out my html codes like that
@Muhammet apart from it has no submit button, whats the issue you are having?
user1607528
@Petah no, i don't have a problem, i am looking for the approach
user1607528
09:49
can be anything wrong handling it like that
yes, you are missing a submit button
and other than that, the form should be inserted via a script
user1607528
why it should be inserted via script ?
user1607528
what makes it wrong submittin it to url
the the foreign domain controls the content
its not wrong, its just not maintainable
user1607528
hm
user1607528
I don't know js very well that's why
user1607528
I don't know how to do it with js
document.write()
user1607528
Ok, then it's not controllable for users where to put the form
well yea it is (kinda)
its not controllable what the form's markup is
user1607528
09:55
Yeah I know they can't change the content of the form, what if they want to pplace in inside some tag or whatever
all the end users site requires is to add <script src="//www.myserver.com/form?id=123"></script>
so they can put it in what ever tag they want
user1607528
oh i see
user1607528
So in my site should the form be returned by php
your site should return JS to the /form?id=X route
the JS can write what ever you want
including form html
user1607528
09:59
ok got it, actually it doesnt seem to complicated, handle the route with php and if right just put the pre generated form inside document write and return ?
document.write("<form action='//www.myserver.com/submit?form=X'><input...>...
user1607528
yep
user1607528
Thanks
the src could be form.php if you dont know how to route URIs yet
Mornings
10:00
hihi
@DaveRandom yo dave
user1607528
@Petah what do you mean like <script src="//www.myserver.com/form.php?id=123"></script>
?
thats whats required to be put in the end users website
user1607528
yeah i know, you said src could be form.php if you don't know routing
user1607528
i didnt understand that
10:03
so myserver is your server
and form and/or form.php is your script that responses to it
user1607528
put the form.php in users site ?
user1607528
haha i feel dumb
no
put the <script... on the users site
user1607528
and what is the src
what is your domain?
user1607528
10:05
sendforms.com example
<script src="//www.sendforms.com/embed.php?form-id=123"></script>
user1607528
yeah, i am about the same
user1607528
thanks
np
anyway
night guys
user1607528
night
user1607528
10:09
helped alot
is there any way to tell composer in which directory to operate w/o changing the working directory to where the composer.lock / json file is placed?
Ohaio, Mina-san
@hakre You mean --working-dir or -d option?
@MadaraUchiha "mina-san"? huh.. sounds like postfix applied to "guys" (: not sure if is incorrect, but strange for me :p
@Jack sounds promising :)
10:22
Mina = everyone
I know. But is it correct to apply postix, like "san" there?
Okay, it always pays to read the global options as well :)
@AlmaDo I think so
@MadaraUchiha so desca..
my Japanese sucks :p limited to all that anime that I've watched with sub-titles
hi Everybody!
I have to open the chrome extension link. So I am using this method.
echo '<script>window.open("chrome://extensions/");</script>';
But it will open empty popup
10:29
Morning
Morning aall
Damn it @rdlowrey you deleted your branch and now I can't rebase against upstream/PHP-5.6 because you squashed your commits /shakes fist
> Warning: It is considered bad practice to rebase commits which you have already pushed to a remote repository. Doing so may invoke the wrath of the git gods.
^ this
Jes
Jes
hi room
good evening
storing array in session variable returns null
$this->Session->write('roles',$roles);
$roles = $this->Session->read('roles');
pr($roles);
empty?
user924016
Maybe you are passing null to it
user924016
10:41
E_GO_SHOP_BEFORE_DEAD_BY_STARVATION.. later
@DaveRandom E_LACK_OF_TEAMWORK ?
hello frineds
hello frined
i want this type of captcha in my form
do you know from where i should get ti
There's a link on it to tell you where to get it.
Also, the name of the software's on it clearly.
All you need is Google.
10:46
@MadaraUchiha wow that was awesome ^_^
@AlmaDo To be fair, my branch is based on stuff from like 2 weeks ago, where a lot of work has been done in those 2 weeks, really I should have rebased before now...
And everyone squashes their commits for php-src to keep the history clean, so can't really complain about that either
stackoverflow.com/questions/21932286/… Could not make any sense out of that...
user924016
10:52
@RonniSkansing dont be harsh..As per OP I gave ans..May be he was getting that $test form other calculation.My ans makes global..there is no wrong with that – Gautam3164 45 secs ago
@Leri There may be a proper question in there, actually.
But it needs more details.
can't get sense of "reference to class"
@Jack As it stands now, it's impossible to answer.
just passing instance?
@Leri Yeah okay ... it was more regarding the downvotes it was getting ...
10:58
^ not mine
also, primarily opinion based is the wrong reason if you're not sure what the question is about.
Better cv reason would be OT -> lacks sufficient info.
@Jack It's about altering state of object that's quite large topic..
However, yes, OT is better reason.
Sure, but with a concrete example it can be a nicely contained question.
Bill Gales? Sure
More like someone from the weather channel.
oh.. I need to wake up..
lol
11:02
home duties are taking too much time :\
Sometimes it's cool that this is just internet.. context
I'm in need of lots in-built functions. cook_dinner() & wash_clothes() will be preferred
shame that PHP hasn't them so I'm doing that manually
@AlmaDo You can always make patch. :p
Yup, a PR is always welcome.
Jes
Jes
reading an array from session returns only one value
11:06
@Leri no idea how to implement that
@Jes Yes it does
Jes
Jes
@IanBrindley how would i get all the stored vales?
@Jes What data are you storing in your session that you want to access?
Jes
Jes
$roles = $this->request->data('role');
$this->Session->write('roles',$roles);
Which framework is this?
Jes
Jes
11:11
$this->Session->write('roles',$roles);

foreach ($roles as $role){
//storing each role in db
}
Can't possibly guess that actually, could be constructor injected
user924016
looks like cake
looks like death
user924016
haha
Jes
Jes
11:13
yes its cake
$roles = $this->Session->read('roles);
missed a quote
use Sf2 they said, everything will be easier they said. then wth am I fiddling with that stoopid dic for half an hour now to inject the frigging entitymanager into my service?
$roles = $this->Session->read('roles');
I never liked cakes.
user924016
Im soo hungry
user924016
11:14
but I need to shop
No they don't agree with me wither
user924016
and there is a nuked kicthen
user924016
that is the worst part
lol @Jack that question is going to be listed on "hot" and get even more upvotes. Hell I like SO's concept (:
@Gordon @doctrine.orm.entity_manager ?
Jes
Jes
11:17
SELECT value FROM metadata WHERE owner_guid='447980' and key='role';
@AlmaDo teeheehee
Jes
Jes
what wrong with this query
@Touki that's what I am trying. what would be the argument type?
@Jes key is a reserved word
@Gordon It's an Doctrine\ORM\ObjectManager instance
11:18
@Touki i know. but what would be the argument type in the dic's xml?
Jes
Jes
@IanBrindley and my column name is key
how would i check then?
@Touki when i try <argument type="service" id="@doctrine.orm.entity_manager"/> i get an undefined service exception
Use backticks
key
@Gordon Remove the @
SELECT `value` FROM `metadata` WHERE `owner_guid`='447980' and `key`='role';
11:20
@Touki same result
Jes
Jes
@IanBrindley yes thanks
@Gordon Can you dump the content of your app/config/config.yml of doctrine?
user924016
@Leri seems the user serial downvoted me
user924016
lol
@RonniSkansing ?
Oh, I saw your profile. :D
It'll be reverted, anyways.
11:24
@Touki nope sorry, just tell where to look.
user924016
@Leri hehe okay thanks, I have just asked in the tavern anyways, have not tried that before.
@Gordon Hmm, my guess is that you didn't define doctrine.orm.default_entity_manager, or didn't declare any managers in your doctrine.orm.entity_managers
@RonniSkansing I really hate that kind of persons. They are much annoying than pure help-vampires.
user924016
Yea, they just want to be right iguess
Hello guys... Lets say I have a date '2014-02-14' in sql how i can get the start and end of that month? So i want to have 2014-02-01 and 2014-02-28
11:31
@Touki i've set default_entity_manager: ~ but result is the same
@Loclip what is your DBMS?
@Gordon Does php app/console container:debug doctrine.orm.entity_manager triggers the same error?
@Loclip End of the month: date('Y-m-t', strtotime($date));
@Jack he wants SQL
mysql
11:33
Oh ya
you should totally drop that and use php.
@Loclip Are you using that in an expression or something?
Sometimes you just need a date range less than the next month.
@Touki no. it gives me an alias name
11
Q: Get the First And Last Date of Next Month in MySQL

Lennie De VilliersHow can I get the first and last day of next month to be used in the where clause?

You know this site has a search function, right?
@Gordon Might your bundle be imported before doctrine's?
@Jack thank you
@Touki AppKernel says no
11:38
first day is much easier: SELECT CONCAT(SUBSTR('2014-02-14', 1, 7), '-01'); hehe (I'm evil man)
String domain ftw
well, it will work well and even no warnings since MySQL will treat that as dates
but format-dependent which is evil
same for last day: SELECT CONCAT(SUBSTR('2014-02-14' + INTERVAL 1 MONTH, 1, 7), '-01') - INTERVAL 1 DAY
@Touki the weird thing is that I can insert Repos just fine. Just not the EM
but - yep, LAST_DAY() is better
@Gordon By using factory_service and factory_method ?
11:41
@Touki no, by their service ID in the core bundle via <argument>
@AlmaDo well, i'll be damned ...
@Jack why?
user924016
@Leri justice.. "This account is temporarily suspended for voting irregularities."
I've never came accross this problem. It may be something trivial, but I'm lacking informations and I don't know where to look further.
didn't make it ...
11:44
@Touki ok. thanks for help
had to be rescued from service station on motorway by a couple of friends ... tail firmly between legs, I'll try tomorrow ... I feel like crap
@Gordon Are you using the "standard" way to import configuration? I mean AcmeFooExtension?
@Touki yes
@Gordon Well, I can't reproduce your error. Fresh bundle, XML service declaration, using doctrine.orm.entity_manager works fine, so does doctrine.orm.default_entity_manager and doctrine.orm.foo_entity_manager. Sorry
@Touki np
11:48
@AlmaDo I didn't know about that function hides in shame
@Gordon Let me know if you find out what it was!
@Jack before SO I didn't know about STR_TO_DATE() :p
The strtotime() clone for mysql? :)
haha, if only..
well, it's better than nothing surely.
11:51
no, it will do exactly as posted - from string to date. And format you should define yourself
good to deal with "20 Jan 2014"
Hi good evening everyone
Is there a way to know what the current server time is for email.us-east-1.amazonaws.com

« first day (1224 days earlier)      last day (3949 days later) »