Download the PHP package spaf/metamagic without Composer

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

:ukraine: #StandWithUkraine

This is the official Bank of Ukraine link for donations for Ukraine:

https://bank.gov.ua/en/news/all/natsionalniy-bank-vidkriv-spetsrahunok-dlya-zboru-koshtiv-na-potrebi-armiyi



PHP MetaMagic

This project is a pico-framework (tini-tiny library) for few basic purposes:

  1. Make software more flexible and configurable on a development level.
    • Code examples:
      • Object default params from file
  2. Working with "Attributed" classes, properties, methods, class-const.
    • searching and filtering the attributed members to perform actions on them.
    • Code examples:
      • Primitive HTTP routing
  3. Provide a new way to extend functionality that usually use "Magic Methods".
    • Code examples:
      • auto-casting (SimpUtils Caster, future project)
      • MetaMagic Extension for casting
      • dynamic getter/setter functionality (SimpUtils Props, future project)
      • Primitive getter/setter handler
      • developers' quality-of-life functionality
      • Debug output use-case
  4. More comfortable development process through dev-markings and architectural analysis by writing utilities that analyse "Attributes" written by Architects and Lead Developers (future project)
    • Code examples:
      • Marker Analysis

MetaMagic is a fully redesigned subproject of PHP SimpUtils.

[!NOTE] There are 2 logical types of PHP Attributes:

  1. "Marker Attribute" - The Attributes that are used just for marking parts of code for analysis and notifications. Those Attributes just mark portion of code and might contain only data/params in them, but do not perform any functionality/logic directly. The most of the native PHP 8+ Attributes play a role of a Marker. Some use cases:
    • #[\Deprecated]
    • #[\ReturnTypeWillChange] It does not affect your code-base runtime (except some log messages or exiting runtime in case of violations in some cases).
  2. "Functional Attribute" - The Attributes that contain logic and functionality directly in the Attribute classes. So those are basically real classes that could be used as normal classes beside being Attributes. It affects your code-base runtime.

Why the difference?! - Because from the architectural standpoint "Functional Attribute" increases coupling due to certain logic in them, while the "Marker Attribute" are dependency-free and does not have a direct coupling, and play role within the context/tools/framework that uses them.

Generic usage

There is basically just a couple of major methods for searching code members covered by attributes.

Simple example of searching members:

[!IMPORTANT] Filtering by params and especially by filter: $filter param allows to reduce some overhead for not processing every single spell when those are not needed.

This is especially important when you are searching only first occurrence with MetaMagic::findSpellOne()

Output:

Magic Methods syntactic sugar

The magic methods are ugly and inherently inconsistent in PHP.

So special MetaMagic attributes implemented for a few reasons:

  1. To demonstrate the power of the MetaMagic pico-framework (purpose of example)
  2. To prettify the class code (it's value is very small, but can improve readability what can cause better maintenance)

[!NOTE] There is no much reason to use these attributes besides slightly improving readability and code analysis.

Additional documentation

  1. About spells

License is "MIT"

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Installation

[!IMPORTANT] This code is a very minimal prototype. It means that all the planned optimizations are not yet applied. So further improvements of performance should be coming in the future versions

Minimal PHP version: 8.4

Current framework version: 0.0.1


All versions of metamagic with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
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 spaf/metamagic contains the following files

Loading the files please wait ...