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


PHP ini_restore函数代码示例

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


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

示例1: checkExternalLibraries

 protected function checkExternalLibraries()
 {
     global $ms;
     $missing = false;
     ini_set('track_errors', 1);
     @(include_once 'Net/IPv4.php');
     if (isset($php_errormsg) && preg_match('/Failed opening.*for inclusion/i', $php_errormsg)) {
         static::raiseError("PEAR Net_IPv4 package is missing!");
         $missing = true;
         unset($php_errormsg);
     }
     if (isset($php_errormsg) && preg_match('/Failed opening.*for inclusion/i', $php_errormsg)) {
         print "PEAR Pager package is missing<br />\n";
         $missing = true;
         unset($php_errormsg);
     }
     @(include_once 'smarty3/Smarty.class.php');
     if (isset($php_errormsg) && preg_match('/Failed opening.*for inclusion/i', $php_errormsg)) {
         print "Smarty3 template engine is missing<br />\n";
         $missing = true;
         unset($php_errormsg);
     }
     @(include_once 'System/Daemon.php');
     if (isset($php_errormsg) && preg_match('/Failed opening.*for inclusion/i', $php_errormsg)) {
         print "PEAR System_Daemon package is missing<br />\n";
         $missing = true;
         unset($php_errormsg);
     }
     ini_restore('track_errors');
     if ($missing) {
         return false;
     }
     return parent::checkExternalLibraries();
 }
开发者ID:unki,项目名称:MasterShaper,代码行数:34,代码来源:RequirementsController.php

示例2: createApiDocs

 /**
  * @GET
  * @route /api/__doc/{type}
  *
  * @param string $type
  *
  * @return string JSON
  */
 public function createApiDocs($type = Api::PSFS_DOC)
 {
     ini_set('memory_limit', -1);
     ini_set('max_execution_time', -1);
     $endpoints = [];
     $modules = $this->srv->getModules();
     switch (strtolower($type)) {
         case self::SWAGGER_DOC:
             $doc = DocumentorService::swaggerFormatter($modules);
             break;
         default:
         case self::HTML_DOC:
         case self::PSFS_DOC:
             if (count($modules)) {
                 foreach ($modules as $module) {
                     $endpoints = array_merge($endpoints, $this->srv->extractApiEndpoints($module));
                 }
             }
             $doc = $endpoints;
             break;
     }
     ini_restore('max_execution_time');
     ini_restore('memory_limit');
     return $type === self::HTML_DOC ? $this->render('documentation.html.twig', ["data" => json_encode($doc)]) : $this->json($doc, 200);
 }
开发者ID:c15k0,项目名称:psfs,代码行数:33,代码来源:Api.php

示例3: generateZip

 protected function generateZip()
 {
     ini_set('max_execution_time', 600);
     $mime = parse_ini_file('include/mime.ini');
     $zip = new ZipArchive();
     if ($zip->open($this->pathcache . $this->filecache, ZIPARCHIVE::CREATE) !== true) {
         return false;
     }
     foreach ($this->filelist as $file) {
         $ext = strtolower(substr($file['name'], strrpos($file['name'], '.') + 1));
         $type = explode('/', $mime[$ext]);
         if ($type[0] != 'image') {
             continue;
         }
         $zip->addFile($this->pathname . $file['path'] . '/' . $file['name'], $file['name']);
     }
     $zip->close();
     $size = filesize($this->pathcache . $this->filecache);
     $archive = array();
     if ($this->albuminfo['archive']) {
         $archive = $this->albuminfo['archive'];
     }
     $archive[$this->data['type']] = $size;
     $this->album->setInfo($this->data['id'], 'archive', $archive);
     ini_restore('max_execution_time');
     return true;
 }
开发者ID:Ashaan,项目名称:phpgallery,代码行数:27,代码来源:archive.php

示例4: convertBatch

 /**
  * Return currencies convert rates in batch mode
  *
  * @param array $data
  * @param string $currencyFrom
  * @param array $currenciesTo
  * @return array
  */
 private function convertBatch($data, $currencyFrom, $currenciesTo)
 {
     $currenciesStr = implode(',', $currenciesTo);
     $url = str_replace('{{CURRENCY_FROM}}', $currencyFrom, self::CURRENCY_CONVERTER_URL);
     $url = str_replace('{{CURRENCY_TO}}', $currenciesStr, $url);
     set_time_limit(0);
     try {
         $response = $this->getServiceResponse($url);
     } finally {
         ini_restore('max_execution_time');
     }
     foreach ($currenciesTo as $currencyTo) {
         if ($currencyFrom == $currencyTo) {
             $data[$currencyFrom][$currencyTo] = $this->_numberFormat(1);
         } else {
             if (empty($response['rates'][$currencyTo])) {
                 $this->_messages[] = __('We can\'t retrieve a rate from %1 for %2.', $url, $currencyTo);
                 $data[$currencyFrom][$currencyTo] = null;
             } else {
                 $data[$currencyFrom][$currencyTo] = $this->_numberFormat((double) $response['rates'][$currencyTo]);
             }
         }
     }
     return $data;
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:33,代码来源:FixerIo.php

示例5: CreateServerFolder

function CreateServerFolder($folderPath)
{
    $sParent = GetParentFolder($folderPath);
    // Check if the parent exists, or create it.
    if (!file_exists($sParent)) {
        $sErrorMsg = CreateServerFolder($sParent);
        if ($sErrorMsg != '') {
            return $sErrorMsg;
        }
    }
    if (!file_exists($folderPath)) {
        // Turn off all error reporting.
        error_reporting(0);
        // Enable error tracking to catch the error.
        ini_set('track_errors', '1');
        // To create the folder with 0777 permissions, we need to set umask to zero.
        $oldumask = umask(0);
        mkdir($folderPath, 0777);
        umask($oldumask);
        $sErrorMsg = $php_errormsg;
        // Restore the configurations.
        ini_restore('track_errors');
        ini_restore('error_reporting');
        return $sErrorMsg;
    } else {
        return '';
    }
}
开发者ID:LFSF,项目名称:oras,代码行数:28,代码来源:io.php

示例6: testParserResetsReconfiguredXdebugMaxNestingLevel

 /**
  * testParserResetsReconfiguredXdebugMaxNestingLevel
  *
  * @return void
  * @covers stdClass
  * @group pdepend
  * @group pdepend::bugs
  * @group regressiontest
  */
 public function testParserResetsReconfiguredXdebugMaxNestingLevel()
 {
     ini_restore('xdebug.max_nesting_level');
     $level = ini_get('xdebug.max_nesting_level');
     self::parseTestCaseSource(__METHOD__);
     $this->assertEquals($level, ini_get('xdebug.max_nesting_level'));
 }
开发者ID:JohnMurray,项目名称:VulnScan,代码行数:16,代码来源:ReconfigureXdebugMaxNestingLevelBug133Test.php

示例7: testParserResetsReconfiguredXdebugMaxNestingLevel

 /**
  * testParserResetsReconfiguredXdebugMaxNestingLevel
  *
  * @return void
  */
 public function testParserResetsReconfiguredXdebugMaxNestingLevel()
 {
     ini_restore('xdebug.max_nesting_level');
     $level = ini_get('xdebug.max_nesting_level');
     self::parseCodeResourceForTest();
     $this->assertEquals($level, ini_get('xdebug.max_nesting_level'));
 }
开发者ID:eduardobenito10,项目名称:jenkins-php-quickstart,代码行数:12,代码来源:ReconfigureXdebugMaxNestingLevelBug133Test.php

示例8: forgetmail

 function forgetmail($to, $subject, $data, $filename, $from)
 {
     if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
         $eol = "\r\n";
     } elseif (strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) {
         $eol = "\r";
     } else {
         $eol = "\n";
     }
     //$filename = "email/signup.tpl";
     if (!file_exists($filename)) {
         echo "Error Loading file";
         exit;
     }
     $str = "";
     $str = file_get_contents($filename);
     foreach ($data as $key => $value) {
         $str = str_replace("%" . $key . "%", "{$value}", "{$str}");
     }
     $headers .= 'From: ' . $from['name'] . ' <' . $from['email'] . '>' . $eol;
     $headers .= 'Reply-To: ' . $to['name'] . ' <' . $to['email'] . '>' . $eol;
     $headers .= "Message-ID: <" . $now . " TheSystem@" . $_SERVER['SERVER_NAME'] . ">" . $eol;
     $headers .= "X-Mailer: PHP v" . phpversion() . $eol;
     // These two to help avoid spam-filters
     $headers .= "Content-Type: text/html; charset=ISO-8859-1 " . $eol;
     $headers .= "MIME-Version: 1.0 " . $eol;
     ini_set(sendmail_from, $from['email']);
     // the INI lines are to force the From Address to be used !
     if (!mail($to['email'], $subject, $str, $headers)) {
         echo "Error Email Sending ";
         exit;
     }
     ini_restore(sendmail_from);
 }
开发者ID:sknlim,项目名称:classified-2,代码行数:34,代码来源:email.class.php

示例9: stop

 public function stop()
 {
     $exectime = microtime(true) - $this->iStartTime;
     ini_restore(self::MAX_EXECUTION_TIME);
     ini_restore(self::MEMORY_LIMIT);
     return $exectime;
 }
开发者ID:forxer,项目名称:tao,代码行数:7,代码来源:Bourinator.php

示例10: __construct

 /**
  * Zend_Feed_Entry_Abstract constructor
  *
  * The Zend_Feed_Entry_Abstract constructor takes the URI of the feed the entry
  * is part of, and optionally an XML construct (usually a
  * SimpleXMLElement, but it can be an XML string or a DOMNode as
  * well) that contains the contents of the entry.
  *
  * @param  string $uri
  * @param  SimpleXMLElement|DOMNode|string  $element
  * @return void
  */
 public function __construct($uri = null, $element = null)
 {
     if (!$element instanceof DOMElement) {
         if ($element) {
             // Load the feed as an XML DOMDocument object
             @ini_set('track_errors', 1);
             $doc = new DOMDocument();
             $success = @$doc->loadXML($element);
             @ini_restore('track_errors');
             if (!$success) {
                 throw new Zend_Feed_Exception("DOMDocument cannot parse XML: {$php_errormsg}");
             }
             $element = $doc->getElementsByTagName($this->_rootElement)->item(0);
             if (!$element) {
                 throw new Zend_Feed_Exception('No root <' . $this->_rootElement . '> element found, cannot parse feed.');
             }
         } else {
             $doc = new DOMDocument('1.0', 'utf-8');
             if ($this->_rootNamespace !== null) {
                 $element = $doc->createElementNS(Zend_Feed::lookupNamespace($this->_rootNamespace), $this->_rootElement);
             } else {
                 $element = $doc->createElement($this->_rootElement);
             }
         }
     }
     parent::__construct($element);
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:39,代码来源:Abstract.php

示例11: connect

 function connect()
 {
     $user = $this->config->get('user');
     $pw = $this->config->get('password');
     $hostspec = $this->config->get('host');
     $port = $this->config->get('port');
     $db = $this->config->get('database');
     $persistent = isset($this->config['persistent']) ? $this->config['persistent'] : null;
     $charset = isset($this->config['charset']) ? $this->config['charset'] : null;
     $connect_function = $persistent ? 'oci_pconnect' : 'oci_connect';
     @ini_set('track_errors', true);
     if ($hostspec && $port) {
         $hostspec .= ':' . $port;
     }
     if ($db && $hostspec && $user && $pw) {
         $conn = @$connect_function($user, $pw, "//{$hostspec}/{$db}", $charset);
     } elseif ($hostspec && $user && $pw) {
         $conn = @$connect_function($user, $pw, $hostspec, $charset);
     } else {
         $conn = false;
     }
     @ini_restore('track_errors');
     if ($conn == false) {
         $this->_raiseError();
     }
     $this->connectionId = $conn;
     //connected ok, need to set a few environment settings
     //please note, if this is changed, the function setTimestamp and setDate in OCI8PreparedStatement.php
     //must be changed to match
     //$sql = "ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'";
     //$this->execute($sql);
 }
开发者ID:r-kitaev,项目名称:limb,代码行数:32,代码来源:lmbOciConnection.class.php

示例12: __destruct

 public function __destruct()
 {
     ini_restore('session.use_only_cookies');
     $this->sessionName = NULL;
     $this->isValid = NULL;
     $this->figerprint = NULL;
     $this->fingerHead = NULL;
 }
开发者ID:rjon76,项目名称:netspotapp,代码行数:8,代码来源:classVSession.php

示例13: setUp

 public function setUp()
 {
     ini_restore('soap.wsdl_cache_enabled');
     ini_restore('soap.wsdl_cache');
     ini_restore('soap.wsdl_cache_dir');
     ini_restore('soap.wsdl_cache_ttl');
     ini_restore('soap.wsdl_cache_limit');
 }
开发者ID:mablae,项目名称:BeSimpleSoap,代码行数:8,代码来源:CacheTest.php

示例14: tearDown

 protected function tearDown()
 {
     parent::tearDown();
     if ($this->captureErrorLog()) {
         ini_restore('error_log');
         unlink($this->errorLogFile);
     }
 }
开发者ID:arjunmarri,项目名称:cloudy,代码行数:8,代码来源:WalkerTest.php

示例15: connect

 /**
  * Connect to a database and log in as the specified user.
  *
  * @param $dsn the data source name (see DB::parseDSN for syntax)
  * @param $flags Any conneciton flags.
  * @access public
  * @throws SQLException
  * @return void
  */
 function connect($dsninfo, $flags = 0)
 {
     if (!extension_loaded('mysql')) {
         throw new SQLException('mysql extension not loaded');
     }
     $this->dsn = $dsninfo;
     $this->flags = $flags;
     $persistent = ($flags & Creole::PERSISTENT) === Creole::PERSISTENT;
     if (isset($dsninfo['protocol']) && $dsninfo['protocol'] == 'unix') {
         $dbhost = ':' . $dsninfo['socket'];
     } else {
         $dbhost = $dsninfo['hostspec'] ? $dsninfo['hostspec'] : 'localhost';
         if (!empty($dsninfo['port'])) {
             $dbhost .= ':' . $dsninfo['port'];
         }
     }
     $user = $dsninfo['username'];
     $pw = $dsninfo['password'];
     $connect_function = $persistent ? 'mysql_pconnect' : 'mysql_connect';
     @ini_set('track_errors', true);
     if ($dbhost && $user && $pw) {
         $conn = @$connect_function($dbhost, $user, $pw);
     } elseif ($dbhost && $user) {
         $conn = @$connect_function($dbhost, $user);
     } elseif ($dbhost) {
         $conn = @$connect_function($dbhost);
     } else {
         $conn = false;
     }
     @ini_restore('track_errors');
     if (empty($conn)) {
         if (($err = @mysql_error()) != '') {
             throw new SQLException("connect failed", $err);
         } elseif (empty($php_errormsg)) {
             throw new SQLException("connect failed");
         } else {
             throw new SQLException("connect failed", $php_errormsg);
         }
     }
     if ($dsninfo['database']) {
         if (!@mysql_select_db($dsninfo['database'], $conn)) {
             switch (mysql_errno($conn)) {
                 case 1049:
                     $exc = new SQLException("no such database", mysql_error($conn));
                     break;
                 case 1044:
                     $exc = new SQLException("access violation", mysql_error($conn));
                     break;
                 default:
                     $exc = new SQLException("cannot select database", mysql_error($conn));
             }
             throw $exc;
         }
         // fix to allow calls to different databases in the same script
         $this->database = $dsninfo['database'];
     }
     $this->dblink = $conn;
 }
开发者ID:BackupTheBerlios,项目名称:nodin-svn,代码行数:67,代码来源:MySQLConnection.php


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