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


PHP getEnv函数代码示例

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


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

示例1: teamLeaderSelect

function teamLeaderSelect($area, $selected)
{
    $url = getEnv('PERMISSIONSURL');
    // Ask the permission microservice which groups' users can be team leaders
    $groups = sendAuthenticatedRequest("GET", $url . "/permission/verbs/28e60394-f719-4225-85ad-fa542ab6a8df/lead");
    $teamLeads = array();
    // loop through groups and get users
    for ($i = 0; $i < count($groups["data"]); $i++) {
        $users = sendAuthenticatedRequest("GET", $url . "/groupMembers/" . $groups["data"][$i]["Guid"]);
        for ($j = 0; $j < count($users["data"]); $j++) {
            if (!in_array($users["data"][$j], $teamLeads)) {
                $teamLeads[] = $users["data"][$j];
            }
        }
    }
    $count = 0;
    for ($i = 0; $i < count($teamLeads); $i++) {
        if ($teamLeads[$i] == $selected) {
            echo "<option value='" . $teamLeads[$i] . "' selected>" . nameByNetId($teamLeads[$i]) . "</option>";
        } else {
            $count++;
            echo "<option value='" . $teamLeads[$i] . "'>" . nameByNetId($teamLeads[$i]) . "</option>";
        }
    }
    // If the selected team lead was not pulled add him/her
    if (count($teamLeads) == $count) {
        echo "<option value='" . $selected . "' selected>" . nameByNetId($selected) . "</option>";
    }
}
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:29,代码来源:teamingFunctions.php

示例2: __construct

 public function __construct($arguments)
 {
     ini_set('display_errors', TRUE);
     error_reporting(E_ALL);
     $this->arguments = new Hymn_Arguments($arguments, $this->baseArgumentOptions);
     self::$fileName = $this->arguments->getOption('file');
     try {
         if (getEnv('HTTP_HOST')) {
             throw new RuntimeException('Access denied');
         }
         $action = $this->arguments->getArgument();
         if ($this->arguments->getOption('help')) {
             array_unshift($arguments, "help");
             $this->arguments = new Hymn_Arguments($arguments, $this->baseArgumentOptions);
         } else {
             if ($this->arguments->getOption('version')) {
                 array_unshift($arguments, "version");
                 $this->arguments = new Hymn_Arguments($arguments, $this->baseArgumentOptions);
             }
         }
         if (!in_array($action, array('help', 'create', 'version'))) {
             $this->readConfig();
             $this->loadLibraries();
             //				$this->setupDatabaseConnection();
         }
         $this->dispatch();
         //			self::out();
     } catch (Exception $e) {
         self::out("Error: " . $e->getMessage());
     }
 }
开发者ID:CeusMedia,项目名称:Hymn,代码行数:31,代码来源:Client.php

示例3: client

 /**
  * @return \Codesmith\TsysTransItSDK\Connection
  */
 protected function client()
 {
     if ($this->client) {
         return $this->client;
     }
     return $this->client = new \Codesmith\TsysTransItSDK\Connection(['mid' => getEnv('mid'), 'userID' => getEnv('userID'), 'password' => getEnv('password'), 'transKey' => getEnv('transactionKey')]);
 }
开发者ID:cleanscript,项目名称:tsys-php-sdk,代码行数:10,代码来源:Test.php

示例4: newGuid

 /**
  * Generates a new guid by calling out to the guid-generator micro-service, or
  *   if it can't be hit, generates one on it's own
  *
  * @return A new v4 guid
  */
 public function newGuid()
 {
     $url = getEnv('GUIDURL');
     if ($url == "") {
         $url = "http://tmt-guid.byu.edu";
     }
     // Start building curl options
     $curl_options = array();
     $curl_options[CURLOPT_URL] = $url . '/guid';
     $curl_options[CURLOPT_RETURNTRANSFER] = true;
     // Create handle and set options
     $curl_handle = curl_init();
     $success = curl_setopt_array($curl_handle, $curl_options);
     // Check failure to properly prepare curl handle
     if (!$success) {
         curl_close($curl_handle);
         return $this->newGuidLocal();
     }
     // Execute request
     $response = curl_exec($curl_handle);
     // Check for errors
     $http_code = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);
     $err_num = curl_errno($curl_handle);
     // Failed to hit micro-service
     if ($http_code < 200 || $http_code >= 400 || $err_num != 0) {
         curl_close($curl_handle);
         return $this->newGuidLocal();
     }
     // Parse response and return
     $response = json_decode($response, false);
     $guid = $response->data;
     curl_close($curl_handle);
     return $guid;
 }
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:40,代码来源:GuidCreator.php

示例5: __construct

 public function __construct()
 {
     parent::__construct();
     $this->url = getEnv('GUIDURL');
     if ($this->url == "") {
         $this->url = "http://tmt-guid.byu.edu";
     }
 }
开发者ID:byu-oit-ssengineering,项目名称:team-managment-tool,代码行数:8,代码来源:index.php

示例6: getLogDir

 public function getLogDir()
 {
     if (false !== getEnv('OPENSHIFT_LOG_DIR')) {
         return getEnv('OPENSHIFT_LOG_DIR');
     } else {
         return parent::getLogDir();
     }
 }
开发者ID:ubc,项目名称:examdb,代码行数:8,代码来源:AppKernel.php

示例7: loadEnvVariables

 public function loadEnvVariables()
 {
     self::loadDotenv();
     self::$host = getEnv('DB_HOST');
     self::$name = getEnv('DB_NAME');
     self::$username = getEnv('DB_USERNAME');
     self::$password = getEnv('DB_PASSWORD');
 }
开发者ID:andela-oisola,项目名称:potato-orm,代码行数:8,代码来源:DBConnection.php

示例8: should_generate_a_valid_transaction_key

 /** @test */
 public function should_generate_a_valid_transaction_key()
 {
     $res = $this->client()->generateKey(['mid' => getEnv('mid'), 'userID' => getEnv('userID'), 'password' => getEnv('password')]);
     $this->log(__METHOD__, $res);
     $this->assertArrayHasKey('status', $res);
     $this->assertEquals('PASS', $res['status']);
     $this->assertContains($res['responseCode'], array_keys($this->client()->approvedCodes));
 }
开发者ID:cleanscript,项目名称:tsys-php-sdk,代码行数:9,代码来源:GenerateKeyTest.php

示例9: __construct

 public function __construct()
 {
     $bddCon = mysqli_connect(getEnv('DB_HOST'), getEnv('DB_USER'), getEnv('DB_PASSWORD'), getEnv('DB_NAME'));
     if (!$bddCon) {
         die("Nous sommes d&eacutesol&eacute : La connexion &agrave la base de donn&eacutees &agrave &eacutechou&eacutee ...");
     } else {
         $this->bdd = $bddCon;
     }
 }
开发者ID:Mutopedia,项目名称:Mutopedia-Local,代码行数:9,代码来源:bdd.php

示例10: __construct

 public function __construct()
 {
     $dbCon = mysqli_connect(getEnv("DB_HOST"), getEnv("DB_USERNAME"), getEnv("DB_PASSWORD"), getEnv("DB_NAME"));
     if (!$dbCon) {
         die("Nous sommes d&eacutesol&eacute : La connexion &agrave la base de donn&eacutees &agrave &eacutechou&eacutee ...");
     } else {
         $this->db = $dbCon;
     }
 }
开发者ID:Vluds,项目名称:vluds,代码行数:9,代码来源:Database.php

示例11: clientIPToHex

function clientIPToHex($ip="") {
    $hex="";
    if($ip=="") $ip=getEnv("REMOTE_ADDR");
    $part=explode('.', $ip);
    for ($i=0; $i<=count($part)-1; $i++) {
        $hex.=substr("0".dechex($part[$i]),-2);
    }
    return $hex;
}
开发者ID:ellipsisno,项目名称:freeversedns,代码行数:9,代码来源:index.php

示例12: ___onCheckAccess

	static public function ___onCheckAccess( $env, $module, $context, $data = array() ){
		$allowUnsecuredLocalhost	= !TRUE;
		$isAuthorized	= (bool) $env->getRequest()->getHeader( 'Authorization', FALSE );
		$isLocalhost	= getEnv( 'HTTP_HOST' ) === "localhost";
		$isSecured		= $isAuthorized || ( $isLocalhost && $allowUnsecuredLocalhost );
		if( !$isSecured ){
			$message	= 'This Hydra instance is not secured by HTTP Basic Authentication. Please fix this!';
			$env->getMessenger()->noteFailure( $message );
		}
	}
开发者ID:CeusMedia,项目名称:Hydra,代码行数:10,代码来源:Index.php5

示例13: loadEnvVariables

 public static function loadEnvVariables()
 {
     if (!getenv('APP_ENV')) {
         self::loadDotenv();
     }
     self::$host = getEnv('DB_HOST');
     self::$name = getEnv('DB_NAME');
     self::$username = getEnv('DB_USERNAME');
     self::$password = getEnv('DB_PASSWORD');
     self::$connection = getEnv('DB_CONNECTION');
 }
开发者ID:andela-oisola,项目名称:naija-emojis,代码行数:11,代码来源:DBConnection.php

示例14: setUp

 public function setUp()
 {
     parent::setUp();
     try {
         $dotenv = new Dotenv\Dotenv(dirname(__DIR__));
         $dotenv->load();
     } catch (Exception $e) {
         exit('Could not find a .env file.');
     }
     $this->faker = Faker\Factory::create();
     $this->object = new PaymentVault(['store-id' => getEnv('PROFIT_STARS_STORE_ID'), 'store-key' => getEnv('PROFIT_STARS_STORE_KEY'), 'entity-id' => getEnv('PROFIT_STARS_ENTITY_ID'), 'location-id' => getEnv('PROFIT_STARS_LOCATION_ID')]);
 }
开发者ID:incraigulous,项目名称:php-profitstars,代码行数:12,代码来源:PaymentVaultTest.php

示例15: common_header

function common_header($title = "")
{
    /* Can't open socket on sourceforge.net, I have to point the demo to my site */
    $host = getEnv("HTTP_HOST") == "canship.sourceforge.net" ? "http://www.allaboutweb.ca/sf/canship/" : "";
    ?>
<html>
<head>
	<title><?php 
    print $title ? "Canada Post Shipping Rate Calculator - A Free PHP Shipping Tool | {$title}" : "";
    ?>
</title>
	<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1">
	<link rel="stylesheet" type="text/css" href="main.css">
	<meta name="keywords" content="Shipping Calculator, Rate Calculator, Calculation, eParcel, Canada Post, PHP, Shipping Module, eBay, Merchant Tools, e-Commerce, Online Shopping, Online Transaction, Real time, Shipping Quote, XML, Web Service, Free Shipping, Shipping Quoter, Open Source, osCommerce, Shopping Cart, Vancouver, British Columbia, Shopping Basket, Package, Free Packaging, Width, Height, Weight, Length, International, Domestic,USA, Fedex, UPS,Expedited, Xpresspost,Priority Courier,Air Parcel, Surface, Sell Online, API, French, Shipping Rate ">
	<meta name="description" content="
	Canada Post Shipping Rate Calculator - A free PHP shipping calculator for all shipping purpose, including eBay merchants, ecommerce sites.
	This tool is developed by using API of Sell Online(tm) Shipping Module from Canada Post. Once you get a retail account from Canada Post,
	you can setup your shipping profile throught their backend.
	">
</head>

<body bgcolor="#ffffff"  marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" bottommargin="0" rightmargin="0">
<table border="0" cellpadding="10" cellspacing="0" bgcolor="#ff0000" width="100%">
<tr valign="middle">
	<td nowrap><img src="pics/canadapost.gif" width="178" height="60" alt="" border="0"></td>
	<td width="100%"><font color="#ffffff" class="pageTitle">Free PHP Canada Post Shipping Rate Calculator</font></td>
</tr>
</table>
<table border="0" cellpadding="5" cellspacing="0" width="100%" >
<tr>
	<td nowrap>[ <a href="index.php">Home</a> ]</td>
	<td nowrap>[ <a href="<?php 
    echo $host;
    ?>
ebay.demo.php">eBay Demo</a> ]</td>
	<td nowrap>[ <a href="<?php 
    echo $host;
    ?>
developer.demo.php">Developer Demo</a> ]</td>
	<td nowrap>[ <a href="merchant_tool.php">Merchant Tool</a> ]</td>
	<td nowrap>[ <a href="download.php">Download</a> ]</td>
	<td nowrap>[ <a href="index.php#contact">Contact</a> ]</td>
	<td width="100%">&nbsp;</td>
</tr>
</table>
<br><br>

<table cellpadding="0" cellspacing="0" border="0"  width="100%">
	<tr>
			<td >
<!-- --------------- Begin: Main Content -------------------------------- -->
<?php 
}
开发者ID:annggeel,项目名称:tienda,代码行数:53,代码来源:local.php


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