public function testGetAlfrescoImplementation()
 {
     $seaMist = SeaMist::getInstance();
     $this->assertNotNull($seaMist);
     $repo = $seaMist->getRepository('Alfresco');
     $this->assertNotNull($repo);
     $this->assertTrue($repo instanceof SeaMistRepository);
     $this->assertTrue($repo instanceof AlfrescoSeaMistRepository);
 }
 /**
  * Get the alfresco seamistrepository connector. 
  * 
  * This is used by this object directly, but also 
  * via AlfrescoContentItems via composition
  * 
  * @return SeaMistRepository
  */
 public function getRemoteRepository()
 {
     // For the first batch, just get all the immediate children of the
     // top level
     $repo = SeaMist::getInstance()->getRepository('Alfresco', $this->ID);
     if (!$repo->isConnected() && $this->ApiUrl) {
         $config = array('apiUrl' => $this->ApiUrl, 'username' => $this->Username, 'password' => $this->Password);
         try {
             $repo->connect($config);
         } catch (Zend_Uri_Exception $zue) {
             error_log("Failed connecting to repository: " . $zue->getMessage() . "\n" . SS_Backtrace::backtrace(true));
         } catch (FailedRequestException $fre) {
             error_log("Failed request: " . $fre->getMessage());
         }
     }
     return $repo;
 }
 /**
  * Get the Cmis seamistrepository connector.
  * 
  * This is used by this object directly, but also 
  * via CmisContentItems via composition
  * 
  * @return SeaMistRepository
  */
 public function getRemoteRepository()
 {
     // For the first batch, just get all the immediate children of the
     // top level
     if (!$this->RepositoryType) {
         return null;
     }
     $repo = SeaMist::getInstance()->getRepository($this->RepositoryType, $this->ID);
     if (!$repo->isConnected() && $this->RepositoryInfoUrl) {
         try {
             $repo->connect($this->RepositoryInfoUrl, $this->RootNodeUrl, $this->Username, $this->Password);
         } catch (Zend_Uri_Exception $zue) {
             error_log("Failed connecting to repository: " . $zue->getMessage() . "\n" . SS_Backtrace::backtrace(true));
         } catch (FailedRequestException $fre) {
             error_log("Failed request: " . $fre->getMessage());
         }
     }
     return $repo;
 }
 /**
  * 
  * @return SeaMist
  */
 public static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new SeaMist();
     }
     return self::$instance;
 }
<?php

SeaMist::getInstance()->registerImplementation('Alfresco', 'AlfrescoSeaMistRepository');
SeaMist::getInstance()->registerImplementation('KnowledgeTree', 'KnowledgeTreeSeaMistRepository');
if (!function_exists('lcfirst')) {
    function lcfirst($string)
    {
        if (strlen($string)) {
            $string[0] = strtolower($string[0]);
            return $string;
        }
    }
}