robrichards / xmlseclibs

A PHP library for XML Security
BSD 3-Clause "New" or "Revised" License
386 stars 180 forks source link

I have to digitally sign an XML document with the xmlseclibs library in Codeigniter4 #245

Closed Construir closed 1 year ago

Construir commented 1 year ago

I use the basic example from Github, we install it via composer as advised. The first error I have when you want to use the library files

use RobRichards\XMLSecLibs\XMLSecurityDSig; use RobRichards\XMLSecLibs\XMLSecurityKey;

that doesn't work anymore, I use an absolute access

require "../xmlseclibs/vendor/robrichards/xmlseclibs/src/XMLSecurityDSig.php"; require "../xmlseclibs/vendor/robrichards/xmlseclibs/src/XMLSecurityKey.php";

the error disappears but it does not recognize the instance

$doc = new DOMDocument(); <--ERROR HERE Class 'App\Controllers\DOMDocument' not found

I don't know if I am accessing the files wrong or there is another error.

Thank you very much.

tvdijen commented 1 year ago

Add use DOMDocument; to your file.

This is basic PHP knowledge and has nothing to do with this library.

Construir commented 1 year ago

Thanks for your help! the problem was solved