GlideApp.with(context!!)
.load(user.avatar)
.apply(
RequestOptions()
.error(R.drawable.cabinet_photo)
)
.listener(object : RequestListener<Drawable> {
override fun onLoadFailed(
e: GlideException?,
model: Any?,
target: Target<Drawable>?,
isFirstResource: Boolean
): Boolean {
Log.e("tag", "fail")
e?.rootCauses?.forEach {
Log.e("tag", "error = $it")
}
return false
}
override fun onResourceReady(
resource: Drawable?,
model: Any?,
target: Target<Drawable>?,
dataSource: DataSource?,
isFirstResource: Boolean
): Boolean {
Log.e("tag", "success")
return false
}
})
.into(photoImage)
return [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=',
'username' => '',
'password' => '',
'charset' => 'utf8',
'enableSchemaCache' => true,
'schemaCacheDuration' => 60,
'schemaCache' => 'cache',
PDO::ATTR_PERSISTENT => true
];