Download the PHP package markstory/geshi without Composer

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

Geshi Helper Plugin

This plugin provides a simple helper for adding GeSHi syntax highlighting to your application.

Installation

You can install the plugin with composer. Add the following your composer.json file:

After running composer update you should also remember to load the plugin. In your application's bootstrap.php file add the following:

Include the helper in your controller

The GeSHi helper offers three different ways to set GeSHi's features, which affects how you will include the helper in your controller.

If you want to use a geshi.php configuration file, or you want to set the features from within your view later, make sure to include without pre-configuration. Otherwise if you want to include the features' settings in your helper declaration, include with pre-configuration, both explained next.

Include without pre-configuration

To use the helper, include the helper in your View:

You will have to include a geshi.php configuration file or simply set the features later from your view.

Include with pre-configuration

To use the helper and specify specific GeSHi features, use the options form of including helpers:

Where the passed-in key is a GeSHi function name, and the passed-in values is an array of values for the function. Note that because GeSHi's own constants are out of scope at this point, you must quote named constants as shown above. GeshiHelper will resolve them for you.

Methods

highlight($html)

This method will scan HTML for <pre> blocks with a known lang attribute. This method is good for highlighting code samples in blog posts or wiki pages.

You can indicate the language of the text in a <pre> block by setting the lang attribute. For example:

Will be highlighted as php code.

highlightText($text, $language)

This method will highlight $text in $language. Use this method to highlight text in any language GeSHI supports.

highlightText($text, $language, $withStylesheet)

This is the same method as above, but if you specify true for the optional, third parameter then the helper will include the GeSHi-generated inline style sheet.

Configuration

As mentioned earlier there are three ways to set GeSHI's feature options.

Configure in your controller

Above "Include with pre-configuration" details how to do this. If you pre-configure in your controller, it's still possible to override these initial settings by configuring in your views.

Configure in your views

You can configure GeSHI's features from within your views by accessing the $features variable so: $this->Geshi->features = array(...), for example:

Note that GeSHI's constants are in scope here, and so quoting parameter values is optional from within views.

Setting the features in your views gives you great flexibility to use GeSHi with (for example) multiple languages served by the same controller.

Configure via a configuration file

You can configure the GeSHi instance by creating a geshi.php file in your /config directory. This file should contain the code/method calls to configure the $geshi object. An example can be found in tests/geshi.php

Note that the configuration file will be ignored completely if you have pre-configured the GeSHi instance in your $helpers or have set $this->Geshi->features in your view.

License

This code is licensed under the MIT License.


All versions of geshi with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
cakephp/cakephp Version ^5.0
cakephp/plugin-installer Version ^2.0.1
geshi/geshi Version ^1.0.9.1
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 markstory/geshi contains the following files

Loading the files please wait ....