Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reintegrate InlineStyle; fix processing of stati images #13

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mosaico-php-backend.iml
backend-php/vendor
backend-php/composer.phar
*.orig
data
dist/**
templates/**
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ This is a PHP backend for Mosaico

Mosaico can be found at https://github.com/voidlabs/mosaico

First, install and set up Mosaico. Then install these files on top of the Mosaico installation.
## Getting started

1. install and set up Mosaico
2. copy `mosaico/dist` to your webserver, e.g. to `myserver/mosaico/dist`
3. copy `mosaico/templates` to youer webserver, e.g. to `myserver/mosaico/templates`
4. copy `index.html`, `editor.html`, `dl`, `img`, `upload` from this project on top of the Mosaico installation e.g. `myserver/mosaico/*`
5. run `php composer.phar install` if you want to use InlineStyle on your server. (See https://getcomposer.org/doc/00-intro.md how to get and use composer.)
You can do this offline and copy `vendor`to e.g. `myserver/mosaico`; The results of this installation are not checked in to this project.
6. adapt `config.php` according to your needs and copy it to e.g. `myserver/mosaico`
7. goto `{url of your server}/mosaico`


## Dependencies

Expand All @@ -14,6 +24,8 @@ You also do need to have Imagemagick support enabled in your PHP configuration.

This project also requires Premailer (http://premailer.dialect.ca/). Premailer is used to inline the CSS styles. If that service is ever taken down, we will have to find an alternate solution. Or, if you have an alternate solution that does not require dependencies on a web service, feel free to contribute!

Alternatively you can use InlineStyle (https://github.com/christiaan/InlineStyle) which runs ony your own server. You need to install it via composer. This is experimental, we will have to investigate if it works well with mosaico.

## New folders and files
```
backend-php/config.php
Expand Down
5 changes: 5 additions & 0 deletions backend-php/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"inlinestyle/inlinestyle": "^1.2"
}
}
119 changes: 119 additions & 0 deletions backend-php/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions backend-php/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,27 @@
BASE_DIR => dirname( dirname( $_SERVER[ "SCRIPT_FILENAME" ] ) ) . "/",

/* url to the uploads folder (relative to BASE_URL) */
UPLOADS_URL => "uploads/",
UPLOADS_URL => "data/uploads/",

/* local file system path to the uploads folder (relative to BASE_DIR) */
UPLOADS_DIR => "uploads/",
UPLOADS_DIR => "data/uploads/",

/* url to the static images folder (relative to BASE_URL) */
STATIC_URL => "uploads/static/",
STATIC_URL => "data/static/",

/* local file system path to the static images folder (relative to BASE_DIR) */
STATIC_DIR => "uploads/static/",
STATIC_DIR => "data/static/",

/* url to the thumbnail images folder (relative to BASE_URL */
THUMBNAILS_URL => "uploads/thumbnails/",
THUMBNAILS_URL => "data/thumbnails/",

/* local file system path to the thumbnail images folder (relative to BASE_DIR) */
THUMBNAILS_DIR => "uploads/thumbnails/",
THUMBNAILS_DIR => "data/thumbnails/",

/* width and height of generated thumbnails */
THUMBNAIL_WIDTH => 90,
THUMBNAIL_HEIGHT => 90
THUMBNAIL_HEIGHT => 90,

/* premailer */
PREMAILER => 'inlinestyle' // inlinestyle | premailer
];
Loading