Mautic

Mautic:开源营销自动化软件。(Mautic: Open Source Marketing Automation Software.)

Github stars Tracking Chart

Mautic简介

入门

建议将GitHub版本用于开发或测试。准备安装所有库的生产包在 https://www.mautic.org/download

有关如何使用Mautic的文档,请访问 https://www.mautic.org/docs

这是一个简单的3步安装过程。您需要确保已在计算机上提供 Composer ,因为这是一个开发版本,您需要使用 Composer 下载供应商包。

Step 1 Step 2 Step 3
下载存储库zip
将此zip解压缩到您的Web根目录。
运行以下命令以安装所需的软件包。
composer install
打开浏览器并通过Web安装程序完成安装。

卡住了? 没问题。查看常规问题排查,如果无法解决您的问题,请加入Maic社区寻求帮助和解答。

声明

只有在使用命令行时才建议从源代码安装。您将需要使用各种CLI命令来使Mautic正常工作并保持其正常工作。如果源和/或数据库模式与Mautic的发行版不同步,则发布更新程序可能无法正常运行,并且需要手动更新。对于生产,建议在 mautic.org/download 上提供预先打包的Mautic。

另请注意,标记版本之外的来源应被视为"alpha"并且可能包含错误,导致意外结果,数据损坏或丢失,不建议在生产环境中使用。使用风险由您自己承担。

要求

贡献者协议

通过参与此项目,您完全接受并同意贡献者协议

开发/构建流程要求

  1. Mautic使用Git作为版本控制系统。从 https://git-scm.com/ 下载并安装适用于您的操作系统的git。
  2. 安装服务器,PHP和MySql,以便能够在本地运行Mautic。简单的选项是 适用于您的操作系统的_AMP包
  3. 安装 Composer, PHP的依赖管理器。
  4. 安装 NPM.
  5. 安装 Grunt.

Mautic 要求

请参阅 Mautic要求

  1. See Mautic requirements.
  2. PHP模块:
    • 必需: zip, xml, mcrypt, imap, mailparse
    • 推荐: openssl, opcache / apcu / memcached
    • 建议用于开发:xdebug
  3. 建议的内存限制:最低256 MB用于测试,512 MB及更多用于生产。
  4. 在mySQL服务器上禁用 ONLY_FULL_GROUP_BY

安装

  1. 打开终端/控制台窗口。
  2. 将目录更改为服务器根目录(例如 cd /var/www 如果您的本地服务器根位于 /var/www).
  3. 克隆存储库 (git clone https://github.com/mautic/mautic.git)
  4. mautic 目录应出现在服务器根目录中。将目录更改为mautic目录 (cd mautic).
  5. 安装依赖项 (composer install).
  6. 在浏览器中访问Mautic (可能在 http://localhost/mautic) 并按照安装步骤进行操作。

保持最新

源文件

每次在初始设置/安装后通过新的 checkout、下载、git pull等更新Mautic的源代码;你需要清除缓存。为此,请运行以下命令:

$ cd /your/mautic/directory
$ php app/console cache:clear

(请注意,如果您通过开发环境访问 Mautic(通过 index_dev.php ),则需要从命令中添加 -env=dev。

供应商

运行 composer install 以确保安装新供应商和/或升级现有供应商。

数据库架构

在运行这些命令之前,请备份数据库。

如果从 已标记的版本更新为 标记版本,架构更改将包含在迁移文件中。要应用更改,请运行

$ php app/console doctrine:migrations:migrate

如果您要更新到最新的来源(请记住这是alpha),请先运行

$ php app/console doctrine:schema:update --dump-sql

这将列出 Doctrine 想要执行的查询以使模式保持最新(实际上不执行任何查询)。查看查询以确保不会对您的数据造成任何损害。如果您对查询有疑问,请在此处提交问题,我们会对其进行验证。

如果您对查询感到满意,请执行它们

$ php app/console doctrine:schema:update --force

您的架构现在应该与源代码保持同步。

开发环境

从 GitHub 下载的 Mautic 有开发环境。您可以通过在 Mautic URL 之后添加 index_dev.php 来访问它。例如:http://localhost/mautic/index_dev.php/s/。或者在CLI命令的情况下,将 -env=dev 属性添加到其中。

此开发环境将直接显示 PHP 错误,警告和通知作为输出,因此您无需打开日志即可查看它们。它还将加载例如没有缓存的翻译,因此您所做的每个更改都将在不清除的情况下显示。需要清除缓存的唯一更改是在 config.php 文件中。

对于像JS、CSS这样的资源,加载源文件而不是连接的缩小文件。这样,这些文件中的更改将在刷新时直接显示。如果您想要查看生产环境中的更改,则必须运行 app/console mautic:assets:generate 命令。

在许多情况下,CSS 文件是从 LESS 文件构建的。要编译 LESS 文件中的更改,请运行 grunt compile-less 命令。

测试

拉取请求测试

每个人都可以测试提交的功能和错误修复。无需编程技能。您所要做的就是按照以下步骤操作。

Mautic 核心的每一次变化都是通过 PR 发生的。每个 PR 必须有2个成功的测试才能合并到核心并在下一个版本中发布。测试 PR 是推动 Mautic 前进并亲自改善其质量和稳定性的好方法。

  1. 选择 PR to test.
  2. 阅读说明和测试步骤,进行测试。如果是错误修复,请按照步骤确保您可以重新创建问题。
  3. 使用开发环境(如上)进行测试。
  4. 申请PR
  5. 清除开发环境的缓存 (rm -rf app/cache/* or app/console cache:clear -e dev).
  6. 再次按照PR说明中的步骤查看结果是否如上所述。
  7. 写下关于测试如何进行的评论。 如果出现问题,请提供尽可能多的信息,包括错误日志消息。

自动化测试

Mautic使用 Codeception, PHPUnit, and Selenium 作为我们的测试工具套件。

PHPUnit

在执行单元测试之前,将 .env.dist 文件复制为 .env,然后更新以反映您的本地环境配置。

在不使用其他数据库设置 .env 文件的情况下运行功能测试将导致配置的数据库被覆盖。

运行整个测试套件:

bin/phpunit --bootstrap vendor/autoload.php --configuration app/phpunit.xml.dist

运行特定捆绑包的测试:

bin/phpunit --bootstrap vendor/autoload.php --configuration app/phpunit.xml.dist --filter EmailBundle

运行特定测试:

bin/phpunit --bootstrap vendor/autoload.php --configuration app/phpunit.xml.dist --filter "/::testVariantEmailWeightsAreAppropriateForMultipleContacts( .*)?$/" Mautic\EmailBundle\Tests\EmailModelTest app/bundles/EmailBundle/Tests/Model/EmailModelTest.php

Codeception/Selenium

如果您计划运行验收测试套件,则需要安装 Selenium Server Standalone 并在本地提供 Chrome WebDriver。

Mac OS

如果您使用的是 Mac 并使用 Homebrew,则可以通过运行 brew install selenium-server-standalone 来安装 Selenium。 您还需要下载最新的 Chrome WebDriver。 将 chromedriver 文件解压缩并移动到 /usr/local/Cellar/selenium-server-standalone/drivers/chromedriver。 安装 Selenium 并在指定位置使用 WebDriver 后,打开并修改 /usr/local/Cellar/selenium-server-standalone/3.5.3/homebrew.mxcl.selenium-server-standalone.plist 中的 plist 文件。在ProgramArguments下的 块中,在包含 -jar 的行之后添加以下内容

...
<string>-Dwebdriver.chrome.driver=/usr/local/Cellar/selenium-server-standalone/drivers/chromedriver</string>
...

完成后,您现在可以使用 brew services start selenium-server-standalone 启动 Selenium 服务器。

遵循Selenium服务器独立的标准安装过程。确保您拥有chrome驱动程序 可用,并使用以下命令启动服务器:

其他平台

遵循Selenium服务器独立的标准安装过程。 确保您具有可用的chrome驱动程序,并使用以下命令启动服务器:

java -jar -Dwebdriver.chrome.driver=/path/to/chromedriver /full/path/to/selenium-server-standalone.3.x.x.jar
执行测试
可以通过从项目根运行 bin/codecept 来执行所有测试套件。 (可选)您可以通过在运行命令之后添加其中一个单词来指定仅运行接受,功能或单元测试套件。

状态分析

Mautic在持续集成测试期间将 PHPSTAN 用于其某些部件。 如果您想在本地测试您的特定贡献,请使用 composer global require phpstan/phpstan-shim 全局安装 PHPSTAN。 Mautic 不能将 PHPSTAN 作为其 dev 依赖,因为它需要 PHP7+。 要对特定包运行分析,请运行 〜/.composer/vendor/phpstan/phpstan-shim/phpstan.phar analyze app/bundles/* Bundle

Overview

Name With Ownermautic/mautic
Primary LanguagePHP
Program languageJavaScript (Language Count: 8)
PlatformLinux, Mac, Windows
License:Other
Release Count165
Last Release Name5.0.4 (Posted on )
First Release Name1.0.0-beta (Posted on )
Created At2013-08-19 00:36:28
Pushed At2024-04-23 14:11:54
Last Commit At
Stargazers Count6.7k
Watchers Count303
Fork Count2.4k
Commits Count29.3k
Has Issues Enabled
Issues Count7076
Issue Open Count233
Pull Requests Count5060
Pull Requests Open Count260
Pull Requests Close Count1234
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Mautic Introduction

Mautic

Supported Versions

Please note that the release dates indicated with * below are estimations, no rights can be derived from them., Branch, Beta Release, Initial Release, Active Support Until, Security Support Until, --, --, --, --, --, 2.15, 27 Sep 2019, 8 Oct 2019, 8 Oct 2019, 8 Oct 2019, 2.16, 30 Jan 2020*, 13 Feb 2020*, 13 Feb 2020, June 2020? (TBD)**, 3.0, 27 Jan 2020*, 3 Feb 2020*, TBD, TBD

** = Security Support for 2.16 will only be provided for Mautic itself, not for core dependencies that are EOL like Symfony 2.8.

Getting Started

The GitHub version is recommended for development or testing. Production package ready for install with all the libraries is at https://www.mautic.org/download.

Documentation on how to use Mautic is available at https://www.mautic.org/docs.

This is a simple 3 step installation process. You'll want to make sure you already have Composer available on your computer as this is a development release and you'll need to use Composer to download the vendor packages.

Get stuck? No problem. Check out general troubleshooting and if it won't solve your issue join us at the Mautic community for help and answers.

Disclaimer

Installing from source is only recommended if you are comfortable using the command line. You'll be required to use various CLI commands to get Mautic working and to keep it working. If the source and/or database schema gets out of sync with Mautic's releases, the release updater may not work and will require manual updates. For production the pre-packaged Mautic available at mautic.org/download is recommended.

Also note that the source outside a tagged release should be considered "alpha" and may contain bugs, cause unexpected results, data corruption or loss, and is not recommended for use in a production environment. Use at your own risk.

Requirements

Contributor Agreement

By contributing to this project, you accept and agree to the Contributor Agreement in its entirety.

Development / Build process requirements

  1. Mautic uses Git as a version control system. Download and install git for your OS from https://git-scm.com/.
  2. Install a server, PHP and MySql to be able to run Mautic locally. Easy option is _AMP package for your OS.
  3. Install Composer, the dependency manager for PHP.
  4. Install NPM.
  5. Install Grunt.

Mautic requirements

  1. See Mautic requirements.
  2. PHP modules:
    • required: zip, xml, mcrypt, imap, mailparse
    • recommended: openssl, opcache / apcu / memcached
    • recommended for development: xdebug
  3. Recommended memory limit: minimally 256 MB for testing, 512 MB and more for production.
  4. Recommended MySQL defaults can be set by running the queries SET GLOBAL innodb_default_row_format=DYNAMIC; SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

Installation

  1. Open a Terminal/Console window.
  2. Change directory to the server root (i.e. cd /var/www if your local server root is at /var/www).
  3. Clone the repository (git clone https://github.com/mautic/mautic.git)
  4. The mautic directory should appear in the server root. Change directory to mautic directory (cd mautic).
  5. Install dependencies (composer install).
  6. Visit Mautic in a browser (probably at http://localhost/mautic) and follow installation steps.

Keeping Up-To-Date

Source Files

Each time you update Mautic's source after the initial setup/installation via a new checkout, download, git pull, etc; you will need to clear the cache. To do so, run the following command:

$ cd /your/mautic/directory
$ php app/console cache:clear

(Note that if you are accessing Mautic through the dev environment (via index_dev.php), you would need to add the --env=dev from the command).

Vendors

Run composer install to ensure new vendors are installed and/or existing upgraded.

Database Schema

Before running these commands, please make a backup of your database.

If updating from a tagged release to a tagged release, schema changes will be included in a migrations file. To apply the changes, run

$ php app/console doctrine:migrations:migrate

If you are updating to the latest source (remember this is alpha), first run

$ php app/console doctrine:schema:update --dump-sql

This will list out the queries Doctrine wants to execute in order to get the schema up-to-date (no queries are actually executed). Review the queries to ensure there is nothing detrimental to your data. If you have doubts about a query, submit an issue here and we'll verify it.

If you're satisfied with the queries, execute them with

$ php app/console doctrine:schema:update --force

Your schema should now be up-to-date with the source.

Development environment

Mautic downloaded from GitHub has the development environment. You can access it by adding index_dev.php after the Mautic URL. Eg. http://localhost/mautic/index_dev.php/s/. Or in case of CLI commands, add --env=dev attribute to it.

This development environment will display the PHP errors, warnings and notices directly as the output so you don't have to open the log to see them. It will also load for example translations without cache, so every change you make will be visible without clearing it. The only changes which require clearing the cache are in the config.php files.

In case of assets like JS, CSS, the source files are loaded instead of concatenated, minified files. This way the changes in those files will be directly visible on refresh. If you'd wanted to see the change in the production environment, you'd have to have run the app/console mautic:assets:generate command.

In many cases, the CSS files are built from LESS files. To compile the changes in the LESS files, run grunt compile-less command.

Testing

Pull Request Testing

Everyone can test submitted features and bug fixes. No programming skills are required. All you have to do is to follow the steps below.

Every change to Mautic core happens via PRs. Every PR must have 2 successful tests to be merged to the core and released in the next version. Testing a PR is a great way to move Mautic forward and personally improve its quality and stability.

  1. Select a PR to test.
  2. Read the description and steps to test. If it's a bug fix, follow the steps to ensure you can recreate the issue.
  3. Use the development environment (above) for testing.
  4. Apply the PR
  5. Clear cache for development environment (rm -rf app/cache/* or app/console cache:clear -e dev).
  6. Follow the steps from the PR description again to see if the result is as described.
  7. Write a comment about how the test went. If there is a problem, provide as much information as possible including error log messages.

Automated Testing

Mautic uses Codeception, PHPUnit, and Selenium
as our suite of testing tools.

PHPUnit

Before executing unit tests, copy the .env.dist file to .env then update to reflect your local environment
configuration.

Running functional tests without setting the .env file with a different database will result in the configured database being overwritten.

To run the entire test suite:

bin/phpunit --bootstrap vendor/autoload.php --configuration app/phpunit.xml.dist

To run tests for a specific bundle:

bin/phpunit --bootstrap vendor/autoload.php --configuration app/phpunit.xml.dist --filter EmailBundle

To run a specific test:

bin/phpunit --bootstrap vendor/autoload.php --configuration app/phpunit.xml.dist --filter "/::testVariantEmailWeightsAreAppropriateForMultipleContacts( .*)?$/" Mautic\EmailBundle\Tests\EmailModelTest app/bundles/EmailBundle/Tests/Model/EmailModelTest.php

Codeception/Selenium

If you plan on running the acceptance test suite, you'll need to have the Selenium Server Standalone installed and the
Chrome WebDriver available locally.

Mac OS

If you're on a Mac and you use Homebrew, you can install Selenium by running brew install selenium-server-standalone.
You'll also need to download the latest Chrome WebDriver.
Unzip and move the chromedriver file to /usr/local/Cellar/selenium-server-standalone/drivers/chromedriver.
Once you have Selenium installed and the WebDriver available at the specified location, open and modify the plist file found at /usr/local/Cellar/selenium-server-standalone/3.5.3/homebrew.mxcl.selenium-server-standalone.plist.
In the <dict><array> block under ProgramArguments, add the following after the line containing <string>-jar</string>"

...
<string>-Dwebdriver.chrome.driver=/usr/local/Cellar/selenium-server-standalone/drivers/chromedriver</string>
...

With that completed, you may now start the Selenium server using brew services start selenium-server-standalone.

Other Platforms

Follow the standard installation procedure for Selenium server standalone. Ensure that you have the chrome driver
available, and startup the server with the following command:

java -jar -Dwebdriver.chrome.driver=/path/to/chromedriver /full/path/to/selenium-server-standalone.3.x.x.jar
Executing Tests

All test suites can be executed by running bin/codecept run from the project root. Optionally, you can specify
running just the acceptance, functional, or unit test suites by adding one of those words after the run command.

Static Analysis

Mautic uses PHPSTAN for some of its parts during continuous integration tests. If you want to test your specific contribution locally, install PHPSTAN globally with composer global require phpstan/phpstan-shim. Mautic cannot have PHPSTAN as its dev dependency, because it requires PHP7+. To run analysis on a specific bundle, run ~/.composer/vendor/phpstan/phpstan-shim/phpstan.phar analyse app/bundles/*Bundle

FAQ and Contact Information

Marketing automation has historically been a difficult tool to implement in a business. The Mautic community is a rich environment for you to learn from others and share your knowledge as well. Open source means more than open code. Open source is providing equality for all and a chance to improve. If you have questions then the Mautic community can help provide the answers.

Ready to get started with the community? You can get more involved on the Mautic website. Or follow Mautic on social media just to stay current with what's happening!

Contact Info

Developers

We love testing our user interface on as many platforms as possible (even those browsers we prefer to not mention). In order to help us do this we use and recommend BrowserStack.

To the top