Class: ConsumerService

Source Location: /CORE/system/classes/consumer/ConsumerService.php

Class ConsumerService

Class Overview

This class provides basic methods for reading Consumer Settings.

ATTENTION: This class handles the Domain Name always lower-case!

The Consumer Configuration File has the Format:

  1.  [www.example.com]
  2.  id 0
You can define a Default Consumer by using the DEFAULT_COMMUNITY constant as Domain:
  1.  [*]
  2.  id 0
A lookup for the default Community is done, if no mapping for the requested Domain could be found.

Located in /CORE/system/classes/consumer/ConsumerService.php [line 63]



		
				Author(s):
		
  • Kevin Papst
Information Tags:
Version:  $Id: ConsumerService.php,v 1.11 2008/10/01 10:17:44 kpapst Exp $
Copyright:  Copyright (C) Kevin Papst
License:  GNU Public License

Methods

[ Top ]
Descendants
Child Class Description
ConsumerHelper This class provides extended methods for manipulating Consumer Settings.

[ Top ]
Method Summary
void   getConfigForDomain()   Finds the Consumer Config for the given Domain.
Consumer   getConsumerByName()   Fetches a full configured Consumer for the given Domain or null if no Consumer could be found for this URL.
mixed   getConsumerConfigEntry()   Returns the Consumer Config Entry for the given Domain.
int   getConsumerIdForDomain()   Returns the Consumer ID for a Domain Name.
array   getNamesForID()   Gets all Domain names matching the given Consumer ID.
array   loadConsumerConfiguration()   Returns the complete Consumer Configuration for this System, including ALL settings for ALL Consumer.
void   _expireCache()  

[ Top ]
Methods
getConfigForDomain  [line 134]

  void getConfigForDomain( String $domain, [String $path = '']  )

Finds the Consumer Config for the given Domain.

Parameters:
String   $domain:  the domain to fetch the configuration for
String   $path:  the path to fetch the configuration for


[ Top ]
getConsumerByName  [line 228]

  Consumer getConsumerByName( String $domain, [ $path = '']  )

Fetches a full configured Consumer for the given Domain or null if no Consumer could be found for this URL.

Parameters:
String   $domain:  domain the Domain Name to fetch the Consumer for
   $path: 

API Tags:
Return:  the Consumer for the given Domain or null


[ Top ]
getConsumerConfigEntry  [line 118]

  mixed getConsumerConfigEntry( String $domain, String $key  )

Returns the Consumer Config Entry for the given Domain.

If no Consumer could be found at all (none installed maybe), it returns -2. It returns -1 if the Config Entry is not existing.

Parameters:
String   $domain:  the Consumer Domain
String   $key:  the Name of the Config Entry

API Tags:
Return:  the Config Value or -1 or -2


[ Top ]
getConsumerIdForDomain  [line 99]

  int getConsumerIdForDomain( String $domain  )

Returns the Consumer ID for a Domain Name.

If no match could be found, it returns -1. If no Consumer could be found at all (none installed maybe), it returns -2. It returns -3 if the Domain Name could not be processed (empty String or invalid Host URL). ATTENTION: This function handles Domain Names lower-case.

Parameters:
String   $domain:  the Domain Name to find the Consumer ID for

API Tags:
Return:  the Consumer ID or -1 if no match could be found


[ Top ]
getNamesForID  [line 195]

  array getNamesForID( int $cid  )

Gets all Domain names matching the given Consumer ID.

Returns an empty array if the given CID could not be found.

Parameters:
int   $cid:  the Consumer ID

API Tags:
Return:  the Array with all Names matching the given CID


[ Top ]
loadConsumerConfiguration  [line 182]

  array loadConsumerConfiguration( [ $reload = false]  )

Returns the complete Consumer Configuration for this System, including ALL settings for ALL Consumer.

Parameters:
   $reload: 

API Tags:
Return:  the Consumer Configuration


[ Top ]
_expireCache  [line 85]

  void _expireCache( )


API Tags:
Access:  protected


[ Top ]