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

PHP getEnv函数代码示例

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

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



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


示例16: compressed_output

function compressed_output()
{
    $encoding = getEnv("HTTP_ACCEPT_ENCODING");
    $useragent = getEnv("HTTP_USER_AGENT");
    $method = trim(getEnv("REQUEST_METHOD"));
    $msie = preg_match("=msie=i", $useragent);
    $gzip = preg_match("=gzip=i", $encoding);
    if ($gzip && ($method != "POST" or !$msie)) {
        ob_start("ob_gzhandler");
    } else {
        ob_start();
    }
}
开发者ID:ECP-Black,项目名称:ECP,代码行数:13,代码来源:mootools.php


示例17: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     fwrite(STDERR, "# protoc-gen-php\n");
     $stdin = stream_get_contents(STDIN);
     $time = time();
     if (getEnv("CAPTURE")) {
         file_put_contents(sprintf("%s.input.bin", $time), $stdin);
     }
     $compiler = new \protocolbuffers\Compiler();
     $response = $compiler->compile($stdin);
     $result = $response->serializeToString();
     if (getEnv("CAPTURE")) {
         file_put_contents(sprintf("%s.output.bin", $time), $result);
     }
     fwrite(STDOUT, $result);
 }
开发者ID:melanc,项目名称:devel,代码行数:16,代码来源:GenerateCommand.php


示例18: __construct

 public function __construct()
 {
     $env = getEnv('DF56_ENV') ?: 'prod';
     switch ($env) {
         case 'dev':
             $this->_db = 'depanfernsender';
             $this->_host = 'localhost';
             $this->_user = 'root';
             $this->_pwd = 'Alucard69';
             break;
         default:
             $this->_db = 'depanfernsender';
             $this->_host = 'depanfernsender.mysql.db';
             $this->_user = 'depanfernsender';
             $this->_pwd = 'Alucard69';
             break;
     }
 }
开发者ID:ndumonteil,项目名称:df56,代码行数:18,代码来源:conn.php


示例19: initDefaultLocalization

 /**
  * Init default localization
  */
 protected function initDefaultLocalization()
 {
     self::$localizations = $this->serviceLocator->get('config')['install_languages'];
     $this->serviceLocator->get('translator');
     $acceptLanguage = $this->intlLoaded ? Locale::acceptFromHttp(getEnv('HTTP_ACCEPT_LANGUAGE')) : null;
     $defaultLanguage = $acceptLanguage ? substr($acceptLanguage, 0, 2) : null;
     // setup locale
     self::$defaultLocalization = array_key_exists($defaultLanguage, self::$localizations) ? self::$localizations[$defaultLanguage] : current(self::$localizations);
     // init translator settings
     $translator = $this->serviceLocator->get('translator');
     $translator->setLocale(self::$defaultLocalization['locale']);
     // init default localization
     if ($this->intlLoaded) {
         Locale::setDefault(self::$defaultLocalization['locale']);
     }
     AbstractValidator::setDefaultTranslator($translator);
     self::$currentLocalization = self::$defaultLocalization;
 }
开发者ID:spooner77,项目名称:dream-cms,代码行数:21,代码来源:Module.php


示例20: __construct

 /**
  * Loads all configuration parameters from a flat file
  *
  * <b>Note:</b> Default file path is set to {/usr/local}/etc/imscp/imscp.conf depending of distribution.
  *
  * @param string $pathFile Configuration file path
  */
 public function __construct($pathFile = null)
 {
     if (is_null($pathFile)) {
         if (getenv('IMSCP_CONF')) {
             $pathFile = getEnv('IMSCP_CONF');
         } else {
             switch (PHP_OS) {
                 case 'FreeBSD':
                 case 'OpenBSD':
                 case 'NetBSD':
                     $pathFile = '/usr/local/etc/imscp/imscp.conf';
                     break;
                 default:
                     $pathFile = '/etc/imscp/imscp.conf';
             }
         }
     }
     $this->_pathFile = $pathFile;
     $this->_parseFile();
 }
开发者ID:imscp-packages,项目名称:addon-installer,代码行数:27,代码来源:iMSCPConfig.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP getError函数代码示例发布时间:2022-05-15
下一篇:
PHP getEnum函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap