So, I have been looking around for a while, and I know this is just a hick-up, but it won’t go away, so here is a quick overview of my setup, and the issue I am stuck on. If anyone has experienced this, and could answer, that would be great.
So, I had api v1 set up and it works perfectly. Sign up and sign in are working. But, I want to include some creator tier access privacy on “my” multi-user blogging platform, so I want to setup api v2 to access user’s patrons, and allow access to tiered content on the blog platform.
So, I installed COMPOSER, to a limited access level /var/www/mysite.com/assets/php/_api/composer.phar
in an nginx server btw ( not that that matters ).
Then I installed the Patreon API v2.
composer require patreon/patreon
All good so far.
Then I setup a little test environment to walk through a conversion of api v1 to api v2.
Here is the current issue I am stuck on
This test file looks like this so far:
var_dump(class_exists('Patreon\API'));
require_once( $_SERVER['DOCUMENT_ROOT'] . '/assets/php/_api/vendor/autoload.php');
var_dump(class_exists('Patreon\API'));
$Api = Patreon\API;
//use Patreon\API;
//use Patreon\OAuth;
I commented out the “use Patreon.…” statements as that was giving a complete output break with no error data.
Essentially the namespace exists, as I can see from the output:
…assets/php/_requests/test.php:1:boolean: false
…assets/php/_requests/test.php:3:boolean: true
But I get these errors:
Fatal error: Uncaught Error: Undefined constant ‘Patreon\API’ in …assets/php/_requests/test.php on line 5
Error: Undefined constant ‘Patreon\API’ in
…assets/php/_requests/test.php on line 5
I have also stepped through a bit of the autoload.php and the autoload_real.php files to ensure that the class was being instantiated.
A guess:
-
I am new to namespaces, but there is no require of API.php nor OAuth.php in the vender/ folder files, which seems odd to me, maybe it only did a partial install?
-
Something else.
Any help on the topic would be much appreciated. Maybe I can send someone a coffee, or 17 of them.