Overview

Namespaces

  • None
  • Xmf
    • Database
    • Module
      • Helper
    • Template
  • Xoops
    • Auth
    • Core
      • Cache
      • Database
        • Logging
        • Schema
      • Exception
      • Handler
        • Scheme
      • Kernel
        • Dtype
        • Handlers
        • Model
      • Lists
      • Locale
        • Punic
      • Service
        • Contract
      • Session
      • Text
        • Sanitizer
          • Extensions
      • Theme
        • Plugins
    • Form
    • Html
    • Locale
    • Module
      • Helper
      • Plugin

Classes

  • AbstractContract
  • Manager
  • NullProvider
  • Provider
  • Response
  • Overview
  • Namespace
  • Class
  • Tree

Class Manager

Xoops services manager, locate, register, choose and dispatch

Namespace: Xoops\Core\Service
Package: Xoops\Core
Category: Xoops\Core\Service\Manager
Copyright: 2013-2014 The XOOPS Project https://github.com/XOOPS/XoopsCore
License: GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Author: Richard Griffith richard@geekwright.com
Version: Release: 1.0
Since: 2.6.0
Link: http://xoops.org
Located at oops_lib/Xoops/Core/Service/Manager.php
Methods summary
protected
# __construct( )

__construct

__construct

public static Xoops\Core\Service\Manager
# getInstance( )

Allow one instance only!

Allow one instance only!

Returns

Xoops\Core\Service\Manager
instance
public array
# readYamlProviderPrefs( )

readYamlProviderPrefs - read configured provider preferences from file

readYamlProviderPrefs - read configured provider preferences from file

Returns

array
of configured provider preferences
protected array
# readProviderPrefs( )

readProviderPrefs - read configured provider preferences from cache

readProviderPrefs - read configured provider preferences from cache

Returns

array
of configured provider preferences
protected
# saveProviderPrefs( array $providerPrefs )

saveProviderPrefs - record array of provider preferences in config file, and update cache

saveProviderPrefs - record array of provider preferences in config file, and update cache

Parameters

$providerPrefs
array of provider preferences to save
public
# saveChoice( string $service, array $choices )

saveChoice - record priority choices for service providers

saveChoice - record priority choices for service providers

This registers a permanent choice (i.e. setting system default) that will persist after the lifetime of this service manager.

Parameters

$service
the service name being set
$choices
array of priorities for each of the named service providers
public
# registerChoice( string $service, array $choices )

registerChoice - record priority choices for service providers

registerChoice - record priority choices for service providers

This registers a temporary choice (i.e. applying user preferences) for the lifetime of this service manager only.

Parameters

$service
the service name being set
$choices
array of priorities for each of the named service providers
public array
# listChoices( string $service )

listChoices - list choices availabe for a named service

listChoices - list choices availabe for a named service

For MODE_CHOICE services, this can supply an array containing the available choices. This array can be used to construct a user form to make a choice.

Parameters

$service
the service name being set

Returns

array
of available service provider objects for this service.
public Xoops\Core\Service\Provider
# locate( string $service )

locate - create a provider object for a named service, locating all contract implementors

locate - create a provider object for a named service, locating all contract implementors

Parameters

$service
the service name being set

Returns

Xoops\Core\Service\Provider
object for the requested service
Constants summary
integer MODE_EXCLUSIVE

Service Mode constant - Exclusive mode where only one located service will be used.

Service Mode constant - Exclusive mode where only one located service will be used.

# 1
integer MODE_CHOICE

Service Mode constant - Choice mode where one service from potentially many located services will be used. The service dispatched will be selected by system default.

Service Mode constant - Choice mode where one service from potentially many located services will be used. The service dispatched will be selected by system default.

# 2
integer MODE_PREFERENCE

Service Mode constant - Choice mode where one service from potentially many located services will be used. The service dispatched will be selected by user preference, or system default if no user valid preference is available.

Service Mode constant - Choice mode where one service from potentially many located services will be used. The service dispatched will be selected by user preference, or system default if no user valid preference is available.

# 4
integer MODE_MULTIPLE

Service Mode constant - Multiple mode where all located services will be dispatched in priority order.

Service Mode constant - Multiple mode where all located services will be dispatched in priority order.

# 8
integer PRIORITY_SELECTED

Provider priorities

Provider priorities

# 0
integer PRIORITY_HIGH
# 1
integer PRIORITY_MEDIUM
# 5
integer PRIORITY_LOW
# 9
Properties summary
protected array $services

Services registry - array keyed on service name, with provider object as value

Services registry - array keyed on service name, with provider object as value

# array()
protected array|null $providerPrefs

Provider Preferences - array keyed on service name, where each element is an array of provider name => priority entries

Provider Preferences - array keyed on service name, where each element is an array of provider name => priority entries

# null
API documentation generated by ApiGen