<commit_before>SFArchiveBundle
===============


Purpose
-------

The purpose of this bundle is to provide a generic Symfony2 Console Command which is used to archive DB tables.
The general idea is that you give it a table name, and a strategy that it should follow to archive.

Say you have 100 000 000 records in a table called "**stuff**". Let's assume for a second that the table
called "**stuff**" has a **created_at** field attached to it, which is a date-time field in MySQL
(or whatever your underlying database is).

When calling the command <code>php app/console archive:generic stuff</code> it will run through the
table **stuff** and archive the values into tables starting with a "z" and ending in the "Ym" value
corresponding to the record's **created_at** column.

As an example, a record having **created_at** of "2014-03-11 23:54:22" will be archived to the table
with name zstuff201403. And record having **created_at** of "2014-02-28 08:23:00" will go
to zstuff201402 - notice the difference is in the month at the end.

The rational behind this is that tables starting with z will be at the end of your list of tables,
in an effort to avoid cluttering your main view of your database.

Usage
-----

	Usage:
	 archive:generic [--days="..."] [--strategy-z-tables[="..."]] [--strategy-source-field="..."] [--batch-size[="..."]] [--source-entity-manager="..."] [--destination-entity-manager="..."] table_name

	Arguments:
	 table_name                    The name of the source table to archive

	Options:
	 --days                        Defines how many days in the past to start archive.
	                               Example, 14 would archive data older than 14 days (default: 90)
	 --strategy-z-tables           Strategy is to create tables of the same name, in format zTableNameYm
	                               (ex zclients201403. (default: "Ym")
	 --strategy-source-field       Field to base the strategy on. For the YYYYMM strategy, this has to be
	                               a date field (default: "created_at")
	 --batch-size                  Size of each batch. It is important not to choose too big or small a batch.
	                               Big batches will cause memory problems, small ones will decrease the
	                               speed of archiving. (default: 100)
	 --source-entity-manager       Source Entity Manager to archive from (default: "default")
	 --destination-entity-manager  Destination Entity Manager to archive to. If none is provided,
	                               the same as --source-entity-manager will be used. (default: "default">
	 
Reporting an issue or a feature request
---------------------------------------

Please submit issues and feature requests in the [Github issue tracker](https://github.com/sarelvdwalt/SFArchiveBundle/issues).
<commit_msg>Readme formatting<commit_after>SFArchiveBundle
===============


Purpose
-------

The purpose of this bundle is to provide a generic Symfony2 Console Command which is used to archive DB tables.
The general idea is that you give it a table name, and a strategy that it should follow to archive.

Say you have 100 000 000 records in a table called "**stuff**". Let's assume for a second that the table
called "**stuff**" has a **created_at** field attached to it, which is a date-time field in MySQL
(or whatever your underlying database is).

When calling the command <code>php app/console archive:generic stuff</code> it will run through the
table **stuff** and archive the values into tables starting with a "z" and ending in the "Ym" value
corresponding to the record's **created_at** column.

As an example, a record having **created_at** of "2014-03-11 23:54:22" will be archived to the table
with name zstuff201403. And record having **created_at** of "2014-02-28 08:23:00" will go
to zstuff201402 - notice the difference is in the month at the end.

The rational behind this is that tables starting with z will be at the end of your list of tables,
in an effort to avoid cluttering your main view of your database.

Usage
-----

	Usage:
	 archive:generic [--days="..."] [--strategy-z-tables[="..."]] [--strategy-source-field="..."] [--batch-size[="..."]]
	 [--source-entity-manager="..."] [--destination-entity-manager="..."] table_name

	Arguments:
	 table_name                    The name of the source table to archive

	Options:
	 --days                        Defines how many days in the past to start archive.
	                               Example, 14 would archive data older than 14 days (default: 90)
	 --strategy-z-tables           Strategy is to create tables of the same name, in format zTableNameYm
	                               (ex zclients201403. (default: "Ym")
	 --strategy-source-field       Field to base the strategy on. For the YYYYMM strategy, this has to be
	                               a date field (default: "created_at")
	 --batch-size                  Size of each batch. It is important not to choose too big or small a batch.
	                               Big batches will cause memory problems, small ones will decrease the
	                               speed of archiving. (default: 100)
	 --source-entity-manager       Source Entity Manager to archive from (default: "default")
	 --destination-entity-manager  Destination Entity Manager to archive to. If none is provided,
	                               the same as --source-entity-manager will be used. (default: "default">
	 
Reporting an issue or a feature request
---------------------------------------

Please submit issues and feature requests in the [Github issue tracker](https://github.com/sarelvdwalt/SFArchiveBundle/issues).

{'fraction_non_alphanumeric': 0.10440917107583775, 'fraction_numerical': 0.02292768959435626, 'mean_word_length': 2.4834152334152333, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1284641', 'n_tokens_mistral': 1572, 'n_tokens_neox': 1389, 'n_words': 707}