本文整理汇总了PHP中Utilities::CopyDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP Utilities::CopyDirectory方法的具体用法?PHP Utilities::CopyDirectory怎么用?PHP Utilities::CopyDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utilities
的用法示例。
在下文中一共展示了Utilities::CopyDirectory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CopyDirectory
public static function CopyDirectory($src, $dst)
{
$dir = opendir($src);
@mkdir($dst);
while (false !== ($file = readdir($dir))) {
if ($file != '.' && $file != '..') {
if (is_dir($src . '/' . $file)) {
Utilities::CopyDirectory($src . '/' . $file, $dst . '/' . $file);
} else {
copy($src . '/' . $file, $dst . '/' . $file);
}
}
}
closedir($dir);
}
示例2: PublishCommonCSS
public static function PublishCommonCSS($site)
{
$src = APP_LOCATION . '/site/css';
$dest = SITES_LOCATION . '/' . $site['FriendlyId'] . '/css';
// create dir if it doesn't exist
if (!file_exists($dest)) {
mkdir($dest, 0755, true);
}
// copies a directory
Utilities::CopyDirectory($src, $dest);
}
示例3: PublishCommonCSS
public static function PublishCommonCSS($siteUniqId, $root = '../')
{
$site = Site::GetBySiteUniqId($siteUniqId);
$src = $root . 'sites/common/css';
$dest = $root . 'sites/' . $site['FriendlyId'] . '/css';
// create dir if it doesn't exist
if (!file_exists($dest)) {
mkdir($dest, 0755, true);
}
// copies a directory
Utilities::CopyDirectory($src, $dest);
}
示例4: post
/**
* @method POST
*/
function post()
{
// get token
$token = Utilities::ValidateJWTToken();
// check if token is not null
if ($token != NULL) {
// get a reference to the site, user
$site = Site::GetBySiteId($token->SiteId);
parse_str($this->request->data, $request);
// parse request
// get content
$locale = $request['locale'];
// copy default file to new locale
$src = SITES_LOCATION . '/' . $site['FriendlyId'] . '/locales/' . $site['Language'] . '/';
$dest = SITES_LOCATION . '/' . $site['FriendlyId'] . '/locales/' . $locale . '/';
// create libs directory if it does not exist
if (!file_exists($dest)) {
mkdir($dest, 0755, true);
}
// copy libs directory
if (file_exists($src)) {
Utilities::CopyDirectory($src, $dest);
}
// return a json response
return new Tonic\Response(Tonic\Response::OK);
return $response;
} else {
// return an unauthorized exception (401)
return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
}
}