表达式引擎SimpleXmlIterator已损坏



这是我的第一个问题,我不知道如何根据指南与其他人相关。我想最后的问题是,noob是否应该试图干预他们不完全理解的代码。

我的站点依赖于在其他地方生成的xml数据库,该数据库被拼接成特定站点的格式,由原始开发人员设置。生成数据库的系统将标签从"联系人"更改为"个人",打破了拼接的数据公式。(Grr.(

我认为我已经修复了它,因为我更改了接收文件中的标记,但拼接器刚刚完全停止。(基本上,我对网站/编码的了解还不够,无法尝试进行这些更改。但我认为我可以逃脱惩罚!(

这就是我所理解的:1.每晚我们都会将一个xml文件发送到文件夹中2.php文件使用SimpleXmlIterator重新格式化原始xml。3.将重新格式化的文件发送到staging.sql文件。4.将其发送到正确的位置,以便站点在夜间加载。

第4步仍在进行,但该站点正在反复使用相同的数据。新数据只是没有通过第2步和第3步。

这就是我所做的(我只是注释掉了原始代码。我是"SOC"(:

$authors = array();
foreach ($author_array as $arr) {
  $bio = ($arr['copy_biography']) ? nl2br(htmlspecialchars($arr['copy_biography'], ENT_QUOTES)) : '';
  // SOC changed $author_title = $arr['contact_first_name'] .' '. $arr['contact_surname'];
  $author_title = $arr['person_first_name'] .' '. $arr['person_surname'];
  $authors[] = array(
    'title'     => $author_title,
    'author_id' => $arr['id'],
    // SOC changed from this to the below 'fname'     => $arr['contact_first_name'],
    'fname'     => $arr['person_first_name'],
    // SOC changed from this to the below 'lname'     => $arr['contact_surname'],
    'lname'     => $arr['person_surname'],
    // SOC ditto 'website'   => $arr['contact_web_page'],
    'website'   => $arr['person_web_page'],
    'bio'       => $bio,
    // SOC ditto 'twitter'   => $arr['contact_fax']
    'twitter'   => $arr['person_fax']
  );
}
$authors = generate_valid_xml_from_array($authors);
$authors_xml = '/var/www/hotkeybooks/biblio/authors_import.xml';
$authorfile = fopen($authors_xml,'w') or die("can't open file");
fwrite($authorfile,$authors);
fclose($authorfile);
//make the files readable
exec('chmod 444 /var/www/hotkeybooks/biblio/*.xml');

我还将staging.sql和staging.tgz.中的"contact"改为"person">

-- ----------------------------
--  Records of `exp_dd_doc_sections`
-- ----------------------------
BEGIN;
INSERT INTO `exp_dd_doc_sections` VALUES (…….<td>contact_first_name, contact_surname</td>n         <td>Text Input</td>n           <td>Would enter author full name, this field would only be used for admin purposes.</td>n          <td>y</td>n        </tr>n     <tr>n          <td>Author Biblio ID</td>n         <td>author_biblio_id</td>n         <td>id</td>n           <td>Text Input</td>n           <td>Used for relationship building and reference only</td>n            <td></td>n     </tr>n     <tr>n          <td>Author First Name</td>n            <td>author_fname</td>n         <td>contact_first_name</td>n           <td>Text Input</td>n           <td></td>n         <td></td>n     </tr>n     <tr>n          <td>Author Last Name</td>n         <td>author_lname</td>n         <td>contact_surname</td>n          <td>Text Input</td>n           <td></td>n         <td></td>n     </tr>n ………)

有人知道我所做的哪一点破坏了系统吗?我能做些什么来恢复它?我曾尝试用原始文件覆盖我的更改,但这没有帮助。

如有任何指导,我们将不胜感激。

听起来您需要一些基本的故障排除。

也许您的解析工作正常,但由于文件权限或其他原因,不同位置之间的传输失败。

向后工作:

您能确认步骤4中传输的文件是新文件吗?它有预期的修改日期吗?它有预期的数据吗?

您能确认步骤3 staging.sql中的文件是一个具有预期修改日期的新文件吗?它有预期的数据吗?

您能确认在步骤2中创建的文件是一个具有预期日期和数据的新文件吗?

您是否在错误日志中看到任何内容表明脚本中的任何内容都失败了?

最新更新