Przykłady na podstawie https://github.com/ibexa/calendar/pull/2
- Zaczynamy od dodania nowej paczki:
composer config repositories.branding vcs https://github.com/ibexa/namespace-compatibility.git
composer require ibexa/namespace-compatibility
- Generujemy aktualne classmapy:
cd vendor/ibexa/namespace-compatibility
composer install
php bin/console rebranding:generate:class-map
cd -
- Klonujemy naszą testowaną paczkę:
git clone https://github.com/ibexa/<nazwa_repo>.git -b <nazwa_brancha>
Dla https://github.com/ibexa/calendar/pull/2 to będzie:
git clone https://github.com/ibexa/calendar.git -b rebranding2
Powstanie nam katalog <nazwa_repo>
Dodajemy do composer.json dwa wpisy:
a) Do sekcji repositories
dodajemy:
"<nazwa_repo>": {
"type": "path",
"url": "./<nazwa_repo>",
"options": {
"symlink": false
}
},
W tym przykładzie to będzie:
"branding": {
"type": "vcs",
"url": "https://github.com/ibexa/namespace-compatibility.git"
},
"calendar": {
"type": "path",
"url": "./calendar",
"options": {
"symlink": false
}
},
b) Znajdujemy nową nazwę paczki:
<nazwa_paczki>
to cat <nazwa_repo>/composer.json | grep name
c) Do sekcji require
dodajemy (gdzieś na środku listy):
"<nazwa_paczki>": "dev-<nazwa_brancha> as 4.0.x-dev",
Dla naszego PRa:
"ibexa/calendar": "dev-rebranding2 as 4.0.x-dev",
I robimy composer update
- Dostaniemy błąd w stylu:
!! Trying to register two bundles with the same name "IbexaCalendarBundle".
I teraz musimy tak:
a) otworzyć plik config/bundles.php
b) Zlokalizować wpis dla paczki którą testujemy: ibexa/calendar zastępuje ezsystems/ezplatform-calendar, więc znajdujemy wpis dla Calendara:
EzSystems\EzPlatformCalendarBundle\EzPlatformCalendarBundle::class => ['all' => true],
i zastępujemy go tym co mamy na samym dole (nowym wpisem dla calendara):
Ibexa\Bundle\Calendar\IbexaCalendarBundle::class => ['all' => true],
U mnie wygląda to tak po podmiance:
EzSystems\EzPlatformWorkflowBundle\EzPlatformWorkflowBundle::class => ['all' => true],
Ibexa\Bundle\Calendar\IbexaCalendarBundle::class => ['all' => true],
EzSystems\EzPlatformVersionComparisonBundle\EzPlatformVersionComparisonBundle::class => ['all' => true],
Dodatkowo:
Znajdujemy wystąpienia ostatniego członu w tekście który zastępowaliśmy (EzPlatformCalendarBundle
) w projekcie (wewnątrz katalogu config) i zastępujemy je ostatnim członem nowego tekstu (IbexaCalendarBundle
).
Dla EzPlatformCalendarBundle
są to dwa wystąpienia w pliku config/routes/ezplatform_calendar.yaml
.
- Teraz robimy
rm -rf var/cache
icomposer update
i już powinno być ok
@mnocon
nie jest wymagane, paczka jest w Satis