コード例 #1
0
function system_device_detection($debug = false)
{
    platform_launch(PLATFORM_SANDBOX_SYSTEM_VENDORS_PATH . DS . PLATFORM_VENDORS_OPENDDR . DS . 'BuilderDataSource.class.php');
    platform_launch(PLATFORM_SANDBOX_SYSTEM_VENDORS_PATH . DS . PLATFORM_VENDORS_OPENDDR . DS . 'DeviceDetection.class.php');
    $device_detection = new DeviceDetection($_SERVER['HTTP_USER_AGENT']);
    $device_options = $device_detection->getAllCapabilities();
    $device_type = 'Unknown';
    if ($device_options['all']) {
        $user_agent = detect_user_agent();
        $device_type = get_device_type();
    } else {
        $device_type = $device_options['vendor'] . ' ' . $device_options['model'];
    }
    if ($debug) {
        echo "<h2>Device Info</h2>";
        echo "<h3>User Agent: " . $user_agent . "</h3>";
        echo "<pre>";
        print_r($device_options);
        echo "</pre>";
    }
    unset($device_detection);
    return $device_type;
}
コード例 #2
0
/**
 * This contains all pseudo platform specific functions
 * @version     $Id: platform.php 40 2011-02-09 14:10:00Z biyi $
 * @package     Platform
 * @subpackage  Pseudo
 * @category    Function
 * @author      Biyi Akinpelu
 * @link        mailto:biyi@entilda.com
 * @copyright   Copyright (C) 2011 - 2012 The Platform Authors. All rights reserved.
 * @license     GNU Public Licence, see LICENSE.php
 * Platform is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */
function pl($file)
{
    platform_launch($file);
}
コード例 #3
0
/**
 * platform_launch_browser: used to launch system application browser
 * @param void
 *
 * @return void
 */
function platform_launch_browser()
{
    $path = PLATFORM_SANDBOX_SYSTEM_APPLICATIONS_PATH . DS . 'browser' . DS;
    $filename = $path . 'index.php';
    platform_launch($filename);
}
コード例 #4
0
 /**
  * launch: used to attach/include a file
  * @param string $file The file to launch and load
  *
  * @return void
  */
 public function launch($file)
 {
     platform_launch($file);
 }
コード例 #5
0
<?php

/**
 * Editor
 * Test case: Determine the optimal approach to implement an editor
 *
 * @version     $Id: index.php 40 2011-02-09 14:10:00Z biyi $
 * @package     Platform
 * @category    Tests
 * @author      Biyi Akinpelu
 * @link        mailto:biyi@entilda.com
 * @copyright   Copyright (C) 2011 Entilda IT Solutions. All rights reserved.
 * @license     GNU/GPL, see LICENSE.php
 * Platform is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */
// initilizing platform for self-contained objects
platform_launch_initialize();
if (isset($_POST['contents'])) {
    $r = file_put_contents("foo.txt", $_POST['contents']) or die("Can't open file");
}
platform_launch('editor.html');