HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/qas.sports-crowd.com/vendor/react/event-loop/tests/ExtLibeventLoopTest.php
<?php

namespace React\Tests\EventLoop;

use React\EventLoop\ExtLibeventLoop;

class ExtLibeventLoopTest extends AbstractLoopTest
{
    /** @var ?string */
    private $fifoPath;

    public function createLoop()
    {
        if ('Linux' === PHP_OS && !extension_loaded('posix')) {
            $this->markTestSkipped('libevent tests skipped on linux due to linux epoll issues.');
        }

        if (!function_exists('event_base_new')) {
            $this->markTestSkipped('libevent tests skipped because ext-libevent is not installed.');
        }

        return new ExtLibeventLoop();
    }

    /**
     * @after
     */
    public function tearDownFile()
    {
        if ($this->fifoPath !== null && file_exists($this->fifoPath)) {
            unlink($this->fifoPath);
        }
    }

    public function createStream()
    {
        if ('Linux' !== PHP_OS) {
            return parent::createStream();
        }

        $this->fifoPath = tempnam(sys_get_temp_dir(), 'react-');
        assert(is_string($this->fifoPath));

        unlink($this->fifoPath);

        // Use a FIFO on linux to get around lack of support for disk-based file
        // descriptors when using the EPOLL back-end.
        posix_mkfifo($this->fifoPath, 0600);

        $stream = fopen($this->fifoPath, 'r+');

        return $stream;
    }

    public function writeToStream($stream, $content)
    {
        if ('Linux' !== PHP_OS) {
            return parent::writeToStream($stream, $content);
        }

        fwrite($stream, $content);
    }
}