<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Harry Torry on Medium]]></title>
        <description><![CDATA[Stories by Harry Torry on Medium]]></description>
        <link>https://medium.com/@harrytorry?source=rss-dfd07cea3888------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uAHC8WEpt0vQsiGu3tV5yg.png</url>
            <title>Stories by Harry Torry on Medium</title>
            <link>https://medium.com/@harrytorry?source=rss-dfd07cea3888------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 15:13:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@harrytorry/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Legacy Software — it’s not _that_ bad]]></title>
            <link>https://medium.com/@harrytorry/legacy-software-its-not-that-bad-2514e11dbb8b?source=rss-dfd07cea3888------2</link>
            <guid isPermaLink="false">https://medium.com/p/2514e11dbb8b</guid>
            <category><![CDATA[psr-11]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[legacy]]></category>
            <dc:creator><![CDATA[Harry Torry]]></dc:creator>
            <pubDate>Wed, 06 Jun 2018 11:18:20 GMT</pubDate>
            <atom:updated>2018-06-07T13:33:31.599Z</atom:updated>
            <content:encoded><![CDATA[<p>Everybody has at least one legacy project, or is pretending they don’t have one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*sKiWxT2f7Fj1Ha4OBA08FA.png" /></figure><p>Hope should not be lost on these projects.</p><p>Everybody loves to hate on legacy apps, although there’s a lot of things you can do in a very short amount of time to make the developer workflow and system administration duties a lot better.</p><p><em>This post has an emphasis on PHP.</em></p><p>A full refactor can be too expensive, time-consuming, daunting or just plain boring. If it’s not an option, there’s a lot that can generally be improved.</p><h3>We can do better</h3><h4>Bring in docker and upgrade your PHP version</h4><p>Let everybody on your team have the same development environment to reduce the number of issues arising from one developer using php5.6 and another using php 7.1. We also need to be updating our apps as much as possible, within reason.</p><p>Try using <a href="http://php.net/manual/en/migration72.incompatible.php">7.2, but it brings in a lot of backwards-incompatible</a> changes that hurt.</p><p>I’m not saying to use the nightly build of PHP7.4, but that app on 5.3 needs some love.</p><h4>Bring in package management</h4><p>We (should) all use package managers like <a href="https://getcomposer.org/">Composer</a> to quickly get dependencies, to get the correct versions and to update them when we need to do so.</p><p>There’s nothing wrong with bringing in composer for one package. The next feature you’re working on might need a different package. The time to act is now, or it will never get done.</p><h4>Fix up the config</h4><p>A good thing to do is unify all of the config and environment variables (database connections, application keys etc). I’d suggest using <a href="https://github.com/vlucas/phpdotenv">dotenv</a> (hey look, you can bring it in with Composer!).</p><p>Regardless of if you’ve brought in docker, you should definitely have a default config that works for development.</p><p>______<br>Why not include a config for staging and prod?</p><blockquote>Waa, we don’t even have a staging for this app it’s so old</blockquote><p>Then put one in for prod, I won’t even bother suggesting getting a staging environment configured, cause we’re past that point. “It’s legacy and this client only makes minor changes that our custom CMS lets them preview.”<br>_____</p><h4>Add logging</h4><p>I’m not suggesting adding logging to everything. That would be silly.</p><p>But you know how your image cdn manipulator fails every few days for a seemingly random image and your PDF generator for emails screws up depending on user input (check for hidden characters that not even PHP’s functions can’t parse). Logging is a great way to give you insight on why these things are happening.</p><p>I’d suggest using <a href="https://inhindsight.io/">https://inhindsight.io/</a></p><h4>Bring in a service container</h4><p>You can read more about PSR-11 <a href="https://github.com/php-fig/container">here</a>.</p><p>I would suggest using the <a href="https://github.com/thephpleague/container">php league container</a>. I’m not sure how much work would be required to get illuminate/container set up and running without bringing all of the Laravel framework in.</p><p>This will allow you to have bindings for your services, resolving (laravel’s app(&#39;request&#39;) functionality), contextual bindings and support for PSR-11.</p><h4>Bring in an ORM</h4><p>composer require laravel/database</p><p>This will allow you to create database migrations and eloquent models for easier database mapping. These two things will help your development process ten-fold.</p><p>This process will take less than an hour the first time around.</p><p>If you’ve used Laravel before, you’ll know what I’m on about. If you haven’t, where have you been for the last 5 years?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2514e11dbb8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>