System_Launcher
[ class tree: System_Launcher ] [ index: System_Launcher ] [ all elements ]

Source for file Windows.php

Documentation is available at Windows.php

  1. <?php
  2.  
  3. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  4.  
  5. /**
  6.  * Launch files with the associated application.
  7.  *
  8.  * PHP version 5
  9.  * 
  10.  * @category System
  11.  * @package  System_Launcher
  12.  * @author   Christian Weiske <cweiske@php.net>
  13.  * @author   Olle Jonsson <olle.jonsson@gmail.com>
  14.  * @license  http://www.gnu.org/licenses/lgpl.html LGPL
  15.  * @link     http://github.com/olleolleolle/System_Launcher
  16.  * @since    File available since Release 0.1.0
  17.  */
  18.  
  19. /** Driver base class */
  20. require_once 'System/Launcher/Driver.php';
  21.  
  22. /**
  23.  * Windows driver
  24.  * 
  25.  * @category System
  26.  * @package  System_Launcher
  27.  * @author   Christian Weiske <cweiske@php.net>
  28.  * @author   Olle Jonsson <olle.jonsson@gmail.com>
  29.  * @license  http://www.gnu.org/licenses/lgpl.html LGPL
  30.  * @link     http://github.com/olleolleolle/System_Launcher
  31.  * @since    File available since Release 0.1.0
  32.  */
  33. class System_Launcher_Driver_Windows implements System_Launcher_Driver
  34. {
  35.     /**
  36.      * Returns a command string template usable with sprintf.
  37.      * 
  38.      * @param boolean $runInBackground Set to true to open in background
  39.      * 
  40.      * @return Command string template to open something
  41.      */
  42.     public function getCommand($runInBackground)
  43.     {
  44.         if ($runInBackground{
  45.             return 'start "" /WAIT %s';
  46.         else {
  47.             return 'start "" %s';
  48.         }
  49.     }
  50.     
  51.     /**
  52.      * Returns true if this class applies to the current OS.
  53.      * 
  54.      * @return boolean 
  55.      * @codeCoverageIgnore
  56.      */
  57.     public function applies()
  58.     {
  59.         return strtoupper(substr(PHP_OS03)) === 'WIN';
  60.     }
  61. }

Documentation generated on Wed, 02 Jan 2013 22:00:02 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.