function _do_index_this_file($csv_filename) { $logger = Logger::getLogger('Indexer._do_index_this_file'); $full_data_filename = realpath($this->_data_root . DIRECTORY_SEPARATOR . $csv_filename); // $logger->debug("\$full_data_filename= '$full_data_filename"); $this->_nb_indexed_files += 1; $fih = fopen("{$full_data_filename}", 'r'); $index_file_name = "{$full_data_filename}" . '.index'; $foh = fopen($index_file_name, 'w'); preg_match("/(^|\\\\|\\/)([^\\\\\\/]+)\\.csv/", $full_data_filename, $matches); $tableName = $matches[2]; // $logger->debug("nom de la table = '$tableName'"); $ligne_champs = fgets($fih); // $logger->debug("\$ligne_champs = '$ligne_champs'"); $position = ftell($fih); $this->_nb_indexed_entries_in_individual_file = 0; while (($ligne_valeurs = fgets($fih)) != NULL) { $this->_nb_indexed_entries += 1; $this->_nb_indexed_entries_in_individual_file += 1; $champsValeurs = parseCSV($ligne_champs, $ligne_valeurs); $champsValeurs['dbName'] = 'Inuktitut'; $champsValeurs['tableName'] = $tableName; // $object = LinguisticObjects::makeLinguisticObject($champsValeurs); $object_ids = LinguisticObjects::make_object_ids($champsValeurs); // $logger->debug("\$object_ids= ".print_r($object_ids,TRUE)); foreach ($object_ids as $an_id) { $entry = $an_id->toString() . ':' . $position . "\n"; fputs($foh, $entry); } $position = ftell($fih); } fclose($fih); fclose($foh); return $index_file_name; }