TYPO3: Change plugin from USER to USER_INT type

2019-04-07 22:44发布

I have a working TYPO3 extension. It is attached this wiki page. How can I change the code of this extension so it is of the USER_INT type? I.e. I don't want TYPO3 to cache the output of this plugin, and want TYPO3 to invoke the extension ever time a page that uses the extension, i.e. disable the caching for this extension.

标签: caching typo3
6条回答
来,给爷笑一个
2楼-- · 2019-04-07 23:12

The correct and comlete way to do this is a combination of the answers of @arturh and @Mehdi Guermazi:

  1. change the last parameter in the addPItoST43() call in ext_localconf.php from 1 to 0
  2. remove the var $pi_checkCHash = true; line from the property definitions in the head of the pi1 class.
  3. add the $this->pi_USER_INT_obj=1; line to the start of the main() function in pi1.

These changes are identical to what you will get when you use the kickstarter method explained in the solution of @bencuss.

查看更多
你好瞎i
3楼-- · 2019-04-07 23:17

The simpliest way to solve your problem is to go back to Extension Maganer, select your extension, choose "Edit in Kickstarter" from the dropdown menu, and then select the corresponding Frontend plugin to edit it's properties.

Check the first checkbox which means that you want your plugins to be rendered as USER_INT cObjects. After that click the View result button, uncheck all custom PHP files (your own code, like modules and plugins) on the right side and click the WRITE button. Please be careful. If you don't uncheck the checkboxes of your own files, they will be overwritten with dummy files.

查看更多
祖国的老花朵
4楼-- · 2019-04-07 23:22

To disable caching for your extension go to your piX/class.tx_XXX_piX.php file and remove the following line (below your class declaration):

var $pi_checkCHash = true;

You also need to add the following line in the main method (below $this->pi_loadLL();):

$this->pi_USER_INT_obj=1;    // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
查看更多
再贱就再见
5楼-- · 2019-04-07 23:29

Edit the file setup.txt of your extension "myext". Change "USER" into "USER_INT".

plugin.tx_myext = USER_INT
plugin.tx_myxt {

This extension will never be cached.

查看更多
爷的心禁止访问
6楼-- · 2019-04-07 23:31

grunwalski it's the opposite you have to change this:

t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',1);

to this:

t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',0);
查看更多
疯言疯语
7楼-- · 2019-04-07 23:38

When you have created your extension with Kickstarter you also have to go to the file [yourextension]/ext_localconf.php and change this line

t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',0);

to this:

t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',1);
查看更多
登录 后发表回答