[TYPO3-dev] My Own Task: Class not found
Michael Schams
typo3.lists at 2015.trash.schams.net
Thu Jun 4 15:36:15 CEST 2015
Hi,
Should not be the namespace: <Vendor>\<ExtensionKey>\<Path> ?!
Also, the extension key "myExt" looks suspicious to me. Assuming the
values you have posted here are "real" values, it should read: "myext"
and when used in a namespace, it should be "Myext".
I am not sure, if this causes the problem though.
Cheers
Michael
On Thu, 2015-06-04 at 15:25 +0200, DirkHo wrote:
> Hi,
>
> I created an own extension (myExt) that shall only contain one task.
> Therefore I added the following files:
>
> myExt\ext_emconf.php
> myExt\ext_localconf.php
> myExt\Classes\Command\MyExtCommandController.php
>
> I can install the exentsion and it's selectable in the scheduler, but
> when I save the new schedule task, a fatal error occurres: Class
> 'MyExt\\Command\\MyExtCommandController' not found in
> /var/www/typo3_src-6.2.11/typo3/sysext/core/Classes/Utility/GeneralUtility.php
>
> There are no misspellings in the namespace, classname,... I also cleared
> caches in the typo3 backend and with the install tool. Please find the
> source code/config I added below.
>
> ext_emconf.php:
> <?php
> $EM_CONF[$_EXTKEY] = array(
> 'title' => 'my ext title',
> 'description' => 'Desc',
> 'category' => 'be',
> 'author' => 'Me',
> 'author_email' => '',
> 'shy' => '',
> 'dependencies' => 'extbase',
> 'conflicts' => '',
> 'priority' => '',
> 'module' => '',
> 'state' => 'stable',
> 'internal' => '',
> 'uploadfolder' => 1,
> 'modify_tables' => '',
> 'clearCacheOnLoad' => 0,
> 'lockType' => '',
> 'author_company' => '',
> 'version' => '0.0.9',
> 'constraints' => array(
> 'depends' => array(
> 'typo3' => '6.0.0-6.2.99',
> 'php' => '5.3.0-0.0.0',
> 'extbase' => ''
> ),
> 'conflicts' => array(),
> 'suggests' => array(),
> ),
> '_md5_values_when_last_written' => '',
> 'suggests' => array(),
> );
>
>
> ext_localconf.php
> <?php
>
> if (!defined('TYPO3_MODE')) {
> die ('Access denied.');
> }
>
> if (TYPO3_MODE === 'BE') {
>
> $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['MyExt\\Command\\MyExtCommandController']
> = array(
> 'extension' => $EXTKEY,
> 'title' => 'my ext title ',
> 'description' => 'desc',
> 'additionalFields' => ''
> );
> }
>
> MyExtCommandController.php
> <?php
>
> namespace MyExt\Command;
>
>
> /**
> * Command controller which is called in CLI mode.
> *
> * @author Me
> */
> class MyExtCommandController extends
> \TYPO3\CMS\Scheduler\Task\AbstractTask {
>
> /**
> * @var \Tx_Extbase_Configuration_ConfigurationManagerInterface
> * @inject
> */
> protected $configurationManager;
>
> /**
> * TS settings
> *
> * @var array
> */
> protected $settings = array();
>
> public function execute() {
> file_put_contents('/var/www/bla.txt', 'Hello');
> }
> }
>
> Thanks and kind regards,
>
> Dirk
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>
More information about the TYPO3-dev
mailing list