title: Use Laravel to refactor old, large PHP application partially over time?
body: <p>From what I've read this should be possible due to the modular nature of Laravel, but I need assurance from people with more Laravel experience:</p>
  
  <p>I have a very large (500k loc) ancient PHP app. So ancient that some parts of it date from PHP3 times (ca. 2000, PHP4 was released already but PHP3 was used for backwards compatibility reasons).</p>
  
  <p>Refactoring this is a huge project, and the only way to reasonably do it is in parts. Replace this part, then that part, etc. Fortunately, the "ancient" part comes in handy as no framework was used and basically every page is its own script, with a few central libraries for shared functionality.</p>
  
  <p>Is it possible to spin up a Laravel app that can route new/refactored pages to the new site and everything else (wildcard if possible) to the ancient code? All data is stored in a database, so there will be no sync issues between them except for user authentication and session info.</p>
  
  <p>Is it possible to get eloquent running on an ancient DB design or to refactor the DB in such a way that it works for both? There was a previous attempt to move the DB interface to Doctrine which from what I know was aborted after partial success (i.e. many DB objects are accessed through Doctrine, but there is also a lot of straight SQL code in parallel).</p>
  
  <p>It's a huge mess, but the software in question is still being used and successfully so and a previous attempt to replace it with something else has already failed.</p>
  
  <hr>
  
  <p><em>additional details</em>:</p>
  
  <p>Thanks @maiorano84 for good questions:</p>
  
  <blockquote>
    <p>First, does your legacy application have tests?</p>
  </blockquote>
  
  <p>Negative on that. PHPUnit was released in 2004. At that time, this app had already been in production for four year.</p>
  
  <blockquote>
    <p>Second, are you able to get it to work on a more recent version of PHP?</p>
  </blockquote>
  
  <p>Yes, the current codebase is running on PHP 5.6.33 - it has been maintained throughout the years, and a major update was made on the transition between PHP 4 and PHP 5.</p>