PHP初学者:获取可用路由

I'm a Rails developer and I just inherited a PHP project with no documentation. Is there a way I can find the hooks of the project? Like available routes and the like? And is there a console equivalent? Sorry for the broad question, really no idea where to start.

Thanks!

PHP == Ruby

PHP =! Rails


If you want to look at the routes for the PHP app, you'll have to look at what framework it uses. Only frameworks can provide a dynamic routing structure, as they capture the request & process on the backend

There are several "rail-like" frameworks in PHP, two of the top being:

  • CakePHP

    Basically a clone of Rails. This is a good implementation of a framework, but is seriously tricky to get working. It has a command-line interface (like Rails), and handles routes in much the same way as Rails

  • Zend

    A pretty popular framework, especially for enterprise. Although I've not got huge experience with this framework, all my friends say it's very robust & relatively extensible

Another important factor to appreciate is PHP is not as eloquent as Ruby (with Rails). You'll have to do a LOT more wrestling with the data to get it working anywhere near to Rails' standards, and so it may be beneficial to actually look at porting to Rails