<tfoot id='9wbE3'></tfoot>
    <legend id='9wbE3'><style id='9wbE3'><dir id='9wbE3'><q id='9wbE3'></q></dir></style></legend>

      <small id='9wbE3'></small><noframes id='9wbE3'>

        <bdo id='9wbE3'></bdo><ul id='9wbE3'></ul>

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

      1. 我可以在我的项目中使用 Zend translate、date 和 cache 作为独立类吗?

        时间:2023-05-30
      2. <small id='EFlau'></small><noframes id='EFlau'>

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

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

              <tfoot id='EFlau'></tfoot>

                • 本文介绍了我可以在我的项目中使用 Zend translate、date 和 cache 作为独立类吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我将使用 Zend 框架,但只是 Zend 的一些工具,如翻译、日期和缓存.我可以将它用作独立类吗?我的项目有自己的结构,我不想使用整个 Zend 固件.如果是,我应该在我的项目中包含哪些文件?是否有单独使用每个 Zend fw 工具的文档?

                  I'm going to use Zend framework but just some tool of Zend like translate, date and cache. Can I use it as standalone class? My project has it own structure and I don't want use the whole Zend fw. If yes, which files should I include in my project? Is there a docs for using each Zend fw tool as standalone?

                  推荐答案

                  请记住,要在另一个项目中使用各种 Zend Framework 组件,您只需要在您的 Zend 库的某个位置>include_path.使用一个组件复制整个内容似乎有些矫枉过正,但这只是磁盘空间.除非调用它们,否则将这些文件放在那里不会影响性能.这样,您就不必担心依赖项,例如 Zend_Exception 及其各种特定于组件的子类.

                  And remember, to use various Zend Framework components in another project, you just need to have the Zend library somewhere on your include_path. Copying the whole thing may seem overkill to use one component, but it's only disk space. Having those files there doesn't affect performance unless they are called upon. And this way, you don't have to sweat the dependencies, like Zend_Exception and its various component-specific subclasses.

                  因此,例如,如果您有一个文件夹 myapp/lib 来包含您的外部库,您只需确保您的包含路径包含该 lib 文件夹并复制将 Zend 文件夹作为 myapp/lib/Zend 放入其中.

                  So, for example, if you have a folder myapp/lib to contain your external libraries, you simply make sure that your include path contains that lib folder and copy the Zend folder into it as myapp/lib/Zend.

                  然后要使用像 Zend_Translate 这样的组件,您所要做的就是如下所示:

                  Then to use a component like Zend_Translate, all you have to do is something like the following:

                  require_once 'Zend/Translate.php';
                  $options = array(
                      // your options here
                  );
                  $translate = new Zend_Translate($options);
                  

                  通过某种自动加载机制,您甚至可以避免 require_once 调用.设置自动加载就像将以下内容放在某种通用/引导文件中一样简单:

                  With some kind of autloading mechanism in place, you can avoid even the require_once call. Setting up autoloading is as easy as putting the following in some kind of common/bootstrap file:

                  require_once 'Zend/Loader/Autoloader.php';
                  Zend_Loader_Autoloader::getInstance();
                  

                  然后是任何遵循 PEAR 1-class-1-file 命名约定的类 无需显式添加任何 require/include 语句即可加载.

                  Then any classes that follow the PEAR 1-class-1-file naming convention can be loaded without explicitly adding any require/include statements.

                  如果磁盘空间真的是一个问题,并且你真的不想要整个 Zend 库,那么你可以研究一个打包器,比如 Jani Hartikainen 的打包器.

                  If disk-space really is a concern and you really don't want the whole Zend library, then you could investigate a packageizer, like Jani Hartikainen's Packageizer.

                  这篇关于我可以在我的项目中使用 Zend translate、date 和 cache 作为独立类吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 Zend 框架上通过 SMTP 发送电子邮件 下一篇:Zend 表单验证

                  相关文章

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

                    <tfoot id='VsVIo'></tfoot>
                    • <bdo id='VsVIo'></bdo><ul id='VsVIo'></ul>

                      <legend id='VsVIo'><style id='VsVIo'><dir id='VsVIo'><q id='VsVIo'></q></dir></style></legend>