Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] change the placeholder of schema dump according to symfony placeholder... #34261

Merged
merged 1 commit into from
Sep 10, 2020
Merged

Conversation

Hesammousavi
Copy link
Contributor

i had a problem with shcema:dump
according to this issues #34257
after runing this command php artisan schema:dump im geting this error

Unknown suffix '$' used for variable 'port' (value '$LARAVEL_LOAD_PORT')
mysqldump: Error while setting value '$LARAVEL_LOAD_PORT' to 'port'

i figure out the placeholder of symfony is this code

    private function replacePlaceholders(string $commandline, array $env)
    {
        return preg_replace_callback('/"\$\{:([_a-zA-Z]++[_a-zA-Z0-9]*+)\}"/', function ($matches) use ($commandline, $env) {
            if (!isset($env[$matches[1]]) || false === $env[$matches[1]]) {
                throw new InvalidArgumentException(sprintf('Command line is missing a value for parameter "%s": ', $matches[1]).$commandline);
            }

            return $this->escapeArgument($env[$matches[1]]);
        }, $commandline);
    }

look at this line
'/"\$\{:([_a-zA-Z]++[_a-zA-Z0-9]*+)\}"/

according to this one
this is wrong command that you put on MysqlSchemaState

        return 'mysqldump '.$gtidPurged.' --column-statistics=0 --skip-add-drop-table --skip-add-locks --skip-comments --skip-set-charset --tz-utc --host=$LARAVEL_LOAD_HOST --port=$LARAVEL_LOAD_PORT --user=$LARAVEL_LOAD_USER --password=$LARAVEL_LOAD_PASSWORD $LARAVEL_LOAD_DATABASE';

i just replace this one to this

'mysqldump '.$gtidPurged.' --column-statistics=0 --skip-add-drop-table --skip-add-locks --skip-comments --skip-set-charset --tz-utc --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --user="${:LARAVEL_LOAD_USER}" --password="${:LARAVEL_LOAD_PASSWORD}" "${:LARAVEL_LOAD_DATABASE}"'

i don't know i'm telling right thing but if u help me to figure it can be helpful

@Hesammousavi Hesammousavi changed the title change the placeholder of schema dump according to symfony placeholder... [8.X] change the placeholder of schema dump according to symfony placeholder... Sep 10, 2020
@Hesammousavi Hesammousavi changed the title [8.X] change the placeholder of schema dump according to symfony placeholder... [8.x] change the placeholder of schema dump according to symfony placeholder... Sep 10, 2020
@taylorotwell taylorotwell merged commit bffaf8d into laravel:8.x Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants