planetteamspeak / ts3phpframework

Modern use-at-will framework that provides individual components to manage TeamSpeak 3 Server instances
https://www.planetteamspeak.com
GNU General Public License v3.0
212 stars 59 forks source link

getViewer #203

Open Grepher76380 opened 1 year ago

Grepher76380 commented 1 year ago

PlanetTeamSpeak\TeamSpeak3Framework\Node\Node::getClass(): Argument #1 ($prefix) must be of type string, null given, called in /var/www/vhosts/codeigniter.maltospeak.com/httpdocs/vendor/planetteamspeak/ts3-php-framework/src/Viewer/Html.php on line 185

code use :

$ts3 = $this->libts->factory($uri); $data['viewer'] = $ts3->getViewer(new Html("../assets/images/viewer/", "../assets/images/flags/", "data:image"));

Use codeigniter4 and php 8.1 and ts3phpframework version dev.

ronindesign commented 1 year ago

We had some incompatible errors with PHP 8.1/8.2, please try again with dev branch and see if you still receive the error.

Grepher76380 commented 1 year ago

Fatal error: Allowed memory size of 1585446912 bytes exhausted (tried to allocate 1073741824 bytes) in /var/www/vhosts/maltospeak.com/httpdocs/vendor/planetteamspeak/ts3-php-framework/src/Helper/StringHelper.php on line 211

planetteamspeak/ts3-php-framework: "dev-dev", php : 8.1.21

Sorry

ronindesign commented 1 year ago

That appears to be another issue. If you're not still getting the Node::getClass() exception, we should probably close this for now.

Grepher76380 commented 1 year ago

humm,

I put the dev version, I had to add in the file: planetteamspeak/ts3-php-framework/src/Transport/TCP.php

public function readLine(string $token = "\n"): StringHelper { $this->connect();

    $line = StringHelper::factory("");

    while (!$line->endsWith($token)) {
        $this->waitForReadyRead();

        $data = @fgets($this->stream, 4096);

        Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "DataRead", $data);

        if ($data === false) {
            if ($line->count()) {
                $line->append($token);
            } else {
                throw new TransportException("connection to server '" . $this->config["host"] . ":" . $this->config["port"] . "' lost");
            }
        } else {
            $line->append($data);
        }
    }

    return $line->trim();
}

no error ( Fatal error: Allowed memory size of 1585446912 bytes exhausted (tried to allocate 1073741824 bytes) in /var/www/vhosts/maltospeak.com/httpdocs/vendor/planetteamspeak/ts3-php-framework/src/Helper/StringHelper.php on line 211 )

just

PlanetTeamSpeak\TeamSpeak3Framework\Node\Node::getClass(): Argument #1 ($prefix) must be of type string, null given, called in /var/www/vhosts/maltospeak.com/httpdocs/vendor/planetteamspeak/ts3-php-framework/src/Viewer/Html.php on line 185

look : https://maltospeak.com/PanelTeamspeak/viewer/13510/14510

ronindesign commented 1 year ago

I believe this was just fixed in dev on #195 as of today. Would you please try pulling latest version of dev? (Latest commit id is 2d4690eb6cbb08013d354b49271ab3d78debf305)

Sebbo94BY commented 1 year ago

@ronindesign The problem is, that composer is still on 990b41a for the dev branch. See #184.