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

PHP Network类代码示例

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

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



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

示例1: get

 function get()
 {
     $profile_uid = intval($_GET['p']);
     $load = argc() > 1 && argv(1) == 'load' ? 1 : 0;
     header("Content-type: text/html");
     echo "<!DOCTYPE html><html><body>\r\n";
     echo array_key_exists('msie', $_GET) && $_GET['msie'] == 1 ? '<div>' : '<section>';
     $mod = new Network();
     $text = $mod->get($profile_uid, $load);
     $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
     $replace = "<img\${1} dst=\"\${2}\"";
     //        $text = preg_replace($pattern, $replace, $text);
     /*
     		if(! $load) {
     			$replace = '<br />' . t('[Embedded content - reload page to view]') . '<br />';
         	    $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
             	$text = preg_replace($pattern, $replace, $text);
     	        $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
         	    $text = preg_replace($pattern, $replace, $text);
             	$pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
     	        $text = preg_replace($pattern, $replace, $text);
         	    $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
             	$text = preg_replace($pattern, $replace, $text);
     		}
     */
     echo str_replace("\t", '       ', $text);
     echo array_key_exists('msie', $_GET) && $_GET['msie'] == 1 ? '</div>' : '</section>';
     echo "</body></html>\r\n";
     //	logger('update_network: ' . $text);
     killme();
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:31,代码来源:Update_network.php


示例2: render

 function render()
 {
     $network = new Network();
     $this->network_links = $network->get();
     $this->inner_HTML = $this->generate_inner_html();
     $links = parent::render();
     return $links;
 }
开发者ID:CivicCommons,项目名称:oldBellCaPA,代码行数:8,代码来源:SplashPageModule.php


示例3: insertCrawlData

 public function insertCrawlData($data)
 {
     $router_data = Router_old::getRouterInfo($data['router_id']);
     $actual_crawl_cycle = Crawling::getActualCrawlCycle();
     $last_endet_crawl_cycle = Crawling::getLastEndedCrawlCycle();
     /**Insert Router Interfaces*/
     foreach ($data['interface_data'] as $sendet_interface) {
         //Update RRD Graph DB
         $interface_last_endet_crawl = Interfaces::getInterfaceCrawlByCrawlCycleAndRouterIdAndInterfaceName($last_endet_crawl_cycle['id'], $data['router_id'], $sendet_interface['name']);
         $traffic_rx_bps = round(($sendet_interface['traffic_rx'] - $interface_last_endet_crawl['traffic_rx']) / $GLOBALS['crawl_cycle'] / 60);
         $traffic_rx_bps = $traffic_rx_bps < 0 ? 0 : $traffic_rx_bps;
         $traffic_tx_bps = round(($sendet_interface['traffic_tx'] - $interface_last_endet_crawl['traffic_tx']) / $GLOBALS['crawl_cycle'] / 60);
         $traffic_tx_bps = $traffic_tx_bps < 0 ? 0 : $traffic_tx_bps;
         //Set default indizies to prevent from warnings
         $sendet_interface['wlan_frequency'] = isset($sendet_interface['wlan_frequency']) ? preg_replace("/([A-Za-z])/", "", $sendet_interface['wlan_frequency']) : "";
         $sendet_interface['wlan_mode'] = isset($sendet_interface['wlan_mode']) ? $sendet_interface['wlan_mode'] : "";
         $sendet_interface['wlan_essid'] = isset($sendet_interface['wlan_essid']) ? $sendet_interface['wlan_essid'] : "";
         $sendet_interface['wlan_bssid'] = isset($sendet_interface['wlan_bssid']) ? $sendet_interface['wlan_bssid'] : "";
         $sendet_interface['wlan_tx_power'] = isset($sendet_interface['wlan_tx_power']) ? $sendet_interface['wlan_tx_power'] : 0;
         //check if interface already exists
         $networkinterface_test = new Networkinterface(false, (int) $data['router_id'], $sendet_interface['name']);
         //if interface not exist, create new
         if (!$networkinterface_test->fetch()) {
             $networkinterface_new = new Networkinterface(false, (int) $data['router_id'], $sendet_interface['name']);
             $networkinterface_id = $networkinterface_new->store();
         } else {
             $networkinterface_id = $networkinterface_test->getNetworkinterfaceId();
         }
         //save crawl data for interface
         $networkinterface_status = new NetworkinterfaceStatus(false, (int) $actual_crawl_cycle['id'], (int) $networkinterface_id, (int) $data['router_id'], $sendet_interface['name'], $sendet_interface['mac_addr'], (int) $sendet_interface['mtu'], (int) $sendet_interface['traffic_rx'], (int) $traffic_rx_bps, (int) $sendet_interface['traffic_tx'], (int) $traffic_tx_bps, $sendet_interface['wlan_mode'], $sendet_interface['wlan_frequency'], $sendet_interface['wlan_essid'], $sendet_interface['wlan_bssid'], (int) $sendet_interface['wlan_tx_power'], false);
         $networkinterface_status->store();
         //Update RRDDatabase
         $rrd_path_traffic_rx = ROOT_DIR . "/rrdtool/databases/router_{$data['router_id']}_interface_{$sendet_interface['name']}_traffic_rx.rrd";
         if (!file_exists($rrd_path_traffic_rx)) {
             exec("rrdtool create {$rrd_path_traffic_rx} --step 600 --start " . time() . " DS:traffic_rx:GAUGE:700:U:U DS:traffic_tx:GAUGE:900:U:U RRA:AVERAGE:0:1:144 RRA:AVERAGE:0:6:168 RRA:AVERAGE:0:18:240");
         }
         exec("rrdtool update {$rrd_path_traffic_rx} " . time() . ":" . round($traffic_rx_bps / 1000, 2) . ":" . round($traffic_tx_bps / 1000, 2));
         //add unknown ipv6 link local addresses to netmon
         //prepare data
         $ipv6_link_local_addr = explode("/", $sendet_interface['ipv6_link_local_addr']);
         $ipv6_link_local_netmask = isset($ipv6_link_local_addr[1]) ? (int) $ipv6_link_local_addr[1] : 64;
         $ipv6_link_local_addr = Ip::ipv6Expand($ipv6_link_local_addr[0]);
         //first try to determine network of given address
         $ipv6_link_local_network = Ip::ipv6NetworkFromAddr($ipv6_link_local_addr, (int) $ipv6_link_local_netmask);
         $network = new Network(false, false, $ipv6_link_local_network, (int) $ipv6_link_local_netmask, 6);
         if ($network->fetch()) {
             //if network found, then try to add ip address
             $ip = new Ip(false, (int) $networkinterface_id, $network->getNetworkId(), $ipv6_link_local_addr);
             $ip->store();
         }
     }
     RrdTool::updateRouterClientCountHistory($data['router_id'], $data['client_count']);
 }
开发者ID:wAmpIre,项目名称:netmon,代码行数:53,代码来源:crawl.class.php


示例4: postNetwork

 public function postNetwork()
 {
     $posted = Input::all();
     $Network = new Network();
     $Network->category_id = $posted['category_id'];
     $Network->country_id = $posted['country_id'];
     $Network->network_name = $posted['network_name'];
     $Network->delivery_time = $posted['delivery_time'];
     $Network->price = $posted['price'];
     $Network->save();
     return Redirect::back()->with('success', 'Network has been successfully added');
 }
开发者ID:bernardowiredu,项目名称:unlocking-site,代码行数:12,代码来源:NetworkController.php


示例5: render

 function render()
 {
     $network = new Network();
     $extra = unserialize(PA::$network_info->extra);
     $this->network_data = '';
     if (!empty($extra['network_feature'])) {
         $network->network_id = $extra['network_feature'];
         $this->network_data = $network->get();
     }
     $this->inner_HTML = $this->generate_inner_html();
     $content = parent::render();
     return $content;
 }
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:13,代码来源:FeaturedNetworkModule.php


示例6: __construct

 public function __construct($user_id = false, $ipv = false, $offset = false, $limit = false, $sort_by = false, $order = false)
 {
     $result = array();
     if ($offset !== false) {
         $this->setOffset((int) $offset);
     }
     if ($limit !== false) {
         $this->setLimit((int) $limit);
     }
     if ($sort_by !== false) {
         $this->setSortBy($sort_by);
     }
     if ($order !== false) {
         $this->SetOrder($order);
     }
     // initialize $total_count with the total number of objects in the list (over all pages)
     try {
         $stmt = DB::getInstance()->prepare("SELECT COUNT(*) as total_count\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM networks\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t(user_id = :user_id OR :user_id=0) AND\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t(ipv = :ipv OR :ipv=0)");
         $stmt->bindParam(':user_id', $user_id, PDO::PARAM_INT);
         $stmt->bindParam(':ipv', $ipv, PDO::PARAM_INT);
         $stmt->execute();
         $total_count = $stmt->fetch(PDO::FETCH_ASSOC);
     } catch (PDOException $e) {
         echo $e->getMessage();
         echo $e->getTraceAsString();
     }
     $this->setTotalCount((int) $total_count['total_count']);
     //if limit -1 then get all ressource records
     if ($this->getLimit() == -1) {
         $this->setLimit($this->getTotalCount());
     }
     try {
         $stmt = DB::getInstance()->prepare("SELECT id as network_id\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM networks\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t(user_id = :user_id OR :user_id=0) AND\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t(ipv = :ipv OR :ipv=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcase :sort_by\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhen 'create_date' then networks.create_date\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse NULL\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . $this->getOrder() . "\n\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT :offset, :limit");
         $stmt->bindParam(':user_id', $user_id, PDO::PARAM_INT);
         $stmt->bindParam(':ipv', $ipv, PDO::PARAM_INT);
         $stmt->bindParam(':offset', $this->getOffset(), PDO::PARAM_INT);
         $stmt->bindParam(':limit', $this->getLimit(), PDO::PARAM_INT);
         $stmt->bindParam(':sort_by', $this->getSortBy(), PDO::PARAM_STR);
         $stmt->execute();
         $result = $stmt->fetchAll(PDO::FETCH_ASSOC);
     } catch (PDOException $e) {
         echo $e->getMessage();
         echo $e->getTraceAsString();
     }
     foreach ($result as $network) {
         $network = new Network((int) $network['network_id']);
         $network->fetch();
         $this->networklist[] = $network;
     }
 }
开发者ID:wAmpIre,项目名称:netmon,代码行数:50,代码来源:Networklist.class.php


示例7: networks

 public function networks()
 {
     $networks = Network::where('user_id', '=', Auth::user()->id)->get();
     $page_data = array('network_count' => count($networks), 'networks' => $networks);
     $this->layout->title = 'Networks';
     $this->layout->content = View::make('admin.networks', $page_data);
 }
开发者ID:anchetaWern,项目名称:ahead,代码行数:7,代码来源:AdminController.php


示例8: handlePOST

 public function handlePOST($request_data)
 {
     global $mothership_info;
     if (!empty($request_data['request'])) {
         //code for requesting
         $this->error = FALSE;
         $this->success = FALSE;
         try {
             $request_sent = Network::join(PA::$network_info->network_id, PA::$login_uid);
             if (!empty($request_sent)) {
                 $this->success = TRUE;
             }
         } catch (PAException $e) {
             $join_error = $e->message;
             $this->error = TRUE;
         }
         if (!empty($this->error)) {
             $this->error_msg = sprintf(__('Your request to join this network could not be sent due to following reason: %s. You can go back to the home network by clicking Return to home network'), $join_error);
         } else {
             $this->success_msg = __('Your request to join this network has been successfully sent to the moderator of this network. The Moderator will check this request and approve or deny the request. You can go back to mother network by clicking the button Return to home network');
         }
         $this->mode = 'msg_display';
     }
     if (!empty($request_data['back'])) {
         //redirect to mother network
         global $mothership_info;
         $this->message = __('Return to home network successfully.');
         $this->redirect2 = NULL;
         $his->queryString = NULL;
         $this->isError = FALSE;
         $this->setWebPageMessage();
     }
 }
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:33,代码来源:RequestModule.php


示例9: get_links

 function get_links()
 {
     // Loading the Searching data
     if ($this->sort_by == 'alphabetic') {
         $this->sort_by = 'login_name';
         $sorting_direction = 'ASC';
     } else {
         $this->sort_by = 'created';
         $sorting_direction = 'DESC';
     }
     global $network_info;
     $users = array();
     if ($this->search_data) {
         // load users on the basis of the search parameters.
         $users_count = User::user_search($this->search_data, $this->viewer_uid, $network_info->network_id);
         $this->Paging["count"] = $users_count['total_users'];
         $users = User::user_search($this->search_data, $this->viewer_uid, $network_info->network_id, FALSE, $this->Paging["show"], $this->Paging["page"], 'U.' . $this->sort_by, $sorting_direction);
     } else {
         $this->Paging["count"] = Network::get_network_members($network_info->network_id, array('cnt' => TRUE));
         $params = array('page' => $this->Paging["page"], 'show' => $this->Paging["show"], 'sort_by' => $this->sort_by, 'direction' => $sorting_direction);
         $users = Network::get_network_members($network_info->network_id, $params);
     }
     // echo "<pre>" . print_r($users,1) . "</pre>";
     $this->users_data = $users['users_data'];
 }
开发者ID:CivicCommons,项目名称:oldBellCaPA,代码行数:25,代码来源:PeopleModule.php


示例10: ephimeral_port

 /**
  * Find an open port in a given range, trying several times.
  * Return FALSE if no open port is found after a timeout (1 second by default)
  *
  * @param  string  $host
  * @param  integer $range_start
  * @param  integer $range_end
  * @param  integer $timeout
  * @return integer|boolean
  */
 public static function ephimeral_port($host, $range_start = 1000, $range_end = 5000, $timeout = 1000)
 {
     return Attempt::make(function () use($host, $range_start, $range_end) {
         $port = rand($range_start, $range_end);
         return Network::is_port_open($host, $port) ? $port : FALSE;
     }, $timeout);
 }
开发者ID:openbuildings,项目名称:spiderling,代码行数:17,代码来源:Network.php


示例11: get_links

 private function get_links()
 {
     //get total count
     $param = array('network_id' => PA::$network_info->network_id, 'cnt' => TRUE, 'neglect_owner' => TRUE);
     //search by login name, including full names also
     if (!empty($this->keyword)) {
         $param['search_keyword'] = $this->keyword;
         $param['also_search_fullname'] = true;
     }
     $param['sort_by'] = $this->sort_by;
     $param['direction'] = $this->direction;
     $param['show_waiting_users'] = true;
     $this->Paging["count"] = Network::get_members($param);
     //now we dont need $param['cnt']
     unset($param['cnt']);
     $param['show'] = $this->Paging['show'];
     $param['page'] = $this->Paging['page'];
     //get actual list
     $users = Network::get_members($param);
     $links = $users['users_data'];
     $objects = array('network' => true, 'groups' => array(), 'forums' => array());
     //echo serialize($objects);
     //    echo '<pre>'.print_r($links,1).'</pre>';
     return $links;
 }
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:25,代码来源:NetworkResultUserModule.php


示例12: getBoardsInfo

 private function getBoardsInfo()
 {
     $boards_info = array();
     $this->nid = isset($this->shared_data['network_id']) ? $this->shared_data['network_id'] : PA::$network_info->network_id;
     $boards = PaForumBoard::listPaForumBoard("network_id = {$this->nid} AND is_active = 1", 'type', 'ASC', 10);
     if (count($boards) > 0) {
         for ($i = 0; $i < count($boards); $i++) {
             $title = $boards[$i]->get_title();
             $type = $boards[$i]->get_type();
             $boards_info[$i]['title'] = strlen($title) <= self::max_title_length ? $title : substr($title, 0, self::max_title_length + 3) . '...';
             $boards_info[$i]['type'] = $type;
             $net_id = $boards[$i]->get_network_id();
             if (Network::is_mother_network($net_id)) {
                 $address = 'www';
             } else {
                 $network = Network::get_by_id((int) $net_id);
                 $address = $network->address;
             }
             $url = "http://{$address}." . PA::$domain_suffix . PA_ROUTE_FORUMS . "/network_id=" . $net_id;
             switch ($type) {
                 case PaForumBoard::network_board:
                     break;
                 case PaForumBoard::group_board:
                     $url .= "&gid=" . $boards[$i]->get_owner_id();
                     break;
                 case PaForumBoard::personal_board:
                     $url .= "&user_id=" . $boards[$i]->get_owner_id();
                     break;
             }
             $boards_info[$i]['url'] = $url;
         }
     }
     return $boards_info;
 }
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:34,代码来源:ForumsListModule.php


示例13: getNetwork

 public function getNetwork()
 {
     if (!$this->_network instanceof Network_Interface) {
         $this->_network = Network::create($this);
     }
     return $this->_network;
 }
开发者ID:vyrus,项目名称:ip-conntrack-max-fixer,代码行数:7,代码来源:Context.php


示例14: auto_email_notification

function auto_email_notification($activity_type, $params)
{
    global $network_info;
    global $to, $mail_type, $mail_sub_msg_array, $from, $no_id, $network_owner, $subject, $message, $owner;
    if (!$network_info) {
        return;
    }
    //setting common variables
    //mail to
    if ($network_info->type == MOTHER_NETWORK_TYPE) {
        $network_owner_id = SUPER_USER_ID;
    } else {
        $network_owner_id = Network::get_network_owner($network_info->network_id);
    }
    $network_owner = User::map_ids_to_logins($network_owner_id);
    $owner = new User();
    foreach ($network_owner as $key => $value) {
        $owner->load((int) $key);
    }
    $to = $owner->email;
    $owner_name = $owner->login_name;
    //mail from
    $from = (int) $_SESSION['user']['id'];
    $array_of_data = array('to' => $to, 'from' => $from, 'owner_name' => $owner_name, 'params' => $params);
    call_user_func_array($activity_type, array($array_of_data));
}
开发者ID:CivicCommons,项目名称:oldBellCaPA,代码行数:26,代码来源:auto_email_notify.php


示例15: get_user_links

 function get_user_links()
 {
     $extra = unserialize(PA::$network_info->extra);
     if (Network::is_mother_network(PA::$network_info->network_id)) {
         $uid = SUPER_USER_ID;
     } else {
         $uid = Network::get_network_owner(PA::$network_info->network_id);
     }
     $condition = array('user_id' => $uid, 'is_active' => 1);
     $limit = 5;
     // 5 lists to be display on home page
     $Links = new NetworkLinks();
     $category_list = $Links->load_category($condition, $limit);
     if (!empty($category_list)) {
         for ($counter = 0; $counter < count($category_list); $counter++) {
             $links_data_array[$counter]['category_id'] = $category_list[$counter]->category_id;
             $links_data_array[$counter]['category_name'] = $category_list[$counter]->category_name;
             $Links->user_id = $uid;
             $condition = array('category_id' => $category_list[$counter]->category_id, 'is_active' => 1);
             $limit = 5;
             // 5 links to be display on home page
             $links_array = $Links->load_link($condition, $limit);
             $links_data_array[$counter]['links'] = $links_array;
         }
         return $links_data_array;
     }
 }
开发者ID:CivicCommons,项目名称:oldBellCaPA,代码行数:27,代码来源:NetworkDefaultLinksModule.php


示例16: auto_email_notification

/** how to use this file
 *
 * include this file where you want to call auto_email_notification
 *  then create a function in this file as it is depicted in                           *  extra['notify_owner']['<-case->']['caption'] field of network info
 *  for examaple 'some_joins_a_network'
 *  within that function return if extra['notify_owner']['<-case->']['value'] !=       *  NET_NONE means no notification
 *  other wise set variables that is to be used in mail/message subject body
 *  then call function $this->switch_destination($destination)
 *
 */
function auto_email_notification($activity_type, $params)
{
    if (!PA::$network_info) {
        return;
    }
    //setting common variables
    $notification = new EmailNotification();
    //mail to
    if (PA::$network_info->type == MOTHER_NETWORK_TYPE) {
        $network_owner_id = SUPER_USER_ID;
    } else {
        $network_owner_id = Network::get_network_owner(PA::$network_info->network_id);
    }
    $notification->network_owner = User::map_ids_to_logins($network_owner_id);
    $notification->owner = new User();
    foreach ($notification->network_owner as $key => $value) {
        $notification->owner->load((int) $key);
    }
    $notification->to = $notification->owner->email;
    $owner_name = $notification->owner->login_name;
    //mail from
    $notification->from = (int) PA::$login_uid;
    $array_of_data = array('to' => $notification->to, 'from' => $notification->from, 'owner_name' => $owner_name, 'params' => $params);
    $notification->send($activity_type, $array_of_data);
}
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:35,代码来源:auto_email_notify.php


示例17: setup_module

function setup_module($column, $moduleName, $obj)
{
    global $content_type, $show_media, $uid, $group_ids, $paging, $error_msg, $login_uid;
    $extra = unserialize(PA::$network_info->extra);
    $authorized_users = array();
    if (!empty($show_media)) {
        $authorized_users = array($show_media->author_id, PA::$network_info->owner_id);
        if ($extra['network_content_moderation'] == NET_YES && Network::item_exists_in_moderation($show_media->content_id, $show_media->parent_collection_id, 'content') && !in_array($login_uid, $authorized_users)) {
            $error_msg = 1001;
            return 'skip';
        }
    }
    switch ($column) {
        case 'middle':
            $obj->mode = PUB;
            $obj->content_id = $_REQUEST['cid'];
            $obj->uid = $uid;
            $obj->media_data = $show_media;
            $obj->Paging["page"] = $paging["page"];
            $obj->Paging["show"] = $paging["show"];
            break;
        default:
            return 'skip';
            break;
    }
}
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:26,代码来源:media_full_view.php


示例18: log_in

 public function log_in($uid, $remember_me, $login_source)
 {
     $user_type = Network::get_user_type(PA::$network_info->network_id, $uid);
     if ($user_type == DISABLED_MEMBER) {
         throw new CNException(USER_ACCESS_DENIED, 'Your account has been temporarily disabled by the administrator.');
     }
     $logged_user = new User();
     // load user
     $logged_user->load((int) $uid);
     $logged_user->set_last_login();
     PA::$login_user = $logged_user;
     register_session($logged_user->login_name, $logged_user->user_id, $logged_user->role, $logged_user->first_name, $logged_user->last_name, $logged_user->email, $logged_user->picture);
     if ($remember_me) {
         // set login cookie
         if ($this->login_cookie->is_new()) {
             $this->login_cookie->new_session($uid);
         }
         $cookie_value = $this->login_cookie->get_cookie();
         $cookie_expiry = time() + LoginCookie::$cookie_lifetime;
         // update tracking info
         $this->login_cookie->update_tracking_info($_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR']);
     } else {
         // clear login cookie
         $cookie_value = "";
         $cookie_expiry = 0;
     }
     // remember series ID, so we can destroy session on logout
     $_SESSION['login_series'] = $this->login_cookie->get_series();
     // remember login source, so we know if it's safe to let user change password, etc
     $_SESSION['login_source'] = $login_source;
     // set new cookie for next login!  (or delete cookie, if not remembering login)
     setcookie(PA_Login::$cookie_name, $cookie_value, $cookie_expiry, PA::$local_url, "." . PA::$domain_suffix);
 }
开发者ID:Cyberspace-Networks,项目名称:CoreSystem,代码行数:33,代码来源:CNLogin.php


示例19: getProducts

 public function getProducts($id)
 {
     $category = Category::find($id);
     $network = Network::where('category_id', '=', $id)->get();
     $product = Product::where('category_id', '=', $id)->paginate(9);
     $phone = Product::where('category_id', '=', $id)->get();
     return View::make('products.index')->with('category', $category)->with('network', $network)->with('product', $product)->with('phone', $phone);
 }
开发者ID:bernardowiredu,项目名称:unlocking-site,代码行数:8,代码来源:CategoryController.php


示例20: trainByHost

 /**
  * @uses Network::saveToFile()
  * @uses Network::train()
  * @uses saveToHost()
  */
 protected function trainByHost()
 {
     $this->saveToHost();
     if ($this->objNetwork instanceof Network) {
         $this->objNetwork->saveToFile($this->strDir . '/' . $_POST['username'] . '.dat');
         $this->objNetwork->train();
     }
 }
开发者ID:0-php,项目名称:AI,代码行数:13,代码来源:Server.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP NetworkPort类代码示例发布时间:2022-05-23
下一篇:
PHP Net_UserAgent_Mobile类代码示例发布时间: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