# PHPMEF **Repository Path**: tojeekup/PHPMEF ## Basic Information - **Project Name**: PHPMEF - **Description**: 用于daimo框架中的PHPMEF - **Primary Language**: PHP - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-06-05 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # PHPMEF - PHP Managed Extensibility Framework 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. ## Downloads Latest download can be found under [releases](https://github.com/maartenba/phpmef/releases). ## Hello, PHPMEF! Here's a simple example on how PHPMEF can be used:
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](https://github.com/maartenba/phpmef/wiki) for more information.
感谢:phpmef/phpmef ,该包在phpmef/phpmef的情况下添加了Jasp.php