Skip to content

infiniityr/alfresco-php-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ALFRESCO-PHP-API

NON OFFICIAL PACKAGE

This package is based on the official alfresco-js-api package.

Classes dealing with the Alfresco 5.2+ API for PHP. Most of the functionalities of the original package are present.

In order to have all the auto-suggestion, try to work with an IDE which understand the properties property-read and method of the PHPDoc. I advise you to use PHPStorm or Intellij Idea which natively understand those properties.

Installation

composer require infiniityr/alfresco-php-api:dev-master

Usage

Initialize the class AlfrescoApi with the configuration array.

$config = [
    'hostEcm' => 'http://localhost:8080',
    //'context' => 'alfresco',
    //'disableCsrf' => true
];
$alfrescoApi = new AlfrescoApi($config);

Then you can login to Alfresco.

$alfrescoApi->login('login', 'password')->wait();

After that, just call the APIs as presented in the documentation.

//Get all sites
$this->alfrescoApi->core->getSites()
    ->then(function(SitePaging $sites) {
        foreach ($sites->list->entries as $entry) {
            print_r(json_encode($entry) . "\n");
        }
    })->wait();

//Create a site
$siteBody = new SiteBody('Site Test PHP');
$siteBody->id = 'new_site_id';
$this->alfrescoApi->core->createSite($siteBody)
    ->then(function($data) {
        print_r("Site CREATED\n");
    })->wait();

Todo

A lot of stuff is still in progress.

  • Unit tests of all models
  • Unit tests of all apis
  • Include all Activiti APIs
  • Include Oauth2 Authentication

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages