本文整理匯總了PHP中Piwik\Filesystem::copy方法的典型用法代碼示例。如果您正苦於以下問題:PHP Filesystem::copy方法的具體用法?PHP Filesystem::copy怎麽用?PHP Filesystem::copy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Piwik\Filesystem
的用法示例。
在下文中一共展示了Filesystem::copy方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: oneClick_Copy
private function oneClick_Copy()
{
/*
* Make sure the execute bit is set for this shell script
*/
if (!Rules::isBrowserTriggerEnabled()) {
@chmod($this->pathRootExtractedPiwik . '/misc/cron/archive.sh', 0755);
}
$model = new Model();
/*
* Copy all files to PIWIK_INCLUDE_PATH.
* These files are accessed through the dispatcher.
*/
Filesystem::copyRecursive($this->pathRootExtractedPiwik, PIWIK_INCLUDE_PATH);
$model->removeGoneFiles($this->pathRootExtractedPiwik, PIWIK_INCLUDE_PATH);
/*
* These files are visible in the web root and are generally
* served directly by the web server. May be shared.
*/
if (PIWIK_INCLUDE_PATH !== PIWIK_DOCUMENT_ROOT) {
/*
* Copy PHP files that expect to be in the document root
*/
$specialCases = array('/index.php', '/piwik.php', '/js/index.php');
foreach ($specialCases as $file) {
Filesystem::copy($this->pathRootExtractedPiwik . $file, PIWIK_DOCUMENT_ROOT . $file);
}
/*
* Copy the non-PHP files (e.g., images, css, javascript)
*/
Filesystem::copyRecursive($this->pathRootExtractedPiwik, PIWIK_DOCUMENT_ROOT, true);
$model->removeGoneFiles($this->pathRootExtractedPiwik, PIWIK_DOCUMENT_ROOT);
}
/*
* Config files may be user (account) specific
*/
if (PIWIK_INCLUDE_PATH !== PIWIK_USER_PATH) {
Filesystem::copyRecursive($this->pathRootExtractedPiwik . '/config', PIWIK_USER_PATH . '/config');
}
Filesystem::unlinkRecursive($this->pathRootExtractedPiwik, true);
Filesystem::clearPhpCaches();
}