예제 #1
0
 /**
  * Test mb_trim.
  */
 public function testMbTrim()
 {
     $str = " \n x x x \n ";
     $expected = 'x x x';
     $actual = BVUtility::mb_trim($str);
     $this->assertEquals($expected, $actual);
 }
예제 #2
0
 /**
  * Render SEO
  *
  * Method used to do all the work to fetch, parse, and then return
  * the SEO payload. This is set as protected so classes inheriting
  * from the base class can invoke it or replace it if needed.
  *
  * @access protected
  * @return string
  */
 protected function _renderSEO($access_method)
 {
     $payload = '';
     $this->start_time = microtime(1);
     $isBot = $this->_isBot();
     if (!$isBot && $this->config['latency_timeout'] == 0) {
         $this->_setBuildMessage("EXECUTION_TIMEOUT is set to 0 ms; JavaScript-only Display.");
     } else {
         if ($isBot && $this->config['latency_timeout'] < 100) {
             $this->config['latency_timeout'] = 100;
             $this->_setBuildMessage("EXECUTION_TIMEOUT_BOT is less than the minimum value allowed. Minimum value of 100ms used.");
         }
         try {
             BVUtility::execTimer($this->config['latency_timeout'], $isBot, $this->start_time);
             $payload = $this->_getFullSeoContents($access_method);
         } catch (Exception $e) {
             $this->_setBuildMessage($e->getMessage());
         }
         BVUtility::stopTimer();
     }
     $payload .= $this->_buildComment($access_method);
     return $payload;
 }