<commit_before><?php
    namespace DB;

    class Schema
    {
        const MODE_CREATE = 1;
        const MODE_MODIFY = 2;
        const MODE_DROP = 3;

        private $schemaDriver = null;

        private $mode = '';
        private $fields = array();
        private $fieldCount = 0;
        private $constraint = array();

        public function __construct($name, &$db)
        {
            $vendor =& loadClass('Vendor', 'Core');
            $list = $vendor->find('DB/Schema', $name);

            if (!is_array($list))
            {
                include ($list . '/DB/Schema/'.$name.'.php');
                $class = '\\DB\\Schema\\'.$name;

                if (class_exists($class))
                {
                    $this->schemaDriver = new $class();
                    $this->schemaDriver->db =& $db;
                }
            }
        }

        public function hasTable($table)
        {
            return $this->schemaDriver->hasTable($table);
        }

        public function create($table, $func)
        {
            $this->reset();
            $this->schemaDriver->reset();

            $func(new SchemaTable($this));

            foreach ($this->fields as $field)
            {
                $this->schemaDriver->addField($field);
            }

            foreach ($this->constraint as $cons)
            {
                $this->schemaDriver->addConstraint($cons);
            }

            $this->schemaDriver->create($table);

            exit();
        }

        public function drop($table)
        {
            $this->schemaDriver->drop($table);
        }

        public function reset()
        {
            $this->fields = array();
            $this->constraint = array();
        }
<commit_msg>remove exit from schema<commit_after><?php
    namespace DB;

    class Schema
    {
        const MODE_CREATE = 1;
        const MODE_MODIFY = 2;
        const MODE_DROP = 3;

        private $schemaDriver = null;

        private $mode = '';
        private $fields = array();
        private $fieldCount = 0;
        private $constraint = array();

        public function __construct($name, &$db)
        {
            $vendor =& loadClass('Vendor', 'Core');
            $list = $vendor->find('DB/Schema', $name);

            if (!is_array($list))
            {
                include ($list . '/DB/Schema/'.$name.'.php');
                $class = '\\DB\\Schema\\'.$name;

                if (class_exists($class))
                {
                    $this->schemaDriver = new $class();
                    $this->schemaDriver->db =& $db;
                }
            }
        }

        public function hasTable($table)
        {
            return $this->schemaDriver->hasTable($table);
        }

        public function create($table, $func)
        {
            $this->reset();
            $this->schemaDriver->reset();

            $func(new SchemaTable($this));

            foreach ($this->fields as $field)
            {
                $this->schemaDriver->addField($field);
            }

            foreach ($this->constraint as $cons)
            {
                $this->schemaDriver->addConstraint($cons);
            }

            $this->schemaDriver->create($table);
        }

        public function drop($table)
        {
            $this->schemaDriver->drop($table);
        }

        public function reset()
        {
            $this->fields = array();
            $this->constraint = array();
        }

{'fraction_non_alphanumeric': 0.14040606233914785, 'fraction_numerical': 0.002287675150128682, 'mean_word_length': 1.3073878627968338, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '2841625', 'n_tokens_mistral': 937, 'n_tokens_neox': 881, 'n_words': 178}