How to keep a Nette addon compatibility with Nette Framework 2.0, 2.1 and 2.2? Here is my fight description:
- Nette 2.0
Nette\Utils\PhpGenerator\ClassTypevs Nette 2.1+Nette\PhpGenerator\ClassTypestrict errors andNette\Config\CompilerExtensionvs.Nette\DI\CompilerExtension. This was a difficult one:
- Create abstract
BC\Extensions like this, - and Nette version-dependent loader like this.
- A target extension will inherit one of them as
class Extension extends BC\Extensionand - the Composer will class-mapping different folder and hard load version-dependent loader like this.
IBarPanelis solved in the same way as 1)