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.
Download minphp/bridge
More information about minphp/bridge
Files in minphp/bridge
Package bridge
Short Description Bridges minPHP 0.x to minPHP 1.x
License MIT
Homepage http://github.com/phillipsdata/minphp-bridge
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.cache
array containing:dir
stringdir_permission
int (octal)extension
stringenabled
bool
minphp.config
array containing:dir
string
minphp.constants
array containing:APPDIR
stringCACHEDIR
stringCOMPONENTDIR
stringCONFIGDIR
stringCONTROLLERDIR
stringDS
stringHELPERDIR
stringHTACCESS
boolLANGDIR
stringLIBDIR
stringMINPHP_VERSION
stringMODELDIR
stringPLUGINDIR
stringROOTWEBDIR
stringVENDORDIR
stringVIEWDIR
stringWEBDIR
string
minphp.language
array containing:default
string 'en_us'dir
stringpass_through
bool
minphp.mvc
array containing the following keys:default_controller
stringdefault_structure
stringdefault_view
stringerror_view
stringview_extension
stringcli_render_views
bool404_forwarding
bool
minphp.session
array containing the following keys (all optional):db
array containing:tbl
string The session database tabletbl_id
string The ID database fieldtbl_exp
string The expiration database fieldtbl_val
string The value database fieldttl
int 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)
ttl
int Number of seconds to keep a session alive.cookie_ttl
int Number of seconds to keep long storage cookie alive.session_name
string Name of the session.session_httponly
bool True to enable HTTP only session cookies.
cache
Minphp\Cache\Cacheview
View As a factory (new instance each time)loader
Loaderpdo
PDO
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
MinphpBridge
service provider) - config/session.php
- lib/ - except the modified
init.php
file
Q: Why do we keep the
init.php
file?A: Because
index.php
loads it in minPHP 0.x, and we're maintaining backwards compatibility. Ifinit.php
isn't loaded anywhere else, then you could put its contents in another file and update yourindex.php
file 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/language Version ^1.1
minphp/pagination Version ^1.0
minphp/record Version ^3.0
minphp/session Version ^1.2.1
minphp/xml Version ^1.0