GithubHelp home page GithubHelp logo

Comments (3)

tunage avatar tunage commented on July 26, 2024

the most I can find, from a var_dump($db); is

classpath = array(); } public function addToClasspath($dir){ if(is_dir($dir)){ $this->classpath[] = $dir; }else{ throw new Exception("cannot find directory: $dir"); } } public function load($classname){ $ok = false; for($i=0;$iclasspath);$i++){ $path = $this->classpath[$i]; /* echo "load recur "" . $path . "";//
\n"; / $ok = $ok || $this->load_recursive($path, $classname); } return $ok; } protected function load_recursive($classpath, $classname){ $theList = array(); $ret = false; if ($handle = opendir($classpath)) { while (false != ($file = readdir($handle))) { if ($file != "." && $file != "..") { if(is_dir($classpath . $file)){ $ret = $ret || $this->load_recursive($classpath . $file . "/", $classname); }else{ if($file == "class.$classname.php"){ include_once $classpath . $file; $ret = true; / echo "include_once "" . $classpath . $file . "";//
\n"; / }else if($file == "class.Boolean.$classname.php"){ include_once $classpath . $file; $ret = true; / echo "include_once "" . $classpath . $file . "";//
\n"; / }else if($file == "interface.$classname.php"){ include_once $classpath . $file; $ret = true; / echo "include_once "" . $classpath . $file . "";//
\n"; */ } } } } closedir($handle); unset($handle); } return $ret; } public function loadTestFiles(GroupTest $g){ foreach($this->classpath as $c){ $this->loadTestFilesHelper($g, $c); } } protected function loadTestFilesHelper(GroupTest $g, $classpath){ $theList = array(); if ($handle = opendir($classpath)) { while (false != ($file = readdir($handle))) { if ($file != "." && $file != "..") { if(is_dir($classpath . $file)){ $this->loadTestFilesHelper($g, $classpath . $file . "/"); }else{ if(strpos($file, "test.class.") === 0 && strpos($file, ".php") == strlen($file)-4){ $g->addTestFile($classpath . $file); } } } } closedir($handle); unset($handle); } } } class ClassLoaderToString extends ClassLoader{ public function __construct(){ parent::__construct(); } protected function load_recursive($classpath, $classname){ $theList = array(); $ret = false; if ($handle = opendir($classpath)) { while (false != ($file = readdir($handle))) { if ($file != "." && $file != "..") { if(is_dir($classpath . $file)){ $this->load_recursive($classpath . $file . "/", $classname); }else{ if($file == "class.$classname.php"){ include_once $classpath . $file; $this->printClass($classpath, $file); $ret = true; }else if($file == "class.Boolean.$classname.php"){ include_once $classpath . $file; $this->printClass($classpath, $file); $ret = true; }else if($file == "interface.$classname.php"){ include_once $classpath . $file; $this->printClass($classpath, $file); $ret = true; } } } } closedir($handle); unset($handle); } return $ret; } protected function printClass($classpath, $file){ if(strpos($classpath, ROOT) === 0){ $classpath = substr($classpath, strlen(ROOT)); echo "include_once(ROOT . "" . $classpath . $file . "");\n"; }else{ echo "include_once("" . $classpath . $file . "");\n"; } } } function milestone_autoload($classname){ global $classLoader; // global $control; // $str = "classname: "; // $str .= $classname; // $str .= "\n"; // if(is_object($control) && !is_int(stripos($classname, "mysql"))){ // $control->getModel()->getLogger()->log($control->getModel(), ALogger::$HIGH, $str); // } try{ $ok = $classLoader->load($classname); // $str .= ":" . $ok; // if(is_object($control) && !is_int(stripos($classname, "mysql"))){ // $control->getModel()->getLogger()->log($control->getModel(), ALogger::$HIGH, $str); // } }catch(Exception $e){ $model->getLogger()->log($model, ALogger::$HIGH, print_r($e, true)); } } spl_autoload_register('milestone_autoload'); $classLoader = new ClassLoader(); ?>
Notice: Undefined variable: classLoader in /usr/local/www/apache24/data/json-to-mysql/insertHash.php on line 68

Fatal error: Call to a member function addToClasspath() on null in /usr/local/www/apache24/data/json-to-mysql/insertHash.php on line 68

I don't know why the value is NULL. the return data is fully populated and all files are found.

from json-to-mysql.

adamwulf avatar adamwulf commented on July 26, 2024

it looks like include.classloader.php isn't included in your script. Include that file and retry, does that fix it?

from json-to-mysql.

adamwulf avatar adamwulf commented on July 26, 2024

closing since no response

from json-to-mysql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.