Download the PHP package apharmony/jsharmony-cms-sdk-php without Composer

On this page you can find all versions of the php package apharmony/jsharmony-cms-sdk-php. 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 jsharmony-cms-sdk-php

jsharmony-cms-sdk-php

jsHarmony CMS SDK for PHP

Installation

Installation and integration instructions are available at jsHarmonyCMS.com

API Documentation

apHarmony\jsHarmonyCms\CmsRouter Class

apHarmony\jsHarmonyCms\CmsPage Class

apHarmony\jsHarmonyCms\CmsResponse Class

apHarmony\jsHarmonyCms\CmsPassthruResponse Class

apHarmony\jsHarmonyCms\CmsRedirect Class

jsHarmonyCmsEditor Class (Client JS)


apHarmony\jsHarmonyCms\CmsRouter Class


CmsRouter Constructor

Arguments

Example


Public Properties


CmsRouter->config

(array)

An associative array with the CmsRouter's config. Config parameters are defined in the Constructor above.


Public Methods


CmsRouter->serve

CmsRouter->serve(?string $url = null, array $options = [])

Main Entry Point - Serve CMS Content

Parameters

Returns

(mixed) Result of the onPage, on301, on302, onPassthru, on404, or onError handler, or TRUE if the return value is null or not defined.

Example


CmsRouter->getStandalone

CmsRouter->getStandalone(?string $url = null)

Main Entry Point - Get CMS Page Data for Standalone Integration

Parameters:

If page is opened from CMS Editor or Not Found, an empty CmsPage Object will be returned

Example


CmsRouter->getPlaceholder

CmsRouter->getPlaceholder()

Get Placeholder Page for Editor template rendering

Parameters:

N/A

Returns

(CmsPage) Placeholder Page

Example


CmsRouter->isInEditor

CmsRouter->isInEditor(?string $url = null)

Checks whether the page is in CMS Edit mode

Parameters

Returns

(bool) True if this page was opened from the CMS Editor

Example


CmsRouter->resolve

CmsRouter->resolve(?string $url = null, array $options = [])

Converts URL to CMS Content Path

Parameters

Returns

(string) CMS Content Path

Example


CmsRouter->route

CmsRouter->route(?string $url = null)

Run CMS router on the target URL

Parameters


CmsRouter->matchRedirect

CmsRouter->matchRedirect(?array $redirects, ?string $url)

Check if URL matches redirects and return first match

Parameters


CmsRouter->getRedirectData

CmsRouter->getRedirectData()

Get CMS Redirect Data

Requires config['redirect_listing_path'] to be defined

Returns

array|null JSON array of CMS redirects

Example


CmsRouter->getEditorScript

CmsRouter->getEditorScript(?string $url = null)

Generate script for CMS Editor

Parameters

If the page was not launched from the CMS Editor, an empty string will be returned

Security

The querystring jshcms_url parameter is validated against config['cms_server_urls']

If the CMS Server is not found in config['cms_server_urls'], an empty string will be returned

Example


CmsRouter->serveFile

CmsRouter->serveFile($filePath)

Serves a file to the user

Parameters

Example


CmsRouter->redirect301

CmsRouter->redirect301(string $url)

Perform 301 Redirect

Parameters

Example


CmsRouter->redirect302

CmsRouter->redirect302(string $url)

Perform 302 Redirect

Parameters

Example


CmsRouter->passthru

CmsRouter->passthru(string $url)

Perform Passthru Request

Parameters

Returns

(CmsPassthruResponse) Response

Call the CmsPassthruResponse->serve() method to serve the page

Example


CmsRouter->generate404

CmsRouter->generate404()

Generate a 404 Not Found Page

Parameters

N/A

Example


CmsRouter->generateError

CmsRouter->generateError($err)

Generate a 500 Error Page

Parameters

Example


CmsRouter->getPage

CmsRouter->getPage(?string $url = null, array $options = [])

Get CMS Page from URL

Parameters

Returns

(CmsPage|null) Page data, or null if page was not found

Example


CmsRouter->getPageFromFile

CmsRouter->getPageFromFile(string $filePath)

Get CMS Page from file path

Parameters


CmsRouter->getPageFileName

CmsRouter->getPageFileName(?string $url = null, array $options = [])

Get CMS Page File

Parameters

Returns

(string) Full path to CMS content file

CmsPageNotFoundException exception is thrown if page is not found

Example


CmsRouter->getFile

CmsRouter->getFile($filePath)

Reads a file from the file system

Parameters

Returns

(string) File content

Example


CmsRouter->getJsonFile

CmsRouter->getJsonFile($filePath)

Reads and parses a JSON file

Parameters

Returns

(array|null) JSON content, or null if file was not found or an error occurred

Example


apHarmony\jsHarmonyCms\CmsPage Class


Public Properties


CmsPage->seo

(CmsPageSeo)

A class instance with the SEO-related properties for a page


CmsPage->seo->title

(string)

Page content for the header <title> tag


CmsPage->seo->keywords

(string)

Page content for the header <meta name="keywords" content="..." /> tag


CmsPage->seo->metadesc

(string)

Page content for the header <meta name="description" content="..." /> tag


CmsPage->seo->canonical_url

(string)

Page content for the header <link rel="canonical" href="..." /> tag


CmsPage->css

(string)

Page content for a header <style type="text/css"> tag


CmsPage->js

(string)

Page content for a header <script type="javascript"> tag


CmsPage->header

(string)

HTML content to be appended to the <head> tag


CmsPage->footer

(string)

HTML content to be appended to the end of the <body> tag


CmsPage->title

(string)

HTML content to be added to an <h1> tag in the body


CmsPage->page_template_id

(string)

Name of the CMS page template used by this page


CmsPage->content

(CmsPageDictionary)

Array of content for this page, indexed by Content Element ID.

Example

If a content area is not defined, its value will be an empty string.


CmsPage->properties

(CmsPageDictionary)

Array of property values for this page, indexed by property name.

Example

If a property is not defined, its value will be an empty string.


CmsPage->isInEditor

(bool)

True if the page was detected to have been opened by the CMS.


CmsPage->editorScript

(string)

If the page was opened by the CMS, the script tag used to launch the CMS Editor. Otherwise, an empty string.


CmsPage->notFound

(bool)

Set to true by CmsRouter->getStandalone if no matching content was found when the page content was supposed to be rendered (when not in CMS Editor mode).


Public Methods


CmsPage::fromArray

CmsPage::fromArray($data)

Generate a CmsPage object from JSON data

Parameters


apHarmony\jsHarmonyCms\CmsResponse Class


CmsResponse Constructor

Arguments

Example


Public Properties


CmsResponse->type

(string|null)

Type of the response - 'page' or 'redirect'


CmsResponse->filename

(string|null)

Page filename, if response type is "page"


CmsResponse->redirect

(CmsRedirect|null)

Redirect, if response type is "redirect"


apHarmony\jsHarmonyCms\CmsPassthruResponse Class


Public Properties


CmsPassthruResponse->http_code

(int|null)

The HTTP response code from the target passthru page


CmsPassthruResponse->content_type

(string|null)

The HTTP content type from the target passthru page


CmsPassthruResponse->content

(string|null)

The HTML content from the target passthru page


Public Methods


CmsPassthruResponse->serve

CmsPassthruResponse->serve()

Serve the passthru content to the user

Parameters

N/A

Example


apHarmony\jsHarmonyCms\CmsRedirect Class


CmsRedirect Constructor

Arguments

Example


Public Properties


CmsRedirect->http_code

(string|null)

HTTP Code ('301', '302' or 'PASSTHRU')


CmsRedirect->url

(string|null)

Destination URL


jsHarmonyCmsEditor Class (Client JS)


jsHarmonyCmsEditor Constructor

Arguments

Example


All versions of jsharmony-cms-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.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 apharmony/jsharmony-cms-sdk-php contains the following files

Loading the files please wait ....