PHP Classes

Packages of Chris Sprucefield

Recommend this page to a friend!
  All class groups  >  All authors  >  Packages of Chris Sprucefield (2)  >  Mission progress status  >  Reputation  
Picture of Chris Sprucefield
Name: Chris Sprucefield is available for providing paid consulting. Contact Chris Sprucefield . Chris Sprucefield Google profile
Classes: 2
Country: Malta Malta
Age: ???
All time rank: 29602 in Malta Malta
Week rank: 195 Up1 in Malta Malta Up
All time users: 648
Week users: 0
Innovation award
Innovation award
Nominee: 1x
 
  A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z  
  Files folder image Advanced INI file  
PHP Programming Innovation award nominee
August 2015
Number 4


Prize: One copy of the Zend Studio
Read and parse INI files with multiple levels
This class can read and parse INI files with N levels.

It can read and parse a given INI file and build an associative array with entries for each section and each variable value.

Sections with names with colons : are returned as multiple levels of the associative array, for instance [ abc:def ] will be returned as

$var['abc']['def'] = values;

Variable names such as a.b.c and a:b:c will be expanded into sub-levels, such as:

['a']['b']['c'] = value;

It also supports variable substitution using values of certain settings to define other settings such as:

root = "/mnt/some/path"
logs.access = "{root}/access_log"

It has now been updated with the following extensions:

#include <filename> Includes the file <filename>
#define <name> <value> Defines the constant <name> to be <value>
#iniset <name> <value> Sets the ini parameter <name> to be <value>

Includes can be N-level.
Not enough user ratings

  Files folder image PHP CSS Variables and Math  
Replace variables and math expressions in CSS
This class can replace variables and math expressions in CSS.

It can load a given CSS file and replace expressions that are defined with square brackets.

The expressions may include variables to be evaluates to given values, as well math expressions that may include sum, subtraction, multiplication and division of values.

The class returns the processed CSS stylesheet as a string with HTML style tag.

While you can do maths with CSS, sometimes, you just need to go that little further than what normal CSS allows?

Ever thought it would be nice to have the option to say:
I have this variable, defining a base width of an object, and make others multiples of that?

What if you have a variable called "$conf['base_width']?
and you could do:

.classname1 {width: [base_width]px ; }
.classname2 {width: [base_width * 2]px }

or use any other variable, together with + - * /, and even floor float values coming out of the calc
by prepending the variable name with ~, still allowing any regular CSS math?

This may be for you.

It's short, it's simple, and opens up dynamic css generation for those special cases where you just need to adjust the class definition to your needs.

Just call CSS::setConf($conf), and $css = CSS::load("myfile") ;
Not enough user ratings


  A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z