cli utilities - argc and argv reversed. Not functionally incorrect since it was consistent but aesthetically incorrect.

This commit is contained in:
redmatrix 2016-05-17 19:49:21 -07:00
parent 9a64c6b9f7
commit 43c2b22fca
18 changed files with 35 additions and 38 deletions

View File

@ -5,7 +5,7 @@ namespace Zotlabs\Project;
class System { class System {
static public function get_platform_name() { static public function get_platform_name() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['platform_name']) if(is_array(\App::$config) && is_array(\App::$config['system']) && array_key_exists('platform_name',\App::$config['system']))
return \App::$config['system']['platform_name']; return \App::$config['system']['platform_name'];
return PLATFORM_NAME; return PLATFORM_NAME;
} }

View File

@ -7,7 +7,7 @@ require_once('include/hubloc.php');
function checksites_run($argv, $argc){ function checksites_run($argc,$argv){
cli_startup(); cli_startup();
@ -57,6 +57,6 @@ function checksites_run($argv, $argc){
} }
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
checksites_run($argv,$argc); checksites_run($argc,$argv);
killme(); killme();
} }

View File

@ -5,18 +5,15 @@ require_once('include/cli_startup.php');
require_once('include/socgraph.php'); require_once('include/socgraph.php');
function cli_suggest_run($argv, $argc){ function cli_suggest_run($argc,$argv){
cli_startup(); cli_startup();
$a = get_app();
update_suggestions(); update_suggestions();
} }
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
cli_suggest_run($argv,$argc); cli_suggest_run($argc,$argv);
killme(); killme();
} }

View File

@ -4,7 +4,7 @@ require_once('boot.php');
require_once('include/cli_startup.php'); require_once('include/cli_startup.php');
function cronhooks_run($argv, $argc){ function cronhooks_run($argc,$argv){
cli_startup(); cli_startup();
@ -18,6 +18,6 @@ function cronhooks_run($argv, $argc){
} }
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
cronhooks_run($argv,$argc); cronhooks_run($argc,$argv);
killme(); killme();
} }

View File

@ -5,7 +5,7 @@ require_once('include/zot.php');
require_once('include/queue_fn.php'); require_once('include/queue_fn.php');
function deliver_run($argv, $argc) { function deliver_run($argc,$argv) {
cli_startup(); cli_startup();
@ -82,6 +82,6 @@ function deliver_run($argv, $argc) {
} }
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
deliver_run($argv,$argc); deliver_run($argc,$argv);
killme(); killme();
} }

View File

@ -5,7 +5,7 @@ require_once('include/cli_startup.php');
require_once('include/zot.php'); require_once('include/zot.php');
function deliver_hooks_run($argv, $argc) { function deliver_hooks_run($argc,$argv) {
cli_startup(); cli_startup();
@ -24,6 +24,6 @@ function deliver_hooks_run($argv, $argc) {
} }
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
deliver_hooks_run($argv,$argc); deliver_hooks_run($argc,$argv);
killme(); killme();
} }

View File

@ -16,7 +16,7 @@ require_once('include/queue_fn.php');
* @param array $argv * @param array $argv
* @param array $argc * @param array $argc
*/ */
function directory_run($argv, $argc){ function directory_run($argc,$argv){
cli_startup(); cli_startup();
@ -108,6 +108,6 @@ function directory_run($argv, $argc){
} }
if (array_search(__file__, get_included_files()) === 0) { if (array_search(__file__, get_included_files()) === 0) {
directory_run($argv, $argc); directory_run($argc,$argv);
killme(); killme();
} }

View File

@ -6,7 +6,7 @@
require_once('boot.php'); require_once('boot.php');
require_once('include/cli_startup.php'); require_once('include/cli_startup.php');
function expire_run($argv, $argc){ function expire_run($argc,$argv){
cli_startup(); cli_startup();
@ -93,6 +93,6 @@ function expire_run($argv, $argc){
} }
if (array_search(__file__, get_included_files()) === 0){ if (array_search(__file__, get_included_files()) === 0){
expire_run($argv, $argc); expire_run($argc,$argv);
killme(); killme();
} }

View File

@ -5,7 +5,7 @@ require_once('include/cli_startup.php');
require_once('include/zot.php'); require_once('include/zot.php');
require_once('include/identity.php'); require_once('include/identity.php');
function externals_run($argv, $argc){ function externals_run($argc,$argv){
cli_startup(); cli_startup();
$a = get_app(); $a = get_app();
@ -98,6 +98,6 @@ function externals_run($argv, $argc){
} }
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
externals_run($argv,$argc); externals_run($argc,$argv);
killme(); killme();
} }

View File

@ -3,7 +3,7 @@
require_once('include/cli_startup.php'); require_once('include/cli_startup.php');
require_once('include/zot.php'); require_once('include/zot.php');
function gprobe_run($argv, $argc){ function gprobe_run($argc,$argv){
cli_startup(); cli_startup();
@ -33,6 +33,6 @@ function gprobe_run($argv, $argc){
} }
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
gprobe_run($argv,$argc); gprobe_run($argc,$argv);
killme(); killme();
} }

View File

@ -5,7 +5,7 @@
require_once('include/cli_startup.php'); require_once('include/cli_startup.php');
function importdoc_run($argv, $argc){ function importdoc_run($argc,$argv){
cli_startup(); cli_startup();
@ -16,7 +16,7 @@ function importdoc_run($argv, $argc){
} }
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
importdoc_run($argv,$argc); importdoc_run($argc,$argv);
killme(); killme();
} }

View File

@ -74,7 +74,7 @@ require_once('include/bbcode.php');
require_once('include/identity.php'); require_once('include/identity.php');
require_once('include/Contact.php'); require_once('include/Contact.php');
function notifier_run($argv, $argc){ function notifier_run($argc,$argv){
cli_startup(); cli_startup();
@ -659,6 +659,6 @@ function notifier_run($argv, $argc){
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
notifier_run($argv,$argc); notifier_run($argc,$argv);
killme(); killme();
} }

View File

@ -6,7 +6,7 @@ require_once('include/zot.php');
require_once('include/dir_fns.php'); require_once('include/dir_fns.php');
function onedirsync_run($argv, $argc){ function onedirsync_run($argc,$argv){
cli_startup(); cli_startup();
@ -77,6 +77,6 @@ function onedirsync_run($argv, $argc){
} }
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
onedirsync_run($argv,$argc); onedirsync_run($argc,$argv);
killme(); killme();
} }

View File

@ -7,7 +7,7 @@ require_once('include/socgraph.php');
require_once('include/Contact.php'); require_once('include/Contact.php');
function onepoll_run($argv, $argc){ function onepoll_run($argc,$argv){
cli_startup(); cli_startup();
@ -154,6 +154,6 @@ function onepoll_run($argv, $argc){
} }
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
onepoll_run($argv,$argc); onepoll_run($argc,$argv);
killme(); killme();
} }

View File

@ -4,7 +4,7 @@ require_once('boot.php');
require_once('include/cli_startup.php'); require_once('include/cli_startup.php');
function poller_run($argv, $argc){ function poller_run($argc,$argv){
cli_startup(); cli_startup();
@ -440,6 +440,6 @@ function poller_run($argv, $argc){
} }
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
poller_run($argv,$argc); poller_run($argc,$argv);
killme(); killme();
} }

View File

@ -4,7 +4,7 @@ require_once('include/cli_startup.php');
require_once('include/queue_fn.php'); require_once('include/queue_fn.php');
require_once('include/zot.php'); require_once('include/zot.php');
function queue_run($argv, $argc){ function queue_run($argc,$argv){
cli_startup(); cli_startup();
@ -90,6 +90,6 @@ function queue_run($argv, $argc){
} }
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
queue_run($argv,$argc); queue_run($argc,$argv);
killme(); killme();
} }

View File

@ -5,7 +5,7 @@ require_once('include/zot.php');
require_once('include/queue_fn.php'); require_once('include/queue_fn.php');
function ratenotif_run($argv, $argc){ function ratenotif_run($argc,$argv){
cli_startup(); cli_startup();
@ -114,6 +114,6 @@ function ratenotif_run($argv, $argc){
} }
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
ratenotif_run($argv,$argc); ratenotif_run($argc,$argv);
killme(); killme();
} }

View File

@ -1,7 +1,7 @@
<?php <?php
function po2php_run($argv, $argc) { function po2php_run($argc,$argv) {
if ($argc!=2) { if ($argc!=2) {
print "Usage: ".$argv[0]." <file.po>\n\n"; print "Usage: ".$argv[0]." <file.po>\n\n";
@ -140,5 +140,5 @@ function trim_message($str) {
} }
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
po2php_run($argv,$argc); po2php_run($argc,$argv);
} }