Download the PHP package goaop/framework without Composer

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

Go! Aspect-Oriented Framework for PHP

This framework brings Aspect-Oriented Programming to PHP — a powerful paradigm for handling cross-cutting concerns that don't fit neatly into traditional OOP like logging, caching, and security checks across hundreds of methods. Go! AOP solves this problem elegantly—define such behaviors as aspect classes once, and apply them automatically everywhere when needed. Your business logic stays clean, your infrastructure code stays organized.

GitHub Workflow Status PHPStan Badge GitHub release Total Downloads Daily Downloads Minimum PHP Version License Sponsor

✨ Features

🔌 Zero Dependencies, Pure PHP

🎯 Powerful Core Interception Capabilities

The framework provides powerful core interception capabilities that can be used to hook into any method in your application:

Feature Support
Interception of public & protected methods
Interception of static and final methods
Interception of private methods
Interception of methods in final classes
Interception of trait methods
Interception of enum methods (PHP 8.1+)
Before, After and Around type of hooks

🧷 Property interception (PHP 8.4+)

Go! AOP intercepts field access via native PHP 8.4 property hooks on generated proxy classes.

For array-typed intercepted properties, the proxy emits only a by-reference &get hook (without set) to keep indirect modification operations like array_push($this->items, ...) valid.

For typed properties without a default value, generated get hooks include an initialization guard:

See also: PHP 8.4 Feature Support & Known Limitations for detailed information about property hooks, readonly properties, lazy objects, and other PHP 8.4 features.

🛠️ Developer Experience

⚡ Production Ready

What is AOP?

Aspect-Oriented Programming (AOP) is a programming paradigm that complements Object-Oriented Programming by solving a fundamental problem: cross-cutting concerns.

The Problem with Traditional OOP

In OOP, we organize code into classes with clear responsibilities. But some behaviors refuse to fit neatly into this model — they cut across many classes:

With pure OOP, you end up copying the same code into hundreds of places. When requirements change, you hunt through the entire codebase. This is called code scattering and code tangling — and it violates the DRY and DDD principle at scale.

The AOP Solution

AOP introduces a simple but powerful idea: define cross-cutting behavior once, apply it automatically wherever needed.

Think of it like life advice. Your mentor doesn't follow you around repeating "check your inputs before every decision." Instead, they give you one piece of advice that you apply in many situations. AOP works the same way — you write the advice once, and the framework applies it at the right moments.

Core Concepts

Concept What It Means Real-World Analogy
Aspect A module containing cross-cutting logic (logging, caching, etc.) A chapter in a guidebook covering the document signing process
Join Point A specific moment in code execution — method call, property access, object creation A decision point in your day where advice could apply
Advice The actual code that runs at a join point The specific guidance: "Before signing the document, read everything"
Pointcut A pattern that selects which join points to target The rule for when advice applies: "Before signing any contract"
Weaving The process of applying aspects to your code The mentor's words becoming part of your thinking

Types of Advice

Just like life advice can be applied at different moments, AOP advice has different timing:

Advice Type When It Runs Example Use Case
Before Right before the method executes Validate input, check permissions
After (Finally) Always, regardless of outcome Release resources, stop timers
Around Wraps the entire execution Caching, transactions, retry logic
After Throwing When an exception is thrown Log errors, send alerts

Around advice is the most powerful — it controls whether the original method runs at all, can modify arguments, change return values, or handle exceptions.

Advanced: Introductions

Go! AOP can do more than intercept behavior — it can add entirely new capabilities to existing classes. This is called an Introduction (or inter-type declaration).

Want all your DTOs to implement Serializable? Instead of modifying every class, declare it once in an aspect — Go! AOP adds the interface and implementation automatically. No inheritance hierarchies, no code duplication.

How Go! AOP Works

Unlike frameworks requiring special compilation steps, Go! AOP performs runtime weaving — it transforms your classes when they're loaded into PHP. No build process, no generated files to commit. Your original source code stays untouched, and the framework handles everything transparently.

Installation

Go! AOP framework can be installed with composer. Installation is quite easy:

  1. Download the framework using composer
  2. Create an application aspect kernel
  3. Configure the aspect kernel in the front controller
  4. Create an aspect
  5. Register the aspect in the aspect kernel

Step 0 (optional): Try demo examples in the framework

Ask composer to create a new project in empty directory:

After that configure your web server to demos/ folder and open it in your browser. Then you can look at some demo examples before going deeper into installing it in your project.

Step 1: Download the library using composer

Ask composer to download the latest version of Go! AOP framework with its dependencies by running the command:

Composer will install the framework to your project's vendor/goaop/framework directory.

Step 2: Create an application aspect kernel

The aim of this framework is to provide easy AOP integration for your application. You have to first create the AspectKernel class for your application. This class will manage all aspects of your application in one place.

The framework provides base class to make it easier to create your own kernel. To create your application kernel, extend the abstract class Go\Core\AspectKernel

3. Configure the aspect kernel in the front controller

To configure the aspect kernel, call init() method of kernel instance.

4. Create an aspect

Aspect is the key element of AOP philosophy. Go! AOP framework just uses simple PHP classes for declaring aspects, which makes it possible to use all features of OOP for aspect classes. As an example, let's intercept all the methods and display their names:

Easy, isn't it? We declared here that we want to install a hook before the execution of all dynamic public methods in the class Example. This is done with the help of attribute #[Before("execution(public Example->*(*))")] Hooks can be of any types, you will see them later.

5. Register the aspect in the aspect kernel

To register the aspect just add an instance of it in the configureAop() method of the kernel:

6. Optional configurations

6.1 Support for weaving Doctrine entities (experimental, alpha)

Weaving Doctrine entities cannot be supported out of the box due to the fact that Go! AOP generates two sets of classes for each woven entity, a concrete class and proxy with pointcuts. Doctrine will interpret both of those classes as concrete entities and assign for both of them the same metadata, which would mess up the database and relations (see https://github.com/goaop/framework/issues/327).

Therefore, a workaround is provided with this library which will sort out mapping issue in Doctrine. Workaround is in form of event subscriber, Go\Bridge\Doctrine\MetadataLoadInterceptor which has to be registered when Doctrine is bootstraped in your project. For details how to do that, see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/events.html.

Event subscriber will modify metadata entity definition for generated Go! Aop proxies as mapped superclass. That would sort out issues on which you may stumble upon when weaving Doctrine entities.

7. Contribution

To contribute changes, see the Contribute Readme


All versions of framework with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2.0
ext-tokenizer Version *
goaop/parser-reflection Version ^3.0 || ^4.0
goaop/dissect Version ^3.0
laminas/laminas-code Version ^4.13
symfony/finder Version ^5.4 || ^6.4 || ^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 goaop/framework contains the following files

Loading the files please wait ...