• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Device类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Device的典型用法代码示例。如果您正苦于以下问题:PHP Device类的具体用法?PHP Device怎么用?PHP Device使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Device类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: message

 function message()
 {
     $BS = new Button("Nachricht", "comment_alt2_stroke", "iconicL");
     $BS->style("float:left;");
     $read = false;
     $message = $this->messageParser();
     #$this->A("NuntiusMessage");
     if ($this->A("NuntiusRead") > "0") {
         $read = true;
         $BS = new Button("Nachricht", "check", "iconicL");
         $BS->style("float:left;color:darkgreen;");
         $ex = explode("\n", $message);
         $message = "<span style=\"color:grey;\">" . $ex[0];
         if (isset($ex[1])) {
             $message .= " …";
         }
         $message .= "</span>";
     }
     $from = "";
     $ex = explode(":", $this->A("NuntiusSender"));
     if ($ex[0] == "Device") {
         $D = new Device($ex[1]);
         $from = $D->A("DeviceName");
     }
     if ($ex[0] == "FritzBox") {
         $from = $this->A("NuntiusSender");
     }
     if ($ex[0] == "Mobile") {
         $from = $this->A("NuntiusSender");
     }
     return "\n\t\t\t<div id=\"Nuntius" . $this->getID() . "\" style=\"cursor:pointer;" . ($read ? "" : "background-color:#efefef;") . "min-height:40px;margin-bottom:10px;margin-top:10px;\" onclick=\"" . OnEvent::rme($this, "read", "", "function(t){ \$j('#Nuntius" . $this->getID() . "').replaceWith(t.responseText); fheOverview.loadContent('mNuntiusGUI::getOverviewContent'); }") . "\">\n\t\t\t\t{$BS}\n\t\t\t\t<div style=\"margin-left:40px;\" class=\"\">\n\t\t\t\t\t<p><small style=\"float:right;color:grey;\">Von {$from}, " . Util::CLDateTimeParser($this->A("NuntiusTime")) . "</small>" . nl2br($message) . "</p>\n\t\t\t\t</div>\n\t\t\t</div>";
 }
开发者ID:nemiah,项目名称:fheME,代码行数:32,代码来源:Nuntius.class.php


示例2: checkWindowsPhone

 /**
  * Determine if the device is Windows Phone.
  *
  * @param Device $device
  * @param UserAgent $userAgent
  * @return bool
  */
 private static function checkWindowsPhone(Device $device, UserAgent $userAgent)
 {
     if (stripos($userAgent->getUserAgentString(), 'Windows Phone') !== false) {
         $device->setName($device::WINDOWS_PHONE);
         return true;
     }
     return false;
 }
开发者ID:Omgan,项目名称:php-browser-detector,代码行数:15,代码来源:DeviceDetector.php


示例3: checkIphone

 /**
  * Determine if the device is Iphone.
  *
  * @return bool
  */
 public function checkIphone()
 {
     if (stripos($this->userAgent->getUserAgentString(), 'iphone;') !== false) {
         $this->device->setName(Device::IPHONE);
         return true;
     }
     return false;
 }
开发者ID:gabrielbull,项目名称:php-browser,代码行数:13,代码来源:DeviceDetector.php


示例4: fetchAll

 /**
  * Get all devices
  */
 public function fetchAll()
 {
     $devices = json_decode($this->dataProvider->get('devices')->getBody()->__toString());
     foreach ($devices->devices as $deviceData) {
         $device = new Device($deviceData, $this->dataProvider);
         $this->devices[$device->getId()] = $device;
     }
 }
开发者ID:unusorin,项目名称:pushbullet,代码行数:11,代码来源:DeviceManager.php


示例5: delete

	public function delete($id)
	{
		$data = array();
	
		$device = new Device($id);
		$device->delete();
		
		redirect("/", "refresh");
	}
开发者ID:JDougherty,项目名称:Network-Management-System,代码行数:9,代码来源:devices.php


示例6: testBase

 /**
  * Base test
  */
 public function testBase()
 {
     $timestamp = time();
     $tokenLength = 32;
     $deviceToken = str_repeat('14', 32);
     $data = pack('NnH*', $timestamp, $tokenLength, $deviceToken);
     $device = new Device($data);
     $this->assertEquals($timestamp, $device->getTimestamp());
     $this->assertEquals($tokenLength, $device->getTokenLength());
     $this->assertEquals($deviceToken, $device->getDeviceToken());
 }
开发者ID:sgmendez,项目名称:AppleApnPush,代码行数:14,代码来源:DeviceTest.php


示例7: get_config

 function get_config($id = '')
 {
     // MUST HAVE<input type='hidden' name='id' value=".$id."></input>
     // the name of the property must follow the conventions plugin_<Classname>_<propertyName>
     // have the form post and make sure the submit button is named widget_update
     // make sure there is also a hidden value giving the name of this Class file
     // Get defaults
     $subquery = "select device_id, enabled FROM plugin_SNMPPoller_devices";
     $result2 = mysql_query($subquery);
     if (!$result2) {
         return "<b>Oops something went wrong, unable to read plugin_SNMPPoller_devices SQL table </b>";
     }
     $devices = array();
     while ($obj = mysql_fetch_object($result2)) {
         $devices[$obj->device_id] = $obj->enabled;
     }
     // Now we have the defaults in $devices;
     $content .= "<h1>Please select the Devices you would like to Monitor with the SNMP poller</h1>";
     $content .= "<form id='configForm' method='post' name='edit_devices'>\r\n\t\t\t<input type='hidden' name='class' value='SNMPPoller'></input>\r\n\t\t\t<input type='hidden' name='id' value=" . $id . "></input> ";
     $select_all = "<input name='all' type='checkbox' value='Select All' onclick=\"checkAll(document.edit_devices['devices[]'],this)\"";
     #$content .= "<table border=1><tr><th>$select_all</th><th>Device</th><th>Device Type</th><th>Location</th></tr>";
     $form = new Form("auto", 4);
     $keyHandlers = array();
     $keyData = array();
     $keyTitle = array();
     foreach (Device::get_devices() as $id => $name) {
         if (array_key_exists($id, $devices) && $devices[$id] == 1) {
             $checked = "checked='yes'";
         } else {
             $checked = "";
         }
         $deviceInfo = new Device($id);
         array_push($keyData, "<input type=checkbox name=devices[] value='{$id}' {$checked} >");
         array_push($keyData, $name);
         array_push($keyData, $deviceInfo->get_type_name());
         array_push($keyData, $deviceInfo->get_location_name());
         #$content .= "<tr><td><input type=checkbox name=devices[] value='$id' $checked ></td>";
         #$content .= "<td>$name</td><td>". $deviceInfo->get_type_name() ."</td>";
         #$content .= "<td>". $deviceInfo->get_location_name() ."</td></tr>";
     }
     #$content .= "</table> <br>";
     //get all the device and display them all in the 3 sections "Device Name", "Device Type", "Location".
     $heading = array($select_all, "Device Name", "Device Type", "Location ");
     $form->setSortable(true);
     // or false for not sortable
     $form->setHeadings($heading);
     $form->setEventHandler($handler);
     $form->setData($keyData);
     $form->setTableWidth("auto");
     $content .= $form->showForm();
     $content .= "<div style='clear:both;'></div><input type='submit' class='submitBut' name='plugin_update' value='Update configuration'/>\r\n\t\t\t</form> ";
     return "{$content}";
 }
开发者ID:precurse,项目名称:netharbour,代码行数:53,代码来源:plugin.php


示例8: device_controller

function device_controller()
{
    global $session, $route, $mysqli, $user, $redis;
    $result = false;
    require_once "Modules/device/device_model.php";
    $device = new Device($mysqli, $redis);
    if ($route->format == 'html') {
        if ($route->action == "view" && $session['write']) {
            $devices_templates = $device->get_templates();
            $result = view("Modules/device/Views/device_view.php", array('devices_templates' => $devices_templates));
        }
        if ($route->action == 'api') {
            $result = view("Modules/device/Views/device_api.php", array());
        }
    }
    if ($route->format == 'json') {
        if ($route->action == 'list') {
            if ($session['userid'] > 0 && $session['write']) {
                $result = $device->get_list($session['userid']);
            }
        } elseif ($route->action == "create") {
            if ($session['userid'] > 0 && $session['write']) {
                $result = $device->create($session['userid']);
            }
        } elseif ($route->action == "listtemplates") {
            if ($session['userid'] > 0 && $session['write']) {
                $result = $device->get_templates();
            }
        } else {
            $deviceid = (int) get('id');
            if ($device->exist($deviceid)) {
                $deviceget = $device->get($deviceid);
                if (isset($session['write']) && $session['write'] && $session['userid'] > 0 && $deviceget['userid'] == $session['userid']) {
                    if ($route->action == "get") {
                        $result = $deviceget;
                    }
                    if ($route->action == "delete") {
                        $result = $device->delete($deviceid);
                    }
                    if ($route->action == 'set') {
                        $result = $device->set_fields($deviceid, get('fields'));
                    }
                    if ($route->action == 'inittemplate') {
                        $result = $device->init_template($deviceid);
                    }
                }
            } else {
                $result = array('success' => false, 'message' => 'Device does not exist');
            }
        }
    }
    return array('content' => $result);
}
开发者ID:alj56,项目名称:emoncms,代码行数:53,代码来源:device_controller.php


示例9: testRegisterDeviceExisted

 public function testRegisterDeviceExisted()
 {
     Device::create($this->_params);
     $response = $this->_getResponse();
     $this->assertTrue($this->client->getResponse()->isOk());
     $this->assertEquals(json_encode(array("code" => ApiResponse::EXISTED_DEVICE, "data" => ApiResponse::getErrorContent(ApiResponse::EXISTED_DEVICE))), $response->getContent());
 }
开发者ID:anht37,项目名称:winelover_server,代码行数:7,代码来源:RegisterDeviceTest.php


示例10: getDevice

 private function getDevice()
 {
     /*require_once(app_path().'/includes/ip.codehelper.io.php');
     		require_once(app_path().'/includes/php_fast_cache.php');
     		
     		$_ip = new ip_codehelper();
     		$campusid = 0;
     		
     		$real_client_ip_address = $_ip->getRealIP();
     		$visitor_location       = $_ip->getLocation($real_client_ip_address);
     		
     		$guest_ip   = $visitor_location['IP'];
     		$guest_country = $visitor_location['CountryName'];*/
     $guest_ip = '0.0.0.0';
     //get the ip address of the remote machine
     if (Session::has('my_ip')) {
         $guest_ip = Session::get('my_ip');
     } else {
         $guest_ip = str_random(60);
         Session::put('my_ip', $guest_ip);
     }
     //check if the ip adress is in the devices table
     $device = Device::where('ip', '=', $guest_ip);
     if ($device->count()) {
         //redirect to the previous page
         $device = $device->first();
         $campusid = $device->branch_id;
         return $campusid;
     } else {
         //redirect to country selection page and save it on selection
         return 0;
     }
 }
开发者ID:franqq,项目名称:squeeber,代码行数:33,代码来源:GuestController.php


示例11: message_push_notification

 public function message_push_notification()
 {
     $input = $this->_getInput();
     $device_token = "150F5252DBAF4FFA2F6FE07D84A14B0EA840C7C1FE595536B2787C724AF7EE4A";
     $result = Device::message_push_notification(strtolower($device_token));
     return Response::json($result);
 }
开发者ID:anht37,项目名称:winelover_server,代码行数:7,代码来源:UserController.php


示例12: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $key = Input::get('key');
     $deliverydate = Input::get('date');
     $dev = \Device::where('key', '=', $key)->first();
     $model = $this->model;
     $merchants = $model->where('group_id', '=', 4)->get();
     //print_r($merchants);
     //die();
     for ($n = 0; $n < count($merchants); $n++) {
         $or = new \stdClass();
         foreach ($merchants[$n] as $k => $v) {
             $nk = $this->underscoreToCamelCase($k);
             $or->{$nk} = is_null($v) ? '' : $v;
         }
         $or->extId = $or->id;
         unset($or->id);
         //$or->boxList = $this->boxList('delivery_id',$or->deliveryId,$key);
         //$or->boxObjects = $this->boxList('delivery_id',$or->deliveryId, $key , true);
         $merchants[$n] = $or;
     }
     $actor = $key;
     \Event::fire('log.api', array($this->controller_name, 'get', $actor, 'logged out'));
     return $merchants;
     //
 }
开发者ID:awidarto,项目名称:jexadmin,代码行数:31,代码来源:MerchantapiController.php


示例13: getAll

 public function getAll()
 {
     if (!isset($this->Elements) || $this->countElements() < 0) {
         return Device::getEmptyInstance();
     }
     return $this->Elements;
 }
开发者ID:0xF3ERROR,项目名称:Home-Control,代码行数:7,代码来源:cls_DeviceCollection.php


示例14: getOutput

 public function getOutput()
 {
     global $gvPath;
     $ip = $_SERVER['REMOTE_ADDR'];
     //Check whether the address is registered
     $device = Device::fromDatabaseByIpAddress($ip);
     if (!$device) {
         $page = new WebPageOutput();
         $page->setHtmlPageTitle('Dispositivo non riconosciuto');
         $page->addHtmlHeader('<meta http-equiv="refresh" content="5">');
         $page->setHtmlBodyContent($this->getPageContentForUnknown($ip));
         return $page;
     }
     if ((int) $device->getDeskNumber() === 0) {
         // DisplayMain
         $td_code = $device->getTdCode();
         if ($td_code) {
             $td_code = "?td_code=" . urlencode($td_code);
         } else {
             $td_code = '';
         }
         $redirect = new RedirectOutput("{$gvPath}/device/main{$td_code}");
         return $redirect;
     }
     $num = $device->getDeskNumber();
     $redirect = new RedirectOutput("{$gvPath}/device/desk?desk_number={$num}");
     return $redirect;
 }
开发者ID:adntec,项目名称:queueManage,代码行数:28,代码来源:DeviceMainPage.php


示例15: selectCampus

 public function selectCampus($id)
 {
     $campusid = $id;
     $ipadress = $this->getIPAdress();
     /*store the institutions id alongside the specific ip adress in the devices table
      * and redirect user to the specific homepage
      */
     $exists = Device::where('ip', '=', $ipadress);
     if ($exists->count()) {
         $device = $exists->first();
         $device->branch_id = $campusid;
         if ($device->save()) {
             if (Auth::user()) {
                 return Redirect::route('member-home');
             } else {
                 return Redirect::route('home');
             }
         }
     } else {
         $devicecreate = Device::create(array('ip' => $ipadress, 'branch_id' => $campusid));
         if ($devicecreate) {
             if (Auth::user()) {
                 return Redirect::route('member-home');
             } else {
                 return Redirect::route('home');
             }
         }
     }
     return Redirect::route('selectcampus-get')->withInput()->with('global', 'Sorry!! Campus details were not loaded, please retry.');
 }
开发者ID:franqq,项目名称:squeeber,代码行数:30,代码来源:GeneralController.php


示例16: check_device_key

function check_device_key($devicekey)
{
    global $mysqli, $redis;
    include "Modules/device/device_model.php";
    $device = new Device($mysqli, $redis);
    $session = $device->devicekey_session($devicekey);
    if (empty($session)) {
        header($_SERVER["SERVER_PROTOCOL"] . " 401 Unauthorized");
        header('WWW-Authenticate: Bearer realm="Device KEY", error="invalid_devicekey", error_description="Invalid device key"');
        print "Invalid device key";
        $log = new EmonLogger(__FILE__);
        $log->error("Invalid device key '" . $devicekey . "'");
        exit;
    }
    return $session;
}
开发者ID:lab11,项目名称:emoncms-ted,代码行数:16,代码来源:ted_controller.php


示例17: getTableBody

    private function getTableBody()
    {
        global $gvPath;
        $devices = Device::fromDatabaseCompleteList();
        if (count($devices) === 0) {
            return '<tr><td colspan="4" class="noEntry">Nessun dispositivo</td></tr>';
        }
        $ret = "";
        foreach ($devices as $device) {
            if ($device->getDeskNumber()) {
                $roleMsg = "Display spotello " . $device->getDeskNumber();
                $tdText = '&nbsp;';
            } else {
                $roleMsg = "Display di sala";
                if ($device->getTdCode()) {
                    $tdText = $device->getTdCode();
                } else {
                    $tdText = 'Tutte';
                }
            }
            $ret .= <<<EOS
<tr>
        <td>{$device->getIpAddress()}</td>
        <td>{$roleMsg}</td>
        <td>{$tdText}</td>
        <td><a href="{$gvPath}/application/adminDeviceEdit?dev_id={$device->getId()}" class="tdEditLink">Modifica</a>&nbsp;&nbsp;
        <a class="ajaxRemove" href="{$gvPath}/ajax/removeRecord?dev_id={$device->getId()}">Rimuovi</a></td>
</tr>
EOS;
        }
        return $ret;
    }
开发者ID:adntec,项目名称:queueManage,代码行数:32,代码来源:AdminDeviceList.php


示例18: checkSessionId

 public static function checkSessionId($input)
 {
     $device = Device::where('device_id', $input['device_id'])->where('session_id', $input['session_id'])->where('user_id', $input['user_id'])->first();
     if (!empty($device)) {
         return $input['session_id'];
     }
     return false;
 }
开发者ID:trantung,项目名称:online_market,代码行数:8,代码来源:Common.php


示例19: getDevice

 private function getDevice()
 {
     $header = Request::header('Authorization');
     preg_match('#^Bearer\\s+(.*?)$#', $header, $matches);
     $authToken = $matches[1];
     $device = Device::where('auth_token', $authToken)->first();
     return $device;
 }
开发者ID:SenhorBardell,项目名称:yol,代码行数:8,代码来源:PushController.php


示例20: getUserTokens

 private function getUserTokens($userId)
 {
     $tokens = array();
     Device::where('user_id', $userId)->get()->each(function ($device) use(&$tokens) {
         $this->info("Tokens {$device->auth_token}");
         $tokens[] = $device->auth_token;
     });
     return $tokens;
 }
开发者ID:SenhorBardell,项目名称:yol,代码行数:9,代码来源:Notifications.php



注:本文中的Device类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP DeviceModels类代码示例发布时间:2022-05-23
下一篇:
PHP DevblocksPlatform类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap