Add command for Doctrine proxy generating
[MAILPOET-2014]
This commit is contained in:
13
RoboFile.php
13
RoboFile.php
@ -310,6 +310,19 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
$this->say("Doctrine metadata generated to: $metadata_dir");
|
$this->say("Doctrine metadata generated to: $metadata_dir");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function doctrineGenerateProxies() {
|
||||||
|
$proxy_dir = \MailPoet\Doctrine\ConfigurationFactory::PROXY_DIR;
|
||||||
|
$this->_exec("rm -rf $proxy_dir");
|
||||||
|
|
||||||
|
// set ArrayCache for metadata to avoid reading & writing them on filesystem as a side effect
|
||||||
|
$entity_manager = $this->createDoctrineEntityManager();
|
||||||
|
$entity_manager->getMetadataFactory()->setCacheDriver(new \MailPoetVendor\Doctrine\Common\Cache\ArrayCache());
|
||||||
|
$entity_manager->getProxyFactory()->generateProxyClasses(
|
||||||
|
$entity_manager->getMetadataFactory()->getAllMetadata()
|
||||||
|
);
|
||||||
|
$this->say("Doctrine proxies generated to: $proxy_dir");
|
||||||
|
}
|
||||||
|
|
||||||
function qa() {
|
function qa() {
|
||||||
$collection = $this->collectionBuilder();
|
$collection = $this->collectionBuilder();
|
||||||
$collection->addCode([$this, 'qaLint']);
|
$collection->addCode([$this, 'qaLint']);
|
||||||
|
4
build.sh
4
build.sh
@ -31,6 +31,10 @@ echo '[BUILD] Building DI Container cache'
|
|||||||
echo '[BUILD] Generating Doctrine Metadata'
|
echo '[BUILD] Generating Doctrine Metadata'
|
||||||
./do doctrine:generate-metadata
|
./do doctrine:generate-metadata
|
||||||
|
|
||||||
|
# Generate Doctrine proxies
|
||||||
|
echo '[BUILD] Generating Doctrine Proxies'
|
||||||
|
./do doctrine:generate-proxies
|
||||||
|
|
||||||
# Backup dev libraries
|
# Backup dev libraries
|
||||||
echo '[BUILD] Backup dev dependencies'
|
echo '[BUILD] Backup dev dependencies'
|
||||||
if [ -d 'vendor' ]; then
|
if [ -d 'vendor' ]; then
|
||||||
|
Reference in New Issue
Block a user