Download the PHP package apinstein/config_magic without Composer

On this page you can find all versions of the php package apinstein/config_magic. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package config_magic

ConfigMagic

A simple organizational tool to help you manage config files for your web app.

INSTALLATION

HOW IT WORKS

A typical web app has 1 or more config files. For instance, your app might have the following files: httpd.conf (apache config) webapp.conf (framework config) sh.conf (shell script config)

A typical web app is also run on more than one server. For instance: dev-alan dev-jason staging production

Configuring your web app to run on a new envirionment can quickly become a painful process as you have to remember to edit multiple files with correct information. In my experience, a lot of time is wasted trying to:

ConfigMagic solves these problems by letting you quickly and easily set up template files for each config file. Your template file can contain default data for each variable substitution used by your configs. You then need only set up a profile.ini for each machine profile and declare any non-default data you need to use. ConfigMagic then writes out all config files for a given profile.

ConfigMagic comes with a command-line utility "cfg" that lets you quickly manage this process.

EXAMPLE

Initialize ConfigMagic for this project.

Set up an example config file

Set up an empty profile

Build all config files for the "dev" profile

Check

Output:

VARIABLE SUBSTITUION

Variables in the template files take the form of:

##my.var##

And will be replace by the corresponding ini file variable:

my.var

Variables in the profile.ini file override the default values set in the config.ini file.

Variables can also use variable substituion on variables previously defined (ie higher in the file).

a = foo b = ##a##-bar # b = foo-bar

The following additional variables are automatically defined:

##CONFIG## => the current config name ##PROFILE## => the current profile name ##CONFIG_DIR## => the absolute path to the config dir ##OUTPUT_DIR## => the absolute path to the output dir ##TEMPLATES_DIR## => the absolute path to the config/templates dir

Any variable substitution in the template file that isn't defined in any ini file will be skipped and a warning will print out.

DYNAMIC TEMPLATES

All templates are treated as PHP code, which means that you can use normal PHP syntax to dynamically generate config files based on profile data.

All variables available in normal variable substition (in form of ##varname##) are available in the template, via the $profileData variable. For instance:

NOTE: if you are actually generating a php file, you will need to escape php tags so that they are not seen as a "PHP Start Tag":

long php tags ?

DYNAMIC VARIABLES

In some cases you may want to programmatically munge the profile data directly rather than in the template files via dynamic templates.

A good example of this is to call realpath() on a path at the variable level so you don't have to remember to do this in each template.

This can be done with this simple syntax:

The php processing will occur after the variable substitution has processed.

CONCLUSION

Getting started with ConfigMagic is very easy and provides a solid organizational framework to manage your config files. I hope you enjoy it.

Please feel free to send comments or suggestions my way.


All versions of config_magic with dependencies

PHP Build Version
Package Version
Requires php Version >=5.2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package apinstein/config_magic contains the following files

Loading the files please wait ....