<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Go!PHP的AOP庫

          聯(lián)合創(chuàng)作 · 2023-09-30 07:10

          Go! 是一個 PHP 5.4 庫,讓 PHP 支持 AOP 面向方面編程方法,無需 PECL 擴(kuò)展、Runkit、evals 或者 DI 容器支持??墒褂?XDebug 輕松調(diào)試。

          示例代碼:

          // Aspect/MonitorAspect.php
          
          namespace Aspect;
          
          use Go\Aop\Aspect;
          use Go\Aop\Intercept\FieldAccess;
          use Go\Aop\Intercept\MethodInvocation;
          use Go\Lang\Annotation\After;
          use Go\Lang\Annotation\Before;
          use Go\Lang\Annotation\Around;
          use Go\Lang\Annotation\Pointcut;
          
          /**
           * Monitor aspect
           */
          class MonitorAspect implements Aspect
          {
          
              /**
               * Method that will be called before real method
               *
               * @param MethodInvocation $invocation Invocation
               * @Before("execution(public Example->*(*))")
               */
              public function beforeMethodExecution(MethodInvocation $invocation)
              {
                  $obj = $invocation->getThis();
                  echo 'Calling Before Interceptor for method: ',
                       is_object($obj) ? get_class($obj) : $obj,
                       $invocation->getMethod()->isStatic() ? '::' : '->',
                       $invocation->getMethod()->getName(),
                       '()',
                       ' with arguments: ',
                       json_encode($invocation->getArguments()),
                       "<br>\n";
              }
          }
          瀏覽 20
          點贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  欧美黄色大片免费在线观看 | 日无码视频 | 日本少妇做爱视频 | 内射无码精品 | 99热这里只有免费精品 |