Created
April 24, 2015 16:47
-
-
Save sascha-egerer/0fa5d55869c0f379d9a9 to your computer and use it in GitHub Desktop.
List CMIS Directory Content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Install https://github.com/dkd/php-cmis-client over composer | |
require_once(__DIR__ . '/vendor/autoload.php'); | |
$httpInvoker = new \GuzzleHttp\Client( | |
array( | |
'defaults' => array( | |
'auth' => array( | |
'admin', | |
'admin' | |
) | |
) | |
) | |
); | |
$parameters = array( | |
\Dkd\PhpCmis\SessionParameter::BINDING_TYPE => \Dkd\PhpCmis\Enum\BindingType::BROWSER, | |
\Dkd\PhpCmis\SessionParameter::BROWSER_URL => 'http://cmis.alfresco.com/cmisbrowser', | |
\Dkd\PhpCmis\SessionParameter::BROWSER_SUCCINCT => false, | |
\Dkd\PhpCmis\SessionParameter::HTTP_INVOKER_OBJECT => $httpInvoker, | |
); | |
$sessionFactory = new \Dkd\PhpCmis\SessionFactory(); | |
$repositories = $sessionFactory->getRepositories($parameters); | |
$parameters[\Dkd\PhpCmis\SessionParameter::REPOSITORY_ID] = $repositories[0]->getId(); | |
$session = $sessionFactory->createSession($parameters); | |
$rootFolder = $session->getRootFolder(); | |
foreach ($rootFolder->getChildren() as $children) { | |
echo $children->getName() . "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment