PDF rausgenommen
This commit is contained in:
197
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/access-interceptor-scope-localizer-proxy.html
vendored
Normal file
197
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/access-interceptor-scope-localizer-proxy.html
vendored
Normal file
@ -0,0 +1,197 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" id="top">
|
||||
<head>
|
||||
<title>ProxyManager - Tuning the ProxyManager for production</title>
|
||||
|
||||
<meta name="description" content="A proxyManager write in php" />
|
||||
<meta name="keywords" content="ProxyManager, proxy, manager, ocramius, Marco Pivetta, php, production" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600' rel='stylesheet' type='text/css'>
|
||||
<link href="css/styles.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<h1><a href="index.html"><img alt="ProxyManager" src="img/block.png" /></a></h1>
|
||||
|
||||
<nav class="main-nav" role="navigation">
|
||||
<ul>
|
||||
<li><a href="https://github.com/Ocramius/ProxyManager" target="_blank">Github</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main role="main">
|
||||
<section class="component-content">
|
||||
|
||||
<div class="component-demo" id="live-demo">
|
||||
<div class="container">
|
||||
<div class="main-wrapper" style="text-align: right">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=fork&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="310" height="40"></iframe>
|
||||
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="40"></iframe>
|
||||
|
||||
</div>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-info">
|
||||
<div class="container">
|
||||
<aside class="sidebar">
|
||||
<nav class="spy-nav">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a></li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a></li>
|
||||
<li><a href="null-object.html">Null Objects</a></li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a></li>
|
||||
<li><a href="remote-object.html">Remote Object</a></li>
|
||||
<li><a href="contributing.html">Contributing</a></li>
|
||||
<li><a href="credits.html">Credits</a></li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
<a class="btn btn-action btn-full download-component"
|
||||
href="download.html">Download</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</aside>
|
||||
|
||||
<div class="content">
|
||||
<div class="bcms-clearfix"></div>
|
||||
<h3 class="section-title">Access Interceptor Scope Localizer Proxy</h3>
|
||||
|
||||
<p>An access interceptor scope localizer is a smart reference proxy that allows you to dynamically define logic to be executed before or after any of the proxied object's methods' logic.</p>
|
||||
|
||||
<p>It works exactly like the <a href="access-interceptor-value-holder-proxy.html">access interceptor value holder</a>, with some minor differences in behavior.</p>
|
||||
|
||||
<p>The working concept of an access interceptor scope localizer is to localize scope of a proxied object:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
class Example
|
||||
{
|
||||
protected $foo;
|
||||
protected $bar;
|
||||
protected $baz;
|
||||
|
||||
public function doFoo()
|
||||
{
|
||||
// ...
|
||||
}
|
||||
}
|
||||
|
||||
class ExampleProxy extends Example
|
||||
{
|
||||
public function __construct(Example $example)
|
||||
{
|
||||
$this->foo = & $example->foo;
|
||||
$this->bar = & $example->bar;
|
||||
$this->baz = & $example->baz;
|
||||
}
|
||||
|
||||
public function doFoo()
|
||||
{
|
||||
return parent::doFoo();
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>This allows to create a mirror copy of the real instance, where any change in the proxy or in the real instance is reflected in both objects.</p>
|
||||
|
||||
<p>The main advantage of this approach is that the proxy is now safe against fluent interfaces, which would break an <a href="access-interceptor-value-holder-proxy.html">access interceptor value holder</a> instead.</p>
|
||||
<hr />
|
||||
<h3>Differences with <a href="access-interceptor-value-holder-proxy.html">access interceptor value holder</a>:</h3>
|
||||
|
||||
<ul>
|
||||
<li>It does <strong>NOT</strong> implement the <code>ProxyManager\Proxy\ValueHolderInterface</code>, since the proxy itself does not keep a reference to the original object being proxied</li>
|
||||
<li>In all interceptor methods (see <a href="access-interceptor-value-holder-proxy.html">access interceptor value holder</a>), the $instance passed in is the proxy itself. There is no way to gather a reference to the original object right now, and that's mainly to protect from misuse.</li>
|
||||
</ul>
|
||||
<hr />
|
||||
|
||||
<h3>Known limitations</h3>
|
||||
|
||||
<ul>
|
||||
<li>It is <strong>NOT</strong> possible to intercept access to public properties</li>
|
||||
<li>It is <strong>NOT</strong> possible to proxy interfaces, since this proxy relies on <code>parent::method()</code> calls. Interfaces obviously don't provide a parent method implementation.</li>
|
||||
<li>calling unset on a property of an access interceptor scope localizer (or the real instance) will cause the two objects to be un-synchronized, with possible unexpected behaviour.</li>
|
||||
<li>serializing or un-serializing an access interceptor scope localizer (or the real instance) will not cause the real instance (or the proxy) to be serialized or un-serialized</li>
|
||||
<li>if a proxied object contains private properties, then an exception will be thrown if you use PHP <code>< 5.4.0</code>.</li>
|
||||
</ul>
|
||||
<hr />
|
||||
<h3>Example</h3>
|
||||
|
||||
<p>Here's an example of how you can create and use an access interceptor scope localizer :</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
<?php
|
||||
|
||||
use ProxyManager\Factory\AccessInterceptorScopeLocalizerFactory as Factory;
|
||||
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
class Foo
|
||||
{
|
||||
public function doFoo()
|
||||
{
|
||||
echo "Foo!\n";
|
||||
}
|
||||
}
|
||||
|
||||
$factory = new Factory();
|
||||
|
||||
$proxy = $factory->createProxy(
|
||||
new Foo(),
|
||||
array('doFoo' => function () { echo "PreFoo!\n"; }),
|
||||
array('doFoo' => function () { echo "PostFoo!\n"; })
|
||||
);
|
||||
|
||||
$proxy->doFoo();
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>This send something like following to your output:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
PreFoo!
|
||||
Foo!
|
||||
PostFoo!
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>This is pretty much the same logic that you can find in <a href="access-interceptor-value-holder-proxy.html">access interceptor value holder</a>.</p>
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="site-footer" role="contentinfo">
|
||||
<div class="container">
|
||||
<div class="footer-logos">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a> | </li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a> | </li>
|
||||
<li><a href="null-object.html">Null Objects</a> | </li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a> | </li>
|
||||
<li><a href="remote-object.html">Remote Object</a> | </li>
|
||||
<li><a href="contributing.html">Contributing</a> | </li>
|
||||
<li><a href="credits.html">Credits</a> | </li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bcms-clearfix"></div>
|
||||
</footer>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</body>
|
||||
</html>
|
208
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/access-interceptor-value-holder-proxy.html
vendored
Normal file
208
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/access-interceptor-value-holder-proxy.html
vendored
Normal file
@ -0,0 +1,208 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" id="top">
|
||||
<head>
|
||||
<title>ProxyManager - Tuning the ProxyManager for production</title>
|
||||
|
||||
<meta name="description" content="A proxyManager write in php" />
|
||||
<meta name="keywords" content="ProxyManager, proxy, manager, ocramius, Marco Pivetta, php, production" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600' rel='stylesheet' type='text/css'>
|
||||
<link href="css/styles.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<h1><a href="index.html"><img alt="ProxyManager" src="img/block.png" /></a></h1>
|
||||
|
||||
<nav class="main-nav" role="navigation">
|
||||
<ul>
|
||||
<li><a href="https://github.com/Ocramius/ProxyManager" target="_blank">Github</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main role="main">
|
||||
<section class="component-content">
|
||||
|
||||
<div class="component-demo" id="live-demo">
|
||||
<div class="container">
|
||||
<div class="main-wrapper" style="text-align: right">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=fork&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="310" height="40"></iframe>
|
||||
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="40"></iframe>
|
||||
|
||||
</div>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-info">
|
||||
<div class="container">
|
||||
<aside class="sidebar">
|
||||
<nav class="spy-nav">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a></li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a></li>
|
||||
<li><a href="null-object.html">Null Objects</a></li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a></li>
|
||||
<li><a href="remote-object.html">Remote Object</a></li>
|
||||
<li><a href="contributing.html">Contributing</a></li>
|
||||
<li><a href="credits.html">Credits</a></li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
<a class="btn btn-action btn-full download-component"
|
||||
href="download.html">Download</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</aside>
|
||||
|
||||
<div class="content">
|
||||
<div class="bcms-clearfix"></div>
|
||||
<h3 class="section-title">Access Interceptor Value Holder Proxy</h3>
|
||||
|
||||
<p>An access interceptor value holder is a smart reference proxy that allows you to dynamically define logic to be executed before or after any of the wrapped object's methods logic.</p>
|
||||
|
||||
<p>It wraps around a real instance of the object to be proxied, and can be useful for things like:</p>
|
||||
|
||||
<ul>
|
||||
<li>caching execution of slow and heavy methods</li>
|
||||
<li>log method calls</li>
|
||||
<li>debugging</li>
|
||||
<li>event triggering</li>
|
||||
<li>handling of orthogonal logic, and <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming" target="_blank">AOP</a> in general</li>
|
||||
</ul>
|
||||
<hr />
|
||||
<h3>Example</h3>
|
||||
|
||||
<p>Here's an example of how you can create and use an access interceptor value holder:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
<?php
|
||||
|
||||
use ProxyManager\Factory\AccessInterceptorValueHolderFactory as Factory;
|
||||
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
class Foo
|
||||
{
|
||||
public function doFoo()
|
||||
{
|
||||
echo "Foo!\n";
|
||||
}
|
||||
}
|
||||
|
||||
$factory = new Factory();
|
||||
|
||||
$proxy = $factory->createProxy(
|
||||
new Foo(),
|
||||
array('doFoo' => function () { echo "PreFoo!\n"; }),
|
||||
array('doFoo' => function () { echo "PostFoo!\n"; })
|
||||
);
|
||||
|
||||
$proxy->doFoo();
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>This send something like following to your output:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
PreFoo!
|
||||
Foo!
|
||||
PostFoo!
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<hr />
|
||||
<h3>Implementing pre- and post- access interceptors</h3>
|
||||
|
||||
<p>A proxy produced by the <code><a href="https://github.com/Ocramius/ProxyManager/blob/master/src/ProxyManager/Factory/AccessInterceptorValueHolderFactory.php" target="_blank">ProxyManager\Factory\AccessInterceptorValueHolderFactory</a></code> implements both the <code><a href="https://github.com/Ocramius/ProxyManager/blob/master/src/ProxyManager/Proxy/ValueHolderInterface.php" target="_blank">ProxyManager\Proxy\ValueHolderInterface</a></code> and the <code><a href="https://github.com/Ocramius/ProxyManager/blob/master/src/ProxyManager/Proxy/ValueHolderInterface.php" target="_blank">ProxyManager\Proxy\AccessInterceptorInterface</a></code>.</p>
|
||||
|
||||
|
||||
<p>Therefore, you can set an access interceptor callback by calling:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
$proxy->setMethodPrefixInterceptor('methodName', function () { echo 'pre'; });
|
||||
$proxy->setMethodSuffixInterceptor('methodName', function () { echo 'post'; });
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>You can also listen to public properties access by attaching interceptors to <code>__get</code>, <code>__set</code>, <code>__isset</code> and <code>__unset</code>.</p>
|
||||
|
||||
<p>A prefix interceptor (executed before method logic) should have following signature:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
/**
|
||||
* @var object $proxy the proxy that intercepted the method call
|
||||
* @var object $instance the wrapped instance within the proxy
|
||||
* @var string $method name of the called method
|
||||
* @var array $params sorted array of parameters passed to the intercepted
|
||||
* method, indexed by parameter name
|
||||
* @var bool $returnEarly flag to tell the interceptor proxy to return early, returning
|
||||
* the interceptor's return value instead of executing the method logic
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
$prefixInterceptor = function ($proxy, $instance, $method, $params, & $returnEarly) {};
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
A suffix interceptor (executed after method logic) should have following signature:
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
/**
|
||||
* @var object $proxy the proxy that intercepted the method call
|
||||
* @var object $instance the wrapped instance within the proxy
|
||||
* @var string $method name of the called method
|
||||
* @var array $params sorted array of parameters passed to the intercepted
|
||||
* method, indexed by parameter name
|
||||
* @var mixed $returnValue the return value of the intercepted method
|
||||
* @var bool $returnEarly flag to tell the proxy to return early, returning the interceptor's
|
||||
* return value instead of the value produced by the method
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
$suffixInterceptor = function ($proxy, $instance, $method, $params, $returnValue, & $returnEarly) {};
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<hr />
|
||||
<h3>Tuning performance for production</h3>
|
||||
|
||||
<p>See <a href="production.html">Tuning ProxyManager for Production</a>.</p>
|
||||
</main>
|
||||
|
||||
<footer class="site-footer" role="contentinfo">
|
||||
<div class="container">
|
||||
<div class="footer-logos">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a> | </li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a> | </li>
|
||||
<li><a href="null-object.html">Null Objects</a> | </li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a> | </li>
|
||||
<li><a href="remote-object.html">Remote Object</a> | </li>
|
||||
<li><a href="contributing.html">Contributing</a> | </li>
|
||||
<li><a href="credits.html">Credits</a> | </li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bcms-clearfix"></div>
|
||||
</footer>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</body>
|
||||
</html>
|
139
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/contributing.html
vendored
Normal file
139
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/contributing.html
vendored
Normal file
@ -0,0 +1,139 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" id="top">
|
||||
<head>
|
||||
<title>ProxyManager - Contributing</title>
|
||||
|
||||
<meta name="description" content="A proxyManager write in php" />
|
||||
<meta name="keywords" content="ProxyManager, proxy, manager, ocramius, Marco Pivetta, php, contributing" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600' rel='stylesheet' type='text/css'>
|
||||
<link href="css/styles.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<h1><a href="index.html"><img alt="ProxyManager" src="img/block.png" /></a></h1>
|
||||
|
||||
<nav class="main-nav" role="navigation">
|
||||
<ul>
|
||||
<li><a href="https://github.com/Ocramius/ProxyManager" target="_blank">Github</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main role="main">
|
||||
<section class="component-content">
|
||||
|
||||
<div class="component-demo" id="live-demo">
|
||||
<div class="container">
|
||||
<div class="main-wrapper" style="text-align: right">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=fork&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="310" height="40"></iframe>
|
||||
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="40"></iframe>
|
||||
|
||||
</div>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-info">
|
||||
<div class="container">
|
||||
<aside class="sidebar">
|
||||
<nav class="spy-nav">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a></li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a></li>
|
||||
<li><a href="null-object.html">Null Objects</a></li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a></li>
|
||||
<li><a href="remote-object.html">Remote Object</a></li>
|
||||
<li><a href="contributing.html">Contributing</a></li>
|
||||
<li><a href="credits.html">Credits</a></li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
<a class="btn btn-action btn-full download-component"
|
||||
href="download.html">Download</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</aside>
|
||||
|
||||
<div class="content">
|
||||
<div class="bcms-clearfix"></div>
|
||||
<h3 class="section-title">Contributing</h3>
|
||||
|
||||
<ul>
|
||||
<li>Coding standard for the project is <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md" target-"_blank">PSR-2</a></li>
|
||||
<li>The project will follow strict <a href="http://www.slideshare.net/guilhermeblanco/object-calisthenics-applied-to-php" target-"_blank">object calisthenics</a></li>
|
||||
<li>Any contribution must provide tests for additional introduced conditions</li>
|
||||
<li>Any un-confirmed issue needs a failing test case before being accepted</li>
|
||||
<li>Pull requests must be sent from a new hotfix/feature branch, not from master.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Installation</h3>
|
||||
|
||||
<p>To install the project and run the tests, you need to clone it first:</p>
|
||||
|
||||
<pre>
|
||||
<code class="sh">
|
||||
$ git clone git://github.com/Ocramius/ProxyManager.git
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>You will then need to run a composer installation:</p>
|
||||
|
||||
<pre>
|
||||
<code class="sh">
|
||||
$ cd ProxyManager
|
||||
$ curl -s https://getcomposer.org/installer | php
|
||||
$ php composer.phar update
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Testing</h3>
|
||||
|
||||
<p>The PHPUnit version to be used is the one installed as a dev- dependency via composer:</p>
|
||||
|
||||
<pre>
|
||||
<code class="sh">
|
||||
$ ./vendor/bin/phpunit
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>Accepted coverage for new contributions is 80%. Any contribution not satisfying this requirement won't be merged.</p>
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="site-footer" role="contentinfo">
|
||||
<div class="container">
|
||||
<div class="footer-logos">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a> | </li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a> | </li>
|
||||
<li><a href="null-object.html">Null Objects</a> | </li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a> | </li>
|
||||
<li><a href="remote-object.html">Remote Object</a> | </li>
|
||||
<li><a href="contributing.html">Contributing</a> | </li>
|
||||
<li><a href="credits.html">Credits</a> | </li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bcms-clearfix"></div>
|
||||
</footer>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</body>
|
||||
</html>
|
100
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/copyright.html
vendored
Normal file
100
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/copyright.html
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" id="top">
|
||||
<head>
|
||||
<title>ProxyManager</title>
|
||||
|
||||
<meta name="description" content="A proxyManager write in php" />
|
||||
<meta name="keywords" content="ProxyManager, proxy, manager, ocramius, Marco Pivetta, php" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600' rel='stylesheet' type='text/css'>
|
||||
<link href="css/styles.css" rel="stylesheet" />
|
||||
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<h1><a href="index.html"><img alt="ProxyManager" src="img/block.png" /></a></h1>
|
||||
|
||||
<nav class="main-nav" role="navigation">
|
||||
<ul>
|
||||
<li><a href="https://github.com/Ocramius/ProxyManager" target="_blank">Github</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main role="main">
|
||||
<section class="component-content">
|
||||
|
||||
<div class="component-demo" id="live-demo">
|
||||
<div class="container">
|
||||
<div class="main-wrapper" style="text-align: right">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=fork&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="310" height="40"></iframe>
|
||||
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="40"></iframe>
|
||||
|
||||
</div>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-info">
|
||||
<div class="container">
|
||||
<aside class="sidebar">
|
||||
<nav class="spy-nav">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a></li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a></li>
|
||||
<li><a href="null-object.html">Null Objects</a></li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a></li>
|
||||
<li><a href="remote-object.html">Remote Object</a></li>
|
||||
<li><a href="contributing.html">Contributing</a></li>
|
||||
<li><a href="credits.html">Credits</a></li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
<a class="btn btn-action btn-full download-component"
|
||||
href="download.html">Download</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</aside>
|
||||
|
||||
<div class="content">
|
||||
<div class="bcms-clearfix"></div>
|
||||
<h3 class="section-title">License</h3>
|
||||
<p>Copyright (c) 2013 Marco Pivetta</p>
|
||||
|
||||
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
|
||||
|
||||
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
|
||||
|
||||
<p>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.</p>
|
||||
<hr />
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="site-footer" role="contentinfo">
|
||||
<div class="container">
|
||||
<div class="footer-logos">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a> | </li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a> | </li>
|
||||
<li><a href="null-object.html">Null Objects</a> | </li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a> | </li>
|
||||
<li><a href="remote-object.html">Remote Object</a> | </li>
|
||||
<li><a href="contributing.html">Contributing</a> | </li>
|
||||
<li><a href="credits.html">Credits</a> | </li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bcms-clearfix"></div>
|
||||
</footer>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</body>
|
||||
</html>
|
113
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/credits.html
vendored
Normal file
113
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/credits.html
vendored
Normal file
@ -0,0 +1,113 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" id="top">
|
||||
<head>
|
||||
<title>ProxyManager - Credits</title>
|
||||
|
||||
<meta name="description" content="A proxyManager write in php" />
|
||||
<meta name="keywords" content="ProxyManager, proxy, manager, ocramius, Marco Pivetta, php, credits" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600' rel='stylesheet' type='text/css'>
|
||||
<link href="css/styles.css" rel="stylesheet" />
|
||||
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<h1><a href="index.html"><img alt="ProxyManager" src="img/block.png" /></a></h1>
|
||||
|
||||
<nav class="main-nav" role="navigation">
|
||||
<ul>
|
||||
<li><a href="https://github.com/Ocramius/ProxyManager" target="_blank">Github</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main role="main">
|
||||
<section class="component-content">
|
||||
|
||||
<div class="component-demo" id="live-demo">
|
||||
<div class="container">
|
||||
<div class="main-wrapper" style="text-align: right">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=fork&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="310" height="40"></iframe>
|
||||
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="40"></iframe>
|
||||
|
||||
</div>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-info">
|
||||
<div class="container">
|
||||
<aside class="sidebar">
|
||||
<nav class="spy-nav">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a></li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a></li>
|
||||
<li><a href="null-object.html">Null Objects</a></li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a></li>
|
||||
<li><a href="remote-object.html">Remote Object</a></li>
|
||||
<li><a href="contributing.html">Contributing</a></li>
|
||||
<li><a href="credits.html">Credits</a></li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
<a class="btn btn-action btn-full download-component"
|
||||
href="download.html">Download</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</aside>
|
||||
|
||||
<div class="content">
|
||||
<div class="bcms-clearfix"></div>
|
||||
<h3 class="section-title">Credits</h3>
|
||||
|
||||
<p>The idea was originated by a <a href="http://marco-pivetta.com/proxy-pattern-in-php/" target="_blank">talk about Proxies in PHP OOP</a> that I gave at the <a href="https://twitter.com/phpugffm" target="_blank">@phpugffm</a> in January 2013.</p>
|
||||
<hr />
|
||||
<h3>Contributors</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://github.com/Ocramius" target="_blank">Marco Pivetta</a></li>
|
||||
<li><a href="https://github.com/malukenho" target="_blank">Jefersson Nathan</a></li>
|
||||
<li><a href="https://github.com/blanchonvincent" target="_blank">Blanchon Vincent</a></li>
|
||||
<li><a href="https://github.com/staabm" target="_blank">Markus Staab</a></li>
|
||||
<li><a href="https://github.com/gws" target="_blank">Gordon Stratton</a></li>
|
||||
<li><a href="https://github.com/prolic" target="_blank">Prolic</a></li>
|
||||
<li><a href="https://github.com/guilro" target="_blank">Guillaume Royer</a></li>
|
||||
<li><a href="https://github.com/reiz" target="_blank">Robert Reiz</a></li>
|
||||
<li><a href="https://github.com/leedavis81" target="_blank">Lee Davis</a></li>
|
||||
<li><a href="https://github.com/flip111" target="_blank">flip111</a></li>
|
||||
<li><a href="https://github.com/krymen" target="_blank">Krzysztof Menzyk</a></li>
|
||||
<li><a href="https://github.com/Xerkus" target="_blank">Aleksey Khudyakov</a></li>
|
||||
<li><a href="https://github.com/asm89" target="_blank">Alexander</a></li>
|
||||
<li><a href="https://github.com/raulfraile" target="_blank">Raul Fraile</a></li>
|
||||
</ul>
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="site-footer" role="contentinfo">
|
||||
<div class="container">
|
||||
<div class="footer-logos">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a> | </li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a> | </li>
|
||||
<li><a href="null-object.html">Null Objects</a> | </li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a> | </li>
|
||||
<li><a href="remote-object.html">Remote Object</a> | </li>
|
||||
<li><a href="contributing.html">Contributing</a> | </li>
|
||||
<li><a href="credits.html">Credits</a> | </li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bcms-clearfix"></div>
|
||||
</footer>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</body>
|
||||
</html>
|
203
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/css/styles.css
vendored
Normal file
203
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/css/styles.css
vendored
Normal file
@ -0,0 +1,203 @@
|
||||
html { font-family: sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
|
||||
body { margin: 0; }
|
||||
article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; }
|
||||
audio, canvas, progress, video { display: inline-block; vertical-align: baseline; }
|
||||
audio:not([controls]) { display: none; height: 0; }
|
||||
[hidden], template { display: none; }
|
||||
a { background: transparent; }
|
||||
a:active, a:hover { outline: 0; }
|
||||
abbr[title] { border-bottom: 1px dotted; }
|
||||
b, strong { font-weight: bold; }
|
||||
dfn { font-style: italic; }
|
||||
h1 { font-size: 2em; margin: 0.67em 0; }
|
||||
mark { background: #ff0; color: #000; }
|
||||
small { font-size: 80%; }
|
||||
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
|
||||
sup { top: -0.5em; }
|
||||
sub { bottom: -0.25em; }
|
||||
img { border: 0; }
|
||||
svg:not(:root) { overflow: hidden; }
|
||||
figure { margin: 1em 40px; }
|
||||
hr { -moz-box-sizing: content-box; box-sizing: content-box; height: 0; }
|
||||
pre { overflow: auto; }
|
||||
code, kbd, pre, samp { font-family: monospace, monospace; font-size: 1em; }
|
||||
button, input, optgroup, select, textarea { color: inherit; font: inherit; margin: 0; }
|
||||
button { overflow: visible; }
|
||||
button, select { text-transform: none; }
|
||||
button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; cursor: pointer; }
|
||||
button[disabled], html input[disabled] { cursor: default; }
|
||||
button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; }
|
||||
input { line-height: normal; }
|
||||
input[type="checkbox"], input[type="radio"] { box-sizing: border-box; padding: 0; }
|
||||
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { height: auto; }
|
||||
input[type="search"] { -webkit-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; }
|
||||
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
|
||||
fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; }
|
||||
legend { border: 0; padding: 0; }
|
||||
textarea { overflow: auto; }
|
||||
optgroup { font-weight: bold; }
|
||||
table { border-collapse: collapse; border-spacing: 0; }
|
||||
td, th { padding: 0; }
|
||||
h1, h2, h3, h4, h5, h6, p, ul, ol, li { margin: 0; padding: 0; line-height: normal; }
|
||||
a { color: #31811D; text-decoration: none; }
|
||||
a:hover { color: #2F611C; text-decoration: none; }
|
||||
strong { font-weight: 600; }
|
||||
h3 { margin-bottom: 1em; color: #17324f; font-weight: 400; font-size: 3em; }
|
||||
h4 { margin-bottom: 1em; font-weight: 400; font-size: 1.375em; }
|
||||
p { margin-bottom: 1.5em; font-size: 1.125em; }
|
||||
hr { margin: 2.5em 0; padding: 0; width: 100%; height: 3px; border: 0; background: #e6eaef; }
|
||||
pre code { padding: 20px; border: 1px solid #EBEBEB; background: #F5F5F5; color: #08468a; font-weight: 200; font-size: .875em; }
|
||||
code { background: transparent; color: #08468a; font-size: .875em; }
|
||||
form { margin: 0; }
|
||||
label { display: block; color: #18324f; font-weight: 400; font-size: 1.5em; margin-bottom: 2em; }
|
||||
legend { position: static; margin: 0; padding: 0; font-weight: normal; }
|
||||
legend span { position: absolute; top: 0; right: 0; left: 0; display: block; padding: 7px 0; border-bottom: 1px solid #e0dede; color: #ed4a21; font-size: 18px; line-height: 1em; }
|
||||
|
||||
/* Menu Sidebar*/
|
||||
.button-block { padding-top: 15px; }
|
||||
.button-block .btn-1 { margin-right: 6px; }
|
||||
.btn, .spy-nav a { position: relative; display: inline-block; margin: 0; padding: 0 20px; height: 57px; border: 0; vertical-align: top; text-align: center; text-transform: uppercase; font-weight: 400; font-size: 1.125em; transitionP: all .2s; line-height: 57px; }
|
||||
.btn.btn-action, .spy-nav a.btn-action { background: #ee2d4d; color: #fff; }
|
||||
.btn.btn-action:hover, .spy-nav a.btn-action:hover { background: #bf0f2d; }
|
||||
.btn.btn-default, .spy-nav a { background: #31811D; color: #fff; }
|
||||
.btn.btn-default:hover, .spy-nav a:hover { background: #2F611C; color: #fff; }
|
||||
.btn.btn-text, .spy-nav a.btn-text { color: #18324f; font-weight: 600; }
|
||||
.btn.btn-full, .spy-nav a { display: block; }
|
||||
@media only screen and (max-width: 480px) {
|
||||
.site-header{ position: fixed !important; top: 0; z-index: 999999}
|
||||
.page-title-wrapper{ margin-top: 70px;}
|
||||
.main-wrapper iframe{ width: 42% !important; float: left; margin-left: 8%;}
|
||||
.content iframe{width: 100%; height: 100%;}
|
||||
}
|
||||
|
||||
.btn-top { position: relative; display: inline-block; float: right; margin: 20px 0 0; padding: 0 30px 0 50px; height: 57px; border: 2px solid ##31811D; color: #31811D; vertical-align: top; text-align: center; text-transform: uppercase; font-weight: 600; font-size: 1.125em; line-height: 53px; transition: all .2s; }
|
||||
.btn-top:before { background-position: 0 -140px; width: 52px; height: 52px; position: absolute; top: 0; left: 0; content: ''; }
|
||||
@media only screen and (min-resolution: 2dppx), (-webkit-min-device-pixel-ratio: 2) { .btn-top:before { background-position: 0 -140px; background-size: 152px auto; width: 52px; height: 52px; } }
|
||||
.btn-top:hover { border-color: #2F611C; color: #2F611C; }
|
||||
@media only screen and (max-width: 768px) { .btn-top { float: none; margin-top: 0; margin-bottom: 30px; white-space: nowrap; } }
|
||||
@media only screen and (max-width: 480px) { .btn-top { font-size: 0.9em; line-height: 46px; height: 48px; padding-right: 22px; padding-left: 47px; } }
|
||||
|
||||
.btn-download { float: right; padding-left: 50px; }
|
||||
.btn-download:before { background-position: -18px -116px; width: 16px; height: 16px; position: absolute; top: 50%; left: 20px; margin-top: -7px; content: ''; }
|
||||
@media only screen and (min-resolution: 2dppx), (-webkit-min-device-pixel-ratio: 2) { .btn-download:before { background-position: -18px -116px; background-size: 152px auto; width: 16px; height: 16px; } }
|
||||
|
||||
.btn-done { float: right; padding-left: 50px; }
|
||||
.btn-done:before { background-position: 0 -116px; width: 18px; height: 14px; position: absolute; top: 50%; margin-top: -7px; left: 20px; content: ''; }
|
||||
@media only screen and (min-resolution: 2dppx), (-webkit-min-device-pixel-ratio: 2) { .btn-done:before { background-position: 0 -116px; background-size: 152px auto; width: 18px; height: 13.5px; margin-top: -6.75px; } }
|
||||
|
||||
.btn-cancel { float: right; }
|
||||
|
||||
*, *:before, *:after { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
|
||||
|
||||
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; min-width: 280px; }
|
||||
@media only screen and (min-width: 64.063em) and (max-width: 90em) { html { min-width: 960px; } }
|
||||
|
||||
body { font-size: 16px; font-family: 'Source Sans Pro', sans-serif; min-width: 290px; }
|
||||
@media only screen and (max-width: 480px) { body.page-home { background-image: none; } }
|
||||
|
||||
img { max-width: 100%; height: auto !important; }
|
||||
|
||||
input { -webkit-appearance: none; -webkit-border-radius: 0; border-radius: 0; }
|
||||
|
||||
main { overflow: hidden; }
|
||||
|
||||
.clearfix:after { content: ""; display: table; clear: both; }
|
||||
|
||||
.container { width: 60em; margin-left: auto; margin-right: auto; }
|
||||
.container:after { content: " "; display: block; clear: both; }
|
||||
@media only screen and (max-width: 1024px) { .container { margin-left: 15px; margin-right: 15px; width: auto; } }
|
||||
|
||||
.content ul { padding-left: 19px; list-style-type: square; margin-top: 15px; }
|
||||
|
||||
/* Menu top */
|
||||
.main-nav { float: right; }
|
||||
.fixed-wrapper .main-nav { display: none; }
|
||||
.active .main-nav { display: block; }
|
||||
.main-nav > ul { list-style: none; }
|
||||
.main-nav > ul > li { float: left; }
|
||||
.main-nav > ul > li > a { display: block; padding: 22px 30px; color: #fff; text-decoration: none; text-transform: uppercase; font-weight: 600; font-size: 1.375em; line-height: 29px; transition: all .2s; }
|
||||
.main-nav > ul > li > a:hover { color: #bfe5f1; background-color: #2F611C; }
|
||||
.main-nav > ul > li > a.active { background-color: #2F611C; color: #fff; }
|
||||
.main-nav > ul > li > a.opened { background-color: #18324f; }
|
||||
@media only screen and (max-width: 600px) { .main-nav { font-size: 0.86em; }
|
||||
.main-nav > ul > li > a { padding-left: 18px; padding-right: 18px; } }
|
||||
@media only screen and (max-width: 480px) { .main-nav > ul > li > a { font-size: 0.95em; padding: 22px 6px; } }
|
||||
|
||||
.site-header { position: relative; width: 100%; background: #31811D; }
|
||||
.site-header h1 { float: left; margin: 15px 0; }
|
||||
.site-header h1 a { display: block; }
|
||||
.site-header h1 img { display: block; max-height: 42px; }
|
||||
@media only screen and (max-width: 480px) { .site-header h1 img { max-height: 42px; } }
|
||||
|
||||
.page-title-wrapper { position: relative; padding: 26px 0 55px; text-align: center; }
|
||||
.page-title-wrapper .page-title { margin-top: 44px; color: #17324f; font-weight: 400; font-size: 3.75em; }
|
||||
.page-title-wrapper .linguistics { padding: 0 2em 13px; border-bottom: 1px solid #D4DBE3; color: #18324f; text-transform: uppercase; font-weight: 400; font-size: 1.25em; }
|
||||
@media only screen and (max-width: 768px) { .page-title-wrapper { font-size: 0.8em; } }
|
||||
@media only screen and (max-width: 480px) { .page-title-wrapper { font-size: 0.65em; } }
|
||||
|
||||
.site-footer { margin-top: 20px; padding-top: 50px; padding-bottom: 50px; background: #18324f; color: #7c8ea3; text-align: center; }
|
||||
.site-footer .container { position: relative; }
|
||||
.site-footer + .bcms-clearfix:after { content: ""; }
|
||||
.about + .site-footer .main { padding-top: 150px; }
|
||||
.footer-logos ul li{ list-style: none; display: inline-block;}
|
||||
.footer-logos ul li a{ padding-left: 10px; padding-right: 10px}
|
||||
.site-footer a{ color: white !important;}
|
||||
.site-footer p { text-align: left; display: block; margin-bottom: 1.5em; font-size: 1.125em; }
|
||||
@media only screen and (max-width: 1024px) { .site-footer p { margin-left: 0; } }
|
||||
@media only screen and (max-width: 768px) { .site-footer p { text-align: center; margin-left: auto; } }
|
||||
@media only screen and (max-width: 600px) { .site-footer { font-size: 0.9em; } }
|
||||
|
||||
.main-logo { display: block; float: left; margin: 30px 0; }
|
||||
.fixed-wrapper .main-logo { display: none; }
|
||||
.main-logo img { display: block; }
|
||||
.main-logo figure { position: relative; margin: 0; max-width: 56px; }
|
||||
.main-logo figcaption { position: absolute; width: 160px; top: 20px; left: 68px; }
|
||||
.active .main-logo { display: block; margin: 0; }
|
||||
.active .main-logo figure { max-width: 42px; }
|
||||
.active .main-logo figcaption { width: 120px; top: 15px; left: 55px; }
|
||||
@media only screen and (max-width: 480px) { .main-logo figcaption { display: none; } }
|
||||
|
||||
.container { width: 60em; margin-left: auto; margin-right: auto; }
|
||||
.container:after { content: " "; display: block; clear: both; }
|
||||
@media only screen and (max-width: 1024px) { .container { margin-left: 15px; margin-right: 15px; width: auto; } }
|
||||
|
||||
.component-demo { position: relative; padding: 1px 0 0; background: #e6eaef; }
|
||||
.component-demo:before { background-image: url("../img/enf.png"); }
|
||||
@media only screen and (max-width: 480px) { .component-demo { padding: 40px 0 0; } }
|
||||
|
||||
.component-info .container { position: relative; }
|
||||
.component-info .sidebar { width: 220px; float: left; margin-top: 75px; }
|
||||
.component-info .sidebar .component-meta { margin-top: 10px; font-size: 1.125em; }
|
||||
.component-info .sidebar .component-meta span { white-space: nowrap; margin-bottom: 10px; padding-left: 25px; color: #18324f; }
|
||||
.component-info .sidebar.sticky { position: fixed; margin-top: 38px; }
|
||||
.component-info .content { width: 64.58333333%; float: right; margin-top: 60px; margin-bottom: 75px; }
|
||||
.component-info .content h3 { margin-bottom: .75em; font-size: 2.75em; }
|
||||
.component-info .content p { margin-bottom: 1.75em; line-height: 1.45; }
|
||||
@media only screen and (max-width: 480px) { .component-info .content .section-title { font-size: 2.1em; } }
|
||||
@media only screen and (max-width: 768px) { .component-info .sidebar { float: none; margin-left: auto; margin-right: auto; }
|
||||
.component-info .sidebar .component-meta { margin-top: 30px; text-align: center; }
|
||||
.component-info .sidebar.sticky { position: relative; margin-top: 75px; }
|
||||
.component-info .content { float: none; width: 100%; } }
|
||||
@media only screen and (max-width: 480px) { .component-info .content { margin-bottom: 0; } }
|
||||
|
||||
.spy-nav { margin-bottom: 10px; }
|
||||
.spy-nav ul { list-style: none; }
|
||||
.spy-nav a { padding-top: 9px; padding-bottom: 10px; height: auto; border-bottom: 1px solid #4B8B20; text-align: left; text-transform: none; font-size: 1.375em; line-height: normal; }
|
||||
.spy-nav .active a { border-bottom-color: #fff; background: #fff; color: #17324f; }
|
||||
@media only screen and (max-width: 768px) { /*.spy-nav { display: none; } */}
|
||||
|
||||
.main-wrapper { margin: 44px auto 44px; max-width: 600px; }
|
||||
.main-wrapper label { display: block; margin-bottom: .75em; color: #3f4e5e; font-size: 1.25em; }
|
||||
.main-wrapper .text-field { padding: 0 15px; width: 100%; height: 40px; border: 1px solid #CBD3DD; font-size: 1.125em; }
|
||||
.main-wrapper ::-webkit-input-placeholder { color: #CBD3DD; font-style: italic; font-size: 18px; }
|
||||
.main-wrapper :-moz-placeholder { color: #CBD3DD; font-style: italic; font-size: 18px; }
|
||||
.main-wrapper ::-moz-placeholder { color: #CBD3DD; font-style: italic; font-size: 18px; }
|
||||
.main-wrapper :-ms-input-placeholder { color: #CBD3DD; font-style: italic; font-size: 18px; }
|
||||
|
||||
.page-icon-wrapper:before, .page-icon-wrapper .logo-asp:before, .page-icon-wrapper .logo-hibernate:before, .page-icon-wrapper .logo-angularjs:before, .page-icon-wrapper .logo-requirejs:before, .page-icon-wrapper .logo-reward:before, .component-demo:before {background-repeat: no-repeat; background-size: 100%; width: 92px; height: 108px; position: absolute; left: 50%; margin-left: -46px; top: 0; bottom: auto; margin-top: -28px; content: ''; }
|
||||
|
||||
.container { width: 60em; margin-left: auto; margin-right: auto; }
|
||||
.container:after { content: " "; display: block; clear: both; }
|
||||
@media only screen and (max-width: 1024px) { .container { margin-left: 15px; margin-right: 15px; width: auto; } }
|
||||
|
||||
.bcms-clearfix:after {content: ""; visibility: hidden; display: block; height: 0; clear: both; }
|
97
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/download.html
vendored
Normal file
97
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/download.html
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" id="top">
|
||||
<head>
|
||||
<title>ProxyManager</title>
|
||||
|
||||
<meta name="description" content="A proxyManager write in php" />
|
||||
<meta name="keywords" content="ProxyManager, proxy, manager, ocramius, Marco Pivetta, php" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600' rel='stylesheet' type='text/css'>
|
||||
<link href="css/styles.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<h1><a href="index.html"><img alt="ProxyManager" src="img/block.png" /></a></h1>
|
||||
|
||||
<nav class="main-nav" role="navigation">
|
||||
<ul>
|
||||
<li><a href="https://github.com/Ocramius/ProxyManager" target="_blank">Github</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main role="main">
|
||||
<section class="component-content">
|
||||
|
||||
<div class="component-demo" id="live-demo">
|
||||
<div class="container">
|
||||
<div class="main-wrapper" style="text-align: right">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=fork&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="310" height="40"></iframe>
|
||||
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="40"></iframe>
|
||||
|
||||
</div>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-info">
|
||||
<div class="container">
|
||||
<aside class="sidebar">
|
||||
<nav class="spy-nav">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a></li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a></li>
|
||||
<li><a href="null-object.html">Null Objects</a></li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a></li>
|
||||
<li><a href="remote-object.html">Remote Object</a></li>
|
||||
<li><a href="contributing.html">Contributing</a></li>
|
||||
<li><a href="credits.html">Credits</a></li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
<a class="btn btn-action btn-full download-component"
|
||||
href="download.html">Download</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</aside>
|
||||
|
||||
<div class="content">
|
||||
<div class="bcms-clearfix"></div>
|
||||
<h3 class="section-title">Installation</h3>
|
||||
<p>The suggested installation method is via <a href="https://getcomposer.org/" target="_blank">composer</a>.</p>
|
||||
<pre><code class="sh">php composer.phar require ocramius/proxy-manager:1.0.*</code></pre>
|
||||
<hr />
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="site-footer" role="contentinfo">
|
||||
<div class="container">
|
||||
<div class="footer-logos">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a> | </li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a> | </li>
|
||||
<li><a href="null-object.html">Null Objects</a> | </li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a> | </li>
|
||||
<li><a href="remote-object.html">Remote Object</a> | </li>
|
||||
<li><a href="contributing.html">Contributing</a> | </li>
|
||||
<li><a href="credits.html">Credits</a> | </li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bcms-clearfix"></div>
|
||||
</footer>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</body>
|
||||
</html>
|
BIN
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/favicon.ico
vendored
Normal file
BIN
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/favicon.ico
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 169 KiB |
314
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/ghost-object.html
vendored
Normal file
314
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/ghost-object.html
vendored
Normal file
@ -0,0 +1,314 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" id="top">
|
||||
<head>
|
||||
<title>ProxyManager - Ghost object</title>
|
||||
|
||||
<meta name="description" content="A proxyManager write in php" />
|
||||
<meta name="keywords" content="ProxyManager, proxy, manager, ocramius, Marco Pivetta, php, ghost object" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600' rel='stylesheet' type='text/css'>
|
||||
<link href="css/styles.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<h1><a href="index.html"><img alt="ProxyManager" src="img/block.png" /></a></h1>
|
||||
|
||||
<nav class="main-nav" role="navigation">
|
||||
<ul>
|
||||
<li><a href="https://github.com/Ocramius/ProxyManager" target="_blank">Github</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main role="main">
|
||||
<section class="component-content">
|
||||
|
||||
<div class="component-demo" id="live-demo">
|
||||
<div class="container">
|
||||
<div class="main-wrapper" style="text-align: right">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=fork&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="310" height="40"></iframe>
|
||||
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="40"></iframe>
|
||||
|
||||
</div>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-info">
|
||||
<div class="container">
|
||||
<aside class="sidebar">
|
||||
<nav class="spy-nav">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a></li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a></li>
|
||||
<li><a href="null-object.html">Null Objects</a></li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a></li>
|
||||
<li><a href="remote-object.html">Remote Object</a></li>
|
||||
<li><a href="contributing.html">Contributing</a></li>
|
||||
<li><a href="credits.html">Credits</a></li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
<a class="btn btn-action btn-full download-component"
|
||||
href="download.html">Download</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</aside>
|
||||
|
||||
<div class="content">
|
||||
<div class="bcms-clearfix"></div>
|
||||
<h3 class="section-title">Lazy Loading Ghost Object Proxies</h3>
|
||||
|
||||
<p>A lazy loading ghost object proxy is a ghost proxy that looks exactly like the real instance of the proxied subject, but which has all properties nulled before initialization.</p>
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Lazy loading with the Ghost Object</h3>
|
||||
|
||||
<p>In pseudo-code, in userland, <a href="http://www.martinfowler.com/eaaCatalog/lazyLoad.html" target="_blank">lazy loading</a> in a ghost object looks like following:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
class MyObjectProxy
|
||||
{
|
||||
private $initialized = false;
|
||||
private $name;
|
||||
private $surname;
|
||||
|
||||
public function doFoo()
|
||||
{
|
||||
$this->init();
|
||||
|
||||
// Perform doFoo routine using loaded variables
|
||||
}
|
||||
|
||||
private function init()
|
||||
{
|
||||
if (! $this->initialized) {
|
||||
$data = some_logic_that_loads_data();
|
||||
|
||||
$this->name = $data['name'];
|
||||
$this->surname = $data['surname'];
|
||||
|
||||
$this->initialized = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>Ghost objects work similarly to virtual proxies, but since they don't wrap around a "real" instance of the proxied subject, they are better suited for representing dataset rows.</p>
|
||||
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">When do I use a ghost object?</h3>
|
||||
|
||||
<p>You usually need a ghost object in cases where following applies</p>
|
||||
|
||||
<ul>
|
||||
<li>you are building a small data-mapper and want to lazily load data across associations in your object graph</li>
|
||||
<li>you want to initialize objects representing rows in a large dataset</li>
|
||||
<li>you want to compare instances of lazily initialized objects without the risk of comparing a proxy with a real subject</li>
|
||||
<li>you are aware of the internal state of the object and are confident in working with its internals via reflection or direct property access</li>
|
||||
</ul>
|
||||
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Usage examples</h3>
|
||||
|
||||
<p><a href="https://github.com/Ocramius/ProxyManager" target="_blank">ProxyManager</a> provides a factory that creates lazy loading ghost objects. To use it, follow these steps:</p>
|
||||
|
||||
<p>First of all, define your object's logic without taking care of lazy loading:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
namespace MyApp;
|
||||
|
||||
class Customer
|
||||
{
|
||||
private $name;
|
||||
private $surname;
|
||||
|
||||
// just write your business logic or generally logic
|
||||
// don't worry about how complex this object will be!
|
||||
// don't code lazy-loading oriented optimizations in here!
|
||||
public function getName() { return $this->name; }
|
||||
public function setName($name) { $this->name = (string) $name; }
|
||||
public function getSurname() { return $this->surname; }
|
||||
public function setSurname($surname) { $this->surname = (string) $surname; }
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>Then use the proxy manager to create a ghost object of it. You will be responsible of setting its state during lazy loading:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
namespace MyApp;
|
||||
|
||||
use ProxyManager\Factory\LazyLoadingGhostFactory;
|
||||
use ProxyManager\Proxy\LazyLoadingInterface;
|
||||
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
$factory = new LazyLoadingGhostFactory();
|
||||
$initializer = function (LazyLoadingInterface $proxy, $method, array $parameters, & $initializer) {
|
||||
$initializer = null; // disable initialization
|
||||
|
||||
// load data and modify the object here
|
||||
$proxy->setName('Agent');
|
||||
$proxy->setSurname('Smith');
|
||||
|
||||
return true; // confirm that initialization occurred correctly
|
||||
};
|
||||
|
||||
$instance = $factory->createProxy('MyApp\Customer', $initializer);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>You can now simply use your object as before:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
// this will just work as before
|
||||
echo $proxy->getName() . ' ' . $proxy->getSurname(); // Agent Smith
|
||||
</code>
|
||||
</pre>
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Lazy Initialization</h3>
|
||||
|
||||
<p>As you can see, we use a closure to handle lazy initialization of the proxy instance at runtime. The initializer closure signature for ghost objects should be as following:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
/**
|
||||
* @var object $proxy the instance the ghost object proxy that is being initialized
|
||||
* @var string $method the name of the method that triggered lazy initialization
|
||||
* @var array $parameters an ordered list of parameters passed to the method that
|
||||
* triggered initialization, indexed by parameter name
|
||||
* @var Closure $initializer a reference to the property that is the initializer for the
|
||||
* proxy. Set it to null to disable further initialization
|
||||
*
|
||||
* @return bool true on success
|
||||
*/
|
||||
$initializer = function ($proxy, $method, $parameters, & $initializer) {};
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>The initializer closure should usually be coded like following:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
$initializer = function ($proxy, $method, $parameters, & $initializer) {
|
||||
$initializer = null; // disable initializer for this proxy instance
|
||||
|
||||
// modify the object with loaded data
|
||||
$proxy->setFoo(/* ... */);
|
||||
$proxy->setBar(/* ... */);
|
||||
|
||||
return true; // report success
|
||||
};
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>The <code>ProxyManager\Factory\LazyLoadingGhostFactory</code> produces proxies that implement both the <code>ProxyManager\Proxy\GhostObjectInterface</code> and the <code>ProxyManager\Proxy\LazyLoadingInterface</code>.</p>
|
||||
|
||||
<p>At any point in time, you can set a new initializer for the proxy:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
$proxy->setProxyInitializer($initializer);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>In your initializer, you <strong>MUST</strong> turn off any further initialization:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
$proxy->setProxyInitializer(null);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>or</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
$initializer = null; // if you use the initializer passed by reference to the closure
|
||||
</code>
|
||||
</pre>
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Triggering Initialization</h3>
|
||||
|
||||
<p>A lazy loading ghost object is initialized whenever you access any property or method of it. Any of the following interactions would trigger lazy initialization:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
// calling a method
|
||||
$proxy->someMethod();
|
||||
|
||||
// reading a property
|
||||
echo $proxy->someProperty;
|
||||
|
||||
// writing a property
|
||||
$proxy->someProperty = 'foo';
|
||||
|
||||
// checking for existence of a property
|
||||
isset($proxy->someProperty);
|
||||
|
||||
// removing a property
|
||||
unset($proxy->someProperty);
|
||||
|
||||
// cloning the entire proxy
|
||||
clone $proxy;
|
||||
|
||||
// serializing the proxy
|
||||
$unserialized = unserialize(serialize($proxy));
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>Remember to call <code>$proxy->setProxyInitializer(null);</code> to disable initialization of your proxy, or it will happen more than once.</p>
|
||||
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Proxying interfaces</h3>
|
||||
|
||||
<p>You can also generate proxies from an interface FQCN. By proxying an interface, you will only be able to access the methods defined by the interface itself, even if the <code>wrappedObject</code> implements more methods. This will anyway save some memory since the proxy won't contain any properties.</p>
|
||||
|
||||
<p>Tuning performance for production</p>
|
||||
|
||||
<p>See <a href="production.html">Tuning ProxyManager for Production.</a></p>
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="site-footer" role="contentinfo">
|
||||
<div class="container">
|
||||
<div class="footer-logos">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a> | </li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a> | </li>
|
||||
<li><a href="null-object.html">Null Objects</a> | </li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a> | </li>
|
||||
<li><a href="remote-object.html">Remote Object</a> | </li>
|
||||
<li><a href="contributing.html">Contributing</a> | </li>
|
||||
<li><a href="credits.html">Credits</a> | </li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bcms-clearfix"></div>
|
||||
</footer>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</body>
|
||||
</html>
|
BIN
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/img/block.png
vendored
Normal file
BIN
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/img/block.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/img/enf.png
vendored
Normal file
BIN
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/img/enf.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
295
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/index.html
vendored
Normal file
295
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/index.html
vendored
Normal file
@ -0,0 +1,295 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" id="top">
|
||||
<head>
|
||||
<title>ProxyManager</title>
|
||||
|
||||
<meta name="description" content="A proxyManager write in php" />
|
||||
<meta name="keywords" content="ProxyManager, proxy, manager, ocramius, Marco Pivetta, php" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600' rel='stylesheet' type='text/css'>
|
||||
<link href="css/styles.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<h1><a href="index.html"><img alt="ProxyManager" src="img/block.png" /></a></h1>
|
||||
|
||||
<nav class="main-nav" role="navigation">
|
||||
<ul>
|
||||
<li><a href="https://github.com/Ocramius/ProxyManager" target="_blank">Github</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main role="main">
|
||||
<section class="component-content"><div class="page-title-wrapper">
|
||||
<div class="container">
|
||||
<img src="https://github.com/Ocramius/ProxyManager/raw/master/proxy-manager.png">
|
||||
<h2 class="page-title">Proxy Manager</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="component-demo" id="live-demo">
|
||||
<div class="container">
|
||||
<div class="main-wrapper" style="text-align: right">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=fork&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="310" height="40"></iframe>
|
||||
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="40"></iframe>
|
||||
|
||||
</div>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-info">
|
||||
<div class="container">
|
||||
|
||||
<aside class="sidebar">
|
||||
<nav class="spy-nav">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a></li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a></li>
|
||||
<li><a href="null-object.html">Null Objects</a></li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a></li>
|
||||
<li><a href="remote-object.html">Remote Object</a></li>
|
||||
<li><a href="contributing.html">Contributing</a></li>
|
||||
<li><a href="credits.html">Credits</a></li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
<a class="btn btn-action btn-full download-component"
|
||||
href="download.html">Download</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</aside>
|
||||
|
||||
<div class="content">
|
||||
<h3>Proxy Manager</h3>
|
||||
<p>This library aims at providing abstraction for generating various kinds of <a href="http://ocramius.github.io/presentations/proxy-pattern-in-php/" target="_blank">proxy classes</a>.</p>
|
||||
<p>If you want to learn more about proxy pattern watch this video:</p>
|
||||
|
||||
<iframe width="640" height="390" src="//www.youtube.com/embed/Ka8wlV8M6Vg" frameborder="0" allowfullscreen></iframe>
|
||||
<hr />
|
||||
<div class="bcms-clearfix"></div>
|
||||
<h3 class="section-title">Installation</h3>
|
||||
<p>The suggested installation method is via <a href="https://getcomposer.org/" target="_blank">composer</a>.</p>
|
||||
<pre><code class="sh">php composer.phar require ocramius/proxy-manager:1.0.*</code></pre>
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title" id="virtualproxy">Lazy Loading Value Holders (Virtual Proxy)</h3>
|
||||
|
||||
<p>ProxyManager can generate
|
||||
<a href="http://www.martinfowler.com/eaaCatalog/lazyLoad.html" target="_blank">lazy loading value holders</a>,
|
||||
which are virtual proxies capable of saving performance and memory for objects that
|
||||
require a lot of dependencies or CPU cycles to be loaded:
|
||||
particularly useful when you may not always need the object,
|
||||
but are constructing it anyways.</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
$factory = new \ProxyManager\Factory\LazyLoadingValueHolderFactory();
|
||||
|
||||
$proxy = $factory->createProxy(
|
||||
'MyApp\HeavyComplexObject',
|
||||
function (& $wrappedObject, $proxy, $method, $parameters, & $initializer) {
|
||||
$wrappedObject = new HeavyComplexObject(); // instantiation logic here
|
||||
$initializer = null; // turning off further lazy initialization
|
||||
|
||||
return true;
|
||||
}
|
||||
);
|
||||
|
||||
$proxy->doFoo();
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>See the <a href="virtual-proxy.html">complete documentation about lazy loading value holders</a>.</p>
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Access Interceptor Value Holder</h3>
|
||||
|
||||
<p>An access interceptor value holder is a smart reference that allows you to execute
|
||||
logic before and after a particular method is executed or a particular property is
|
||||
accessed, and it allows to manipulate parameters and return values depending on
|
||||
your needs.</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
$factory = new \ProxyManager\Factory\AccessInterceptorValueHolderFactory();
|
||||
|
||||
$proxy = $factory->createProxy(
|
||||
new \My\Db\Connection(),
|
||||
array('query' => function () { echo "Query being executed!\n"; }),
|
||||
array('query' => function () { echo "Query completed!\n"; })
|
||||
);
|
||||
|
||||
$proxy->query(); // produces "Query being executed!\nQuery completed!\n"
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>See the <a href="access-interceptor-value-holder-proxy.html">complete documentation about access interceptor value holders</a>.</p>
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Access Interceptor Scope Localizer</h3>
|
||||
|
||||
<p>An access interceptor scope localizer works exactly like an access interceptor
|
||||
value holder, but it is safe to use to proxy fluent interfaces.</p>
|
||||
|
||||
<p>See the <a href="access-interceptor-scope-localizer-proxy.html">complete documentation about access interceptor scope localizer</a>.</p>
|
||||
<hr />
|
||||
|
||||
|
||||
<h3 class="section-title">Null Objects</h3>
|
||||
|
||||
<p>A Null Object proxy implements the null object pattern.</p>
|
||||
|
||||
<p>This kind of proxy allows you to have fallback logic in case loading of the wrapped value failed.</p>
|
||||
<pre>
|
||||
<code class="php">
|
||||
$factory = new \ProxyManager\Factory\NullObjectFactory();
|
||||
|
||||
$proxy = $factory->createProxy('My\EntityObject');
|
||||
|
||||
$proxy->getName(); // empty return
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>A Null Object Proxy can be created from an object, a class name or an interface name:</p>
|
||||
<pre>
|
||||
<code class="php">
|
||||
$factory = new \ProxyManager\Factory\NullObjectFactory();
|
||||
|
||||
$proxy = $factory->createProxy('My\EntityObjectInterface');
|
||||
$proxy->getName(); // empty return
|
||||
|
||||
$proxy = $factory->createProxy($entity); // created from object
|
||||
$proxy->getName(); // empty return
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>See the <a href="null-object.html">complete documentation about null object proxy</a>.</p>
|
||||
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Ghost Objects</h3>
|
||||
|
||||
<p>Similar to value holder, a ghost object is usually created to handle lazy loading.</p>
|
||||
|
||||
<p>The difference between a value holder and a ghost object is that the ghost
|
||||
object does not contain a real instance of the required object, but handles
|
||||
lazy loading by initializing its own inherited properties.</p>
|
||||
|
||||
<p>ProxyManager can generate
|
||||
<a href="http://www.martinfowler.com/eaaCatalog/lazyLoad.html" target="_blank">lazy loading ghost objects</a>,
|
||||
which are proxies used to save performance and memory for large datasets and
|
||||
graphs representing relational data. Ghost objects are particularly useful
|
||||
when building data-mappers.</p>
|
||||
|
||||
<p>Additionally, the overhead introduced by ghost objects is very low when
|
||||
compared to the memory and performance overhead caused by virtual proxies.</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
$factory = new \ProxyManager\Factory\LazyLoadingGhostFactory();
|
||||
|
||||
$proxy = $factory->createProxy(
|
||||
'MyApp\HeavyComplexObject',
|
||||
function ($proxy, $method, $parameters, & $initializer) {
|
||||
$initializer = null; // turning off further lazy initialization
|
||||
|
||||
// modify the proxy instance
|
||||
$proxy->setFoo('foo');
|
||||
$proxy->setBar('bar');
|
||||
|
||||
return true;
|
||||
}
|
||||
);
|
||||
|
||||
$proxy->doFoo();
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>See the <a href="ghost-object.html">complete documentation about lazy loading ghost objects</a>.</p>
|
||||
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Remote Object</h3>
|
||||
|
||||
<p>A remote object proxy is an object that is located on a different system,
|
||||
but is used as if it was available locally. There's various possible
|
||||
remote proxy implementations, which could be based on xmlrpc/jsonrpc/soap/dnode/etc.</p>
|
||||
|
||||
<p>This example uses the XML-RPC client of Zend Framework 2:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
interface FooServiceInterface
|
||||
{
|
||||
public function foo();
|
||||
}
|
||||
|
||||
$factory = new \ProxyManager\Factory\RemoteObjectFactory(
|
||||
new \ProxyManager\Factory\RemoteObject\Adapter\XmlRpc(
|
||||
new \Zend\XmlRpc\Client('https://example.com/rpc-endpoint')
|
||||
)
|
||||
);
|
||||
|
||||
// proxy is your remote implementation
|
||||
$proxy = $factory->createProxy('FooServiceInterface');
|
||||
|
||||
var_dump($proxy->foo());
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>See the <a href="remote-object.html">complete documentation about remote objects</a>.</p>
|
||||
<hr />
|
||||
|
||||
|
||||
<h3 class="section-title">Contributing</h3>
|
||||
<p>Please read the <a href="contributing.html">CONTRIBUTING</a> contents if you wish to help out!</p>
|
||||
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Credits</h3>
|
||||
|
||||
<p>The idea was originated by a <a href="http://marco-pivetta.com/proxy-pattern-in-php/" target="_blank">talk about Proxies in PHP OOP</a> that I gave at the <a href="https://twitter.com/phpugffm" target="_blank">@phpugffm</a> in January 2013.</p>
|
||||
|
||||
|
||||
<div class="bcms-clearfix"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="site-footer" role="contentinfo">
|
||||
<div class="container">
|
||||
<div class="footer-logos">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a> | </li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a> | </li>
|
||||
<li><a href="null-object.html">Null Objects</a> | </li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a> | </li>
|
||||
<li><a href="remote-object.html">Remote Object</a> | </li>
|
||||
<li><a href="contributing.html">Contributing</a> | </li>
|
||||
<li><a href="credits.html">Credits</a> | </li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bcms-clearfix"></div>
|
||||
</footer>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</body>
|
||||
</html>
|
185
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/null-object.html
vendored
Normal file
185
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/null-object.html
vendored
Normal file
@ -0,0 +1,185 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" id="top">
|
||||
<head>
|
||||
<title>ProxyManager - Null object</title>
|
||||
|
||||
<meta name="description" content="A proxyManager write in php" />
|
||||
<meta name="keywords" content="ProxyManager, proxy, manager, ocramius, Marco Pivetta, php, null object" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600' rel='stylesheet' type='text/css'>
|
||||
<link href="css/styles.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<h1><a href="index.html"><img alt="ProxyManager" src="img/block.png" /></a></h1>
|
||||
|
||||
<nav class="main-nav" role="navigation">
|
||||
<ul>
|
||||
<li><a href="https://github.com/Ocramius/ProxyManager" target="_blank">Github</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main role="main">
|
||||
<section class="component-content">
|
||||
|
||||
<div class="component-demo" id="live-demo">
|
||||
<div class="container">
|
||||
<div class="main-wrapper" style="text-align: right">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=fork&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="310" height="40"></iframe>
|
||||
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="40"></iframe>
|
||||
|
||||
</div>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-info">
|
||||
<div class="container">
|
||||
<aside class="sidebar">
|
||||
<nav class="spy-nav">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a></li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a></li>
|
||||
<li><a href="null-object.html">Null Objects</a></li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a></li>
|
||||
<li><a href="remote-object.html">Remote Object</a></li>
|
||||
<li><a href="contributing.html">Contributing</a></li>
|
||||
<li><a href="credits.html">Credits</a></li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
<a class="btn btn-action btn-full download-component"
|
||||
href="download.html">Download</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</aside>
|
||||
|
||||
<div class="content">
|
||||
<div class="bcms-clearfix"></div>
|
||||
<h3 class="section-title">Null Object Proxy</h3>
|
||||
<p>A Null Object proxy is a <a href="http://en.wikipedia.org/wiki/Null_Object_pattern" target="_blank">null object pattern</a> implementation. The proxy factory creates a new object with defined neutral behavior based on an other object, class name or interface.</p>
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">What is null object proxy ?</h3>
|
||||
|
||||
<p>In your application, when you can't return the object related to the request, the consumer of the model must check for the return value and handle the failing condition gracefully, thus generating an explosion of conditionals throughout your code. Fortunately, this seemingly-tangled situation can be sorted out simply by creating a polymorphic implementation of the domain object, which would implement the same interface as the one of the object in question, only that its methods wouldn’t do anything, therefore offloading client code from doing repetitive checks for ugly null values when the operation is executed.</p>
|
||||
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Usage examples</h3>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
class UserMapper
|
||||
{
|
||||
private $adapter;
|
||||
|
||||
public function __construct(DatabaseAdapterInterface $adapter) {
|
||||
$this->adapter = $adapter;
|
||||
}
|
||||
|
||||
public function fetchById($id) {
|
||||
$this->adapter->select("users", array("id" => $id));
|
||||
if (!$row = $this->adapter->fetch()) {
|
||||
return null;
|
||||
}
|
||||
return $this->createUser($row);
|
||||
}
|
||||
|
||||
private function createUser(array $row) {
|
||||
$user = new Entity\User($row["name"], $row["email"]);
|
||||
$user->setId($row["id"]);
|
||||
return $user;
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>If you want to remove conditionals from client code, you need to have a version of the entity conforming to the corresponding interface. With the Null Object Proxy, you can build this object :</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
$factory = new \ProxyManager\Factory\NullObjectFactory();
|
||||
|
||||
$nullUser = $factory->createProxy('Entity\User');
|
||||
|
||||
var_dump($nullUser->getName()); // empty return
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>You can now return a valid entity :</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
class UserMapper
|
||||
{
|
||||
private $adapter;
|
||||
|
||||
public function __construct(DatabaseAdapterInterface $adapter) {
|
||||
$this->adapter = $adapter;
|
||||
}
|
||||
|
||||
public function fetchById($id) {
|
||||
$this->adapter->select("users", array("id" => $id));
|
||||
return $this->createUser($this->adapter->fetch());
|
||||
}
|
||||
|
||||
private function createUser($row) {
|
||||
if (!$row) {
|
||||
$factory = new \ProxyManager\Factory\NullObjectFactory();
|
||||
|
||||
return $factory->createProxy('Entity\User');
|
||||
}
|
||||
$user = new Entity\User($row["name"], $row["email"]);
|
||||
$user->setId($row["id"]);
|
||||
return $user;
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Proxying interfaces</h3>
|
||||
|
||||
<p>You can also generate proxies from an interface FQCN. By proxying an interface, you will only be able to access the methods defined by the interface itself, and like with the object, the methods are empty.</p>
|
||||
|
||||
<p>Tuning performance for production</p>
|
||||
|
||||
<p>See <a href="production.html">Tuning ProxyManager for Production.</a></p>
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="site-footer" role="contentinfo">
|
||||
<div class="container">
|
||||
<div class="footer-logos">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a> | </li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a> | </li>
|
||||
<li><a href="null-object.html">Null Objects</a> | </li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a> | </li>
|
||||
<li><a href="remote-object.html">Remote Object</a> | </li>
|
||||
<li><a href="contributing.html">Contributing</a> | </li>
|
||||
<li><a href="credits.html">Credits</a> | </li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bcms-clearfix"></div>
|
||||
</footer>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</body>
|
||||
</html>
|
114
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/production.html
vendored
Normal file
114
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/production.html
vendored
Normal file
@ -0,0 +1,114 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" id="top">
|
||||
<head>
|
||||
<title>ProxyManager - Tuning the ProxyManager for production</title>
|
||||
|
||||
<meta name="description" content="A proxyManager write in php" />
|
||||
<meta name="keywords" content="ProxyManager, proxy, manager, ocramius, Marco Pivetta, php, production" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600' rel='stylesheet' type='text/css'>
|
||||
<link href="css/styles.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<h1><a href="index.html"><img alt="ProxyManager" src="img/block.png" /></a></h1>
|
||||
|
||||
<nav class="main-nav" role="navigation">
|
||||
<ul>
|
||||
<li><a href="https://github.com/Ocramius/ProxyManager" target="_blank">Github</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main role="main">
|
||||
<section class="component-content">
|
||||
|
||||
<div class="component-demo" id="live-demo">
|
||||
<div class="container">
|
||||
<div class="main-wrapper" style="text-align: right">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=fork&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="310" height="40"></iframe>
|
||||
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="40"></iframe>
|
||||
|
||||
</div>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-info">
|
||||
<div class="container">
|
||||
<aside class="sidebar">
|
||||
<nav class="spy-nav">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a></li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a></li>
|
||||
<li><a href="null-object.html">Null Objects</a></li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a></li>
|
||||
<li><a href="remote-object.html">Remote Object</a></li>
|
||||
<li><a href="contributing.html">Contributing</a></li>
|
||||
<li><a href="credits.html">Credits</a></li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
<a class="btn btn-action btn-full download-component"
|
||||
href="download.html">Download</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</aside>
|
||||
|
||||
<div class="content">
|
||||
<div class="bcms-clearfix"></div>
|
||||
<h3 class="section-title">Tuning the ProxyManager for production</h3>
|
||||
|
||||
<p>By default, all proxy factories generate the required proxy classes at runtime.</p>
|
||||
|
||||
<p>Proxy generation causes I/O operations and uses a lot of reflection, so be sure to have generated all of your proxies <strong>before deploying your code on a live system</strong>, or you may experience poor performance.</p>
|
||||
|
||||
<p>You can configure ProxyManager so that it will try autoloading the proxies first. Generating them "bulk" is not yet implemented:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
$config = new \ProxyManager\Configuration();
|
||||
$config->setProxiesTargetDir(__DIR__ . '/my/generated/classes/cache/dir');
|
||||
|
||||
// then register the autoloader
|
||||
spl_autoload_register($config->getProxyAutoloader());
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>Generating a classmap with all your proxy classes in it will also work perfectly.</p>
|
||||
|
||||
<p>Please note that all the currently implemented <code>ProxyManager\Factory\*</code> classes accept a <code>ProxyManager\Configuration</code> object as optional constructor parameter. This allows for fine-tuning of ProxyManager according to your needs.</p>
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="site-footer" role="contentinfo">
|
||||
<div class="container">
|
||||
<div class="footer-logos">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a> | </li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a> | </li>
|
||||
<li><a href="null-object.html">Null Objects</a> | </li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a> | </li>
|
||||
<li><a href="remote-object.html">Remote Object</a> | </li>
|
||||
<li><a href="contributing.html">Contributing</a> | </li>
|
||||
<li><a href="credits.html">Credits</a> | </li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bcms-clearfix"></div>
|
||||
</footer>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</body>
|
||||
</html>
|
203
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/remote-object.html
vendored
Normal file
203
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/remote-object.html
vendored
Normal file
@ -0,0 +1,203 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" id="top">
|
||||
<head>
|
||||
<title>ProxyManager - Remote object</title>
|
||||
|
||||
<meta name="description" content="A proxyManager write in php" />
|
||||
<meta name="keywords" content="ProxyManager, proxy, manager, ocramius, Marco Pivetta, php, remote object" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600' rel='stylesheet' type='text/css'>
|
||||
<link href="css/styles.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<h1><a href="index.html"><img alt="ProxyManager" src="img/block.png" /></a></h1>
|
||||
|
||||
<nav class="main-nav" role="navigation">
|
||||
<ul>
|
||||
<li><a href="https://github.com/Ocramius/ProxyManager" target="_blank">Github</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main role="main">
|
||||
<section class="component-content">
|
||||
|
||||
<div class="component-demo" id="live-demo">
|
||||
<div class="container">
|
||||
<div class="main-wrapper" style="text-align: right">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=fork&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="310" height="40"></iframe>
|
||||
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="40"></iframe>
|
||||
|
||||
</div>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-info">
|
||||
<div class="container">
|
||||
<aside class="sidebar">
|
||||
<nav class="spy-nav">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a></li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a></li>
|
||||
<li><a href="null-object.html">Null Objects</a></li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a></li>
|
||||
<li><a href="remote-object.html">Remote Object</a></li>
|
||||
<li><a href="contributing.html">Contributing</a></li>
|
||||
<li><a href="credits.html">Credits</a></li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
<a class="btn btn-action btn-full download-component"
|
||||
href="download.html">Download</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</aside>
|
||||
|
||||
<div class="content">
|
||||
<div class="bcms-clearfix"></div>
|
||||
<h3 class="section-title">Remote Object Proxy</h3>
|
||||
|
||||
<p>The remote object implementation is a mechanism that enables an local object to control an other object on an other server. Each call method on the local object will do a network call to get information or execute operations on the remote object.</p>
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">What is remote object proxy ?</h3>
|
||||
|
||||
<p>A remote object is based on an interface. The remote interface defines the API that a consumer can call. This interface must be implemented both by the client and the RPC server.</p>
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Adapters</h3>
|
||||
|
||||
<p>ZendFramework's RPC components (XmlRpc, JsonRpc & Soap) can be used easily with the remote object. You will need to require the one you need via composer, though:</p>
|
||||
|
||||
<pre>
|
||||
<code class="sh">
|
||||
$ php composer.phar require zendframework/zend-xmlrpc:2.*
|
||||
$ php composer.phar require zendframework/zend-json:2.*
|
||||
$ php composer.phar require zendframework/zend-soap:2.*
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>ProxyManager comes with 3 adapters:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>ProxyManager\Factory\RemoteObject\Adapter\XmlRpc</code></li>
|
||||
<li><code>ProxyManager\Factory\RemoteObject\Adapter\JsonRpc</code></li>
|
||||
<li><code>ProxyManager\Factory\RemoteObject\Adapter\Soap</code></li>
|
||||
</ul>
|
||||
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Usage examples</h3>
|
||||
|
||||
<p>RPC server side code (<code>xmlrpc.php</code> in your local webroot):</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
interface FooServiceInterface
|
||||
{
|
||||
public function foo();
|
||||
}
|
||||
|
||||
class Foo implements FooServiceInterface
|
||||
{
|
||||
/**
|
||||
* Foo function
|
||||
* @return string
|
||||
*/
|
||||
public function foo()
|
||||
{
|
||||
return 'bar remote';
|
||||
}
|
||||
}
|
||||
|
||||
$server = new Zend\XmlRpc\Server();
|
||||
$server->setClass('Foo', 'FooServiceInterface'); // my FooServiceInterface implementation
|
||||
$server->handle();
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>Client side code (proxy) :</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
interface FooServiceInterface
|
||||
{
|
||||
public function foo();
|
||||
}
|
||||
|
||||
$factory = new \ProxyManager\Factory\RemoteObjectFactory(
|
||||
new \ProxyManager\Factory\RemoteObject\Adapter\XmlRpc(
|
||||
new \Zend\XmlRpc\Client('https://localhost/xmlrpc.php')
|
||||
)
|
||||
);
|
||||
|
||||
$proxy = $factory->createProxy('FooServiceInterface');
|
||||
|
||||
var_dump($proxy->foo()); // "bar remote"
|
||||
</code>
|
||||
</pre>
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Implementing custom adapters</h3>
|
||||
|
||||
<p>Your adapters must implement <code>ProxyManager\Factory\RemoteObject\AdapterInterface</code> :</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
interface AdapterInterface
|
||||
{
|
||||
/**
|
||||
* Call remote object
|
||||
*
|
||||
* @param string $wrappedClass
|
||||
* @param string $method
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function call($wrappedClass, $method, array $params = array());
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>It is very easy to create your own implementation (for RESTful web services, for example). Simply pass your own adapter instance to your factory at construction time</p>
|
||||
|
||||
<p>Tuning performance for production</p>
|
||||
|
||||
<p>See <a href="production.html">Tuning ProxyManager for Production.</a></p>
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="site-footer" role="contentinfo">
|
||||
<div class="container">
|
||||
<div class="footer-logos">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a> | </li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a> | </li>
|
||||
<li><a href="null-object.html">Null Objects</a> | </li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a> | </li>
|
||||
<li><a href="remote-object.html">Remote Object</a> | </li>
|
||||
<li><a href="contributing.html">Contributing</a> | </li>
|
||||
<li><a href="credits.html">Credits</a> | </li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bcms-clearfix"></div>
|
||||
</footer>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</body>
|
||||
</html>
|
305
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/virtual-proxy.html
vendored
Normal file
305
msd2/phpBB3/vendor/ocramius/proxy-manager/html-docs/virtual-proxy.html
vendored
Normal file
@ -0,0 +1,305 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" id="top">
|
||||
<head>
|
||||
<title>ProxyManager - Virtual Proxy</title>
|
||||
|
||||
<meta name="description" content="A proxyManager write in php" />
|
||||
<meta name="keywords" content="ProxyManager, proxy, manager, ocramius, Marco Pivetta, php, virtual proxy" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600' rel='stylesheet' type='text/css'>
|
||||
<link href="css/styles.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<h1><a href="index.html"><img alt="ProxyManager" src="img/block.png" /></a></h1>
|
||||
|
||||
<nav class="main-nav" role="navigation">
|
||||
<ul>
|
||||
<li><a href="https://github.com/Ocramius/ProxyManager" target="_blank">Github</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main role="main">
|
||||
<section class="component-content">
|
||||
|
||||
<div class="component-demo" id="live-demo">
|
||||
<div class="container">
|
||||
<div class="main-wrapper" style="text-align: right">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=fork&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="310" height="40"></iframe>
|
||||
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=ocramius&repo=ProxyManager&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="40"></iframe>
|
||||
|
||||
</div>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-info">
|
||||
<div class="container">
|
||||
<aside class="sidebar">
|
||||
<nav class="spy-nav">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a></li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a></li>
|
||||
<li><a href="null-object.html">Null Objects</a></li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a></li>
|
||||
<li><a href="remote-object.html">Remote Object</a></li>
|
||||
<li><a href="contributing.html">Contributing</a></li>
|
||||
<li><a href="credits.html">Credits</a></li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="bcms-clearfix bcms-clearfix"></div>
|
||||
<a class="btn btn-action btn-full download-component"
|
||||
href="download.html">Download</a>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</aside>
|
||||
|
||||
<div class="content">
|
||||
<div class="bcms-clearfix"></div>
|
||||
<h3 class="section-title">Lazy Loading Value Holder Proxy</h3>
|
||||
<p>A lazy loading value holder proxy is a virtual proxy that wraps and lazily initializes a "real" instance of the proxied class.</p>
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">What is lazy loading?</h3>
|
||||
|
||||
<p>In pseudo-code, in userland, <a href="http://www.martinfowler.com/eaaCatalog/lazyLoad.html" target="_blank">lazy loading</a> looks like following:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
class MyObjectProxy
|
||||
{
|
||||
private $wrapped;
|
||||
|
||||
public function doFoo()
|
||||
{
|
||||
$this->init();
|
||||
|
||||
return $this->wrapped->doFoo();
|
||||
}
|
||||
|
||||
private function init()
|
||||
{
|
||||
if (null === $this->wrapped) {
|
||||
$this->wrapped = new MyObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>This code is problematic, and adds a lot of complexity that makes your unit tests' code even worse.</p>
|
||||
|
||||
<p>Also, this kind of usage often ends up in coupling your code with a particular <a href="http://martinfowler.com/articles/injection.html" target="_blank">Dependency Injection Container</a> or a framework that fetches dependencies for you. That way, further complexity is introduced, and some problems related with service location raise, as I've explained <a href="http://ocramius.github.io/blog/zf2-and-symfony-service-proxies-with-doctrine-proxies/" target="_blank">in this article</a>.</p>
|
||||
|
||||
<p>Lazy loading value holders abstract this logic for you, hiding your complex, slow, performance-impacting objects behind tiny wrappers that have their same API, and that get initialized at first usage.</p>
|
||||
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">When do I use a lazy value holder?</h3>
|
||||
|
||||
<p>You usually need a lazy value holder in cases where following applies</p>
|
||||
|
||||
<ul>
|
||||
<li>your object takes a lot of time and memory to be initialized (with all dependencies)</li>
|
||||
<li>your object is not always used, and the instantiation overhead can be avoided</li>
|
||||
</ul>
|
||||
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Usage examples</h3>
|
||||
|
||||
<p>ProxyManager provides a factory that eases instantiation of lazy loading value holders. To use it, follow these steps:</p>
|
||||
|
||||
<p>First of all, define your object's logic without taking care of lazy loading:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
namespace MyApp;
|
||||
|
||||
class HeavyComplexObject
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// just write your business logic
|
||||
// don't worry about how heavy initialization of this will be!
|
||||
}
|
||||
|
||||
public function doFoo() {
|
||||
echo "OK!"
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>Then use the proxy manager to create a lazy version of the object (as a proxy):</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
namespace MyApp;
|
||||
|
||||
use ProxyManager\Factory\LazyLoadingValueHolderFactory;
|
||||
use ProxyManager\Proxy\LazyLoadingInterface;
|
||||
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
$factory = new LazyLoadingValueHolderFactory();
|
||||
$initializer = function (& $wrappedObject, LazyLoadingInterface $proxy, $method, array $parameters, & $initializer) {
|
||||
$initializer = null; // disable initialization
|
||||
$wrappedObject = new HeavyComplexObject(); // fill your object with values here
|
||||
|
||||
return true; // confirm that initialization occurred correctly
|
||||
};
|
||||
|
||||
$instance = $factory->createProxy('MyApp\HeavyComplexObject', $initializer);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>You can now simply use your object as before:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
// this will just work as before
|
||||
$proxy->doFoo(); // OK!
|
||||
</code>
|
||||
</pre>
|
||||
<hr />
|
||||
|
||||
|
||||
<h3 class="section-title">Lazy Initialization</h3>
|
||||
|
||||
<p>As you can see, we use a closure to handle lazy initialization of the proxy instance at runtime. The initializer closure signature should be as following:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
/**
|
||||
* @var object $wrappedObject the instance (passed by reference) of the wrapped object,
|
||||
* set it to your real object
|
||||
* @var object $proxy the instance proxy that is being initialized
|
||||
* @var string $method the name of the method that triggered lazy initialization
|
||||
* @var string $parameters an ordered list of parameters passed to the method that
|
||||
* triggered initialization, indexed by parameter name
|
||||
* @var Closure $initializer a reference to the property that is the initializer for the
|
||||
* proxy. Set it to null to disable further initialization
|
||||
*
|
||||
* @return bool true on success
|
||||
*/
|
||||
$initializer = function (& $wrappedObject, $proxy, $method, $parameters, & $initializer) {};
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>The initializer closure should usually be coded like following:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
$initializer = function (& $wrappedObject, $proxy, $method, $parameters, & $initializer) {
|
||||
$newlyCreatedObject = new Foo(); // instantiation logic
|
||||
$newlyCreatedObject->setBar('baz') // instantiation logic
|
||||
$newlyCreatedObject->setBat('bam') // instantiation logic
|
||||
|
||||
$wrappedObject = $newlyCreatedObject; // set wrapped object in the proxy
|
||||
$initializer = null; // disable initializer
|
||||
|
||||
return true; // report success
|
||||
};
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>The <code>ProxyManager\Factory\LazyLoadingValueHolderFactory</code> produces proxies that implement both the <code>ProxyManager\Proxy\ValueHolderInterface</code> and the <code>ProxyManager\Proxy\LazyLoadingInterface</code>.</p>
|
||||
|
||||
<p>At any point in time, you can set a new initializer for the proxy:</p>
|
||||
|
||||
<pre><code class="php">$proxy->setProxyInitializer($initializer);</code></pre>
|
||||
|
||||
<p>In your initializer, you currently <strong>MUST</strong> turn off any further initialization:</p>
|
||||
|
||||
<pre><code class="php">$proxy->setProxyInitializer(null);</code></pre>
|
||||
|
||||
<p>or</p>
|
||||
|
||||
<pre><code class="php">$initializer = null; // if you use the initializer by reference</code></pre>
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Triggering Initialization</h3>
|
||||
|
||||
<p>A lazy loading proxy is initialized whenever you access any property or method of it. Any of the following interactions would trigger lazy initialization:</p>
|
||||
|
||||
<pre>
|
||||
<code class="php">
|
||||
// calling a method
|
||||
$proxy->someMethod();
|
||||
|
||||
// reading a property
|
||||
echo $proxy->someProperty;
|
||||
|
||||
// writing a property
|
||||
$proxy->someProperty = 'foo';
|
||||
|
||||
// checking for existence of a property
|
||||
isset($proxy->someProperty);
|
||||
|
||||
// removing a property
|
||||
unset($proxy->someProperty);
|
||||
|
||||
// cloning the entire proxy
|
||||
clone $proxy;
|
||||
|
||||
// serializing the proxy
|
||||
$unserialized = serialize(unserialize($proxy));
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<p>Remember to call <code>$proxy->setProxyInitializer(null);</code> to disable initialization of your proxy, or it will happen more than once.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<h3 class="section-title">Proxying interfaces</h3>
|
||||
|
||||
<p>You can also generate proxies from an interface FQCN. By proxying an interface, you will only be able to access the methods defined by the interface itself, even if the wrappedObject implements more methods. This will anyway save some memory since the proxy won't contain useless inherited properties.</p>
|
||||
|
||||
<p>Tuning performance for production</p>
|
||||
|
||||
<p>See <a href="production.html">Tuning ProxyManager for Production.</a></p>
|
||||
|
||||
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="site-footer" role="contentinfo">
|
||||
<div class="container">
|
||||
<div class="footer-logos">
|
||||
<ul>
|
||||
<li><a href="index.html">Intro</a> | </li>
|
||||
<li><a href="virtual-proxy.html">Virtual Proxy</a> | </li>
|
||||
<li><a href="null-object.html">Null Objects</a> | </li>
|
||||
<li><a href="ghost-object.html">Ghost Objects</a> | </li>
|
||||
<li><a href="remote-object.html">Remote Object</a> | </li>
|
||||
<li><a href="contributing.html">Contributing</a> | </li>
|
||||
<li><a href="credits.html">Credits</a> | </li>
|
||||
<li><a href="copyright.html">Copyright</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bcms-clearfix"></div>
|
||||
</footer>
|
||||
<div class="bcms-clearfix"></div>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user