-
-
Notifications
You must be signed in to change notification settings - Fork 181
Migrations
Karoly Gossler edited this page Feb 6, 2024
·
13 revisions
- Create an empty
composer.jsonif it does not already exist. - If it already exists, you can install symfony1 with
composer require friendsofsymfony1/symfony1 "^1.5". - You must remove the
sfCoreAutoload::register()call from theProjectConfiguration.phpfile and you need to replace the path to the autoloader:
<?php
require_once(__DIR__.'/../vendor/autoload.php');
class ProjectConfiguration extends sfProjectConfiguration {- You can install doctrine1 using the
composer require friendsofsymfony1/doctrine1"^1.5"command. In this case, you need to set thesf_doctrine_diroption insfConfig, which should point to thevendor/friendsofsymfony1/doctrine1/libdirectory. - You must change all
Doctrineclass occurrences toDoctrine_Core. The easiest way to do this is to create aDoctrineclass (eg:ProjectConfiguration.php) and tag it with @deprecated:
/** @deprecated */
class Doctrine extends Doctrine_Core
{
}After that your IDE or phpstan with deprecation rules extension can list the Doctrine class occurrences very well.
- If you have configured doctrine by calling the
configureDoctrineEventorconfigureDoctrinemethods in the ProjectConfiguration file, you must subscribe todoctrine.configureeven in thesetupmethod:
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
// ...
$this->dispatcher->connect('doctrine.configure', array($this, 'configureDoctrineEvent'));
}
public function configureDoctrineEvent(sfEvent $event)
{
$manager = $event->getSubject();
$manager->setAttribute(Doctrine_Core::ATTR_USE_DQL_CALLBACKS, false);
}
}- ?