Comments (5)
Actually, I believe I have found the reason: The Polyfill seems not to be included in the final phpbu.phar
distribution file:
phar list -f phpbu.phar | grep polyfill-mbstring
# 0 results
I believe the Phar file is built by copying dependencies over via a "whitelist":
Lines 453 to 461 in b65da0c
E.g.: The current distribution only contains symfony/options-resolver
, but not the other symfony/*
dependencies, such as the polyfill:
- deprecation-contracts
- polyfill-ctype
- polyfill-mbstring
- polyfill-php80
- process
- var-dumper
I am not sure why the dependencies are copied one-by-one, rather than adding all of them. Perhaps distribution size? But even then I would guess adding everything and then removing the ones that are definitely not needed (aka. blacklist rather than whitelist) would make for more stable release package while keeping release sizes reasonable.
from phpbu.
possible solution here:
https://stackoverflow.com/questions/6419102/fatal-error-call-to-undefined-function-mb-strlen
from phpbu.
Hm, this puzzles me a bit. Can you provide more information on the type of environment you run phpbu in: PHP version, OS, Shared Hosting, phpbu version, ...?
This usage of mb_strlen
comes from a transitive dependency: phpbu uses aws/aws-sdk-php
, which uses mtdowling/jmespath.php
, which uses mb_strlen
. However, that last one also requires symfony/polyfill-mbstring
, which should transparently add the function in the global namespace, if it doesn't exist. So I am wondering how we're even getting to this message...
from phpbu.
Well, is a VPS with docker and no public php server. So the php installed there is the default ubuntu one, which lacks the mbstring.
Installing apt-get install php7.4-mbstring
solve the issue and works, but yeah, I wondered the same thing.
Ubuntu 22.04, php 7.4, latest phpbu version. VPS.
from phpbu.
Yes the main reason for the whitelist was file size at some point.
But I think changing it to a blacklist would be the better option.
That does not remove the burden of knowing every dependency that goes into the PHAR.
The Symfony polyfills are a good example. Including the classes into the PHAR is not enough.
The polyfill setup hast to be manually called within the PHAR
// load the symfony polyfills
require __PHPBU_PHAR_ROOT__ . '/lib/symfony/polyfill-ctype/bootstrap.php';
require __PHPBU_PHAR_ROOT__ . '/lib/symfony/polyfill-mbstring/bootstrap.php';
require __PHPBU_PHAR_ROOT__ . '/lib/symfony/polyfill-php80/bootstrap.php';
I think 470ab12 fixes the issue
from phpbu.
Related Issues (20)
- Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in phar:///home/<site>/public_html/dbbackup/phpbu.phar/lib/symfony/process/Process.php on line 54 HOT 7
- Nextcloud support? HOT 1
- error HOT 3
- SSL decryption issue HOT 2
- Incomplete remote MySQL backups? HOT 1
- DropBox tokens expire after 4 hours HOT 4
- Webhook json template example? HOT 2
- Relative paths don't work for template? HOT 2
- Docker support HOT 2
- What will happen if the database is huge? HOT 1
- syntax error when selected pgdump HOT 1
- More information in the message HOT 1
- GPG encryption is not working
- Error with `xtrabackup8` source: `unknown argument` for target directory HOT 2
- Minor improvement regarding the manual and the use of OpenSSL (on Windows)
- syntax error, unexpected '|', expecting variable HOT 2
- Google Drive crypt failing HOT 2
- rsync with port
- PHP Parse error: syntax error, unexpected 'static' (T_STATIC) in phar (using phpbu-6.0.20.phar with php 7.4.33) HOT 1
- Consider adding support for MariaDB `mariabackup`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpbu.