Download the PHP package drands/deployer-sync without Composer

On this page you can find all versions of the php package drands/deployer-sync. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package deployer-sync

Deployer Sync

This package provides a set of commands to synchronize uploaded files and database between a remote server and your local machine using Deployer.

Installation

Install the package using Composer:

Add the following to your deploy.yml file:

You must also set the local_php_path variable with the path to your PHP executable on your local machine. For example:

Important: Before you can execute actions on the remote server, you must perform a deployment.

mysqldump and mysql connect with the app's mysql connection settings (host and port, or unix_socket). If they aren't in the PATH, set their paths with SYNC_MYSQLDUMP_PATH and SYNC_MYSQL_PATH (database.connections.mysql.dump_path is still honored for mysqldump).

Usage

Full sync files and database from remote server to local machine

Only export files and database from remote server and download to local machine

Full sync including S3 file clone (if your uploads disk is S3-compatible)

This is a shortcut for dep sync:prod-to-local -o s3=true — -o s3=true also works directly on sync:prod-to-local or sync:export-to-local if you'd rather not use the extra task.

Only import files and database from sync_export.zip

Only clone uploaded files from the production bucket to your local development prefix

Anonymizing personal data

sync:export never copies personal data as is: database/sync-schema.php (in your project, committed) declares, for every table, how its data is exported:

The export fails (in production, before dumping anything) if a table isn't declared, if a column of an anonymized table isn't declared, if a strategy is invalid, or if a table marked 'keep' has columns that look personal (judging by their names: email, phone, address, dni, iban, ip_address, notes...). Marking such a column 'keep' explicitly is allowed: it has to be a conscious decision.

Column strategies (NULL values always stay NULL):

Strategy Result
'keep' Original value
null NULL (nullable columns only)
'static:<value>' That literal value
'unique_email' user<primary key>@example.test, safe for UNIQUE indexes
'password' Bcrypt hash of password, so you can log in locally
'<formatter>' Any Faker formatter, e.g. 'name', 'phoneNumber', 'streetAddress'
'<formatter>:<arg>' Faker formatter with one argument, e.g. 'regexify:[0-9]{8}[A-Z]'
'App\\Sync\\MyAnonymizer' Class implementing Drands\DeployerSync\Anonymization\Anonymizer (e.g. for JSON columns)

Faker is seeded per row, so every export generates the same fake values. Its locale is app.faker_locale (override it with faker_locale in config/deployer-sync.php). Fake strings longer than the column are truncated.

Keeping it up to date

--fix guesses from column names, so review its suggestions (e.g. free-text columns it doesn't recognize stay 'keep'). It regenerates the file, so comments in it are lost. Both commands read the local database: run your migrations first.

Claude Code integration

In the local environment, the package installs these files into your project on install/update (more precisely, after package:discover, which Laravel runs after every composer install/update, or after the first artisan command if the package wasn't discovered yet). Review them in git status before committing:

Run php artisan sync:install-claude to install them manually (--force also overwrites the test).

Restoring your local admin after an import

The import replaces your local users with the anonymized production ones, so dep sync:import-from-local (and therefore dep sync:prod-to-local) then asks whether to create or update a local admin: by default it updates user 1, with the name, email and password pre-filled from your .env:

Fields left empty keep what the imported user has. With SYNC_ADMIN_ASK_DEFAULTS=false nothing that already has a value is asked: user 1 is updated with your .env values and you're only asked for the empty ones (typically the password, which is then typed hidden). If your admin users aren't App\Models\User with name/email/password, override local_admin in config/deployer-sync.php (only that key is needed):

The same runs without prompts with php artisan sync:local-admin (options: --create, --id=, --field=name=value). It refuses to run in production. To skip the question in Deployer, add set('sync_local_admin', false); to your deploy.php.

Large uploads, timeouts and MariaDB dumps

Excluding tables from the database dump

The dump only contains data, so any table that doesn't exist locally makes the import fail. Tables matching the exclude_tables patterns in config/deployer-sync.php are skipped (* wildcards allowed). By default this covers phpMyAdmin's configuration storage (pma__*). They don't need to be declared in database/sync-schema.php. For tables that exist locally, use 'exclude' in database/sync-schema.php instead.

Syncing uploaded files on S3-compatible storage (e.g. DigitalOcean Spaces)

sync:export/sync:export-to-local only handle files that live on local disk (storage/app) on the remote server. If your uploads disk is S3-compatible, those files never touch the server's local disk, so passing -o s3=true to sync:export-to-local (or sync:prod-to-local) makes it also pass --s3 to the remote sync:export call, which copies the files directly from the production bucket to a development bucket, server-side, in the same remote call (no data passes through your local machine or the deploy server's disk). Without -o s3=true, nothing S3-related runs. A standalone sync:clone-storage task/command is also available if you need to (re-)run just the file clone without a full export.

This requires:

sync:clone-storage mirrors production into your development prefix: unchanged files (matched by ETag) are skipped, and any file under your prefix that no longer exists in production is deleted, including files you may have uploaded manually while testing locally. It's safe and idempotent to run repeatedly.

If the configured uploads disk isn't S3-compatible, --s3 is a no-op and storage/app files continue to sync through the existing ZIP-based flow.


All versions of deployer-sync with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
illuminate/console Version ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0
fakerphp/faker Version ^1.9.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package drands/deployer-sync contains the following files

Loading the files please wait ...