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

Unable to set static zone in cloudflare.php #8

Open
bertalanimre opened this issue Jun 4, 2019 · 5 comments
Open

Unable to set static zone in cloudflare.php #8

bertalanimre opened this issue Jun 4, 2019 · 5 comments
Labels

Comments

@bertalanimre
Copy link

Hey Seb!

Thanks for your work, it works like a charm if it comes to adding the zone in the terminal after the command. However I'm trying to add a permanent zone to the config file but I keep getting the same error message: Please supply a valid zone identifier in the input argument or the cloudflare config.

Your example isn't working either from the file. It doesn't give any syntax error just the above. I have tried like:

'zones' => 'asd123asd123asd123asd123asd';
'zones' => [
        'asd123asd123asd123asd123asd'
    ],
'zones' => [
        'asd123asd123asd123asd123asd' => []
    ],

And also your example. Please help me (us) out a bit.

@sebdesign sebdesign added the bug label Jun 4, 2019
@sebdesign
Copy link
Owner

I will check this today. Thanks for letting me know!

@sebdesign
Copy link
Owner

I don't see anything suspicious on my side. Can you check that your configuration is not cached? Please run php artisan config:clear and try again.

By the way, this is the correct structure for the configuration:

'zones' => [
    'asd123asd123asd123asd123asd' => [],
],

@bertalanimre
Copy link
Author

bertalanimre commented Jun 6, 2019

The config:clear command was already used a number of times. It did not help to solve the issue. However the comma at the end of the square brackets after the zone ID did help! lol me... Thanks for clarifying the example for me.

Alto I prefer to use it this way:

'zones' => [
    env('CLOUDFLARE_ZONEID') => [],
],

But clearly this doesn't work. Am I using a wrong syntax here or what? I would prefer this method because then the package could be used slightly more easy and convenient. I recommend implementing it in the code.

@sebdesign
Copy link
Owner

The CLOUDFLARE_ZONEID environment variable is a nice idea! I will add it to the configuration in the next release.

There's nothing wrong with your setup, but I'm not sure how to solve this issue. Can you dd($zones) in the constructor of the purge command in your vendor?
https://github.com/sebdesign/artisan-cloudflare/blob/master/src/Commands/Cache/Purge.php#L58

The $zones should be exactly the same as your configuration.

Then you should try to dd() the various statements in the getZones() method:

https://github.com/sebdesign/artisan-cloudflare/blob/master/src/Commands/Cache/Purge.php#L234

This method is called just before the Please supply a valid zone identifier in the input argument or the cloudflare config. is raised. So it could help us debug this.

Let me know about your findings, thanks!

@bertalanimre
Copy link
Author

Unfortunately I just left for vacation and my projects are unreachable (thank god) so I'll be free of duty for a few days. :) I'm glad I've gave you an idea. If this issue won't be closed and I'll be back, I'm gonna test what you are asking Mate !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants