code/Debug/Model/Service.php
public function setSqlProfilerStatus($isEnabled)
    {
        $filePath = $this->getLocalXmlFilePath();
        $xml = $this->loadXmlFile($filePath);
        if ($xml === false) {
            throw new Exception("Unable to parse local.xml configuration file: {$filePath}");
        }

        /** @var SimpleXMLElement $connectionNode */
        $connectionNode = $xml->global->resources->default_setup->connection;
        if ($isEnabled) {
            /** @noinspection PhpUndefinedFieldInspection */
            $connectionNode->profiler = '1';
        } else {
            unset($connectionNode->profiler);
        }

        if ($this->saveXml($xml, $filePath) === false) {
            throw new Exception("Unable to save {$filePath}: check if web server user has write permission");
        }
    }
public function setSqlProfilerStatus($isEnabled)
    {
        $filePath = $this->getLocalXmlFilePath();
        $xml = $this->loadXmlFile($filePath);
        if ($xml === false) {
            throw new Exception("Unable to parse local.xml configuration file: {$filePath}");
        }

        /** @var SimpleXMLElement $connectionNode */
        $connectionNode = $xml->global->resources->default_setup->connection;
        if ($isEnabled) {
            /** @noinspection PhpUndefinedFieldInspection */
            $connectionNode->profiler = '1';
        } else {
            unset($connectionNode->profiler);
        }

        if ($this->saveXml($xml, $filePath) === false) {
            throw new Exception("Unable to save {$filePath}: check if web server user has write permission");
        }
    }
public function setSqlProfilerStatus ( $ isEnabled ) { $ filePath = $ this -> getLocalXmlFilePath ( ) ; $ xml = $ this -> loadXmlFile ( $ filePath ) ; if ( $ xml === false ) { throw new Exception ( "Unable to parse local.xml configuration file: {$filePath}" ) ; } /** @var SimpleXMLElement $connectionNode */ $ connectionNode = $ xml -> global -> resources -> default_setup -> connection ; if ( $ isEnabled ) { /** @noinspection PhpUndefinedFieldInspection */ $ connectionNode -> profiler = '1' ; } else { unset ( $ connectionNode -> profiler ) ; } if ( $ this -> saveXml ( $ xml , $ filePath ) === false ) { throw new Exception ( "Unable to save {$filePath}: check if web server user has write permission" ) ; } }
Changes status for SQL profiler

@param bool $isEnabled
@throws Exception
Changes status for SQL profiler