<legend id='8mmyF'><style id='8mmyF'><dir id='8mmyF'><q id='8mmyF'></q></dir></style></legend>
  • <i id='8mmyF'><tr id='8mmyF'><dt id='8mmyF'><q id='8mmyF'><span id='8mmyF'><b id='8mmyF'><form id='8mmyF'><ins id='8mmyF'></ins><ul id='8mmyF'></ul><sub id='8mmyF'></sub></form><legend id='8mmyF'></legend><bdo id='8mmyF'><pre id='8mmyF'><center id='8mmyF'></center></pre></bdo></b><th id='8mmyF'></th></span></q></dt></tr></i><div id='8mmyF'><tfoot id='8mmyF'></tfoot><dl id='8mmyF'><fieldset id='8mmyF'></fieldset></dl></div>
    • <bdo id='8mmyF'></bdo><ul id='8mmyF'></ul>

        <small id='8mmyF'></small><noframes id='8mmyF'>

      1. <tfoot id='8mmyF'></tfoot>

        将外部脚本与 Zend Framework 集成

        时间:2023-10-02

        1. <tfoot id='xy4xT'></tfoot>
            <tbody id='xy4xT'></tbody>

          <i id='xy4xT'><tr id='xy4xT'><dt id='xy4xT'><q id='xy4xT'><span id='xy4xT'><b id='xy4xT'><form id='xy4xT'><ins id='xy4xT'></ins><ul id='xy4xT'></ul><sub id='xy4xT'></sub></form><legend id='xy4xT'></legend><bdo id='xy4xT'><pre id='xy4xT'><center id='xy4xT'></center></pre></bdo></b><th id='xy4xT'></th></span></q></dt></tr></i><div id='xy4xT'><tfoot id='xy4xT'></tfoot><dl id='xy4xT'><fieldset id='xy4xT'></fieldset></dl></div>

          <legend id='xy4xT'><style id='xy4xT'><dir id='xy4xT'><q id='xy4xT'></q></dir></style></legend>
          • <small id='xy4xT'></small><noframes id='xy4xT'>

                <bdo id='xy4xT'></bdo><ul id='xy4xT'></ul>

                  本文介绍了将外部脚本与 Zend Framework 集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  将外部脚本集成到 Zend 框架的最佳方法是什么?让我解释一下,因为我可能问错了.我有一个下载和解析 XML 文件的脚本.该脚本作为日常 cron 作业运行,需要将其数据转储到数据库中.

                  What is the best way to integrate an external script into the Zend Framework? Let me explain because I may be asking this the wrong way. I have a script that downloads and parses an XML file. This script, which runs as a daily cron job, needs to dump its data into the database.

                  我正在为使用此脚本的站点使用 Zend Framework,在我看来,最好使用我的 Zend_Db_Abstract 子类模型来添加和更新数据库.怎么做呢?我的脚本是否位于 Zend 组件旁边的库中(即 library/Mine/Xmlparse.php),从而可以访问各种 ZF 组件?我是否只需要在文件本身中包含正确的模型文件和 Zend DB 组件?处理这种集成的最佳方法是什么?

                  I am using Zend Framework for the site which uses this script and it seems to me that it would be best to use my subclassed model of Zend_Db_Abstract to do the adding and updating of the database. How does one go about doing this? Does my script go in the library next to the Zend Components (i.e. library/Mine/Xmlparse.php) and thus have access to the various ZF components? Do I simply need to include the correct model files and the Zend DB component in the file itself? What is the best way to handle this sort of integration?

                  推荐答案

                  在您的库目录中,您应该在 Zend 库文件夹旁边有您自己的库.无论你怎么称呼它(Mylib、Project 等),你都应该将它包含到 Zend Autoloader 中,具体操作如下:

                  In your library directory you should have your own library next to the Zend library folder. Whatever you call it (Mylib, Project, ...) you should include it into the Zend Autoloader and that's done as follows:

                  require_once 'Zend/Loader/Autoloader.php';
                  $loader = Zend_Loader_Autoloader::getInstance();
                  $loader->registerNamespace('Project_');
                  $loader->setFallbackAutoloader(true);
                  if ($configSection == 'development')
                  {
                      $loader->suppressNotFoundWarnings(false);
                  }
                  

                  为了让您的库与 ZF 和 Autoloader 很好地集成,您应该坚持 ZF 命名约定.这意味着两件事:

                  In order for you library to integrate nicely with ZF and the Autoloader you should stick to the ZF naming conventions. This means two things:

                  • 如果您扩展现有的 ZF 类,请复制 ZF 文件夹结构,以便您的文件具有相同的路径和名称,但库名称除外.例如./library/Zend/Db/Abstract.php =>/library/Project/Db/Abstract.php.
                  • 如果您编写自己的类,仍要坚持自动加载器的 ZF 命名约定以找到它们.

                  这篇关于将外部脚本与 Zend Framework 集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:此结果是仅向前的结果集,不支持向前移动后调 下一篇:图片上传安全 - 使用 GD 重新处理

                  相关文章

                  最新文章

                  1. <small id='KsEDM'></small><noframes id='KsEDM'>

                        <bdo id='KsEDM'></bdo><ul id='KsEDM'></ul>
                    1. <tfoot id='KsEDM'></tfoot>
                    2. <legend id='KsEDM'><style id='KsEDM'><dir id='KsEDM'><q id='KsEDM'></q></dir></style></legend>
                    3. <i id='KsEDM'><tr id='KsEDM'><dt id='KsEDM'><q id='KsEDM'><span id='KsEDM'><b id='KsEDM'><form id='KsEDM'><ins id='KsEDM'></ins><ul id='KsEDM'></ul><sub id='KsEDM'></sub></form><legend id='KsEDM'></legend><bdo id='KsEDM'><pre id='KsEDM'><center id='KsEDM'></center></pre></bdo></b><th id='KsEDM'></th></span></q></dt></tr></i><div id='KsEDM'><tfoot id='KsEDM'></tfoot><dl id='KsEDM'><fieldset id='KsEDM'></fieldset></dl></div>