Download the PHP package sotvokun/webman-aop without Composer

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

Webman AOP

sotvokun/webman-aop integrates Ray.Aop with Webman and provides an Illuminate-based container. Mark a public service method with an Aspect Attribute and the interceptor is applied automatically when the service is resolved from the container.

Requirements

Installation

Webman automatically exports the plugin configuration to config/plugin/sotvokun/webman-aop/ during installation.

Configure the generated proxy directory and directories to scan in config/plugin/sotvokun/webman-aop/app.php:

Create or replace the container in config/container.php with the package container:

Define an Aspect

An Aspect is a PHP Attribute extending Sotvokun\Webman\Aop\Aspect. Its interceptors() method returns interceptor instances or class names.

An interceptor implements Sotvokun\Webman\Aop\MethodInterceptor:

Apply the Aspect to a service method located in a configured scan directory:

Resolve OrderService through Webman's container or constructor injection as usual. No factory call is needed:

Dependency Injection in Interceptors

When interceptors() returns a class name, the package creates it through the Webman container. Constructor dependencies are therefore injected normally:

Returning new ExampleInterceptor() bypasses container construction for that interceptor.

Lazy Injection

Mark a class-typed constructor dependency with #[Sotvokun\Webman\Aop\Attribute\Lazy]. The container injects a proxy and resolves the real service only when its state is first accessed:

The dependency type must be an instantiable, user-defined class with at least one non-static, non-virtual instance property (an inherited property also qualifies). Interfaces, union types, internal classes and their subclasses, and classes with no backed instance property are rejected immediately with a LogicException. Although PHP permits stdClass, it has no declared backed property and is therefore also rejected by this container.

PHP initializes a lazy proxy when its state is observed or changed. A method call that does not access object state does not initialize it. The factory must return a non-lazy instance of the proxy's class (or a compatible parent); the container guarantees this for normal services and for generated Ray.Aop classes.

The consuming service may use AOP attributes. The proxy is injected while the consuming service is constructed, and ReportService remains lazy:

Lazy AOP services

#[Lazy] can be used on a dependency whose public methods have AOP attributes. The container first generates Ray.Aop's child class, then creates the PHP lazy proxy from that generated class. When the service is first initialized, the real object therefore has the same class as its lazy proxy and interceptors remain active:

Constraints

Generated Proxy Cache

Each worker writes proxy classes to class_path/<worker-pid>. When a worker reloads, its replacement has a new PID and generates fresh proxy classes without affecting running workers. Bootstrap clears the entire class_path once per Webman restart, protected by a file lock so multiple workers do not clear it concurrently.


All versions of webman-aop with dependencies

PHP Build Version
Package Version
Requires illuminate/container Version ^13.31
ray/aop Version ^2.20
composer/class-map-generator Version ^1.7
workerman/webman-framework Version ^2.1
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 sotvokun/webman-aop contains the following files

Loading the files please wait ...