0
I Use This!
Activity Not Available

Project Summary

This project does 2 major things: 1. It makes sure you include every css and js only once in every page you generate. This is very helpful when using templating, since you want to attach the template css to the template, but if you reuse the template the css will be called several times, not necessarily causing any damage, but there is a slight performance hit, and problems in firebug (and we don't want that!) 2. If you set $GENERAL_CONFIG'aggregate' = true, then this code starts aggregating the css and js files into one large file. This helps decrease calls to http, really boosting up your site's performance.

USAGE: 1. Create the cache table (see notices) 2. Create the code accessing the cache table, basically this is a class supporting the functions $db->GetCacheInfo, $db->SetCacheInfo, and $db->CreateCacheInfo. 3. require js_css_aggregator in your code, and either call js_include_once(), or css_include_once() as necessary. 4. to output the cache into your html, the code provides the global variables $all_js and $all_css, which you just echo in your html. To provide the best performace for your site, echo $all_css at the top of your html, and echo $all_js at the bottom of your html.

NOTICES: 1. To use the aggregator you need the following db table: CREATE TABLE cache (

id int(11) NOT NULL auto_increment,
cache_name varchar(100) collate utf8_unicode_ci NOT NULL,
cache_content text collate utf8_unicode_ci NOT NULL,
version varchar(100) collate utf8_unicode_ci NOT NULL,
last_update datetime NOT NULL,
last_update_unix bigint(20) unsigned NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE KEY cache_name (cache_name)
) I didn't add the database code to the project yet because it is too customized for the project I wrote the aggregator for. So this google code is for php programmers not afraid to hack and customize code to fit their own projects. I am hoping that in the near future I will have a quiet weekend to turn this code into a closed component. 2. The code currently creates a different cache per page, but that is easily modifiable. 3. There is different code producing the js and css includes, but they are virtually identical, I will probably pretty up this code when I have the time.

WISHLIST: 1. Wrap this code in a normal class to get rid of the horrible global variables. 2. Split the parameter $GENERAL_CONFIG'aggregate' into $GENERAL_CONFIG'js-aggregate' and $GENERAL_CONFIG'css-aggregate', so people can choose whether they want to aggregate js or css only. 3. Add the database code to the class so people don't have to write it themselves. 4. That someone would either volunteer to help me with this, or that someone will take this and rewrite it into something more useful for the community :)

Tags

aggregation aggregator cache caching css javascript performance php

In a Nutshell, php-javascript-css-aggregator...

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

GNU General Public License v3.0 or later
Permitted

Place Warranty

Use Patent Claims

Commercial Use

Modify

Distribute

Forbidden

Sub-License

Hold Liable

Required

Distribute Original

Include Copyright

State Changes

Include License

Include Install Instructions

Disclose Source

These details are provided for information only. No information here is legal advice and should not be used as such.

All Licenses

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    Black Duck offers a free trial so you can discover if there are open source vulnerabilities in your code
  • ...
    compare projects before you chose one to use
  • ...
    use of OSS increased in 65% of companies in 2016
  • ...
    check out hot projects on the Open Hub

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

Community Rating

Be the first to rate this project
Click to add your rating
   Spinner
Review this Project!
Sample ohloh analysis