Download the PHP package rokka/kirby without Composer

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

Kirby Rokka

rokka is digital image processing done right. Store, render and deliver images. Easy and blazingly fast. This plugin automatically uploads your pictures to rokka and delivers them in the right format, as light and as fast as possible. And you only pay what you use, no upfront and fixed costs.

Free account plans are available. Just install the plugin, register and use it.

WARNING

This is still beta software. We use this for our Liip company webpage, so it's somehow battle tested. But there's still room for improvements and some behind the scene code will change, the kirby API will stay stable, hopefully. And input is always welcome.

Requirements

Installation

Composer install

The recommended way

Git Submodule

Copy and Paste

  1. Download the contents of this repository as ZIP-file.
  2. Rename the extracted folder to rokka and copy it into the site/plugins/ directory in your Kirby project.
  3. composer require rokka/client

Usage

In your site/config.php activate the plugin and set the ROKKA API key .

The following is also recommended for shorter, nicer image URLS (see below in "Defining Stacks"):

After having added that, you have to call https://yourkirbysite.com/_rokka/create-stacks (and be logged in) to create the actual stacks on the rokka server.

The plugin adds a $myFile->rokkaCropUrl($width, $height, $format = "jpg"), $myFile->rokkaResizeUrl($width, $height, $format = "jpg") and a $myFile->rokkaOriginalSizeUrl($format="jpg") function to $file objects.

You can use them like the following in your templates:

There's also $myFile->rokka($stackname, $extension) for returning an html img tag with using a stack and $myFile->rokkaGetHash() for getting the rokka hash of an image.

Defining stacks

Rokka has a concept of stacks, which allow to have nicer URLs.

You can configure some stacks with the rokka.kirby.stacks configure option. If you for example use certain sizes a lot, you should use a stack. For example, if you do $myFile->rokkaCropUrl(200,200) and $myFile->rokkaResizeUrl(300,300), then define a stack with

The value of the array (in this example www_thumbnail) is the used stack name. It can be an ascii text, you can use there whatever you want.

The noop, crop and resize and raw keys have a special meaning and you should define them like in the example above, but you can change the name of the actual stacks

After you defined your stacks, open the URL https://yourkirbysite.com/_rokka/create-stacks, after you logged in into the Panel. This will create your stacks on the Rokka server. A panel option for this will come one day. You only have to do this once, but whenever you change some of the stack definitions.

You can also set stack options for those stacks with eg.

And if you want different settings for retina screens you can add an 'options-retina' key

All available Stack options can be found on the rokka documentation.

Retina images

To be more documented.

Get html attribute snippets with Rokka::getSrcAttributes($url) Rokka::getBackgroundImageStyle($url) for srcset enabled tags with retina resolutions.

kirbytext

This plugin overwrites the kirbytext image tag and serves pictures from rokka if that is used.

Disclaimer

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.

License

MIT


All versions of kirby with dependencies

PHP Build Version
Package Version
Requires rokka/client Version ^1.14.0
getkirby/cms Version ^3.6|^4
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 rokka/kirby contains the following files

Loading the files please wait ....