File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load diff This file was deleted.
Original file line number Diff line number Diff line change 11<?php
22namespace Transvision ;
33
4+ use Json \Json ;
5+
46// Create a JSON file logging locale/number of requests
5- $ stats = Json::fetch (CACHE_PATH . 'stats_locales.json ' );
7+ $ json_data = new Json ;
8+ $ local_filename = CACHE_PATH . 'stats_locales.json ' ;
9+ $ stats = $ json_data
10+ ->setURI ($ local_filename )
11+ ->fetchContent ();
12+
613$ stats [$ locale ] = array_key_exists ($ locale , $ stats ) ? $ stats [$ locale ] += 1 : 1 ;
7- file_put_contents ( CACHE_PATH . ' stats_locales.json ' , json_encode ( $ stats ) );
14+ $ json_data -> saveFile ( $ stats , $ local_filename );
815
916// Create a JSON file logging search options to determine if some are unused
10- $ stats = Json::fetch (CACHE_PATH . 'stats_requests.json ' );
17+ $ local_filename = CACHE_PATH . 'stats_requests.json ' ;
18+ $ stats = $ json_data
19+ ->setURI ($ local_filename )
20+ ->fetchContent ();
1121
1222foreach ($ check as $ k => $ v ) {
1323 if (in_array ($ k , $ form_checkboxes ) && $ v == 1 ) {
1828 $ stats [$ v ] = array_key_exists ($ v , $ stats ) ? $ stats [$ v ] += 1 : 1 ;
1929 }
2030
21- file_put_contents ( CACHE_PATH . ' stats_requests.json ' , json_encode ( $ stats ) );
31+ $ json_data -> saveFile ( $ stats , $ local_filename );
2232}
2333unset($ stats );
Original file line number Diff line number Diff line change 11<?php
22namespace Transvision ;
33
4+ use Json \Json ;
5+
46/*
5- * This view outputs a json or jsonp representation of search results
7+ * This view outputs a JSON or JSONP representation of search results
68 */
79
810// Log script performance in PHP integrated developement server console
911Utils::logScriptPerformances ();
1012
11- // We die here because we never want to send anything more after the Json file
12- die (Json::output (
13+ // We die here because we never want to send anything more after the JSON file
14+ $ json_data = new Json ;
15+ die ($ json_data ->outputContent (
1316 $ json ,
1417 isset ($ _GET ['callback ' ]) ? $ _GET ['callback ' ] : false
1518));
Original file line number Diff line number Diff line change 88 "type" : " vcs" ,
99 "url" : " https://github.com/mozilla-l10n/phpclass-cache"
1010 },
11+ {
12+ "type" : " vcs" ,
13+ "url" : " https://github.com/mozilla-l10n/phpclass-json"
14+ },
1115 {
1216 "type" : " vcs" ,
1317 "url" : " https://github.com/pascalchevrel/Verif/"
4751 "monolog/monolog" : " ~1.1" ,
4852 "mozillal10n/bugzilla" : " ~0.1" ,
4953 "mozillal10n/cache" : " ~0.1" ,
54+ "mozillal10n/json" : " ~0.1" ,
5055 "pascalc/tinyl10n" : " ~0.1" ,
5156 "pascalc/vcs" : " ~0.1" ,
5257 "robloach/component-installer" : " *" ,
Load diff This file was deleted.
Load diff This file was deleted.
Load diff This file was deleted.
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments