sundrique / doctrine-tools
Zend Framework 2 Module providing unified endpoint for Doctrine command line tools
Installs: 1 722
Dependents: 1
Suggesters: 0
Security: 0
Stars: 7
Watchers: 2
Forks: 0
Open Issues: 1
pkg:composer/sundrique/doctrine-tools
Requires
- php: >=5.3.3
- doctrine/doctrine-orm-module: >=0.7
- doctrine/migrations: dev-master
README
Important notice
Since this code was merged into DoctrineORMModule and DoctrineModule present module is no longer supported. Simply use aforenamed modules instead.
Introduction
This module provides an unified endpoint for Doctrine command line tools.
Installation
First, add the following line into your composer.json file:
"require": { "sundrique/doctrine-tools": ">=0.2" }
Then, enable the module by adding DoctrineTools in your application.config.php file.
<?php return array( 'modules' => array( 'DoctrineTools', 'DoctrineModule', 'DoctrineORMModule', 'Application', ), );
Create directory data/DoctrineTools/Migrations and make sure your application has write access to it.
Configuration
If you have already configured DoctrineORMModule no extra configuration required. Otherwise you need to configure it first.
You can also overwrite default directory where migrations files will be stored, migrations namespace and migrations table name.
<?php return array( 'doctrinetools' => array( 'migrations' => array( 'directory' => 'path/to/MyDoctrineMigrations', 'namespace' => 'MyDoctrineMigrations', 'table' => 'my_migrations' ) ) );
Usage
$ /path/to/your/app/public/index.php <command>
Available commands
The following commands are currently available:
helpDisplays help for a command.listLists commands.
DBAL
dbal:importImport SQL file(s) directly to Database.dbal:run-sqlExecutes arbitrary SQL directly from the command line.
Migrations
migrations:diffGenerate a migration by comparing your current database to your mapping information.migrations:executeExecute a single migration version up or down manually.migrations:generateGenerate a blank migration class.migrations:migrateExecute a migration to a specified version or the latest available version.migrations:statusView the status of a set of migrations.migrations:versionManually add and delete migration versions from the version table.
ORM
orm:clear-cache:metadataClear all metadata cache of the various cache drivers.orm:clear-cache:queryClear all query cache of the various cache drivers.orm:clear-cache:resultClear all result cache of the various cache drivers.orm:convert-d1-schemaConverts Doctrine 1.X schema into a Doctrine 2.X schema.orm:convert-mappingConvert mapping information between supported formats.orm:ensure-production-settingsVerify that Doctrine is properly configured for a production environment.orm:generate-entitiesGenerate entity classes and method stubs from your mapping information.orm:generate-proxiesGenerates proxy classes for entity classes.orm:generate-repositoriesGenerate repository classes from your mapping information.orm:infoShow basic information about all mapped entitiesorm:run-dqlExecutes arbitrary DQL directly from the command line.orm:schema-tool:createProcesses the schema and either create it directly on EntityManager Storage Connection or generate the SQL output.orm:schema-tool:dropDrop the complete database schema of EntityManager Storage Connection or generate the corresponding SQL output.orm:schema-tool:updateExecutes (or dumps) the SQL needed to update the database schema to match the current mapping metadata.orm:validate-schemaValidate the mapping files.