Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
RELEASE CANCELED (but code below) - VZippy, Vanilla Packer alternative (Occam's Razor Rules)
This discussion has been closed.
Comments
Some people seem to have problems with LOCAL installs (blank screens) that disappear with LIVE installs.
Suspect it's a path-related issue... (win vs linux or so) Will have to look into it over the weekend. Once
done/fixed I will upload vzippy to the add-on server.
The good news:
Two testers tell me that all extensions seem to work for them without code adaptation.
One tester has 34 (!) extensions, another 28, Dino's test forum has 23.
More testers welcome. Whisper your email address to me here.
Like I said, great work (I'm a php/js noob myself), I just personally don't agree with the execution. I'm sure some people will, so definitely keep going with this and I'll help where I can.
To clarify: when you say "with the execution" you mean
"inclusion of the JS into the HTML file and leave all compression/optimization to mod_gzip" or something else?
I know it wastes more bandwidth and it's the less-than-perfect solution, but it's also transparent and simple
because it ONLY makes minor changes to the AddScript routines in the Vanilla theme (and not the core).
Of course caching the JS packages as one external link is a *much* better idea (and I may add it yet,
as well as some CSS on-the-fly compression), but the dynamic caching adds a lot of complexity -- perhaps
the vpacker discussion speaks for itself in this context?
IMHO requiring PHP/JS or CS rewrites of popular add-ons so the vpacker add-on (or vzippy for that matter) will work
is unwise... It undoes all recent progress made with the update-checker unless the add-ons are changed permanently
*and* continue to work on older vanilla installs too.
Guys, I've decided to CANCEL a public add-on release of VZippy and reserve it for personal use only.
My goal for VZippy was to make a SIMPLE and TRANSPARENT add-on that SPEEDS UP vanilla as much
as possible with A MINIMAL AMOUNT of patching required to core or add-ons. I think I've succeeded,
as VZippy (seems to) require NO patches to popular add-ons, other than JQ , JQM and iBox because
of the path issue, but in dealing with the latter I've come to realize I have no time to support it even
if it all worked flawlessly.
I look forward to the final release of vanilla packer by Dinoboff.
which is s perhaps slightly more complex than I'd like, but also much more advanced.
For the benefit of whomever might be interested I've included the release notes and some slightly
commented code in the next post.
TT
====================================================================== TT: PRELIMINARY NOTES ON VZIPPY INSTALL: ====================================================================== TT: #1 DUPLICATE /THEMES/VANILLA as /THEMES/VZIPPY/ TT: #2 DROP HEAD.PHP FILE in /THEMES/VZIPPY/ folder TT: #3 CHANGE THEME SETTINGS FOR YOUR FORUM TO VZIPPY TT: #4 CLEAR YOUR CACHE, CLOSE BROWSER, OPEN BROWSER, OPEN YOUR SITE TT: #5 ENJOY! ====================================================================== ALTERNATIVE INSTALL Drop HEAD.PHP contained in this archive into your /THEMES/VANILLA folder Note: Do NOT drop HEAD.PHP in /THEMES folder, that is the original you want to keep. The first install notes allow you to switch to/from VZIPPY via custom theme selection. ====================================================================== CLIENT SIDE: Tested with the vanilla default style only, though it should work with *any* style what does not have a custom HEAD.PHP (other THEMES, might also easily be adapted by the way) ====================================================================== SERVER SIDE: Tested it with PHP 4.4.4 on Apache/1.3.37 (Unix) with mod_gzip/1.3.26.1a mod_ssl/2.8.28 OpenSSL/0.9.7a mod_perl/1.29 FrontPage/5.0.2.2510 Do note that mod_gzip is installed, zlib is too, but zlib.output_compression is set to OFF (important according to some articles) ====================================================================== KNOWN ISSUES: I've had my FF 2.0.0.3 browser crash several times when changing the theme from normal vanilla to vzippy. Not sure if this is a clash with a running firebug install. Error complains about XPCOM_CORE.dll The SMILE add-on is incompatible (something about the JS include) JQueury and JQMedia require a modification to hardcode the JS root path. ======================================================================
VZIPPY CODE in the next comment:
(copy in its entirity into HEAD.PHP and install as per above)
<?php if (function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) // TT: WHAT: only start if compression available and zlib is available // TT: TODO: check out issues with zlib compression being ON and ob_gzhandler/mod-gzip, // opinions vary over proper setting { ob_start('ob_gzhandler'); } else // TT: TODO: at present we continue, could be made to die() instead or show descriptive error { ob_start(); } // TT: Code above MUST appear as first thing in the file or compression will fail, // nothing can appear before <? PHP. // ENABLE/DISABLE DEBUGGING ini_set('error_reporting', E_ALL); ini_set('display_errors','On'); // ================================================================================================= // TT: PRELIMINARY NOTES ON VZIPPY INSTALL: // ================================================================================================= // TT: #1 DUPLICATE /THEMES/VANILLA as /THEMES/VZIPPY/ // TT: #2 DROP THIS FILE (HEAD.PHP) in /THEMES/VZIPPY/ folder (usually contains ONLY a readme.txt) // TT: #3 CHANGE THEME SETTINGS FOR YOUR FORUM TO VZIPPY // TT: #4 CLEAR YOUR CACHE, CLOSE BROWSER, OPEN BROWSER, OPEN YOUR SITE // TT: #5 ENJOY! // ================================================================================================= // TT: Step 1. // TT: WHAT: Calculate server root path (i.e. strip web root, e.g. /vanilla/ from application path) // TT: USED: Only to determine full path to script (on/around line 100) // TT: NOTE: Why is there not config var for the server root path in settings.php, strange! // TT: TODO: This may cause issues on a local install... verify... $vzippy_root = substr($this->Context->Configuration['APPLICATION_PATH'],0,(strlen($this->Context->Configuration['APPLICATION_PATH'])-strlen($this->Context->Configuration['WEB_ROOT']))); // TT: Inserted this file read function // TT: TODO: Check if there's a better/safer one already present in Vanilla library core code function _GetFiles($file_path){ // Does it exist if (!file_exists($file_path)){ return false; } // Can we get a read-only handle if (!$handle = fopen($file_path, "r")) { return false; } // Read the file if (!$content = fread($handle, filesize($file_path))) { return false; } // Close handle @fclose($handle); // Return content return $content; } // <!-- '.$vzippy_root.' --> // Note: This file is included from the library/Framework/Framework.Control.Head.php class. $HeadString = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'.$this->Context->GetDefinition('XMLLang').'"> <head> <title>'.$this->Context->Configuration['APPLICATION_TITLE'].' - '.$this->Context->PageTitle.'</title> <link rel="shortcut icon" href="'.$this->Context->StyleUrl.'favicon.ico" />'; while (list($Name, $Content) = each($this->Meta)) { $HeadString .= ' <meta name="'.$Name.'" content="'.$Content.'" />'; } // TT: NOTE: Stylesheets difficult because of @MEDIA and @IMPORT stuff as well as // PRINT vs SCREEN version, so ignore for now // TT: NOTE: Compressing CSS on-the-fly is an interesting idea for expansion later-on // see http://paulstamatiou.com/2007/03/18/how-to-optimize-your-css-even-more/ if (is_array($this->StyleSheets)) { while (list($Key, $StyleSheet) = each($this->StyleSheets)) { $HeadString .= ' <link rel="stylesheet" type="text/css" href="'.$StyleSheet['Sheet'].'"'.($StyleSheet['Media'] == ''?'':' media="'.$StyleSheet['Media'].'"').' />'; } } // TT: Step 2. // TT: WHAT: Loop over script array, insert all JS directly into document (unless its scriptaculous) // TT: GOAL: create one document to reduce connections, then gzip this document to reduce bandwith // TT: NOTE: original code for reference... // // if (is_array($this->Scripts)) { // $ScriptCount = count($this->Scripts); // $i = 0; // for ($i = 0; $i < $ScriptCount; $i++) { // $HeadString .= ' // <scr ipt type="text/javascript" src="'.$this->Scripts[$i].'"></scr ipt>'; // } // } if (is_array($this->Scripts)) { $ScriptCount = count($this->Scripts); // TT: Include local JS header (since it's not included in JS file) with some formatting $HeadString .= ' <script language="JavaScript"> <!-- '; // TT: WHAT: Loop over scripts, include insertion marker for debugging & review $i = 0; for ($i = 0; $i < $ScriptCount; $i++) { // TT: WHAT: If not scriptaculous, read content and include straight into HTML if (!strstr( $this->Scripts[$i], 'scriptaculous.js')) { $HeadString .= ' /* +==== vzippy include: ==========================================================+'.' // | '.$this->Scripts[$i].' // +-------------------------------------------------------------------------------+*/'.' '; $HeadString .= _GetFiles($vzippy_root.$this->Scripts[$i]).' '; } else { // TT: WHAT: If scriptaculous force-include all scriptaculous elements (*HACK*) // TT: TODO: Clean up header inclusions at later stage, generic insertion, perhaps in _getfile $HeadString .= ' /* +==== vzippy include: ==========================================================+'.' // | SCRIPTACULOUS: builder.js // +-------------------------------------------------------------------------------+*/'.' '; $HeadString .= _GetFiles($this->Context->Configuration['APPLICATION_PATH'].'js/builder.js'); $HeadString .= ' /* +==== vzippy include: ==========================================================+'.' // | SCRIPTACULOUS: effects.js // +-------------------------------------------------------------------------------+*/'.' '; $HeadString .= _GetFiles($this->Context->Configuration['APPLICATION_PATH'].'js/effects.js'); $HeadString .= ' /* +==== vzippy include: ==========================================================+'.' // | SCRIPTACULOUS: dragdrop.js // +-------------------------------------------------------------------------------+*/'.' '; $HeadString .= _GetFiles($this->Context->Configuration['APPLICATION_PATH'].'js/dragdrop.js'); $HeadString .= ' /* +==== vzippy include: ==========================================================+'.' // | SCRIPTACULOUS: controls.js // +-------------------------------------------------------------------------------+*/'.' '; $HeadString .= _GetFiles($this->Context->Configuration['APPLICATION_PATH'].'js/controls.js'); $HeadString .= ' /* +==== vzippy include: ==========================================================+'.' // | SCRIPTACULOUS: slider.js // +-------------------------------------------------------------------------------+*/'.' '; $HeadString .= _GetFiles($this->Context->Configuration['APPLICATION_PATH'].'js/slider.js'); } } $HeadString .= ' --> </script>'; } // TT: NOTE: No modifications past this point if (is_array($this->Strings)) { $StringCount = count($this->Strings); $i = 0; for ($i = 0; $i < $StringCount; $i++) { $HeadString .= $this->Strings[$i]; } } $BodyId = ""; if ($this->BodyId != "") $BodyId = ' id="'.$this->BodyId.'"'; echo $HeadString . '</head> <body'.$BodyId.' '.$this->Context->BodyAttributes.'>'; ?>