3v4l.org

run code in 300+ PHP versions simultaneously
<?php #CreatedBy;Aaron;01NOV2014;Odin-Framework /* Disclaimer: I am just learning couchbase now, so don't trust this script. */ class bolt_couchbase { public $server; public $login; function __construct($conf) { if($conf['default_port']) { $this->set_server($conf['default_host'],$conf['auth'],$conf['default_port']); } elseif($conf['default_host']) { $this->set_server($conf['default_host'],$conf['auth']); } } function set_server($host,$login,$port=8092) { $this->server = $host.':'.$port; $this->login = $login['user'].':'.$login['pass']; } function pull($bucket,$view_path,$debug=NULL) { global $odin; if(!$this->server) { return $odin->debug->error('No host set'); } $uri = $this->server.'/'.$bucket.'/'.$view_path; $o = array( CURLOPT_USERPWD => $this->login, CURLOPT_CONNECTTIMEOUT => 3, ); if($debug) { $o['return_all'] = 1; } $ret = $odin->curl->request($uri,$o); return json_decode($ret); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mfpAQ
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E > > RETURN                                                   1

Class bolt_couchbase:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 25
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/mfpAQ
function name:  __construct
number of ops:  26
compiled vars:  !0 = $conf
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        FETCH_DIM_R                                      ~1      !0, 'default_port'
          2      > JMPZ                                                     ~1, ->15
   13     3    >   INIT_METHOD_CALL                                         'set_server'
          4        CHECK_FUNC_ARG                                           
          5        FETCH_DIM_FUNC_ARG                               $2      !0, 'default_host'
          6        SEND_FUNC_ARG                                            $2
          7        CHECK_FUNC_ARG                                           
          8        FETCH_DIM_FUNC_ARG                               $3      !0, 'auth'
          9        SEND_FUNC_ARG                                            $3
         10        CHECK_FUNC_ARG                                           
         11        FETCH_DIM_FUNC_ARG                               $4      !0, 'default_port'
         12        SEND_FUNC_ARG                                            $4
         13        DO_FCALL                                      0          
         14      > JMP                                                      ->25
   14    15    >   FETCH_DIM_R                                      ~6      !0, 'default_host'
         16      > JMPZ                                                     ~6, ->25
   15    17    >   INIT_METHOD_CALL                                         'set_server'
         18        CHECK_FUNC_ARG                                           
         19        FETCH_DIM_FUNC_ARG                               $7      !0, 'default_host'
         20        SEND_FUNC_ARG                                            $7
         21        CHECK_FUNC_ARG                                           
         22        FETCH_DIM_FUNC_ARG                               $8      !0, 'auth'
         23        SEND_FUNC_ARG                                            $8
         24        DO_FCALL                                      0          
   16    25    > > RETURN                                                   null

End of function __construct

Function set_server:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mfpAQ
function name:  set_server
number of ops:  14
compiled vars:  !0 = $host, !1 = $login, !2 = $port
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      8092
   20     3        CONCAT                                           ~4      !0, '%3A'
          4        CONCAT                                           ~5      ~4, !2
          5        ASSIGN_OBJ                                               'server'
          6        OP_DATA                                                  ~5
   21     7        FETCH_DIM_R                                      ~7      !1, 'user'
          8        CONCAT                                           ~8      ~7, '%3A'
          9        FETCH_DIM_R                                      ~9      !1, 'pass'
         10        CONCAT                                           ~10     ~8, ~9
         11        ASSIGN_OBJ                                               'login'
         12        OP_DATA                                                  ~10
   22    13      > RETURN                                                   null

End of function set_server

Function pull:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/mfpAQ
function name:  pull
number of ops:  38
compiled vars:  !0 = $bucket, !1 = $view_path, !2 = $debug, !3 = $odin, !4 = $uri, !5 = $o, !6 = $ret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
   26     3        BIND_GLOBAL                                              !3, 'odin'
   27     4        FETCH_OBJ_R                                      ~7      'server'
          5        BOOL_NOT                                         ~8      ~7
          6      > JMPZ                                                     ~8, ->12
   28     7    >   FETCH_OBJ_R                                      ~9      !3, 'debug'
          8        INIT_METHOD_CALL                                         ~9, 'error'
          9        SEND_VAL_EX                                              'No+host+set'
         10        DO_FCALL                                      0  $10     
         11      > RETURN                                                   $10
   29    12    >   FETCH_OBJ_R                                      ~11     'server'
         13        CONCAT                                           ~12     ~11, '%2F'
         14        CONCAT                                           ~13     ~12, !0
         15        CONCAT                                           ~14     ~13, '%2F'
         16        CONCAT                                           ~15     ~14, !1
         17        ASSIGN                                                   !4, ~15
   31    18        FETCH_CONSTANT                                   ~17     'CURLOPT_USERPWD'
         19        FETCH_OBJ_R                                      ~18     'login'
         20        INIT_ARRAY                                       ~19     ~18, ~17
   32    21        FETCH_CONSTANT                                   ~20     'CURLOPT_CONNECTTIMEOUT'
         22        ADD_ARRAY_ELEMENT                                ~19     3, ~20
   30    23        ASSIGN                                                   !5, ~19
   34    24      > JMPZ                                                     !2, ->27
   35    25    >   ASSIGN_DIM                                               !5, 'return_all'
         26        OP_DATA                                                  1
   36    27    >   FETCH_OBJ_R                                      ~23     !3, 'curl'
         28        INIT_METHOD_CALL                                         ~23, 'request'
         29        SEND_VAR_EX                                              !4
         30        SEND_VAR_EX                                              !5
         31        DO_FCALL                                      0  $24     
         32        ASSIGN                                                   !6, $24
   37    33        INIT_FCALL                                               'json_decode'
         34        SEND_VAR                                                 !6
         35        DO_ICALL                                         $26     
         36      > RETURN                                                   $26
   38    37*     > RETURN                                                   null

End of function pull

End of class bolt_couchbase.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.77 ms | 1409 KiB | 15 Q