maslosoft / embedi Goto Github PK
View Code? Open in Web Editor NEWEmbedded Dependency Injection Container
Home Page: https://maslosoft.com/embedi/
License: Other
Embedded Dependency Injection Container
Home Page: https://maslosoft.com/embedi/
License: Other
This will hold AdaptersManager
too
Config should allow calling method, also combined with component name, ie:
'setLogger()' => [
'class' => Monolog\Monolog::class
];
// or
'@setLogger()' => 'logger';
Or some other syntax?
'setLogger@' => [
'class' => Monolog\Monolog::class
];
This should unify interface for SourceManager
and (planned) AdaptersManager
.
Methods setAdapters
, addAdapters
should be renamed to set/addManager(s)
.
Compound manager should be used to manage many managers sequentially.
NEW: Possibly outdated, as adapters seems to be enough
Add static method:
EmbeDi::fly('instanceId')
which should create or return flyweight instance of EmbeDi
This should replace adapters.
This method should add configuration for classes to be used when requesting component.
$di = new EmbeDi();
$di->addSource([
'mangan' => [
'dbName' => 'foo'
]
])
new Mangan('mangan');// Will use config from source
This should allow easier integration with existing applications.
Adapter should point to configuration from external source.
Embedi should have method for setting adapter, ie.
setAdapter(IAdapter $adapter)
Or
addAdapter(IAdapter $adapter)
This sould allow loading config from several sources
Adapter interface:
IAdapter
{
// This should return configuration array compatible
getConfig($class, $instanceId);
}
Example for Yii
YiiAdapter implements IAdapter
{
getConfig($class, $instanceId)
{
return Yii::app()->$instanceId;
}
}
This method should return named component instance based on config from Managers.
Currently if object contains array of objects, it's not handled properly - objects are exported "as is".
They should be exported as array embedi configs
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.