EvilFreelancer / routeros-api-php

Mikrotik RouterOS API PHP client for your applications
https://mikrotik.com/software
MIT License
397 stars 145 forks source link

cant display full script if the script contain new line #24

Closed skolastikarhea closed 4 years ago

skolastikarhea commented 4 years ago

hi, i got issue like this https://github.com/EvilFreelancer/routeros-api-php/issues/20, but for me is not solved.

fyi, mikrotik version 6.44.6 (long term)

i create script manualy on mikrotik, like this image

then i create php file with this data :

<?php
require_once 'vendor/autoload.php';
error_reporting(E_ALL);
use RouterOS\Client;
use RouterOS\Query;
$client = new Client([
    'timeout' => 1,
    'host'    => 'my host',
    'user'    => 'my user',
    'pass'    => 'my pass',
    'port'    => my port,
]);

$query = (new Query('/system/script/print'))
            ->where('name','test_script');
$response = $client->query($query)->read();
print_r($response);

and this is the result :

image

the results can not display the full script, this method only display the first 1 line of code.

can i get full script (3 lines code) without changing my source script?

previously I apologize if the English I use is not good

EvilFreelancer commented 4 years ago

Hello! Sorry for long response, all problems with scripts are very individual, have you checked the result returned by the RouterOS through the command line? If results is different, then issue in library, if same then in script which you created.

EvilFreelancer commented 4 years ago

Hello, any updates?