ext_update::main PHP Method

main() public method

public main ( ) : string
return string
    public function main()
    {
        $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('cf_extbase_reflection');
        $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('cf_extbase_reflection_tags');
        $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('cf_extbase_object');
        $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('cf_extbase_object_tags');
        return $GLOBALS['TYPO3_DB']->sql_affected_rows() . ' rows have been updated';
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Returns true, if ext_update class says it wants to run.
  *
  * @param string $extensionKey extension key
  * @return mixed NULL, if update is not available, else update script return
  */
 public function executeUpdateIfNeeded($extensionKey)
 {
     $this->requireUpdateScript($extensionKey);
     $scriptObject = new \ext_update();
     // old em always assumed the method exist, we do so too.
     // @TODO: Make this smart, let scripts implement interfaces
     // @TODO: Enforce different update class script names per extension
     // @TODO: With different class names it would be easily possible to check for updates in list view.
     $accessReturnValue = $scriptObject->access();
     $result = NULL;
     if ($accessReturnValue === TRUE) {
         // @TODO: With current ext_update construct it is impossible
         // @TODO: to enforce some type of return
         $result = $scriptObject->main();
     }
     return $result;
 }
ext_update