Welcome Guest, Not a member yet? Register   Sign In
Migration Advice
#1

[eluser]richard_ctv[/eluser]
Hello.

I am in the process of planning the migration of two applications to CI. Both use 'legacy' code in that it mixes to a great degree php and html output. I am quite new to MVC frameworks but have been working an on app using CI for the last couple of weeks. It seems fairly simple to write something from scratch, but migration...

Both apps were written about 5 years ago, and require new features. I want to move them into CI as neither are MVC and adding new features means a lot more spaghetti code. And not having looked at the code for such a long time, I have to go through and work out how it all works! Probably better to do the migration and relearn (and clean up) the code as I go.

The structure of the main app is that it runs mostly of a single index.php file. You can read a full overview of the system in Linux Journal. The system is very stable and fast, just a bit messy to extend, hence the desire to move it to a framework. (We are about to move it to new faster hardware and update to php5 and mysql5, both from v4).

The app includes a whole bunch of files - for sessions, user authentication, cookies and access to objects in the database - and these are in directories below the site root. Fairly standard stuff. There is an additional large group of included files that contain classes for objects that represent items in the db. This is so I can go $object->print or $object->save and not have to worry about the underlying table differences.

There is also a complex query compiler that works in a similar way to the lucene query parser (although it pre-dates it), allowing complex search constructs. It also allows multiple data sources to be searched, regardless of the schema, and returned to the user in a simple format. This, I want to retain as it is what makes the system so powerful from the users' point of view (and represents a significant time investment).

I want to retain as much of the good code as possible, passing out data in arrays, as you do for MVC.

May main concern is how to move all the class files into CI in a structured and logical way, and then convert the descendant classes to be (i expect) libraries).

Other questions I have are: is search a library or a model. Ditto the object classes which access the DB.

Suggestions on restructuring this for CI and any other tips that come to mind would be appreciated!


regards,

Richard

======
basic structural overview:

root/htdocs/index.php
edit.php
help.php

root/includes/search.inc.php
other includes

root/includes/recordtypes/record.inc.php
other classes extended from record


Messages In This Thread
Migration Advice - by El Forum - 07-12-2007, 02:51 PM
Migration Advice - by El Forum - 07-16-2007, 07:28 PM
Migration Advice - by El Forum - 07-16-2007, 08:16 PM
Migration Advice - by El Forum - 07-17-2007, 05:11 AM
Migration Advice - by El Forum - 07-17-2007, 04:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB