Piwik\Common::sendHeader PHP Méthode

sendHeader() public static méthode

Sets outgoing header.
public static sendHeader ( string $header, boolean $replace = true )
$header string The header.
$replace boolean Whether to replace existing or not.
    public static function sendHeader($header, $replace = true)
    {
        // don't send header in CLI mode
        if (!Common::isPhpCliMode() and !headers_sent()) {
            header($header, $replace);
        }
    }

Usage Example

Exemple #1
0
 /**
  * Return the base.less compiled to css
  *
  * @return string
  */
 public function getUpdaterJs()
 {
     Common::sendHeader('Content-Type: application/javascript; charset=UTF-8');
     Common::sendHeader('Cache-Control: max-age=' . 60 * 60);
     $files = array('libs/bower_components/jquery/dist/jquery.min.js', 'libs/bower_components/jquery-ui/ui/minified/jquery-ui.min.js', 'libs/bower_components/materialize/dist/js/materialize.min.js', 'plugins/Morpheus/javascripts/piwikHelper.js', 'plugins/CoreHome/javascripts/donate.js', 'plugins/CoreUpdater/javascripts/updateLayout.js', 'libs/bower_components/angular/angular.min.js', 'libs/bower_components/angular-sanitize/angular-sanitize.js', 'libs/bower_components/angular-animate/angular-animate.js', 'libs/bower_components/angular-cookies/angular-cookies.js', 'libs/bower_components/ngDialog/js/ngDialog.min.js', 'plugins/CoreHome/angularjs/common/services/service.module.js', 'plugins/CoreHome/angularjs/common/filters/filter.module.js', 'plugins/CoreHome/angularjs/common/filters/translate.js', 'plugins/CoreHome/angularjs/common/directives/directive.module.js', 'plugins/CoreHome/angularjs/common/directives/focus-anywhere-but-here.js', 'plugins/CoreHome/angularjs/piwikApp.config.js', 'plugins/CoreHome/angularjs/piwikApp.js', 'plugins/Installation/javascripts/installation.js');
     return AssetManager::compileCustomJs($files);
 }
All Usage Examples Of Piwik\Common::sendHeader