Jump to content

Can't copy files per PHP in processwire directories.


Asdiff
 Share

Recommended Posts

Hello,

I'm building a module which needs to copy a template file from its module directory to /templates/default/.

I'm using copy(source, dest) and I don't even get an error message with active debugging. Just nothing happens.

I assume there is some kind of permission problem, but I don't know where to start with that, since I'm not very familiar with Linux (the server runs apache2 on it).

Thank you for any help!

This is what I'm using for tests the ___install() function of the module:

$path = wire(config)->paths->siteModules.'fma-helper/';
copy($path.'_head_metadata.php', $path.'testtesttest.php')
Link to comment
Share on other sites

$path = wire(config)->paths->siteModules.'fma-helper/';
copy($path.'_head_metadata.php', $path.'testtesttest.php')

Shouldn't this be wire('config') - with quotes around the config?

Also, echo out $path to make sure it is what you expect.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...