English 中文(简体)
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. But we have the same structure as yours, we realize this through SVN. All of our projects got a SVN repository and common extensions have their own repository. Through svn:externals the extensions are linked into the concrete project. 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. 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. 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). This t3x file can be installed as a extension (Import extension) on all your other sites.

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. 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).

You can enable installing global extensions via the Install Tool. Once inside the tool, click on All Configuration , then search for allowGlobalInstall. Or put the following line into your localconf.php:

$TYPO3_CONF_VARS[ EXT ][ allowGlobalInstall ] =  1 ;

At last, but not least, you need to make sure the typo3/ext/ directory is writeable.

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. 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 )). 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.





相关问题
How can I symlink a file in Linux? [closed]

I want to make a symbolic link in Linux. I have written this Bash command where the first path is the folder I want link into and the second path is the compiled source. ln -s +basebuild+ /IpDome-...

How to create symbolic links in the output .tar.gz file?

We are using Windows as a development system and Ant to create the platform-specific bundles. For the macOS specific bundle (.tar.gz file) we are using the tar task. I want to create a symbolic link ...

Ignore symlinks in clean URL s in .htaccess

Example URL: example.com/user /user is both a symlinked directory and a valid URL to content on my site. I user Horde Routes to request the content and all requests to the site go through index.php. ...

Create broken symlink with Python

Using Python I want to create a symbolic link pointing to a path that does not exist. However os.symlink just complains about "OSError: [Errno 2] No such file or directory:".. This can easily be done ...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

热门标签