src/Database/InOut/Mysql/Importer.php
public static function last($name)
    {
        if (!$name) {
            $database = config('database.database');
            $path = root().'database/backup';
            $files = glob($path.'/*.sql');

            if (!is_null($files)) {
                for ($i = count($files) - 1; $i >= 0; $i--) {
                    $file = $files[$i];
                    //
                    $file = explode(root().'database/backup/'.$database.'_', $file);
                    $file = $file[1];
                    $file = explode('.sql', $file);
                    $file = $file[0];
                    //
                    if (is_numeric($file)) {
                        return root().'database/backup/'.$database.'_'.$file.'.sql';
                    }
                }
            }
        } elseif ($name) {
            return root().'database/backup/'.$name.'.sql';
        }
    }
public static function last($name)
    {
        if (!$name) {
            $database = config('database.database');
            $path = root().'database/backup';
            $files = glob($path.'/*.sql');

            if (!is_null($files)) {
                for ($i = count($files) - 1; $i >= 0; $i--) {
                    $file = $files[$i];
                    //
                    $file = explode(root().'database/backup/'.$database.'_', $file);
                    $file = $file[1];
                    $file = explode('.sql', $file);
                    $file = $file[0];
                    //
                    if (is_numeric($file)) {
                        return root().'database/backup/'.$database.'_'.$file.'.sql';
                    }
                }
            }
        } elseif ($name) {
            return root().'database/backup/'.$name.'.sql';
        }
    }
public static function last ( $ name ) { if ( ! $ name ) { $ database = config ( 'database.database' ) ; $ path = root ( ) . 'database/backup' ; $ files = glob ( $ path . '/*.sql' ) ; if ( ! is_null ( $ files ) ) { for ( $ i = count ( $ files ) - 1 ; $ i >= 0 ; $ i -- ) { $ file = $ files [ $ i ] ; // $ file = explode ( root ( ) . 'database/backup/' . $ database . '_' , $ file ) ; $ file = $ file [ 1 ] ; $ file = explode ( '.sql' , $ file ) ; $ file = $ file [ 0 ] ; // if ( is_numeric ( $ file ) ) { return root ( ) . 'database/backup/' . $ database . '_' . $ file . '.sql' ; } } } } elseif ( $ name ) { return root ( ) . 'database/backup/' . $ name . '.sql' ; } }
Get the last database save.

@param string $name

@return string
Get the last database save .