

Twitto: A web framework in a tweet - kenver
http://twitto.org/

======
dchest
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

~~~
dmoney
_How about (secure?) OO version_

Nice. You should call it TwitOO.

------
tptacek
I'd have been more impressed if he also write a 2-line ORM based on SQL
statements fed from browsers.

~~~
tlrobinson
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.

~~~
tptacek
Mine is a subtle humor.

------
nate
love this line: » TWITTO IS NOT SECURE, DON'T USE IT FOR YOUR NEXT WEBSITE «

~~~
Hexstream
Yeah, because you see, Twitto is a web framework you can't use for web
development. That makes it the coolest web framework around.

------
paul_houle
this is why i like hacker news: anything about PHP gets downvoted into
oblivion on reddit.

~~~
nir
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.

~~~
sho
_"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'...

~~~
ahoyhere
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.

------
antirez
too bloated, but nice hack

~~~
Andys
It doesn't scale, either

------
pierrefar
I thought Perl was supposed to be the king of really low char count code!

(Sorry for the alliteration.)

~~~
simonista
One should never apologize for alliteration. It is a joy to stumble upon.

------
mrfish
So what exactly would I use this for. Aside from shitting myself with geeky-
ness

~~~
treo
I think the point is that PHP is a web framework by itself and there is no
need for a fancy framework around it.

------
loincloth
cute

