Invalid usage of a reserved method name unlink() Sugar7

This was also mentioned as ... and i have resolved all by using SugarAutoLoader but unable to resolve this problem. Please help

Invalid usage of a function file_exists()
Invalid usage of a function file_exists()
Invalid usage of a function mkdir()
Invalid usage of a function pathinfo()
Invalid usage of a function file_exists()
Invalid usage of a function unlink()
Invalid usage of a function move_uploaded_file()
Invalid usage of a function $base_module_create()
Invalid usage of a function preg_replace_callback()

These All are done

Parents Reply Children
  • Yeah, in that case I would have to see more of your code and know what it is you are trying to accomplish.  There really isn't a way to unlink() files in the OnDemand environment.  If that's something you have to do then you would need to move your instance on site.  

    That being said there are always ways to make something work.  It depends on what the file you want to delete does.  If it's a PHP/TPL file then you might be out of luck, there just isn't an unlink command to use. But if its some sort of data file or JavaScript or CSS then maybe writing it to a file isn't necessary, I have kept data files like this in memory or written them to a DB table to get around the unlink() issue in the past.  You can easily insert JS and CSS into TPL files in an ad-hoc fashion that might work. 

    Give us some detail on what you are trying to do and maybe we can help with a solution.