if (0 === $n) { return []; } $out = []; $tmp = null; $i = 0; $o = array_fill(0, $n, 0); $o[0] = $k; while ($k != $o[$i = $n - 1]) { if (false === $withoutZero || !in_array(0, $o)) { $out[] = $o; } $tmp = $o[$i]; $o[$i] = 0; while ($o[$i] == 0) { --$i; } --$o[$i]; $o[$i + 1] = $tmp + 1; } if (false === $withoutZero || !in_array(0, $o)) { $out[] = $o; } return $out; } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Math\\Combinatorics\\Combination\\Combination');
$out[] = $solution; } } return $out; } if (true !== $exists) { return $handle[0]; } foreach ($handle as $solution) { if (file_exists($solution)) { return $solution; } } return static::NO_RESOLUTION; } /** * Clear the cache. * * @return void */ public static function clearCache() { self::$_cache = []; return; } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Protocol\\Protocol');
$this->_body = $body; return $old; } /** * Get request body. * * @return string */ public function getBody() { return $this->_body; } /** * Dump (parse^-1). * * @return string */ public function __toString() { $out = null; foreach ($this->getHeaders() as $key => $value) { $out .= $key . ': ' . $value . CRLF; } return $out; } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Http\\Http');
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ namespace Hoa\Websocket\Exception; use Hoa\Consistency; use Hoa\Exception as HoaException; /** * Class \Hoa\Websocket\Exception. * * Extending the \Hoa\Exception\Exception class. * * @copyright Copyright © 2007-2016 Hoa community * @license New BSD License */ class Exception extends HoaException { } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Websocket\\Exception\\Exception');
* @return string */ public function getHash() { return $this->_hash; } /** * Delete head buffer. * * @return void */ public function __destruct() { $last = current(self::$_stack); if ($this->getHash() != $last[0]) { return; } for ($i = 0, $max = $last[1]; $i < $max; ++$i) { $this->flush(); if (0 < $this->getBufferLevel()) { $this->deleteBuffer(); } } return; } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Http\\Response\\Response');
public function setPPRepresentation($pp) { $old = $this->_pp; $this->_pp = $pp; $this->_transitional = false; return $old; } /** * Get PP representation of the rule. * * @return string */ public function getPPRepresentation() { return $this->_pp; } /** * Check whether the rule is transitional or not. * * @return bool */ public function isTransitional() { return $this->_transitional; } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Compiler\\Llk\\Rule\\Rule');
/** * Component's name. * * @var string */ protected $_name = 'Stream'; /** * ID of the component. * * @param string $id ID of the component. * @return mixed */ public function reachId($id) { return Stream::getStreamHandler($id); } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Stream\\Stream'); /** * Shutdown method. */ Consistency::registerShutdownFunction(xcallable('Hoa\\Stream\\Stream::_Hoa_Stream')); /** * Add the `hoa://Library/Stream` node. Should be use to reach/get an entry * in the stream register. */ $protocol = Protocol::getInstance(); $protocol['Library'][] = new _Protocol();
* * @return int */ public function tell() { $stream = $this->getStream(); if (null === $stream) { return 0; } return ftell($stream); } /** * Create a file. * * @param string $name File name. * @param mixed $dummy To be compatible with childs. * @return bool */ public static function create($name, $dummy) { if (file_exists($name)) { return true; } return touch($name); } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\File\\File');
* By default, the last ID is removed. * * @return void */ protected function removeId() { unset(self::$_id[$this->getId()]); return; } /** * Sort array of arrays etc., according to keys, recursively. * * @param array $array Array to sort. * @return array */ public function ksort(array &$array) { ksort($array); foreach ($array as $key => $value) { if (is_array($value)) { $array[$key] = $this->ksort($value); } } return $array; } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Cache\\Cache');
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ namespace Hoa\Math\Exception; use Hoa\Consistency; use Hoa\Exception as HoaException; /** * Class \Hoa\Math\Exception. * * Extending the \Hoa\Exception\Exception class. * * @copyright Copyright © 2007-2016 Hoa community * @license New BSD License */ class Exception extends HoaException { } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Math\\Exception\\Exception');
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ namespace Hoa\Compiler\Exception; use Hoa\Consistency; use Hoa\Exception as HoaException; /** * Class \Hoa\Compiler\Exception. * * Extending the \Hoa\Exception\Exception class. * * @copyright Copyright © 2007-2016 Hoa community * @license New BSD License */ class Exception extends HoaException { } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Compiler\\Exception\\Exception');
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ namespace Hoa\Http\Exception; use Hoa\Consistency; use Hoa\Exception as HoaException; /** * Class \Hoa\Http\Exception. * * Extending the \Hoa\Exception\Exception class. * * @copyright Copyright © 2007-2016 Hoa community * @license New BSD License */ class Exception extends HoaException { } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Http\\Exception\\Exception');
$this->_backend = $backend; return; } /** * Clean cache. * * @param int $lifetime Lifetime of caches. * @return void */ public function cleanCache($lifetime = Cache::CLEAN_EXPIRED) { if (null === $this->_backend) { return; } return $this->_backend->clean($lifetime); } /** * Get the backend. * * @return \Hoa\Cache\Backend */ public function getBackend() { return $this->_backend; } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Cache\\Frontend\\Frontend');
* @return void * @throws \Hoa\Event\Exception */ public static function notify($eventId, Source $source, Bucket $data) { if (false === self::eventExists($eventId)) { throw new Exception('Event ID %s does not exist, cannot send notification.', 3, $eventId); } $data->setSource($source); $event = self::getEvent($eventId); foreach ($event->_callable as $callable) { $callable($data); } return; } /** * Check whether an event exists. * * @param string $eventId Event ID. * @return bool */ public static function eventExists($eventId) { return array_key_exists($eventId, self::$_register) && self::$_register[$eventId][self::KEY_SOURCE] !== null; } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Event\\Event');
* * @param string $directory Directory where the temporary filename * will be created. If the directory does not * exist, it may generate a file in the * system's temporary directory. * @param string $prefix Prefix of the generated temporary * filename. * @return string */ public static function create($directory = null, $prefix = '__hoa_') { if (null === $directory || false === is_dir($directory)) { $directory = static::getTemporaryDirectory(); } return tempnam($directory, $prefix); } /** * Get the directory path used for temporary files. * * @return string */ public static function getTemporaryDirectory() { return sys_get_temp_dir(); } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\File\\Temporary\\Temporary');
* * @return bool */ public function eof() { return feof($this->getStream()); } /** * Get filename component of path. * * @return string */ public function getBasename() { return basename($this->getSocket()->__toString()); } /** * Get directory name component of path. * * @return string */ public function getDirname() { return dirname($this->getSocket()->__toString()); } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Socket\\Connection\\Connection');
public function isSecured() { return $this->_secured; } /** * Get a string that represents the socket address. * * @return string */ public function __toString() { $out = null; if (true === $this->hasTransport()) { $out .= $this->getTransport() . '://'; } if (true === $this->hasPort()) { if (self::ADDRESS_IPV6 === $this->getAddressType()) { $out .= '[' . $this->getAddress() . ']'; } else { $out .= $this->getAddress(); } return $out . ':' . $this->getPort(); } return $out . $this->getAddress(); } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Socket\\Socket');
* @param string $protocol The wrapper name to be restored. * @return bool */ public static function restore($protocol) { return stream_wrapper_restore($protocol); } /** * Check if a protocol is registered or not. * * @param string $protocol Protocol name. */ public static function isRegistered($protocol) { return in_array($protocol, self::getRegistered()); } /** * Get all registered wrapper. * * @return array */ public static function getRegistered() { return stream_get_wrappers(); } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Stream\\Wrapper\\Wrapper');
use Hoa\Consistency; use Hoa\Xyl; /** * Class \Hoa\Xyl\Interpreter\Html. * * HTML interpreter. * * @copyright Copyright © 2007-2016 Hoa community * @license New BSD License */ class Html extends Xyl\Interpreter { /** * Rank: abstract elements to concrete elements. * * @var array */ protected $_rank = ['document' => '\\Hoa\\Xyl\\Interpreter\\Html\\Document', 'title' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'definition' => '\\Hoa\\Xyl\\Interpreter\\Common\\XylYield', 'value' => '\\Hoa\\Xyl\\Interpreter\\Common\\Value', 'yield' => '\\Hoa\\Xyl\\Interpreter\\Common\\XylYield', 'fragment' => '\\Hoa\\Xyl\\Interpreter\\Common\\XylYield', 'snippet' => '\\Hoa\\Xyl\\Interpreter\\Common\\Snippet', 'if' => '\\Hoa\\Xyl\\Interpreter\\Common\\XylIf', 'elseif' => '\\Hoa\\Xyl\\Interpreter\\Common\\XylElseif', 'else' => '\\Hoa\\Xyl\\Interpreter\\Common\\XylElse', '_' => '\\Hoa\\Xyl\\Interpreter\\Common\\Translate', 'script' => '\\Hoa\\Xyl\\Interpreter\\Html\\Script', 'noscript' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'section' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'nav' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'article' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'aside' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'h1' => '\\Hoa\\Xyl\\Interpreter\\Html\\Heading', 'h2' => '\\Hoa\\Xyl\\Interpreter\\Html\\Heading', 'h3' => '\\Hoa\\Xyl\\Interpreter\\Html\\Heading', 'h4' => '\\Hoa\\Xyl\\Interpreter\\Html\\Heading', 'h5' => '\\Hoa\\Xyl\\Interpreter\\Html\\Heading', 'h6' => '\\Hoa\\Xyl\\Interpreter\\Html\\Heading', 'hgroup' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'header' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'footer' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'address' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'tableofcontents' => '\\Hoa\\Xyl\\Interpreter\\Html\\Tableofcontents', 'p' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'blockquote' => '\\Hoa\\Xyl\\Interpreter\\Html\\Q', 'hr' => '\\Hoa\\Xyl\\Interpreter\\Html\\Hr', 'pre' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'ol' => '\\Hoa\\Xyl\\Interpreter\\Html\\Ol', 'ul' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'li' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'dl' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'dt' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'dd' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'figure' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'figcaption' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'main' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'div' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'error' => '\\Hoa\\Xyl\\Interpreter\\Html\\Error', 'a' => '\\Hoa\\Xyl\\Interpreter\\Html\\A', 'em' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'strong' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'small' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 's' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'cite' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'q' => '\\Hoa\\Xyl\\Interpreter\\Html\\Q', 'dfn' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'abbr' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'data' => '\\Hoa\\Xyl\\Interpreter\\Html\\Data', 'time' => '\\Hoa\\Xyl\\Interpreter\\Html\\Time', 'code' => '\\Hoa\\Xyl\\Interpreter\\Html\\Code', 'var' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'samp' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'kbd' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'sub' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'sup' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'i' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'b' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'u' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'mark' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'ruby' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'rt' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'rp' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'bdi' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'bdo' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'span' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'br' => '\\Hoa\\Xyl\\Interpreter\\Html\\Br', 'wbr' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'ins' => '\\Hoa\\Xyl\\Interpreter\\Html\\Mod', 'del' => '\\Hoa\\Xyl\\Interpreter\\Html\\Mod', 'img' => '\\Hoa\\Xyl\\Interpreter\\Html\\Img', 'iframe' => '\\Hoa\\Xyl\\Interpreter\\Html\\Iframe', 'video' => '\\Hoa\\Xyl\\Interpreter\\Html\\Video', 'audio' => '\\Hoa\\Xyl\\Interpreter\\Html\\Media', 'source' => '\\Hoa\\Xyl\\Interpreter\\Html\\Source', 'track' => '\\Hoa\\Xyl\\Interpreter\\Html\\Track', 'object' => '\\Hoa\\Xyl\\Interpreter\\Html\\HtmlObject', 'param' => '\\Hoa\\Xyl\\Interpreter\\Html\\Param', 'canvas' => '\\Hoa\\Xyl\\Interpreter\\Html\\Canvas', 'table' => '\\Hoa\\Xyl\\Interpreter\\Html\\Table', 'caption' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'colgroup' => '\\Hoa\\Xyl\\Interpreter\\Html\\TableCol', 'col' => '\\Hoa\\Xyl\\Interpreter\\Html\\TableCol', 'tbody' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'thead' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'tfoot' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'tr' => '\\Hoa\\Xyl\\Interpreter\\Html\\Generic', 'td' => '\\Hoa\\Xyl\\Interpreter\\Html\\Td', 'th' => '\\Hoa\\Xyl\\Interpreter\\Html\\Th', 'form' => '\\Hoa\\Xyl\\Interpreter\\Html\\Form', 'async' => '\\Hoa\\Xyl\\Interpreter\\Html\\Async', 'fieldset' => '\\Hoa\\Xyl\\Interpreter\\Html\\Fieldset', 'legend' => '\\Hoa\\Xyl\\Interpreter\\Html\\GenericPhrasing', 'label' => '\\Hoa\\Xyl\\Interpreter\\Html\\Label', 'input' => '\\Hoa\\Xyl\\Interpreter\\Html\\Input', 'button' => '\\Hoa\\Xyl\\Interpreter\\Html\\Button', 'select' => '\\Hoa\\Xyl\\Interpreter\\Html\\Select', 'optgroup' => '\\Hoa\\Xyl\\Interpreter\\Html\\Optgroup', 'option' => '\\Hoa\\Xyl\\Interpreter\\Html\\Option', 'textarea' => '\\Hoa\\Xyl\\Interpreter\\Html\\Textarea', 'keygen' => '\\Hoa\\Xyl\\Interpreter\\Html\\Keygen', 'output' => '\\Hoa\\Xyl\\Interpreter\\Html\\Output', 'progress' => '\\Hoa\\Xyl\\Interpreter\\Html\\Progress', 'meter' => '\\Hoa\\Xyl\\Interpreter\\Html\\Meter', 'tabs' => '\\Hoa\\Xyl\\Interpreter\\Html\\Tabs', 'tablist' => '\\Hoa\\Xyl\\Interpreter\\Html\\Tablist', 'tab' => '\\Hoa\\Xyl\\Interpreter\\Html\\Tab', 'tabpanel' => '\\Hoa\\Xyl\\Interpreter\\Html\\Tabpanel', 'checkpoint' => '\\Hoa\\Xyl\\Interpreter\\Html\\Checkpoint', '__text' => '\\Hoa\\Xyl\\Interpreter\\Html\\Text']; /** * Resource path. * * @var string */ protected $_resourcePath = 'Html/Resource/'; } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Xyl\\Interpreter\\Html\\Html');
/** * Get root the protocol. * * @return \Hoa\Protocol\Node\Node */ public static function getRoot() { return Protocol::getInstance(); } /** * Print a tree of component. * * @return string */ public function __toString() { static $i = 0; $out = str_repeat(' ', $i) . $this->getName() . "\n"; foreach ($this as $node) { ++$i; $out .= $node; --$i; } return $out; } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Protocol\\Node\\Node');
case 'double': $self->withFloat((double) $value->readAll()); break; case 'i4': case 'int': $self->withInteger((int) $value->readAll()); break; case 'string': $self->withString(htmlspecialchars_decode($value->readAll())); break; case 'struct': $self = $self->withStructure(); foreach ($value->member as $member) { $self->withName($member->name->readAll()); $this->computeValues($member->xpath('./value/*'), $self); } $self = $self->endStructure(); break; case 'nil': $self->withNull(); break; } } return; } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\XmlRpc\\Message\\Message');
throw new File\Exception('Cannot find an appropriated object that matches with ' . 'path %s when defining it.', 1, $target); } /** * Get the target name of a symbolic link. * * @return string */ public function getTargetName() { return readlink($this->getStreamName()); } /** * Create a link. * * @param string $name Link name. * @param string $target Target name. * @return bool */ public static function create($name, $target) { if (false != linkinfo($name)) { return true; } return symlink($target, $name); } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\File\\Link\\Link');
} else { throw new Exception('Cannot remove the stream filter %s because no resource was ' . 'found with this name.', 2, $streamFilter); } } return stream_filter_remove($streamFilter); } /** * Check if a filter is already registered or not. * * @param string $name Filter name. * @return bool */ public static function isRegistered($name) { return in_array($name, self::getRegistered()); } /** * Get all registered filer names. * * @return array */ public static function getRegistered() { return stream_get_filters(); } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Stream\\Filter\\Filter');
* @return string */ protected function setCurrentNamespace($namespace) { $old = $this->_currentNamespace; $this->_currentNamespace = $namespace; return $old; } /** * Generate a token value. * Complete and set next token namespace. * * @param \Hoa\Compiler\Llk\Rule\Token $token Token. * @return string */ protected function generateToken(Compiler\Llk\Rule\Token $token) { $toNamespace = $this->completeToken($token); $this->setCurrentNamespace($toNamespace); $out = $this->_tokenSampler->visit($token->getAST()); if (isset($this->_tokens[$this->_currentNamespace]['skip'])) { $out .= $this->_tokenSampler->visit($this->getSkipTokenAST()); } return $out; } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Compiler\\Llk\\Sampler\\Sampler');
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ namespace Hoa\Xyl\Element; use Hoa\Consistency; use Hoa\Xml; /** * Class \Hoa\Xyl\Element. * * Represent any XYL element. * * @copyright Copyright © 2007-2016 Hoa community * @license New BSD License */ interface Element extends Xml\Element { } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Xyl\\Element\\Element');
} throw new Exception('Selector %s is not a valid selector.', 22, $selector); } /** * Destruct XYL object. * * @return void */ public function __destruct() { $protocol = Protocol::getInstance(); unset($protocol['Library']['Xyl[' . $this->_i . ']']); return; } } /** * Class \Hoa\Xyl\_Protocol. * * The `hoa://Library/Xyl` node. * * @copyright Copyright © 2007-2016 Hoa community * @license New BSD License */ class _Protocol extends Protocol\Node { } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Xyl\\Xyl'); Event::getEvent('hoa://Event/Exception')->attach(xcallable('Hoa\\Xyl\\Interpreter\\Common\\Debug', 'receiveException'));
* Save data. * * @param mixed $data Data to store. * @return void */ public abstract function store($data); /** * Load data. * * @return mixed */ public abstract function load(); /** * Clean data. * * @param int $lifetime Lifetime of caches. * @return void */ public abstract function clean($lifetime = Cache::CLEAN_EXPIRED); /** * Remove data. * * @return void */ public abstract function remove(); } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Cache\\Backend\\Backend');
? 3.4028235e38 - 1 : 1.7976931348623157e308 - 1; */ if ($lower > $upper) { throw new Math\Exception('Unexpected values, float %f should be lower than %f', 2, [$lower, $upper]); } return $this->_getFloat($lower, $upper); } /** * Generate a continuous uniform distribution. * * @param float $lower Lower bound value. * @param float $upper Upper bound value. * @return float */ protected abstract function _getFloat($lower, $upper); /** * Get an exclude set. * * @return array */ public function getExcludeSet() { return []; } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Math\\Sampler\\Sampler');
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ namespace Hoa\Irc\Exception; use Hoa\Consistency; use Hoa\Exception as HoaException; /** * Class \Hoa\Irc\Exception. * * Extending the \Hoa\Exception\Exception class. * * @copyright Copyright © 2007-2016 Hoa community * @license New BSD License */ class Exception extends HoaException { } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Irc\\Exception\\Exception');
return; } unset($this->_data[$this->_temp][$offset]); $this->_temp = null; return; } /** * Transform data as an array. * * @return array */ public function toArray() { $out = []; foreach ($this->_data as $key => &$ii) { foreach ($ii as $i => &$value) { if (is_object($value) && $value instanceof Datable) { $out[$i][$key] = $value->toArray(); } else { $out[$i][$key] =& $value; } } } return $out; } } /** * Flex entity. */ Consistency::flexEntity('Hoa\\Xyl\\Data\\Data');