« first day (531 days earlier)      last day (4417 days later) » 

3:00 PM
And I suppose __invoke doesn't work as a reflection function, so I'd have to ensure method_exists($obj, '__invoke'), correct?
 
Sam
the collaborative structure of SO is seems very amazing
 
@Sam oh, it's a life-saver alright.
@ircmaxell Even if I parse the file, how'd I find which is the right function?
 
Sam
@Christian yup.......more like a classroom for me.
 
@Christian getStartLine, getEndLine. You don't get more. :)
 
@NikiC lol, I was going to reply "yeah, it's line 10, 10 and uhm... 10 and 10" :D
 
3:03 PM
@Christian You can't distinguish those, I'd say
 
well, it's a bit annoying. Should have had getStartChar
 
I'd just assume that there won't be two functions on a line ;)
 
@Christian well, you'd need to check for that
 
If I were mad enough, I'd try to submit a patch to PHP homebase. Too bad I need that little remaining I've got.
 
why?
what's the use case for it
 
3:05 PM
If you're submitting a patch, make it a toSource() method :)
 
I can understand that sometimes there can be a use, but it's so minor that I'm not sure
 
@salathe Makes more sense.
 
actually if you were going to submit a patch, I'd do a ReflectionCallback() object...
 
@ircmaxell I can't see a use to getStartLine without a getStartChar ;)
@ircmaxell I just did, in PHP :P
 
eih, it doesn't keep track of startChar
 
3:07 PM
@ircmaxell Just had the same thought. Those I'm not sure how that should work. A better alternative would be having a factory creating the right Reclection* based on the passed callable
 
perhaps
ReflectionFactory::loadFromCallable(Callable $callback)
 
Though I doubt that you'll get a ->toSource() method. It would require PHP to keep the source in memory and nobody wants that much memory overhead for a rare usecase
@ircmaxell Uh, static :D
 
or have to re-parse the file in question...
@NikiC doesn't have to be static, just indicating it's a method
 
@ircmaxell How would that work? Reparsing wouldn't allow identifying the two closures on the same line ^^
@ircmaxell ah, okay :)
 
true
but you could include a startOffset in the tokenizing code, which would increase memory, but only by a single integer per token (which admittedly adds up)...
 
3:11 PM
@ircmaxell and you'd have to store that for all functions etc too :)
I don't even think you'd have to store it in the tokens
PHP is dirty anyways, so there's no problem accessing the lexer directly
 
Well, to re-parse it you would
 
I would agree with Anthony, it should be working over files...
 
@ircmaxell Well, just access LANG_SCNG(yy_cursor) while parsing and stop as soon as you find it ^^
 
oh good god
 
@ircmaxell :D
 
3:13 PM
It would work, but still...
 
But in the end, the effort is not worth it ^^
 
@NikiC You've lost me there...what's yy_cursor? I guess LANG_SCNG is the tokenizer?
@NikiC Considering the required effort and how it would make PHP fatter, I'd have to agree. :/
 
@Christian Don't worry about it, if you don't know, it's not worth knowing
 
@Christian LANG_SCNG is a macro to access the lexer globals through the TSRM :)
And yy_cursor obviously is the pointer to the current character ^^
 
@NikiC I think I'll take @ircmaxell's word for it.
 
So the current offset is yy_cursor - yy_start
@tereško That's the only sane thing to do
 
why would anyone call such a thing cursor??
 
because that's what it is
 
@Christian What @ircmaxell just said
 
I'd have settled for pos/position
 
3:19 PM
@Christian cursor is probably less common in the PHP work, as it doesn't use pointers where the term "cursor" makes slightly more sense.
 
Remember, a mouse indicator is called a cursor, but before that became common venacular, in the world of text-editors a cursor was the indicator for the position of the current character in a document (usually indicated by a highlighted block). It's still that way in VIM...
 
@ircmaxell Exactly, I don't think there's a blinking character inside PHP each time it runs a script ;)
 
No, but it needs to keep track of it just the same
 
@Christian C is from completly different planet comparing to PHP world.
 
@Donut I'll settle with that.
 
3:21 PM
Actually, I'd say that PHP is from the completely different planet
Cursor is also used in database quite extensively
 
PHP is the moon circling around the C world ^^
 
In computer science and technology, a database cursor is a control structure that enables over the records in a database. Cursors facilitate subsequent processing in conjunction with the traversal, such as retrieval, addition and removal of database records. The database cursor characteristic of traversal makes cursors akin to the programming language concept of iterator. Cursors are used by database programmers to process individual rows returned by database system queries. Cursors enable manipulation of whole result sets at once—a capability that most procedural programming language...
 
databases - the other different world
 
I approach it from the common vernacular is usually what's wrong. Think about how much of common phrase really fails to accurately describe what's happening
 
@ircmaxell Uhm, can you please rephrase that?
 
3:26 PM
@Christian +1
thinks about fixing lexing of nested heredoc strings
 
@Christian Common phrase is usually incorrect when you look at the original meanings
 
There are times I wished to have stayed longer in English Language classes.
 
3:40 PM
@Paul ok<
quick question I am making a contact form and I have my validation if in my php. when it sees the echo it print everything after it...
anyway will comeback later with the code
have a good day
 
Hey guys, sorry to ask in here, but most PHP people are pretty good at MySQL and i have been tearing my hair out over this. I've setup a DISTANCE function within MySQL which looks like: DISTANCE from POINT(51.524921 -0.087953) <= 0.002 this makes use of Glenth, LineString and GeomFromText this is meant to allow me to search within a certain distance. In the above example: 0.002. But what UNIT is 0.002 in? I cant see it anywhere, is it miles, meatres, feed, inches, nanometres?
i have been trying for ages to work out what this unit is. Hopefully someone has done this before and can help me. As i've exhausted all current options
 
user895378
@Andy "I've setup a DISTANCE function" ... If you set up the function, how do you not know what it does? Do you really mean, "I'm using a function I found online somewhere" ? :)
 
user895378
In a related note: Sorry. I don't even try on Fridays.
 
3:55 PM
ha, ok, yes i created a function based on what i found online, annoyingly the mysql native DISTANCE function doesnt actually work - or rather, so i've been told. I found the function here: codeutopia.net/blog/2011/02/19/using-spatial-data-in-doctrine-2
an example query looks like: SELECT count(a0_.Id) AS sclr0 FROM addresses a0_ WHERE a0_.Deleted IS NULL AND GLength(LineString(a0_.Location, GeomFromText([this is the current POINT]))) <= 0.5
so i'm using GLength with LineString as the calculator, but i have no idea what 0.5 is.
 
Hello, back again : I got problem with this code, it print everything after the first echo ::
                  if ($_POST['submit']) {
                    if ($name != '' && $email != '') {
                      if ($human == '4') {
                        if (mail ($to, $subject, $body, $from)) {
                            echo '<p>Your message has been sent!</p>';
                        } else {
                          echo '<p>Something went wrong, go back and try again!</p>';
                        }
 
@rdlowrey Its just turned Saturday here, I'm almost happy not to even try too.
@Andy If you have two Lat/Longs you could perhaps use the great circle distance approximation.
 
Ideally what i'd love is a PHP function that, when given a lat and long and distance ( in miles ) will return me an array of MAX and MIN lat and Long ranges which i can use within the database like: where (lat < $lat_man and $lat > $lat_min) and (long < long_max and long > long_min )
but i have yet to find a good example of that function and my maths is a tad rusty/shit to do what i need
 
user895378
@Delarn You need to ask a real question if you want real help. Try to avoid the pitfalls mentioned in this article and you'll have more success
 
@Paul I have a PHP function that can give me the distance between two points, using the Haversine formula which works ok, but i cant really use this in a real world example. i.e. it's not worth me selecting all then filtering on this function.
 
4:00 PM
ok sorry... I don't know php, I am makinga contact form and I am implementing it... I can't solve the problem because I don't know how to spot it.
 
i'd love to be able to do: where Distance(location, POINT(X,Y)) < 5 miles || < 5 Kms || < 5 metres
 
@rdlowrey thanks I'll keep that in mind
 
user895378
@Andy Did you try googling mysql distance between coordinates?
 
@Delarn I don't see any reason why it would be doing what you are saying. you seem to have closed your echo ok.
 
@rdlowrey yes, as well as stackoverflow and all sorts
 
4:02 PM
@paul I am testing the file localy ... It may be the problem?
 
user895378
@Andy I only ask because the the results on that search page show exactly how to do it ...
 
@paul I DO NOT want to do: (((acos(sin((".$latitude."*pi()/180)) * sin((Latitude*pi()/180))+cos((".$latitude."*pi()/180)) * cos((Latitude*pi()/180)) * cos(((".$longitude."- Longitude)*pi()/180))))*180/pi())*60*1.1515) as distance FROM MyTable WHERE distance >= ".$distance."
 
user895378
My Stack Overflow philosophy: SO helps those who help themselves.
 
yes they do it the way which is HEAVY on db load, which i dont want. Unless i've missed something. Finding distance between 2 points isnt the issue. FInding all points within 5 minles of a lat long is what i'm after
 
I have digged out my old php book ... it date when php4 got out
 
4:04 PM
@Delarn Just to be clear, you see the following in the output?
<p>Your message has been sent!</p>';
                        } else {
                          echo '<p>Something went wrong, go back and try again!</p>';
                        }
 
@rdlowrey i am here as a last resort. I only come to SO chat when i have no other options. Believe me when i say i've tried all sorts. Everything gets complicated for me as i'm also using Doctrine 2.2.1 but that should affect what i'm trying to do
 
user895378
@Andy Ah I see. In that case knock yourself out with questions :)
 
user895378
Hmm ... weird ... I thought ORM's were supposed to make your life easier :)
 
it print that (copied from the index.html) Your message has been sent!
'; } else { echo '
Something went wrong, go back and try again!

'; } } else if ($_POST['submit'] && $human != '4') { echo '
You answered the anti-spam question incorrectly!

'; } } else { echo '
You need to fill in all required fields!!

'; } } ?>
 
ok, so, to repeat :) i'm trying to be able to search for all locations (mysql datatype POINT) within X Miles of a Lat Long combination. I would much prefer to have a PHP function which can give me upper and lower lat long ranges for the searching within the database. As it removes load from the server and it's easier for me to undestand when things break
 
4:07 PM
@Andy are you ok with approximations?
 
@paul and I did not press on submit
oh is the code supposed to be inside or outside of the form?
 
@Delarn I'm guessing you missed a ' character somewhere. Or you have php code not within <?php I'd have a good look for those.
 
@paul it doesnt have to be perfect. I think the largest range will probably be 100 miles. So i dont think we need to worry about the elliptical nature of the earth.
 
ok I'll check ... thanks @paul
 
@Andy at a given latitude the number of degrees in latitude to move 5miles is roughly the same
 
4:11 PM
@Paul to be clear, if we search within 100 miles and get a result that is 102 miles then i dont care, if it returns 140 miles then that isnt ideal.
@Paul although i can always do an additional sanity check with my own Distance calculation
 
@Andy Yes, I am just checking because I did something similar to this ages ago.
 
@Paul ohhhhh i hope you can help, this has taken days. Why oh why are people so happy to do this calculation using that crazy sql i posted earlier. According to some posts it's like 10x slower than any other way
crazy no?
 
@Andy ahh, yes. I compared it to a box of +/- lat long. That was based around a small geographic area though. It was only for Vancouver area.
 
add to that my lack of being able to search and you get to a situation where you can't find a solution to the problem that is sensible for a real world product
@Paul well for now that would do, what was the upper range? I have some Maths peeps i can talk to and could change this to work for me.
im based in london so at the least this has to work within 20 miles.
 
@Andy Then I used a modified Haversine function because you can simplify it if you aren't using points on the opposite side of the earth.
 
4:19 PM
@paul everything is good ... it's a wtf moment...
 
@Paul that's exactly what i'm planning to use to 'streamline' the process. i.e. make 100% sure it works
@Paul seems you and I had the same idea.
 
@Andy Here is a pastebin of some code. I'd rewrite it differently now, but that was me a few years back. pastebin.com/TQs0tbCD
 
@paul I changed the <?php ?> for a <script type="php> </script> and the printed echo disapeared...
 
damn .. sometimes i feel unappreciated
 
@Paul this is the haversine function for distance between 2 points which i already have. Do you not have the function, pseudo code, blog post, maths to "Create max and min lat long ranges from lat, long and distance"
@Paul - how rude of me, firstly ( although secondly now ) thanks for the pastebin
 
4:25 PM
@tereško why, would you like to help me out?
 
@Delarn A pastebin of the entire code would probably reveal a lot. Here is a good thing for you to read: codinghorror.com/blog/2006/01/flattening-arrow-code.html
@Andy I'm struggling to remember, but I do know that what I ended up with was: Pulling from the database everything that fitted within a constant +-lat and another constant +-long. This was generous to avoid misses. I then used the modified haversine to make sure everything was fairly accurate (given all the approximations in the modified haversine).
 
I missed a }
AAAAARRRGGHHHHH even with the missing } it still print it !!!
 
thanks
 
@Delarn paste your code here pastebin.com so that we can check it
 
4:42 PM
goodnight all
 
user895378
@Paul Later dude
 
@rdlowrey btw, I have been noticing good things within Artax. keep up the good work.
 
user895378
@Paul Thanks! I've eaten, breathed and dreamed it over the last two days. Got a sweet dev branch shaping up for the HTTP side of things. Might be consulting you for some HTTP questions soon.
 
@JamshidHashimi , i kinda doubt that you would want to .. this was the fragment he showed : chat.stackoverflow.com/transcript/message/3126297#3126297
damn .. cat took my object graph , and now she is sleeping on it
4
 
5:21 PM
@tereško I sent something out on PHP webmasters about the JavaScript.
They believe it's fine.
That is the real problem.
 
what would unit testing views look like? or is it kind of pointless?
 
@AndyPerlitch Testing views is important under certain circumstances.
From what little I've seen, it is usually done via testing the end result with Selenium or the like.
 
No, that's not unit testing
 
@ircmaxell Correct.
 
5:29 PM
Unit testing views is very difficult, if not impossible. The only way to really do it, is if you're using a templating engine that you can hook your unit tests into (to verify that the tokenized output matches what you expect). But you shouldn't test the template yourself
 
ok so basically just use tools like selenium to test views in a "functional testing" way then
 
yes
 
cool thanks guys
 
@tereško Also, my new favorite snippet from prototype.php.net/js/common.js:
$(".docs div[id] > h1, .docs div[id] > h2, .docs div[id] > h3, .docs div[id] > h4").each(function(){
    $(this).append("<a class='genanchor' href='#" + $(this).parent().attr("id") + "'> ¶</a>");
});
$(".docs .methodparam .parameter").each(function (idx, node) {
    $(".parameters .term i > tt.parameter").each(function (idx, param) {
        if ($(param).text() == $(node).text().substring(1)) {
            $(node).click(function() {
                $.scrollTo($(param), 800);
            });
        }
Let's see how many times we can find all the .docs, shall we?
 
actually one other question then, if views dont get unit tested, is it kosher to use say a helper class that has static methods for forming html (inputs, links, script tags, etc), as long as you ONLY use the helper class in views?
 
user895378
5:33 PM
@LeviMorrison Your Tokenizer is $$$. I've been on a crazy 48-hour coding binge ... checkout the results on the dev branch. Full support for Closure controllers with provisioned dependencies, event callbacks for configurating controllers before invocation as well as their return values after invocation. Example
 
I built a CSS parser for fun
 
user895378
Well, technically there was some sleeping during those 48 hours.
 
.foo:not(.bar) something[id=af] else#foo .baz gets converted to:
object(PHPCSS\Parser\Nodes\Selector)#12 (1) {
  ["nodes":protected]=>
  array(7) {
    [0]=>
    object(PHPCSS\Parser\Nodes\Attribute)#3 (3) {
      ["name":protected]=>
      string(5) "class"
      ["combinator":protected]=>
      int(5)
      ["value":protected]=>
      string(3) "foo"
    }
    [1]=>
    object(PHPCSS\Parser\Nodes\Negation)#4 (1) {
      ["selector":protected]=>
      object(PHPCSS\Parser\Nodes\Selector)#6 (1) {
        ["nodes":protected]=>
        array(1) {
          [0]=>
 
@ircmaxell nice
 
it also includes a tokenizer:
array(19) {
  [0]=>
  array(3) {
    [0]=>
    int(20)
    [1]=>
    string(1) "."
    [2]=>
    int(0)
  }
  [1]=>
  array(3) {
    [0]=>
    int(8)
    [1]=>
    string(3) "foo"
    [2]=>
    int(1)
  }
  [2]=>
  array(3) {
    [0]=>
    int(13)
    [1]=>
    string(1) ":"
    [2]=>
    int(4)
  }
  [3]=>
  array(3) {
    [0]=>
    int(8)
    [1]=>
    string(3) "not"
    [2]=>
    int(5)
  }
  [4]=>
  array(3) {
    [0]=>
    int(15)
    [1]=>
    string(1) "("
    [2]=>
    int(8)
  }
  [5]=>
 
5:37 PM
@rdlowrey I think you picked poor symbols for shortcuts. # should be for number, because, well . . . it should be obvious.
 
user895378
@LeviMorrison Haha those are simple to change. I just blindly threw them in :)
 
@LeviMorrison They're being pragmatic, if someone wants to come along and fix it then awesome. If someone just wants to come along and bitch that the code is "absolutely horrid", then thank you but move along.
 
user895378
@LeviMorrison I was just trying to get things working, now is the part where you say, "let's change this to that, etc" and I say, "sounds good to me" :)
 
@salathe I came off too strong, I admit. However, you have to admit it is pretty awful and it is a concern. I've been committing things to web and working on other aspects or I would do it. There was a message trying to push this to completion so I was intending to send out a call for help on that particular area.
I'll probably end up fixing it myself.
@rdlowrey lol
 
@LeviMorrison "the code sucks, can anyone fix it" is not a call for help!
 
5:42 PM
@salathe It does suck. If you know anything about JS and jQuery then it is absolutely, blatantly obvious.
 
@LeviMorrison I'm not disagreeing with you at all.
 
Honestly, I was a bit polite as far as the overall awfulness of the code.
Apparently the PHP community is a bit more sensitive than I would have thought.
 
I'm disagreeing with your choice of mailing to the list "the code sucks, I won't fix it, someone please do it burns my eyes it's so awful" (not a quote).
 
@salathe Did you see the other messages trying to push this thing to completion? I actually took that call to help and have been working on improving the UX, but I don't have time to fix this problem. It's very possible nobody knew it was a problem.
I could have been more polite, sure.
But considering how bad the code is, I was pretty polite.
 
@LeviMorrison it's not a problem, the JS works.
 
5:45 PM
@salathe Poorly, in my opinion.
I'm not sure who designed the menu interaction, but it is a UX nightmare.
 
@LeviMorrison And in mine, but fix it or move along. I think you're being overly concerned with making something pretty rather than making something work.
 
@salathe Perhaps, but what I've been seeing is an apathy for good craftmanship.
 
@LeviMorrison As with most of the prototype, I don't think anyone designed the menu interaction at all.
@LeviMorrison You're surprised by that? You have seen the phpweb code...
 
YEEEEEEEEEAAAAAAAAAAAAAAAAAHHHHHHHHHH!!!!!!!!!! HI ALL!!!!! WEEEEEEEEKEEEEND!
:)
 
in JavaScript, 27 secs ago, by Neal
: http://stackoverflow.com/q/9947931/561731
 
I'm seriously thinking about dropping my Spring term classes to work on the php website. I'm a bit tired of school and could use a 2 month break.
@rdlowrey By the way, how much did you modify my Tokenizer? A lot?
I'm curious :)
 
user895378
@LeviMorrison I only modified the Tokenizer to allow it to accept a file path -OR- an already open file stream.
 
user895378
I created a Token class and created a RouteList class that accepts a TokenizerFactory so it can load routes from an array or Traversable in addition to a file/stream
 
user895378
The RouteList class does the parsing ...
 
5:56 PM
I'm looking at src now.
 
@LeviMorrison "php webmasters" ? whats that ?
 
They have a mailing list.
php-webmaster@lists.php.net
 
oh , it's about the prototype
ehh
 
@tereško nothing is cleared there. Where that code is located? inside form, outside form, different page?
 
@rdlowrey So, we should probably have multiple Tokenizer classes to be really polymorphic kosher.
 
6:05 PM
@LeviMorrison , how was the "professional design" idea taken ?
 
@tereško I didn't suggest that one yet.
 
user895378
@LeviMorrison Yeah, I just hacked that up to make it work
 
@tereško Needs to be carefully worded, I think.
 
user895378
@LeviMorrison It would be preferable to have multiple Tokenizer classes and then the RouteList parser can use a factory to instantiate the appropriate one for the appropriate action. I figured I'd save that for you :)
 
@rdlowrey Also, I think I misunderstood the Iterator::valid semantics when I wrote that.
I had been up a long time when I wrote it.
I think I wrote it as "Are there more tokens?" instead of "Are we in a valid state?"
 
user895378
6:07 PM
I didn't really look at the innards of it, I just made sure the parser worked with what it got back from the Tokenizer ...
 
user895378
Hey, it's a "dev" branch :)
 
@LeviMorrison , here's a careful wording for you : colorblind geeks who thing that mouse is a funny idea, should not be making web designs
 
@tereško Yeah, they'd never go for it if it was worded like that.
 
user895378
@LeviMorrison The way the Route class works, any "shortcuts" are "compiled" into a usable regex when the class is instantiated. It's trivial to change/add any of those.
 
user895378
6:12 PM
#var    (hash)    (integer \d+)
:var    (colon)   (alpha [a-zA-Z]+)
=var    (equal)   (alphanumeric [a-zA-Z0-9]+)
 
user895378
how about those ^
 
@rdlowrey , where did you steal that idea from ?
 
user895378
@tereško @LeviMorrison
 
user895378
Wait, which idea?
 
> #var (hash) (integer \d+)
this one
 
# => \d+
: => [a-zA-Z0-9-_]+
Those for sure.
 
user895378
@tereško That's not a format definition it's just explaining regex shortcuts in the Route definitions ...
 
@ircmaxell , that a purely american joke
 
user895378
@LeviMorrison Oh right, I left out _
 
And -.
 
user895378
6:16 PM
And -.
 
user895378
:)
 
@rdlowrey , yes , i am not mentally deficient .. im just asking did you come up with this on you own , or stole the idea
 
@tereško No, not at all. It's a human joke. What human doesn't love bacon?
 
user895378
@tereško Hehe okay ... it was @LeviMorrison's idea, so you'll have to ask him
 
@ircmaxell Vegans and vegetarians and animal rights activists.
 
user895378
6:17 PM
@ircmaxell lol
 
also muslims
 
@LeviMorrison Well, then by definition they are not humans, are they.
:-P
 
user895378
and jews
 
and a lot of people who dont like high-fat diet
 
@ircmaxell I was vegan for a while, but not because of all the 'moral' reasons. I just wanted to try the diet.
I actually liked it, but it was hard
 
user895378
6:18 PM
Sadly, if I were forced to choose between Heaven and bacon ... well queue me up for a sad afterlife.
 
so .. your "everyone loves bacon" is kinda narrow-minded idea
=P
 
@tereško Not in the least
 
Basically, other routing systems had a regex shortcut for something similar to `[a-zA-Z0-9._-]+`, but sometimes you need a more specific definition. For example:
`GET /user/#id`
`GET /user/:username`
 
user895378
It annoys me how you don't get code formatting when sending multi-line messages ...
 
6:22 PM
@rdlowrey Same.
 
agree
 
user895378
=var    (equal)   (alphanumeric [a-zA-Z0-9_.-]+)
 
@ircmaxell , i failed to notice any mentions of places outside north america
 
user895378
@LeviMorrison I like the idea of a shortcut to specify between alphabetic chars only and alphanumerics. Do you think that's unnecessary, though?
 
@rdlowrey Not sure. If we really wanted to be awesome, we could let users define their own shortcuts . . .
lol
> Push Button, Receive Bacon is a catchphrase often found in public restrooms under graphic instructions typically found on hand dryers. The phrase’s earliest documentation defacing a hand dryer dates back to August 2004, found at Brigham Young University in Utah. Since, the squiggly red lines that represent warm air in pictorial instructions have become synonymous with bacon.
 
6:25 PM
 
user895378
@LeviMorrison That's a little overboard, IMHO. You can write your own regex if you need customization. No need to create another regex language.
 
user895378
You can simply do:
 
user895378
GET /test/(?P<id>\d+) MyController
 
user895378
And the $id parameter in your closure controller or class method will receive the value from a matching URI
 
user895378
That's equivalent to:
 
user895378
6:27 PM
GET /test/#id MyController
 
user895378
Or will be equivalent when I alter the shortcut definitions in a minute
 
user895378
shortcut   constraint      regex component
========   ==========      ===============
/#var      (integer)       /(?P<var>\d+)
/:var      (alphanumeric)  /(?P<var>[a-zA-Z0-9_.-]+)
/=var      (alpha)         /(?P<var>[a-zA-Z_.-]+)
 
user895378
@LeviMorrison Speak now or forever hold your peace.
 
Uh . . .
sure
I like the first two, don't really care about the third.
 
user895378
And by forever, I mean it can be changed at any time
 
6:38 PM
lol
@rdlowrey By the way, it's really nice to have someone to collaborate with. Thanks for agreeing to come to chat to discuss that one question.
 
Hello,
Does anyone have any idea about this?
http://stackoverflow.com/q/9947827/376535
 
user895378
@LeviMorrison Yeah I'm with that. It's especially nice for me considering I don't work in an office with other programmers. My only interaction with other people in the field comes online. Thanks for the original invitation. I might never have discovered SO PHP chat otherwise!
 
user895378
@Shiplu I'd suggest ImageMagick, but I'm not terribly knowledgeable on the subject of PHP image manipulation ...
 
user895378
@LeviMorrison I'm just going to kill the third one. Ease of use is the goal. The more shortcuts you have, the more "frameworky" things get and you start having to learn a whole new language to accomplish things. Probably better to follow the KISS principle and just stop at the original two.
 
@rdlowrey Just enough help to be helpful, not so much that the learning curve is undesirable.
 
user895378
6:47 PM
@LeviMorrison Right. I just imagined myself walking onto a project that had a whole slew of custom regex shortcuts and having no idea how one route differed from another. Or worse, accidentally confusing one shortcut for another and allowing parameters that you shouldn't to route to the wrong controllers
 
@rdlowrey Sadly I won't be programming at all this weekend.
 
user895378
@LeviMorrison Alas. In I think 9 days I'm going to Ireland for a week for my sister's wedding. I'm trying to get as much done as possible before that.
 
7:04 PM
@rdlowrey I have a programming project due next week as well, so I might not program on Artax next week either.
Sad day.
 
user895378
It's no problem. It's an ongoing thing. I had a question I wanted your input on. One sec
 
user895378
Closure controller definitions are optional as the Router expects to find a class with the same name as the Route target controller. So they aren't required for the Router to function. For this reason they aren't listed in Router::__construct as dependencies and the Router::register and Router::registerAll methods exist to add Closure controllers for specific Route targets.
 
user895378
So my question is, do you think Router::__construct should require a Traversable list of Closure controllers in the same manner as it requires a Traversable list of routes?
 
Let me reread that.
 
user895378
7:09 PM
And subsequently do away with the register and registerAll methods?
 
user895378
 
First: Why closures instead of callables?
 
user895378
@LeviMorrison It saved some work :) ... I feel like I had some good reasons at the time for only allowing Closures ... but it was also very late at night
 
Ah, nothing like late-night work.
 
user895378
First, do we really want to allow people to make the mistake of having static method controllers? Or global function controllers?
 
user895378
7:15 PM
Which leaves array-style callbacks [$instance, 'method'], invokable objects and Closures
 
But how do we instantiate a class when we don't know what dependencies we need?
I think we'll have to couple the router and the target class in some way.
 
user895378
@LeviMorrison I've handled it, actually. In a non-evil way.
 
user895378
And it's not a Service Locator. It's done in the same way as lazy-class event listeners are provisioned.
 
github is slow today.
Or my network is.
 
user895378
It only requires one brief use of Reflection. I know you said you weren't a fan of the Reflection solution but the one I've implemented is (1) not slow (as per much profiling with kcachegrind) (2) and solves ALL the routing issues extremely well.
 
7:19 PM
Yeah, definitely my network.
 
user895378
What I have also allows you to implement "fat" controllers if you want to and have a single controller class method handle multiple types of things (which I originally said I preferred to avoid). So, it may be worth altering the tokenizer to allow multiple HTTP methods for a single route as well.
 
@rdlowrey That was planned, actually
 
user895378
@LeviMorrison Yeah, at about 2am last night I found myself thinking, "it would be sweet if the Tokenizer gave me back GET|POST|PUT for the httpMethod" because when the Route is instantiated it's a simple thing to split into an array ... etc
 
I originally had the route take an array of methods for its constructor.
@rdlowrey Any reason you are doing:
use Iterator,
RuntimeException;

Instead of multiple use statements?
Looks odd to me. Maybe I'm crazy.
 
user895378
@LeviMorrison I just visually liked the indentation with a single use statement. But there's no real reason.
 
user895378
7:34 PM
How the Router generates the arguments that will be passed to the controller:
 
@ hello everyone
 
user895378
(1) use the controller's default parameter value for any parameters that aren't specified by the URI-Route match,
(2) use the values from the URI for any parameters that were matched
(3) automatically provision any typehinted object parameters using the dependency container,
(4) pass a NULL for any other parameters
 
user895378
@LeviMorrison ^
 
@rdlowrey Bueno.
 
user895378
@LeviMorrison I know you're probably doing other stuff ... I'm just posting this so you can reference if needed :)
 
user895378
7:41 PM
Those 4 steps happen whether the target controller is MyClass::get or a lambda function(Request $request, $id) {}
 
life was so much better when the only asked "how can i make a blog"
0
Q: php code generator for mysql

KostasI have a database, but my scripting/coding knowledge is really poor. What I would like to do is, code a search engine for my MySQL database in PHP. My database is very simple structured with only few fields. Is there a program that codes that kind of stuff for me? Something along the lines of "...

 
@rdlowrey I'm actually pushing some stuff right now.
 
user895378
@tereško lol "Is there a program that codes that kind of stuff for me?"
 
hey people what you think about ROR technology
 
RoR is versatile
 
7:45 PM
@rdlowrey So, I can't push. Something about non-fastforward.
I definitely pulled before changing anything.
I actually did a new clone of the whole thing . . .
 
@abysslogic hmmm
 
user895378
@LeviMorrison I've been uploading stupid documentation changes and stuff in the last few minutes
 
user895378
@LeviMorrison Go ahead and do a git push -f origin dev
 
@abysslogic I need bit Information about portal development if you can help me with that :) please
 
I dont know RoR at all, I just know what its capable of
 
7:46 PM
@rdlowrey It worked now. Just did a pull and thankfully we didn't modify the same files.
 
user895378
@LeviMorrison I'll re-merge any of my documentation changes from another branch after I pull your changes.
 
You'll need to do a pull
 
user895378
Okay, one sec
 
@abysslogic its not about ROR, its just simple web developement related questions
 
Im just here to get some help on putting PDO queries within other class objects
 
7:47 PM
oh okay i let you carry on with that then i rather ask a question :) , cheers
 
im no expect but i can try
expert*
anyone here good with OOP, I am trying to put a simple PDO query / fetch within another PDO generated object
 
@abysslogic Give us what you've tried.
 
the code might take up a bit of space here if thats what you're asking
 
Link it then.
@rdlowrey By the way, having a global exception handler is sooooo nice.
 
user895378
@LeviMorrison Yeah tell me about it! Did you see how I used it in the listener definitions file? github.com/rdlowrey/Artax-Http/blob/dev/examples/…
 
7:57 PM
Hi all
 
@rdlowrey I hadn't, but I like it.
 
user895378
... Allowing you to send out a 500 error anytime an unexpected termination happens. It's pretty sweet.
 

« first day (531 days earlier)      last day (4417 days later) »