Download the PHP package openbuildings/environment-backup without Composer
On this page you can find all versions of the php package openbuildings/environment-backup. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download openbuildings/environment-backup
More information about openbuildings/environment-backup
Files in openbuildings/environment-backup
Package environment-backup
Short Description Backup/restore environment variables: globals, static vars, configs
License BSD-3-Clause
Informations about the package environment-backup
Environment Backup
Set environment variables: globals, static vars, kohana configs etc. and later restore their original values. This is useful testing when you want to have a specific environment set for the test, but don't want that test to affect other code outside of it.
The environment class is initialized with some environment groups, each handling specific type of environment. You can easily add more classes to handle different environments.
Each environment group that you add allows has a unique name of "naming" its variables so that it knows how to handle their backup
- '_POST', '_GET', '_FILES', '_SERVER', '_COOKIE' and '_SESSION' are handled by the 'Environment_Group_Globals',
- 'REMOTE_HOST', 'CLIENT_IP' and all the other variables inside the '_SERVER' variable are handled by Environment_Group_Server (this is used to easily backup restore only sertain variables of the $_SERVER super global)
- 'SomeClass::$variable' is used to handle stativ variables - it can backup / restore public, protected and private ones by Environment_Group_Static
- 'group.config_var' is used to handle Kohana config settings by Environment_Group_Config - this is used only in a Kohana Framwork environment
Example:
License
Copyright (c) 2012-2013, OpenBuildings Ltd. Developed by Ivan Kerin as part of clippings.com
Under BSD-3-Clause license, read LICENSE file.