Merge pull request #4 from setiawanhu/dev

Potential Critical Bug Fix
This commit is contained in:
Setiawan 2020-08-18 21:13:07 +07:00 committed by GitHub
commit d0c6af04fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 5 deletions

View File

@ -49,7 +49,7 @@ return [
'logger' => Logger::FILE_LOGGER,
'logger_param' => env('MP_LOGGER_PATH', storage_path('logs/madeline-proto.log')),
'logger_param' => env('MP_LOGGER_PATH', storage_path('logs/madeline_proto_' . date('dmY') . '.log')),
],

View File

@ -70,10 +70,6 @@ class MadelineProtoFactory
$config = config('telegram.settings');
}
if (!file_exists(storage_path("app/telegram/"))) {
mkdir(storage_path("app/telegram"), 0755);
}
$client = new API(storage_path("app/telegram/$sessionFile"), $config);
return new MadelineProto($client);

View File

@ -52,6 +52,8 @@ class MadelineProtoServiceProvider extends ServiceProvider
if ($this->app->runningInConsole()) {
$this->registerCommands();
$this->generateTelegramSessionFolder();
$this->publishes([
__DIR__ . '/../config/telegram.php' => config_path('telegram.php')
]);
@ -71,6 +73,18 @@ class MadelineProtoServiceProvider extends ServiceProvider
]);
}
/**
* Create telegram session folder at storage path.
*
* @return void
*/
public function generateTelegramSessionFolder()
{
if (!file_exists(storage_path("app/telegram/"))) {
mkdir(storage_path("app/telegram"), 0755);
}
}
/**
* @inheritDoc
*/