Forums

Resolved
0 votes
I have a function.



function rpmlist()
{
$this->load->library('Server_1C');

$dom = new DOMDocument;
$dom->loadHTML($postResult);

}


This code is working.

But if try that



function rpmlist()
{
$this->load->library('Server_1C');

$dom = new DOMDocument;
$dom->loadHTML($postResult);

$data = array();
$data['rpmlist'] = $this->server_1c->login1c('login,'Password');
$this->page->view_form('app/rpmlist', $data, lang('server_1c_web_app_name'));
}


Than i have an error:
PHP Fatal error: Class 'clearos\\apps\\server_1c\\DOMDocument' not found in /usr/clearos/apps/server_1c/libraries/Server_1C.php on line 564, referer: https://192.168.1.22:81/app/server_1c

Why if use view_form webconfig said that DOMDocument not found. But if i use function without view_form all works fine.

Why?
Tuesday, September 18 2018, 12:22 PM
Share this post:

Accepted Answer

Tuesday, September 18 2018, 01:25 PM - #Permalink
Resolved
0 votes
I can't explain why you're seeing what you're seeing, but I don't think view_form is the problem.

If your app is executing in Webconfig, make sure you have webconfig-php-xml. If your app is using the Apache/PHP, make sure you have php-xml installed (for whatever version of PHP you're using if you are using php-engines).

One other thing to try is to add a backslash in front of your objection creation...eg:


$dom = new \DOMDocument();


B
The reply is currently minimized Show
Responses (1)
  • Accepted Answer

    Tuesday, September 18 2018, 06:21 PM - #Permalink
    Resolved
    0 votes
    Maybe i was something wrong in my explaination. I have an error when i try to executing DOMDocument from Library Class. And so \DOMDocument it is working.


    [root@clearosdev controllers]# yum list installed | grep php-xml
    php-xml.x86_64 5.4.16-45.el7 @clearos-centos
    rh-php56-php-xml.x86_64 5.6.25-1.el7 @clearos-centos-sclo-rh
    rh-php56-php-xmlrpc.x86_64 5.6.25-1.el7 @clearos-centos-sclo-rh
    rh-php70-php-xml.x86_64 7.0.27-1.el7 @clearos-centos-sclo-rh
    rh-php71-php-xml.x86_64 7.1.8-1.el7 @clearos-centos-sclo-rh
    webconfig-php-xml.x86_64 5.4.16-45.v7 @clearos
    The reply is currently minimized Show
Your Reply