Example #1
0
 /**
  * Build the STK Whitelist
  * @param  Boolean $download Download the file, or if false add to the archive
  */
 public function build_whitelist($download)
 {
     // First the 'STK'
     $this->_whitelist('./../stk/', array('includes/critical_repair'), array('config', 'erk'), 'stk');
     // Now do the extra packages if they're included
     foreach (self::$whitelist_extras as $extra => $params) {
         // Need to run this extra?
         if (!is_dir('./whitelist_additional/' . $extra)) {
             continue;
         }
         $params = array_merge(array('./whitelist_additional/' . $extra), $params);
         call_user_func_array(array($this, '_whitelist'), $params);
     }
     if ($download) {
         print " *********************************************\n";
         print " *         THE BOM SNIFFER WHITELIST         *\n";
         print " *********************************************\n";
         print implode("\n", $this->whitelist) . "\n";
         // When only building the Sniffer we exit
         if (empty($this->build_command['lang']) && empty($this->build_command['stk'])) {
             exit;
         }
         print " *********************************************\n";
         print " *         END BOM SNIFFER WHITELIST         *\n";
         print " *********************************************\n";
         return;
     }
     // Add the whitelist to the package
     $this->stk_build->add_data(implode("\n", $this->whitelist), 'stk/includes/critical_repair/whitelist.txt');
 }