desarrolla2/download-bundle
最新稳定版本:1.10.0
Composer 安装命令:
composer require desarrolla2/download-bundle
包简介
This bundle provides download utilities for symfony2
README 文档
README
This bundle allows you to download a database and folders associated with the project from remote host to local machine. It is the easiest and easiest way to have the same production data in your development environment.
The bundle works using ssh connections so it is necessary that you have configured to connect through a public key.
Disclaimer: This bundle works only for environments with linux.
Installation
Download the Bundle.
composer require --dev "desarrolla2/download-bundle"
Enable the Bundle
// app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { // enable it only for dev environment if (in_array($this->getEnvironment(), ['dev'], true)) { $bundles[] = new Desarrolla2\DownloadBundle\DownloadBundle(); } // ... } // ... }
Configuration
You need put something like this in your config_dev.yml
download: user: 'deploy_user' host: 'production_host_or_ip' # optional parameter. use it if you want customize max proccess time timeout: 300 database: # local directory to save databases directory: '%kernel.root_dir%/../var/data/databases' # optional parameter. use it for tables that you just want to download the structure, not data only_structure: - 'mail_history' remote: host: 'production_database_host' name: 'production_database_name' user: 'production_database_user' password: 'production_database_password' local: host: '%database_host%' name: '%database_name%' user: '%database_user%' password: '%database_password%' # optional parameter. define max number of database files to keep on local directory max_local_db: 0 # some directories that you want download. directories: web_uploads: remote: '/path/to/project/web/uploads' local: '%kernel.root_dir%/../web' # you can exclude some directories from there exclude: - 'cache' var_data: remote: '/path/to/project/var/data' local: '%kernel.root_dir%/../var' exclude: - 'spool'
Usage
Download
When you execute this command, both the database and the directories are downloaded from the remote environment.
php bin/console downloader:download
This is what you will see in your command line.
Load
Maybe you want to put your local database in a previous state. This bundle keeps a copy of every download you have made, so going back to one of these states is very easy.
php bin/console downloader:load
Select from available dates.
This is what you will see in your command line.
Delete old databases
Delete old databases from the local directory. The max number of files you can keep is defined by max_local_db parameter
php bin/console downloader:delete:old
Contact
You can contact with me on @desarrolla2.
desarrolla2/download-bundle 适用场景与选型建议
desarrolla2/download-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 25.4k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2018 年 03 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 desarrolla2/download-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 desarrolla2/download-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 25.4k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-03-28


