Changeset 12622
- Timestamp:
- 02/22/08 13:21:21 (11 months ago)
- Files:
-
- 1 modified
-
util/branches/dev/jsdoc/jsdoc.module (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
util/branches/dev/jsdoc/jsdoc.module
r12621 r12622 367 367 $files = variable_get('jsdoc_cron_files', array()); 368 368 if (!empty($files)) { 369 // Call this without caring about its return, just to handle any set up it does 369 370 call_user_func(_jsdoc_base() . '_get_files'); 370 371 print count($files) . ' files left<br>'; … … 403 404 404 405 $ignores = array(); 405 $query = db_query("SELECT parent.title FROM jsdoc_variable_hierarchy AS jvh JOIN node AS child ON (child.vid = jvh.vid) JOIN jsdoc_objects AS jschild ON (jschild.vid = jvh.nid) JOIN nodeAS parent ON (parent.vid = jvh.parent_vid) WHERE jvh.type NOT IN ('cascading', 'normal', 'alias') AND (parent.title LIKE 'dojo.%' OR parent.title LIKE 'dojox.%' OR parent.title LIKE 'dijit.%') AND jschild.private = 0 AND jschild.private_parent = 0 GROUP BY BINARY parent.title ORDER BY parent.title");406 $query = db_query("SELECT parent.title FROM {jsdoc_variable_hierarchy} AS jvh JOIN {node} AS child ON (child.vid = jvh.vid) JOIN {jsdoc_objects} AS jschild ON (jschild.vid = jvh.nid) JOIN {node} AS parent ON (parent.vid = jvh.parent_vid) WHERE jvh.type NOT IN ('cascading', 'normal', 'alias') AND (parent.title LIKE 'dojo.%' OR parent.title LIKE 'dojox.%' OR parent.title LIKE 'dijit.%') AND jschild.private = 0 AND jschild.private_parent = 0 GROUP BY BINARY parent.title ORDER BY parent.title"); 406 407 while ($result = db_fetch_object($query)) { 407 408 $ignores[] = $result->title; 408 409 } 409 410 $namespaces = array(); 410 $query = db_query("SELECT parent.title FROM jsdoc_variable_hierarchy AS jvh JOIN node AS child ON (child.vid = jvh.vid) JOIN jsdoc_objects AS jschild ON (jschild.vid = jvh.nid) JOIN nodeAS parent ON (parent.vid = jvh.parent_vid) WHERE jvh.type = 'normal' AND (parent.title LIKE 'dojo.%' OR parent.title LIKE 'dojox.%' OR parent.title LIKE 'dijit.%') AND jschild.private = 0 AND jschild.private_parent = 0 GROUP BY BINARY parent.title ORDER BY parent.title");411 $query = db_query("SELECT parent.title FROM {jsdoc_variable_hierarchy} AS jvh JOIN {node} AS child ON (child.vid = jvh.vid) JOIN {jsdoc_objects} AS jschild ON (jschild.vid = jvh.nid) JOIN {node} AS parent ON (parent.vid = jvh.parent_vid) WHERE jvh.type = 'normal' AND (parent.title LIKE 'dojo.%' OR parent.title LIKE 'dojox.%' OR parent.title LIKE 'dijit.%') AND jschild.private = 0 AND jschild.private_parent = 0 GROUP BY BINARY parent.title ORDER BY parent.title"); 411 412 while ($result = db_fetch_object($query)) { 412 413 $found = false; … … 423 424 cache_set('jsdoc_namespaces', 'cache', serialize($namespaces)); 424 425 425 $timestamp = variable_get('jsdoc_cron_time', 0); 426 if ($timestamp && time() - $timestamp < 43200) { 427 // 12 hours 428 // return; 429 } 430 variable_set('jsdoc_cron_time', time()); 431 426 // Build an array of ctimes from our cache table 432 427 $file_ctimes = array(); 433 428 $query = db_query("SELECT ctime, cid, namespace, filepath FROM {jsdoc_cache}"); … … 439 434 } 440 435 441 $count = 0;442 436 while (count($files)) { 443 437 $list = array_shift($files); … … 450 444 } 451 445 452 ++$count;453 446 list($namespace, $file_name) = $list; 454 447 unset($list); … … 458 451 print 'FINISHED'; 459 452 } 453 flush(); 460 454 ob_flush(); 461 flush(); 462 463 set_time_limit(300); // 5 minutes 455 456 set_time_limit(60); // 1 minute 464 457 // Cache the results from a parse in the file and reuse it if we can. 465 458 $cache_dir = _jsdoc_get_base_path() . '/' . drupal_get_path('module', 'jsdoc') . '/cache/'; … … 570 563 } 571 564 572 // TODO: Delete items from cache573 565 if (!db_result(db_query("SELECT 1 FROM {jsdoc_resources} WHERE used = 0"))) { 574 // If all items are used (typically happens the first pass), then none of them are new. 575 // We can do this because if nothing is missing, then all then new things are really new. 566 // If all items are used, then none of them are new. 567 // We can do this because if nothing is missing, 568 // then all then new things are really new. 576 569 db_query("UPDATE {jsdoc_objects} SET new = 0"); 577 570 } … … 2974 2967 } 2975 2968 if ($prototype) { 2976 if ($parent = jsdoc_object_node_load($prototype, jsdoc_get_project($node), jsdoc_get_version($node), $node->jsdoc_provide_nids)) {2969 if ($parent = jsdoc_object_node_load($prototype, jsdoc_get_project($node), jsdoc_get_version($node), jsdoc_get_resources($node)->jsdoc_provide_nids)) { 2977 2970 return jsdoc_get_prototype_chain($parent, $environments, $output); 2978 2971 } … … 3079 3072 if ($parents[$parent]) { 3080 3073 foreach ($parents[$parent] as $parent) { 3081 if (isset($terms[$parent[ 1]])) {3082 $term = $terms[$parent[ 1]];3074 if (isset($terms[$parent[0]])) { 3075 $term = $terms[$parent[0]]; 3083 3076 } 3084 3077 else { … … 3088 3081 3089 3082 $term->depth = $depth; 3090 $term->children = $children[$parent[ 1]];3083 $term->children = $children[$parent[0]]; 3091 3084 $tree[] = $term; 3092 3085 3093 if ($parents[$parent[ 1]]) {3094 if (in_array($parent[ 1], $visited)) {3086 if ($parents[$parent[0]]) { 3087 if (in_array($parent[0], $visited)) { 3095 3088 return $tree; 3096 3089 } 3097 $visited[] = $parent[ 1];3098 $tree = array_merge($tree, _jsdoc_get_tree($environments, $parent[ 1], $depth, $visited));3090 $visited[] = $parent[0]; 3091 $tree = array_merge($tree, _jsdoc_get_tree($environments, $parent[0], $depth, $visited)); 3099 3092 } 3100 3093 }