Download the PHP package tobimori/kirby-paparazzi without Composer

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

Kirby Paparazzi

A toolkit for programatically creating images with Kirby, by simply writing HTML, JS & CSS code. Under the hood, it uses Browsershot & Puppeteer.

NOTE

This is a work in progress plugin. API & usage may change at any time.

Prerequisites

Installation

Non-composer installation methods are not supported.

Usage

Currently, Paparazzi supports the following ways of creating images:

Content representations

1. Creating the template

For our image representation, let's create a file default.png.php in our /site/templates directory. This file contains the template that will later be rendered to an image by Puppeteer.

It works just like writing a normal HTML template.

Content representations use the same name as its HTML counterpart. This means, if we want to create an image for all project pages, our template name has to be project.png.php.

2. Creating the Paparazzi controller

Paparazzi uses controllers to inject its logic in your templates. Let's create a file with the same name as your template in our /site/controllers directory.

3. Adding content to the template

Now, let's add some content to our template. We can use all the Kirby variables & helpers just like in a normal template.

Our example template could look something like this:

4. Admire the result in your browser

We can now open our page in the browser, and simply add .png to the URL. This will render our template to an image.

5. Usage with kirby-seo (optional)

If you're using my kirby-seo plugin, and you want to use the image as Open Graph image, you can use the programmatic defaults feature for that.

  1. Create a page model, e.g. site/models/project.php. You can read more about Page models in the Kirby Guide.
  2. Add a metaDefaults() function that returns an array with the Open Graph image URL, like so:

Please note, that this will require kirby-seo v0.4.0 or higher.

Limitations

Using the PHPs built-in server

The built-in PHP server is by default not capable of accepting more than 1 request at once. If you're loading assets or images from your server, the request will time out as Puppeteer will never go into idle state. You'll have to use a proper webserver like Apache or Nginx in development for this, or set the PHP_CLI_SERVER_WORKERS environment variable to something bigger than 1.

Roadmap

This plugin is highly specific and mostly growing with my needs. New feature are usually only added when I need for my own projects. I’ll only consider working on funded feature requests. This doesn't mean the plugin is deprecated, it will be actively maintained.

Support

This plugin is provided free of charge & published under the permissive MIT License. If you use it in a commercial project, please consider to sponsor me on GitHub to support further development and continued maintenance of my plugins.

License

MIT License Copyright © 2023 Tobias Möritz


All versions of kirby-paparazzi with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2.0
getkirby/composer-installer Version ^1.2
spatie/browsershot Version ^4.1.3
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 tobimori/kirby-paparazzi contains the following files

Loading the files please wait ....