2016-03-19 7 views
2

Ich habe bereits alle "Official PHP SDK für die Content Delivery API" Dateien und Ordner von GitHub in einen Ordner auf meinem Server namens "Contentful" hochgeladen.Contentful ohne Composer

Dann habe ich versucht, das Tutorial von Contentful site zu folgen, aber natürlich konnte ich es nicht funktionieren, weil ich Composer nicht verwendet habe.

Der Code ist der folgende:

require_once 'vendor/autoload.php'; 

// This is the space ID. A space is like a project folder in Contentful terms 
$space='developer_bookshelf'; 

// This is the access token for this space. Normally you get both ID and the  token in the Contentful web app 
$token='0b7f6x59a0'; 

// This configures the SDK to access the Delivery API entry with the specified ID from the space defined at the top, using a space-specific access token. 
$client = new \Contentful\Delivery\Client($token, $space); 

// This retrieves the entry with the specified ID and JSON encodes it 
echo json_encode($client->getEntry('5PeGS2SoZGSa4GuiQsigQu'), JSON_PRETTY_PRINT); 

auf GitHub ich keine Anweisungen finden konnten, manuell installieren und das SDK zu initialisieren.

Ich möchte Contentful wirklich für ein Projekt verwenden, aber als Anfänger PHP Entwickler, der nichts über Composer weiß, brauche ich Anweisungen.

Jede gute Seele könnte mir helfen, meinen Code zu ändern, damit ich SDK initialisieren und mit dem Abrufen von Daten aus Contentful API beginnen kann? Welche Dateien benötigen Sie? Muss ich etwas tun, um Klassen automatisch zu laden? So viele Zweifel ...

Mein Gastgeber: Pagely. Mein Arbeitsbereich: Codeanywhere.

Vielen Dank.

+0

Danke für Sie Hilfe, Mann. –

Antwort

0

Nun, ich habe es so aus:

1) Installed MAMPS on my Mac; 
2) Installed Composer locally, running the script from [here][1]; 
3) Ran php composer.phar require contentful/contentful:@beta through Terminal; 
4) Got all the files uploaded to my live server. 

Das ist es.

Verwandte Themen