3v4l.org

run code in 300+ PHP versions simultaneously
<?php /*************************************************************** * Copyright notice * * (c) 2007 Dmitry Dulepov <dmitry@typo3.org> * All rights reserved * * This script is part of the TYPO3 project. The TYPO3 project is * free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * The GNU General Public License can be found at * http://www.gnu.org/copyleft/gpl.html. * * This script is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ /** * [CLASS/FUNCTION INDEX of SCRIPT] */ /** * Content post-processing functions. * * @author Dmitry Dulepov <dmitry@typo3.org> * @package TYPO3 * @subpackage tx_robots */ class tx_robots_postproc { /** * Checks for indexing flags * * @param array $params Unused * @param object $pObj Reference to TSFE */ function contentPostProcOutput(&$params, &$pObj) { // Only if flags are non-zero and <meta name="robots"> is not set already if ($GLOBALS['TSFE']->page['tx_robots_flags'] && false !== ($pos = stripos($pObj->content, '</head>')) && !preg_match('/<meta[^>]*\sname=([\'"])?robots\1/i', $pObj->content)) { $values = array(1 => 'index', 2 => 'follow'); if ($GLOBALS['TSFE']->page['tx_robots_flags'] & 1) { $values[1] = 'noindex'; } if ($GLOBALS['TSFE']->page['tx_robots_flags'] & 2) { $values[2] = 'nofollow'; } $pObj->content = substr($pObj->content, 0, $pos) . '<meta name="robots" content="' . implode(',', $values) . '" />' . chr(10) . substr($pObj->content, $pos); } } } if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/robots/class.tx_robots_postproc.php']) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/robots/class.tx_robots_postproc.php']); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 7
filename:       /in/42nKa
function name:  (null)
number of ops:  14
compiled vars:  !0 = $TYPO3_CONF_VARS
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   63     0  E >   DEFINED                                          ~1      'TYPO3_MODE'
          1      > JMPZ_EX                                          ~1      ~1, ->7
          2    >   FETCH_CONSTANT                                   ~2      'TYPO3_MODE'
          3        FETCH_DIM_R                                      ~3      !0, ~2
          4        FETCH_DIM_R                                      ~4      ~3, 'XCLASS'
          5        FETCH_DIM_R                                      ~5      ~4, 'ext%2Frobots%2Fclass.tx_robots_postproc.php'
          6        BOOL                                             ~1      ~5
          7    > > JMPZ                                                     ~1, ->13
   64     8    >   FETCH_CONSTANT                                   ~6      'TYPO3_MODE'
          9        FETCH_DIM_R                                      ~7      !0, ~6
         10        FETCH_DIM_R                                      ~8      ~7, 'XCLASS'
         11        FETCH_DIM_R                                      ~9      ~8, 'ext%2Frobots%2Fclass.tx_robots_postproc.php'
         12        INCLUDE_OR_EVAL                                          ~9, INCLUDE_ONCE
   67    13    > > RETURN                                                   1

Class tx_robots_postproc:
Function contentpostprocoutput:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 23
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 63
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
Branch analysis from position: 33
Branch analysis from position: 63
Branch analysis from position: 23
Branch analysis from position: 15
filename:       /in/42nKa
function name:  contentPostProcOutput
number of ops:  64
compiled vars:  !0 = $params, !1 = $pObj, !2 = $pos, !3 = $values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   46     2        FETCH_R                      global              ~4      'GLOBALS'
          3        FETCH_DIM_R                                      ~5      ~4, 'TSFE'
          4        FETCH_OBJ_R                                      ~6      ~5, 'page'
          5        FETCH_DIM_R                                      ~7      ~6, 'tx_robots_flags'
          6      > JMPZ_EX                                          ~7      ~7, ->15
   47     7    >   INIT_FCALL                                               'stripos'
          8        FETCH_OBJ_R                                      ~8      !1, 'content'
          9        SEND_VAL                                                 ~8
         10        SEND_VAL                                                 '%3C%2Fhead%3E'
         11        DO_ICALL                                         $9      
         12        ASSIGN                                           ~10     !2, $9
         13        TYPE_CHECK                                  1018  ~11     ~10
         14        BOOL                                             ~7      ~11
         15    > > JMPZ_EX                                          ~7      ~7, ->23
   48    16    >   INIT_FCALL                                               'preg_match'
         17        SEND_VAL                                                 '%2F%3Cmeta%5B%5E%3E%5D%2A%5Csname%3D%28%5B%27%22%5D%29%3Frobots%5C1%2Fi'
         18        FETCH_OBJ_R                                      ~12     !1, 'content'
         19        SEND_VAL                                                 ~12
         20        DO_ICALL                                         $13     
         21        BOOL_NOT                                         ~14     $13
         22        BOOL                                             ~7      ~14
         23    > > JMPZ                                                     ~7, ->63
   49    24    >   ASSIGN                                                   !3, <array>
   50    25        FETCH_R                      global              ~16     'GLOBALS'
         26        FETCH_DIM_R                                      ~17     ~16, 'TSFE'
         27        FETCH_OBJ_R                                      ~18     ~17, 'page'
         28        FETCH_DIM_R                                      ~19     ~18, 'tx_robots_flags'
         29        BW_AND                                           ~20     ~19, 1
         30      > JMPZ                                                     ~20, ->33
   51    31    >   ASSIGN_DIM                                               !3, 1
         32        OP_DATA                                                  'noindex'
   53    33    >   FETCH_R                      global              ~22     'GLOBALS'
         34        FETCH_DIM_R                                      ~23     ~22, 'TSFE'
         35        FETCH_OBJ_R                                      ~24     ~23, 'page'
         36        FETCH_DIM_R                                      ~25     ~24, 'tx_robots_flags'
         37        BW_AND                                           ~26     ~25, 2
         38      > JMPZ                                                     ~26, ->41
   54    39    >   ASSIGN_DIM                                               !3, 2
         40        OP_DATA                                                  'nofollow'
   56    41    >   INIT_FCALL                                               'substr'
         42        FETCH_OBJ_R                                      ~29     !1, 'content'
         43        SEND_VAL                                                 ~29
         44        SEND_VAL                                                 0
         45        SEND_VAR                                                 !2
         46        DO_ICALL                                         $30     
   57    47        CONCAT                                           ~31     $30, '%3Cmeta+name%3D%22robots%22+content%3D%22'
         48        INIT_FCALL                                               'implode'
         49        SEND_VAL                                                 '%2C'
         50        SEND_VAR                                                 !3
         51        DO_ICALL                                         $32     
         52        CONCAT                                           ~33     ~31, $32
         53        CONCAT                                           ~34     ~33, '%22+%2F%3E'
         54        CONCAT                                           ~35     ~34, '%0A'
   58    55        INIT_FCALL                                               'substr'
         56        FETCH_OBJ_R                                      ~36     !1, 'content'
         57        SEND_VAL                                                 ~36
         58        SEND_VAR                                                 !2
         59        DO_ICALL                                         $37     
         60        CONCAT                                           ~38     ~35, $37
   56    61        ASSIGN_OBJ                                               !1, 'content'
   58    62        OP_DATA                                                  ~38
   60    63    > > RETURN                                                   null

End of function contentpostprocoutput

End of class tx_robots_postproc.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.92 ms | 1409 KiB | 21 Q