of course… YOU have no problem, because you always send credentials by FAX to your peers & customers! or YOU are the person who is having great fun, telling your customers credentials on the phone and using passwords like this: „B3y3^zA#](}7j6#tmJ=[r“
let‘s do that with ZF2 of course, we use Composer ! (and ZF community fortunately decided to do so, too) cd ~/Sites/zf2test git clone git://github.com/zendframework/ ZendSkeletonApplication.git cd ZendSkeletonApplication php composer.phar install or php composer.phar create-project --repository-url="http:// packages.zendframework.com" zendframework/skeleton- application ~/Sites/zf2test
APPLICATION.CONFIG.PHP modules: a list of modules you want to use module_listener_options: where to find your modules & how to load other config files by pattern
ZF2 Modules can be pretty anything ([more or less] code, assets, configs) there is no structure you have to follow but there is a structure, you could/should follow you need a Module.php in the module root Module.php needs its own Namespace
ZF2 ModuleManager „A flexible and powerful system for loading managing modules“ (Evan Coury) Loads all your modules and fires some listeners AutoloaderListener ConfigListener InitTrigger OnBootstrapListener LocatorRegistrationListener ServiceListener Makes use of ZF2 EventManager
ZF2 ServiceManager because we can write $sm then! because everybody right now uses a DIC your module.config.php will feed the ServiceManager and get you up and running I assume, you already understand the concepts behind DIC (Dependency Injection Container) and IoC (Inversion of Control), if not…
ZF2 EventManager ZF2 MVC makes heavy usage of EventManager Everything is bound to an event If you want to hook into any bootstrapping process, you will end in attaching to an event You can use the EventManager to integrate event based logic into your own app
KEYCONTROLLER.PHP - PRESDISPATCH & INDEX PREDISPATCH IS A OWN EVENT! (that is created in MvcController) add key-de_DE.mo and key-us_US.mo to translator Check, if key is already created. If not, create KeyForm. Return keyRecord and keyForm as ViewModel Attributes
KEYCONTROLLER.PHP - ADD ACTION If Request is POST Create new KeyRecord and get Input Filter out of it. Fill Form with POST data If form is valid Get passphrase out of form values Generate Private Key Save Public Key for User ($this->identity) Add Private Key to ViewModel Update User Role