Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.
/ cspage-php Public archive

Automated webpage optimization utility that caches, compresses, concatenates, and otherwise optimizes HTML, CSS, JavaScript, and static file content distribution.

Notifications You must be signed in to change notification settings

CharlesStover/cspage-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CSPage (PHP)

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.

Supports

  • 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

To-Do

  • Compressing: Optipng
  • CSS: LESS/SASS, move media=print to bottom of <body> element

Documentation

  • 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.

  • 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.

    • 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.

    • 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.

    • MimeType
      • get($file)

        Returns the mime type for a given file name.

About

Automated webpage optimization utility that caches, compresses, concatenates, and otherwise optimizes HTML, CSS, JavaScript, and static file content distribution.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages