Last active
August 29, 2015 14:10
-
-
Save raamdev/1d88d0b5a37d0a461577 to your computer and use it in GitHub Desktop.
Revisions
-
JasWSInc revised this gist
Dec 3, 2014 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -38,4 +38,5 @@ 'vendor_css_prefixes' => array('moz', 'webkit', 'khtml', 'ms', 'o') ); $html_compressor = new \websharks\html_compressor\core($html_compressor_options); $compressed_html = $html_compressor->compress(file_get_contents($url)); echo $compressed_html; -
JasWSInc revised this gist
Dec 3, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ /* --- Config. section. ----------------------------------------------------------------------- */ $url = 'http://yoursite.com/'; // Swap this out when testing. // Install the HTML Compressor locally, and change the following path as necessary. require_once $_SERVER['WEBSHARK_HOME'].'/websharks/html-compressor/html-compressor/stub.php'; -
JasWSInc created this gist
Dec 3, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ <?php error_reporting(-1); ini_set('display_errors', TRUE); /* --- Config. section. ----------------------------------------------------------------------- */ $url = 'http://wallshit.com/'; // Swap this out when testing. // Install the HTML Compressor locally, and change the following path as necessary. require_once $_SERVER['WEBSHARK_HOME'].'/websharks/html-compressor/html-compressor/stub.php'; /* -------------------------------------------------------------------------------------------- */ $html_compressor_options = array( 'css_exclusions' => array(), 'js_exclusions' => array('.php?'), 'cache_expiration_time' => '14 days', 'cache_dir_public' => sys_get_temp_dir(), 'cache_dir_private' => sys_get_temp_dir(), 'cache_dir_url_public' => 'http://example.com/htmlc/cache/public', 'current_url_scheme' => 'http', 'current_url_host' => parse_url($url, PHP_URL_HOST), 'current_url_uri' => parse_url($url, PHP_URL_PATH), 'compress_combine_head_body_css' => TRUE, 'compress_combine_head_js' => TRUE, 'compress_combine_footer_js' => TRUE, 'compress_inline_js_code' => TRUE, 'compress_css_code' => TRUE, 'compress_js_code' => TRUE, 'compress_html_code' => FALSE, 'benchmark' => FALSE, 'product_title' => 'HTML Compressor', 'vendor_css_prefixes' => array('moz', 'webkit', 'khtml', 'ms', 'o') ); $html_compressor = new \websharks\html_compressor\core($html_compressor_options); $compressed_html = $html_compressor->compress(file_get_contents($url));