function advancedcontentfilter_init(App $a)
{
- if ($a->argc > 1 && $a->argv[1] == 'api') {
+ if (DI::args()->getArgc() > 1 && DI::args()->getArgv()[1] == 'api') {
$slim = new \Slim\App();
require __DIR__ . '/src/middlewares.php';
function advancedcontentfilter_content(App $a)
{
if (!local_user()) {
- return Login::form('/' . implode('/', $a->argv));
+ return Login::form('/' . implode('/', DI::args()->getArgv()));
}
- if ($a->argc > 1 && $a->argv[1] == 'help') {
+ if (DI::args()->getArgc() > 1 && DI::args()->getArgv()[1] == 'help') {
$lang = $a->user['language'];
$default_dir = 'addon/advancedcontentfilter/doc/';
require_once "mod/settings.php";
settings_init($a);
- if (isset($a->argv[1])) {
- switch ($a->argv[1]) {
+ if (isset(DI::args()->getArgv()[1])) {
+ switch (DI::args()->getArgv()[1]) {
case "connect":
$o = buffer_connect($a);
break;
default:
- $o = print_r($a->argv, true);
+ $o = print_r(DI::args()->getArgv(), true);
break;
}
} else {
*/
function catavatar_content(App $a)
{
- if ($a->argc < 2 || $a->argc > 3) {
+ if (DI::args()->getArgc() < 2 || DI::args()->getArgc() > 3) {
throw new NotFoundException(); // this should be catched on index and show default "not found" page.
}
- if (is_numeric($a->argv[1])) {
- $uid = intval($a->argv[1]);
+ if (is_numeric(DI::args()->getArgv()[1])) {
+ $uid = intval(DI::args()->getArgv()[1]);
$condition = ['uid' => $uid,
'account_expired' => false, 'account_removed' => false];
$user = DBA::selectFirst('user', ['email'], $condition);
}
$seed = DI::pConfig()->get($uid, "catavatar", "seed", md5(trim(strtolower($user['email']))));
- } elseif (!empty($a->argv[1])) {
- $seed = $a->argv[1];
+ } elseif (!empty(DI::args()->getArgv()[1])) {
+ $seed = DI::args()->getArgv()[1];
} else {
throw new NotFoundException();
}
$size = 0;
- if ($a->argc == 3) {
- $size = intval($a->argv[2]);
+ if (DI::args()->getArgc() == 3) {
+ $size = intval(DI::args()->getArgv()[2]);
}
// ...Or start generation
);
if (DBA::isResult($r)) {
- if (in_array('small', $a->argv)) {
+ if (in_array('small', DI::args()->getArgv())) {
$photo = 'thumb';
} else {
$photo = 'photo';
function ifttt_post(App $a)
{
- if ($a->argc != 2) {
+ if (DI::args()->getArgc() != 2) {
return;
}
- $nickname = $a->argv[1];
+ $nickname = DI::args()->getArgv()[1];
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname]);
if (!DBA::isResult($user)) {
require_once("mod/settings.php");
settings_init($a);
- if (isset($a->argv[1])) {
- switch ($a->argv[1]) {
+ if (isset(DI::args()->getArgv()[1])) {
+ switch (DI::args()->getArgv()[1]) {
case "connect":
$o = pumpio_connect($a);
break;
default:
- $o = print_r($a->argv, true);
+ $o = print_r(DI::args()->getArgv(), true);
break;
}
} else {
return '';
}
- if (isset($a->argv[1])) {
- switch ($a->argv[1]) {
+ if (isset(DI::args()->getArgv()[1])) {
+ switch (DI::args()->getArgv()[1]) {
case "connect":
$o = tumblr_connect($a);
break;
break;
default:
- $o = print_r($a->argv, true);
+ $o = print_r(DI::args()->getArgv(), true);
break;
}
} else {
// Login with the specified Network credentials (like in api.php)
windowsphonepush_login($a);
- $path = $a->argv[0];
- $path2 = $a->argv[1];
+ $path = DI::args()->getArgv()[0];
+ $path2 = DI::args()->getArgv()[1];
if ($path == "windowsphonepush") {
switch ($path2) {
case "show_settings":
return;
}
- if (in_array($a->argv[0], ["delegation", "logout"])) {
+ if (in_array(DI::args()->getArgv()[0], ["delegation", "logout"])) {
$additional_commands = "converse.user.logout();\n";
} else {
$additional_commands = "";