Closed nosovk closed 9 years ago
I think you might want to keep the ".phar" extension of the PHAR file. Perhaps the SPL autoloader (and by extension, PEAR2_Autoload) is looking at "PEAR2_Net_RouterOS-1.0.0b4/", and thinks "that's a folder, not a PHAR file", and hence the error.
Oh, and... How does the file you're including the PHAR from look like? I'd just like to make sure your use statements and "new" call are fine.
Judging from your posts at the MikroTik forum, I take it you've abandoned the idea of using the API protocol altogether?
I'm therefore closing this issue. If I've misread your direction, and you intend to pursue an API protocol solution, feel free to reopen this issue.
Yep, I used telnet scripts.
When I try to load phar - I got an exception abour wrong namespace PEAR2\Net\RouterOS\RouterOS\Client RouterOS written twice, but in client.php - namespace declare with one RouterOS. And execution fails.
[Mon Sep 01 19:06:55 2014] [warn] [client 141.101.89.158] mod_fcgid: stderr: PHP Fatal error: Uncaught exception 'Exception' with message 'Class PEAR2\Net\RouterOS\RouterOS\Client could not be loaded from PEAR2/Net/RouterOS/RouterOS/Client.php, file does not exist (registered paths="phar:///var/www/clients/client1/web2/web/rs/test2.php/PEAR2_Net_RouterOS-1.0.0b4/src" ) [PEAR2_Autoload-0.2.4]' in phar:///var/www/clients/client1/web2/web/rs/test2.php/PEAR2_Net_RouterOS-1.0.0b4/src/PEAR2/Autoload.php:181 [Mon Sep 01 19:06:55 2014] [warn] [client 141.101.89.158] mod_fcgid: stderr: Stack trace:
[Mon Sep 01 19:06:55 2014] [warn] [client 141.101.89.158] mod_fcgid: stderr: #1 /var/www/clients/client1/web2/web/rs/test.php(16): spl_autoload_call('PEAR2\Net\Route...') [Mon Sep 01 19:06:55 2014] [warn] [client 141.101.89.158] mod_fcgid: stderr: #2 {main} [Mon Sep 01 19:06:55 2014] [warn] [client 141.101.89.158] mod_fcgid: stderr: thrown in phar:///var/www/clients/client1/web2/web/rs/test2.php/PEAR2_Net_RouterOS-1.0.0b4/src/PEAR2/Autoload.php on line 181