search
top

Runtime – Get various system infos (UPDATE)

In my recent post i talked about the Environment class and how to use it to switch databases with ease. Today i paid the blog of Neil Crookes a visit and found his most recent post to be of the same nature. How to make life easier with using environment variables in config/bootstrap.

In a comment Daniel Hofstetter was suggesting to encapsulate his env-tests into a class, and that’s what i basicly just did (”hope you like it, Neil”). Besides checking the OS you can also check for loaded extensions, read version strings, modify include paths and manage environment variables. There are some other handy shorthand methods too.

Again probably easy to combine with Environment and Configure and together a very decent set of tools for automated deployment, i think. Full PHPDoc included. If you want to know how each method works just look at the source ;-)

Hop over to GitHub: github.com/m3nt0r/cake-bits/tree/master/libs/runtime.php

Update:
I have added a bunch of new methods for Apache and tweaked the API a little to be more consistent (renamed two methods). I also added a example script with some demo calls to the lib folder. But it should all be pretty self-explanatory. Enjoy.

One Response to “Runtime – Get various system infos (UPDATE)”

  1. Neil Crookes says:

    Good stuff mate, nice one. Think I’ll be using this in my apps from now on.

Leave a Reply

top