Welcome Guest, Not a member yet? Register   Sign In
delete_files() not working correctly in CI3
#2

[quote pid="389060" dateline="1627916219"]
 i use to for ci3 ,4 

PHP Code:
<?php namespace Modules\Common\Libraries;

use 
CodeIgniter\HTTP\Response;

class  CustomFileSystem
{
    protected string $error;

    public function __construct()
    {
        $this->error '';
    }

    /**
    * @return string
    */
    public function getError(): string
    
{
        return $this->error;
    }

    public function removeSingleFile($path)
    {
        try {

            if (file_exists($path)) {
                unlink($path);
            }


        } catch (\Exception $e) {
            $this->error $e->getMessage();

        }

    }


    public function removeMultipleFiles($path)
    {
        try {

            if (file_exists($path)) {
                unlink($path);
            }


        } catch (\Exception $e) {
            $this->error $e->getMessage();

        }

    }




[/quote]
Enlightenment  Is  Freedom
Reply


Messages In This Thread
RE: delete_files() not working correctly in CI3 - by paliz - 08-02-2021, 10:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB