« first day (643 days earlier)      last day (4296 days later) » 

5:00 PM
@AndyPerlitch that looks like machine default return-path. You do not set them
 
@MikeB , you told a designer to use cakephp .. that about sums it up
 
@ert3 whats wrong with using a global constant (besides the generic issue of use of globals, im working in an older project)
 
congrats , you have added another ticking time-bomb project
 
@AndyPerlitch im just listing possible dumb mistakes we all make, there is nothing wrong with it, just a normal thing us 'profesionals' don't always think about
 
@tereško He had experience with django, between the two choices he gave (Drupal and CakePHP) I advised which one was closer
 
5:02 PM
@orourkek A lot of sigh worthy things going on
 
@ert3 haha right, good point
 
He clearly wants to know more about PHP Frameworks, go ahead and lay it on about Cake or insult his intelligence
 
@Truth lol it's on the road to be closed yet again haha
 
@MikeB , that is not the problem .. you assumed that "experience with django" means "able to write code"
 
@tereško I'm not going to assume that since he mentioned he was a 'designer' that he's incapable of working with anything semi-complex
 
5:04 PM
thats a point
 
@tereško I don't disagree with your point, but you're not offering any suggestions or alternatives
 
then go ahead offering suggestions or alternatives
 
if he/she has experience with django , then it would be much better to invest time in actually learning python
 
@user1438003 Like I said if you read the Twitter Bootstrap page you would already know this, it says at the bottom of the Collapse section how to call it: jsfiddle.net/THnR9/4Event_Horizon 22 mins ago
 
5:14 PM
♬ "Not enough reputation" ♬
 
Since we're all still talking about 'the designer' which refers to me, yes I WOULD like to learn php, and would like to CODE in php. so yes I would rather prefer something like phpcake (or ANY other framework) so what I just wanted to know is what to start with (and the question before that, pure cms or framework was to check if starting with something like drupal would give lots of advantages to start with vs frameworks, taking the lack of 'freedom' in something like drupal)
sorry for asking the, clearly, retarded question of trying to help/guide me to a framework that might suit me -.-
 
it depends
 
You don't prefer Python or you think PHP would be better for you to learn?
 
@Spyral , if you actually want to learn PHP , then jumping in a framework would be the worst possible way
 
@tereško thats correct
 
5:17 PM
I think not to many people would actually 'request' a site that runs on a python framework, like django. and I think php is more supported in general. That's why I choose to go for php. + for some reason I feel drawn to php oO
 
Spyral - true.
 
@tereško Even though that might be bad, I do also want to simultaniously be able to use it for my webdesign
and if I'd just start with php (which I already know the bare basics of)
I wouldn't benefit from any framework
but I do get why diving in a framework to learn php could be bad
 
it "is" bad
 
ok = /
 
because of the abstraction
 
5:21 PM
technically learning a framework is usually just that, learning the framework (and usually not much of the language)
 
@Spyral , i would recommend for a quick look through devzone.zend.com/6/php-101-php-for-the-absolute-beginner , and then reading "PHP Masters"
 
I hate PHP's access modifier system sometimes...
 
that by the time you are done with both materials , you will be able to make a website , without copypasting code from StackOverflow
 
K, thanks! :)
 
Why was Class Name{function Name()} changed to Class Name{function __construct()} ? To keep things more in line with OOP convention?
 
5:31 PM
so an accident just happened outside my office window; a car ended up being pushed up onto and down the sidewalk about 25ft...
 
I need a little PDO help. Why would one method work and not the other? pastebin.com/NRsqQvnJ
 
@orourkek Last year a van was on fire out in front of my work on the main road, just burning, and it took the fire department at least 15-20 mins to put it out while it was raining.
 
@Event_Horizon geeeez, doesn't say much about the fire dept
 
@ImmortalFirefly because it shouldn't work?
 
For being in the middle of a major city, it sure took a long time for the ambulance to get here...
 
5:34 PM
@webarto Ahh, words of wisdom.... :) What should it be then?
 
@orourkek Small town, large fire, the entire van was engulfed before they even got there.
 
@ImmortalFirefly have you tried removing self:: :)
 
@webarto Sorry, I forgot to remove that. That's how it is in my real code, but I simplified it for pastebin. Here's the repaste pastebin.com/4pWSXThn
The code for the $DB->query is actually self::$DB->query, and it still works @webarto
@webarto and $true is actually boolean = true; i.e. it really should be executing the $statement->fetch() command
 
Everything I've read says it should work......
unless I'm missing something (which is usually the case)
 
5:42 PM
What Have You Tried? @ImmortalFirefly
 
$sql = "SELECT column FROM table WHERE id = ?";
$stmt = $DB->prepare($sql);
if ($stmt->execute(array(5)))
{
    $row = $stmt->fetch();
    print_r($row);
}
@ImmortalFirefly can you try this?
 
@webarto That was the first method I tried and it didn't work
 
@ImmortalFirefly execute needs a array as param
array(5)
 
@jami, correct, I have an array already set
 
yes, $ids[]
 
5:45 PM
ah
i missed that
 
If it wasn't an array, would it still return true?
 
$sql = "SELECT column FROM table WHERE id = :id";
$stmt = $DB->prepare($sql);
if ($stmt->execute(array(':id' => 5)))
{
    $row = $stmt->fetch();
    print_r($row);
}
try this... @ImmortalFirefly
either way, it must return something, error at least, some output... "doesn't work is" is like "sky is blue"...
 
@webarto Negatory....
 
i raff i ruse
where are you trying this? on your computer or some server?
 
On a live server
I think I figured it out. There were extra ' ' in the $ids array inserted. When I recoded it to take them out, it worked
Sweet mother of pearl
:)
@webarto @jami You both get my hero of the day award..... don't know how much recognition you'll get for it though...
 
5:57 PM
so PEBKAC :)
 
I don't know what you just said, but I'm sure it's supposed to boost my suffering self-esteem @webarto
 
Wow
I'll go hide in a corner now...
with a quart of ice cream
 
another gem from the CI forums:
> By library do you mean the controller ?
 
@ircmaxell Thanks for some meaningful input on a new API.
It was a refreshing break.
 
6:05 PM
@webarto Your mom goes to college.......
-- Kipp Dynamite
 
@ImmortalFirefly Were you in the movie, by chance?
 
@LeviMorrison My wife met Pedro.....she said he was actually quite smelly....but I have a picture for proof
 
@LeviMorrison Oh snap, I'm in the presence of a celebrity...

My what a fancy title you were given!
 
6:08 PM
rrrrg new canary chrome build is being funky....
 
@Neal This is pretty funky too, youtube.com/watch?v=pzVbHmcSvm0
 
@rdlowrey I see you updated a lot of Artax.
 
hey @Levi
 
@NikiC G'afternoon.
 
6:14 PM
how's it going?
 
Good. Writing a HTTP client written on top of PHP streams.
It's going quite well.
Much better than cURL imo.
 
@LeviMorrison Do you know a Dave Skinner?
 
user895378
@LeviMorrison Yes. Need to write tests, but I think I finally have the error handling correct.
 
good weekdn all :)
 
@ImmortalFirefly Not that I can remember. Is he from the area?
 
user895378
6:20 PM
My wireless router died this morning and I've been fixing that and getting all the other stuff on the network working all day. So annoying. I've been having infrastructure issues a lot lately.
 
@LeviMorrison Yeah, he goes to the Utah PHP Users Group Meetings monthly
Didn't know if that was up your alley or not
 
@ImmortalFirefly I've never gone.
 
@LeviMorrison me neither :)
 
gotta git push on friday
 
6:23 PM
@PeeHaa if($today=='friday'){$PeeHaa->postvid($friday);}
 
die; die; die;
 
fun(); fun(); fun();
 
@PeeHaa MOTHER OF GOD
 
@rdlowrey Return array that contains Response objects, or return a ResponseChain or something of the like?
I really wish PHP had generics for this case.
Happens all the time.
I usually end up making an object just for the type :/
 
6:33 PM
@PeeHaa I know what I'm doing when I get home, trolling collegetown with birds
 
Trying to build a preg_replace() regex....
I have this so far....
RegEx: ([\w\.]+)\s?(=|IN)\s?(\(?\'?(\S+)\'?\)?)
Replace: $1 $2 ?
I need to replace a string such as WHERE id = 18 AND group_id IN(57,67,57) to
WHERE id = ? AND group_id IN(?)

I have it where it does the id = ?, but then it is group_id IN ?
도와주세요
 
@Event_Horizon :-)
 
I'm using RegExr.....just can't quite get it to match up....
 
Unlike many languages where a core rand function will return a float from 0 to 1, I suppose in PHP you'd (rand() / getrandmax()), eh?
 
6:41 PM
@Bracketworks Well, you should at least use mt_rand.
 
Yea, I was actually going to edit with "...or mt_* respectively"
lol
 
user895378
@LeviMorrison Sorry I'm in and out of the office right now. Will be able to respond in maybe half an hour or so.
 
@LeviMorrison Thanks! What do you thyink? I'm not totally sold. Feels like trying build a house of cards on an elephant's back...
 
@ircmaxell lol
It's a tough issue.
I'm not sure how I feel about pseudo methods.
Imagine the next WTF PHP article that talks about them . . .
> PHP didn't even implement REAL objects; they just added an object-like syntax to be cooler.
@ircmaxell How difficult do you think it would be to add types to arrays in C-land?
array<Response>() would only allow response objects to live in it. array() would act like it currently does.
 
6:52 PM
@ircmaxell What are you two talking about there?
 
imho the fact that the method notation will be stricter about types is a very good thing
not an issue you should try to fix
 
@NikiC How would you feel about proposing typed arrays?
 
And I think Rasmus provided the ultimate example as to why:
$a = 1;
$a->strstr('1');
@LeviMorrison what for?
 
@NikiC Better type hints.
Consider the situation where you want to add a few items of a certain type at once to some kind of collection (loose terms here).
function addAll(array $items); won't get you there.
 
7:01 PM
@LeviMorrison I would like that
 
If you create a new class that represents the strict type you have solved the problem, but you now have more complexity to deal with.
The only other solution is to throw exceptions.
 
0
Q: How to move files in PHP?

user1541587I am working on image hosting script. And whenever i upload file it saves in public_html. I want to save images in public_html/images. I am using below code it works perfect but saves file in public_html. <?php include( "settings.php" ); // // MySQL Connect // // mysql_connect( $GYAZO_DB_...

 
just so it's said...PHP is not C++, Java, or any of that. part of what i like about it is that it's not all anal-retentive about types.
 
where to start picking apart this
 
@cHao Which is fine. I want to leave the original array() syntax and behavior unchanged.
 
7:02 PM
I figure you folk will be better to convince him that there is a lot more wrong with that code that he might think
 
I'd love to see something like this: function addAll(Traversable<Item> $items);
 
@rlemon That shit is FUBAR
 
yea
 
@LeviMorrison For typehints why not just write Foo[]. Every IDE supports that I think
 
@NikiC I want interpreter enforced type-hints, not sugar for my IDE.
 
7:05 PM
@PeeHaa I often want to comment with "Is this production code? Can you link me to it? I can Show you what is wrong with it ;)"
 
I'm tempted to just cv it, because it's a turd. I just don't see it as an cv option
@rlemon :)
 
well "too localized" jumped out to me
> Above is the code plz set save DIRECTORY to public_html/images . and repost the new code.
 
Voted for NARQ
 
also.... youtube.com/watch?v=p6PZhONZ3Ac&feature=related we do not respond well to these requests. — rlemon 6 secs ago
 
too localized would perhaps be better. Mah as long as it is gone
 
7:08 PM
@LeviMorrison Ah, okay. "Type hinting" is a really ugly term ^^ Nothin to do with hints, but rather compiler-enforcement
 
hey chat, are there any plans to implement (try/catch) finally in PHP?
 
@NikiC Agreed.
@markus-tharkun Not that I know of.
 
@markus-tharkun No
And imho completely unnecessary ;)
 
thanks
it's not extremely necessary, I agree... I just wanted to know if something is planned or not to know how to proceed
 
@markus-tharkun no but i hurd they are implementing (try/catch) whenallissaidanddone
 
7:11 PM
thanks for the info! :)
 
it will be part of the Rick-Astley package. Just make sure you want it... because it's hard to give up once you've started.
 
do you guys all have the new summer flower SO love in here already? :P (hint: SE blog)
 
@rlemon Neva gonna give, neva gonna give!
 
@markus-tharkun ehm. no :P
 
@markus-tharkun no but all should have the unicorn love script
 
7:13 PM
I'm still approaching the problem with kill it with fire.
seems more efficient than kill it with daffodils.
 
^ if you do not know what i'm talking about - install the script here refresh the chat and star something
 
@rlemon How do you install it ?
 
click the link
 
@NikiC So do you think it would be difficult to implement typed arrays and iterators?
 
need Chrome ?
 
7:17 PM
or FF
it's a userscript
 
When I click the link, it only show me the content
 
hrm.
shouldn't
it's a .userscript.js
 
With Chrome it works
 
damn
it's .user.js
iirc FF might require .userscript.js
 
@LeviMorrison I think so
Or, no, it is very easy to implement if you just hack it into zend_hash
but a clean, decoupled implementation...
 
7:20 PM
are there any downsides to a foreach() by reference, other than the "hanging" reference to the last element when the foreach is done?
 
@dievardump does FF require you load greasemonkey to run userscripts?
 
Scriptish or Greasemonkey .
I think
 
@NikiC Fair enough.
 
If PHP were written in C++ ... you'd just use polymorphism to provide the additional typed implementation ^^
Heh :(
 
What about implementing a new option for HTTP contexts in streams to return the meta-data wrapper-data as a multi-dimensional array?
This just sucks:
Array
(
    [0] => HTTP/1.1 302 Found
    [1] => Location: iana.org/domains/example
    [2] => Server: BigIP
    [3] => Content-Length: 0
    [4] => Date: Fri, 20 Jul 2012 19:10:51 GMT
    [5] => Via: 1.1 hfltr2.byu.edu:80 (IronPort-WSA/7.1.3-014)
    [6] => Connection: keep-alive
    [7] => HTTP/1.1 200 OK
    [8] => Date: Fri, 20 Jul 2012 19:09:38 GMT
    [9] => Server: Apache/2.2.3 (CentOS)
    [10] => Last-Modified: Wed, 09 Feb 2011 17:13:15 GMT
    [11] => Vary: Accept-Encoding
 
7:23 PM
Has anyone used a caching library that does good indexing/tagging?
 
@LeviMorrison You mean like headerName => content?
if so, what happens when there is a redirect in between and you thus get the same headers multiple times?
 
@NikiC No, notice that there are multiple responses in the array.
 
oh
ah, just what I said :D
didn't notice it
yeah that's ugly
 
you should look into it ;)
 
7:25 PM
Only if you are willing to answer my questions.
:)
 
sure
at least as far as I know. I didn't look much at the streams code yet
 
Can you remind me how to run tests on a particular directory?
For php-src?
 
make test TESTS=dir
 
Thanks.
 
+flag as spam / soliciting / wtf
 
7:41 PM
['http']['max_redirects'] = 1 <- you would think that redirects once. It won't redirect at all.
Same as setting it to 0.
 
well doing a uber quick google search on that link I find like 6 deleted questions he also did that in
 
Funny lightning talk: destroyallsoftware.com/talks/wat
 
why are mods not banning him outright.
 
dunno, I flagged as spam
-6
A: What are the limits of compiling dart to javascript?

ZekeNot sure but this site may be able to help you out. check out this website http://ubuntu365.com/

Get that one too
 
-2
A: Ubuntu pass information to a text file during process execution

ZekeNot sure but this site may be able to help you out. check out this website http://ubuntu365.com/

 
7:46 PM
am i just dumb
0
Q: Kohana 3.2, ORM has_many, belongs_to relationship not reference correct key

gorelativeI have two tables named utilities, types that i am trying to access the other fields within types from the utilities view. e.g; $utilities->type->type; Utilities would have_one type and type would belong_to utility right? This is how i have it currently, and rather than referencing utilit...

crap, thats a loaded question..
 
@MikeB i am in meta bitching about him
 
user895378
> I did a quick survey and found that about 50% of questions that are closed on Stack Overflow are also accompanied by an unfriendly comment.
 
user895378
Sounds scientific.
 
user895378
@LeviMorrison I usually try to avoid an array if I don't need the map/dictionary functionality. I know it's a pain to create a ResponseChain just to hold Response objects in lieu of generics, but that's what I tend to do. Either that or attach the Response instances to an SplObjectStorage and return that.
 
@gorelative wouldn't you be better of using native SQL instead of ORM ?
 
user895378
7:52 PM
But I don't have a strong preference in this particular case -- ease of use should probably be the most important consideration.
 
@Event_Horizon I agree with you on the subject of tables vs. divs, however George is already using a table, and has asked for a solution with the use of a table. However, I politely disagree with your inclination towards inline styles, which I believe for certain situations, such as the one George has just provided, is completely acceptable when you need a certain solution in a specific spot. — Patrick Roberts 4 mins ago
Regardless if someone is using a table they should still try to use CSS for cross page compatibility, wouldn't you guys say?
 
@Event_Horizon well, the OP never stated what the table was for, and there are plenty of legitimate uses for tables
 
<-- frantically hitting F5
 
@gorelative , i am serious , use native SQL for this
 
@rdlowrey Had a thought regarding unit testing stuff that relies on PHP internal functions like fopen or session_start, but it's probably a horrible abuse of PHP features. Wondered what you thought.
 
8:06 PM
@tereško yeah, i dont want to. My whole purpose of this is to learn Kohana.. as a result i am purposely using the ORM. :) otherwise i'd use query builder or straight sql but eh.
 
@Event_Horizon cross page compatibility doesn't mean much unless there is more than one use. if the style is only being used in one place, it doesn't make much sense to stick it in a style sheet imo
 
user895378
@GordonM I mock anything that relies on the file system with vfsStream ...
 
user895378
(like fopen)
 
If the class is in a namespace then just redefine the PHP function in question in that namespace for the unit test, so when the class under test calls session_start () it's actually a mock under your control instead of the real session_start.
Probably a terrible idea but thought I'd just run it by you guys first.
 
user895378
@GordonM I've seen that suggested that before, actually
 
8:08 PM
@gorelative , thing is , ORMs are pretty bad when i comes to complex joins
 
@tereško thats not a complex join. Its a simple one to one..
 
user895378
The problem is that if your code is designed correctly you should have an excruciatingly small number of test cases that actually need to mock session calls or things like remote http/ftp operations
 
does SO have email notifications of question answers?
 
user895378
@GordonM It just seems a little hacky to me to do that, but if it helps you test, go for it. I haven't personally used that tactic before.
 
@rdlowrey Wow, more positive reaction than I expected! And yeah, it feels really quite hacky to me too.
It's more of a "What if" idea. I can't see a technical reason why it wouldn't work, though it's not exactly pleasant.
 
8:11 PM
Is there a way to dynamically change the dbname of a PDO instance ?
 
user895378
Usually if you have code that's very hard to test it should be taken as a cue to do some refactoring. You should be able to get the "hard-to-mock-because-it's-a-native-function" cases down to a minimum and mock the behavior everywhere else.
 
Yeah, that's what I was thinking.
 
@dievardump i imagine it depends a bit on the DBMS. but really, if you have a different database, you probably ought to have a different connection
 
I'm just not sure you can modify the performance of non-public methods on a class with PHPUnit's mocking tools are you? I don't want to expose non-public methods as public just for the sake of testing.
 
@cHao It's what I was thinking after sending the message. Thanks
 
8:14 PM
If only php implemented a native session class, then you could just mock that and be done with it.
 
@rdlowrey So, when I redirect a get request, do I not pass query parameters or what?
I'm guessing I should send the URI exactly as it arrived in Location?
 
user895378
@LeviMorrison I agree. I would pass the exact same URI when redirecting
 
Hmm . . . what about POST requests?
I'm starting to lean towards not giving the content-body for these previous response . . . lol
 
Yo
 
Regex is gonna be the end of me. Anyone in the mood to help with a regex question?
 
8:25 PM
as long as it isn't about parsing html.
 
@NikiC The source for streams is confusing to such a noobish C developer like myself, lol.
I don't even know where to start asking questions.
 
@LeviMorrison Just be happy that you aren't looking at the iterator code :D
They say that the dual-iterator code was sent straight from hell
 
@NikiC lol
You mean like iterating an array OR an iterator?
 
I have this.....
`preg_replace("/([\w\.]+)\s?(=\s?|IN\s?\x28?)([\x20-\x7F]+)(\x29?)/","$1 $2?$4", $sql);`
It needs to parse this...
`WHERE id = 18 AND group_id = 5 AND group_ids IN('15', 'test text string (yeah you get the idea)','more strings') OR active = 5 LIMIT 1`
So it ends up like this...
`WHERE id = ? AND group_id = ? AND group_ids IN(?) OR active = ? LIMIT 1`
My issue is the ending ) in the IN() function. I can get everything else.
 
8:30 PM
@NikiC (If it were me I'd solve the problem by iterating over an array by using an ArrayIterator internally).
 
@LeviMorrison No, there is an internal concept of a dual-iterator, i.e. an iterator that wraps another iterator
 
bah. that's just as bad as parsing html.
stop it. lol
 
If I had a choice, I would
lol
I'm using RegExr and I just can't quite get it the way I need it.
 
@ImmortalFirefly Is this SQL condition coming from the user?
 
@LeviMorrison It'll be used in PDO with vars coming from the end-user yes.
 
8:32 PM
@ImmortalFirefly But is the user giving you SQL?
 
If it's not PDO, it's OOP killing me. If it's not OOP, it's regex.....
no, they aren't thank goodness
 
@ImmortalFirefly Then why on earth do you need to parse a SQL string?
 
@LeviMorrison For me. :) That was easy
 
@ImmortalFirefly . . . I'm confused.
 
I created a custom function using PDO where all I would do is supply the query I want and then it would parse it properly to use a ->prepare(), ->execute(), and finally a fetch() statement
but some of the variables could be user supplied.....and I'm trying to not let people go crazy
 
8:34 PM
@ImmortalFirefly Sounds like a terrible way to solve your problem.
 
@LeviMorrison Delivered with such tact...... you should be a funeral director
:)
 
Let me try to understand your situation a bit.
You don't want to have to write prepare, execute and fetch for every query.
 
we see enough people trying to do stuff they have no business doing...past the 63622nd one, you stop trying to be nice and just get to the point. :)
 
Maybe I'll get a pastebin up........
 
@ImmortalFirefly I think what you want is an abstraction layer known as a gateway . . .
 
8:38 PM
Yesterday it was dependency injection, today it's abstraction layers...... fun :) I love PHP
I think I've got it safe....... holding breath pastebin.com/5EJMGNuU
@LeviMorrison Make sense..... I'm sure it does(n't)
 
user895378
for the record, I HATE RAID.
 
@LeviMorrison The method that runs the regex is on line 26. Where the actual regex is is line 52 and 55.
@rdlowrey duly noted....
 
8:53 PM
Wow. Just found a way of killing the white space between inline blocks that just blows my mind.
Negative word/letter spacing on the wrapping element and normal word/letter spacing on its child nodes
Mind = blown.
 
@GordonM $myMind = 'intact';
 
Works in Firefox, Webkit and Opera too!
Can't test in IE though
 
nobody likes IE anyway
 

« first day (643 days earlier)      last day (4296 days later) »