Download the PHP package realodix/readtime without Composer

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

Read time

PHPVersion Build Status GitHub license

📚 Medium's like reading time estimation, based on Medium's read time formula.

Sites like Medium.com have popularized the concept of giving users an estimate for the amount of time it will take them to read the content. With this convenience in mind, ReadTime gives PHP developers the same tool for their readable content. It's a simple feature that will give a nice touch to your PHP application.

Features

Reference

Installation

You can install the package via composer:

Quick start

Here is an example of the most basic usage:

You may also pass several arguments to the constructor if you wish to change settings on the fly:

The ReadTime class is able to accept a string of content or a array (flat or multidimensional) of multiple pieces of content. This may come in handy if you are attempting to display the total read time of body content along with sidebar content.

For example:

:exclamation: Named arguments are not covered by Realodix Readtime backwards compatibility guidelines. We may choose to rename function arguments when necessary in order to improve codebase. Therefore, using named arguments when calling methods should be done cautiously and with the understanding that the parameter names may change in the future.

Methods

get()

Retrieve the read time.

setTranslation(array $translations)

Manually set the translation text for the class to use. If no key is passed it will default to the English counterpart. A complete translation array will contain the following:

toArray()

Get the contents and settings of the class as an array.

toJson()

Get the contents and settings of the class as a JSON string.

Variable Description
duration Humanized actualDuration for the input
actual_duration Actual duration of the input (in minutes)
total_words Number of words in the input
total_words_cjk Chinese / Japanese / Korean language characters count
total_images Number of images in input
word_time Read time of the words in the input (in minutes)
word_time_cjk Read time of the Chinese / Japanese / Korean in the input (in minutes)
image_time Read time of the images in the input (in minutes)

Contributing

Thank you for your interest in ReadTime. Please check out our contributing guide.

License

This package is licensed using the MIT License.


All versions of readtime with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/collections Version ^10.0 || ^11.0
symfony/options-resolver Version ^6.1 || ^7.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 realodix/readtime contains the following files

Loading the files please wait ....