Welcome Guest, Not a member yet? Register   Sign In
Welcome message out of the box regardless
#1

(This post was last modified: 03-23-2020, 08:15 PM by John_Betong.)

I know this has been discussed before but I do think that being able to immediately display the "Welcome_message" would be beneficial rather than having the unfriendly "Whoops! We seem to have hit a snag message..." appear...

May I propose the following additional JavaScript script which I think is far more informative:

file: system/Cache/Handlers/FileHandler.php
PHP Code:
/**
* Constructor.
*
* @param  type $config
* @throws type
*/
public function __construct($config)
{
$path = ! empty($config->storePath) ? $config->storePath WRITEPATH 'cache';
if (! 
is_really_writable($path))
{

// PROPOSAL START
$aTmp = [
 
'Unable to log Errors and/or warnings'
 
'Please set ../writable folder permissions to 0777',
 
'../writable folder permissions not set to 0777',
 
'Please consult manual regarding ../writable folder',
 
'\t\tWhoops! \n\nWe seem to have hit a snag. \n\n\tPlease try again later...\n\n',
 
'Better suggestions welcome \n\n\t\t :)\n\n',
 
'Shit happens :(',
 ];
$tmp $aTmp[mt_rand(0count($aTmp)-)];

?>
<script>
alert("<?= $tmp ?>");
</script>
<?php
// throw CacheException::forUnableToWrite($path);
// PROPOSAL FINISH

}//endif

$this->prefix $config->prefix ?: '';
$this->path  rtrim($path'/') . '/';
}
//endfunc 

Please note the additional script always shows if and only the writable folder is not writable instead of the following exception:

PHP Code:
  throw CacheException::forUnableToWrite($path); 
Reply


Messages In This Thread
Welcome message out of the box regardless - by John_Betong - 03-23-2020, 08:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB