<commit_before><?php

namespace DigipolisGent\Robo\Task\Deploy\Common;

use Robo\Contract\TaskInterface;

trait DatabaseCommand
{

    protected function defaultFileSystemConfig()
    {
        return [
            'local' => [
                'type' => 'Local',
                'root' => realpath(getcwd()),
            ],
        ];
    }

    protected function defaultDbConfig($drupal = false)
    {
        $dbConfig = [
            'default' => [
                'type' => 'mysql',
                'host' => 'localhost',
                'port' => '3306',
                'user' => 'root',
                'pass' => '',
                'database' => dirname(realpath(getcwd())),
            ],
        ];
        return $drupal
            ? $this->parseDrupalDbConfig()
            : $dbConfig;
    }

    protected function parseDrupalDbConfig()
    {
        $webDir = $this->getConfig()->get('digipolis.project.web', false);
        if (!$webDir) {
            return false;
        }<commit_msg>Default to fileystem root.<commit_after><?php

namespace DigipolisGent\Robo\Task\Deploy\Common;

use Robo\Contract\TaskInterface;

trait DatabaseCommand
{

    protected function defaultFileSystemConfig()
    {
        return [
            'local' => [
                'type' => 'Local',
                'root' => '/',
            ],
        ];
    }

    protected function defaultDbConfig($drupal = false)
    {
        $dbConfig = [
            'default' => [
                'type' => 'mysql',
                'host' => 'localhost',
                'port' => '3306',
                'user' => 'root',
                'pass' => '',
                'database' => dirname(realpath(getcwd())),
            ],
        ];
        return $drupal
            ? $this->parseDrupalDbConfig()
            : $dbConfig;
    }

    protected function parseDrupalDbConfig()
    {
        $webDir = $this->getConfig()->get('digipolis.project.web', false);
        if (!$webDir) {
            return false;
        }
{'fraction_non_alphanumeric': 0.14442231075697212, 'fraction_numerical': 0.00398406374501992, 'mean_word_length': 1.4741379310344827, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2244430', 'n_tokens_mistral': 586, 'n_tokens_neox': 564, 'n_words': 96}