If you can write and run some PHP code then…
<?php
$copyFrom = '/public_html/.../oldTheme/file.php';
$copyTo = '/public_html/.../newTheme/file.php';
if(!copy($copyFrom, $copyTo)){
echo 'copy failed';
}
?>
You didn’t write a PHP class, but if you had, this is how you’d access it.
<?php
// This is a PHP class.
class myClass
{
public $variable1 = 1;
public function sayHi(){
return 'hi';
}
}
// This is how you create an instance your class.
$object = new myClass;
// This is how you call a function inside of your class.
echo $object->sayHi();
?>