Download the PHP package bjornbasar/karhu-skeleton without Composer

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

karhu-skeleton

Starter app template for the karhu PHP microframework. Boots a working app with one HTTP route and one CLI command — meant to be cloned and edited.

Quick start

You'll see the HomeController rendering at /. Try the CLI too:

The value must be passed as --name=…: HelloCommand reads $args['name'], so a bare karhu hello YourName lands in $args['0'] and prints Hello, world! instead.

Which karhu you get

This template requires bjornbasar/karhu: ^0.1.5 — a release, from Packagist. It previously tracked dev-main with minimum-stability: dev, which meant a fresh clone installed whatever happened to be at the tip of the framework's default branch. That is a poor default for a starter template: two people cloning a week apart got different frameworks, and neither got something they could reproduce.

^0.1.5 is also what makes vendor/bin/karhu above work at all. Composer only links that shim because karhu declares a bin key, which landed in v0.1.5.

karhu is pre-1.0, so a 0.x minor release may break the API — bump this pin deliberately rather than widening it.

What you get

The front controller is three lines:

karhu reads #[Route] attributes off the registered controllers — no YAML, no closures.

Add a route

  1. Drop a controller into app/Controllers/:

    Three things are easy to guess wrong here: the path is the first argument to #[Route] (methods is a named argument after it), handlers receive the Request rather than unpacked route parameters, and json() is an instance method on Response, not a static one.

  2. Register it in config/controllers.php:

That's it. Same shape for #[Command] CLI handlers in config/commands.php.

Tests

Documentation

License

MIT


All versions of karhu-skeleton with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
bjornbasar/karhu Version ^0.1.5
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 bjornbasar/karhu-skeleton contains the following files

Loading the files please wait ...