• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

schickling/laravel-backup: Backup and restore database support for Laravel 4 app ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

schickling/laravel-backup

开源软件地址(OpenSource Url):

https://github.com/schickling/laravel-backup

开源编程语言(OpenSource Language):

PHP 100.0%

开源软件介绍(OpenSource Introduction):

laravel-backup Build Status Coverage Status Total Downloads

Backup and restore database support for Laravel 4 applications

Installation

  1. Run the following command:
$ composer require schickling/backup
  1. Add Schickling\Backup\BackupServiceProvider to your config/app.php

Usage

Backup

Creates a dump file in app/storage/dumps

$ php artisan db:backup
Use specific database
$ php artisan db:backup --database=mysql
Upload to AWS S3
$ php artisan db:backup --upload-s3 your-bucket

You can use the --keep-only-s3 option if you don't want to keep a local copy of the SQL dump.

Uses the aws/aws-sdk-php-laravel package which needs to be configured.

Restore

Paths are relative to the app/storage/dumps folder.

Restore a dump
$ php artisan db:restore dump.sql
List dumps
$ php artisan db:restore

Configuration

Since version 0.5.0 this package follows the recommended standard for configuration. In order to configure this package please run the following command:

$ php artisan config:publish schickling/backup

All settings are optional and have reasonable default values.

return array(

    // add a backup folder in the app/database/ or your dump folder
    'path' => app_path() . '/database/backup/',

    // add the path to the restore and backup command of mysql
    // this exemple is if your are using MAMP server on a mac
    // on windows: 'C:\\...\\mysql\\bin\\'
    // on linux: '/usr/bin/'
    // trailing slash is required
    'mysql' => array(
        'dump_command_path' => '/Applications/MAMP/Library/bin/',
        'restore_command_path' => '/Applications/MAMP/Library/bin/',
    ),

    // s3 settings
    's3' => array(
        'path'  => 'your/s3/dump/folder'
    )

    // Use GZIP compression
    'compress' => false,
);

Dependencies

...for MySQL

You need to have mysqldump installed. It's usually already installed with MySQL itself.

TODO - Upcoming Features

  • db:restore WRONGFILENAME more detailed error message
  • db:backup FILENAME set title for dump
  • S3
  • Upload as default
  • default bucket
  • More detailed folder checking (permission, existence, ...)
  • Some more ideas? Tell me!

Bitdeli Badge




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap