Download the PHP package kpion/spaghetti without Composer

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

🍝 Spaghetti - Low Calorie Documentation Tool

Automate explaining your code to AI (and maybe humans).

Creating documentation is such a joyride. Especially when you need to keep your documentation up-to-date with the latest code or database schema, perhaps to feed an AI model or to ensure that your team always has access to the most accurate information.

There's nothing quite like manually copying and pasting code snippets to really brighten your day.

Because let's face it, who doesn't love the relaxing experience of executing SHOW CREATE TABLE user and then transferring the result to a doc file every time you need an updated document? After all, what could be more calming than mindlessly copying and pasting for hours on end.

Oh, and you also proably believe you will never again create a spaghetti code in your live.

We are here to ruin all the fun :)

Spaghetti is a tool designed to simplify the creation of project documentation, especially useful for generating structured content for AI review (prompts). It works by authoring Markdown files enriched with dynamic content generated by PHP, automating repetitive tasks such as inserting database information.

Unlike full-scale documentation tools like phpDocumentor or Sphinx which focus on entire projects, Spaghetti is designed for narrower, context-specific tasks. You can easily combine your own explanations with dynamically generated content such as:

Example Usage

Create a file like about-pet-project.spaghetti.php:

# Pet Adoption Project

Example description: This is a simple project for managing a pet adoption database. It includes tables for storing information about pets, their sweetness level (subjective but fun!), and more.

Now create your main file, index.spaghetti.php:

<?= $spaghetti->import('about-pet-project.spaghetti.php') ?>

The most important table in this project is pet. Here's its structure:

<?= $spaghetti->db->showTable('pet') ?>

It’s related to the sweetness table, which evaluates how adorable each pet is:

<?= $spaghetti->db->showTable('sweetness') ?>

Each pet is represented by the Pet entity:

<?= $spaghetti->file('src/Entity/Pet.php') ?>

Finally, build the documentation using Spaghetti:

This will generate a Markdown file (index.md) with all your descriptions, database schemas, and entity code snippets combined.

Alternatively, you can pass it directly to another application, such as an AI model

This way, you can start your day with a cup of coffee and a single command, spaghetti ensures the information returned is up-to-date :)

Example output

The above example will result in a markdown file similar to this:

# Pet Adoption Project

This is a simple project for managing a pet adoption (...)

The most important table in this project is pet. Here's its structure:

Column Type Description
id int Primary key
name varchar Name of the pet
... ... ...

It’s related to the sweetness table, which evaluates how adorable each pet is:

Column Type Description
id int Primary key
pet_id int Foreign key referencing pet
level int Sweetness level of the pet
... ... ...

Each pet is represented by the Pet entity:

...End of example output

Installation

[!NOTE] Installing Spaghetti as a regular Composer dependency is not recommended. Spaghetti is a tool, not a library. As such, it should be installed as a standalone package, so that Spaghetti's dependencies do not interfere with your project's dependencies.

Install globally with Composer:

Make sure your global Composer binaries directory* is in your system's PATH. Because lost spaghetti is sad spaghetti.

* Usually, on Ubuntu, Composer binaries are located either in ~/.config/composer/vendor/bin/ or ~/.composer/vendor/bin/.

Details

Including Other Spaghetti files

Easily include and parse contents of other spaghetti files.

Including External Files (source files)

Easily include contents of external files to keep your documentation updated without manual copy-pasting. For example:

This includes the contents of User.php directly in the Markdown output.

Database Table Structure Example

You can use showCreateTable to generate a Markdown-friendly representation of your table’s SQL schema:

Assuming example_table is defined in your database, the output might look like this:

Available Functions

Here are some of the core functions available in Spaghetti for generating documentation content:

Why the Name "Spaghetti"?

While "spaghetti code" (mixing logic and presentation) is a horrible and evil practice in 99% of cases, it's actually a perfectly reasonable approach for this project's input files (documentation source files).

Plus, I absolutely love spaghetti in all its forms (the food, of course!). Buon appetito 🍝!

Contributing

This project was built with collaboration and feedback from the community. Contributions, suggestions, and improvements are always welcome!


All versions of spaghetti with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.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 kpion/spaghetti contains the following files

Loading the files please wait ....