use \GeoIp2\WebService\Client;
$tokens = token_get_all('<?php ' . $results); // Get rid of the opening '<?php ' we've just added array_shift($tokens); $useContent = ''; $newScriptContent = ''; $in_use = false; // Extract everything between T_USE and ';' (string value) foreach ($tokens as $t) { if ((is_array($t) && $t[0] == T_USE) || $in_use) { $in_use = true; $useContent .= is_array($t) ? $t[1] : $t; if (is_string($t) && $t == ';') { $in_use = false; $useContent .= "\n"; } continue; } $newScriptContent .= is_array($t) ? $t[1] : $t; } $results = $useContent ."\n" . $newScriptContent;
$results= $objElement->getContent(is_string($objContent) ? array('content' => objContent) : array()); $results = rtrim($results, "\n") . "\nreturn;\n";
$results = $useContent ."\n";
$results = $useContent ."\n".$newScriptContent;
return include MODX_CORE_PATH . 'components/path/to/file.php';