<commit_before><?php
namespace Concrete\Core\Updater\Migrations\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

class Version571 extends AbstractMigration
{

    public function getName()
    {
        return '20141008000000';
    }

    public function up(Schema $schema)
    {
        /** @todo refresh CollectionVersionBlocks, CollectionVersionBlocksCacheSettings tables */
        /** @todo add permissions lines for edit_block_name and edit_block_cache_settings */
        /** @todo Add marketplace single pages */
        /** @todo Install the community authentication type */
        /** @todo delete customize page themes dashboard single page */
        /** @todo Add auth types ("handle|name") "twitter|Twitter" and "community|concrete5.org" */
        /** @remove exclude nav from flat view in dashboard */
    }

    public function down(Schema $schema)
    {
    }
}
<commit_msg>5.7.1 migration script<commit_after><?php
namespace Concrete\Core\Updater\Migrations\Migrations;

use Concrete\Core\Authentication\AuthenticationType;
use Concrete\Core\Page\Page;
use Concrete\Core\Permission\Key\Key;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

class Version571 extends AbstractMigration
{

    public function getName()
    {
        return '20141016000000';
    }

    public function up(Schema $schema)
    {
        /** refresh CollectionVersionBlocks, CollectionVersionBlocksCacheSettings tables */
        $cvb = $schema->getTable('CollectionVersionBlocks');
        $cvb->addColumn('cbOverrideBlockTypeCacheSettings', 'boolean', array('default' => 0));

        $cvbcs = $schema->createTable('CollectionVersionBlocksCacheSettings');
        $cvbcs->addColumn('cID', 'integer', array('notnull' => true, 'default' => 0));
        $cvbcs->addColumn('cvID', 'integer', array('notnull' => true, 'default' => 1));
        $cvbcs->addColumn('bID', 'integer', array('notnull' => true, 'default' => 0));
        $cvbcs->addColumn('arHandle', 'string', array('notnull' => false));
        $cvbcs->addColumn('btCacheBlockOutput', 'boolean', array('default' => 0));
        $cvbcs->addColumn('btCacheBlockOutputOnPost', 'boolean', array('default' => 0));
        $cvbcs->addColumn('btCacheBlockOutputForRegisteredUsers', 'boolean', array('default' => 0));
        $cvbcs->addColumn('btCacheBlockOutputLifetime', 'integer', array('notnull' => true, 'default' => 0));
        $cvbcs->setPrimaryKey(array('cID', 'cvID', 'bId', 'arHandle'));

        /** add permissions lines for edit_block_name and edit_block_cache_settings */
		$ebk = Key::getByHandle('edit_block_name');
		if (!is_object($ebk)) {
			Key::add('block', 'edit_block_name', 'Edit Name', "Controls whether users can change the block's name (rarely used.).", false, false);
		}
		$ebk = Key::getByHandle('edit_block_cache_settings');
		if (!is_object($ebk)) {
			Key::add('block', 'edit_block_cache_settings', 'Edit Cache Settings', "Controls whether users can change the block cache settings for this block instance.", false, false);
		}

        /** Add marketplace single pages */
		$sp = Page::getByPath('/dashboard/extend/connect');
		if (!is_object($sp) || $sp->isError()) {
			$sp = SinglePage::add('/dashboard/extend/connect');
			$sp->update(array('cName' => 'Connect to the Community'));
			$sp->setAttribute('meta_keywords', 'concrete5.org, my account, marketplace');
		}
		$sp = Page::getByPath('/dashboard/extend/themes');
		if (!is_object($sp) || $sp->isError()) {
			$sp = SinglePage::add('/dashboard/extend/themes');
			$sp->update(array('cName' => 'Get More Themes'));
			$sp->setAttribute('meta_keywords', 'buy theme, new theme, marketplace, template');
		}
		$sp = Page::getByPath('/dashboard/extend/add-ons');
		if (!is_object($sp) || $sp->isError()) {
			$sp = SinglePage::add('/dashboard/extend/add-ons');
			$sp->update(array('cName' => 'Get More Add-Ons'));
			$sp->setAttribute('meta_keywords', 'buy addon, buy add on, buy add-on, purchase addon, purchase add on, purchase add-on, find addon, new addon, marketplace');
		}

        /** Add auth types ("handle|name") "twitter|Twitter" and "community|concrete5.org" */
        $community = AuthenticationType::getByHandle('community');
        if (!is_object($community)) {
            AuthenticationType::add('community', 'concrete5.org');
        }
        $twitter = AuthenticationType::getByHandle('twitter');
        if (!is_object($twitter)) {
            AuthenticationType::add('twitter', 'Twitter');
        }

        /** delete customize page themes dashboard single page */
        $customize = Page::getByPath('/dashboard/pages/themes/inspect');
        if (is_object($customize) && !$customize->isError()) {
            $customize->delete();
        }

        /** exclude nav from flat view in dashboard */
        $flat = Page::getByPath('/dashboard/sitemap/explore');
        if (is_object($customize) && !$customize->isError()) {
            $flat->setAttribute("exclude_nav", false);
        }
    }

    public function down(Schema $schema)
    {
    }
}

{'fraction_non_alphanumeric': 0.1607843137254902, 'fraction_numerical': 0.009607843137254901, 'mean_word_length': 3.8396584440227706, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 44, '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': '5999065', 'n_tokens_mistral': 1595, 'n_tokens_neox': 1500, 'n_words': 327}