Download the PHP package blua-blue/blua-blue-php-sdk without Composer
On this page you can find all versions of the php package blua-blue/blua-blue-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package blua-blue-php-sdk
blua.blue PHP SDK
The goal of this package is to enable fast, secure and simple integration of your blua.blue content into own web domains. NOTE: this library also works for open-source installations of blua.blue
Installation
composer require blua-blue/blua-blue-php-sdk
Usage
Client Methods
Constructor
$bluaBlue = new Client($publicKey, $apiKey=null, $apiEndpoint = 'https://blua.blue')
getArticle($articleSlugOrID)
This method accepts either the unique ID or the unique article-slug of a particular article.
getOwnArticles()
Retrieves all owned articles regardless of publish-state
getArticlesByKeywords($keywords)
Comma-seperated or single keyword e.g.
$phpTutorials = getArticlesByKeywords('php,tutorial');
getCategories()
Retrieves a list of available categories
getImages()
Retrieves stored images
registerImage($pathOrBase64, $mode='external')
MODES: external | upload
Either registers external images for reference or accepts base64 encoded image strings. (all browser-native content-types, max 600kb)
createArticle($article)
Creates a new article. While you can pass in a simple array, we recommend using the wrapper:
updateArticle($article)
Similar to createArticle, but operates on an existing article
Article Wrapper
The article wrapper can be constructed with an array:
new Article(['name'=>'How to set up x'])
or empty
new Article()
Either way, the wrapper has setters and getters for the following properties:
- $id (getter only)
- $name
- $slug (getter only)
- $teaser
- $image_id
- $author_user_id (setter will be overwritten by endpoint)
- $category_id
- $is_public
- $keywords
- $publish_date
- $insert_date (getter only)
- $update_date
- $delete_date
- $article_content
- $article_store
Example:
NOTE: you can let the endpoint determine certain values based on neoan3-db logik:
$article->setDeleteDate('.')
will be translated to the current ("point") in time when the request is received.
In other words, the SQL equivalent NOW()
Image Wrapper
The image wrapper can be constructed with an array:
new Image(['format'=>'image/png']) or empty new Image()
Either way, the wrapper has setters and getters for the following properties:
- id (getter only)
- path
- format
- inserterUserId (getter only)
Example:
Additional methods on Article and Image
toArray()
Exports object into assoc-array.
Additional method on Article
getContentHtml()
Exports a combined HTML-string from all contents