CODE STYLE Formating gulliver/system/class.helper.php
Change format files in gulliver/system/class.helper.php
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* class.helper.php
|
* class.helper.php
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
*
|
*
|
||||||
* ProcessMaker Open Source Edition
|
* ProcessMaker Open Source Edition
|
||||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
* Copyright (C) 2004 - 2011 Colosa Inc.
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Helper
|
* Class Helper
|
||||||
* @author Erik Amaru Ortiz. <erik@colosa.com>
|
* @author Erik Amaru Ortiz. <erik@colosa.com>
|
||||||
@@ -37,7 +37,7 @@ class Helper{
|
|||||||
public $minified;
|
public $minified;
|
||||||
public $gzipModuleEnabled;
|
public $gzipModuleEnabled;
|
||||||
public $contentType;
|
public $contentType;
|
||||||
|
|
||||||
function __construct(){
|
function __construct(){
|
||||||
$this->content = '';
|
$this->content = '';
|
||||||
$this->gzipEnabled = true;
|
$this->gzipEnabled = true;
|
||||||
@@ -45,20 +45,20 @@ class Helper{
|
|||||||
$this->gzipModuleEnabled = false;
|
$this->gzipModuleEnabled = false;
|
||||||
$this->contentType = 'text/html';
|
$this->contentType = 'text/html';
|
||||||
}
|
}
|
||||||
|
|
||||||
function addFile($file){
|
function addFile($file){
|
||||||
if( is_file($file) )
|
if( is_file($file) )
|
||||||
$this->content .= file_get_contents($file);
|
$this->content .= file_get_contents($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addContent($content){
|
function addContent($content){
|
||||||
$this->content = $content;
|
$this->content = $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setContentType($ctype){
|
function setContentType($ctype){
|
||||||
$this->contentType = $ctype;
|
$this->contentType = $ctype;
|
||||||
}
|
}
|
||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
header("Content-type: {$this->contentType}");
|
header("Content-type: {$this->contentType}");
|
||||||
header('Pragma: cache');
|
header('Pragma: cache');
|
||||||
@@ -67,10 +67,10 @@ class Helper{
|
|||||||
if( $this->gzipEnabled && extension_loaded('zlib') ){
|
if( $this->gzipEnabled && extension_loaded('zlib') ){
|
||||||
$this->gzipModuleEnabled = true;
|
$this->gzipModuleEnabled = true;
|
||||||
ob_start('ob_gzhandler');
|
ob_start('ob_gzhandler');
|
||||||
} else
|
} else
|
||||||
ob_start();
|
ob_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
function minify() {
|
function minify() {
|
||||||
if ($this->contentType != 'text/css') {
|
if ($this->contentType != 'text/css') {
|
||||||
G::LoadThirdParty('jsmin', 'jsmin');
|
G::LoadThirdParty('jsmin', 'jsmin');
|
||||||
@@ -84,14 +84,14 @@ class Helper{
|
|||||||
print($this->content);
|
print($this->content);
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
function serve($type=null){
|
function serve($type=null){
|
||||||
if( isset($type) )
|
if( isset($type) )
|
||||||
$this->setContentType($ctype);
|
$this->setContentType($ctype);
|
||||||
$this->init();
|
$this->init();
|
||||||
$this->flush();
|
$this->flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
function minify($buffer) {
|
function minify($buffer) {
|
||||||
return G::removeComments($buffer);
|
return G::removeComments($buffer);
|
||||||
|
|||||||
Reference in New Issue
Block a user