Download the PHP package php-sage/sage without Composer

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

Sage - Insightful PHP debugging assistant ☯

At first glance Sage is just a drop-in replacement for var_dump() and debug_backtrace().

However, it's much, much more.


Sage is designed to exceed expectations, it intelligently handles everything that you throw at it and displays in the best possible way.

If you can think of how it can be better, please create an issue!

For an overview of Sage's outstanding features jump to the F.A.Q.

Installation

Or if you prefer, download the phar and simply

Or if your PHP version does not support either, download the latest source code and include Sage.php

Usage

Function Shorthand
sage s Dump (same as \Sage::dump())
saged sd Dump & die
ssage ss Simple dump
ssaged ssd Simple dump & die
sagetrace s(1) Debug backtrace (same as \Sage::trace())

Simple dump:

Debug backtrace:

Guarantees ✅

  1. Sage just works and it displays ALL available information (or in cases when something is truncated - that is clear too).

  2. Each release is vigorously tested. Or - use the bleeding edge dev-main version at your own risk.

  3. Semver versioning ensures there's no compatibility breaks if you use it in your production (eg. reporting).

  4. Sage has gotten lots of love and improvements in the last >10 years. It is used by a lot of real people in a lot of real-world scenarios, it is battle tested and has a lot of advanced features no other tool has.

More cool stuff

Sage displays the passed variable name and supports prefixes to the dump function call. Use it for some common on-the-fly adjustments to the dump output.

Sage tokenizes & introspects the calling code to get all this information. All that can be done with prefixes can also be achieved with standard, verbose syntax:

See Advanced section below if you want more tips & tricks.

Verbose versions

If you want to use Sage as part of permanent code (e.g. part of a test helper/logger/exception reporter etc), you can use the verbose way to invoke Sage:


Customization

The main goal of Sage is to be zero-setup. There are also several customization options for advanced uses.

Where to store the configuration?

  1. Add this entry to the autoload.files configuration in composer.json:

  2. Put settings inside of php.ini:

  3. Include the desired settings in your bootstrap process anywhere™.

All available options

Currently available themes are:


Make visible source file paths clickable to open your editor. Available options are:

'phpstorm-remote' - default (requires IDE Remote Control plugin), 'sublime', 'textmate', 'emacs', 'macvim', 'phpstorm', 'idea', 'vscode', 'vscode-insiders', 'vscode-remote', 'vscode-insiders-remote', 'vscodium', 'atom', 'nova', 'netbeans', 'xdebug'

Or pass a custom string where %file should be replaced with full file path, %line with line number to create a custom link. Set to null to disable linking.


Whether to display where Sage was called from


Max array/object levels to go deep, set to zero/false to disable


Draw rich output already expanded without having to click


Enable detection when running in command line and adjust output format accordingly.


In addition to above setting, enable detection when Sage is run in UNIX command line. Attempts to add coloring, but if opened as plain text, the color information is visible as gibberish.


Possible alternative char encodings in order of probability.


Sage returns output instead of printing it.


Add new custom Sage wrapper names. Optional, but needed for backtraces, variable name detection and modifiers to work properly. Accepts array or comma separated string. Use notation Class::method for methods.


🧙 Advanced Tips & Tricks

this section is under construction :)


F.A.Q.

💬 How is it different or better than symfony/var-dumper?

💬 What are the other dumpers out there

💬 Why does Sage look so much like Kint? A.K.A. Why does this repo have so few stars?

Because it is Kint, and I am its author, however the project was forcibly taken over by a malicious contributor!

Instead of fighting windmills I chose to fork and rename the last good version and continue under a new name!

You can use Sage as a drop-in replacement for Kint. Simple.

💬 How is var_dump - style debugging still relevant when we have Xdebug?

  1. In practice, Xdebug is quite often very difficult and time-consuming to install and configure.
  2. There's many use-cases where dump&die is just faster to bring up.
  3. There is no way you can visualise a timeline of changed data with XDebug. For example, all values dumped from within a loop.
  4. And there's more subtle use-cases, eg. if you stepped over something there's no way to go back, but with var-dumping the values are still there...

I use xdebug almost daily, by the way. Side by side with Sage.

Known issues

  1. Since PHP 8.2 variable name detection for multiline Sage calls is broken. Simple matter of Backtrace format changing the reported line, fix is comming.

Contributing

🎲 Prerequisites

Do your changes but before committing run

To compile resources and build the phar file.

Author

Rokas Šleinius (Raveren)

Contributors: https://github.com/php-sage/sage/graphs/contributors

License

Licensed under the MIT License


Hope you'll love using Sage as much as I love creating it!


All versions of sage with dependencies

PHP Build Version
Package Version
Requires php Version >=5.1.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 php-sage/sage contains the following files

Loading the files please wait ....