phpDocumentor CAT_Developer_Documentation
[ class tree: CAT_Developer_Documentation ] [ index: CAT_Developer_Documentation ] [ all elements ]

Class: DeviceConfig

Source Location: /core/Device.php

Class DeviceConfig

Class Overview

This class defines the API for CAT module writers.

A device is a fairly abstract notion. In most cases it represents a particular operating system or a set of operationg systems like MS Windows Vista and newer.

The purpose of this class is to preapare a setup for the device configurator, collect all necessary information from the database, taking into account limitations, that a given device may present (like a set of supported EAP methods).

All that is required from the device module is to produce a conigurator file and pass its name back to the API.

Located in /core/Device.php [line 31]



		
				Author(s):
		
		
		API Tags:
Abstract:  

Information Tags:
License:  http://ticker.eduroam.lu/cat/LICENSE

Properties

Methods

[ Top ]
Descendants
Child Class Description
This class defines the API for CAT module writers.

[ Top ]
Property Summary
array   $attributes   The array passing all options to the device module.
mixed   $FPATH  
mixed   $name  
mixed   $selected_eap   The optimal EAP type
mixed   $supportedEapMethods  
mixed   $version  

[ Top ]
Method Summary
DeviceConfig   __construct()   Constructs a Device object.
bool   copyFile()   Copy a file from the module location to the temporary directory.
void   dumpAttibutes()   dumps attributes for debugging purposes
void   saveCertificateFiles()   Save certificate files in either DER or PEM format
void   setup()   Set up working environment for a device module
void   writeInstaller()   placeholder for the main device method

[ Top ]
Properties
array   $attributes [line 238]

The array passing all options to the device module.

$attrbutes array contains option values defined for the institution and a particular profile (possibly overriding one another) ready for the device module to consume.

For each of the options the value is another array of vaules.

API Tags:
Access:  public


[ Top ]
mixed   $FPATH [line 35]
API Tags:
Access:  protected
Name:  string FPATH stores the temporary working directory for a module instance


[ Top ]
mixed   $name [line 245]
API Tags:
Access:  public


[ Top ]
mixed   $selected_eap [line 244]

The optimal EAP type

API Tags:
Access:  public


[ Top ]
mixed   $supportedEapMethods [line 172]
API Tags:
Access:  protected


[ Top ]
mixed   $version [line 246]
API Tags:
Access:  public


[ Top ]
Methods
Constructor __construct  [line 50]

  DeviceConfig __construct( $device  )

Constructs a Device object.

string $device - a pointer to a device module, which must be an index of one of the devices defined in the Devices array in devices/devices.php. The role of the constructor is to prepare the working enironment for the device module by:

  • setting the module source directory as the $module_path proprety
  • setting the supportedEapMethods (from the module $my_eap_methods variable)

Parameters:
   $device: 

API Tags:
Access:  public

Information Tags:
Final:  not to be redefined

[ Top ]
copyFile  [line 115]

  bool copyFile( )

Copy a file from the module location to the temporary directory.

If the second argument is provided then the file will be saved under the name taken form this argument. If only one parameter is given, source and destination filenames are the same


API Tags:
Return:  result of the copy operation
Access:  protected

Information Tags:
Final:  not to be redefined

[ Top ]
dumpAttibutes  [line 199]

  void dumpAttibutes( $file  )

dumps attributes for debugging purposes

dumpAttibutes method is supplied for debuging purposes, it simply dumps the attribute array to a file with name passed in the attribute.

Parameters:
   $file: 

API Tags:
Access:  protected


[ Top ]
saveCertificateFiles  [line 131]

  void saveCertificateFiles( $ca_array, $format  )

Save certificate files in either DER or PEM format

Parameters:
   $ca_array: 
   $format: 

API Tags:
Access:  protected


[ Top ]
setup  [line 77]

  void setup( $profile  )

Set up working environment for a device module

Sets up the device module environment taking into account the actual profile selected by the user in the GUI. The selected profile is passed as the Profile $profile argumant.

This method needs to be called inside of the Device::writeInstaller method.

setup performs the following tasks:

  • collect profile attributes and pass them as the attributes property;
  • create the temporary working directory
  • process CA certificates and store them as 'internal:CAs' attribute
  • process and save optional info files and store references to them in 'internal:info_file' attribute

Parameters:
Profile   $profile: 

API Tags:
Access:  protected

Information Tags:
Final:  not to be redefined

[ Top ]
writeInstaller  [line 214]

  void writeInstaller( $profile  )

placeholder for the main device method

writeInstaller method needs to be redefined in every ExtendedConfig the one below is just an example

Parameters:
Profile   $profile: 

API Tags:
Access:  protected


Redefined in descendants as:

[ Top ]

Documentation generated on Fri, 15 Jul 2011 13:02:35 +0200 by phpDocumentor 1.4.3