Problem using fdpf in joomla4 : class not found - class

I'm converting a Joomla 3 component to make it compatible with Joomla 4.
I'm having an issue when trying to use fpdf.
In joomla 3, the fpdf file was included like this at the top of the model : include('./components/com_mycomp/libraries/fpdf/morepagestable.php');
Then the pdf class was called this way in a function : $pdf=new PDF('P','mm','A4');
I did the same in Joomla 4 but got the following error : Class 'Mycomp\Component\Mycomp\Administrator\Model\PDF' not found
Still haven't found the correct way to include the class
Thanks in advance for your help

Related

Custom mail driver in Laravel 8

I'm using a custom mail driver with Laravel 8. It's good to work with direct mailing. But after using it should queue, an issue was found.
"Target class [mail.manager] does not exist."
I have already registered at config/app.php for customMailServiceProvider. The problem is only for when using shouldqueue at Notifications with mail. Any ideas or any suggestions? I was following the instruction for the following article.
https://www.delenamalan.co.za/2020/laravel-custom-mail-driver.html#create-a-custom-mail-transport-class
Add This code line at app/bootstrap.php
$app->alias('mail.manager', Illuminate\Mail\MailManager::class);
This is worked for me. Laravel Queue don't know the facades name "mail.manager".
Don't forget to run compose dump after code update.
In Providers/CustomMailServiceProvider.php change from:
class CustomMailServiceProvider extends ServiceProvider
{
to
class CustomMailServiceProvider extends MailServiceProvider
{

HTML2PDF : error (sometimes) when generating, but PDF generated

Let me explain !
I have a magento website. I'm generating custom PDF when my user is making an order.
It works most of the time, but for some reason, sometimes, I have this error :
Undefined property: Spipu\Html2Pdf\MyPdf::$h in ...../vendor/spipu/html2pdf/src/MyPdf.php on line 670"
The line is this :
public function getH()
{
return $this->h;
}
The class is : class MyPdf extends \TCPDF
and in TCPDF, $h is a protected variable
It's weird, knowing that my PDF is saved on my server, and I can open without getting an error..
Do you have any idea of what the problem could be ?
Ah ah got it !
Forgot to mention, i'm using a loop to make and attach my pdf to a mailer.
I had to put the declaration of the HTML2PDF inside the loop, not outside (that's make sense).
Hope this will help !

TYPO3 - includelibs security

I need to include a PHP script in my TS template :
page {
10 = USER_INT
10.includeLibs = lib_confidential.php
10.userFunc = MyClass->ConfidentialRequest
}
It works perfectly but I would like to locate the lib_confidential.php outside of my website root directory (and make something like 10.includeLibs = ../lib_confidential.php). Is it possible to secure my PHP script and how to ? I thought about creating a symlink but that doesn't give any solution.
As your installation needs an update you will have to change the mechanism for including php-functions for the future.
since TYPO3 8 you need to have a class for your php functions. So the autoloader can identify the class and execute the function you need to place the class inside of an extension or declare the class to the autoloader.
Best practice would be site extension where you configure your installation, there you can havea class with all the functions you need.
examples can be found in the manual.

Typo3 BE : No module "" could be found

I've upgraded one of typo3 module from 4.1 to 6.2 when I switch the module back end options from dropdown. The error comes. Any Idea please help
After a couple days of research. I got the solution for this.
The issue is occured because in the Iframe url: parameter 'M' {Module Name} was not generated.[you could able to see the complete url by view frame in new window]
This was due to a mis configuration that doesn't support in TYPO3 6.2
I've changed conf.php and index.php in TYPO3 Module Folder.
1.In conf.php
OLD : $MCONF['script']='index.php';
CHANGE : $MCONF["script"]="_DISPATCH";
2.In index.php
OLD CODE
unset($MCONF);
require ("conf.php");
require ($BACK_PATH."init.php");
require_once($BACK_PATH.'template.php');
require_once (PATH_t3lib."class.t3lib_scbase.php");
$LANG->includeLLFile("EXT:extension_name/mod1/locallang.php");
$BE_USER->modAccess($MCONF,1);
NEW CODE
unset($MCONF);
require ("conf.php");
//Comment----------require ($BACK_PATH."init.php");
//Comment----------require_once($BACK_PATH.'template.php');
//Comment----------require_once (PATH_t3lib."class.t3lib_scbase.php");
/*
* Changed $LANG to $GLOBALS['LANG']
* Changed $BE_USER to $GLOBALS['BE_USER']
*/
$GLOBALS['LANG']->includeLLFile('EXT:wf_tagcloud_bl/mod1/locallang.xml');
$GLOBALS['BE_USER']->modAccess($MCONF,1);

Call a custom class in zend framework

I have a very rough project that done partially in zend framework (not ZF2). The 'application', 'library' and 'public' folders are on the same root. Now i need to create a library 'Anil' in the 'library' folder at the same level where 'zend' is located.
I tried it by adding following lines in bootstrap.php :
protected function _initAutoload()
{
Zend_Loader_Autoloader::getInstance()->registerNamespace('Anil');
}
Then inside the 'Anil' folder I created Anil_Test.php :
class Anil_Test{
}
And in the controller file I added following lines :
$myTest= new Anil_Test();
But it shows a Fatal error :
Fatal error: Class 'Anil_Test' not found in.....
I know I have done something silly here because this is my first project in Zend Framework. I believe the problem is the folder structure. I can do nothing with that because 50% of the project has already been coded.
Thanks in advance.
ANIL
The file name should be library/Anil/Test.php. ;-)