Неустранимая ошибка: необработанная ошибка: вызов неопределенной функции AlexaCRM \ CRMToolkit \ Auth \ curl_version () Authentication.php: 60 # 90 - PullRequest
0 голосов
/ 05 июля 2019

То же самое работает с WAMP.Это дает мне ошибку с лампой.Пожалуйста, предложите, что мне нужно сделать.

URL моего кода: Как создать дело или инцидент в Microsoft Dynamics Online CRM с помощью php-crm-toolkit

Получениеошибка в следующей строке - 22 * ​​1007 *

"$ service = new OrganizationService ($ serviceSettings);"

<code>print_r($_POST);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// error_reporting(0);
// ini_set('display_errors', 0);
/**
* Use init.php if you didn't install the package via Composer
*/
require_once 'vendor/autoload.php';

use AlexaCRM\CRMToolkit\Client as OrganizationService;
use AlexaCRM\CRMToolkit\Settings;
use AlexaCRM\CRMToolkit\Client;
use AlexaCRM\CRMToolkit\Entity\MetadataCollection;
use AlexaCRM\CRMToolkit\Entity\EntityReference;

$options  = include( 'config.php' );

$serviceSettings = new Settings( $options );
$service = new OrganizationService( $serviceSettings );


$clientSettings = new Settings( $options );
$client         = new Client( $clientSettings );
$metadata       = MetadataCollection::instance( $client );
$contactid = '';

$request_type = trim($_POST['request_type']);
$file_uploadName = '';

switch($request_type) {
    case 'call_you':

                    $firstname = $lastname = trim($_POST['name']);
                    $title = trim($_POST['order']);
                    $description = trim($_POST['message']);
                    $phone = trim($_POST['phone']);
                    $emailaddress1 = '';
                    $search_node = "<condition attribute='mobilephone' operator='like' value='%".$phone."%' />";

                    break;

    case 'support_email':

                    $firstname = $lastname = '';
                    $emailaddress1 = trim($_POST['email']);
                    $title = trim($_POST['subject']);
                    $description = trim($_POST['message']);
                    $search_node = "<condition attribute='emailaddress1' operator='like' value='%".$emailaddress1."%' />";

                    $file_upload = base64_encode(file_get_contents( $_FILES["file_upload"]["tmp_name"] ));
                    $file_uploadType = $_FILES["file_upload"]["type"];
                    $file_uploadName = $_FILES["file_upload"]["name"];
                    //echo '<br/>support_email - case<br/>';
                    break;    

    case 'submit_request':

                    $firstname = $lastname = '';
                    $emailaddress1 = trim($_POST['email']);
                    $title = ($_POST['requestSelect']).' - '.trim($_POST['subject']);
                    $description = trim($_POST['message']);
                    $search_node = "<condition attribute='emailaddress1' operator='like' value='%".$emailaddress1."%' />";

                    $file_upload = base64_encode(file_get_contents( $_FILES["file_upload"]["tmp_name"] ));
                    $file_uploadType = $_FILES["file_upload"]["type"];
                    $file_uploadName = $_FILES["file_upload"]["name"];
                    //echo '<br/>support_email - case<br/>';
                    break;    

    case 'customer_service':

                    $firstname = $lastname = trim($_POST['name']);
                    $title = trim($_POST['order']);
                    $description = trim($_POST['message']);
                    $phone = trim($_POST['phone']);
                    $emailaddress1 = '';
                    $search_node = "<condition attribute='mobilephone' operator='like' value='%".$phone."%' />";

                    break;                            
}

$queryXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
            <entity name='contact'>
              <attribute name='contactid' />
              <filter type='and'>
                ".$search_node."
              </filter>
            </entity>
          </fetch>";


$contacts = $client->retrieveSingle($queryXML, $allPages = false, $pagingCookie = null, $limitCount = 10, $pageNumber = 1, $simpleMode = false);

if(isset($contacts)) {
    $contactid = $contacts->contactid;
    $emailaddress1 = $contacts->emailaddress1;
}

if(trim($contactid) != '') {
    $guid = $contactid;
} else {
    $contact = $service->entity( 'contact' );
    $contact->firstname = $firstname;
    $contact->lastname = $lastname;
    $contact->emailaddress1 = $emailaddress1;
    $guid = $contact->create();
}

$incident = $service->entity('incident');
//echo '<pre>';print_r($incident);echo '
';$ident-> title = $ title;$ident-> description = $ description;$ident-> customerid = new EntityReference ('contact', $ guid);// $ident-> ID = $ guid; // contactid ответственныйконтактif ($ file_uploadName! = '') {// echo $ file_uploadName;$ note = $ service-> entity ('annotation');$ note-> objectid = new EntityReference ('инцидент', $ инцидент ID);$ note-> subject = $ title;$ note-> documentbody = $ file_upload;$ note-> mimetype = $ file_uploadType; // "text / plain";$ note-> notetext = $ note;$ note-> filename = $ file_uploadName;// echo '
';print_r($note);echo '
'; die ();$ noteId = $ note-> create ();} echo "Для вашего запроса был создан регистр. ";?>` Неустранимая ошибка: необработанная ошибка: вызов неопределенной функции AlexaCRM \ CRMToolkit \ Auth \ curl_version () в / var / www / html / php_crm / vendor / alexacrm / php-crm-toolkit / src / Auth / Authentication.php: 60 Трассировка стека: # 0 /var/www/html/php_crm/vendor/alexacrm/php-crm-toolkit/src/Auth/OnlineFederation.php(39): AlexaCRM \ CRMToolkitAuth \ Authentication -> __ construct (Объект (AlexaCRM \ CRMToolkit \ Settings), Объект (AlexaCRM \ CRMToolkit \ Client)) # 1 / var / www / html / php_crm / vendor / alexacrm / php-crm-toolkit / src / Client.php (156): AlexaCRM \ CRMToolkit \ Auth \ OnlineFederation -> __ construct (Объект (AlexaCRM \ CRMToolkit \ Settings), Объект (AlexaCRM \ CRMToolkit \ Client)) # 2 /var/www/html/php_crm/create_case.php23): AlexaCRM \ CRMToolkit \ Client -> __ construct (Object (AlexaCRM \ CRMToolkit \ Settings)) # 3 {main}, брошенный в / var / www / html / php_crm / vendor / alexacrm / php-crm-toolkit / src / Auth /Authentication.php на линии 60
...