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


PHP xp::gc方法代码示例

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


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

示例1: connect

 /**
  * Connect
  *
  * @param   bool reconnect default FALSE
  * @return  bool success
  * @throws  rdbms.SQLConnectException
  */
 public function connect($reconnect = false)
 {
     if (is_resource($this->handle)) {
         return true;
     }
     // Already connected
     if (!$reconnect && false === $this->handle) {
         return false;
     }
     // Previously failed connecting
     $this->_obs && $this->notifyObservers(new \rdbms\DBEvent(\rdbms\DBEvent::CONNECT, $reconnect));
     if ($this->flags & DB_PERSISTENT) {
         $this->handle = mssql_pconnect($this->dsn->getHost(), $this->dsn->getUser(), $this->dsn->getPassword());
     } else {
         $this->handle = mssql_connect($this->dsn->getHost(), $this->dsn->getUser(), $this->dsn->getPassword());
     }
     if (!is_resource($this->handle)) {
         $e = new \rdbms\SQLConnectException(trim(mssql_get_last_message()), $this->dsn);
         \xp::gc(__FILE__);
         throw $e;
     }
     \xp::gc(__FILE__);
     $this->_obs && $this->notifyObservers(new \rdbms\DBEvent(\rdbms\DBEvent::CONNECTED, $reconnect));
     return parent::connect();
 }
开发者ID:xp-framework,项目名称:rdbms,代码行数:32,代码来源:MsSQLConnection.class.php

示例2: connect

 /**
  * Connect
  *
  * @param   bool reconnect default FALSE
  * @return  bool success
  * @throws  rdbms.SQLConnectException
  */
 public function connect($reconnect = FALSE)
 {
     if (is_resource($this->handle)) {
         return TRUE;
     }
     // Already connected
     if (!$reconnect && FALSE === $this->handle) {
         return FALSE;
     }
     // Previously failed connecting
     $this->_obs && $this->notifyObservers(new DBEvent(DBEvent::CONNECT, $reconnect));
     if ($this->flags & DB_PERSISTENT) {
         $this->handle = sybase_pconnect($this->dsn->getHost(), $this->dsn->getUser(), $this->dsn->getPassword(), 'iso_1');
     } else {
         $this->handle = sybase_connect($this->dsn->getHost(), $this->dsn->getUser(), $this->dsn->getPassword(), 'iso_1');
     }
     if (!is_resource($this->handle)) {
         $e = new SQLConnectException(trim(sybase_get_last_message()), $this->dsn);
         xp::gc(__FILE__);
         throw $e;
     }
     xp::gc(__FILE__);
     $this->_obs && $this->notifyObservers(new DBEvent(DBEvent::CONNECTED, $reconnect));
     return parent::connect();
 }
开发者ID:melogamepay,项目名称:xp-framework,代码行数:32,代码来源:SybaseConnection.class.php

示例3: gc

 public function gc()
 {
     trigger_error('Test');
     $this->assertEquals([__FILE__ => [__LINE__ - 2 => ['Test' => ['class' => NULL, 'method' => 'trigger_error', 'cnt' => 1]]]], \xp::$errors);
     \xp::gc();
     $this->assertEquals([], \xp::$errors);
 }
开发者ID:xp-framework,项目名称:core,代码行数:7,代码来源:XpTest.class.php

示例4: gc

 public function gc()
 {
     trigger_error('Test');
     $this->assertEquals(array(__FILE__ => array(__LINE__ - 2 => array('Test' => array('class' => NULL, 'method' => 'trigger_error', 'cnt' => 1)))), xp::$errors);
     xp::gc();
     $this->assertEquals(array(), xp::$errors);
 }
开发者ID:Gamepay,项目名称:xp-framework,代码行数:7,代码来源:XpTest.class.php

示例5: finalize

 /**
  * Finalizes the processor.
  *
  * @return  string
  */
 public function finalize()
 {
     static $classes = array(T_VARIABLE => 'variable', T_CLASS => 'keyword', T_INTERFACE => 'keyword', T_EXTENDS => 'keyword', T_IMPLEMENTS => 'keyword', T_CATCH => 'keyword', T_THROW => 'keyword', T_TRY => 'keyword', T_NEW => 'keyword', T_FUNCTION => 'keyword', T_FOR => 'keyword', T_IF => 'keyword', T_ELSE => 'keyword', T_SWITCH => 'keyword', T_WHILE => 'keyword', T_FOREACH => 'keyword', T_RETURN => 'keyword', T_STATIC => 'modifier', T_ABSTRACT => 'modifier', T_PUBLIC => 'modifier', T_PRIVATE => 'modifier', T_PROTECTED => 'modifier', T_FINAL => 'modifier', T_DNUMBER => 'number', T_LNUMBER => 'number', T_CONSTANT_ENCAPSED_STRING => 'string', T_COMMENT => 'comment', '{' => 'bracket', '}' => 'bracket', '(' => 'bracket', ')' => 'bracket');
     // Tokenize buffer
     $tokens = token_get_all('<?php ' . trim($this->buffer, "\r\n") . '?>');
     if (!is_array($tokens) || xp::errorAt(__FILE__, __LINE__ - 1)) {
         $e = new FormatException('Cannot parse "' . $this->buffer . '"');
         xp::gc(__FILE__);
         throw $e;
     }
     // Create HTML
     $current = NULL;
     $out = '';
     for ($i = 1, $s = sizeof($tokens) - 1; $i < $s; $i++) {
         $token = $tokens[$i];
         $class = isset($classes[$token[0]]) ? $classes[$token[0]] : 'default';
         // Handle annotations
         if (is_array($token) && T_COMMENT === $token[0] && '#' === $token[1][0]) {
             $class = 'annotation';
         }
         if ($current != $class) {
             $out .= '</span><span class="' . $class . '">';
             $current = $class;
         }
         $out .= strtr(htmlspecialchars(is_array($token) ? $token[1] : $token), array("\n" => '<br/>', "\r" => ''));
     }
     // Skip leading "</span>" (7)
     return '</p><code>' . substr($out, 7) . ($current ? '</span>' : '') . '</code><p>';
 }
开发者ID:Gamepay,项目名称:xp-framework,代码行数:34,代码来源:CodeProcessor.class.php

示例6: __construct

 /**
  * Constructor
  *
  * @see     php://pspell_new
  * @param   string language
  * @param   string spelling
  * @param   string jargon
  * @param   string encoding 
  * @param   int mode 
  * @throws  lang.IllegalArgumentException
  */
 public function __construct($language, $spelling = NULL, $jargon = NULL, $encoding = NULL, $mode = PSPELL_NORMAL)
 {
     if (FALSE === ($this->handle = pspell_new($language, $spelling, $jargon, $encoding, $mode))) {
         $e = new IllegalArgumentException('Could not create spell checker');
         xp::gc(__FILE__);
         throw $e;
     }
 }
开发者ID:melogamepay,项目名称:xp-framework,代码行数:19,代码来源:SpellChecker.class.php

示例7: write

 /**
  * Write a string
  *
  * @param   var arg
  */
 public function write($arg)
 {
     if (false === fwrite($this->fd, $arg)) {
         $e = new IOException('Could not write ' . strlen($arg) . ' bytes to ' . $this->name . ' channel');
         \xp::gc(__FILE__);
         throw $e;
     }
 }
开发者ID:johannes85,项目名称:core,代码行数:13,代码来源:ChannelOutputStream.class.php

示例8: readImageFromUri

 /**
  * Read image
  *
  * @param   string uri
  * @return  resource
  * @throws  img.ImagingException
  */
 public function readImageFromUri($uri)
 {
     if (FALSE === ($r = imagecreatefromxbm($uri))) {
         $e = new ImagingException('Cannot read image from "' . $uri . '"');
         xp::gc(__FILE__);
         throw $e;
     }
     return $r;
 }
开发者ID:melogamepay,项目名称:xp-framework,代码行数:16,代码来源:XbmStreamReader.class.php

示例9: readImageFromUri

 /**
  * Read image
  *
  * @param   string uri
  * @return  resource
  * @throws  img.ImagingException
  */
 public function readImageFromUri($uri)
 {
     if (false === ($r = imagecreatefrompng($uri))) {
         $e = new \img\ImagingException('Cannot read image from "' . $uri . '"');
         \xp::gc(__FILE__);
         throw $e;
     }
     return $r;
 }
开发者ID:xp-framework,项目名称:imaging,代码行数:16,代码来源:PngStreamReader.class.php

示例10: read

 /**
  * Read a string
  *
  * @param   int limit default 8192
  * @return  string
  */
 public function read($limit = 8192)
 {
     if (false === ($bytes = fread($this->fd, $limit))) {
         $e = new IOException('Could not read ' . $limit . ' bytes from ' . $this->name . ' channel');
         \xp::gc(__FILE__);
         throw $e;
     }
     return $bytes;
 }
开发者ID:johannes85,项目名称:core,代码行数:15,代码来源:ChannelInputStream.class.php

示例11: readImageFromString

 /**
  * Read image via imagecreatefromstring()
  *
  * @param   string bytes
  * @return  resource
  * @throws  img.ImagingException
  */
 public function readImageFromString($bytes)
 {
     if (FALSE === ($r = imagecreatefromstring($bytes))) {
         $e = new ImagingException('Cannot read image');
         xp::gc(__FILE__);
         throw $e;
     }
     return $r;
 }
开发者ID:melogamepay,项目名称:xp-framework,代码行数:16,代码来源:StreamReader.class.php

示例12: readImage0

 /**
  * Read image via imagecreatefromgif()
  *
  * @param   string uri
  * @return  resource
  * @throws  img.ImagingException
  */
 protected function readImage0($uri)
 {
     if (FALSE === ($r = imagecreatefromgif($uri))) {
         $e = new ImagingException('Cannot read image');
         xp::gc(__FILE__);
         throw $e;
     }
     return $r;
 }
开发者ID:Gamepay,项目名称:xp-framework,代码行数:16,代码来源:GifStreamReader.class.php

示例13: divide

 /**
  * /
  *
  * @param   var other
  * @return  math.BigNum
  */
 public function divide($other)
 {
     if (NULL === ($r = bcdiv($this->num, $other instanceof self ? $other->num : $other))) {
         $e = key(xp::$errors[__FILE__][__LINE__ - 1]);
         xp::gc(__FILE__);
         throw new IllegalArgumentException($e);
     }
     return new self($r);
 }
开发者ID:melogamepay,项目名称:xp-framework,代码行数:15,代码来源:BigFloat.class.php

示例14: crypt

 /**
  * Crypt a given plain-text string
  *
  * @param   string plain
  * @param   string salt
  * @return  string
  */
 public function crypt($plain, $salt)
 {
     $crypted = crypt($plain, $salt);
     if (strlen($crypted) < 13) {
         // Crypted contains error
         $message = key(@\xp::$errors[__FILE__][__LINE__ - 3]);
         \xp::gc(__FILE__);
         throw new CryptoException('Failed to crypt: ' . $message);
     }
     \xp::gc(__FILE__);
     return $crypted;
 }
开发者ID:xp-framework,项目名称:security,代码行数:19,代码来源:NativeCryptImpl.class.php

示例15: loadXML

 /**
  * Helper method
  *
  * @param   string xml
  * @return  php.DOMDocument
  * @throws  xml.XMLFormatException if the given XML is not well-formed or unparseable
  */
 protected function loadXML($xml)
 {
     $doc = new DOMDocument();
     if (!$doc->loadXML($xml)) {
         $errors = libxml_get_errors();
         libxml_clear_errors();
         $e = new XMLFormatException(rtrim($errors[0]->message), $errors[0]->code, $errors[0]->file, $errors[0]->line, $errors[0]->column);
         xp::gc(__FILE__);
         throw $e;
     }
     return $doc;
 }
开发者ID:melogamepay,项目名称:xp-framework,代码行数:19,代码来源:XPath.class.php


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