Skip to content

Latest commit

 

History

History
190 lines (135 loc) · 15.5 KB

upgrading.md

File metadata and controls

190 lines (135 loc) · 15.5 KB

Upgrading

Table of Contents

  1. 1.2.0
  2. 1.1.0
  3. Files to Move
  4. Files to Copy
  5. Files to Delete
  6. Files to Manually Update
  7. Code to Refactor
  8. 1.0.0-rc4
  9. Files to Copy
  10. Files to Manually Update
  11. 1.0.0-rc3
  12. Files to Manually Update
  13. 1.0.0-rc1
  14. Classes to Update
  15. 1.0.0-beta7
  16. Files to Copy
  17. Files to Manually Update
  18. 1.0.0-beta6
  19. Files to Delete
  20. Files to Copy
  21. Files to Manually Update

1.2.0

Estimated Upgrade Time: 5 minutes

This release brings with it support for PHP 8.0 along with a minimum supported PHP version of 7.3. Upgrading to it should just require updating your local PHP version and updating to Opulence 1.2.

1.1.0

Estimated Upgrade Time: 20 minutes

This release focused on deprecating some of the magical/unnecessary parts of Opulence, adding database migration support, introducing the collection library. It also bumped the minimum supported PHP version to PHP 7.1.

Files to Move

This step isn't strictly necessary, but it may help ease upgrading to future major releases of Opulence. Move src/Project/* to src/* and tests/src/Project/* to /tests/src/*. If you do this, be sure to update the psr-4 setting in composer.json to point to the new location.

Files to Copy

Unless you've customized any of the following files, you can just copy the updated versions from the skeleton project.

Files to Delete

  • config/phpunit.php
  • config/tasks.php

Files to Manually Update

  • Changed the Opulence version in composer.json to "1.1.*"
  • Add \Opulence\Framework\Databases\Bootstrappers\MigrationBootstrapper::class to config/console/bootstrappers.php to add database migration support

Code to Refactor

This step is not strictly necessary, but it will save time when upgrading to Opulence 2.0.

  • Remove any usages of Opulence\Ioc\Bootstrappers\Bootstrapper::run()
    • Change any bindings that occur here to happen inside Bootstrapper::registerBindings()
  • Remove any usages of Opulence\Ioc\Bootstrappers\Bootstrapper::shutDown()

1.0.0-rc4

Estimated Upgrade Time: 5 minutes

This release focused on fixing unit tests on Windows machines and making it easier to run Opulence on localhost.

Files to Copy

Unless you've customized any of the following files, you can just copy the updated versions from the skeleton project.

Files to Manually Update

  • Add Environment::setVar("VIEW_CACHE", \Opulence\Views\Caching\FileCache::class); to your .env.app.php and .env.example.php

1.0.0-rc3

Estimated Upgrade Time: 2 minutes

This release fixed an issue that would prevent users from clearing Opulence's framework cache when bootstrappers were deleted.

Files to Manually Update

Unless you've customized any of the following files, you can just copy the updated versions from the skeleton project.

1.0.0-rc1

Estimated Upgrade Time: 2 minutes

This release removed deprecated classes from previous betas. If you're upgrading from v1.0.0-beta7, then follow the steps below. If you're upgrading from older versions, first upgrade to v1.0.0-beta7.

Classes to Update

The Opulence\Events\Event and IEvent classes do not exist anymore. Instead, your event classes should be plain-old PHP objects (POPO). So, stop extending/implementing Event and IEvent. Any code that may have called stopPropagation() should also be removed. Event listeners that were explicitly accepting an Event or IEvent instance should also be changed to accept any POPO.

1.0.0-beta7

Estimated Upgrade Time: 5 minutes

This beta was mostly about changing Opulence\Environments\Environment to a static class. Additionally, there are some performance boosts and bug fixes. If you're upgrading from v1.0.0-beta6, then follow the steps below. If you're upgrading from an even older version, first upgrade to v1.0.0-beta6.

Files to Copy

Unless you've customized any of the following files, you can just copy the updated versions from the skeleton project.

Files to Manually Update

Update any instances of $environment->getVar(...) to \Opulence\Environments\Environment::getVar(...) and $environment->setVar(..., ...) to \Opulence\Environments\Environment::setVar(..., ...) in the following files:

Update $environment->getName() to \Opulence\Environments\Environment::getName() in the following file:

Remove $container->bindInstance(Environment::class, $environment); from config/application.php

Remove $this->environment = require __DIR__ . "/../../../../../config/environment.php"; from the following files:

1.0.0-beta6

Estimated Upgrade Time: 20-40 minutes

This beta primarily focused on the overhauling of bootstrappers. Bootstrappers now reside in the Ioc library, and no longer have dependencies on the Opulence\Applications\Tasks\Dispatchers\ITaskDispatcher, Opulence\Bootstrappers\Paths, or Opulence\Environments\Environment classes.

Files to Delete

The following files need to be deleted manually from your server:

  • tmp/framework/console/cachedBootstrapperRegistry.json
  • tmp/framework/http/cachedBootstrapperRegistry.json

Files to Copy

Unless you've customized any of the following files, you can just copy the updated versions from the skeleton project. Just be sure not to overwrite namespace {PROJECT_NAME}\...; at the top of your classes.

Files to Manually Update

  • In your application's bootstrappers, change:
    • use Opulence\Bootstrappers\Bootstrapper; to use Opulence\Ioc\Bootstrappers\Bootstrapper;
    • use Opulence\Bootstrappers\ILazyBootstrapper; to use Opulence\Ioc\Bootstrappers\ILazyBootstrapper;
    • $this->environment->getVar({VAR_NAME}) to getenv({VAR_NAME})
    • $this->environment->getName() to getenv("ENV_NAME")
    • $this->paths[{PATH}] to Config::get("paths", {PATH})
  • In config/environment/.env.app.php, add:
    • $environment->setVar("SESSION_COOKIE_DOMAIN", "");
    • $environment->setVar("SESSION_COOKIE_IS_SECURE", false);
    • $environment->setVar("SESSION_COOKIE_PATH", "/");