Download the PHP package rah/rah_external_output without Composer

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

h1. rah_external_output

"Download":https://github.com/gocom/rah_external_output/releases | "Packagist":https://packagist.org/packages/rah/rah_external_output | "Twitter":http://twitter.com/gocom | "GitHub":https://github.com/gocom/rah_external_output | "Support forum":http://forum.textpattern.com/viewtopic.php?id=30664 | "Donate":http://rahforum.biz/donate/rah_external_output

Rah_external_output is a "Textpattern":http://textpattern.com plugin that can be used create custom content-type snippets. These snippets can be requested with a publicly accessible URL, and used as pages or to provide site's content over in form of JSON or XML to JavaScript or across domains.

While these snippets can act as pages, they are independent from Textpattern's normal content model. Snippets won't require or overpopulate "page templates":http://textpattern.net/wiki/index.php?title=Pages or "sections":http://textpattern.net/wiki/index.php?title=Sections.

This makes the plugin ideal for generating various publicly accessible snippets, including XML feeds or JavaScript Object Notations that can be then used to feed site's content to JavaScript applications, build application layers or to transmit content across domains.

Rah_external_output uses Textpattern's "form partials":http://textpattern.net/wiki/index.php?title=Forms to power its snippets. A form partial that's name is prefixed with a @raheo@ can be accessed directly with a URL, creating its own, independent, page. The term external directly refers to separateness and independency from sections and page templates while still serving client-side content.

h2. List of features

h2. Requirements

Rah_external_output's minimum requirements:

h2. Install

Using "Composer":http://getcomposer.org:

bc. $ composer require rah/rah_external_output:*

Or "download":https://github.com/gocom/rah_external_output/releases a plugin package.

h2. Basics

Rah_external_output treats any misc type "form partial":http://textpattern.net/wiki/index.php?title=Forms that name us prefixed with a @raheo@ prefix as a "external" content-type snippet. These special prefixed forms can be accessed using a public callback URL. This URL follows the pattern:

bc. http://example.com/?rah_external_output=FormNameWithoutPrefix

Where @example.com@ is the site's URL and @FormNameWithoutPrefix@ is the form's name excluding the prefix. The above URL would output a misc form named as @rah_eo_FormNameWithoutPrefix@.

h2. Creating your first snippet

Creating a new rah_external_output's custom form, a snippet, would follow the same steps as "any other form":http://textpattern.net/wiki/index.php?title=Forms#Creating_a_New_Form. Go to Forms panel, located under "Presentation":http://textpattern.net/wiki/index.php?title=Presentation, and click the Create new form button at the top of the column on the right. This will open a new empty editor.

As with any form partial, you can type in any Textpattern markup you wish to the large code field. This field contains what your snippet will output when accessed using its URL. For now, type in the field this:

bc. ; Content-type: text/plain < says> Hello World!

You can then give the snippet a name by typing it in the Name field. This name will be also used for the snippet's URL. To register a form partial as a rah_external_output's snippet, the name should be prefixed with @raheo@. For now, give the form a name @rah_eo_hello_world@.

Last but not least is a Type. The most appropriate type for a snippet is a misc, but it can be anything if you so wish. Form types are for the most part visual, used for organizing things on the admin-side, from the Write panel's "Override Form":http://textpattern.net/wiki/index.php?title=Write field to the Tag Builder.

When you have done with the code, giving it a name and selecting a type, hit the Save button. The snippet is now ready for being accessed. After you have saved the editor, you will notice that there is a View link next to the Name field. By clicking the link you will be taken to the snippet's generated page.

That page is the snippets publicly accessible URL, which you can freely use as a page, to serve content to applications and use in client-side scripts. For the snippet @rah_eo_hello_world@ you just created, this URL would be:

bc. http://example.com/?rah_external_output=hello_world

Where @example.com@ is your site's URL and @hello_world@ the name of the snippet. When accessing the snippet, you should see the following output:

bc. Hello World!

Where @MySiteName@ is the name of the site. As you may notice, the page is served as a plain text opposed to HTML. This is due to a HTTP header line the snippet's code included:

bc. ; Content-type: text/plain

All rah_external_output's snippets support few unique features including custom HTTP header lines and file extensions.

h2. Custom HTTP headers

In addition to a form partial's normal features, rah_external_output's special forms, snippets, support sending custom HTTP headers, including a content-type header.

All lines at the beginning of the form starting with a semicolon (@;@) are sent as HTTP headers. These lines should be placed at the very beginning of a form, starting from the first line. HTTP header lines can not be preceded by any white-space or empty lines.

HTTP header lines follow the normal syntax you would expect from a HTTP header field definitions. A line consist of a header property, also commonly referred as a field, followed by a colon (@:@) and a value.

bc. ; Property: Value

A form supports unlimited number of header lines. Each subsequent line starting with a semicolon is sent as a HTTP header.

bc. ; Content-type: text/javascript ; Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0 ; Expires: Sat, 24 Jul 2003 05:00:00 GMT ; Last-Modified: Wed, 1 Jan 2025 05:00:00 GMT ; Pragma: no-cache

Using these HTTP header lines visitor can be redirected, or document's content-type, encoding, caching or timestamp attributes changed. A form that starts with the following header line would be sent as a plain-text:

bc.. ; Content-type: text/plain

p. Note that for security reasons HTTP header lines can not contain Textpattern tags. Headers are collected from the source code before any Textpattern tags are processed. This is to prevent any type of header injections that could occur otherwise. h2. Content-types and file extensions In addition to custom HTTP headers, a snippet's content-type can be set using a file extension, appended to the form's name. Supported extensions are @.json@, @.js@, @.xml@, @.css@, @.txt@ and @.html@. If a form is named as a @rah_eo_jsontable.json@, the snippet would be served as a JSON presentation when @http://example.com/?rah_external_output=jsontable.json@ is accessed. h2. Tag trace and debugging As with Textpattern's normal page templates, rah_external_output's snippets support "tag traces":http://textpattern.net/wiki/index.php?title=tag_trace. In "debugging mode":http://textpattern.net/wiki/index.php?title=Basic_Preferences#Production_Status, a tag trace is appended to the HTML output of each snippet that ends with a @.html@ extension. As a tag trace on a normal page, the trace tells you which Textpattern tags are being executed and their outcome. h2. Example snippets As the plugin can be used to serve any type of snippet and content there is no to say what you should do with it or not. To give out a simple idea how you could benefit from the plugin, please see our "examples directory on GitHub":https://github.com/gocom/rah_external_output/tree/master/examples. The directory contains some basic, yet real-world proof examples. Examples include XML sitemap generation and some JSON serving. h2. For developers The plugin comes with few features targeted to developers. h3. Callback One of these developer features is a callback event which is fired when a snippet is viewed. The callback in question is named @rah_external_output.snippet_end@ and is executed at the very end of a snippet. This callback can be used like any other Textpattern's callback event. Hooking to the event happens using @register_callback()@ function. bc. register_callback(callback, 'rah_external_output.snippet_end'); Please see "Plugin Basics":http://textpattern.net/wiki/index.php?title=Plugin_basics for more information about plugin development and callbacks. h3. File extensions Rah_external_output allows extending the recognized MIME types and extensions. This can be done by modifying a global variable. The variable is named @$rah_external_output_mime@ and it takes an array map of @extension => mime/type@ key-value pairs. bc. global $rah_external_output_mime; $rah_external_output_mime['png'] = 'image/png'; $rah_external_output_mime['svg'] = 'image/svg+xml'; h2. Changelog h3. Version 1.1.0 - 2014/03/18 * Added: Clean URL support. Snippet can now be requested by its name, e.g. @http://example.com/snippet@. h3. Version 1.0.4 - 2013/05/07 * Changed: The installer doesn't use embedded version numbers. The only purpose for the installer is to handle migrations anyway. h3. Version 1.0.3 - 2013/05/06 * Composer package now uses "textpattern/lock":https://packagist.org/packages/textpattern/lock and "textpattern/installer":https://packagist.org/packages/textpattern/installer. The package installs to Textpattern without any extra configuration. h3. Version 1.0.2 - 2013/04/23 * Fixed: PHP namespace compatibility. * Changed: Under Textpattern 4.6.0-dev adds the 'View' link to the new action bar. * Improved: Internal clean up. * Improved: Use Textpattern's assigned flags to ensure future compatibility. * Improved: Creating preferences to the memory isn't necessary. h3. Version 1.0.1 - 2012/08/31 * Changed: Now doesn't uninstall @rah_eo_@ prefixed form partials with the plugin. These forms could be used for something else than just as the plugin's snippets. * Dropped: code path used as a plugin cache fallback. Now relays on existence of plugin-lifecycle callbacks. * Dropped: migration cleaner deployed in v0.6. Is no longer relevant. h3. Version 1.0 - 2012/07/14 * Removed: Plugin's own user interface. The plugin now uses @rah_eo_@ prefixed form partials and integrates with Forms panel. * Removed: @@ tag. As forms are used, normal and more flexible "output_form":http://textpattern.net/wiki/index.php?title=output_form tag can be used. * Removed: Raw PHP support to comply with "r3706.":http://code.google.com/p/textpattern/source/detail?r=3706 * Added: Ability to set a snippet's content-type using a file extension in the name. * Added: Migration assistant script. The script is run automatically on install and migrates rah_external_output snippets from the old interface to Forms. * Added: @rah_external_output.snippet_end@ callback event for developers. * Changed: Returns a 404 page instead of the home page when requesting a nonexistent snippet. * Changed: "Tag trace":http://textpattern.net/wiki/index.php?title=tag_trace can no longer be controlled using a URL parameter. A tag trace is added when the snippet name has a @.html@ extension and the site is in debugging mode. * Now requires PHP5 or newer. * Compatibility with Textpattern v4.5.0. h3. Version 0.9 - 2011/09/03 * Fixed: now handles raw PHP tags. * Changed: now parses tag structure in same fashion as core. Do it twice. Provides identical results with core in every scenario. * Added: ability to display tag trace, and error reporting, by adding @rah_external_output_trace@ parameter (@&rah_external_output_trace=1@) to the snippet URL when site's production status is set to _debugging_. h3. Version 0.8 - 2011/07/26 * Added: CSRF (session riding) protection using Textpattern's core functions introduced in v4.4.1. * Changed: Make sure the plugin interfaces is all in one language. * Changed: Only try to drop old database tables when humanly possible that there is old leftovers. Don't run queries when updating from clean to clean. * Changed: set temporary version number when installing. Removes the possibility of running the installer twice for no reason. * Now requires Textpattern version 4.4.1 or newer. h3. Version 0.7 - 2011/06/12 * Fixed: Error in @@ tag. * Fixed: Closed open @@ tag in the main list view. * Fixed: Now admin-side page title uses language strings. h3. Version 0.6 - 2011/04/15 * Fixed: Saving snippets while changing name. * Fixed: Now keeps the sent data in the editor if error occurs during saving instead of fetching the old data from the database. * Added: Translation support. Interface now uses language strings. * Added: @@ tag now caches fetched results. * Added: Now uses plugin_lifecycle callbacks, and includes uninstaller. * Added: Adds an options link to the Plugins pane which directs to the plugin's admin-interface. * Removed: Mime-interface. Was confusing and not so many used it. Trying to simplify the user interface. * Changed: The user-interface and markup. Removed heading, removed inline styles, added @@ and @@ tags to the tables. * Changed: Now uses new, improved multi-selection/edit feature, seen in other rah-plugins. * Changed: now uses @textpattern@ callback instead of outputting the snippets right away when the plugin is loaded. * Changed: Now checks if the saving/updating succeeds, instead of expecting. * Now requires Textpattern 4.2.0 (or newer) for full feature compatibility. h3. Version 0.5 - 2010/04/11 * Added _disable_ and _activate_ actions to the multiedit feature. h3. Version 0.4 - 2009/06/08 * Fixed forgotten insert query escaping. h3. Version 0.3 - 2009/05/10 * Fixed error caused by non-set @$pretext@ (note: TXP load order). * Set @$pretext@ indexes to empty: we are not on page template. h3. Version 0.2 - 2009/05/09 * Fixed forgotten parse call. h3. Version 0.1 - 2009/05/09 * Initial release.

All versions of rah_external_output with dependencies

PHP Build Version
Package Version
Requires php Version >=5.2.0
textpattern/lock Version >=4.4.1
textpattern/installer Version *
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 rah/rah_external_output contains the following files

Loading the files please wait ....