<tfoot id='BQv3B'></tfoot>
    <bdo id='BQv3B'></bdo><ul id='BQv3B'></ul>
  • <legend id='BQv3B'><style id='BQv3B'><dir id='BQv3B'><q id='BQv3B'></q></dir></style></legend>
  • <small id='BQv3B'></small><noframes id='BQv3B'>

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

        我可以在我的项目中使用 Zend translate、date 和 c

        时间:2023-10-02

          <legend id='ydEMI'><style id='ydEMI'><dir id='ydEMI'><q id='ydEMI'></q></dir></style></legend>
          <tfoot id='ydEMI'></tfoot>
            <tbody id='ydEMI'></tbody>

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

            <small id='ydEMI'></small><noframes id='ydEMI'>

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

                  本文介绍了我可以在我的项目中使用 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 作为独立类吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

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

                  相关文章

                  最新文章

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

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

                      <small id='NphNH'></small><noframes id='NphNH'>

                        <bdo id='NphNH'></bdo><ul id='NphNH'></ul>
                    2. <tfoot id='NphNH'></tfoot>