本文整理匯總了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);
}
}