Esempio n. 1
0
 public function GetRpcObject($str, $get)
 {
     $t = $this->GetOrganizedTokens($str);
     $args = $this->ExplodeTokensToCallee($t);
     $try = $this->GetAllCallVariations($args);
     include_once 'include.php';
     if (!count($try)) {
         die('Error at rpc resolve: All variations were invalid. Unable to resolve');
     }
     foreach ($try as $t) {
         $target_dir = ".";
         if ($t['class'] === 'phoxy') {
             $target_dir = realpath(dirname(__FILE__));
             $t["scope"] = str_replace(\phoxy::Config()["api_dir"], "", $t["scope"]);
         }
         $file_location = $target_dir . $t["scope"];
         $obj = IncludeModule($file_location, $t["class"]);
         if (!is_null($obj)) {
             return ["original_str" => $str, "obj" => $obj, "method" => $t["method"]];
         }
     }
     exit(json_encode(["error" => 'Module not found']));
 }
Esempio n. 2
0
function LoadModule($dir, $module, $force_raw = false, $expect_simple_result = true)
{
    $obj = IncludeModule($dir, $module);
    return $obj->fork($force_raw, $expect_simple_result);
}