当前位置: 首页>>代码示例>>PHP>>正文


PHP F3::get方法代码示例

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


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

示例1: _get_f_list_id

function _get_f_list_id($uid)
{
    $facebook = F3::get('Facebook');
    $f_list_exists = false;
    try {
        // Try and see if they already have a "Single Yet?" friendslist
        // But maybe deleted their account from our site or somehow
        // their friendlist field went blank in the DB
        // And catch general Facebook errors...
        $f_lists = $facebook->api($uid . '/friendlists');
    } catch (FacebookApiException $e) {
        F3::error('500');
    }
    // Loop through each friendlist and
    // see if it is the Single Yet? friendlist
    foreach ($f_lists['data'] as $f_list) {
        if ($f_list['name'] == 'Single Yet?') {
            $f_list_exists = true;
            $f_list_id = $f_list['id'];
            // If there is a friendlist for Single Yet?, break out of loop.
            break;
        }
    }
    // If the Single Yet? friendlist doesn't exist, create it.
    if (!$f_list_exists) {
        $f_list = $facebook->api($uid . '/friendlists', 'post', array('name' => 'Single Yet?'));
        $f_list_id = $f_list['id'];
    }
    return $f_list_id;
}
开发者ID:nicholasserra,项目名称:singleyet,代码行数:30,代码来源:index.php

示例2: login

 public function login($f3, $args)
 {
     self::check_configuration();
     $params = json_decode($f3->get('BODY'));
     if ($params->username && $params->password) {
         $login = new DB\Jig\Mapper($this->db, 'users.json');
         $temp = $login->find(array('(isset(@userName) && @userName == ?)', $params->username));
         if ($temp) {
             $first = __::first($temp);
             if (password_verify($params->password, $first['password'])) {
                 $date = new DateTime();
                 $date->add(new DateInterval('PT' . F3::get('custom.TTL') . 'H'));
                 $out = array('username' => $first['userName'], 'userid' => $first['_id'], 'ttl' => $date->format('Y-m-d H:i:s'), 'roles' => self::get_roles($first['_id']));
                 $jwt = JWT::encode($out, F3::get('custom.SUPER-KEY'));
                 echo json_encode(array('token' => $jwt, 'data' => array('firstName' => $first['firstName'], 'lastName' => $first['lastName'], 'userName' => $first['userName'])));
             } else {
                 self::wrong_login();
             }
         } else {
             self::wrong_login();
         }
     } else {
         self::wrong_login();
     }
 }
开发者ID:boliviasoftware,项目名称:micro-system-maker,代码行数:25,代码来源:login.php

示例3: yukle

function yukle($hedef = NULL, $alan = 'file')
{
    $yuklenen = F3::get("FILES.{$alan}.tmp_name");
    // hedef ve yüklenen dosyanın boş olmasına izin veriyoruz
    // herhangi biri boşsa mesele yok, çağırana dön
    if (empty($hedef) || empty($yuklenen)) {
        return true;
    }
    // bu bir uploaded dosya olmalı, fake dosyalara izin yok
    if (is_uploaded_file($yuklenen)) {
        // boyutu sınırla, değeri öylesine seçtim
        if (filesize($yuklenen) > 600000) {
            F3::set('error', 'Resim çok büyük');
        } else {
            if (exif_imagetype($yuklenen) != IMAGETYPE_JPEG) {
                F3::set('error', 'Resim JPEG değil');
            } else {
                if (file_exists($hedef)) {
                    F3::set('error', 'Resim zaten kaydedilmiş');
                } else {
                    if (!move_uploaded_file($yuklenen, $hedef)) {
                        F3::set('error', 'Dosya yükleme hatası');
                    }
                }
            }
        }
        // yok başka bir ihtimal!
    } else {
        // bu aslında bir atak işareti
        F3::set('error', 'Dosya geçerli bir yükleme değil');
    }
    return false;
}
开发者ID:seyyah,项目名称:uzkay,代码行数:33,代码来源:kaydet.php

示例4: logout

 function logout()
 {
     if (F3::get('SESSION.onlineUser')) {
         F3::clear('SESSION.onlineUser');
         F3::reroute('/');
     }
 }
开发者ID:pshreez,项目名称:PHP,代码行数:7,代码来源:user_login.php

示例5: get

 /**
  * returns items
  *
  * @return mixed items as array
  * @param mixed $options search, offset and filter params
  */
 public function get($options = array())
 {
     $options = array_merge(array('starred' => false, 'offset' => 0, 'search' => false, 'items' => \F3::get('items_perpage')), $options);
     $items = $this->backend->get($options);
     // remove private posts with private tags
     if (!\F3::get('auth')->showPrivateTags()) {
         foreach ($items as $idx => $item) {
             $tags = explode(',', $item['tags']);
             foreach ($tags as $tag) {
                 if (strpos(trim($tag), '@') === 0) {
                     unset($items[$idx]);
                     break;
                 }
             }
         }
         $items = array_values($items);
     }
     // remove posts with hidden tags
     if (!isset($options['tag']) || strlen($options['tag']) === 0) {
         foreach ($items as $idx => $item) {
             $tags = explode(',', $item['tags']);
             foreach ($tags as $tag) {
                 if (strpos(trim($tag), '#') === 0) {
                     unset($items[$idx]);
                     break;
                 }
             }
         }
         $items = array_values($items);
     }
     return $items;
 }
开发者ID:andrel,项目名称:selfoss,代码行数:38,代码来源:Items.php

示例6: home

 function home()
 {
     $this->view->title = 'Open Postbox | India';
     $this->view->caption = 'Latest postboxes added.';
     $q = 'select * from post_box order by cast(created_time as int) desc limit 14';
     $POSTBOX_DB = \F3::get('POSTBOX_DB');
     $result = $POSTBOX_DB->exec($q);
     $array_all_postboxes = array();
     foreach ($result as $row) {
         $single_postbox = array();
         $single_postbox['post_id'] = $row["post_id"];
         $single_postbox['lat'] = $row["lat"];
         $single_postbox['lan'] = $row["lan"];
         $single_postbox['pincode'] = $row["pincode"];
         $single_postbox['caption'] = $row["caption"];
         $single_postbox['img'] = $row["img"];
         $single_postbox['picture_url'] = $row["picture_url"];
         $array_all_postboxes[$row["post_id"]] = $single_postbox;
     }
     $this->view->set('array_all_postboxes', $array_all_postboxes);
     $q = 'select * from stats order by sl desc limit 1';
     $result = $POSTBOX_DB->exec($q);
     foreach ($result as $row) {
         $post_count = $row["post_count"];
         $user_count = $row["user_count"];
         $this->view->set('is_home', 1);
         $this->view->set('post_count', $post_count);
         $this->view->set('user_count', $user_count);
     }
     $out = Template::instance()->render('basic/sub_home.html');
     $this->view->set('sub_out_put', $out);
     $this->view->set('enable_maps', 1);
     echo Template::instance()->render('basic/main.html');
 }
开发者ID:datameet,项目名称:openpostbox,代码行数:34,代码来源:main.php

示例7: add

 /**
  * add new source
  *
  * @return int new id
  * @param string $title
  * @param string $tags
  * @param string $spout the source type
  * @param mixed $params depends from spout
  */
 public function add($title, $tags, $spout, $params)
 {
     // sanitize tag list
     $tags = implode(',', preg_split('/\\s*,\\s*/', trim($tags), -1, PREG_SPLIT_NO_EMPTY));
     $res = \F3::get('db')->exec('INSERT INTO sources (title, tags, spout, params) VALUES (:title, :tags, :spout, :params) RETURNING id', array(':title' => trim($title), ':tags' => $tags, ':spout' => $spout, ':params' => htmlentities(json_encode($params))));
     return $res[0]['id'];
 }
开发者ID:gabor-udvari,项目名称:selfoss,代码行数:16,代码来源:Sources.php

示例8: is_table_exists

function is_table_exists($table, $db = NULL)
{
    if (is_null($db)) {
        $db = F3::get('DB.name');
    }
    return $db && F3::sql(array("SELECT COUNT(*) AS found " . "FROM information_schema.tables " . "WHERE table_schema='{$db}' " . "AND table_name='{$table}';"));
}
开发者ID:seyyah,项目名称:uzkay,代码行数:7,代码来源:db.php

示例9: item

 public function item($identifier, $options = array())
 {
     try {
         // Configurations
         $this->options = array_merge($this->options, $options);
         // Initialize Item Object
         $item = new ItemModel();
         // Fetch Shared Item Data
         DB::sql($this->query['item'], array("item" => $identifier));
         $shared = F3::get('DB')->result[0];
         // Presumably, no item data found
         if (empty($shared)) {
             throw new Exception("No item found.");
         }
         // Assign Class Attributes
         foreach ($shared as $key => $attribute) {
             $item->{$key} = $attribute;
         }
         // Fetch Parent
         // Fetch Flags
         // Property Collection
         if ($this->options['properties']) {
             switch ($item->rarity) {
                 case "normal":
                     $item->properties['normal'] = DB::sql($this->query['properties'], array("item" => $item->name));
                     break;
                 case "unique":
                     $item->properties['magic'] = DB::sql($this->query['properties_magic'], array("item" => $item->name));
                     break;
                 case "set":
                     $item->properties['magic'] = DB::sql($this->query['properties_magic'], array("item" => $item->name));
                     $item->properties['set'] = DB::sql($this->query['properties_set'], array("item" => $item->name));
                     break;
                 default:
                     throw new Exception("Unknown rarity.");
             }
             // Translate Item Properties
             $tokens = array("@param", "@min", "@max");
             foreach ($item->properties as $type_key => $type) {
                 if ($type_key != 'normal') {
                     foreach ($type as $row_key => $row) {
                         // Determine which string to use
                         $field = $row['minimum'] == $row['maximum'] ? "translation" : "translation_varies";
                         // Order must line up with $tokens
                         $values = array($row['parameter'], $row['minimum'], $row['maximum']);
                         // Replace database tokens with values
                         $item->properties[$type_key][$row_key]['translation'] = str_replace($tokens, $values, $row[$field]);
                         // Unset unecessary string
                         unset($item->properties[$type_key][$row_key]['translation_varies']);
                     }
                 }
             }
         }
     } catch (Excecption $e) {
         error_log($e->getMessage());
         return false;
     }
     // Return JSON string
     return json_encode($item);
 }
开发者ID:huckfinnaafb,项目名称:leviatha,代码行数:60,代码来源:LootModel.php

示例10: pull_data

 function pull_data()
 {
     $this->view->set('title', 'PostBox - Instagram Data Pull');
     $instagram_api_clinet_id = 'b9d4b604105648168c671293d10cc67e';
     $instagram_api_url = 'https://api.instagram.com/v1/tags/openpostboxindia/media/recent?client_id=' . $instagram_api_clinet_id;
     $data_pull_messages = array();
     $ch = curl_init($instagram_api_url);
     curl_setopt($ch, CURLOPT_HEADER, 0);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
     $json = curl_exec($ch);
     curl_close($ch);
     $data = json_decode($json, true);
     //var_dump($data);
     if ($data['meta']['code'] == 200) {
         //echo 'sucess';
         $picture_dicts = $data['data'];
         foreach ($picture_dicts as $pic) {
             $tags = implode(', ', $pic['tags']);
             $pincode = 0;
             foreach ($pic['tags'] as $tag) {
                 if ($this->startswith4($tag, 'pin')) {
                     $pincode = substr($tag, 3, 10);
                 }
             }
             $lat = $pic['location']['latitude'];
             $lan = $pic['location']['longitude'];
             $created_time = $pic['created_time'];
             $picture_url = $pic['images']['standard_resolution']['url'];
             $post_id = $pic['id'];
             $username = 'instagram-' . $pic["user"]["username"];
             $website = '';
             //$pic["user"]["website"];
             $caption = $pic["caption"]["text"];
             //check if post_id exists, if yes then go to next one. else insert
             $data_pull_messages[] = "Processing the post_id=" . $post_id;
             $q = 'select count(*) as count_posts from post_box where post_id="' . $post_id . '"';
             $POSTBOX_DB = \F3::get('POSTBOX_DB');
             $result = $POSTBOX_DB->exec($q);
             //print '\n'.$q;
             $count_posts = 0;
             foreach ($result as $row) {
                 $count_posts = $row['count_posts'];
             }
             if ($count_posts == 0) {
                 $data_pull_messages[] = "Lets INSERT.";
                 $i = 'insert into post_box( post_id , picture_url , tags , lat , lan , created_time , username , website,pincode, caption, provider) values(' . '"' . $post_id . '","' . $picture_url . '","' . $tags . '","' . $lat . '","' . $lan . '","' . $created_time . '","' . $username . '","' . $website . '","' . $pincode . '","' . $caption . '"' . ',"Instagram")';
                 //print $i;
                 $POSTBOX_DB->exec($i);
             } else {
                 $data_pull_messages[] = "Already exists.";
             }
         }
     }
     $this->view->set('data_pull_messages', $data_pull_messages);
     $out = Template::instance()->render('basic/sub_data_pull.html');
     $this->view->set('sub_out_put', $out);
     echo Template::instance()->render('basic/main.html');
 }
开发者ID:datameet,项目名称:openpostbox,代码行数:59,代码来源:instagram.php

示例11: jwt_decode

 public function jwt_decode($token)
 {
     try {
         return JWT::decode($token, F3::get('custom.SUPER-KEY'));
     } catch (Exception $e) {
         return false;
     }
 }
开发者ID:boliviasoftware,项目名称:micro-system-maker,代码行数:8,代码来源:common.php

示例12: load

 /**
  * loads content for given source
  *
  * @return void
  * @param string $url
  */
 public function load($params)
 {
     $this->apiKey = $params['api'];
     if (strlen(trim($this->apiKey)) == 0) {
         $this->apiKey = \F3::get('readability');
     }
     parent::load(array('url' => $params['url']));
 }
开发者ID:ZMOM1031,项目名称:selfoss,代码行数:14,代码来源:readability.php

示例13: __call

 /**
  * pass any method call to the backend.
  * 
  * @return methods return value
  * @param string $name name of the function
  * @param array $args arguments
  */
 public function __call($name, $args)
 {
     if (method_exists($this->backend, $name)) {
         return call_user_func_array(array($this->backend, $name), $args);
     } else {
         \F3::get('logger')->log('Unimplemented method for ' . \F3::get('db_type') . ': ' . $name, \ERROR);
     }
 }
开发者ID:andrel,项目名称:selfoss,代码行数:15,代码来源:Tags.php

示例14: cleanup

 /**
  * cleanup orphaned and old items
  *
  * @return void
  * @param DateTime $date date to delete all items older than this value [optional]
  */
 public function cleanup(\DateTime $date = NULL)
 {
     \F3::get('db')->exec('DELETE FROM items WHERE id IN (
                             SELECT items.id FROM items LEFT JOIN sources
                             ON items.source=sources.id WHERE sources.id IS NULL)');
     if ($date !== NULL) {
         \F3::get('db')->exec('DELETE FROM items WHERE starred=0 AND datetime<:date', array(':date' => $date->format('Y-m-d') . ' 00:00:00'));
     }
 }
开发者ID:gabor-udvari,项目名称:selfoss,代码行数:15,代码来源:Items.php

示例15: getUserAgent

 /**
  * get the user agent to use for web based spouts
  *
  * @return the user agent string for this spout
  */
 public static function getUserAgent($agentInfo = null)
 {
     $userAgent = 'Selfoss/' . \F3::get('version');
     if (is_null($agentInfo)) {
         $agentInfo = array();
     }
     $agentInfo[] = '+http://selfoss.aditu.de';
     return $userAgent . ' (' . implode('; ', $agentInfo) . ')';
 }
开发者ID:sevengage,项目名称:feed-merge,代码行数:14,代码来源:WebClient.php


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