[DoctrineBundle] harmonized commands documentation by changing ./app/console to php app/console.
This commit is contained in:
parent
1c082b8133
commit
ec9c0aab64
@ -34,12 +34,12 @@ class CreateDatabaseDoctrineCommand extends DoctrineCommand
|
|||||||
The <info>doctrine:database:create</info> command creates the default
|
The <info>doctrine:database:create</info> command creates the default
|
||||||
connections database:
|
connections database:
|
||||||
|
|
||||||
<info>./app/console doctrine:database:create</info>
|
<info>php app/console doctrine:database:create</info>
|
||||||
|
|
||||||
You can also optionally specify the name of a connection to create the
|
You can also optionally specify the name of a connection to create the
|
||||||
database for:
|
database for:
|
||||||
|
|
||||||
<info>./app/console doctrine:database:create --connection=default</info>
|
<info>php app/console doctrine:database:create --connection=default</info>
|
||||||
EOT
|
EOT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -34,14 +34,14 @@ class DropDatabaseDoctrineCommand extends DoctrineCommand
|
|||||||
The <info>doctrine:database:drop</info> command drops the default connections
|
The <info>doctrine:database:drop</info> command drops the default connections
|
||||||
database:
|
database:
|
||||||
|
|
||||||
<info>./app/console doctrine:database:drop</info>
|
<info>php app/console doctrine:database:drop</info>
|
||||||
|
|
||||||
The --force parameter has to be used to actually drop the database.
|
The --force parameter has to be used to actually drop the database.
|
||||||
|
|
||||||
You can also optionally specify the name of a connection to drop the database
|
You can also optionally specify the name of a connection to drop the database
|
||||||
for:
|
for:
|
||||||
|
|
||||||
<info>./app/console doctrine:database:drop --connection=default</info>
|
<info>php app/console doctrine:database:drop --connection=default</info>
|
||||||
|
|
||||||
<error>Be careful: All data in a given database will be lost when executing
|
<error>Be careful: All data in a given database will be lost when executing
|
||||||
this command.</error>
|
this command.</error>
|
||||||
|
@ -43,27 +43,27 @@ You have to limit generation of entities:
|
|||||||
|
|
||||||
* To a bundle:
|
* To a bundle:
|
||||||
|
|
||||||
<info>./app/console doctrine:generate:entities MyCustomBundle</info>
|
<info>php app/console doctrine:generate:entities MyCustomBundle</info>
|
||||||
|
|
||||||
* To a single entity:
|
* To a single entity:
|
||||||
|
|
||||||
<info>./app/console doctrine:generate:entities MyCustomBundle:User</info>
|
<info>php app/console doctrine:generate:entities MyCustomBundle:User</info>
|
||||||
<info>./app/console doctrine:generate:entities MyCustomBundle/Entity/User</info>
|
<info>php app/console doctrine:generate:entities MyCustomBundle/Entity/User</info>
|
||||||
|
|
||||||
* To a namespace
|
* To a namespace
|
||||||
|
|
||||||
<info>./app/console doctrine:generate:entities MyCustomBundle/Entity</info>
|
<info>php app/console doctrine:generate:entities MyCustomBundle/Entity</info>
|
||||||
|
|
||||||
If the entities are not stored in a bundle, and if the classes do not exist,
|
If the entities are not stored in a bundle, and if the classes do not exist,
|
||||||
the command has no way to guess where they should be generated. In this case,
|
the command has no way to guess where they should be generated. In this case,
|
||||||
you must provide the <comment>--path</comment> option:
|
you must provide the <comment>--path</comment> option:
|
||||||
|
|
||||||
<info>./app/console doctrine:generate:entities Blog/Entity --path=src/</info>
|
<info>php app/console doctrine:generate:entities Blog/Entity --path=src/</info>
|
||||||
|
|
||||||
You should provide the <comment>--no-backup</comment> option if you don't mind to back up files
|
You should provide the <comment>--no-backup</comment> option if you don't mind to back up files
|
||||||
before to generate entities:
|
before to generate entities:
|
||||||
|
|
||||||
<info>./app/console doctrine:generate:entities Blog/Entity --no-backup</info>
|
<info>php app/console doctrine:generate:entities Blog/Entity --no-backup</info>
|
||||||
|
|
||||||
<error>Important:</error> Even if you specified Inheritance options in your
|
<error>Important:</error> Even if you specified Inheritance options in your
|
||||||
XML or YAML Mapping files the generator cannot generate the base and
|
XML or YAML Mapping files the generator cannot generate the base and
|
||||||
|
@ -42,22 +42,22 @@ class ImportMappingDoctrineCommand extends DoctrineCommand
|
|||||||
The <info>doctrine:mapping:import</info> command imports mapping information
|
The <info>doctrine:mapping:import</info> command imports mapping information
|
||||||
from an existing database:
|
from an existing database:
|
||||||
|
|
||||||
<info>./app/console doctrine:mapping:import "MyCustomBundle" xml</info>
|
<info>php app/console doctrine:mapping:import "MyCustomBundle" xml</info>
|
||||||
|
|
||||||
You can also optionally specify which entity manager to import from with the
|
You can also optionally specify which entity manager to import from with the
|
||||||
<info>--em</info> option:
|
<info>--em</info> option:
|
||||||
|
|
||||||
<info>./app/console doctrine:mapping:import "MyCustomBundle" xml --em=default</info>
|
<info>php app/console doctrine:mapping:import "MyCustomBundle" xml --em=default</info>
|
||||||
|
|
||||||
If you don't want to map every entity that can be found in the database, use the
|
If you don't want to map every entity that can be found in the database, use the
|
||||||
<info>--filter</info> option. It will try to match the targeted mapped entity with the
|
<info>--filter</info> option. It will try to match the targeted mapped entity with the
|
||||||
provided pattern string.
|
provided pattern string.
|
||||||
|
|
||||||
<info>./app/console doctrine:mapping:import "MyCustomBundle" xml --filter=MyMatchedEntity</info>
|
<info>php app/console doctrine:mapping:import "MyCustomBundle" xml --filter=MyMatchedEntity</info>
|
||||||
|
|
||||||
Use the <info>--force</info> option, if you want to override existing mapping files:
|
Use the <info>--force</info> option, if you want to override existing mapping files:
|
||||||
|
|
||||||
<info>./app/console doctrine:mapping:import "MyCustomBundle" xml --force</info>
|
<info>php app/console doctrine:mapping:import "MyCustomBundle" xml --force</info>
|
||||||
EOT
|
EOT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -34,12 +34,12 @@ The <info>doctrine:mapping:info</info> shows basic information about which
|
|||||||
entities exist and possibly if their mapping information contains errors or
|
entities exist and possibly if their mapping information contains errors or
|
||||||
not.
|
not.
|
||||||
|
|
||||||
<info>./app/console doctrine:mapping:info</info>
|
<info>php app/console doctrine:mapping:info</info>
|
||||||
|
|
||||||
If you are using multiple entity managers you can pick your choice with the
|
If you are using multiple entity managers you can pick your choice with the
|
||||||
<info>--em</info> option:
|
<info>--em</info> option:
|
||||||
|
|
||||||
<info>./app/console doctrine:mapping:info --em=default</info>
|
<info>php app/console doctrine:mapping:info --em=default</info>
|
||||||
EOT
|
EOT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -36,12 +36,12 @@ class ClearMetadataCacheDoctrineCommand extends MetadataCommand
|
|||||||
The <info>doctrine:cache:clear-metadata</info> command clears all metadata
|
The <info>doctrine:cache:clear-metadata</info> command clears all metadata
|
||||||
cache for the default entity manager:
|
cache for the default entity manager:
|
||||||
|
|
||||||
<info>./app/console doctrine:cache:clear-metadata</info>
|
<info>php app/console doctrine:cache:clear-metadata</info>
|
||||||
|
|
||||||
You can also optionally specify the <comment>--em</comment> option to specify
|
You can also optionally specify the <comment>--em</comment> option to specify
|
||||||
which entity manager to clear the cache for:
|
which entity manager to clear the cache for:
|
||||||
|
|
||||||
<info>./app/console doctrine:cache:clear-metadata --em=default</info>
|
<info>php app/console doctrine:cache:clear-metadata --em=default</info>
|
||||||
EOT
|
EOT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -36,12 +36,12 @@ class ClearQueryCacheDoctrineCommand extends QueryCommand
|
|||||||
The <info>doctrine:cache:clear-query</info> command clears all query cache for
|
The <info>doctrine:cache:clear-query</info> command clears all query cache for
|
||||||
the default entity manager:
|
the default entity manager:
|
||||||
|
|
||||||
<info>./app/console doctrine:cache:clear-query</info>
|
<info>php app/console doctrine:cache:clear-query</info>
|
||||||
|
|
||||||
You can also optionally specify the <comment>--em</comment> option to specify
|
You can also optionally specify the <comment>--em</comment> option to specify
|
||||||
which entity manager to clear the cache for:
|
which entity manager to clear the cache for:
|
||||||
|
|
||||||
<info>./app/console doctrine:cache:clear-query --em=default</info>
|
<info>php app/console doctrine:cache:clear-query --em=default</info>
|
||||||
EOT
|
EOT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -36,27 +36,27 @@ class ClearResultCacheDoctrineCommand extends ResultCommand
|
|||||||
The <info>doctrine:cache:clear-result</info> command clears all result cache
|
The <info>doctrine:cache:clear-result</info> command clears all result cache
|
||||||
for the default entity manager:
|
for the default entity manager:
|
||||||
|
|
||||||
<info>./app/console doctrine:cache:clear-result</info>
|
<info>php app/console doctrine:cache:clear-result</info>
|
||||||
|
|
||||||
You can also optionally specify the <comment>--em</comment> option to specify
|
You can also optionally specify the <comment>--em</comment> option to specify
|
||||||
which entity manager to clear the cache for:
|
which entity manager to clear the cache for:
|
||||||
|
|
||||||
<info>./app/console doctrine:cache:clear-result --em=default</info>
|
<info>php app/console doctrine:cache:clear-result --em=default</info>
|
||||||
|
|
||||||
If you don't want to clear all result cache you can specify some additional
|
If you don't want to clear all result cache you can specify some additional
|
||||||
options to control what cache is deleted:
|
options to control what cache is deleted:
|
||||||
|
|
||||||
<info>./app/console doctrine:cache:clear-result --id=cache_key</info>
|
<info>php app/console doctrine:cache:clear-result --id=cache_key</info>
|
||||||
|
|
||||||
Or you can specify a <comment>--regex</comment> to delete cache entries that
|
Or you can specify a <comment>--regex</comment> to delete cache entries that
|
||||||
match it:
|
match it:
|
||||||
|
|
||||||
<info>./app/console doctrine:cache:clear-result --regex="user_(.*)"</info>
|
<info>php app/console doctrine:cache:clear-result --regex="user_(.*)"</info>
|
||||||
|
|
||||||
You can also specify a <comment>--prefix</comment> or
|
You can also specify a <comment>--prefix</comment> or
|
||||||
<comment>--suffix</comment> to delete cache entries for:
|
<comment>--suffix</comment> to delete cache entries for:
|
||||||
|
|
||||||
<info>./app/console doctrine:cache:clear-result --prefix="user_" --suffix="_frontend"</info>
|
<info>php app/console doctrine:cache:clear-result --prefix="user_" --suffix="_frontend"</info>
|
||||||
EOT
|
EOT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ class ConvertMappingDoctrineCommand extends ConvertMappingCommand
|
|||||||
The <info>doctrine:mapping:convert</info> command converts mapping information
|
The <info>doctrine:mapping:convert</info> command converts mapping information
|
||||||
between supported formats:
|
between supported formats:
|
||||||
|
|
||||||
<info>./app/console doctrine:mapping:convert xml /path/to/output</info>
|
<info>php app/console doctrine:mapping:convert xml /path/to/output</info>
|
||||||
EOT
|
EOT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -39,15 +39,15 @@ class CreateSchemaDoctrineCommand extends CreateCommand
|
|||||||
The <info>doctrine:schema:create</info> command executes the SQL needed to
|
The <info>doctrine:schema:create</info> command executes the SQL needed to
|
||||||
generate the database schema for the default entity manager:
|
generate the database schema for the default entity manager:
|
||||||
|
|
||||||
<info>./app/console doctrine:schema:create</info>
|
<info>php app/console doctrine:schema:create</info>
|
||||||
|
|
||||||
You can also generate the database schema for a specific entity manager:
|
You can also generate the database schema for a specific entity manager:
|
||||||
|
|
||||||
<info>./app/console doctrine:schema:create --em=default</info>
|
<info>php app/console doctrine:schema:create --em=default</info>
|
||||||
|
|
||||||
Finally, instead of executing the SQL, you can output the SQL:
|
Finally, instead of executing the SQL, you can output the SQL:
|
||||||
|
|
||||||
<info>./app/console doctrine:schema:create --dump-sql</info>
|
<info>php app/console doctrine:schema:create --dump-sql</info>
|
||||||
EOT
|
EOT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -38,16 +38,16 @@ class DropSchemaDoctrineCommand extends DropCommand
|
|||||||
The <info>doctrine:schema:drop</info> command generates the SQL needed to
|
The <info>doctrine:schema:drop</info> command generates the SQL needed to
|
||||||
drop the database schema of the default entity manager:
|
drop the database schema of the default entity manager:
|
||||||
|
|
||||||
<info>./app/console doctrine:schema:drop --dump-sql</info>
|
<info>php app/console doctrine:schema:drop --dump-sql</info>
|
||||||
|
|
||||||
Alternatively, you can execute the generated queries:
|
Alternatively, you can execute the generated queries:
|
||||||
|
|
||||||
<info>./app/console doctrine:schema:drop --force</info>
|
<info>php app/console doctrine:schema:drop --force</info>
|
||||||
|
|
||||||
You can also optionally specify the name of a entity manager to drop the
|
You can also optionally specify the name of a entity manager to drop the
|
||||||
schema for:
|
schema for:
|
||||||
|
|
||||||
<info>./app/console doctrine:schema:drop --em=default</info>
|
<info>php app/console doctrine:schema:drop --em=default</info>
|
||||||
EOT
|
EOT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -37,12 +37,12 @@ class EnsureProductionSettingsDoctrineCommand extends EnsureProductionSettingsCo
|
|||||||
The <info>doctrine:ensure-production-settings</info> command ensures that
|
The <info>doctrine:ensure-production-settings</info> command ensures that
|
||||||
Doctrine is properly configured for a production environment.:
|
Doctrine is properly configured for a production environment.:
|
||||||
|
|
||||||
<info>./app/console doctrine:ensure-production-settings</info>
|
<info>php app/console doctrine:ensure-production-settings</info>
|
||||||
|
|
||||||
You can also optionally specify the <comment>--em</comment> option to specify
|
You can also optionally specify the <comment>--em</comment> option to specify
|
||||||
which entity manager to use:
|
which entity manager to use:
|
||||||
|
|
||||||
<info>./app/console doctrine:ensure-production-settings --em=default</info>
|
<info>php app/console doctrine:ensure-production-settings --em=default</info>
|
||||||
EOT
|
EOT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -37,17 +37,17 @@ class RunDqlDoctrineCommand extends RunDqlCommand
|
|||||||
The <info>doctrine:query:dql</info> command executes the given DQL query and
|
The <info>doctrine:query:dql</info> command executes the given DQL query and
|
||||||
outputs the results:
|
outputs the results:
|
||||||
|
|
||||||
<info>./app/console doctrine:query:dql "SELECT u FROM UserBundle:User u"</info>
|
<info>php app/console doctrine:query:dql "SELECT u FROM UserBundle:User u"</info>
|
||||||
|
|
||||||
You can also optional specify some additional options like what type of
|
You can also optional specify some additional options like what type of
|
||||||
hydration to use when executing the query:
|
hydration to use when executing the query:
|
||||||
|
|
||||||
<info>./app/console doctrine:query:dql "SELECT u FROM UserBundle:User u" --hydrate=array</info>
|
<info>php app/console doctrine:query:dql "SELECT u FROM UserBundle:User u" --hydrate=array</info>
|
||||||
|
|
||||||
Additionally you can specify the first result and maximum amount of results to
|
Additionally you can specify the first result and maximum amount of results to
|
||||||
show:
|
show:
|
||||||
|
|
||||||
<info>./app/console doctrine:query:dql "SELECT u FROM UserBundle:User u" --first-result=0 --max-result=30</info>
|
<info>php app/console doctrine:query:dql "SELECT u FROM UserBundle:User u" --first-result=0 --max-result=30</info>
|
||||||
EOT
|
EOT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ class RunSqlDoctrineCommand extends RunSqlCommand
|
|||||||
The <info>doctrine:query:sql</info> command executes the given DQL query and
|
The <info>doctrine:query:sql</info> command executes the given DQL query and
|
||||||
outputs the results:
|
outputs the results:
|
||||||
|
|
||||||
<info>./app/console doctrine:query:sql "SELECT * from user"</info>
|
<info>php app/console doctrine:query:sql "SELECT * from user"</info>
|
||||||
EOT
|
EOT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -43,15 +43,15 @@ default entity manager.
|
|||||||
For example, if you add metadata for a new column to an entity, this command
|
For example, if you add metadata for a new column to an entity, this command
|
||||||
would generate and output the SQL needed to add the new column to the database:
|
would generate and output the SQL needed to add the new column to the database:
|
||||||
|
|
||||||
<info>./app/console doctrine:schema:update --dump-sql</info>
|
<info>php app/console doctrine:schema:update --dump-sql</info>
|
||||||
|
|
||||||
Alternatively, you can execute the generated queries:
|
Alternatively, you can execute the generated queries:
|
||||||
|
|
||||||
<info>./app/console doctrine:schema:update --force</info>
|
<info>php app/console doctrine:schema:update --force</info>
|
||||||
|
|
||||||
You can also update the database schema for a specific entity manager:
|
You can also update the database schema for a specific entity manager:
|
||||||
|
|
||||||
<info>./app/console doctrine:schema:update --em=default</info>
|
<info>php app/console doctrine:schema:update --em=default</info>
|
||||||
EOT
|
EOT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user