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 = 30, Position 2 = 35
Branch analysis from position: 30
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 53
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 53
Branch analysis from position: 48
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 53
filename:       /in/ZkbtV
function name:  (null)
number of ops:  67
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
   59    27        ISSET_ISEMPTY_PROP_OBJ                           ~15     !0, 'cronclionly'
         28        BOOL_NOT                                         ~16     ~15
         29      > JMPZ                                                     ~16, ->35
   61    30    >   INIT_FCALL_BY_NAME                                       'print_error'
         31        SEND_VAL_EX                                              'cronerrorclionly'
         32        SEND_VAL_EX                                              'admin'
         33        DO_FCALL                                      0          
   62    34      > EXIT                                                     
   65    35    >   ISSET_ISEMPTY_PROP_OBJ                           ~18     !0, 'cronremotepassword'
         36        BOOL_NOT                                         ~19     ~18
         37      > JMPZ                                                     ~19, ->53
   66    38    >   INIT_FCALL_BY_NAME                                       'optional_param'
         39        SEND_VAL_EX                                              'password'
         40        SEND_VAL_EX                                              ''
         41        FETCH_CONSTANT                                   ~20     'PARAM_RAW'
         42        SEND_VAL_EX                                              ~20
         43        DO_FCALL                                      0  $21     
         44        ASSIGN                                                   !1, $21
   67    45        FETCH_OBJ_R                                      ~23     !0, 'cronremotepassword'
         46        IS_NOT_EQUAL                                             !1, ~23
         47      > JMPZ                                                     ~24, ->53
   69    48    >   INIT_FCALL_BY_NAME                                       'print_error'
         49        SEND_VAL_EX                                              'cronerrorpassword'
         50        SEND_VAL_EX                                              'admin'
         51        DO_FCALL                                      0          
   70    52      > EXIT                                                     
   75    53    >   BEGIN_SILENCE                                    ~26     
         54        INIT_FCALL                                               'header'
         55        SEND_VAL                                                 'Content-Type%3A+text%2Fplain%3B+charset%3Dutf-8'
         56        DO_ICALL                                                 
         57        END_SILENCE                                              ~26
   78    58        BEGIN_SILENCE                                    ~28     
         59        INIT_FCALL                                               'ini_set'
         60        SEND_VAL                                                 'html_errors'
         61        SEND_VAL                                                 'off'
         62        DO_ICALL                                                 
         63        END_SILENCE                                              ~28
   81    64        INIT_FCALL_BY_NAME                                       'cron_run'
         65        DO_FCALL                                      0          
   83    66      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.19 ms | 1400 KiB | 21 Q