[TYPO3-dev] having trouble writing a custom hook

John Nicholas typo3user at mobosplash.com
Fri Mar 2 15:23:22 CET 2007


Hi,

I am trying to add a hook to one of my extensions. The long term goal is 
to trigger an external process to sync a directory on my web server with 
a media server so that typo3 can manage the video files with titles etc 
but on save or update the video files will get synced to the separate 
server.

For now I just need to get the hook to trigger but must be missing 
something. My extension is called 'bnews_ondemandvideo'. In the 
ext_localconf.php I have this line:

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][]=
'EXT:bnews_ondemandvideo/class.bnews_ondemandvideo_tcemain_processdatamap.php:bnews_ondemandvideo_tcemain_processdatamap';


then I have the file 
'class.bnews_ondemandvideo_tcemain_processdatamap.php' with this inside.

<?php
class bnews_ondemandvideo_tcemain_processdatamap {
  function processDatamap_postProcessFieldArray($status, $table, $id, 
&$fieldArray, &$this){
   $myFile = "/usr/local/apache2/htdocs/testFile.txt";
   $fh = fopen($myFile, 'a') or die("can't open file");
   fwrite($fh, "logged | $status | $table");
   fclose($fh);
  }
}
?>


At this point I just have a simple write to a log file to see if the 
function is getting called. Nothing gets written and there are no errors 
in the logs. First, is there some big thing I am missing like "you have 
to add X to file Z" or are there any tips on how to debug this stuff?

Thanks, John




More information about the TYPO3-dev mailing list