php - Best way to package a general-purpose zend module -
php - Best way to package a general-purpose zend module -
as our company starts using zend framework base of operations framework of our projects, want share mutual elements across our projects. talk things like:
an implementation of model (based on doctrine2) rbac model, including user, group, role models a xml-based templating engine ajax backend interfaces (you name it) ...basically, things set "zend on rails" , going. best way bundle these components? see 2 possibilities:
as moduleswe include necessary functions separate modules modules folder.
pro:
we can set routes , execute code, many modules (imaginary example: paypal module needs kind of callback url. if our module can set on own, no configuration "project developer" needed). we can provide real functionality (like user administration) out of box we have bootstrap set autoloading , doctrine etc.con:
bad place? interferes users project a little harder share between projects (git submodules instead of classpath) in library folderwe set in library folder , point classpath it.
pro:
clean solution sharing across projectscon:
bootstrap has explicitly called no direct routing or actions - has proxied through concrete projectso, how solve this? set reusable, general purpose stuff in zf?
i think should utilize both approaches.
when developing "library-like" code, in kind of "infrastructure" classes , other things reusable (like zf's own components, doctrine 2's components etc.), can set them library directory. (or own exclusively separate project)
when developing actual zf modules (like auth module example), format code around zf module structure.
i think using kind of approach benfits listed, , pretty much none of cons :)
as 1 additional idea, if develop architecture parts "services", maintain them running own web service endpoints.
php zend-framework zend-framework-modules project-layout
Comments
Post a Comment