Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Create a file in the plugin folder
so, just like the title says, I am developing a plugin that requires its default.php to create a file upon install, right next to the default.php file in the plugin folder...
I have tried several ways, none succeeded:
file_put_contents('test.php', 'bla'); -> creates the file in the root folder
file_put_contents('/test.php', 'bla'); -> does nothing
file_put_contents('./test.php', 'bla'); ->does nothing
file_put_contents(Gdn_Url::WebRoot(true).'/test.php', 'bla'); -> nothing, not even in root
file_put_contents(PATH_PLUGINS.DS.'tInfoBar'.DS.'test.php', 'bla'); -> nothing
Did any1 else encountered this problem and knows a solution to it?
I have tried several ways, none succeeded:
file_put_contents('test.php', 'bla'); -> creates the file in the root folder
file_put_contents('/test.php', 'bla'); -> does nothing
file_put_contents('./test.php', 'bla'); ->does nothing
file_put_contents(Gdn_Url::WebRoot(true).'/test.php', 'bla'); -> nothing, not even in root
file_put_contents(PATH_PLUGINS.DS.'tInfoBar'.DS.'test.php', 'bla'); -> nothing
Did any1 else encountered this problem and knows a solution to it?
1
Comments
Sorry if that is vague, but that is the bottom line. Since you are writing php scripts to your public web area, I think you need to learn a bit more about what that means for security.
Vanilla Forums COO [GitHub, Twitter, About.me]