CSPage (PHP) is a PHP framework designed to automate webpage optimization. It caches, compresses, concatenates, and otherwise optimizes HTML, CSS, JavaScript, and static file content distribution.
This repository contains an obsolete version that was never intended to be distributed. Future versions will be maintained in NodeJS.
- Caching: automated ETag generation, dependencies, permacaching
- Compressing: YUI compressor
- CSS: variables
- HTML: <if>/<else> and <foreach> tags, variables
- ... and countless shortcuts to decrease page development time
- Compressing: Optipng
- CSS: LESS/SASS, move media=print to bottom of <body> element
- Methods
- module($module)
Initializes and/or returns a module to use its methods.
- devMachine()
Returns whether or not the running machine is a development machine.
- devMachine($boolean)
Sets whether or not the program is operating on a development machine.
- module($module)
- Modules
- Cache
- getDir()
Gets the directory of cache files.
- getUrl()
Gets the base URL for cached files.
- getUrl($id[, $ext])
Gets the static URL of a cached file.
- setDir($dir)
Sets the directory in which to store cache files.
- setUrl($url)
Sets the base URL for cached files.
- getDir()
- Error
- count()
Returns the number of errors in the error log.
- critical($str)
Adds $str to the error log, outputs the errors, and terminates the program.
- debug($str)
Adds $str to the debug logger.
- debugEnabled()
Returns whether debugging should be treated as enabled.
- debugEnabled($bool)
Enables or disables debugging output.
- handler($no, $str[, $file, $line, $context])
Default error handler. Adds $str to the error log.
- output($return_only)
Sets the page output to a plaintext display of the error log.
If $return_only flag is true, returns the text log instead of outputting it.
- count()
- HTML
- body($html)
A file that contains or the HTML contents of the <body>.
- description($description)
Sets the meta description of the page.
- element($name, $attributes, $contents)
Returns the markup of an element with the given attributes and contents.
- keywords($keywords)
Sets the meta keywords of the page.
- meta($name, $content)
Sets a meta tag.
- output($return_only)
Outputs an optimized HTML document.
If $return_only flag is true, returns the document instead of outputting it.
- themeColor($color)
Sets the mobile color for the webpage.
- body($html)
- MimeType
- get($file)
Returns the mime type for a given file name.
- get($file)
- Cache