3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org CakePHP(tm) Project * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ namespace Cake\View; use Cake\Core\App; use Cake\Event\EventManager; use Cake\Network\Request; use Cake\Network\Response; use Cake\Utility\Inflector; use Cake\Utility\ModelAwareTrait; use Cake\Utility\ViewVarsTrait; /** * Cell base. * */ abstract class Cell { use ModelAwareTrait; use ViewVarsTrait; /** * Instance of the View created during rendering. Won't be set until after * Cell::__toString() is called. * * @var \Cake\View\View */ public $View; /** * Name of the action that was invoked. * * Action name will be inflected to get the template name when rendering. * * @var string */ public $action; /** * Automatically set to the name of a plugin. * * @var string */ public $plugin = null; /** * An instance of a Cake\Network\Request object that contains information about the current request. * This object contains all the information about a request and several methods for reading * additional information about the request. * * @var \Cake\Network\Request */ public $request; /** * An instance of a Response object that contains information about the impending response * * @var \Cake\Network\Response */ public $response; /** * The name of the View class this cell sends output to. * * @var string */ public $viewClass = 'Cake\View\View'; /** * Instance of the Cake\Event\EventManager this cell is using * to dispatch inner events. * * @var \Cake\Event\EventManager */ protected $_eventManager = null; /** * These properties are settable directly on Cell and passed to the View as options. * * @var array * @see \Cake\View\View */ protected $_validViewOptions = [ 'viewVars', 'helpers', 'viewPath', 'plugin', ]; /** * List of valid options (constructor's fourth arguments) * * @var array */ protected $_validCellOptions = []; /** * Constructor. * * @param \Cake\Network\Request $request * @param \Cake\Network\Response $response * @param \Cake\Event\EventManager $eventManager * @param array $cellOptions */ public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $cellOptions = []) { $this->_eventManager = $eventManager; $this->request = $request; $this->response = $response; $this->modelFactory('Table', ['Cake\ORM\TableRegistry', 'get']); foreach ($this->_validCellOptions as $var) { if (isset($cellOptions[$var])) { $this->{$var} = $cellOptions[$var]; } } } /** * Rendering method. * * @param string $action Custom template name to render. If not provided (null), the last * value will be used. This value is automatically set by `CellTrait::cell()`. * @return void */ public function render($action = null) { if ($action !== null) { $this->action = $action; } return $this->__toString(); } /** * Magic method. * * Starts the rendering process when Cell is echoed. * * @return string Rendered cell */ public function __toString() { $this->View = $this->createView(); $this->View->layout = false; $className = explode('\\', get_class($this)); $className = array_pop($className); $this->View->subDir = 'Cell' . DS . substr($className, 0, strpos($className, 'Cell')); try { return $this->View->render(Inflector::underscore($this->action)); } catch (\Exception $e) { return ''; } } /** * Debug info. * * @return void */ public function __debugInfo() { return [ 'plugin' => $this->plugin, 'action' => $this->action, 'viewClass' => $this->viewClass, 'request' => $this->request, 'response' => $this->response, ]; } /** * Returns the Cake\Event\EventManager manager instance for this cell. * * You can use this instance to register any new listeners or callbacks to the * cell events, or create your own events and trigger them at will. * * @return \Cake\Event\EventManager */ public function getEventManager() { if (empty($this->_eventManager)) { $this->_eventManager = new EventManager(); } return $this->_eventManager; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mJCEN
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   DECLARE_CLASS                                            'cake%5Cview%5Ccell'
  195     1      > RETURN                                                   1

Class Cake\View\Cell:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 23
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 22
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/mJCEN
function name:  __construct
number of ops:  25
compiled vars:  !0 = $request, !1 = $response, !2 = $eventManager, !3 = $cellOptions, !4 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  114     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      null
          3        RECV_INIT                                        !3      <array>
  116     4        ASSIGN_OBJ                                               '_eventManager'
          5        OP_DATA                                                  !2
  117     6        ASSIGN_OBJ                                               'request'
          7        OP_DATA                                                  !0
  118     8        ASSIGN_OBJ                                               'response'
          9        OP_DATA                                                  !1
  119    10        INIT_METHOD_CALL                                         'modelFactory'
         11        SEND_VAL_EX                                              'Table'
         12        SEND_VAL_EX                                              <array>
         13        DO_FCALL                                      0          
  121    14        FETCH_OBJ_R                                      ~9      '_validCellOptions'
         15      > FE_RESET_R                                       $10     ~9, ->23
         16    > > FE_FETCH_R                                               $10, !4, ->23
  122    17    >   ISSET_ISEMPTY_DIM_OBJ                         0          !3, !4
         18      > JMPZ                                                     ~11, ->22
  123    19    >   FETCH_DIM_R                                      ~13     !3, !4
         20        ASSIGN_OBJ                                               !4
         21        OP_DATA                                                  ~13
  121    22    > > JMP                                                      ->16
         23    >   FE_FREE                                                  $10
  126    24      > RETURN                                                   null

End of function __construct

Function render:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/mJCEN
function name:  render
number of ops:  9
compiled vars:  !0 = $action
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  135     0  E >   RECV_INIT                                        !0      null
  136     1        TYPE_CHECK                                  1020          !0
          2      > JMPZ                                                     ~1, ->5
  137     3    >   ASSIGN_OBJ                                               'action'
          4        OP_DATA                                                  !0
  140     5    >   INIT_METHOD_CALL                                         '__toString'
          6        DO_FCALL                                      0  $3      
          7      > RETURN                                                   $3
  141     8*     > RETURN                                                   null

End of function render

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 47
Branch analysis from position: 47
2 jumps found. (Code = 107) Position 1 = 48, Position 2 = -2
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mJCEN
function name:  __toString
number of ops:  51
compiled vars:  !0 = $className, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  151     0  E >   INIT_METHOD_CALL                                         'createView'
          1        DO_FCALL                                      0  $3      
          2        ASSIGN_OBJ                                               'View'
          3        OP_DATA                                                  $3
  153     4        FETCH_OBJ_W                                      $4      'View'
          5        ASSIGN_OBJ                                               $4, 'layout'
          6        OP_DATA                                                  <false>
  154     7        INIT_NS_FCALL_BY_NAME                                    'Cake%5CView%5Cexplode'
          8        SEND_VAL_EX                                              '%5C'
          9        INIT_NS_FCALL_BY_NAME                                    'Cake%5CView%5Cget_class'
         10        FETCH_THIS                                       $6      
         11        SEND_VAR_EX                                              $6
         12        DO_FCALL                                      0  $7      
         13        SEND_VAR_NO_REF_EX                                       $7
         14        DO_FCALL                                      0  $8      
         15        ASSIGN                                                   !0, $8
  155    16        INIT_NS_FCALL_BY_NAME                                    'Cake%5CView%5Carray_pop'
         17        SEND_VAR_EX                                              !0
         18        DO_FCALL                                      0  $10     
         19        ASSIGN                                                   !0, $10
  156    20        FETCH_CONSTANT                                   ~14     'Cake%5CView%5CDS'
         21        CONCAT                                           ~15     'Cell', ~14
         22        INIT_NS_FCALL_BY_NAME                                    'Cake%5CView%5Csubstr'
         23        SEND_VAR_EX                                              !0
         24        SEND_VAL_EX                                              0
         25        INIT_NS_FCALL_BY_NAME                                    'Cake%5CView%5Cstrpos'
         26        SEND_VAR_EX                                              !0
         27        SEND_VAL_EX                                              'Cell'
         28        DO_FCALL                                      0  $16     
         29        SEND_VAR_NO_REF_EX                                       $16
         30        DO_FCALL                                      0  $17     
         31        CONCAT                                           ~18     ~15, $17
         32        FETCH_OBJ_W                                      $12     'View'
         33        ASSIGN_OBJ                                               $12, 'subDir'
         34        OP_DATA                                                  ~18
  159    35        FETCH_OBJ_R                                      ~19     'View'
         36        INIT_METHOD_CALL                                         ~19, 'render'
         37        INIT_STATIC_METHOD_CALL                                  'Cake%5CUtility%5CInflector', 'underscore'
         38        CHECK_FUNC_ARG                                           
         39        FETCH_OBJ_FUNC_ARG                               $20     'action'
         40        SEND_FUNC_ARG                                            $20
         41        DO_FCALL                                      0  $21     
         42        SEND_VAR_NO_REF_EX                                       $21
         43        DO_FCALL                                      0  $22     
         44        VERIFY_RETURN_TYPE                                       $22
         45      > RETURN                                                   $22
         46*       JMP                                                      ->49
  160    47  E > > CATCH                                       last         'Exception'
  161    48    > > RETURN                                                   ''
  163    49*       VERIFY_RETURN_TYPE                                       
         50*     > RETURN                                                   null

End of function __tostring

Function __debuginfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mJCEN
function name:  __debugInfo
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  172     0  E >   FETCH_OBJ_R                                      ~0      'plugin'
          1        INIT_ARRAY                                       ~1      ~0, 'plugin'
  173     2        FETCH_OBJ_R                                      ~2      'action'
          3        ADD_ARRAY_ELEMENT                                ~1      ~2, 'action'
  174     4        FETCH_OBJ_R                                      ~3      'viewClass'
          5        ADD_ARRAY_ELEMENT                                ~1      ~3, 'viewClass'
  175     6        FETCH_OBJ_R                                      ~4      'request'
          7        ADD_ARRAY_ELEMENT                                ~1      ~4, 'request'
  176     8        FETCH_OBJ_R                                      ~5      'response'
          9        ADD_ARRAY_ELEMENT                                ~1      ~5, 'response'
         10      > RETURN                                                   ~1
  178    11*     > RETURN                                                   null

End of function __debuginfo

Function geteventmanager:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 6
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/mJCEN
function name:  getEventManager
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  189     0  E >   ISSET_ISEMPTY_PROP_OBJ                                   '_eventManager'
          1      > JMPZ                                                     ~0, ->6
  190     2    >   NEW                                              $2      'Cake%5CEvent%5CEventManager'
          3        DO_FCALL                                      0          
          4        ASSIGN_OBJ                                               '_eventManager'
          5        OP_DATA                                                  $2
  192     6    >   FETCH_OBJ_R                                      ~4      '_eventManager'
          7      > RETURN                                                   ~4
  193     8*     > RETURN                                                   null

End of function geteventmanager

End of class Cake\View\Cell.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
280.62 ms | 1408 KiB | 24 Q