<?php ini_set("ERROR_REPORTING", 0); include_once 'lib/parser2/dojo2.inc'; $allfiles = @dojo_get_files(); if ($argc || !empty($_GET['f'])) { $argfile = empty($_GET['f']) ? $argv[1] : $_GET['f']; $parts = explode("/", $argfile); $ns = array_shift($parts); $file = implode("/", $parts); try { $data = @dojo_get_contents($ns, $file); } catch (Exception $e) { $data = array("success" => False, "error" => $e); } if (!empty($_GET['f'])) { header("Content-type: application/json"); } print json_encode($data); }
if (isset($kwargs['serialize']['json'])) { JsonSerializer::clean('cache', 'json', $kwargs['outfile']); } if (isset($kwargs['serialize']['xml'])) { XmlSerializer::clean('cache', 'xml', $kwargs['outfile']); } } else { if (isset($kwargs['serialize']['json'])) { JsonSerializer::clean('cache', 'json'); } if (isset($kwargs['serialize']['xml'])) { XmlSerializer::clean('cache', 'xml'); } } } $files = dojo_get_files($args); $nodes = new Freezer('cache', 'nodes'); $resources = new Freezer('cache', 'resources'); print "=== PARSING FILES ===\n"; flush(); foreach ($files as $set) { list($namespace, $file) = $set; if (!$namespaces[$namespace]) { $namespaces[$namespace] = true; } $ctime = dojo_get_file_time($namespace, $file); if ($ctime == $resources->open($namespace . '%' . $file, null)) { continue; } printf("%-100s %6s KB\n", $namespace . '/' . $file, number_format(memory_get_usage() / 1024)); flush();
// // This is an experiemental file, used to generate dojo11.cix, // the XML for ActiveState's Komodo Editor code-completion. // // it requires php5, a lot of memory, and write access to // the ./cache folder in this path. It will parse the dojo // tree (or read from cache if a file is unmodified), and dump // the results to "valid" XML (i think). // // to use: // /usr/local/php5/bin/php -q makeCix.php > ../resources/dojo.cix // header("Content-type: text/xml"); ini_set("memory_limit", "512M"); include_once 'includes/dojo.inc'; $files = dojo_get_files(); // our namespaces: $out = array("dijit" => array(), "dojox" => array(), "dojo" => array()); // put the results of each file into $array[$namespace] foreach ($files as $set) { list($namespace, $file) = $set; $data = dojo_get_contents_cache($namespace, $file); $out[$namespace] = array_merge($out[$namespace], $data); } // and do some weeeird array manipulations: $out = @expando_dojo($out); // start a new document $doc = new DOMDocument('1.0'); // setup for codeintel: $codeintel = $doc->createElement('codeintel'); $codeintel->setAttribute("description", "the Dojo Toolkit 1.1 API");