rtgx

Extension UPDATE v EM

V adresári modulu vytvoríme súbor s názvom class.ext_update.php a triedou nazvanou ext_update. Táto musí obsahovať dve členské funkcie:

  1. main() - je volaná po stlačení UPDATE! v extension managery (EM)
  2. access() - určuje, či sa voľba UPDATE! bude v EM zobrazovať

Takže základná schéma bude takáto:

/**
* Class for updating extension
*
* $Id: class.ext_update.php
*
* @author Robert Gonda <>
* @package TYPO3
* @subpackage extension
*/
class ext_update {

/**
* EXT Update
*
* Create a classfile named class.ext_update.php in the root of your extension directory.
* This class must contain two functions. A main() function that is called if you choose the “UPDATE!” entry in the extensions details in the Extension Manager and an access() function that decides if the “UPDATE!” entry is shown in the extension details.
*
* @return string
*/
public function main(){

$htmlCode = array();
$htmlCode[] = 'This updates were performed successfully:';

return implode( chr(10), $htmlCode );
}

/**
* Check update
*
* @return boolean True if update should be perfomed
*/
public function access() {

return TRUE;
}
}

if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/extension/class.ext_update.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/extension/class.ext_update.php']);
}
 
Koprimovaný súbor ZIP class.ext_update.php, 660.0 (B)