# Re-coding a sizable PHP app in rails

**URL:** <https://www.ruby-forum.com/t/re-coding-a-sizable-php-app-in-rails/61931>\
**Category:** Rails\
**Created:** [May 29, 2006, 10:44pm UTC](https://www.ruby-forum.com/t/re-coding-a-sizable-php-app-in-rails/61931 "2006-05-29T22:44:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sshingler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3da27b/32.png) [@sshingler](https://www.ruby-forum.com/u/sshingler)\
**Post date:** [May 29, 2006, 10:44pm UTC](https://www.ruby-forum.com/t/re-coding-a-sizable-php-app-in-rails/61931/1 "2006-05-29T22:44:35Z")

</div>

Hello,

I am the developer of a fairly major PHP app. It has the full  
compliment of web application goodies – email, batch processes, cc  
transactions, multi-level authentication, security, content management,  
curl-type interaction with other applications, etc. I am obsessed with  
the idea of re-doing a year and a half of work in Rails and the more I  
learn the worse my itch gets. I feel like I will be able to make much  
faster forward progress on features once this is done. The app  
consists of 250 PHP files and approximately 75 MySQL tables. Has anyone  
done anything like this? Do you have any words of advice for me? I  
already used migrations to convert the DB to conform with Rails naming  
conventions and I have recoded one of the two most complex pages. I am  
about about to go down a rabit hole for a month. (I hope not more!) I  
need a sanity check.

Steven

---

<div class="post-metadata">

**Author:** ![sshingler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3da27b/32.png) [@sshingler](https://www.ruby-forum.com/u/sshingler)\
**Post date:** [May 29, 2006, 11:24pm UTC](https://www.ruby-forum.com/t/re-coding-a-sizable-php-app-in-rails/61931/2 "2006-05-29T23:24:20Z")

</div>

I have not converted anything huge. Just smaller things.  
Only advice I have is to completely forget the old code. Remember the  
result but not how you did it. Not the solutions to the problems. I  
have seem a bunch of code where PHP methods were used to accomplish  
things and it’s just messy and doesn’t work.

But I guess the LoginEngine And RolesEngine should get you pretty far  
in a short time.  
Also go over all the plugins at  
[http://www.agilewebdevelopment.com/plugins](http://www.agilewebdevelopment.com/plugins) and try to visualize how  
they may help you out.  
You might even manage to set this up in half a month. 😉

On 5/29/06, Steven Talcott S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> done anything like this? Do you have any words of advice for me? I  
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–

---

<div class="post-metadata">

**Author:** ![sshingler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3da27b/32.png) [@sshingler](https://www.ruby-forum.com/u/sshingler)\
**Post date:** [May 30, 2006, 2:03am UTC](https://www.ruby-forum.com/t/re-coding-a-sizable-php-app-in-rails/61931/3 "2006-05-30T02:03:18Z")

</div>

On May 29, 2006, at 1:44 PM, Steven Talcott S. wrote:

> faster forward progress on features once this is done. The app  
> Steven
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

Hey Steven-

```
I did this same thing in rails about a year ago. I converted the cms

```

and intranet for the [http://yakimaherald.com](http://yakimaherald.com) newspaper. This website  
is a huge content management thing that speaks with 5 differetn data  
sources. The original version in php amounted to so much duck tape  
and paperclip style hacking that it was unmaintainable any more. So I  
rewrote it in rails. The important thing to remember is to try to  
solve the same problems you solved with your old php app but don’t  
bring over preconceptions or methodologies from your php code base.  
Now that you have solved the app once, you want to do as well and as  
extensable as possible this time. So take some time and plan things  
out a bit as to how you approach things. Here is a write up I did  
when I launched that site last summer:

[http://brainspl.at/articles/2005/11/03/from-start-to-launch-http-](http://brainspl.at/articles/2005/11/03/from-start-to-launch-http-)  
yakimaherald-com

```
Good luck on your project. You will have fun rewriting it in rails.

```

It’s a great way to jump right in and learn.

Cheers-  
-Ezra

---

<div class="post-metadata">

**Author:** ![sshingler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3da27b/32.png) [@sshingler](https://www.ruby-forum.com/u/sshingler)\
**Post date:** [May 30, 2006, 5:19am UTC](https://www.ruby-forum.com/t/re-coding-a-sizable-php-app-in-rails/61931/4 "2006-05-30T05:19:21Z")

</div>

Steven Talcott S. wrote:

> Hello,
> 
> I am the developer of a fairly major PHP app. It has the full  
> compliment of web application goodies – email, batch processes, cc  
> transactions, multi-level authentication, security, content management,  
> curl-type interaction with other applications, etc. I am obsessed with  
> the idea of re-doing a year and a half of work in Rails and the more I  
> learn the worse my itch gets. I feel like I will be able to make much  
> faster forward progress on features once this is done. The app  
> consists of 250 PHP files and approximately 75 MySQL tables. Has anyone  
> done anything like this? Do you have any words of advice for me? I  
> already used migrations to convert the DB to conform with Rails naming  
> conventions and I have recoded one of the two most complex pages. I am  
> about about to go down a rabit hole for a month. (I hope not more!) I  
> need a sanity check.
> 
> Steven

I say go for it. I switched over a similar PHP app (that was about half  
as complicated as yours) to Rails. The first couple weeks were  
frustrating trying to figure out how to do things the Rails way (which  
was made even more difficult due to the sparse docs). But I’m glad I  
switched. I definitely recommend reading AWDWR before getting started  
(which I didn’t do until well into the project).

Joe

---

<div class="post-metadata">

**Author:** ![sshingler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3da27b/32.png) [@sshingler](https://www.ruby-forum.com/u/sshingler)\
**Post date:** [June 1, 2006, 4:42am UTC](https://www.ruby-forum.com/t/re-coding-a-sizable-php-app-in-rails/61931/5 "2006-06-01T04:42:46Z")

</div>

Thank you to all who provided encouragement and suggestions. I will  
post some stats and results when the project is complete.

Steven

---

<div class="post-metadata">

**Author:** ![sshingler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3da27b/32.png) [@sshingler](https://www.ruby-forum.com/u/sshingler)\
**Post date:** [May 29, 2006, 11:31pm UTC](https://www.ruby-forum.com/t/re-coding-a-sizable-php-app-in-rails/61931/6 "2006-05-29T23:31:02Z")

</div>

I am going through the process of re-doing an [ASP.Net](http://ASP.Net) 1.1 Project. The  
process has been this:

1. Consider the task at hand.
2. How did I do this in .Net?
3. Okay, how do I do it the way I did it in .Net … in Rails?
4. This is annoying, Rails doesn’t do what I need it to do.
5. Think that my task is very complicated in Rails.
6. Get frustrated with Rails.
7. Do some more research.
8. Get ready to drop Rails completely.
9. Realize that what I needed to do was a one-line of code
10. Get frustrated with self for overcomplicating it.
11. Get frustrated with Rails documentation.
12. Onto the next task…
13. OKAY, how do I do this ‘the Rails way’

#9 Actually happened. It was :acts\_as\_tree.

And you’ll find that Rails documentation is inconsistent across various  
community sites. There are a whack of new print publications coming out  
this  
summer that will hopefully help this. The book “Agile Development with  
Rails” has helped immensley. Inconsistant and out of date at times, but  
I  
appreciate the consistent voice throughout.

---

<div class="post-metadata">

**Author:** ![sshingler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3da27b/32.png) [@sshingler](https://www.ruby-forum.com/u/sshingler)\
**Post date:** [June 1, 2006, 5:09am UTC](https://www.ruby-forum.com/t/re-coding-a-sizable-php-app-in-rails/61931/7 "2006-06-01T05:09:41Z")

</div>

Jeff,

I have been having pretty much the same experience. Currently my task  
of  
handling an object graph (see my previous posts to this mailing list)  
has  
lead me through all steps up to 8, which is where I’m out now. I’m  
anxiously awaiting step 9.

I also agree that I find the rails documentation throughly confusing,  
but  
I’m sure a long time RoR developer finds JavaDocs throughly confusing as  
well.

---

<div class="post-metadata">

**Author:** ![sshingler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3da27b/32.png) [@sshingler](https://www.ruby-forum.com/u/sshingler)\
**Post date:** [June 1, 2006, 1:21pm UTC](https://www.ruby-forum.com/t/re-coding-a-sizable-php-app-in-rails/61931/8 "2006-06-01T13:21:17Z")

</div>

On 01/06/06, Paul B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> but I’m sure a long time RoR developer finds JavaDocs throughly  
> confusing as well.

Hmmm, doubt it.
