Following your instructions, it looks like Composer installed something somewhere:
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See Basic usage - Composer for more information.
Loading composer repositories with package information
Updating dependencies
Lock file operations: 2 installs, 0 updates, 0 removals
- Locking mautic/api-library (3.0.0)
- Locking psr/log (1.1.4)
Writing lock file
Installing dependencies from lock file
Package operations: 2 installs, 0 updates, 0 removals
- Downloading psr/log (1.1.4)
- Downloading mautic/api-library (3.0.0)
- Installing psr/log (1.1.4): Extracting archive
- Installing mautic/api-library (3.0.0): Extracting archive
Generating autoload files
Trying the example code from above, from both @mzagmajster and @joeyk, I don’t get any more errors, but also no results or $contact output.
Is there a way to check if it is actually connecting to the API? I tried echo $contactApi
etc., but no results.
I still get this error:
Fatal Error: Uncaught Error: Class ‘Mautic\Auth\ApiAuth’ not found in /home/username/public_html/myothersite/site/assets/cache/FileCompiler/site/templates/process/functions.php: …
This error appears when I put the code in a functions.php file in my CMS; putting it in other files produces a similar error. Putting it in a plain php file outside of the CMS I get no error, but also no results/response and don’t have logs to check why not.
I put echo 'WE LIVE';
in autoload.php and that does show up where it is included, but apparently autoload.php cannot find Class 'Mautic\Auth\ApiAuth'
?