Classes/Scheduler/Base.php
public static function execute( array $conf, array $jobs, $sites )
	{
		$aimeos = Aimeos\Base::getAimeos();
		$context = self::getContext( $conf );
		$process = $context->getProcess();

		// Reset before child processes are spawned to avoid lost DB connections afterwards (TYPO3 9.4 and above)
		if( method_exists( '\TYPO3\CMS\Core\Database\ConnectionPool', 'resetConnections' ) ) {
			 GeneralUtility::makeInstance( 'TYPO3\CMS\Core\Database\ConnectionPool' )->resetConnections();
		}

		$manager = \Aimeos\MShop::create( $context, 'locale' );

		foreach( self::getSiteItems( $context, $sites ) as $siteItem )
		{
			$localeItem = $manager->bootstrap( $siteItem->getCode(), '', '', false );
			$localeItem->setLanguageId( null );
			$localeItem->setCurrencyId( null );

			$context->setLocale( $localeItem );

			foreach( $jobs as $jobname )
			{
				$fcn = function( $context, $aimeos, $jobname ) {
					\Aimeos\Controller\Jobs::create( $context, $aimeos, $jobname )->run();
				};

				$process->start( $fcn, [$context, $aimeos, $jobname], true );
			}
		}
	}
public static function execute( array $conf, array $jobs, $sites )
	{
		$aimeos = Aimeos\Base::getAimeos();
		$context = self::getContext( $conf );
		$process = $context->getProcess();

		// Reset before child processes are spawned to avoid lost DB connections afterwards (TYPO3 9.4 and above)
		if( method_exists( '\TYPO3\CMS\Core\Database\ConnectionPool', 'resetConnections' ) ) {
			 GeneralUtility::makeInstance( 'TYPO3\CMS\Core\Database\ConnectionPool' )->resetConnections();
		}

		$manager = \Aimeos\MShop::create( $context, 'locale' );

		foreach( self::getSiteItems( $context, $sites ) as $siteItem )
		{
			$localeItem = $manager->bootstrap( $siteItem->getCode(), '', '', false );
			$localeItem->setLanguageId( null );
			$localeItem->setCurrencyId( null );

			$context->setLocale( $localeItem );

			foreach( $jobs as $jobname )
			{
				$fcn = function( $context, $aimeos, $jobname ) {
					\Aimeos\Controller\Jobs::create( $context, $aimeos, $jobname )->run();
				};

				$process->start( $fcn, [$context, $aimeos, $jobname], true );
			}
		}
	}
public static function execute ( array $ conf , array $ jobs , $ sites ) { $ aimeos = Aimeos \ Base :: getAimeos ( ) ; $ context = self :: getContext ( $ conf ) ; $ process = $ context -> getProcess ( ) ; // Reset before child processes are spawned to avoid lost DB connections afterwards (TYPO3 9.4 and above) if ( method_exists ( '\TYPO3\CMS\Core\Database\ConnectionPool' , 'resetConnections' ) ) { GeneralUtility :: makeInstance ( 'TYPO3\CMS\Core\Database\ConnectionPool' ) -> resetConnections ( ) ; } $ manager = \ Aimeos \ MShop :: create ( $ context , 'locale' ) ; foreach ( self :: getSiteItems ( $ context , $ sites ) as $ siteItem ) { $ localeItem = $ manager -> bootstrap ( $ siteItem -> getCode ( ) , '' , '' , false ) ; $ localeItem -> setLanguageId ( null ) ; $ localeItem -> setCurrencyId ( null ) ; $ context -> setLocale ( $ localeItem ) ; foreach ( $ jobs as $ jobname ) { $ fcn = function ( $ context , $ aimeos , $ jobname ) { \ Aimeos \ Controller \ Jobs :: create ( $ context , $ aimeos , $ jobname ) -> run ( ) ; } ; $ process -> start ( $ fcn , [ $ context , $ aimeos , $ jobname ] , true ) ; } } }
Execute the list of jobs for the given sites

@param array $conf Multi-dimensional array of configuration options
@param array $jobs List of job names
@param string $sites List of site names
Execute the list of jobs for the given sites