Skip to content
epicwhale edited this page Jul 11, 2012 · 26 revisions

DrupalConnect is a PHP 5.3+ library to connect your application to Drupal using the Services 3.0 API.

DrupalConnect aims to truly let you use Drupal as a pure backend data store for your website.

At the moment, this is purely a work in progress. Please do not start using this in production, but for learning, testing or contributing only. When we're ready with v1, we'll freeze the core take off this message.

Getting Started

First, read up on the requirements.

The starting point of querying resources from Drupal is by configuring an instance of the \DrupalConnect\DocumentManager. This allows us to query for Documents (a document can be a node, comment, file, user).

Here's an example code to configure the DocumentManager:

<?php
// Configure the connection to your Drupal
$drupalConnection = new \DrupalConnect\Connection(array(
    'endpoint' => 'http://mydrupal.com/api/public/' // replace with your Services endpoint
));

// Create a DocumentManager which gives us access to Repositories, Query Builders, etc
$dm = new \DrupalConnect\DocumentManager($drupalConnection, array(
    'file_base_url' => array(
        'public' => 'http://mydrupal.com/sites/default/files/', // base url to your drupal's public files
        'private' => 'http://mydrupal.com/drupal/system/files/' // base url to your drupal's private files
    )
));

Tutorials and How-Tos


Roadmap

  1. Develop a Document, Repository, Hydrator and QueryBuilder model (90% complete) (testing)
  2. Query Nodes (100% complete) (testing)
  3. Retrieve Custom Fields (85% complete) (testing)
  4. Query Views (Broken) (fixing)
  5. Query Media/Files (100% complete) (testing)
  6. Query Taxanomy / Terms (90% complete) (testing)
  7. Query Menus
  8. Query Drupal System Variables
  9. Web Form Support
  10. Authentication Support
  11. Query Users
  12. Query Comments
Clone this wiki locally