Download the PHP package clarkwinkelmann/flarum-ext-scratchpad without Composer

On this page you can find all versions of the php package clarkwinkelmann/flarum-ext-scratchpad. 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 flarum-ext-scratchpad

Developer Scratchpad

MIT license Latest Stable Version Total Downloads Donate

PLEASE DO NOT INSTALL THIS EXTENSION UNLESS YOU KNOW WHAT YOU ARE DOING!

Any user with administrative access is able to run any javascript and PHP code on the server and website without any restriction!

This extension adds a scratchpad feature to the admin panel of Flarum to ease testing and development for developers.

While the feature is restricted to admin users, I still recommend installing this on local environments only.

This is still very experimental. Use at your own risks.

Requirements:

Each scratchpad can contain javascript, Less and PHP code just like any extension.

You can give names to individual scratchpads and enable/disable them via a checkbox.

There's a good chance that despite the checks in place you will be able to save invalid code. If that happens, the easier is to go in the database and disable the scratchpad that's responsible.

PHP and Less are validated by doing a "stateless" background request to the forum and admin homepage with the new code when saving. If the background request fails, a validation error is shown and the scratchpad is not saved. This background request can be disabled in the extension settings.

Javascript is not validated during save, but if the compilation fails, the compiled code will not be loaded on the forum and you will see a message in the editor.

Javascript compilation is done locally by calling node through PHP. A scratchpad folder will be created under storage. The first time you compile, npm install will run. Subsequent compilations will re-use the installed dependencies.

If you end up with an invalid javascript setup, you can delete the storage/scratchpad folder and the extension will re-install everything on the next compilation.

The text editor on the Scratchpad page is CodeMirror. You can customize the theme and indentation via the cog icon above the editor. For now the settings are global and apply to all languages.

Installation

Please read the disclaimers and requirements above before installing.

composer require clarkwinkelmann/flarum-ext-scratchpad

Customizing the NPM and Webpack commands

The default commands should work fine on most Linux systems, but they are known to fail on some configurations, including (unsurprisingly) Windows.

You can edit the commands by editing the settings named "NPM installl command" and "Webpack command" in the modal that can be accessed via the cog icon of the editor.

Below are the default commands.

{{path}} must be kept verbatim and will be replaced with the path to the scratchpad folder, which is the equivalent of the js folder of an extension.

2>&1 is necessary at the end to redirect errors to standard output so the compiler can inspect the output and look for error messages.

NPM install:

cd {{path}} && npm install 2>&1

Webpack:

cd {{path}} && node_modules/.bin/webpack --mode development --config node_modules/flarum-webpack-config/index.js 2>&1

Links


All versions of flarum-ext-scratchpad with dependencies

PHP Build Version
Package Version
Requires flarum/core Version ^1.0
guzzlehttp/guzzle Version ^6.0||^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 clarkwinkelmann/flarum-ext-scratchpad contains the following files

Loading the files please wait ....