Download the PHP package minphp/bridge without Composer
On this page you can find all versions of the php package minphp/bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package bridge
Minphp/Bridge
This library allows you to seamlessly take advantage of newer namespaced minPHP libraries while at the same time maintaining backwards compatibility with minPHP 0.x global classes.
Why use this library
This library is intended for projects that are built using minPHP 0.x that want to take advantage of other namespaced minPHP libraries.
Installation
Install via composer:
Usage
The bridge requires some information before it's able to initialize some
libraries. This is handled by populating and passing in a container that
implements Minphp\Container\ContainerInterface.
The following config files in minphp 0.x were removed in minphp 1.0, which is what necessitates populating the container:
- core.php
- database.php
- session.php
minPHP uses the Minphp\Container\Container, which meets this requirement. The
following elements are required to be set:
minphp.cachearray containing:dirstringdir_permissionint (octal)extensionstringenabledbool
minphp.configarray containing:dirstring
minphp.constantsarray containing:APPDIRstringCACHEDIRstringCOMPONENTDIRstringCONFIGDIRstringCONTROLLERDIRstringDSstringHELPERDIRstringHTACCESSboolLANGDIRstringLIBDIRstringMINPHP_VERSIONstringMODELDIRstringPLUGINDIRstringROOTWEBDIRstringVENDORDIRstringVIEWDIRstringWEBDIRstring
minphp.languagearray containing:defaultstring 'en_us'dirstringpass_throughbool
minphp.mvcarray containing the following keys:default_controllerstringdefault_structurestringdefault_viewstringerror_viewstringview_extensionstringcli_render_viewsbool404_forwardingbool
minphp.sessionarray containing the following keys (all optional):dbarray containing:tblstring The session database tabletbl_idstring The ID database fieldtbl_expstring The expiration database fieldtbl_valstring The value database fieldttlint The session time-to-live, in seconds, relative to current server time (should be set to the same value as the other TTLs, e.g., 'max(ttl, cookie_ttl)' to correctly sync client and server session expirations)
ttlint Number of seconds to keep a session alive.cookie_ttlint Number of seconds to keep long storage cookie alive.session_namestring Name of the session.session_httponlybool True to enable HTTP only session cookies.
cacheMinphp\Cache\CacheviewView As a factory (new instance each time)loaderLoaderpdoPDO
Creating and Using the Container
First create a new config file called services.php that will be used to
define our service providers.
Each service is defined as the fully qualified class name. It can be whatever you want as long as it can be properly autoloaded.
/config/services.php
Next, create the service provider that matches the one we added to services.php.
/app/ServiceProviders/MinphpBridge.php
Note: You can auotload classes in this directory by defining the namespace in your composer.json file under the "autoload" section like so:
Updating init.php
Update /lib/init.php so it looks like the following:
Removing Unused Files
With this bridge in place, you can now remove minPHP 0.x files that are no longer required in your project.
Remove the following directories and files:
- components/acl/
- components/input/
- components/record/
- components/session/
- helpers/date/
- helpers/form/
- helpers/html/
- helpers/javascript/
- helpers/pagination/
- helpers/xml/
- config/core.php
- config/database.php (unless you used it in your
MinphpBridgeservice provider) - config/session.php
- lib/ - except the modified
init.phpfile
Q: Why do we keep the
init.phpfile?A: Because
index.phploads it in minPHP 0.x, and we're maintaining backwards compatibility. Ifinit.phpisn't loaded anywhere else, then you could put its contents in another file and update yourindex.phpfile to load that file instead. It's up to you.
All versions of bridge with dependencies
minphp/container Version ^2.1
minphp/acl Version ^2.0
minphp/cache Version ^1.0
minphp/configure Version ^2.0
minphp/date Version ^1.0
minphp/form Version ^1.0
minphp/html Version ^1.0
minphp/input Version ^1.0
minphp/javascript Version ^1.0
minphp/pagination Version ^1.0
minphp/record Version ^3.0
minphp/session Version ^1.2.1
minphp/xml Version ^1.0
minphp/language Version ~1.1.1