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


PHP API::__construct方法代码示例

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


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

示例1:

 function __construct()
 {
     /* Since parent constructors are not called implicitly if */
     /* the child class defines a constructor we simpley call it */
     /* here to inherit the parent's methods and bad habits. */
     parent::__construct();
 }
开发者ID:dramalcolm,项目名称:pedicabAPI,代码行数:7,代码来源:page.php

示例2: __construct

 public function __construct($request, $origin)
 {
     $this->config = (include 'config.php');
     $this->initDB();
     $this->sanitizeHTTPParameters();
     parent::__construct($request);
 }
开发者ID:HMProgrammingClub,项目名称:NYCSL,代码行数:7,代码来源:DefHacksAPI.php

示例3: __construct

 public function __construct($request)
 {
     parent::__construct($request);
     // Grab the uid from Webauth, API Key lookup, etc
     if (array_key_exists("WEBAUTH_USER", $_SERVER)) {
         $this->uid = htmlentities($_SERVER["WEBAUTH_USER"]);
         $this->webauth = true;
     } else {
         if ($this->api_key) {
             $this->uid = $this->_lookupUser($this->api_key);
             $this->webauth = false;
         } else {
             if (DEBUG) {
                 $this->uid = DEBUG_USER_UID;
                 $this->webauth = true;
             } else {
                 $this->uid = false;
                 $this->webauth = false;
             }
         }
     }
     // Check if the user is a drink admin
     if ($this->uid != false) {
         $this->admin = $this->_isAdmin($this->uid);
     }
 }
开发者ID:bencentra,项目名称:WebDrink-2.0,代码行数:26,代码来源:drink_api.php

示例4: __construct

 public function __construct()
 {
     parent::__construct(get_class(), 'robotpony-4.1');
     $this->root = realpath(dirname(__FILE__) . '/db/');
     $this->newest = $this->root . '/newest.json';
     $this->listing = $this->root . '/comics.json';
     // other startup here
 }
开发者ID:robotpony,项目名称:robotpony.ca,代码行数:8,代码来源:comics.php

示例5: __construct

 public function __construct()
 {
     parent::__construct(get_class(), 'robotpony-4.1');
     $this->root = realpath(dirname(__FILE__) . '/pages/') . '/';
     $this->inc = realpath(dirname(__FILE__) . '/lib/') . '/';
     Response::add_type_handler('text/plain', function ($dom) {
         print json_encode($dom);
     });
 }
开发者ID:robotpony,项目名称:eyntkoop.com,代码行数:9,代码来源:page.php

示例6:

 function __construct()
 {
     parent::__construct();
     $this->ca = CAHandler::getCA($this->person);
     $perm = $this->person->mayRequestCertificate();
     if (!$perm->isPermissionGranted()) {
         $this->errorNotAuthorized($perm);
     }
 }
开发者ID:henrikau,项目名称:confusa,代码行数:9,代码来源:certificates.php

示例7: __construct

 public function __construct($request)
 {
     if (session_status() == PHP_SESSION_NONE) {
         session_start();
     }
     $this->loadConfig();
     $this->initDB();
     $this->sanitizeHTTPParameters();
     parent::__construct($request);
 }
开发者ID:HaliteChallenge,项目名称:Halite,代码行数:10,代码来源:WebsiteAPI.php

示例8: __construct

 public function __construct($action, $params)
 {
     parent::__construct($action, $params);
     //check if the action is available for the resource
     if (!method_exists($this, $action)) {
         HTTP::response('404');
     }
     //call the action on the resource
     $this->{$action}($params);
 }
开发者ID:robertboloc,项目名称:presence-manager,代码行数:10,代码来源:User.php

示例9: __construct

 public function __construct($request, $origin)
 {
     parent::__construct($request);
     // Abstracted out for example
     //@todo: should create apiKey class to provide functionality to create apiKey
     /* if (!array_key_exists('apiKey', $this->request)) {
            throw new Exception('No API Key provided');
        } else if (!$APIKey->verifyKey($this->request['apiKey'], $origin)) {
            throw new Exception('Invalid API Key');
        }*/
 }
开发者ID:ktincheva,项目名称:simpleAPI,代码行数:11,代码来源:riversAPI.class.php

示例10: __construct

 public function __construct($request, $origin)
 {
     parent::__construct($request);
     //Check if token present in the header
     if (!array_key_exists('Token', $this->headers) && $request != 'get_token') {
         throw new Exception('No API Token provided');
     }
     //Authenticate Token
     if (!in_array($this->headers['Token'], $_SESSION) && $request != 'get_token') {
         throw new Exception('Expired or Invalid API Token');
     }
 }
开发者ID:harjeet-singh,项目名称:php_rest_api,代码行数:12,代码来源:MyAPI.php

示例11: __construct

 public function __construct($request)
 {
     $this->loadConfig();
     $this->initDB();
     if ($this->isValidWorker() == false) {
         echo "Not valid worker";
         exit(1);
     } else {
         $this->insert("UPDATE Worker SET lastRequestTime = now() WHERE apiKey = {$this->apiKey}");
     }
     parent::__construct($request);
 }
开发者ID:HaliteChallenge,项目名称:Halite,代码行数:12,代码来源:ManagerAPI.php

示例12: __construct

 public function __construct($request, $origin)
 {
     // call parent constructor
     parent::__construct($request);
     $Users = new Users();
     $PersonalEmail = new PersonalEmail();
     $GlobalEmail = new GlobalEmail();
     $Notifications = new Notifications();
     $this->Users = $Users;
     $this->PersonalEmail = $PersonalEmail;
     $this->GlobalEmail = $GlobalEmail;
     $this->Notifications = $Notifications;
 }
开发者ID:Javas01,项目名称:sharemail-server,代码行数:13,代码来源:main_api.php

示例13:

 function __construct()
 {
     parent::__construct();
     $this->auth_dir = $this->get_output_dir('flickr/auth');
     $this->frobfile = $this->auth_dir . '/frob.txt';
     $this->tokenfile = $this->auth_dir . '/token.txt';
     // warning: stored in libapi data dir - should store locally, or set read permissions?
     if (file_exists($this->tokenfile)) {
         $this->token = file_get_contents($this->tokenfile);
     }
     if (!$this->token) {
         $this->get_token();
     }
 }
开发者ID:hubgit,项目名称:libapi,代码行数:14,代码来源:Flickr.php

示例14: __construct

 /**
  * Constructor: __construct
  * Call parent construct and connect to database
  */
 public function __construct($request, $origin)
 {
     parent::__construct($request);
     try {
         $servername = "localhost";
         $username = "restapi-assignme";
         $password = "yXydwAJSR8VaWtZr";
         $myDB = "restapi-assignment";
         $this->conn = new PDO("mysql:host={$servername};dbname={$myDB}", $username, $password);
         $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     } catch (PDOException $e) {
         echo json_encode(array('error' => $e->getMessage()));
     }
 }
开发者ID:ankitpaliwal,项目名称:restapi-assignment,代码行数:18,代码来源:index.php

示例15: __construct

 public function __construct($configuration_file_name)
 {
     if (PHP_SAPI == 'cli') {
         global $argv;
         parent::__construct(API::FRONTEND_FASTCGI);
     } else {
         parent::__construct(API::FRONTEND_BASIC);
     }
     $this->initializeConfiguration($configuration_file_name);
     if (method_exists($this, 'routeMap')) {
         parent::registerCommonRequestHandler($this, 'initializeDynamicRouteTable');
     }
     // Left for compatibility
     $this->sd = $this->ats = $this;
 }
开发者ID:wst,项目名称:spindash,代码行数:15,代码来源:application.inc.php


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