News for hackers. Stuff that matters.
Re:Twitto: A web framework in a tweet by dchest on Friday March 06, 2009 @03:18PM (#505899)
How about (secure?) OO version (with no error handling)?

  $c=new ReflectionClass('co');$m=$c->getMethod($_GET['m']);if($m && $m->isPublic()){$i = $c->newInstance();$m->invoke($i);}
Example usage:

  <?php
  // "Framework"
  $c=new ReflectionClass('co');$m=$c->getMethod($_GET['m']);if($m && $m->isPublic()){$i = $c->newInstance();$m->invoke($i);}

  // Controller
  class co 
  {
  	public function index()
  	{
  	    echo "index!";
  	}
  
  	public function test()
  	{
	    echo "yes, it's test.";  
  	}
  }
  
  ?>
Call:

example.com/?m=index example.com/?m=test

Re:Twitto: A web framework in a tweet by dmoney on Tuesday March 10, 2009 @11:24PM (#511224)
How about (secure?) OO version

Nice. You should call it TwitOO.

Re:Twitto: A web framework in a tweet by tptacek on Friday March 06, 2009 @12:01PM (#505649)
I'd have been more impressed if he also write a 2-line ORM based on SQL statements fed from browsers.
Re:Twitto: A web framework in a tweet by tlrobinson on Friday March 06, 2009 @01:44PM (#505786)
I was going to give you a lecture on why that's a ridiculously bad idea. Then I noticed your username. Then I went back and looked at the code. I see now.
Re:Twitto: A web framework in a tweet by tptacek on Friday March 06, 2009 @02:57PM (#505878)
Mine is a subtle humor.
Re:Twitto: A web framework in a tweet by nate on Friday March 06, 2009 @12:01PM (#505648)
love this line: » TWITTO IS NOT SECURE, DON'T USE IT FOR YOUR NEXT WEBSITE «
Re:Twitto: A web framework in a tweet by Hexstream on Friday March 06, 2009 @12:27PM (#505680)
Yeah, because you see, Twitto is a web framework you can't use for web development. That makes it the coolest web framework around.
Re:Twitto: A web framework in a tweet by there on Friday March 06, 2009 @02:46PM (#505872)
but you may use it for your current website
Re:Twitto: A web framework in a tweet by kenver on Friday March 06, 2009 @01:21PM (#505754)
For some reason that warning makes me want to build something with it even more!
Re:Twitto: A web framework in a tweet by paul_houle on Friday March 06, 2009 @12:56PM (#505717)
this is why i like hacker news: anything about PHP gets downvoted into oblivion on reddit.
Re:Twitto: A web framework in a tweet by nir on Friday March 06, 2009 @03:59PM (#505940)
One of the symptoms of Reddit's takeover by the same kind of idiots that comment on YouTube was the knee jerk downmod of any non-derisive mention of PHP. I hope the fact the parent comment is downmodded so quickly doesn't mean those people have arrived at HN too, now.

IMHO, attitude towards PHP is a great way to tell if someone really codes or just quotes the current hype. People that actually build stuff appreciate PHP's ease of deployment and scaling, even if its weaknesses make many coders (self included) choose other tools most of the time.

Re:Twitto: A web framework in a tweet by kragen on Friday March 06, 2009 @07:50PM (#506178)
Maybe the parent comment was downmodded so quickly because it adds nothing to the conversation (except self-congratulation).
Re:Twitto: A web framework in a tweet by sho on Friday March 06, 2009 @05:54PM (#506065)
"IMHO, attitude towards PHP is a great way to tell if someone really codes or just quotes the current hype. People that actually build stuff appreciate PHP's ease of deployment and scaling"

I don't agree with this. Yes, everyone knows PHP is easy to deploy, and it's faster than the ruby/pythons etc. But it's an ugly mess with a long history of security problems and a design that flows against the principles of well designed architecture. I know plenty of people who "really code" and abhor PHP.

I know what you mean about "trendy" language snobbishness being a hallmark of someone who doesn't actually know what they're talking about, but in PHP's case I think there is a case for informed people having strong, negative opinions.

Doesn't excuse the Reddit behaviour, of course, I don't miss that one bit. Just sayin'...

Re:Twitto: A web framework in a tweet by ahoyhere on Saturday March 07, 2009 @03:19AM (#506377)
Or maybe it's just because they spent lots and lots of hours doing things that made PHP (and thus them) cry.

When you spend every day for months writing methods like __get and __set and so on, and try to work around the other busted aspects of the object model, it can get to you.

Re:Twitto: A web framework in a tweet by Hexstream on Friday March 06, 2009 @04:06PM (#505945)
Moot point. We can't downvote submissions here.
Re:Twitto: A web framework in a tweet by nir on Friday March 06, 2009 @04:08PM (#505950)
Yeah, but there's a distinct difference between the way this is handled in HN and the automatic "Beh, PHP!" in Reddit.
Re:Twitto: A web framework in a tweet by antirez on Friday March 06, 2009 @04:39PM (#505985)
too bloated, but nice hack
Re:Twitto: A web framework in a tweet by Andys on Saturday March 07, 2009 @12:23AM (#506307)
It doesn't scale, either
Re:Twitto: A web framework in a tweet by pierrefar on Friday March 06, 2009 @01:02PM (#505726)
I thought Perl was supposed to be the king of really low char count code!

(Sorry for the alliteration.)

Re:Twitto: A web framework in a tweet by simonista on Friday March 06, 2009 @09:53PM (#506242)
One should never apologize for alliteration. It is a joy to stumble upon.
Re:Twitto: A web framework in a tweet by mrfish on Friday March 06, 2009 @12:04PM (#505652)
So what exactly would I use this for. Aside from shitting myself with geeky-ness
Re:Twitto: A web framework in a tweet by treo on Friday March 06, 2009 @12:19PM (#505671)
I think the point is that PHP is a web framework by itself and there is no need for a fancy framework around it.
Re:Twitto: A web framework in a tweet by jonursenbach on Friday March 06, 2009 @10:31PM (#506255)
You shouldn't be using it for anything.
Re:Twitto: A web framework in a tweet by loincloth on Friday March 06, 2009 @12:06PM (#505656)
cute