Silindi Şundan Bilinmeyen 6 Şub 2020 02:55 Hello, I´m trying to include a library for a payment module but getting grey hairs out of it. What´s the correct way cause either I get message that says like below or I can´t set the correct path even though the files are there. I´m missing something completly I guess. I want to include following file and library like this: require_once ('/usr/share/php/Com/Tecnick/Barcode/autoload.php'); but as you see the path gets totally messed. Fatal error: require_once(): Failed opening required '/home/shop/public_html/includes/library/lib_Com/Tecnick/Barcode/Barcode.inc.php' (include_path='.:/usr/share/php') in /home/shop/public_html/includes/autoloader.inc.php on line 102``` My wish is to make qr codes for Swish payment. Tested and it works just fine in setup outside Litecart. Please show me in the right direction /H
tim Founder Şundan Sweden May 2013 tarihinden beri üye tim 6 Şub 2020 03:25 Is this a composer library? In that case you can download composer for LiteCart: https://www.litecart.net/en/addons/255/composer-for-litecart Otherwise make sure the autoloader prepends the added autoloader function. https://www.php.net/manual/en/function.spl-autoload-register.php spl_autoload_register('my_autoloader', false, true);
Silindi Şundan Bilinmeyen 6 Şub 2020 14:40 Yes ist´s composer. Thanks for quick reply, i´ll have a look at your links and read a bit. Love your concept with Litecart compared to many other softwares. Logical and quick. Regards/ H
tim Founder Şundan Sweden May 2013 tarihinden beri üye tim 6 Şub 2020 22:03 Thank you for the kind words. I did work very hard to come up with it all :) Hoping doing things a little different than the industry is better in the long run.
Silindi Şundan Bilinmeyen 15 May 2020 22:22 I am having the same problem, but the library is not Composer nor I can install composer on the host system. Redsys is a credit card payment system in Spain being used by most Spanish banks (is one of two payments services). They request the some PHP libraries and installed and to add and include command on the code. When I do so, I get the same error; Fatal error: require_once(): Failed opening required '.../includes/library/lib_ISOperationMessage.inc.php' (include_path='.:/usr/lib/php7.4') in /.../includes/autoloader.inc.php on line 102 How can I add this Third-Party library?
tim Founder Şundan Sweden May 2013 tarihinden beri üye tim 15 May 2020 23:33 You need to pass the third parameter prepend TRUE to your spl_autoload_register(). https://www.php.net/manual/en/function.spl-autoload-register.php