At work we currently use a pretty outdated (php) "framework" that doesn't really make use of all the cool new stuff like spl autoloading, mvc, pretty much all the new stuff that came out for PHP in the last 2-3 years.
I'm trying to transition this framework slowly into a more modern mvc based one but I don't want to jump the gun and completely switch things up, but make a slow slow transition.
Right now, the way it works out is ( and I'm sure many of you loathe this or have done this before ) - for every .php page on the site we have a file and that points to a master.php ( the reason we still have these flat .php pages that point to master.php is because sometimes but not very often we have to place these sites on IIS which doesn't support mod_rewrite and I believe it's 5 or 6, not 7 ). In master.php we have a bunch of includes for css, js, and then in the content area we have a bunch of switch statements that act on the page URL, eg:
<head>
switch ($pageName ) {
case 'specialPage': echo $databaseContent->grabRSSTitle(); break;
default: echo $xml->printContent( $pageName );
}
</head>
<body>
<div id=content>
<?php
switch ( $pageName ) {
case 'contact-form': include 'includes/contact-form.php'; break;
default: echo $xml->printContent( $pageName);
}
?>
</div>
</body>
Keep in mind there are a lot of custom areas and not just those two examples which I typed, so I'm trying to also keep the flexibility there.
So if we were to hit up 'sitename.com/contact-form.php' it would first go to that file, which then includes the master.php file, does the switch on $pageName which is 'contact-form' and includes relevant portions for the content area.
By the way, we do store content in an xml based format instead of relying on databases - it just seems to be much easier making edits in xml locally than a database. I'm wondering if this is even practical as pretty much everywhere I go I see a database being used for this. ( We have seperate elements inside these xml files for things such as meta area, content area and spit them out seperately from within the master.php file ).
I'm wondering if anyone has tips on how to meld this into an mvc based one slowly, so that others aren't completely lost. Or is it even worth it? Should I go with a popular framework like Kohana/Zend?