AthenaeumAthenaeum
Packages
  • next
  • current
  • v9.x
  • v8.x
  • v7.x
  • v6.x
  • v5.x
  • v4.x
  • v3.x
  • v2.x
  • v1.x
Changelog
GitHub
Packages
  • next
  • current
  • v9.x
  • v8.x
  • v7.x
  • v6.x
  • v5.x
  • v4.x
  • v3.x
  • v2.x
  • v1.x
Changelog
GitHub
  • Version 4.x

    • Release Notes
    • Upgrade Guide
    • New to this...
    • Origin
  • Circuits

    • Circuits
    • How to install
    • Setup
    • Usage
    • Events
  • Config

    • Configuration Loader
    • How to install
    • Setup
    • Load Configuration Files
    • Custom File Parsers
  • Console

    • Command and Schedule Registration
    • How to install
    • Setup
    • Commands
    • Schedules
  • Container

    • IoC Service Container
    • How to install
    • registerAsApplication()
    • destroy()
  • Core

    • Athenaeum Core Application
    • Prerequisite
    • How to install
    • Integration
    • Usage

      • Configuration
      • Service Providers
      • Service Container
      • Events
      • Caching
      • Logging
      • Console
      • Task Scheduling
      • Exception Handling
      • Extending Core Application
      • Testing
  • Dto

    • Data Transfer Object (DTO)
    • How to install
    • Create Interface
    • Implement DTO
    • How to use
    • Populate
    • Export
    • Json
    • Serialization
    • Nested DTOs
    • Array DTO
  • Events

    • Register Listeners and Subscribers
    • How to install
    • Setup
    • Listeners
    • Subscribers
  • Http

    • Clients

      • Http Clients
      • How to install
      • Setup
      • Basic Usage
      • Available Methods

        • Fluent Api
        • Protocol Version
        • Base Uri
        • Http Method and Uri
        • Headers
        • Accept & Content-Type
        • Authentication
        • Http Query
        • Payload Format
        • Payload
        • Attachments
        • Cookies
        • Response Expectations
        • Conditions
        • Criteria
        • Redirects
        • Timeout
        • Driver Options
        • Driver
      • Http Query Builder

        • Introduction
        • Select
        • Where
        • Dates
        • Include
        • Pagination
        • Sorting
        • Raw Expressions
        • Custom Grammar
    • Cookies

      • Http Cookies
      • How to install
      • Usage
  • Properties

    • Properties Overload
    • How to install
    • Usage
    • Naming Convention
    • Properties Visibility
  • Service

    • Service Registrar
    • How to install
    • How to use
  • Support

    • Introduction
    • How to install
    • Laravel Aware-of Helpers

      • How to use
      • Enforce Via Interface
      • Custom Default
      • Pros and Cons
      • Available Helpers
    • Aware-of Properties

      • Generator
      • Available Aware-of Helpers
    • Live Templates
  • Testing

    • Introduction
    • How to install
    • Test Cases
    • Testing Aware-of Helpers
  • Utils

    • Introduction
    • How to install
    • Array
    • Json
    • Math
    • Method Helper
    • Populatable
    • Version
You are viewing documentation for an outdated version. It is no longer supported!

Prerequisite

  • Composer
  • PHP v7.4.x
    • Other Requirements
  • Tools to help Upgrading
    • PHP Compatibility checker
    • Symfony Polyfill
    • Rector
    • Other Tools?
    • Tip for installing Tools
  • Testing...?

Composer

This might seem trivial for some developers, yet composer must be available within your legacy application. Without it's autoloading capabilities, it can be difficult to integrate this package's components. Therefore, please ensure that composer is installed and available inside your legacy application.

PHP v7.4.x

Unfortunately this package is only available from Athenaeum v4.x, meaning that it requires PHP v7.4.x or higher. If you application only runs on older versions of PHP, then you should spend the time it requires to upgrade. Your application stands to benefit greatly from this, both in terms of security, performance and new language features.

Please consult yourself with PHP Migration Guides, for additional information.

As the author of this package, I apologise if you somehow feel mislead. I have been working on this and many other packages by myself. There are limits to how much backwards compatibility I can offer.

Other Requirements

See eventual remaining requirements on packagist or inside this package's composer.json.

Tools to help Upgrading

You are not the only developer, that has to deal with upgrading legacy applications. Many other developers have gone through the same. Some of these developers have written very useful tools that can help you a lot. Below is a small list of tools that will help you upgrade.

PHP Compatibility checker

The PHP Compatibility Checker for PHP_CodeSniffer is a really great tools for identifying outdated code, e.g. unsupported features. It can be a bit cumbersome to install and setup. Yet, once it is up and running, it will show you exactly what line(s) of code are not compatible with PHP 7.x, 8.x,...etc.

Symfony Polyfill

Sadly, it is not always easy to deal with outdated code. Sometimes you might hit a "brick wall" that requires lots of hours or perhaps days to get through. This is especially true, when your legacy application depends on PHP features that are no longer supported. Fortunately, Symfony Polyfill has a great library that provides backwards compatibility to several outdated features.

Rector

This is probably the coolest, and most powerful tool for upgrading outdated code. It able to do so automatically! Based on a few rules, Rector will automatically refactor your code. According to their documentation, it can upgrade code from PHP v5.3.x, all the way to PHP v7.4.x. Check out their online demo to see it in action.

Other Tools?

There are many more tools available, than the ones mentioned above. Try searching packagist or your favorite search engine, whenever you feel stuck with some outdated lines of code.

Note

If you happen to know of other great tools, that can help developers upgrade their legacy applications, then please feel free to contribute to this page's content.

Tip for installing Tools

Depending on the tool(s) that you choose to use, they can sometimes cause conflicts with the dependencies that your legacy application might contain. To avoid having to deal with this, you can make use of Composer Bin Plugin. It allows you to install your binary dependencies in a different folder, whilst linking the package's binaries into your regular vendor directory.

Testing...?

Depending on your end-goals, perhaps it would be better that you start adding a few automated high-level tests to your legacy application, before starting to refactor, redesign or add several new features. Nevertheless, bringing automated tests into your legacy application, is beyond the scope of this package. You may find some inspiration by reviewing the following testing frameworks Codeception, PHP Spec, Behat, PHPUnit... etc.

Edit page
Last Updated: 08/09/2020, 18:52
Contributors: Alin Eugen Deac
Prev
Athenaeum Core Application
Next
How to install