• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
is it possible to make command to delete debugbar json files?

#1
In Codeigntier 4, Debugbar is automatically creating so many json files when CI_ENVIRONMENT = development.
is there any way to delete it periodically?

can we create one spark command to delete these json files? 

is there any good solution?


Attached Files Thumbnail(s)
   
Reply

#2
I am not familiar with Spark so use this index.php script: 

Code:
# CLEANER -  only shows last error logs and debugbar JSON files
  define('LOGFILE',  '../writable/logs/log-' .date('Y-m-d') .'.php');
  $ok = @unlink(LOGFILE);
  $ok = @array_map('unlink', glob("../writable/debugbar/*.json"));
download and make your system directory strict
Reply

#3
(03-10-2020, 09:08 PM)John_Betong Wrote: I am not familiar with Spark so use this index.php script: 

Code:
# CLEANER -  only shows last error logs and debugbar JSON files
  define('LOGFILE',  '../writable/logs/log-' .date('Y-m-d') .'.php');
  $ok = @unlink(LOGFILE);
  $ok = @array_map('unlink', glob("../writable/debugbar/*.json"));

i got it. thank you.
Reply

#4
In CI 4 the log files extension is .log not .php 

This is what worked for me:

PHP Code:
<?php
    
# CLEANER -  only shows last error logs and debugbar JSON files
    
$ok = @array_map('unlink'glob("../writable/logs/*.log"));
    
$ok = @array_map('unlink'glob("../writable/debugbar/*.json")); 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.