comparison vendor/psy/psysh/src/ExecutionLoop.php @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
3:307d7a7fd348 4:a9cd425dd02b
40 */ 40 */
41 protected function loadIncludes(Shell $shell) 41 protected function loadIncludes(Shell $shell)
42 { 42 {
43 // Load user-defined includes 43 // Load user-defined includes
44 $load = function (Shell $__psysh__) { 44 $load = function (Shell $__psysh__) {
45 set_error_handler([$__psysh__, 'handleError']); 45 \set_error_handler([$__psysh__, 'handleError']);
46 foreach ($__psysh__->getIncludes() as $__psysh_include__) { 46 foreach ($__psysh__->getIncludes() as $__psysh_include__) {
47 try { 47 try {
48 include $__psysh_include__; 48 include $__psysh_include__;
49 } catch (\Error $_e) { 49 } catch (\Error $_e) {
50 $__psysh__->writeException(ErrorException::fromError($_e)); 50 $__psysh__->writeException(ErrorException::fromError($_e));
51 } catch (\Exception $_e) { 51 } catch (\Exception $_e) {
52 $__psysh__->writeException($_e); 52 $__psysh__->writeException($_e);
53 } 53 }
54 } 54 }
55 restore_error_handler(); 55 \restore_error_handler();
56 unset($__psysh_include__); 56 unset($__psysh_include__);
57 57
58 // Override any new local variables with pre-defined scope variables 58 // Override any new local variables with pre-defined scope variables
59 extract($__psysh__->getScopeVariables(false)); 59 \extract($__psysh__->getScopeVariables(false));
60 60
61 // ... then add the whole mess of variables back. 61 // ... then add the whole mess of variables back.
62 $__psysh__->setScopeVariables(get_defined_vars()); 62 $__psysh__->setScopeVariables(\get_defined_vars());
63 }; 63 };
64 64
65 $load($shell); 65 $load($shell);
66 } 66 }
67 } 67 }