News for hackers. Stuff that matters.
Re:How I Build PHP Applications by robryan on Friday April 23, 2010 @10:49AM (#1288180)
Similarly to the author I don't use any frameworks, well except JQuery for front end and XTemplate for templates. Main reason being when I'm a lone developer I prefer having stuff I'm comfortable with and understand back to front. I'm sure I could get this from a good framework that doesn't have a lot of linking between parts but I'll admit I haven't put a lot of time in to try and find this.

The more I learn about PHP internals the less confidence I have in the language. The main things holding me to the language is comfortableness with the syntax- been using it for years can code very quickly in it, understand a lot of the functions and extensions I would want to use normally and a good feel for what will run fast and what won't.

The being said I would like to learn a ruby/python like language when I get the chance, I have previously done web stuff in .NET and Java but much prefer PHP over those for my uses.

Re:How I Build PHP Applications by steveklabnik on Friday April 23, 2010 @10:58AM (#1288214)
If you do get the chance, check out Ruby and Sinatra. The whole source is only roughly 2000 lines of code, but it gives you just a very minimal level of abstraction over HTTP.

Here's "hello world" in Sinatra:

    require ‘rubygems’
    require ’sinatra’
    get ‘/hi’ do
      “Hello World!”
    end
... That's it. It's cool stuff.
Re:How I Build PHP Applications by armandososa on Friday April 23, 2010 @02:14PM (#1288982)
Or try Microbus

    if(get("hi")){
        echo "Hello World";
    }
http://github.com/soska/microbus

(I know… I always feel bad with self promotion)

Re:How I Build PHP Applications by mixmax on Friday April 23, 2010 @01:37PM (#1288827)
And here it is in PHP:

echo "Hello world";

One line. Just saying....

Re:How I Build PHP Applications by cmelbye on Friday April 23, 2010 @01:57PM (#1288905)
Except not at all. Your example doesn't handle a clean URL like "/hi" (it would be something like "/hi.php" at best in PHP). Furthermore, it doesn't force the GET http request type, which is a major part of the Sinatra microframework. I can setup a Ruby script that outputs "Hello World", but that would miss the point entirely.

EDIT: Also, the original ruby example could be condensed to one line as well:

  get "/hi" { "Hello world" }
Run with ruby -rsinatra script.rb
Re:How I Build PHP Applications by rikthevik on Friday April 23, 2010 @12:04PM (#1288430)
CherryPy is a good place to start as well.