Using external libaries

hi, can anyone help?
i created an external library import_files , added it to a project but when i call it onscript init event
sc_include_library(“prj”, “import_files”, “vendor/autoload.php”, true, true);

get
failed to open stream: No such file or directory

require_once(…/_lib/libraries/grp/import_files/vendor/autoload.php): failed to open stream: No such file or directory

if i check folders, the library is not in grp folder but in sys
so probably i need something else than prj. how should i know? it is not in the documentation, nor in de examples sc publishes

i managed to include the library. no error (for public libraries you should use sys and not prj as the first argument

next step , i want to declare class from the library, in plain php it works, in SC page does not open, so how to declare classes from the lib in SC?

use PhpOffice\PhpSpreadsheet\IOFactory;

Hi maximnl,

When I use libraries like that, I create the object according to the library. For example:

sc_include_library(“sys”, “composer”, “vendor/autoload.php”);
$parser = new \Smalot\PdfParser\Parser();

OR
sc_include_library(‘sys’, ‘azure’, ‘vendor/autoload.php’);
$request = new \Zend\Http\PhpEnvironment\Request();

I usually test in a blank application in order to check if it works.

Good Luck!!

Ricardo

1 Like

good point, thanx. what is azure library example doing by the way?

I use it to log in my system using valid microsoft web accounts.

oh, great man, i just wanted to add microsoft AD authorisation , is that what you mean by web accounts? (=right name is microsoft active directory i guess IMO)
if so, could you share what library do you use and how did you integrate it / changes in login app?

Yes, I meant Microsoft AD. I used this library: GitHub - magium/active-directory: Provides a simple login to an Azure Active Directory instance Here the tutorial I used: Authenticating a PHP application against Active Directory in Azure - YouTube
Nevertheless, I read in one of the recent upgrades that Scriptcase now supports that kind of integration natively. Maybe you can try that too.

If you choose that last alternative, let me know if it works.

1 Like

Hi Richie, thank you for sharing the links,
i notice that it takes me longer to implement than i thought,
i like to implement azure AD integration.
would you be available to assist in a skype call,
i will refund your time via paypal . let me know your rate and if you like to assist.
my skype maxim.ivashkov, or whatsapp +31622801528
regards
Maxim