Esempio n. 1
0
                 //sometimes the sound is nothing like a number or 'y'
                 if ($sound) {
                     $index[$sound][$row[RF_NODES_TYPE]][] = $row[RF_NODES_KEY];
                 }
                 // alternative $index[$sound][$row['ptype']]['pnum'] = $name;
             }
         }
         $blob = clb_blob_enc($index, TRUE);
         //TRUE=binary
         file_put_contents($metaphones, $blob);
         //, FILE_BINARY);
     }
     break;
 case 'near':
     //create mapping from raw segs to nodes
     $stopsegs = pbuild_stop2segs($node_types, $raw_segs, $near_path);
     break;
 case 'prim':
     //build array with end points of raw links so we can build node to node links
     $primitives = pbuild_primitives($raw_segs, $prim_path);
     break;
 case 'links':
     //build ACTUAL node to node link reocrds
     $data = file_get_contents($near_path);
     //, FILE_BINARY);
     $stopsegs = clb_blob_dec($data);
     $data = file_get_contents($prim_path);
     //, FILE_BINARY);
     $primitives = clb_blob_dec($data);
     $query = 'SELECT ' . RF_ROUTES_KEY . ' FROM ' . RF_ROUTES_FROM . ' WHERE ' . $route_where;
     $sel = $wpdb->get_results($query, ARRAY_A);
Esempio n. 2
0
                     $index[$sound][$row['ptype']][] = $row['pnum'];
                 }
                 // alternative $index[$sound][$row['ptype']]['pnum'] = $name;
             }
         }
         if ($path && is_dir(dirname($path))) {
             $blob = clb_blob_enc($index, TRUE);
             //TRUE=binary
             file_put_contents($path, $blob, FILE_BINARY);
         }
     }
     break;
 case 'near':
     //create mapping from raw segs to nodes
     if (IS_CLI) {
         $map = pbuild_stop2segs($node_types, $raw_segs, $map_path);
     } else {
         $path = $map_path;
     }
     break;
 case 'raw':
     //build array with end points of raw links so we can build node to node links
     if (IS_CLI) {
         $map = pbuild_primitives($raw_segs, $links_path);
     } else {
         $path = $links_path;
     }
     break;
 case 'stops':
     //build array of rnum/pnum stops so we can look up which stops are on which routes
     if (IS_CLI) {