Upgrading
Table of Contents
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.
- bootstrap/console/start.php
- bootstrap/http/start.php
- config/application.php
- config/paths.php
- phpunit.xml
- src/Application/Bootstrappers/Console/Commands/CommandsBootstrapper.php
- src/Application/Bootstrappers/Http/Views/BuildersBootstrapper.php
- src/Infrastructure/Databases/Migrations/.gitkeep
- tests/src/Application/Console/IntegrationTestCase.php
- tests/src/Application/Http/IntegrationTestCase.php
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()
- Change any bindings that occur here to happen inside
- 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.
- phpunit.xml
- src/Application/Bootstrappers/Http/Sessions/SessionBootstrapper.php
- src/Application/Bootstrappers/Http/Views/ViewBootstrapper.php
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:
- tests/src/Project/{PROJECT_NAME}/Application/Console/IntegrationTestCase.php
- tests/src/Project/{PROJECT_NAME}/Application/Http/IntegrationTestCase.php
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.
- bootstrap/console/start.php
- bootstrap/http/start.php
- config/application.php
- config/environment/.env.example.php
- config/http/sessions.php
- config/paths.php
- src/{PROJECT_NAME}/Application/Bootstrappers/Cache/RedisBootstrapper.php
- src/{PROJECT_NAME}/Application/Bootstrappers/Console/Commands/CommandsBootstrapper.php
- src/{PROJECT_NAME}/Application/Bootstrappers/Databases/SqlBootstrapper.php
- src/{PROJECT_NAME}/Application/Bootstrappers/Events/EventDispatcherBootstrapper.php
- src/{PROJECT_NAME}/Application/Bootstrappers/Http/Routing/RouterBootstrapper.php
- src/{PROJECT_NAME}/Application/Bootstrappers/Http/Sessions/SessionBootstrapper.php
- src/{PROJECT_NAME}/Application/Bootstrappers/Http/Views/ViewBootstrapper.php
- src/{PROJECT_NAME}/Application/Bootstrappers/Orm/UnitOfWorkBootstrapper.php
- src/{PROJECT_NAME}/Application/Bootstrappers/Validation/ValidatorBootstrapperBootstrapper.php
- src/{PROJECT_NAME}/Application/Http/Middleware/CheckCsrfToken.php
- src/{PROJECT_NAME}/Application/Http/Middleware/Session.php
- tests/src/Project/{PROJECT_NAME}/Application/Console/IntegrationTestCase.php
- tests/src/Project/{PROJECT_NAME}/Application/Http/IntegrationTestCase.php
Files to Manually Update
- In your application's bootstrappers, change:
use Opulence\Bootstrappers\Bootstrapper;
touse Opulence\Ioc\Bootstrappers\Bootstrapper;
use Opulence\Bootstrappers\ILazyBootstrapper;
touse Opulence\Ioc\Bootstrappers\ILazyBootstrapper;
$this->environment->getVar({VAR_NAME})
togetenv({VAR_NAME})
$this->environment->getName()
togetenv("ENV_NAME")
$this->paths[{PATH}]
toConfig::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", "/");