當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BaseObject::getAll方法代碼示例

本文整理匯總了PHP中BaseObject::getAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP BaseObject::getAll方法的具體用法?PHP BaseObject::getAll怎麽用?PHP BaseObject::getAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BaseObject的用法示例。


在下文中一共展示了BaseObject::getAll方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getAll

 public function getAll()
 {
     $connections = parent::getAll();
     // Explode jcli command output to fetch groups
     $exploded = explode("#", $connections);
     // Unset first and second elements that include unwanted results from the command group -l
     unset($exploded[0]);
     unset($exploded[1]);
     $connections = [];
     foreach ($exploded as $expl) {
         $connector = trim($expl);
         //fetch string before the "Total Users:" phrase. This has the last user that was parsed from jcli
         $ff = strstr($expl, 'Total Users:', true);
         if (!empty($ff)) {
             $connector = trim($ff);
         }
         $temp_connector = explode(" ", $connector);
         $temp_connector = array_filter($temp_connector);
         $fixed_connector = array();
         foreach ($temp_connector as $temp) {
             array_push($fixed_connector, $temp);
         }
         $connections[] = ['uid' => $fixed_connector[0], 'gid' => $fixed_connector[1], 'username' => $fixed_connector[2], 'balance' => $fixed_connector[3], 'mt' => $fixed_connector[4], 'throughput' => $fixed_connector[5]];
     }
     return $connections;
 }
開發者ID:haegemon,項目名稱:jasmin-web,代碼行數:26,代碼來源:User.php

示例2: getAll

 public function getAll()
 {
     $connectors = parent::getAll();
     // Explode jcli command output to fetch groups
     $exploded = explode("#", $connectors);
     // Unset first and second elements that include unwanted results from the command group -l
     unset($exploded[0]);
     unset($exploded[1]);
     $connectors = [];
     foreach ($exploded as $expl) {
         $user = trim($expl);
         //fetch string before the "Total Users:" phrase. This has the last user that was parsed from jcli
         $ff = strstr($expl, 'Total Users:', true);
         if (!empty($ff)) {
             $user = trim($ff);
         }
         $temp_user = explode(" ", $user);
         $temp_user = array_filter($temp_user);
         $fixed_user = array();
         foreach ($temp_user as $temp) {
             array_push($fixed_user, $temp);
         }
         $userz['cid'] = $fixed_user[0];
         $userz['status'] = $fixed_user[1];
         $userz['session'] = $fixed_user[2];
         $userz['starts'] = isset($fixed_user[3]) ? $fixed_user[3] : 0;
         $userz['stops'] = isset($fixed_user[4]) ? $fixed_user[4] : 0;
         array_push($connectors, $userz);
     }
     return $connectors;
 }
開發者ID:haegemon,項目名稱:jasmin-web,代碼行數:31,代碼來源:Connector.php

示例3: getAll

 public function getAll()
 {
     $fetch_groups = parent::getAll();
     // Explode jcli command output to fetch groups
     $exploded = explode("#", $fetch_groups);
     // Unset first and second elements that include unwanted results from the command group -l
     unset($exploded[0]);
     unset($exploded[1]);
     $groups = [];
     foreach ($exploded as $expl) {
         $group = trim($expl);
         //fetch string before the "Total Groups:" lectic
         $ff = strstr($expl, 'Total Groups:', true);
         if (!empty($ff)) {
             $group = trim($ff);
         }
         $groups[] = ['gid' => $group];
     }
     return $groups;
 }
開發者ID:haegemon,項目名稱:jasmin-web,代碼行數:20,代碼來源:Group.php


注:本文中的BaseObject::getAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。