Download the PHP package jkphl/edropub without Composer

On this page you can find all versions of the php package jkphl/edropub. 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 edropub

edropub

is a PHP command line script that establishes a simple publishing workflow between Editorially and Leanpub, using Dropbox as an intermediate / exchange platform.

Involved platforms

Editiorially is an excellent online editor with a focus on collaborative writing, using Markdown as it's primary format and supporting export to Dropbox.

Leanpub is a publishing and distribution platform for ebooks that also uses Markdown as source format and supports synchronizing with Dropbox.

Unfortunately, neither Editorially nor Dropbox have support for webhooks or another kind of active triggers at the moment, so an external polling mechanism has to be employed in order to detect and process changes of your Markdown files. This is where edropub jumps in. It may be installed on any external server and e.g. called periodically by a cronjob. It processes modifications of your Markdown files and can trigger the preview creation or publication of your Leanpub book.

Requirements

edropub uses the Dropbox SDK for PHP 5.3+, which implies the following requirements:

Installation

To install edropub, change to a directory or your liking and clone the GitHub repository:

This will install edropub into the subdirectory edropub. To install edropub's dependencies, simply use Composer:

Setup / configuration

To get the publishing workflow running, you have to fulfill some prerequisites:

Dropbox

First of all, create yourself a Dropbox account to be used for the publishing workflow. I recommend using a dedicated account for each book you want to publish (each with a dedicated email address).

Next, visit the Dropbox App Console and create a Dropbox API app. Make sure your app

Finally, I recommend giving your app the name edropub to avoid confusion. After the app has been created, you will be provided with an App key and an App secret in your app's settings tab. You will need them later to configure edropub.

Editorially

Also for Editiorially, I recommend creating a dedicated account (simply use the same email address as you did for Dropbox). Switch to the Publishing tab in your account settings and link the account to the Dropbox you created earlier. This way, you will be able to publish your documents to Dropbox from within the online editor.

Leanpub

Sign up with Leanpub and create a new book. You will have to enter an URL path to your book. This string is also referred to as the book's slug. You will need it later for configuring edropub's access settings.

In the book's Settings tab, select the Writing sub menu and activate the Dropbox synchronization there. You will get an email asking you to accept the invitation for a Dropbox folder. Obviously, you would accept it. ;)

Finally, switch to your Leanpub Dashboard and select the Account tab. At the bottom of the page, activate the Leanpub API. You will get an API key, which you will again need for configuring edropub's access settings.

First run

Before you can run edropub for the first time, you need to configure it and complete it's setup. Copy the file config/config.dist.json to config/config.json and fill in your Dropbox API key and secret there. The file should look something like this:

In the next step you have to create a Dropbox access token. Change to your installation directory and run edropub for the first time:

You will be asked to open a specific URL (using your browser) and confirm that edropub may access your Dropbox. Just follow the instructions on the screen.

Access configuration

As a result, the file config/access.json will be written. It looks something like this:

These are the possible options inside this configuration file:

Key Value
access_token Access token returned by the above process
editorially_prefix The Dropbox path Edititorially is exporting your Markdown files to. Currently, this is always /Apps/Editorially
leanpub_book_slug This is your Leanpub book's URL path
leanpub_api_key This is your Leanpub API key
leanpub_trigger edropub can automatically trigger the preview creation or publication of your Leanpub book in case any Markdown changes are detected. Use preview or publish as value, otherwise leave this option empty (or omit it altogether)

Please fill in your leanpub_book_slug and leanpub_api_key and optionally specify leanpub_trigger according to your needs.

Running edropub

As soon as you have finished configuring the access parameters, you may use edropub by calling it on the command line:

edropub utilizes the Dropbox delta API to only process changes to your Dropbox that have occured since the last call. You may, however, force edropub to start from scratch and reprocess all your Markdown files by passing a reset as an argument to the command:

A crontab entry for calling edropub every 15 minutes could e.g. look like this:

Known problems

At the moment, edropub only supports exactly one book to be processed. You will need to have a separate edropub installation / configuration for each book you want to publish.

Legal

Copyright © 2014 Joschi Kuphal @jkphl

edropub is licensed under the terms of the MIT license.


All versions of edropub with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
dropbox/dropbox-sdk Version 1.1.*
michelf/php-markdown Version >=1.4.0
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 jkphl/edropub contains the following files

Loading the files please wait ....