dev-master
9999999-dev https://github.com/maartenba/phpmefPHPMEF allows easy composition and extensibility in an application.
BSD-3-Clause
The Development Requires
PHPMEF allows easy composition and extensibility in an application.
PHPMEF is a PHP port of the .NET Managed Extensibility Framework, allowing easy composition and extensibility in an application using the Inversion of Control principle and 2 easy keywords: @export and @import., (*1)
Latest download can be found under releases., (*2)
Here's a simple example on how PHPMEF can be used:, (*3)
class HelloWorld {
/**
* @import-many MessageToSay
*/
public $Messages;
public function sayIt() {
echo implode(', ', $this->Messages);
}
}
class Hello {
/**
* @export MessageToSay
*/
public $HelloMessage = 'Hello';
}
class World {
/**
* @export MessageToSay
*/
public $WorldMessage = 'World!';
}
$helloWorld = new HelloWorld();
$compositionInitializer = new MEF_CompositionInitializer(new MEF_Container_Default());
$compositionInitializer->satisfyImports($helloWorld);
$helloWorld->sayIt(); // Hello, World!
Check the wiki for more information., (*4)
PHPMEF allows easy composition and extensibility in an application.
BSD-3-Clause