2017 © Pedro Peláez
 

symfony-bundle download-bundle

This bundle provides download utilities for symfony2

image

desarrolla2/download-bundle

This bundle provides download utilities for symfony2

  • Friday, June 29, 2018
  • by desarrolla2
  • Repository
  • 1 Watchers
  • 2 Stars
  • 473 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 63 % Grown

The README.md

Download Bundle

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., (*1)

The bundle works using ssh connections so it is necessary that you have configured to connect through a public key., (*2)

Disclaimer: This bundle works only for environments with linux., (*3)

Installation

Download the Bundle., (*4)

composer require --dev "desarrolla2/download-bundle"

Enable the Bundle, (*5)

// 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, (*6)

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., (*7)

php bin/console downloader:download

This is what you will see in your command line., (*8)

screenshot, (*9)

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., (*10)

php bin/console downloader:load

Select from available dates., (*11)

screenshot, (*12)

This is what you will see in your command line., (*13)

screenshot, (*14)

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, (*15)

php bin/console downloader:delete:old

Contact

You can contact with me on @desarrolla2., (*16)

The Versions

29/06 2018

1.0.6

1.0.6.0

This bundle provides download utilities for symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel González Cerviño

26/06 2018

dev-master

9999999-dev

This bundle provides download utilities for symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel González Cerviño

26/06 2018

1.0.5

1.0.5.0

This bundle provides download utilities for symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel González Cerviño

23/05 2018

1.0.4

1.0.4.0

This bundle provides download utilities for symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel González Cerviño

16/04 2018

1.0.2

1.0.2.0

This bundle provides download utilities for symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel González Cerviño

16/04 2018

1.0.3

1.0.3.0

This bundle provides download utilities for symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel González Cerviño

16/04 2018

1.0.1

1.0.1.0

This bundle provides download utilities for symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel González Cerviño

05/04 2018

1.0.0

1.0.0.0

This bundle provides download utilities for symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel González Cerviño

31/03 2018

0.0.1

0.0.1.0

This bundle provides download utilities for symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel González Cerviño