1 | <?php |
||
15 | class EvalProvider { |
||
16 | |||
17 | protected $sharedVars = array(); |
||
18 | protected $openBaseDirs = array(); |
||
19 | protected $codeCallbackHandlers = array(); |
||
20 | protected $globalsBackup; |
||
21 | |||
22 | /** |
||
23 | * Execute PHP code handling execution time, output & exception |
||
24 | * @param string $code |
||
25 | * @return EvalResult |
||
26 | */ |
||
27 | 22 | public function evaluate($code) { |
|
57 | |||
58 | /** |
||
59 | * Add callback that will be called with &$code var reference before code execution |
||
60 | * @param $callback |
||
61 | * @throws \Exception |
||
62 | */ |
||
63 | 2 | public function addCodeHandler($callback) { |
|
69 | |||
70 | /** |
||
71 | * Call added code handlers |
||
72 | * @param $code |
||
73 | * @return mixed |
||
74 | */ |
||
75 | 22 | protected function applyHandlersToCode($code) { |
|
81 | |||
82 | /** |
||
83 | * Store global vars data in backup var |
||
84 | */ |
||
85 | 22 | protected function backupGlobals() { |
|
93 | |||
94 | /** |
||
95 | * Restore global vars data from backup var |
||
96 | */ |
||
97 | 22 | protected function restoreGlobals() { |
|
107 | |||
108 | /** |
||
109 | * Execute code with shared vars |
||
110 | * @param $_code |
||
111 | * @param array $_sharedVars |
||
112 | * @return mixed |
||
113 | */ |
||
114 | 22 | protected static function executeCode($_code, array $_sharedVars) { |
|
126 | |||
127 | /** |
||
128 | * Prepare code PHP tags be correctly passed to eval() function |
||
129 | * @param string $code |
||
130 | * @return string |
||
131 | */ |
||
132 | 22 | protected function trimPhpTags($code) { |
|
141 | |||
142 | /** |
||
143 | * Add semicolon to the end of code if it's required |
||
144 | * @param string $code |
||
145 | * @return string |
||
146 | */ |
||
147 | 22 | protected function forceEndingSemicolon($code) { |
|
151 | |||
152 | /** |
||
153 | * Apply some default code handlers |
||
154 | * @param string $code |
||
155 | * @return string |
||
156 | */ |
||
157 | 22 | protected function adaptCodeToEval($code) { |
|
162 | |||
163 | /** |
||
164 | * Protect response code access only to specified directories using http://www.php.net/manual/en/ini.core.php#ini.open-basedir |
||
165 | * IMPORTANT: classes autoload methods will work only for specified directories |
||
166 | * @param array $openBaseDirs |
||
167 | * @codeCoverageIgnore |
||
168 | */ |
||
169 | public function setOpenBaseDirs(array $openBaseDirs) { |
||
172 | |||
173 | /** |
||
174 | * Autoload all PHP Console classes |
||
175 | * @codeCoverageIgnore |
||
176 | */ |
||
177 | protected function forcePhpConsoleClassesAutoLoad() { |
||
185 | |||
186 | /** |
||
187 | * Set actual "open_basedir" PHP ini option |
||
188 | * @throws \Exception |
||
189 | * @codeCoverageIgnore |
||
190 | */ |
||
191 | protected function applyOpenBaseDirSetting() { |
||
202 | |||
203 | /** |
||
204 | * Protect response code from reading/writing/including any files using http://www.php.net/manual/en/ini.core.php#ini.open-basedir |
||
205 | * IMPORTANT: It does not protects from system(), exec(), passthru(), popen() & etc OS commands execution functions |
||
206 | * IMPORTANT: Classes autoload methods will not work, so all required classes must be loaded before code evaluation |
||
207 | * @codeCoverageIgnore |
||
208 | */ |
||
209 | public function disableFileAccessByOpenBaseDir() { |
||
212 | |||
213 | /** |
||
214 | * Add var that will be implemented in PHP code executed from PHP Console debug panel (will be implemented in PHP Console > v3.0) |
||
215 | * @param $name |
||
216 | * @param $var |
||
217 | * @throws \Exception |
||
218 | */ |
||
219 | 4 | public function addSharedVar($name, $var) { |
|
222 | |||
223 | /** |
||
224 | * Add var that will be implemented in PHP code executed from PHP Console debug panel (will be implemented in PHP Console > v3.0) |
||
225 | * @param $name |
||
226 | * @param $var |
||
227 | * @throws \Exception |
||
228 | */ |
||
229 | 5 | public function addSharedVarReference($name, &$var) { |
|
235 | } |
||
236 | |||
245 |
Scrutinizer analyzes your
composer.json
/composer.lock
file if available to determine the classes, and functions that are defined by your dependencies.It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.