<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>

          Appserver.ioPHP 應(yīng)用服務(wù)器

          聯(lián)合創(chuàng)作 · 2023-10-01 15:02

          appserver.io 是一個(gè)多線程的 PHP 應(yīng)用服務(wù)器,實(shí)現(xiàn)真正多線程的 PHP 編程,高效安全而且快速,速度比基于 NginxMagento 標(biāo)準(zhǔn)安裝要快 50%。使用上非常像 Java 的 Servlet。

          亮點(diǎn):

          • 使用 Doctrine 作為標(biāo)準(zhǔn)的持久層

          • Session Beans (stateful, stateless + singleton)

          • Message Beans

          • Timer Service (tbd)

          • Servlet Engine

          • Integrated Message Queue

          • Easy scaling

          • Webservices

          要求:

          • PHP 5.4+ on x64 or x86

          • ZTS enabled (thread safety)

          • POSIX threads implementation

          • Memcached (2.1+)

          示例配置:

          <servlet>
              <description><![CDATA[A demo servlet]]></description>
              <display-name>DemoServlet</display-name>
              <servlet-name>DemoServlet</servlet-name>
              <servlet-class>\TechDivision\Example\Servlets\DemoServlet</servlet-class>
          </servlet>
          
          <servlet-mapping>
              <servlet-name>DemoServlet</servlet-name>
              <url-pattern>/</url-pattern>
          </servlet-mapping>

          示例代碼:

          public function doGet(Request $req, Response $res)
          {
              // build path to template
              $pathToTemplate = $this->getServletConfig()->getWebappPath() .
                  DIRECTORY_SEPARATOR . 'static' .
                  DIRECTORY_SEPARATOR . 'templates' .
                  DIRECTORY_SEPARATOR . 'layout.phtml';
          
              // init template
              $template = new DemoTemplate($pathToTemplate);
          
              $baseUrl = '/';
              // if the application has NOT been called over a
              //VHost configuration append application folder naem
              if (!$this->getServletConfig()->getApplication()->isVhostOf(
                  $req->getServerName())
              ) {
                  $baseUrl .= $this->getServletConfig()->getApplication()->getName() . '/';
              }
          
              // set vars in template
              $template->setBaseUrl($baseUrl);
              $template->setRequestUri($req->getUri());
              $template->setUserAgent($req->getHeader("User-Agent"));
              $template->setWebappName($this->getServletConfig()->getApplication()->getName());
          
              // set response content by render template
              $res->setContent($template->render());
          }
          瀏覽 13
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <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>
                  在线看AV的网站 | 国产婷婷999 | 麻豆91精品人妻成人无码 | 亚洲天堂日韩国 | 欧美大生殖器在线观看 |