function have_hardcoded_fixes_for($entry) { global $file_content; if ($file_content == "") { $file = fopen("SpellFixes.cpp", "r"); while (!feof($file)) { $file_content .= trim(fgets($file)); } } // return strpos( $file_content, $entry ); // -> fails at large files !!! return strfind($file_content, $entry); }
function pre_split_work_rem(&$line, &$rem_state) { /* This function manages the $line when in a rem state ($rem_state['rem_state'] = 0) */ // retrieve the rem opening tag (previously saved when the rem state was set, otherwise "<?php") if (empty($rem_state['rem_state_restart_tag'])) { $tag = '<?php'; } else { $tag = $rem_state['rem_state_restart_tag']; } // search for rem opening tags (previously saved when the rem state was set) $ind = strfind($line, $tag); if ($ind === False) { $line = ''; } else { $line = substr($line, $ind + strlen($tag)); $rem_state['rem_state'] = 1; $temp_result = pre_split_work($line, $rem_state); $line = $temp_result[0]; $rem_state = $temp_result[1]; } return array($line, $rem_state); }