Inserts the SQL file $sqlFile found in the path $path into the currently connected database.

@param string $path
@param string $sqlFile
@param bool $usePathType
@return bool true if succesful.
334579
function insertFile( $path, $sqlFile, $usePathType = true )
    {
        $type = $this->databaseName();

        if ( $usePathType )
            $sqlFileName = eZDir::path( array( $path, $type, $sqlFile ) );
        else
            $sqlFileName = eZDir::path( array( $path, $sqlFile ) );
        if ( !file_exists( $sqlFileName ) )
        {
            eZDebug::writeError( "File not found: $sqlFileName", __METHOD__ );
            return false;
        }
        $sqlFileHandler = fopen( $sqlFileName, 'rb' );
        $buffer = '';
        $done = false;
        while ( count( ( $sqlArray = $this->prepareSqlQuery( $sqlFileHandler, $buffer ) ) ) > 0 )
        {
            // Turn unneccessary SQL debug output off
            $oldOutputSQL = $this->OutputSQL;
            $this->OutputSQL = false;
            if ( $sqlArray && is_array( $sqlArray ) )
            {
                $done = true;
                foreach( $sqlArray as $singleQuery )
                {
                    $singleQuery = preg_replace( "/\n|\r\n|\r/", " ", $singleQuery );
                    if ( preg_match( "#^ */(.+)$#", $singleQuery, $matches ) )
                    {
                        $singleQuery = $matches[1];
                    }
                    if ( trim( $singleQuery ) != "" )
                    {
//                    eZDebug::writeDebug( $singleQuery );
                        $this->query( trim( $singleQuery ) );
                        if ( $this->errorNumber() )
                        {
                            return false;
                        }
                    }
                }

            }
            $this->OutputSQL = $oldOutputSQL;
        }
        return $done;

    }
42641
public static function initialize($path = null, $mapfile = null)
    {
        self::register();
        self::addPath($path);
        self::addMap($mapfile);
    }
745550
public function useCert($certType, $certPath, $keyPath)
    {
        switch ($certType) {
            case self::CERT_TYPE_PEM:
            case self::CERT_TYPE_DER:
            case self::CERT_TYPE_ENG:
                $this->useCert      = true;
                $this->sslCertType  = $certType;
                $this->sslKeyType   = $certType;

                $this->sslCert      = $certPath;
                $this->sslKey       = $keyPath;
                break;
            default:
                $this->useCert = false;
                break;
        }
    }
1364371
public function addConnection(Connection $connection, bool $useLogger = true)
    {
        if ($useLogger) {
            $connection->setLogger($this->getLogger());
        }
        $this->connections[$connection->getType()] = $connection;
        if ($connection->isDefault()) {
            $this->setDefaultConnectionByType($connection->getType());
        }
    }
953006
protected void addRequiredPath(String requiredPath) {
        if(requiredPath == null) {
            throw new IllegalArgumentException("Required path can't be null.");
        }
        DefaultOperationRequestAddress requiredAddress = new DefaultOperationRequestAddress();
        CommandLineParser.CallbackHandler handler = new DefaultCallbackHandler(requiredAddress);
        try {
            ParserUtil.parseOperationRequest(requiredPath, handler);
        } catch (CommandFormatException e) {
            throw new IllegalArgumentException("Failed to parse nodeType: " + e.getMessage());
        }
        addRequiredPath(requiredAddress);
    }
1075508
public function copyToAppliedDir($file)
    {
        if (false === @copy($file->getPathName(), $this->appliedFilesDir . '/' . $file->getFileName())) {
            throw new RuntimeException('cannot copy the sql file to applied directory. check the <info>'. $this->appliedFilesDir . '</info> directory.');
        }
    }
1050576
public function useFiles($path, $level = 'debug', $format='', $dateFormat = 'Y-m-d H:i:s', $permissions=null)
	{
		$level = $this->parseLevel($level);

		$handler = new StreamHandler($path, $level, true, $permissions);
		if ($format)
		{
			$handler->setFormatter(new LineFormatter($format, $dateFormat));
		}

		$this->monolog->pushHandler($handler);
	}
327047
private function performFindAndReplaceInFile(
        string $path
    ): void {
        $this->findAndReplaceHelper->findReplace(
            'use ' . RelationsGenerator::FIND_ENTITIES_NAMESPACE . '\\' . RelationsGenerator::FIND_ENTITY_NAME,
            "use {$this->entityFqn}",
            $path
        );
        $this->findAndReplaceHelper->findReplace(
            'use ' .
            RelationsGenerator::FIND_ENTITY_INTERFACE_NAMESPACE .
            '\\' .
            RelationsGenerator::FIND_ENTITY_INTERFACE_NAME,
            "use {$this->entityInterfaceFqn}",
            $path
        );
        $this->findAndReplaceHelper->findReplaceRegex(
            '%use(.+?)Relations\\\TemplateEntity(.+?);%',
            'use ${1}Relations\\' . $this->singularNamespace . '${2};',
            $path
        );
        $this->findAndReplaceHelper->findReplaceRegex(
            '%use(.+?)Relations\\\TemplateEntity(.+?);%',
            'use ${1}Relations\\' . $this->pluralNamespace . '${2};',
            $path
        );
        $this->findAndReplaceHelper->findReplaceRegex(
            '%(Has|Reciprocates)(Required|)TemplateEntity%',
            '${1}${2}' . $this->singularNamespacedName,
            $path
        );
        $this->findAndReplaceHelper->findReplaceRegex(
            '%(Has|Reciprocates)(Required|)TemplateEntities%',
            '${1}${2}' . $this->pluralNamespacedName,
            $path
        );
        $this->findAndReplaceHelper->findReplace(
            RelationsGenerator::FIND_ENTITY_INTERFACE_NAME,
            $this->namespaceHelper->basename($this->entityInterfaceFqn),
            $path
        );
        $this->findAndReplaceHelper->replaceName($this->singularNamespacedName, $path);
        $this->findAndReplaceHelper->replacePluralName($this->pluralNamespacedName, $path);
        $this->findAndReplaceHelper->replaceProjectNamespace($this->projectRootNamespace, $path);
    }
675913
@Override
	public boolean existSql(final String sqlPath) {
		if (!cache) {
			return sqlLoader.existSql(sqlPath);
		} else {
			return sqlMap.get(sqlPath.replace(".", "/")) != null;
		}
	}
289477
private function updateFilePermissions(ConnectionAdapterInterface $connection, $releasePath, $path, $pathSettings)
    {
        $path = $releasePath.'/'.$path;

        if (isset($pathSettings['permissions']) === false) {
            return false;
        }

        $permissions = FilePermissionCalculator::fromStringRepresentation(str_pad($pathSettings['permissions'], 10, '-'))->getMode();

        $recursive = false;
        if (isset($pathSettings['recursive'])) {
            $recursive = $pathSettings['recursive'];
        }

        return $connection->changePermissions($path, $permissions, $recursive);
    }
830062
public function file($path, $type = 'debug')
    {
        $this->pushHandler(new StreamHandler($path, $this->getLevel($type)));
    }
273274
public void addFile(String path, File file, String contentType) throws IOException {
    try (InputStream is = new FileInputStream(file)) {
      addFile(path, is, contentType);
    }
  }
381761
static function createPathConditionSQLString( $nodePath, $nodeDepth, $depth = false, $depthOperator = 'le' )
    {
        $pathCondition  = '';
        $depthCondition = '';

        if ( $depth )
        {
            $sqlDepthOperator = '<=';
            if ( $depthOperator )
            {
                if ( $depthOperator == 'lt' )
                {
                    $sqlDepthOperator = '<';
                }
                else if ( $depthOperator == 'gt' )
                {
                    $sqlDepthOperator = '>';
                }
                else if ( $depthOperator == 'le' )
                {
                    $sqlDepthOperator = '<=';
                }
                else if ( $depthOperator == 'ge' )
                {
                    $sqlDepthOperator = '>=';
                }
                else if ( $depthOperator == 'eq' )
                {
                    $sqlDepthOperator = '=';
                }
            }

            $nodeDepth += $depth;
            $depthCondition = ' ezcontentobject_tree.depth '. $sqlDepthOperator . ' ' . $nodeDepth . '  and ';
        }

        $pathCondition = " ezcontentobject_tree.path_string like '$nodePath%' and $depthCondition ";
        return $pathCondition;
    }
742609
public SqlBuilder join(final String joinMode, final String path, final String alias) {
    from += " " + joinMode + " join " + path + " " + alias;
    return this;
  }
425601
public function xmlShouldBeValid($xmlFile, $schemaPath)
    {
        $dom = new DomDocument();
        $dom->load($this->workingDir . '/' . $xmlFile);

        $dom->schemaValidate(__DIR__ . '/schema/' . $schemaPath);
    }
390184
public static function ensureConfigFile($path, $type)
    {
        if (!is_file($path)) {
            $content = self::getExampleConfiguration($type);
            file_put_contents($path, $content);
        }
    }
462166
public function addPath($db_filename = null, $db_directory = null, $file = null)
    {
        if (!empty($db_filename) && !in_array($db_filename, $this->_paths['language_strings_db_filename'])) {
            $this->_paths['language_strings_db_filename'][] = $db_filename;
        }
        if (!empty($db_directory) && !in_array($db_directory, $this->_paths['language_strings_db_directory'])) {
            $this->_paths['language_strings_db_directory'][] = $db_directory;
        }
        if (!empty($file) && !in_array($file, $this->_paths['loaded_files'])) {
            $this->_paths['loaded_files'][] = $file;
        }
        return $this;
    }