function generateConfigFile($arguments) { $configFile = mfcs::config('mfcstmp') . '/tesseract-ocr-config-' . rand() . '.conf'; exec("touch {$configFile}"); $whitelist = TesseractOCR::generateWhitelist($arguments); if (!empty($whitelist)) { $fp = fopen($configFile, 'w'); fwrite($fp, "tessedit_char_whitelist {$whitelist}"); fclose($fp); } return $configFile; }