Services_Blogging
[ class tree: Services_Blogging ] [ index: Services_Blogging ] [ all elements ]

Class: Services_Blogging

Source Location: /Services_Blogging-0.2.4/Services/Blogging.php

Class Overview


Generic package for several Blogging APIs.


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 45]
Generic package for several Blogging APIs.

Create a new instance via Services_Blogging::factory($driver, $username, $password, $server, $path), or more easy via Services_Blogging::discoverDriver($url, $username, $password) .

Note that some Blogging APIs allow multiple blogs with one account. These drivers implement Services_Blogging_MultipleBlogsInterface

  • you need to call setBlogId($id) before you can use the driver in that case.



[ Top ]


Method Detail

discoverDriver   [line 138]

Services_Blogging_Driver discoverDriver( string $url, string $username, string $password)

Autodiscover the driver settings from the given blog URL and create a driver instance.
  • Return: The driver object if all goes ok
  • Throws: Services_Blogging_Exception If an error occured
  • Access: public

Parameters:

string   $url   —  Blog URL
string   $username   —  Username for the blog account
string   $password   —  Password for the blog account

[ Top ]

discoverSettings   [line 186]

mixed discoverSettings( string $url)

Tries to auto-discover the driver settings for the blog at the given URL.

Internally, an RSD page is tried to load and read.


Parameters:

string   $url   —  Url of the blog

[ Top ]

driverExists   [line 286]

boolean driverExists( string $driver)

Tries to include the driver file and checks if the driver class exists.
  • Return: If the driver exists
  • Access: protected

Parameters:

string   $driver   —  Driver to check

[ Top ]

factory   [line 96]

Services_Blogging_Driver factory( string $driver, string $username, string $password, string $server, string $path)

The factory function that instantiates the appropriate class and returns the object, so that further methods may be executed. This function serves as the single entry point for the class.
  • Return: Blogging driver instance
  • Throws: Services_Blogging_Exception If the driver does not extend the base driver class Services_Blogging_Driver
  • Throws: Services_Blogging_Exception If authentication fails
  • Throws: Services_Blogging_Exception If the driver does not exist.
  • Access: public

Parameters:

string   $driver   —  The driver name, currently either 'Blogger', 'MetaWeblog' or 'LiveJournal'.
string   $username   —  The username of the blog account to connect to.
string   $password   —  The password of the blog account to connect to.
string   $server   —  The URI of the blog's server with protocol.
string   $path   —  The location of the XML-RPC server script.

[ Top ]

getBestAvailableDriver   [line 252]

string getBestAvailableDriver( array $arSettings)

Tries to return the best available driver for the given settings array. The settings array is returned by Services_Blogging::discoverSettings()
  • Return: The driver to use, false if none found
  • Access: public

Parameters:

array   $arSettings   —  Settings array

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:46:35 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.