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

PHP ini_get函数代码示例

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

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



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

示例1: filterLoad

 /**
  * Filters an asset after it has been loaded.
  *
  * @param  \Assetic\Asset\AssetInterface  $asset
  * @return void
  */
 public function filterLoad(AssetInterface $asset)
 {
     $max_nesting_level = ini_get('xdebug.max_nesting_level');
     $memory_limit = ini_get('memory_limit');
     if ($max_nesting_level && $max_nesting_level < 200) {
         ini_set('xdebug.max_nesting_level', 200);
     }
     if ($memory_limit && $memory_limit < 256) {
         ini_set('memory_limit', '256M');
     }
     $root = $asset->getSourceRoot();
     $path = $asset->getSourcePath();
     $dirs = array();
     $lc = new \Less_Parser(array('compress' => true));
     if ($root && $path) {
         $dirs[] = dirname($root . '/' . $path);
     }
     foreach ($this->loadPaths as $loadPath) {
         $dirs[] = $loadPath;
     }
     $lc->SetImportDirs($dirs);
     $url = parse_url($this->getRequest()->getUriForPath(''));
     $absolutePath = str_replace(public_path(), '', $root);
     if (isset($url['path'])) {
         $absolutePath = $url['path'] . $absolutePath;
     }
     $lc->parseFile($root . '/' . $path, $absolutePath);
     $asset->setContent($lc->getCss());
 }
开发者ID:cartalyst,项目名称:assetic-filters,代码行数:35,代码来源:LessphpFilter.php


示例2: dump

function dump($var, $echo = true, $label = null, $strict = true)
{
    $label = $label === null ? '' : rtrim($label) . ' ';
    if (!$strict) {
        if (ini_get('html_errors')) {
            $output = print_r($var, true);
            $output = "<pre>" . $label . htmlspecialchars($output, ENT_QUOTES) . "</pre>";
        } else {
            $output = $label . " : " . print_r($var, true);
        }
    } else {
        ob_start();
        var_dump($var);
        $output = ob_get_clean();
        if (!extension_loaded('xdebug')) {
            $output = preg_replace("/\\]\\=\\>\n(\\s+)/m", "] => ", $output);
            $output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES, "GB2312") . '</pre>';
        }
    }
    if ($echo) {
        echo $output;
        return null;
    } else {
        return $output;
    }
}
开发者ID:winiceo,项目名称:job,代码行数:26,代码来源:lib.php


示例3: toXml

 public static function toXml($data, $rootNodeName = 'data', $xml = null)
 {
     // turn off compatibility mode as simple xml throws a wobbly if you don't.
     if (ini_get('zend.ze1_compatibility_mode') == 1) {
         ini_set('zend.ze1_compatibility_mode', 0);
     }
     if ($xml == null) {
         $xml = simplexml_load_string("<?xml version='1.0' encoding='utf-8'?><{$rootNodeName} />");
     }
     // loop through the data passed in.
     foreach ($data as $key => $value) {
         // no numeric keys in our xml please!
         if (is_numeric($key)) {
             // make string key...
             $key = "child_" . (string) $key;
         }
         // replace anything not alpha numeric
         $key = preg_replace('/[^a-z]/i', '', $key);
         // if there is another array found recrusively call this function
         if (is_array($value)) {
             $node = $xml->addChild($key);
             // recrusive call.
             ArrayToXML::toXml($value, $rootNodeName, $node);
         } else {
             // add single node.
             $value = htmlentities($value);
             $xml->addChild($key, $value);
         }
     }
     // pass back as string. or simple xml object if you want!
     return $xml->asXML();
 }
开发者ID:beingsane,项目名称:Joomla-REST-API,代码行数:32,代码来源:classes.php


示例4: __construct

 public function __construct($di, $config = array())
 {
     $this->di = $di;
     $this->repo = new PDOSessionRepository($this->di->get('db'));
     $this->mapper = new PDOSessionDatamapper($this->di->get('db'));
     $this->maxLifetime = isset($config['maxLifetime']) ? $config['maxLifetime'] : ini_get('session.gc_maxlifetime');
 }
开发者ID:reservat,项目名称:session,代码行数:7,代码来源:PDO.php


示例5: startSession

 /**
  * Sets the time against which the session is measured. This function also
  * sets the cash_session_id internally as a mechanism for tracking analytics
  * against a consistent id, regardless of PHP session id.
  *
  * @return boolean
  */
 protected function startSession()
 {
     // begin PHP session
     if (!defined('STDIN')) {
         // no session for CLI, suckers
         @session_cache_limiter('nocache');
         $session_length = 3600;
         @ini_set("session.gc_maxlifetime", $session_length);
         @session_start();
     }
     $this->cash_session_timeout = ini_get("session.gc_maxlifetime");
     if (!isset($_SESSION['cash_session_id'])) {
         $modifier_array = array('deedee', 'johnny', 'joey', 'tommy', 'marky');
         $_SESSION['cash_session_id'] = $modifier_array[array_rand($modifier_array)] . '_' . rand(1000, 9999) . substr((string) time(), 4);
     }
     if (isset($_SESSION['cash_last_request_time'])) {
         if ($_SESSION['cash_last_request_time'] + $this->cash_session_timeout < time()) {
             $this->resetSession();
         }
     }
     $_SESSION['cash_last_request_time'] = time();
     if (!isset($GLOBALS['cash_script_store'])) {
         $GLOBALS['cash_script_store'] = array();
     }
     return true;
 }
开发者ID:nodots,项目名称:DIY,代码行数:33,代码来源:CASHData.php


示例6: __construct

 public function __construct()
 {
     $time_limit = ini_get('max_execution_time');
     if (!empty($time_limit)) {
         $this->maxTimeLimit = (int) $time_limit + $this->maxTimeLimit;
     }
 }
开发者ID:ntadmin,项目名称:framework,代码行数:7,代码来源:modulefunctions.class.php


示例7: dir_name

 public function dir_name()
 {
     $path = ini_get("xhprof.output_dir");
     $path = empty($path) ? sys_get_temp_dir() : $path;
     return $path;
     // return DATA_DIR."/xhprof/";
 }
开发者ID:sss201413,项目名称:ecstore,代码行数:7,代码来源:xhprof.php


示例8: testDocRef

 /**
  * testDocRef method
  *
  * @return void
  */
 public function testDocRef()
 {
     ini_set('docref_root', '');
     $this->assertEquals(ini_get('docref_root'), '');
     $debugger = new Debugger();
     $this->assertEquals(ini_get('docref_root'), 'http://php.net/');
 }
开发者ID:ronaldsalazar23,项目名称:ComercialChiriguano,代码行数:12,代码来源:DebuggerTest.php


示例9: syscheck

function syscheck($items)
{
    foreach ($items as $key => $item) {
        if ($item['list'] == 'php') {
            $items[$key]['current'] = PHP_VERSION;
        } elseif ($item['list'] == 'upload') {
            $items[$key]['current'] = @ini_get('file_uploads') ? ini_get('upload_max_filesize') : 'unknow';
        } elseif ($item['list'] == 'gdversion') {
            $tmp = function_exists('gd_info') ? gd_info() : array();
            $items[$key]['current'] = empty($tmp['GD Version']) ? 'noext' : $tmp['GD Version'];
            unset($tmp);
        } elseif ($item['list'] == 'disk') {
            if (function_exists('disk_free_space')) {
                $items[$key]['current'] = floor(disk_free_space(admin_ROOT) / (1024 * 1024)) . 'M';
            } else {
                $items[$key]['current'] = 'unknow';
            }
        } elseif (isset($item['c'])) {
            $items[$key]['current'] = constant($item['c']);
        }
        $items[$key]['status'] = 1;
        if ($item['r'] != 'notset' && strcmp($items[$key]['current'], $item['r']) < 0) {
            $items[$key]['status'] = 0;
        }
    }
    return $items;
}
开发者ID:huangs0928,项目名称:zzlangshi,代码行数:27,代码来源:fun_center.php


示例10: session_init

/**
 * Initialize session.
 * @param boolean $keepopen keep session open? The default is
 * 			to close the session after $_SESSION has been populated.
 * @uses $_SESSION
 */
function session_init($keepopen = false)
{
    $settings = new phpVBoxConfigClass();
    // Sessions provided by auth module?
    if (@$settings->auth->capabilities['sessionStart']) {
        call_user_func(array($settings->auth, $settings->auth->capabilities['sessionStart']), $keepopen);
        return;
    }
    // No session support? No login...
    if (@$settings->noAuth || !function_exists('session_start')) {
        global $_SESSION;
        $_SESSION['valid'] = true;
        $_SESSION['authCheckHeartbeat'] = time();
        $_SESSION['admin'] = true;
        return;
    }
    // start session
    session_start();
    // Session is auto-started by PHP?
    if (!ini_get('session.auto_start')) {
        ini_set('session.use_trans_sid', 0);
        ini_set('session.use_only_cookies', 1);
        // Session path
        if (isset($settings->sessionSavePath)) {
            session_save_path($settings->sessionSavePath);
        }
        session_name(isset($settings->session_name) ? $settings->session_name : md5('phpvbx' . $_SERVER['DOCUMENT_ROOT'] . $_SERVER['HTTP_USER_AGENT']));
        session_start();
    }
    if (!$keepopen) {
        session_write_close();
    }
}
开发者ID:rgooler,项目名称:personal-puppet,代码行数:39,代码来源:utils.php


示例11: getFieldTypeDetails

 function getFieldTypeDetails($webserviceField)
 {
     global $upload_maxsize;
     $typeDetails = array();
     switch ($webserviceField->getFieldDataType()) {
         case 'reference':
             $typeDetails['refersTo'] = $webserviceField->getReferenceList();
             break;
         case 'multipicklist':
         case 'picklist':
             $typeDetails["picklistValues"] = $this->getPicklistDetails($webserviceField);
             $typeDetails['defaultValue'] = $typeDetails["picklistValues"][0]['value'];
             break;
         case 'file':
             $maxUploadSize = 0;
             $maxUploadSize = ini_get('upload_max_filesize');
             $maxUploadSize = strtolower($maxUploadSize);
             $maxUploadSize = explode('m', $maxUploadSize);
             $maxUploadSize = $maxUploadSize[0];
             if (!is_numeric($maxUploadSize)) {
                 $maxUploadSize = 0;
             }
             $maxUploadSize = $maxUploadSize * 1000000;
             if ($upload_maxsize > $maxUploadSize) {
                 $maxUploadSize = $upload_maxsize;
             }
             $typeDetails['maxUploadFileSize'] = $maxUploadSize;
             break;
         case 'date':
             $typeDetails['format'] = $this->user->date_format;
     }
     return $typeDetails;
 }
开发者ID:hardikk,项目名称:HNH,代码行数:33,代码来源:WebserviceEntityOperation.php


示例12: __construct

 /**
  * Constructor
  *
  * @access	public
  * @param	object		ipsRegistry reference
  * @param	array 		Configuration info for this method
  * @param	array 		Custom configuration info for this method
  * @return	void
  */
 public function __construct(ipsRegistry $registry, $method, $conf = array())
 {
     $this->method_config = $method;
     $this->openid_config = $conf;
     parent::__construct($registry);
     //-----------------------------------------
     // Fix include path for OpenID libs
     //-----------------------------------------
     $path_extra = dirname(__FILE__);
     $path = ini_get('include_path');
     $path = $path_extra . PATH_SEPARATOR . $path;
     ini_set('include_path', $path);
     define('Auth_OpenID_RAND_SOURCE', null);
     //-----------------------------------------
     // OpenID libraries are not STRICT compliant
     //-----------------------------------------
     ob_start();
     /**
      * Turn off strict error reporting for openid
      */
     if (version_compare(PHP_VERSION, '5.2.0', '>=')) {
         error_reporting(E_ERROR | E_WARNING | E_PARSE | E_RECOVERABLE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_USER_WARNING);
     } else {
         error_reporting(E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR | E_USER_ERROR | E_USER_WARNING);
     }
     //-----------------------------------------
     // And grab libs
     //-----------------------------------------
     require_once "Auth/OpenID/Consumer.php";
     require_once "Auth/OpenID/FileStore.php";
     require_once "Auth/OpenID/SReg.php";
     require_once "Auth/OpenID/PAPE.php";
 }
开发者ID:dalandis,项目名称:Visualization-of-Cell-Phone-Locations,代码行数:42,代码来源:auth.php


示例13: parse

 /**
  * Converts a YAML string to a PHP array.
  *
  * @param string  $value                  A YAML string
  * @param Boolean $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise
  * @param Boolean $objectSupport          true if object support is enabled, false otherwise
  *
  * @return array A PHP array representing the YAML string
  */
 public static function parse($value, $exceptionOnInvalidType = false, $objectSupport = false)
 {
     self::$exceptionOnInvalidType = $exceptionOnInvalidType;
     self::$objectSupport = $objectSupport;
     $value = trim($value);
     if (0 == strlen($value)) {
         return '';
     }
     if (function_exists('mb_internal_encoding') && (int) ini_get('mbstring.func_overload') & 2) {
         $mbEncoding = mb_internal_encoding();
         mb_internal_encoding('ASCII');
     }
     $i = 0;
     switch ($value[0]) {
         case '[':
             $result = self::parseSequence($value, $i);
             ++$i;
             break;
         case '{':
             $result = self::parseMapping($value, $i);
             ++$i;
             break;
         default:
             $result = self::parseScalar($value, null, array('"', "'"), $i);
     }
     // some comments are allowed at the end
     if (preg_replace('/\\s+#.*$/A', '', substr($value, $i))) {
         throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i)));
     }
     if (isset($mbEncoding)) {
         mb_internal_encoding($mbEncoding);
     }
     return $result;
 }
开发者ID:shinichi81,项目名称:Codeigniter-TDD-with-Hooks,代码行数:43,代码来源:Inline.php


示例14: upload

 /**
  * @brief Accion que se encarga de manipular el proceso de guardar
  * un archivo en el servidor
  * @param array $allowedExtensions Arreglo de extensiones validas para el archivo
  * @param int $sizeLimit Tamaño maximo permitido del fichero que se sube
  */
 function upload($allowedExtensions, $sizeLimit = 10485760)
 {
     jimport('Amadeus.Util.Uploader');
     $media =& JComponentHelper::getParams('com_media');
     $postSize = $this->toBytes(ini_get('post_max_size'));
     $uploadSize = $this->toBytes(ini_get('upload_max_filesize'));
     $mediaSize = (int) $media->get('upload_maxsize');
     // Se selecciona el minimo tamaño válido para un fichero, de acuerdo
     // a los valores configurados en el php, el joomla y el componente.
     $sizeLimit = min($postSize, $uploadSize, $mediaSize, $sizeLimit);
     // Se alamacena la imagen en la ruta especificada
     $uploader = new qqFileUploader($allowedExtensions, $sizeLimit);
     $result = $uploader->handleUpload(JPATH_SITE . '/tmp/', true);
     if (!isset($result['error'])) {
         jimport('Amadeus.Util.Validation');
         $file = $uploader->getName();
         $result = AmadeusUtilValidation::isValidFile($file, $only_image);
         if (isset($result['error'])) {
             jimport('joomla.filesystem.file');
             if (!JFile::delete($file)) {
                 $result = array('error' => JText::_('DELETEERROR'));
             }
         } else {
             $this->_file = $file;
         }
     }
     return $result;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:34,代码来源:File.php


示例15: max

 /**
  * Max execution time.
  *
  * @since 150424 Initial release.
  *
  * @param int|null $max Max execution time.
  *
  * @return int Max execution time; in seconds.
  */
 public function max(int $max = null) : int
 {
     if (isset($max) && $max >= 0) {
         @set_time_limit($max);
     }
     return (int) ini_get('max_execution_time');
 }
开发者ID:websharks,项目名称:core,代码行数:16,代码来源:ExecTime.php


示例16: getVideoData

 public static function getVideoData($videoid, $customimage, $customtitle, $customdescription)
 {
     $theTitle = '';
     $Description = '';
     $theImage = '';
     //if($firstvideo=='')
     //$firstvideo=$videoid;
     $XML_SOURCE = '';
     if ($customimage != '') {
         $theImage = $customimage;
     } else {
         if (ini_get('allow_url_fopen')) {
             $XML_SOURCE = YouTubeGalleryMisc::getURLData('http://video.google.com/videofeed?docid=' . $videoid);
             $match = array();
             preg_match("/media:thumbnail url=\"([^\"]\\S*)\"/siU", $XML_SOURCE, $match);
             $theImage = $match[1];
         }
         //if(ini_get('allow_url_fopen'))
     }
     //if($customimage!='')
     $theTitle = 'Google Video';
     if ($customtitle != '') {
         $theTitle = $customtitle;
     }
     if ($customdescription != '') {
         $Description = $customdescription;
     }
     return array('videosource' => 'google', 'videoid' => $videoid, 'imageurl' => $theImage, 'title' => $theTitle, 'description' => $Description);
 }
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:29,代码来源:google.php


示例17: downloadPackage

 function downloadPackage($src, $dst)
 {
     if (ini_get('allow_url_fopen')) {
         $file = @file_get_contents($src);
     } else {
         if (function_exists('curl_init')) {
             $ch = curl_init();
             curl_setopt($ch, CURLOPT_URL, $src);
             curl_setopt($ch, CURLOPT_HEADER, 0);
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
             curl_setopt($ch, CURLOPT_TIMEOUT, 180);
             $safeMode = @ini_get('safe_mode');
             $openBasedir = @ini_get('open_basedir');
             if (empty($safeMode) && empty($openBasedir)) {
                 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
             }
             $file = curl_exec($ch);
             curl_close($ch);
         } else {
             return false;
         }
     }
     file_put_contents($dst, $file);
     return file_exists($dst);
 }
开发者ID:vgrish,项目名称:el,代码行数:25,代码来源:validate.install.php


示例18: render

 /**
  * Renders the page by injecting controller data inside a view template
  */
 public function render()
 {
     $viewFile = 'views/' . $this->name . '.php';
     if (!file_exists($viewFile)) {
         throw new Exception("view file [{$viewFile}] is missing");
     }
     // inject data and render template
     $this->buildPageData();
     extract($this->data);
     ob_start();
     if ((bool) ini_get('short_open_tag') === true) {
         include $viewFile;
     } else {
         $templateCode = file_get_contents($viewFile);
         $this->convertShortTags($templateCode);
         // Evaluating PHP mixed with HTML requires closing the PHP markup opened by eval()
         $templateCode = '?>' . $templateCode;
         echo eval($templateCode);
     }
     // get ouput
     $out = ob_get_contents();
     // get rid of buffer
     @ob_end_clean();
     return $out;
 }
开发者ID:telabotanica,项目名称:ezmlm-forum,代码行数:28,代码来源:BaseController.php


示例19: jws_fetchUrl

 function jws_fetchUrl($url)
 {
     //Can we use cURL?
     if (is_callable('curl_init')) {
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($ch, CURLOPT_TIMEOUT, 20);
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
         $feedData = curl_exec($ch);
         curl_close($ch);
         //If not then use file_get_contents
     } elseif (ini_get('allow_url_fopen') == 1 || ini_get('allow_url_fopen') === TRUE) {
         $feedData = @file_get_contents($url);
         //Or else use the WP HTTP API
     } else {
         if (!class_exists('WP_Http')) {
             include_once ABSPATH . WPINC . '/class-http.php';
         }
         $request = new WP_Http();
         $result = $request->request($url);
         $feedData = $result['body'];
     }
     /*    echo $feedData;
     		exit;*/
     return $feedData;
 }
开发者ID:ICONVI,项目名称:sigmacatweb,代码行数:27,代码来源:core-functions.php


示例20: connect

 /**
  * Connects to a database.
  * @return void
  * @throws DibiException
  */
 public function connect(array &$config)
 {
     DibiConnection::alias($config, 'username', 'user');
     DibiConnection::alias($config, 'password', 'pass');
     if (isset($config['resource'])) {
         $this->connection = $config['resource'];
     } else {
         // default values
         if (!isset($config['username'])) {
             $config['username'] = ini_get('odbc.default_user');
         }
         if (!isset($config['password'])) {
             $config['password'] = ini_get('odbc.default_pw');
         }
         if (!isset($config['dsn'])) {
             $config['dsn'] = ini_get('odbc.default_db');
         }
         if (empty($config['persistent'])) {
             $this->connection = @odbc_connect($config['dsn'], $config['username'], $config['password']);
             // intentionally @
         } else {
             $this->connection = @odbc_pconnect($config['dsn'], $config['username'], $config['password']);
             // intentionally @
         }
     }
     if (!is_resource($this->connection)) {
         throw new DibiDriverException(odbc_errormsg() . ' ' . odbc_error());
     }
 }
开发者ID:jakubkulhan,项目名称:shopaholic,代码行数:34,代码来源:odbc.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP ini_get_all函数代码示例发布时间:2022-05-15
下一篇:
PHP ini_alter函数代码示例发布时间: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