Skip to content

Commit

Permalink
Update according to rejoice/framework:0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
prinx committed Oct 23, 2020
1 parent 03cdaaf commit c2ba18c
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 29 deletions.
6 changes: 3 additions & 3 deletions app/Console/Commands/MyCustomCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Console\Commands;

use Rejoice\Console\Commands\SmileCommand;
use Rejoice\Console\Commands\SmileCommand as Command;

class MyCustomCommand extends SmileCommand
class MyCustomCommand extends Command
{
public function configure()
{
Expand All @@ -17,6 +17,6 @@ public function fire()
{
$this->success('It works :D');

return SmileCommand::SUCCESS;
return Command::SUCCESS;
}
}
25 changes: 15 additions & 10 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/*
* Unique identifier for this application.
*/
'id' => env('APP_ID', 'rejoice_'.rand(1, 999999)),
'id' => env('APP_ID', 'rejoice_ussd'),

/*
* The environment of the application
Expand All @@ -31,22 +31,22 @@

/*
* If true, and an SMS endpoint and sender name have been configured, every
* last response will be sent as SMS to the user
* last response will be sent as SMS to the user.
*/
'always_send_sms_at_end' => false,

/*
* For test purpose. You can enable/disable overall sending of SMS
* For test purpose. You can enable/disable overall sending of SMS.
*/
'send_sms_enabled' => env('SEND_SMS_ENABLED', true),

/*
* For test purpose. You can enable/disable overall sending of SMS
* For test purpose. You can enable/disable overall sending of SMS.
*/
'log_enabled' => env('LOG_ENABLED', true),

/*
* You can disabled connection to the application database by turning this to false
* You can disabled connection to the application database by turning this to false.
*/
'connect_app_db' => true,

Expand All @@ -62,7 +62,7 @@
* intentionally or unintentionaly, cancels his request.
* If false, whenever the user comes back after
* cancelling his session, they will have a prompt to continue from last
* session or restart a new session
* session or restart a new session.
*/
'always_start_new_session' => false,

Expand All @@ -88,7 +88,7 @@
'allow_timeout' => true,

/*
* Cancel the session whenever there is an error in the user's response
* Cancel the session whenever there is an error in the user's response.
*/
'end_on_user_error' => false,

Expand All @@ -103,13 +103,18 @@

/*
* If true, you can directly call a sub menu, without passing through
* the normal flow (from the welcome menu till the particular sub menu)
* the normal flow (from the welcome menu till the particular sub menu).
*/
'allow_direct_sub_menu_call' => false,

/*
* Delimits variables in stubs files.
*/
'stub_variable_delimiter' => ':',

/*
* Customize according to the paramters provided by the telecos of the
* country
* country.
*/
'request_param_user_phone_number' => env('USER_PHONE_PARAM_NAME', 'msisdn'),
'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'),
Expand All @@ -119,7 +124,7 @@
'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'),

/*
* Request type codes
* Request type codes.
*/
'request_init' => env('REQUEST_INIT_CODE', '1'),
'request_end' => env('REQUEST_END_CODE', '17'),
Expand Down
62 changes: 55 additions & 7 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* $this->db('name')->query('SELECT name FROM users WHERE age > 18');
*
* The `name` is the index that is specified in the array return below.
* If no name is passed, the default will be returned:
* If no name is passed, the 'default' will be returned:
*
* $db = $this->db();
* equivalent to:
Expand All @@ -20,12 +20,60 @@

return [

'default' => [
'user' => env('APP_DEFAULT_DB_USER', ''),
'password' => env('APP_DEFAULT_DB_PASS', ''),
'host' => env('APP_DEFAULT_DB_HOST', ''),
'port' => env('APP_DEFAULT_DB_PORT', ''),
'dbname' => env('APP_DEFAULT_DB_NAME', ''),
'default' => env('APP_DB_CONNECTION', 'mysql'),

'connections' => [

'mysql' => [
'driver' => 'mysql',
'host' => env('APP_DB_HOST', '127.0.0.1'),
'port' => env('APP_DB_PORT', '3306'),
'database' => env('APP_DB_NAME', ''),
'username' => env('APP_DB_USER', ''),
'password' => env('APP_DB_PASS', ''),
'unix_socket' => env('APP_DB_SOCKET', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
],

'sqlite' => [
'driver' => 'sqlite',
'url' => env('APP_DB_URL'),
'database' => env('APP_DB_NAME', ''),
'prefix' => '',
'foreign_key_constraints' => env('APP_DB_FOREIGN_KEYS', true),
],

'pgsql' => [
'driver' => 'pgsql',
'url' => env('APP_DB_URL'),
'host' => env('APP_DB_HOST', '127.0.0.1'),
'port' => env('APP_DB_PORT', '5432'),
'database' => env('APP_DB_NAME', 'forge'),
'username' => env('APP_DB_USER', 'forge'),
'password' => env('APP_DB_PASS', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'sslmode' => 'prefer',
],

'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('APP_DB_URL'),
'host' => env('APP_DB_HOST', 'localhost'),
'port' => env('APP_DB_PORT', '1433'),
'database' => env('APP_DB_NAME', 'forge'),
'username' => env('APP_DB_USER', 'forge'),
'password' => env('APP_DB_PASS', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
],
],

];
55 changes: 51 additions & 4 deletions config/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,62 @@

'message_ask_user_before_reload_last_session' => 'Do you want to continue from where you left?',

'last_session_trigger' => '1',
'last_session_display' => 'Continue last session',
'last_session_trigger' => '1',

'last_session_display' => 'Continue last session',

'restart_session_trigger' => '2',

'restart_session_display' => 'Restart',

/*
* Default character that will trigger a go back, if the user can go back
* on the current menu
*/
'back_action_trigger' => '0',

/*
* Default 'go back' expression to display to the user, if the user can go
* back on the current menu
*/
'back_action_display' => 'Back',

/*
* Default character that will trigger a go forward, if the user can go
* forward on the current menu
*/
'splitted_menu_next_trigger' => '00',
'splitted_menu_display' => 'Next page',

/*
* Default 'go forward' expression to display to the user, if they can go
* forward on the current menu
*/
'splitted_menu_display' => 'Next page',

/*
* Default character that will trigger a go forward, if the user can go
* forward on the current menu
*/
'paginate_forward_trigger' => '00',

/*
* Default 'paginate forward' expression
*/
'paginate_forward_display' => 'More',

/*
* Default character that will trigger a go forward, if the user can go
* forward on the current menu
*/
'welcome_action_trigger' => '01',

/*
* Default 'paginate forward' expression
*/
'welcome_action_display' => 'Main menu',

'end_trigger' => '02',

'end_display' => 'End',

/*
Expand All @@ -34,12 +72,19 @@

'unhandled_action_message' => 'Action not handled.',

'empty_response_error' => 'Empty response not allowed',
'empty_response_error' => 'Empty response not allowed.',

'application_failed_message' => 'Sorry, an error happened.',

/*
* Default character that will trigger a paginate back, if the user can
* paginate back on the current menu
*/
'paginate_back_trigger' => '0',

/*
* Default 'paginate back' expression
*/
'paginate_back_display' => 'Back',

/*
Expand All @@ -63,6 +108,8 @@
*/
'trigger_decorator' => '. ',

'namespace_delimiter' => '::',

/*
* If allow_timeout is false, this message will be appended to the last
* message to let the user press the cancel button to terminate the request.
Expand Down
18 changes: 13 additions & 5 deletions config/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@

return [

'driver' => env('SESSION_DRIVER', 'file'), // file|database
/*
* file|database
*/
'driver' => env('SESSION_DRIVER', 'file'),

// Use to control the timeout of the final response
'timeout' => 180, // 3min
/*
* Timeout of the final response
*/
'timeout' => 5, // 3min

// Remaining session will be deleted after the lifetime has passed
'lifetime' => 60 * 60 * 5, // 5h
/*
* Sessions will be deleted after the lifetime has passed
* Default = 60 * 60 * 5 = 5hours
*/
'lifetime' => 60 * 60 * 5,

'database' => [
'user' => env('SESSION_DB_USER', ''),
Expand Down

0 comments on commit c2ba18c

Please sign in to comment.