3v4l.org

run code in 300+ PHP versions simultaneously
<?php // This file is part of Moodle - http://moodle.org/ // // Moodle 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 3 of the License, or // (at your option) any later version. // // Moodle 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. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Web cron * * This script looks through all the module directories for cron.php files * and runs them. These files can contain cleanup functions, email functions * or anything that needs to be run on a regular basis. * * This file is best run from cron on the host system (ie outside PHP). * It is strongly recommended to add password protection via admin settings. * * eg wget -q -O /dev/null 'http: *moodle.somewhere.edu/admin/cron.php?password=SeCreT666' * * It is also possible to use CLI script admin/cli/cron.php instead, * you can not call this script from command line any more. * * @package core * @subpackage admin * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ if (defined('STDIN')) { fwrite(STDERR, "ERROR: This script no longer supports CLI, please use admin/cli/cron.php instead\n"); exit(1); } // This is a fake CLI script, it is a really ugly hack which emulates // CLI via web interface, please do not use this hack elsewhere define('CLI_SCRIPT', true); define('WEB_CRON_EMULATED_CLI', 'defined'); // ugly ugly hack, do not use elsewhere please define('NO_OUTPUT_BUFFERING', true); require('../config.php'); require_once($CFG->libdir.'/clilib.php'); require_once($CFG->libdir.'/cronlib.php'); // extra safety core\session\manager::write_close(); // check if execution allowed if (!empty($CFG->cronclionly)) { // This script can only be run via the cli. print_error('cronerrorclionly', 'admin'); exit; } // This script is being called via the web, so check the password if there is one. if (!empty($CFG->cronremotepassword)) { $pass = optional_param('password', '', PARAM_RAW); if ($pass != $CFG->cronremotepassword) { // wrong password. print_error('cronerrorpassword', 'admin'); exit; } } // send mime type and encoding @header('Content-Type: text/plain; charset=utf-8'); // we do not want html markup in emulated CLI @ini_set('html_errors', 'off'); // execute the cron cron_run(); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 8
Branch analysis from position: 2
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 37
Branch analysis from position: 32
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 55
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 55
Branch analysis from position: 50
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
filename:       /in/l65Dd
function name:  (null)
number of ops:  69
compiled vars:  !0 = $CFG, !1 = $pass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   DEFINED                                                  'STDIN'
          1      > JMPZ                                                     ~2, ->8
   41     2    >   INIT_FCALL                                               'fwrite'
          3        FETCH_CONSTANT                                   ~3      'STDERR'
          4        SEND_VAL                                                 ~3
          5        SEND_VAL                                                 'ERROR%3A+This+script+no+longer+supports+CLI%2C+please+use+admin%2Fcli%2Fcron.php+instead%0A'
          6        DO_ICALL                                                 
   42     7      > EXIT                                                     1
   47     8    >   INIT_FCALL                                               'define'
          9        SEND_VAL                                                 'CLI_SCRIPT'
         10        SEND_VAL                                                 <true>
         11        DO_ICALL                                                 
   48    12        INIT_FCALL                                               'define'
         13        SEND_VAL                                                 'WEB_CRON_EMULATED_CLI'
         14        SEND_VAL                                                 'defined'
         15        DO_ICALL                                                 
   49    16        INIT_FCALL                                               'define'
         17        SEND_VAL                                                 'NO_OUTPUT_BUFFERING'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                                 
   51    20        INCLUDE_OR_EVAL                                          '..%2Fconfig.php', REQUIRE
   52    21        FETCH_OBJ_R                                      ~9      !0, 'libdir'
         22        CONCAT                                           ~10     ~9, '%2Fclilib.php'
         23        INCLUDE_OR_EVAL                                          ~10, REQUIRE_ONCE
   53    24        FETCH_OBJ_R                                      ~12     !0, 'libdir'
         25        CONCAT                                           ~13     ~12, '%2Fcronlib.php'
         26        INCLUDE_OR_EVAL                                          ~13, REQUIRE_ONCE
   56    27        INIT_STATIC_METHOD_CALL                                  'core%5Csession%5Cmanager', 'write_close'
         28        DO_FCALL                                      0          
   59    29        ISSET_ISEMPTY_PROP_OBJ                           ~16     !0, 'cronclionly'
         30        BOOL_NOT                                         ~17     ~16
         31      > JMPZ                                                     ~17, ->37
   61    32    >   INIT_FCALL_BY_NAME                                       'print_error'
         33        SEND_VAL_EX                                              'cronerrorclionly'
         34        SEND_VAL_EX                                              'admin'
         35        DO_FCALL                                      0          
   62    36      > EXIT                                                     
   65    37    >   ISSET_ISEMPTY_PROP_OBJ                           ~19     !0, 'cronremotepassword'
         38        BOOL_NOT                                         ~20     ~19
         39      > JMPZ                                                     ~20, ->55
   66    40    >   INIT_FCALL_BY_NAME                                       'optional_param'
         41        SEND_VAL_EX                                              'password'
         42        SEND_VAL_EX                                              ''
         43        FETCH_CONSTANT                                   ~21     'PARAM_RAW'
         44        SEND_VAL_EX                                              ~21
         45        DO_FCALL                                      0  $22     
         46        ASSIGN                                                   !1, $22
   67    47        FETCH_OBJ_R                                      ~24     !0, 'cronremotepassword'
         48        IS_NOT_EQUAL                                             !1, ~24
         49      > JMPZ                                                     ~25, ->55
   69    50    >   INIT_FCALL_BY_NAME                                       'print_error'
         51        SEND_VAL_EX                                              'cronerrorpassword'
         52        SEND_VAL_EX                                              'admin'
         53        DO_FCALL                                      0          
   70    54      > EXIT                                                     
   75    55    >   BEGIN_SILENCE                                    ~27     
         56        INIT_FCALL                                               'header'
         57        SEND_VAL                                                 'Content-Type%3A+text%2Fplain%3B+charset%3Dutf-8'
         58        DO_ICALL                                                 
         59        END_SILENCE                                              ~27
   78    60        BEGIN_SILENCE                                    ~29     
         61        INIT_FCALL                                               'ini_set'
         62        SEND_VAL                                                 'html_errors'
         63        SEND_VAL                                                 'off'
         64        DO_ICALL                                                 
         65        END_SILENCE                                              ~29
   81    66        INIT_FCALL_BY_NAME                                       'cron_run'
         67        DO_FCALL                                      0          
   83    68      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.11 ms | 1400 KiB | 21 Q