Overview

Packages

  • None
  • Wicked

Classes

  • Text_Wiki_Parse_Heading2
  • Text_Wiki_Parse_Toc2
  • Text_Wiki_Render_Latex_Heading2
  • Text_Wiki_Render_Latex_Toc2
  • Text_Wiki_Render_Plain_Heading2
  • Text_Wiki_Render_Plain_Toc2
  • Text_Wiki_Render_Rst
  • Text_Wiki_Render_Rst_Blockquote
  • Text_Wiki_Render_Rst_Bold
  • Text_Wiki_Render_Rst_Code
  • Text_Wiki_Render_Rst_Deflist
  • Text_Wiki_Render_Rst_Emphasis
  • Text_Wiki_Render_Rst_Freelink
  • Text_Wiki_Render_Rst_Heading2
  • Text_Wiki_Render_Rst_Links
  • Text_Wiki_Render_Rst_List
  • Text_Wiki_Render_Rst_Newline
  • Text_Wiki_Render_Rst_Paragraph
  • Text_Wiki_Render_Rst_Raw
  • Text_Wiki_Render_Rst_Toc2
  • Text_Wiki_Render_Rst_Tt
  • Text_Wiki_Render_Rst_Url
  • Text_Wiki_Render_Xhtml_Attribute
  • Text_Wiki_Render_Xhtml_Code2
  • Text_Wiki_Render_Xhtml_Freelink2
  • Text_Wiki_Render_Xhtml_Heading2
  • Text_Wiki_Render_Xhtml_Image2
  • Text_Wiki_Render_Xhtml_Interwiki
  • Text_Wiki_Render_Xhtml_Registrylink
  • Text_Wiki_Render_Xhtml_Toc2
  • Text_Wiki_Render_Xhtml_Url
  • Text_Wiki_Render_Xhtml_Wickedblock
  • Text_Wiki_Render_Xhtml_Wikilink2
  • Wicked
  • Wicked_Api
  • Wicked_Driver
  • Wicked_Driver_Sql
  • Wicked_Exception
  • Wicked_Factory_Driver
  • Wicked_Page
  • Wicked_Page_AddPage
  • Wicked_Page_AllPages
  • Wicked_Page_AttachedFiles
  • Wicked_Page_BackLinks
  • Wicked_Page_DeletePage
  • Wicked_Page_EditPage
  • Wicked_Page_LeastPopular
  • Wicked_Page_LikePages
  • Wicked_Page_MergeOrRename
  • Wicked_Page_MostPopular
  • Wicked_Page_NewPage
  • Wicked_Page_RecentChanges
  • Wicked_Page_RevertPage
  • Wicked_Page_Search
  • Wicked_Page_StandardHistoryPage
  • Wicked_Page_StandardPage
  • Wicked_Page_SyncDiff
  • Wicked_Page_SyncPages
  • Wicked_Sync
  • Wicked_Sync_Wicked
  • Wicked_Test
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Wicked_Sync defines an API for implementing synchronization backends for
  4:  * Wicked.
  5:  *
  6:  * Copyright 2008-2012 Horde LLC (http://www.horde.org/)
  7:  *
  8:  * See the enclosed file COPYING for license information (GPL). If you
  9:  * did not receive this file, see http://www.horde.org/licenses/gpl.
 10:  *
 11:  * @author  Duck <duck@obala.net>
 12:  * @package Wicked
 13:  */
 14: abstract class Wicked_Sync
 15: {
 16:     /**
 17:      * Hash containing connection parameters.
 18:      *
 19:      * @var array
 20:      */
 21:     protected $_params = array();
 22: 
 23:     /**
 24:      * Attempts to return a concrete Wicked_Sync instance based on $driver.
 25:      *
 26:      * @param string $driver  The type of the concrete Wicked_Sync subclass
 27:      *                        to return.  The class name is based on the
 28:      *                        sync driver ($driver).  The code is
 29:      *                        dynamically included.
 30:      *
 31:      * @param array $params   A hash containing any additional configuration
 32:      *                        or connection parameters a subclass might need.
 33:      *
 34:      * @return Wicked_Sync    The newly created concrete Wicked_Sync
 35:      *                        instance, or false on an error.
 36:      */
 37:     public function factory($driver = 'Wicked', $params = array())
 38:     {
 39:         $driver = Horde_String::ucfirst(basename($driver));
 40:         $class = 'Wicked_Sync_' . $driver;
 41: 
 42:         if (!class_exists($class)) {
 43:             return false;
 44:         }
 45: 
 46:         if (empty($params['user'])) {
 47:             $params['user'] = $GLOBALS['registry']->getAuth();
 48:         }
 49:         if (empty($params['password'])) {
 50:             $params['password'] = $GLOBALS['registry']->getAuthCredential('password');
 51:         }
 52:         return new $class($params);
 53:     }
 54: 
 55:     /**
 56:      * Constructs a new Wicked driver object.
 57:      *
 58:      * @param array $params  A hash containing connection parameters.
 59:      */
 60:     public function __construct(array $params = array())
 61:     {
 62:         $this->_params = $params;
 63:     }
 64: 
 65:     /**
 66:      * Returns a list of available pages.
 67:      *
 68:      * @return array  An array of all available pages.
 69:      * @throws Wicked_Exception
 70:      */
 71:     abstract function listPages();
 72: 
 73:     /**
 74:      * Get the wiki source of a page specified by its name.
 75:      *
 76:      * @param string $name  The name of the page to fetch
 77:      *
 78:      * @return array  Page data.
 79:      * @throws Wicked_Exception
 80:      */
 81:     abstract function getPageSource($pageName);
 82: 
 83:     /**
 84:      * Return basic page information.
 85:      *
 86:      * @param string $pageName Page name
 87:      *
 88:      * @return array  Page data.
 89:      * @throws Wicked_Exception
 90:      */
 91:     abstract function getPageInfo($pageName);
 92: 
 93:     /**
 94:      * Return basic information of .multiple pages
 95:      *
 96:      * @param array $pages Page names to get info for
 97:      *
 98:      * @return array  Pages data.
 99:      * @throws Wicked_Exception
100:      */
101:     abstract function getMultiplePageInfo($pages = array());
102: 
103:    /**
104:      * Return page history.
105:      *
106:      * @param string $pagename Page name
107:      *
108:      * @return array  An array of page parameters.
109:      * @throws Wicked_Exception
110:      */
111:     abstract function getPageHistory($pagename);
112: 
113:     /**
114:      * Updates content of a wiki page. If the page does not exist it is
115:      * created.
116:      *
117:      * @param string $pagename Page to edit
118:      * @param string $text Page content
119:      * @param string $changelog Description of the change
120:      *
121:      * @throws Wicked_Exception
122:      */
123:     abstract function editPage($pagename, $text, $changelog = '');
124: }
125: 
API documentation generated by ApiGen