start documentation

This commit is contained in:
John Bintz 2009-06-27 09:14:33 -04:00
parent bd3620a2ae
commit bbd13538f8

View File

@ -8,10 +8,16 @@ class PluginWonderful {
function PluginWonderful() {} function PluginWonderful() {}
/**
* Wrapper around file_get_contents for testing purposes.
*/
function _retrieve_url($url) { function _retrieve_url($url) {
return @file_get_contents($url); return @file_get_contents($url);
} }
/**
* Initialize the object if it isn't already.
*/
function init() { function init() {
if (empty($this->adboxes_client)) { if (empty($this->adboxes_client)) {
$this->messages = array(); $this->messages = array();
@ -24,10 +30,16 @@ class PluginWonderful {
} }
} }
/**
* Wrapper around PublisherInfo generation for testing.
*/
function _get_new_publisher_info_object() { function _get_new_publisher_info_object() {
return new PublisherInfo(); return new PublisherInfo();
} }
/**
* Check to see if the database schema needs to be updated.
*/
function _update_database_version() { function _update_database_version() {
$result = get_option('plugin-wonderful-database-version'); $result = get_option('plugin-wonderful-database-version');
if (empty($result) || ($result < PLUGIN_WONDERFUL_DATABASE_VERSION)) { if (empty($result) || ($result < PLUGIN_WONDERFUL_DATABASE_VERSION)) {
@ -39,6 +51,10 @@ class PluginWonderful {
} }
} }
/**
* Get publisher info (adboxes) from cache or from Project Wonderful.
* @return PublisherInfo|boolean The PublisherInfo object with adbox information, or false if there was a problem.
*/
function _get_publisher_info() { function _get_publisher_info() {
$this->publisher_info = false; $this->publisher_info = false;
$member_id = get_option('plugin-wonderful-memberid'); $member_id = get_option('plugin-wonderful-memberid');
@ -300,4 +316,4 @@ function the_project_wonderful_ad($adboxid) {
$w->widget(array(), array('adboxid' => $adboxid)); $w->widget(array(), array('adboxid' => $adboxid));
} }
?> ?>