sourcebroker/deployer-typo3-media 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sourcebroker/deployer-typo3-media

最新稳定版本:1.0.0

Composer 安装命令:

composer require sourcebroker/deployer-typo3-media

包简介

Media sync for TYPO3 with deployer-extended-media.

README 文档

README

Latest Stable Version License: MIT

What does it do?

This package allows to sync media between instances using host data stored in deployer configuration.

It allows to copy files to your local instance, copy files between instances, but also symlink files instead of copy to save disk space (if the staging instance is at the same server as production).

This package only extends sourcebroker/deployer-extended-media with settings specific for TYPO3 CMS.

Installation

  1. Install package with composer:

    composer require sourcebroker/deployer-typo3-media 
  2. Put the following lines at the beginning of your deploy.php:

    require_once(__DIR__ . '/vendor/autoload.php'); new \SourceBroker\DeployerLoader\Loader([ ['get' => 'sourcebroker/deployer-typo3-media'], ]);
  3. Create a .env file (or .env.local) in your project root. The .env (or .env.local) file should be out of git because you need to store there information about instance name in var INSTANCE. The INSTANCE value must correspond to host() name.

    For the following real, example configuration:

    <?php namespace Deployer; require_once(__DIR__ . '/vendor/autoload.php'); new \SourceBroker\DeployerLoader\Loader([ ['get' => 'sourcebroker/deployer-typo3-media'], ]); host('production') ->setHostname('vm-dev.example.com') ->setRemoteUser('deploy') ->set('bin/php', '/usr/bin/php8.4') ->set('deploy_path', '~/t3base13/production'); host('staging') ->setHostname('vm-dev.example.com') ->setRemoteUser('deploy') ->set('bin/php', '/usr/bin/php8.4') ->set('deploy_path', '~/t3base13/staging');

    you would need to create file .env (or .env.local) with the following content:

    • INSTANCE=production at host defined by host('production')
    • INSTANCE=staging at host defined by host('staging')
    • INSTANCE=local at your local environment (laptop)

    As an alternative you can also not create any env file but make sure that the env variable INSTANCE exists in the system at hosts defined in deployer (and also at your local host).

TYPO3 sync media

TYPO3 sync folder is fileadmin with exclusion of _processed_ folder.

set('media', function () { return [ 'filter' => [ '+ /' . get('web_path'), '+ /' . get('web_path') . 'fileadmin/', '- /' . get('web_path') . 'fileadmin/_processed_/*', '+ /' . get('web_path') . 'fileadmin/**', '- *' ] ]; });

Synchronizing media

The commands for synchronizing media for the example configuration above would be:

  • For syncing media from production to local instance (usually your laptop):

    dep media:pull production 
  • For syncing media from production to staging instance:

    dep media:copy production --options=target:staging 
  • For syncing media from production to staging, creating symlinks to each file in the shared folder if both instances are at the same server (saves disk space):

    dep media:link production --options=target:staging 
  • For syncing media from local to staging (use with care - generally not recommended):

    dep media:push staging 
  • For syncing media from local to production (use with care! - generally strongly not recommended):

    dep media:push production 

For more options and ways to extend the sync process, visit sourcebroker/deployer-extended-media.

Changelog

See CHANGELOG.rst

统计信息

  • 总下载量: 8.14k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04