简体   繁体   English

TYPO3扩展和符号链接

[英]TYPO3 extensions and symlinks

Can I create a symlink to the local extension from aonther project folder? 我可以从其他项目文件夹创建到本地扩展的符号链接吗? I have a common local-server and i need to implement same extension on all local project-installations. 我有一个通用的本地服务器,并且需要在所有本地项目安装上实施相同的扩展。 I tried to put the symlink, but some times i do not get expected output. 我试图放置符号链接,但有时我没有得到预期的输出。 I get it only after clearing the cache of that perticular project. 我只有在清除该特定项目的缓存后才能得到它。

Your scenario is a common one I guess. 我猜您的情况很常见。 But as Omar said, linking to the same code base of the extension through several typo3 instances is not a good practice. 但是正如Omar所说,通过几个typo3实例链接到扩展的相同代码库不是一个好习惯。 But we have the same structure as yours, we realize this through SVN. 但是我们拥有与您相同的结构,我们通过SVN来实现这一点。 All of our projects got a SVN repository and common extensions have their own repository. 我们所有的项目都有一个SVN存储库,公共扩展都有自己的存储库。 Through svn:externals the extensions are linked into the concrete project. 通过svn:externals,扩展被链接到具体项目中。 This has the advantage that you can change the extension in the concrete project and after committing all other projects (that do have to update from svn though) contribute from it. 这样做的好处是,您可以在具体项目中更改扩展名,并在提交所有其他项目(尽管确实必须从svn更新)之后从中进行贡献。 I Think this would fit your needs, too. 我认为这也将满足您的需求。

If I understand your question correctly you have several Typo3 sites on the same server and want to share an extension between them using a symlink. 如果我正确理解您的问题,则您在同一服务器上有多个Typo3站点,并希望使用符号链接在它们之间共享扩展名。 I don't think that is a very great idea because many extensions use tables and every site normally has it's own database so you would have to do a lot of tinkering to get that to work. 我认为这不是一个好主意,因为许多扩展使用表,并且每个站点通常都有其自己的数据库,因此您必须进行大量修改才能使其正常工作。

Instead you could make all the modifications to the extension files in the typo3conf/ext/extension_name folder and then export the extension to a t3x file (Ext Manager in the Backend). 相反,您可以对typo3conf / ext / extension_name文件夹中的扩展文件进行所有修改,然后将扩展导出到t3x文件(后端中的Ext Manager)。 This t3x file can be installed as a extension (Import extension) on all your other sites. 该t3x文件可以作为扩展名(导入扩展名)安装在所有其他站点上。

If you extension does not use a database and you are planning to make frequent changes then I guess you should be able to make that work (the symlink). 如果您的扩展名不使用数据库,并且您打算进行频繁的更改,那么我想您应该可以进行这项工作(符号链接)。 Otherwise I recommend you use the first approach I described. 否则,我建议您使用我描述的第一种方法。

I have not tried this, but you should be able to install extensions globally in Typo3. 我没有尝试过,但是您应该能够在Typo3中全局安装扩展。 What this means is that the given extension is placed inside '(typo3_src/)typo3/ext/' instead of 'typo3conf/ext/', presuming both sites use the same Typo3 Core/Source (and thus typo3_src is a symlink to the location of the core). 这意味着给定的扩展名放在'(typo3_src /)typo3 / ext /'而不是'typo3conf / ext /'内,假定两个站点都使用相同的Typo3 Core / Source(因此typo3_src是指向该位置的符号链接)的核心)。

You can enable installing global extensions via the Install Tool. 您可以通过“安装工具”启用安装全局扩展。 Once inside the tool, click on 'All Configuration', then search for allowGlobalInstall. 进入工具后,单击“所有配置”,然后搜索allowGlobalInstall。 Or put the following line into your localconf.php: 或将以下行放入您的localconf.php中:

$TYPO3_CONF_VARS['EXT']['allowGlobalInstall'] = '1';

At last, but not least, you need to make sure the 'typo3/ext/' directory is writeable. 最后但并非最不重要的一点是,您需要确保'typo3 / ext /'目录是可写的。

Hope this will be to some help. 希望这会有所帮助。 If you have any further questions, let me know :) 如果您还有其他问题,请告诉我:)

As Björn mentioned, I'd sugegst to install them globally. 正如Björn所言,我建议在全球范围内安装它们。 Mind you, updating the source will require to move the extensions accordingly.. 请注意,更新源将需要相应地移动扩展名。

As for "expected output": be aware that the code in these folders is cached in various ways (mainly page content and config settings), and hence not always run. 至于“预期的输出”:请注意,这些文件夹中的代码以各种方式(主要是页面内容和配置设置)缓存,因此并不总是运行。 This is the reason a change done from "outside" the current installation is likely not to propagate to your output without clearing these caches (as you have observed). 这就是从当前安装“外部”进行的更改可能不传播到您的输出而不清除这些缓存的原因(如您所观察到的)。

When you actually install an extension via the extension manager, the cache should (if correctly configured) be cleared (interested parties may search for clearCacheOnLoad in class.em_index.php to reveal a clear_cacheCmd('all')). 当您通过扩展管理器实际安装扩展时,应清除缓存(如果配置正确)(有关各方可以在class.em_index.php中搜索clearCacheOnLoad以显示clear_cacheCmd('all'))。 There is a small checkbox, which is normally checked, during the installation process to accomplish this. 在安装过程中,通常会选中一个小复选框以实现此目的。

Omar's first approach is therefore, as I see it, the more easy way to get "expected output" and less jumbling around with global extensions. 因此,正如我所看到的,Omar的第一种方法是获得“预期输出”的更简单方法,并且减少了使用全局扩展的麻烦。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM