Error con una funcion PHP

  • Autor Autor imported_erickman
  • Fecha de inicio Fecha de inicio
I

imported_erickman

Curioso
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
tengo un problema con una funcion es de un modulo de WHMCS
aqui les muestro el error espero que me ayuden




if (!()->hasTable('mod_xtreamautoscript')) { <-------ERROR AQUI syntax error, unexpected '}'
WHMCS\Database\Capsule::schema()->create('mod_xtreamautoscript', function($table) {
$table->string('name');
$table->string('value');
});
$autoscript = array('Enigma 2 OE 1.6' => 'wget -O /etc/enigma2/iptv.sh \'{$serverhostname}/get.php?username={$iptv_username}&password={$iptv_password}&type=enigma216_script&output={$outputfirst}\' && chmod 777 /etc/enigma2/iptv.sh && /etc/enigma2/iptv.sh', 'Enigma 2 OE 2.0' => 'wget -O /etc/enigma2/iptv.sh \'{$serverhostname}/get.php?username={$iptv_username}&password={$iptv_password}&type=enigma22_script&output={$outputfirst}\' && chmod 777 /etc/enigma2/iptv.sh && /etc/enigma2/iptv.sh', 'Octagon Script' => 'wget -qO /var/bin/iptv \'{$serverhostname}/get.php?username={$iptv_username}&password={$iptv_password}&type=octagon_script&output={$outputfirst}\'');


foreach ($autoscript as $name => $value) {
$configurationautoscript[] = array('name' => $name, 'value' => $value);
}


WHMCS\Database\Capsule::table('mod_xtreamautoscript')->delete();


try {
WHMCS\Database\Capsule::table('mod_xtreamautoscript')->insert($configurationautoscript);
}
catch (Exception $e) {
return array('status' => 'error', 'description' => $e->getMessage() . '. There is an error while activating this module');
}
}
else { <----- ERROR AQUI
return array('status' => 'error', 'description' => $e->getMessage() . '. There is an error while activating this module');
}
 
[MENTION=73120]imported_erickman[/MENTION]

Posible hasta probable es que te falta el símbolo de abre o cierre en algún lado.
 
no se como resolverlo tengo todo el codigo si quieres te lo paso para que lo mires
 
Prueba con este, a ver que tal 🙂


PHP:
if (!hasTable('mod_xtreamautoscript')) {
	WHMCS\Database\Capsule::schema()->create('mod_xtreamautoscript', function($table) {
		$table->string('name');
		$table->string('value');
	});
	$autoscript = array('Enigma 2 OE 1.6' => 'wget -O /etc/enigma2/iptv.sh \'{$serverhostname}/get.php?username={$iptv_username}&password={$iptv_ password}&type=enigma216_script&output={$outputfir st}\' && chmod 777 /etc/enigma2/iptv.sh && /etc/enigma2/iptv.sh', 'Enigma 2 OE 2.0' => 'wget -O /etc/enigma2/iptv.sh \'{$serverhostname}/get.php?username={$iptv_username}&password={$iptv_ password}&type=enigma22_script&output={$outputfirs t}\' && chmod 777 /etc/enigma2/iptv.sh && /etc/enigma2/iptv.sh', 'Octagon Script' => 'wget -qO /var/bin/iptv \'{$serverhostname}/get.php?username={$iptv_username}&password={$iptv_ password}&type=octagon_script&output={$outputfirst }\'');


	foreach ($autoscript as $name => $value) {
		$configurationautoscript[] = array('name' => $name, 'value' => $value);
	}


	WHMCS\Database\Capsule::table('mod_xtreamautoscrip t')->delete();


	try {
		WHMCS\Database\Capsule::table('mod_xtreamautoscrip t')->insert($configurationautoscript);
	}
	catch (Exception $e) {
		return array('status' => 'error', 'description' => $e->getMessage() . '. There is an error while activating this module');
	}
}
else {
	return array('status' => 'error', 'description' => $e->getMessage() . '. There is an error while activating this module');
}
 
te falta uno de esos, solo sigue el codigo mira donde abre y donde cierra... no tiene mucho misterio, suponiendo que el codigo esté completo
 
Atrás
Arriba