simple-backup icon indicating copy to clipboard operation
simple-backup copied to clipboard

PHP Fatal error: Uncaught Error: Using $this when not in object context

Open shahariaazam opened this issue 4 years ago • 8 comments

Can't use excludeOnly and includeOnly features.

[06-May-2020 21:04:37 UTC] PHP Fatal error:  Uncaught Error: Using $this when not in object context in /var/www/backup/vendor/coderatio/simple-backup/src/SimpleBackup.php:481
Stack trace:
#0 [internal function]: Coderatio\SimpleBackup\SimpleBackup::Coderatio\SimpleBackup\{closure}()
#1 /var/www/backup/vendor/coderatio/simple-backup/src/SimpleBackup.php(486): array_filter()
#2 /var/www/backup/test.php(26): Coderatio\SimpleBackup\SimpleBackup->excludeOnly()
#3 {main}
  thrown in /var/www/backup/vendor/coderatio/simple-backup/src/SimpleBackup.php on line 481

shahariaazam avatar May 06 '20 21:05 shahariaazam

Related issue #2

Related PR #3

@coderatio, can you please review that PR and make a release?

shahariaazam avatar May 06 '20 21:05 shahariaazam

Related issue #2

Related PR #3

@coderatio, can you please review that PR and make a release?

shahariaazam avatar May 06 '20 21:05 shahariaazam

@shahariaazam I will do that by tomorrow and let you know immediately.

Sorry about this.

coderatio avatar May 07 '20 00:05 coderatio

@shahariaazam I will do that by tomorrow and let you know immediately.

Sorry about this.

coderatio avatar May 07 '20 00:05 coderatio

@shahariaazam I will do that by tomorrow and let you know immediately.

Sorry about this.

Thanks @coderatio . Also to use your library i also found some others bugs and few recommendations. I can create several issue and post fixes with my PR if you are OK with that.

shahariaazam avatar May 07 '20 00:05 shahariaazam

@shahariaazam I will do that by tomorrow and let you know immediately.

Sorry about this.

Thanks @coderatio . Also to use your library i also found some others bugs and few recommendations. I can create several issue and post fixes with my PR if you are OK with that.

shahariaazam avatar May 07 '20 00:05 shahariaazam

@shahariaazam this sounds good. Please go ahead.

I'm currently reviewing the whole package too. Thanks for this man.

coderatio avatar May 07 '20 00:05 coderatio

@shahariaazam this sounds good. Please go ahead.

I'm currently reviewing the whole package too. Thanks for this man.

Thanks. In coming weekend I will make some plans.

shahariaazam avatar May 07 '20 00:05 shahariaazam

I just hit this same issue using the composer-packaged version

Exception - Using $this when not in object context
Stack trace:
    line 481 of /backup/vendor/coderatio/simple-backup/src/SimpleBackup.php: Error thrown
    line ? of unknownfile: call to Coderatio\SimpleBackup\SimpleBackup::Coderatio\SimpleBackup\{closure}()
    line 486 of /backup/vendor/coderatio/simple-backup/src/SimpleBackup.php: call to array_filter()
    line 49 of /backup/index.php: call to Coderatio\SimpleBackup\SimpleBackup->excludeOnly()
$ composer show --latest
coderatio/simple-backup v1.0.4 v1.0.4 A simple mysql database backup library for php.
        $this->tables = array_filter($this->tables, static function($table){
            if(!in_array($table, $this->tables_to_exclude, false)) {
                return $table;
            }

            return null;
        });

Could you please tag an update with this up to packagist? Ref https://packagist.org/packages/coderatio/simple-backup

Or maybe I'm missing something?

mwithheld avatar Nov 18 '20 00:11 mwithheld

Add pull request #5 to fix this

mwithheld avatar Nov 18 '20 00:11 mwithheld

hello , i m not getting whole data while exporting mysql database, what goes wrong with me

Screenshot (69)

shaikhsaliem avatar Oct 12 '21 12:10 shaikhsaliem