Hi community
I'd like to use the php imagick extension in order to create a jpg image from a uploaded pdf file. (see http://php.net/manual/en/book.imagick.php)
I figured that the a right way to do so would be to use the postUpload hook.
However, I never used Contao Hooks and can't figure out how to do it...
I added
Code:
$GLOBALS['TL_HOOKS']['postUpload'][] = array('MyClass', 'myPostUpload');
to \system\config\dcaconfig.php
but I got the following error
Code:
Warning: in_array() expects parameter 2 to be array, null given in system\modules\core\library\Contao\System.php on line 140
#0 [internal function]: __error(2, 'in_array() expe...', 'C:\Program File...', 140, Array)
#1 system\modules\core\library\Contao\System.php(140): in_array('getInstance', NULL)
#2 system\modules\core\drivers\DC_Folder.php(975): Contao\System->import('MyClass')
#3 system\modules\core\classes\Backend.php(650): Contao\DC_Folder->move()
#4 system\modules\core\controllers\BackendMain.php(131): Contao\Backend->getBackendModule('files')
#5 contao\main.php(20): Contao\BackendMain->run()
#6 {main}
Fatal error: Class 'MyClass' not found in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\projects\mysite\system\modules\core\library\Contao\System.php on line 140
Not surprisingly, since I dont know where to save MyClass.php
Code:
// MyClass.php
public function myPostUpload($arrFiles)
{
// Do something
}
Could someone help me out on this one?
Edit : Contao version is 3.5.14
Thanks a lot
Vinny
Bookmarks