返回排行榜

Ocramius/ProxyManager

PHP

🎩✨🌈 OOP Proxy wrappers/utilities - generates and manages proxies of your objects

oopproxylazy-loadingaop
Star 增长趋势
Star
5k
Forks
190
周增长
Issues
37
2k4k
2013年3月2017年8月2022年2月2026年7月
制品库Packagistcomposer require ocramius/proxymanager
README

Proxy Manager

A message to Russian 🇷🇺 people

If you currently live in Russia, please read this message.

Purpose

This library aims to provide abstraction for generating various kinds of proxy classes.

ProxyManager

Mutation testing badge Type Coverage

Total Downloads Latest Stable Version Latest Unstable Version

Documentation

You can learn about the proxy pattern and how to use the ProxyManager in the docs.

ocramius/proxy-manager for enterprise

Available as part of the Tidelift Subscription.

The maintainer of ocramius/proxy-manager and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more..

You can also contact the maintainer at ocramius@gmail.com for looking into issues related to this package in your private projects.

Installation

The suggested installation method is via composer:

php composer.phar require ocramius/proxy-manager

Proxy example

Here's how you build a lazy loadable object with ProxyManager using a Virtual Proxy

$factory = new \ProxyManager\Factory\LazyLoadingValueHolderFactory();

$proxy = $factory->createProxy(
    \MyApp\HeavyComplexObject::class,
    function (& $wrappedObject, $proxy, $method, $parameters, & $initializer) {
        $wrappedObject = new \MyApp\HeavyComplexObject(); // instantiation logic here
        $initializer   = null; // turning off further lazy initialization

        return true; // report success
    }
);

$proxy->doFoo();

See the documentation for more supported proxy types and examples.

相关仓库
DesignPatternsPHP/DesignPatternsPHP

Sample code for several design patterns in PHP 8.x

PHPPackagistMIT Licensedesignpatternsphpphp
22.2k4.5k
mehdihadeli/awesome-software-architecture

📚 A curated list of awesome articles, videos, and other resources to learn and practice software architecture, patterns, and principles.

Creative Commons Zero v1.0 Universalarchitectureddd
awesome-architecture.com
11.4k993
prasadgujar/low-level-design-primer

Dedicated Resources for the Low-Level System Design. Learn how to design and implement large-scale systems. Prep for the system design interview.

designsystem-design
7.9k2.5k
python-attrs/attrs

Python Classes Without Boilerplate

PythonPyPIMIT Licensepythonboilerplate
attrs.org
5.8k456
niieani/bash-oo-framework

Bash Infinity is a modern standard library / framework / boilerplate for Bash

ShellMIT Licensebashshell
github.com/niieani/bash-oo-framework/discussions
5.6k244
salesforce/akita

🚀 State Management Tailored-Made for JS Applications

TypeScriptnpmApache License 2.0angularstate-management
salesforce.github.io/akita/
3.7k339
MrGemy95/Tensorflow-Project-Template

A best practice for tensorflow project template architecture.

PythonPyPIApache License 2.0tesnorflowsoftware-engineering
3.6k816
mgsalem/Tensorflow-Project-Template

A best practice for tensorflow project template architecture.

PythonPyPIApache License 2.0tesnorflowsoftware-engineering
3.6k794
coffe1891/frontend-hard-mode-interview

《前端内参》,有关于JavaScript、编程范式、设计模式、软件开发的艺术等大前端范畴内的知识分享,旨在帮助前端工程师们夯实技术基础以通过一线互联网企业技术面试。

JavaScriptnpmOtherfrontend-interviewinterview-preparation
coffe1891.gitbook.io/frontend-hard-mode-interview/
3.5k327
stampit-org/stampit

OOP is better with stamps: Composable object factories.

TypeScriptnpmMIT Licensejavascriptoop
stampit.js.org
3k103
changeweb/Unifiedtransform

A school management Software

PHPPackagistGNU General Public License v3.0school-managementteacher-student
changeweb.github.io/Unifiedtransform/
3k1.3k
marcelgsantos/learning-oop-in-php

A collection of resources to learn object-oriented programming and related concepts for PHP developers.

phpoop
2.5k424