i updated using composer. after updating getting error in php file , sending data intercom. error :
fatal error: class 'intercom\intercombasicauthclient' not found in <filename>
i found similar problem here symfony exception (class not found) on development , production servers. couldn't understand how solve issue. tried using intercom in uppercase lowercase, problem not solved.
in installed.json found :
"autoload": { "psr-4": { "intercom\\": [ "src" ] } }
and directory location of intercom files :
/public_html/vendor/intercom/intercom-php/src
when dig more composers file(was trying understand how classes included , all), came across code in autoload_namespaces.json
<?php // autoload_namespaces.php @generated composer $vendordir = dirname(dirname(__file__)); $basedir = dirname($vendordir); return array( 'libphonenumber' => array($vendordir . '/giggsey/libphonenumber-for-php/src'), 'phpamqplib' => array($vendordir . '/php-amqplib/php-amqplib'), );
libphonenumber , phpamqplib 2 libraries installed using composer, , intercom missing here.
so totally confused, actual problem. intercom library missing in autoload_namespace or uppercase-lowercase issue or what.
edit :
this found in autoload_psr4.php
<?php // autoload_psr4.php @generated composer $vendordir = dirname(dirname(__file__)); $basedir = dirname($vendordir); return array( 'psr\\http\\message\\' => array($vendordir . '/psr/http-message/src'), 'jmespath\\' => array($vendordir . '/mtdowling/jmespath.php/src'), 'intercom\\' => array($vendordir . '/intercom/intercom-php/src'), 'guzzlehttp\\psr7\\' => array($vendordir . '/guzzlehttp/psr7/src'), 'guzzlehttp\\promise\\' => array($vendordir . '/guzzlehttp/promises/src'), 'guzzlehttp\\' => array($vendordir . '/guzzlehttp/guzzle/src'), 'aws\\' => array($vendordir . '/aws/aws-sdk-php/src'), );
and how including intercom in php file :
use intercom\intercombasicauthclient;
i figured out myself. problem php version. using php-5.5 , intercom library strictly requires php version >= 5.6 .
created own library using intercom apis work php-5.5.
Comments
Post a Comment