dlepera88-php/doctrine-prefixes
Composer 安装命令:
composer require dlepera88-php/doctrine-prefixes
包简介
Set database and/or table prefix.
README 文档
README
In some cases, we need to install a web application on shared hosts. On shared hosts, database names usually have a prefix, like cPanel, for example. Eg: etc_dbname.
So, I make this package. I hope this help u.
Basic Usage
<?php // $connectionOptions and $config set earlier /** @var $connectionOptions */ /** @var array $config */ $evm = new \Doctrine\Common\EventManager; // Database Prefix $database_prefix = new \DoctrinePrefixes\DatabasePrefix('db_'); $evm->addEventListener(\Doctrine\ORM\Events::loadClassMetadata, $database_prefix); // Table Prefix $table_prefix = new \DoctrinePrefixes\TablePrefix('prefix_'); $evm->addEventListener(\Doctrine\ORM\Events::loadClassMetadata, $table_prefix); $em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config, $evm);
统计信息
- 总下载量: 103
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-11-12