我想知道如何使用 PHP 重新索引 Express 程序 (.CDX) 文件

问题描述 投票:0回答:1

目前,我可以使用 PHP 中的 xbase 库插入数据,但我遇到一个问题,插入数据后必须在 Express 程序中手动重新索引数据。我想知道如何编写一个PHP程序,可以在插入数据后触发重新索引过程。 这是我用于插入的代码

$remote_path8 = 'GLJNLIT.DBF';
  $temp_file = tempnam(sys_get_temp_dir(), 'dbf_temp');
  $connection = ftp_connect($ftp_server);
  ftp_login($connection, $ftp_user, $ftp_pass);
  if (ftp_get($connection, $temp_file, $remote_path8, FTP_BINARY)){

  $table1 = new TableEditor(
    $temp_file,
    [
        'editMode' => TableEditor::EDIT_MODE_CLONE,
    ]
  );
     $record1 = $table1->appendRecord();
     $record->set('VOUCHER', '111111');
     $record1->set('Seqit', '3');
     $record1->set('Voudat', '20231107');
     $record1->set('Accnum', '1154-00');
     $record1->set('Depcod', '');
     $record1->set('Jobcod', '');
     $record1->set('Phase', '');
     $record1->set('Coscod', '');
     $record1->set('Descrp', 'JIB');
     $record1->set('Trntyp', '0');
     $record1->set('Amount', '1');
     $record1->set('Chgdat', '20231107');
     $record1->set('Chgtim', '0951');
     $record1->set('Adjust', '');
     $record1->set('Chgaccfrom', '');

     $table1
     ->writeRecord($record1)
     ->save()
     ->close();

      ftp_put($connection, $remote_path8, $temp_file, FTP_BINARY); 
      ftp_close($connection);
      unlink($temp_file);

    echo "<br> DBF file GLJNL<br>";
  }else{
    echo "<br>Error downloading DBF file GLJNL";
  }
php visual-foxpro dbf reindex xbase
1个回答
0
投票

php-xbase库不支持索引,正如您在here中看到的:

我不知道CDX文件是如何工作的,所以我不打算很快实现它

© www.soinside.com 2019 - 2024. All rights reserved.