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

file listing

  1. <?php
  2. /* *********************************************************************************
  3.  * (c) 2011-13 DANTE Ltd. on behalf of the GN3 and GN3plus consortia
  4.  * License: see the LICENSE file in the root directory
  5.  ***********************************************************************************/
  6. ?>
  7. <?php
  8. /**
  9.  * This file contains the Devices class.
  10.  *
  11.  * @package ModuleWriting
  12.  */
  13. /**
  14.  * The Devices class holds a list of all devices the CAT knows about
  15.  * 
  16.  * @author Tomasz Wolniewicz <twoln@umk.pl>
  17.  * 
  18.  * @license see LICENSE file in root directory
  19.  * 
  20.  * @package ModuleWriting
  21.  */
  22. class Devices{
  23.  
  24. /**
  25.  * This array lists available configuration options for local device management.
  26.  * Values from this array will be taken as defaults.
  27.  * Do not modify this array unless you really konw what you are doing.
  28.  * Default values will be overriden by the settings of options inside
  29.  * each device definition
  30.  *
  31.  * - 'sign' - if set to nonzero will cause installer signing if the module
  32.  *         supports this
  33.  * - 'no_cache' if defined and equal to 1 will block installer caching - useful
  34.  *         for device development, should not be used in production
  35.  * - 'hidden' if defined and equal to 1 will hide the device form listing -
  36.  *         useful for device development
  37.  * - 'device_id' - used in building the installer filename; when this option
  38.  *         is not defined, the filename will use the index from
  39.  *         the listDevices array; when defined and not empty, it will be
  40.  *         used in place of this index; when defined as empty will cause
  41.  *         the omission of the device part the filename.
  42.  *         The default is unset, so it is not listed in the Options array.
  43.  */
  44.  
  45. public static $Options=array(
  46.   'sign'=>0,
  47.   'no_cache'=>0,
  48.   'hidden'=>0,
  49. );
  50.  
  51. /**
  52.  * Each device is defined as a sub-array within this array
  53.  *
  54.  * Except for changing/adding things inside the options arrays, do not modify
  55.  * this array unless you really know what you are doing.
  56.  *
  57.  * Beware that the entrance page of CAT contains a rolling ad which
  58.  * lists some devices, and also states that certain device modules are signed,
  59.  * you should keep this information in sync with your settings in this file
  60.  * See web/user/roll.php for settings and more information.
  61.  *
  62.  * Settings
  63.  * - 'group' - caused device grouping used by the entrance screen
  64.  * - 'display' is the name shown on the GUI button
  65.  * - 'directory' is the subdirectory of devices directory, where
  66.  *       the device module resides
  67.  * - 'module' is the name of the module class, the same name with .php
  68.  *       added will be used as the name of the main include file for the module
  69.  * - 'signer' if defined points to a script which will sign a file.
  70.  *       The script must be located in the signer subdirectory of CAT.
  71.  *       The first argument of this script must be the input file name,
  72.  *       the second - the signed file filename. Signer will not be used
  73.  *       unless the sign option is set to nonzero.
  74.  * - 'options' - the array of options overriding the default settings.
  75.  *       See the descripption of options above.
  76.  *
  77.  * @example devices/devices-template.php file listing
  78.  * @return array the device modules
  79.  */
  80.  
  81.  
  82. public static function listDevices({
  83.     return array(
  84.  'w8'=>array(
  85.    'group' => "microsoft",
  86.    'display'=>_("MS Windows 8, 8.1"),
  87.    'directory'=>'ms',
  88.    'module'=>'W8',
  89.    'signer'=>'ms_windows_sign',
  90.     'options'=>array(
  91.        'sign'=>0,
  92.        'device_id'=>'W8',
  93.       ),
  94.    ),
  95.     
  96.  'w7'=>array(
  97.    'group' => "microsoft",
  98.    'display'=>_("MS Windows 7"),
  99.    'directory'=>'ms',
  100.    'module'=>'Vista7',
  101.    'signer'=>'ms_windows_sign',
  102.     'options'=>array(
  103.        'sign'=>0,
  104.        'device_id'=>'W7',
  105.       ),
  106.    ),
  107.     
  108.  'vista'=>array(
  109.    'group' => "microsoft",
  110.    'display'=>_("MS Windows Vista"),
  111.    'directory'=>'ms',
  112.    'module'=>'Vista7',
  113.    'signer'=>'ms_windows_sign',
  114.     'options'=>array(
  115.        'sign'=>0,
  116.        'device_id'=>'Vista',
  117.       ),
  118.    ),
  119.     
  120.  'apple_yos'=>array(
  121.     'group' => "apple",
  122.     'display'=>_("Apple OS X Yosemite"),
  123.     'directory'=>'apple_mobileconfig',
  124.     'module'=>'mobileconfig',
  125.     'signer'=>'mobileconfig_sign',
  126.     'options'=>array(
  127.        'sign'=>0,
  128.        'device_id'=>'MacOS',
  129.       ),
  130.     ),
  131.     
  132.  'apple_mav'=>array(
  133.     'group' => "apple",
  134.     'display'=>_("Apple OS X Mavericks"),
  135.     'directory'=>'apple_mobileconfig',
  136.     'module'=>'mobileconfig',
  137.     'signer'=>'mobileconfig_sign',
  138.     'options'=>array(
  139.        'sign'=>0,
  140.        'device_id'=>'MacOS',
  141.       ),
  142.     ),
  143.     
  144.     
  145.  'apple_m_lion'=>array(
  146.     'group' => "apple",
  147.     'display'=>_("Apple OS X Mountain Lion"),
  148.     'directory'=>'apple_mobileconfig',
  149.     'module'=>'mobileconfig',
  150.     'signer'=>'mobileconfig_sign',
  151.     'options'=>array(
  152.        'sign'=>0,
  153.        'device_id'=>'MacOS',
  154.       ),
  155.     ),
  156.     
  157.  'apple_lion'=>array(
  158.     'group' => "apple",
  159.     'display'=>_("Apple Mac OS X Lion"),
  160.     'directory'=>'apple_mobileconfig',
  161.     'module'=>'mobileconfig',
  162.     'signer'=>'mobileconfig_sign',
  163.     'options'=>array(
  164.        'sign'=>0,
  165.        'device_id'=>'MacOS',
  166.       ),
  167.     ),
  168.  'mobileconfig'=>array(
  169.     'group' => "apple",     
  170.     'display'=>_("Apple iOS mobile devices"),
  171.     'directory'=>'apple_mobileconfig',
  172.     'module'=>'mobileconfig',
  173.     'signer'=>'mobileconfig_sign',
  174.     'options'=>array(
  175.        'sign'=>0,
  176.        'device_id'=>'',
  177.       ),
  178.     ),
  179.  'linux'=>array(
  180.      'group' => "linux",
  181.      'display'=>_("Linux"),
  182.      'directory'=>'linux',
  183.      'module' => 'Linux',
  184.     'options'=>array(
  185.       ),
  186.    ),
  187. /* these two devices are not meant for production
  188.  
  189.  'welcomeletter'=>array(
  190.     'group' => "other",
  191.     'display'=>_("Welcome Letter"),
  192.     'directory'=>'welcomeletter',
  193.     'module'=>'welcomeletter',
  194.     'options'=>array(
  195.        'device_id'=>'welcome',
  196.       ),
  197.    ),
  198.     
  199.  'test'=>array(
  200.     'group' => "other",
  201.     'display'=>_("Test"),
  202.     'directory'=>'test_module',
  203.     'module'=>'TestModule',
  204.     'options'=>array(
  205.       ),
  206.    ),
  207. */
  208.     
  209. );
  210. }
  211. }
  212. ?>

Documentation generated on Wed, 08 Apr 2015 07:12:46 +0000 by phpDocumentor 1.4.4