Initializes and checks if we have received a SIGWINCH signal.

@return bool whether dimensions should be fetched
15608
private static function checkPcntl()
    {
        if (static::$pcntlEnabled === null) {
            if (!extension_loaded('pcntl')) {
                static::$pcntlEnabled = false;

                return true;
            }
            static::$pcntlEnabled = true;

            if (version_compare(PHP_VERSION, '7.1', '>=')) {
                pcntl_async_signals(true);
                static::$pcntlAsync = true;
            }

            // This can be dispatched multiple times when resizing,
            // so it's important that we throttle fetching dimensions.
            pcntl_signal(SIGWINCH, function () {
                static::$pcntlNeedsUpdate = true;
            });
        } elseif (static::$pcntlEnabled === false) {
            return true;
        }

        if (!static::$pcntlAsync) {
            pcntl_signal_dispatch();
        }

        return static::$pcntlNeedsUpdate;
    }
746284
def isConnected(self, signal, slot):
        
        sig_calls = self._callbacks.get(signal, [])
        for callback in sig_calls:
            if callback == slot:
                return True
        return False
886293
public function iniciar()
    {
        if ($this->iniciado) {
            return true;
        }

        if (!$this->adaptador->abrir($this->nombre)) {
            throw new \RuntimeException('Hubo un error inicializando el adaptador de sesión.');
        }

        if (!$this->id) {
            $this->id = $this->generarId();
        }

        $this->datos = $this->adaptador->leer($this->id);

        return $this->iniciado = true;
    }
1061465
public function isMultidimensional() {
    foreach ($this->elements->getItems() as $element) {
      if ($element instanceof ArrayPairNode) {
        if ($element->getValue() instanceof ArrayNode) {
          return TRUE;
        }
      }
      elseif ($element instanceof ArrayNode) {
        return TRUE;
      }
    }
    return FALSE;
  }
991640
protected function hasChange()
	{
		return !( $this->bound1() == $this->model->getRight() || $this->bound1() == $this->model->getLeft() );
	}
90802
protected function isSigchildEnabled()
    {
        if (null !== self::$sigchild) {
            return self::$sigchild;
        }

        if (!function_exists('phpinfo') || defined('HHVM_VERSION')) {
            return self::$sigchild = false;
        }

        ob_start();
        phpinfo(INFO_GENERAL);

        return self::$sigchild = false !== strpos(ob_get_clean(), '--enable-sigchild');
    }
620480
private static boolean isSigarAlreadyLoaded() throws Exception {
        final String libraryName = new SigarLoader(Sigar.class).getLibraryName();
        final Field loadedLibraryNames = ClassLoader.class.getDeclaredField("loadedLibraryNames");
		loadedLibraryNames.setAccessible(true);
        final Collection<String> libraries = (Collection<String>) loadedLibraryNames.get(SigarProvisioner.class.getClassLoader());

        for (String library: libraries) {
            if(library.contains(libraryName)) return true;
        }
        return false;
    }
33574
public function onAfterInit()
    {
        // Suppress errors if dev/build necessary
        if (!Security::database_is_ready()) {
            return false;
        }
        $currentMember = Security::getCurrentUser();
        if (!$currentMember || !$currentMember->exists()) {
            return false;
        }

        $statusCode = $this->owner->getResponse()->getStatusCode();

        if (substr($statusCode, 0, 1) == '4') {
            $this->logPermissionDenied($statusCode, $currentMember);
        }
    }
424865
protected function isNodeDataMatchingContext(): bool
    {
        if ($this->nodeDataIsMatchingContext === null) {
            $workspacesMatch = $this->workspaceIsMatchingContext();
            $this->nodeDataIsMatchingContext = $workspacesMatch && $this->dimensionsAreMatchingTargetDimensionValues();
        }

        return $this->nodeDataIsMatchingContext;
    }
1308311
public function initDimensions()
    {
        $this->log("Init dimension (before) newWidth x newHeight is {$this->newWidth} x {$this->newHeight}.");

        // width as %
        if ($this->newWidth[strlen($this->newWidth)-1] == '%') {
            $this->newWidth = $this->width * substr($this->newWidth, 0, -1) / 100;
            $this->log("Setting new width based on % to {$this->newWidth}");
        }

        // height as %
        if ($this->newHeight[strlen($this->newHeight)-1] == '%') {
            $this->newHeight = $this->height * substr($this->newHeight, 0, -1) / 100;
            $this->log("Setting new height based on % to {$this->newHeight}");
        }

        is_null($this->aspectRatio) or is_numeric($this->aspectRatio) or $this->raiseError('Aspect ratio out of range');

        // width & height from aspect ratio
        if ($this->aspectRatio && is_null($this->newWidth) && is_null($this->newHeight)) {
            if ($this->aspectRatio >= 1) {
                $this->newWidth   = $this->width;
                $this->newHeight  = $this->width / $this->aspectRatio;
                $this->log("Setting new width & height based on width & aspect ratio (>=1) to (w x h) {$this->newWidth} x {$this->newHeight}");

            } else {
                $this->newHeight  = $this->height;
                $this->newWidth   = $this->height * $this->aspectRatio;
                $this->log("Setting new width & height based on width & aspect ratio (<1) to (w x h) {$this->newWidth} x {$this->newHeight}");
            }

        } elseif ($this->aspectRatio && is_null($this->newWidth)) {
            $this->newWidth   = $this->newHeight * $this->aspectRatio;
            $this->log("Setting new width based on aspect ratio to {$this->newWidth}");

        } elseif ($this->aspectRatio && is_null($this->newHeight)) {
            $this->newHeight  = $this->newWidth / $this->aspectRatio;
            $this->log("Setting new height based on aspect ratio to {$this->newHeight}");
        }

        // Change width & height based on dpr
        if ($this->dpr != 1) {
            if (!is_null($this->newWidth)) {
                $this->newWidth  = round($this->newWidth * $this->dpr);
                $this->log("Setting new width based on dpr={$this->dpr} - w={$this->newWidth}");
            }
            if (!is_null($this->newHeight)) {
                $this->newHeight = round($this->newHeight * $this->dpr);
                $this->log("Setting new height based on dpr={$this->dpr} - h={$this->newHeight}");
            }
        }

        // Check values to be within domain
        is_null($this->newWidth)
            or is_numeric($this->newWidth)
            or $this->raiseError('Width not numeric');

        is_null($this->newHeight)
            or is_numeric($this->newHeight)
            or $this->raiseError('Height not numeric');

        $this->log("Init dimension (after) newWidth x newHeight is {$this->newWidth} x {$this->newHeight}.");

        return $this;
    }
254246
public function scNext()
    {
        $mValue = $this->next();

        return (false === $mValue and false === $this->valid()) ? self::NOT_SET_FLAG : $mValue;
    }
868173
public function getIsNew ()
		{
			if ($this->_isNew == false)
				return false;

			for ($i = 1; $i <= $this->_params[ 'totalChunks' ]; $i++)
			{
				if ($this->chunkIsUploaded($i))
				{
					$this->_isNew = false;

					return false;
				}
			}

			$this->_isNew = true;

			return true;
		}
1318485
public function isSymmetric()
    {
        // check all edges
        foreach ($this->graph->getEdges() as $edge) {
            // only check directed edges (undirected ones are symmetric by definition)
            if ($edge instanceof EdgeDirected) {
                // check if end also has an edge to start
                if (!$edge->getVertexEnd()->hasEdgeTo($edge->getVertexStart())) {
                    return false;
                }
            }
        }

        return true;
    }
746759
public function isSuccessful()
    {
        if (null === $this->data) {
            $this->initializeReport();
        }

        return isset($this->data['report']['state']) && 'successful' === $this->data['report']['state'];
    }
1199199
public function isSerialized()
    {
        if ($this->getLength() === 0) return false;

        /** @noinspection PhpUsageOfSilenceOperatorInspection */
        return
        (
            $this->scalarString === 'b:0;' ||
            @unserialize($this->scalarString) !== false
        );
    }
93682
public function isSuperUser()
    {
        $result = null;
        if ($result === null && $this->functionInspector->functionAvailable('posix_getuid')) {
            $uid = posix_getuid();
            if (is_int($uid)) {
                $result = $uid === 0;
            }
        }

        return $result;
    }
718461
public function onRead()
    {
        if ($this->state === self::STATE_PREHANDSHAKE) {
            if (!$this->handshake()) {
                return;
            }
        }
        if ($this->state === self::STATE_HANDSHAKED) {
            while (($buflen = $this->getInputLength()) >= 2) {
                $first = ord($this->look(1)); // first byte integer (fin, opcode)
                $firstBits = Binary::getbitmap($first);
                $opcode = (int)bindec(substr($firstBits, 4, 4));
                if ($opcode === 0x8) { // CLOSE
                    $this->finish();
                    return;
                }
                $opcodeName = isset(static::$opcodes[$opcode]) ? static::$opcodes[$opcode] : false;
                if (!$opcodeName) {
                    Daemon::log(get_class($this) . ': Undefined opcode ' . $opcode);
                    $this->finish();
                    return;
                }
                if ($this->firstFrameOpcodeName === null) {
                    $this->firstFrameOpcodeName = $opcodeName;
                }
                $second = ord($this->look(1, 1)); // second byte integer (masked, payload length)
                $fin = (bool)($first >> 7);
                $isMasked = (bool)($second >> 7);
                $dataLength = $second & 0x7f;
                $p = 2;
                if ($dataLength === 0x7e) { // 2 bytes-length
                    if ($buflen < $p + 2) {
                        return; // not enough data yet
                    }
                    $dataLength = Binary::bytes2int($this->look(2, $p), false);
                    $p += 2;
                } elseif ($dataLength === 0x7f) { // 8 bytes-length
                    if ($buflen < $p + 8) {
                        return; // not enough data yet
                    }
                    $dataLength = Binary::bytes2int($this->look(8, $p));
                    $p += 8;
                }
                if ($this->pool->maxAllowedPacket <= $dataLength) {
                    // Too big packet
                    Daemon::log(get_class($this) . ': MaxAllowedPacket limit exceeded. Packet size ' . $dataLength . ' bytes when limit ' . $this->pool->maxAllowedPacket . ' bytes');
                    $this->finish();
                    return;
                }
                // Extend buffer size to accommodate all data
                $this->setWatermark(null, $dataLength + 100);
                if ($isMasked) {
                    if ($buflen < $p + 4) {
                        return; // not enough data yet
                    }
                    $mask = $this->look(4, $p);
                    $p += 4;
                }
                if ($buflen < $p + $dataLength) {
                    return; // not enough data yet
                }
                $this->drain($p);
                $data = $this->read($dataLength);
                if ($isMasked) {
                    $data = $this->mask($data, $mask);
                }
                //Daemon::log(Debug::dump(array('ext' => $this->extensions, 'rsv1' => $firstBits[1], 'data' => Debug::exportBytes($data))));
                /*if ($firstBits[1] && in_array('deflate-frame', $this->extensions)) { // deflate frame
                    $data = gzuncompress($data, $this->pool->maxAllowedPacket);
                }*/
                if (!$fin) {
                    $this->framebuf .= $data;
                } else {
                    $this->onFrame($this->framebuf . $data, $this->firstFrameOpcodeName);
                    $this->firstFrameOpcodeName = null;
                    $this->framebuf = '';
                }
            }
        }
    }