class vB_SiteMapRunner_Admin extends vB_SiteMapRunner

Admin CP-based sitemap build helper.

Properties

protected vB_Registry $registry The vBulletin registry object from vB_SiteMapRunner
protected array $session The current sitemap runner session. Tracks progress across pages. from vB_SiteMapRunner
protected bool|null $environment_ok Stores if the environment is ok for execution. from vB_SiteMapRunner
bool $is_finished If the entire sitemap generation process is known to be finished. from vB_SiteMapRunner
string $written_filename Name of the written out filename from vB_SiteMapRunner

Methods

__construct(vB_Registry $registry)

Constructor. Automatically sets up the session.

static array
fetch_session_from_db(vB_Registry $registry)

Fetches the session info for this run from the database.

array
fetch_session()

Fetches the current, "in progress" session. This may differ from the state in the DB if changes are pending.

array
check_environment()

Check that the environment is ok for building the sitemap.

array
check_environment_internal()

Internal function for checking the environment. Checks ACP-specific items like whether the sitemap is being built by cron.

bool
generate()

Generates one "page" worth of a sitemap and prepares for the next page or finalizes.

set_state()

Sets session state to running.

static vB_Sitemap
get_content_handler($type, vB_Registry $registry)

Fetches the handler class for a particular type of content.

boolean
write_sitemap(vB_Sitemap $sitemap_obj)

Writes out the sitemap file for the current content.

boolean
is_finished(vB_Sitemap $sitemap_obj)

Determines if the sitemap generation is finished. This manipulates the session and helps prepare for the next page.

step_content_type_forward()

Moves forward to the next content type.

boolean
finalize(vB_Sitemap $sitemap_obj)

Finalizes the sitemap build by writing an index and contacting the selected search engines.

boolean
prepare_next_page()

Prepares for the next page. This is only called when the build isn't finished.

write_session()

Writes the sitemap session out. Only needed when not finished.

trigger_failure(string $error_phrase)

Triggers a failure event. This prevents the sitemap from being built any further until the error is resolved. Calling this updates the sitemap session automatically.

Details

in vB_SiteMapRunner at line 60
__construct(vB_Registry $registry)

Constructor. Automatically sets up the session.

Parameters

vB_Registry $registry Registry object

in vB_SiteMapRunner at line 73
static array fetch_session_from_db(vB_Registry $registry)

Fetches the session info for this run from the database.

Parameters

vB_Registry $registry

Return Value

array Array of session info; new session is created if needed

in vB_SiteMapRunner at line 111
array fetch_session()

Fetches the current, "in progress" session. This may differ from the state in the DB if changes are pending.

Return Value

array

in vB_SiteMapRunner at line 121
array check_environment()

Check that the environment is ok for building the sitemap.

Return Value

array Array of status information. Check 'error' key.

at line 519
protected array check_environment_internal()

Internal function for checking the environment. Checks ACP-specific items like whether the sitemap is being built by cron.

Return Value

array Array of status info. Check 'error' key.

in vB_SiteMapRunner at line 164
bool generate()

Generates one "page" worth of a sitemap and prepares for the next page or finalizes.

Return Value

bool True on success

at line 534
protected set_state()

Sets session state to running.

in vB_SiteMapRunner at line 224
static vB_Sitemap get_content_handler($type, vB_Registry $registry)

Fetches the handler class for a particular type of content.

Parameters

$type
vB_Registry $registry

Return Value

vB_Sitemap Subclass of vB_Sitemap

in vB_SiteMapRunner at line 247
protected boolean write_sitemap(vB_Sitemap $sitemap_obj)

Writes out the sitemap file for the current content.

Parameters

vB_Sitemap $sitemap_obj Current sitemap object

Return Value

boolean

in vB_SiteMapRunner at line 271
protected boolean is_finished(vB_Sitemap $sitemap_obj)

Determines if the sitemap generation is finished. This manipulates the session and helps prepare for the next page.

Parameters

vB_Sitemap $sitemap_obj Current sitemap object

Return Value

boolean

in vB_SiteMapRunner at line 295
protected step_content_type_forward()

Moves forward to the next content type.

in vB_SiteMapRunner at line 311
protected boolean finalize(vB_Sitemap $sitemap_obj)

Finalizes the sitemap build by writing an index and contacting the selected search engines.

Parameters

vB_Sitemap $sitemap_obj Sitemap object

Return Value

boolean

in vB_SiteMapRunner at line 342
protected boolean prepare_next_page()

Prepares for the next page. This is only called when the build isn't finished.

Return Value

boolean

in vB_SiteMapRunner at line 352
protected write_session()

Writes the sitemap session out. Only needed when not finished.

in vB_SiteMapRunner at line 364
protected trigger_failure(string $error_phrase)

Triggers a failure event. This prevents the sitemap from being built any further until the error is resolved. Calling this updates the sitemap session automatically.

Parameters

string $error_phrase Phrase key (in "error messages") that describes the error