(sınıf bulunamadı), Yani ben bu kadar composer.json düzenledikten: Bu komut $ composer update
besteciyi güncellemek içinKeen.io php istemci Linux üzerinde besteci yüklemiş
{
"name": "keen-io/keen-io",
"description": "A PHP library for reporting events to the Keen IO API",
"type": "library",
"license": "MIT",
"keywords": [
"keen io",
"analytics"
],
"support": {
"chat": "https://www.hipchat.com/gIdidQscL"
},
"require": {
"php": ">=5.3.3",
"ext-mcrypt": "*",
"guzzle/guzzle": "~3.7"
},
"require-dev": {
"phpunit/phpunit": "~3.7.0"
},
"homepage": "http://keen.io",
"autoload": {
"psr-4": {
"KeenIO\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"KeenIO\\Tests\\": "tests/Tests"
}
},
"authors": [
{
"name": "Tom Anderson",
"email": "[email protected]"
},
{
"name": "Keith Kirk",
"email": "[email protected]",
"homepage": "http://kmfk.io"
},
{
"name": "Michaël Gallego",
"email": "[email protected]",
"homepage": "http://michaelgallego.fr"
}
]
}
Sonra ben türüne sahip .json ve ./vendor/autoload.php
üretir. ve bu JSON'un amacı, PHP istemcisini kullanmak için keen.io'a bağlanmaktır. --------------
Fatal error: Class 'KeenIO\Client\KeenIOClient' not found in /opt/bitnami/apache2/htdocs/sandbox/keen.io/test-keen.php on line 9
:
Sonra ben bu php script kodlanmış:<?php
require_once __DIR__ . '/vendor/autoload.php';
use KeenIO\Client\KeenIOClient;
$client = KeenIOClient::factory([
'projectId' => $projectId,
'writeKey' => $writeKey,
'readKey' => $readKey
]);
?>
Ama senaryoyu çalıştırdığınızda hatadır -------------------------------------------------- ----------- ** scirpt.php: **
<?php
//* Composer Directory : /htdocs/sandbox/project/KeenClient-PHP/
//* Current Directory : ~/htdocs/sandbox/project/KeenClient- PHP/script.php
//* File_name : script.php
require_once __DIR__ .'/vendor/autoload.php';
use KeenIO\Client\KeenIOClient;
$client = KeenIOClient::factory([
'projectId' => "Project_ID",
'writeKey' => "Write_Key",
'readKey' => "Read_Key"
]);
?>
Cevabınız için teşekkürler, ama script.php bu direk içine koyduğumda bu ~/htdocs/sandbox/proje/KeenClient-PHP/script.php github'dan aldığım gibi aynı composer.json ile: https : //github.com/keenlabs/KeenClient-PHP. çalıştı ama herhangi bir dir içinde script.php koyduğumda hatalar gösterilir ... – luka
Script.php gösterebilir misiniz? Aynı sınıf bulunamadı hatasıyla çöküyor? –
Script.php'yi orijinal yanıt defterine – luka