Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3786374
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:40:23+00:00 2026-05-19T11:40:23+00:00

I am working on extending an existing PHP application. Unfortunately for me, the existing

  • 0

I am working on extending an existing PHP application. Unfortunately for me, the existing app is a mess. It’s all spaghetti code with raw mysql_* calls. Groan. No way that I am going to do that in the parts that I am extending.

So, I am looking for a simple ORM of DBAL that I can easily drop in and start using. Desired features:

  • It must work on an existing database schema. Preferably with minimal or no additional configuration. The existing database schema is the same quality as the existing PHP code (no sensible naming conventions, not normalised, etc.). I don’t want to spend days converting the database schema manually into annotated object properties a la Doctrine 2.
  • It must be able to work alongside the existing raw mysql_* queries. I have no idea how hydrating ORMs like Doctrine 2 or Propel behave when scripts are manually manipulating the data in the database behind their backs, but I assume it’s not pretty.
  • It must run on PHP 5.2.x. I’d love to use PHP 5.3 but I have zero interest in going over the existing 125K lines of spaghetti code mess to make sure it runs on PHP 5.3.
  • Relationships not required. In the few places I need to get to relational data, I’ll be happy to call an extra find() or query() or whatever myself.
  • Bonus points if it has some trigger support (e.g. beforeSave, afterSave). Not a requirement, but just nice to have.

Edit: Someone put me out of my misery. I just found out that the 125K lines of spaghetti code also changes the database schema. E.g, add an extra option somewhere and a whole slew of ALTER TABLE statements start flying. I could probably fill a year’s worth of TheDailyWTF with this codebase. So, one more requirement:

  • Must be able to cope with a changing database schema automatically (e.g. adding columns).

I have been looking at a few solutions, but I am unsure how well they would work given the requirements. Doctrine 2, RedBeanPhp and the like all require PHP 5.3, so they are out. There’s a legacy version of RedBeanPhp for PHP 5.2.x but I don’t know if it would work with a messy, existing database schema. NotORM looks okay for getting data out but I don’t know if it can be configured for the existing database schema, and how you can easily put data back into the database.

Ideally I would like something simple. E.g:

$user = User::find($id);
$user->name = 'John Woo';
$user->save();

Or:

$articles = ORM::find('article')->where('date' => '2010-01-01');
foreach ($articles as $article) {
    echo $article->name;
}

Any tips or even alternative solutions are welcome!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:40:24+00:00Added an answer on May 19, 2026 at 11:40 am

    I use…
    http://github.com/j4mie/idiorm/

    it has an active record implementation too in the form of Paris.

    With regard to your edit. Idiorm copes with changing schemas and the syntax almost exactly matches the type you want in your question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on extending an ASP.NET 2.0 application using an InterBase database. My
Working in Eclipse on a Dynamic Web Project (using Tomcat (v5.5) as the app
Working with an Oracle 9i database from an ASP.NET 2.0 (VB) application using OLEDB.
I'm working on a WPF application and is using the Model-View-ViewModel pattern. The application
I'm working on extending the errorprovider to the propertygrid and treeview controls. I found
I am working on extending the spell checker that has recently been updated on
I'm working with Qt and QWt3D Plotting tools, and extending them to provide some
I'm extending an application to play one of several videos on a control in
I am extending a class from a external library. Here is my code: Header
Hey there, Now im working this base on dmitko tutorial on extending django-registration post

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.