Пример #1
0
	if($change !== false){
		$changes = array_merge($changes, $change);
	}
}



if(CDN_TYPE != 'local'){
	CLI::PrintHeader('Synchronizing Public Files');
	// Check to see if any public files need to be deployed to the CDN.
	// This behaves the same as asset deployment, but is a utility-only function that is beyond the normal reinstallation procedure.
	// However, seeing as this is a utility script... :)
	$public  = new \Core\Filestore\Backends\DirectoryLocal(CDN_LOCAL_PUBLICDIR);
	$dirname = $public->getPath();
	$dirlen  = strlen($dirname);
	foreach($public->ls(null, true) as $file){
		if($file instanceof \Core\Filestore\Backends\FileLocal){
			/** @var \Core\Filestore\Backends\FileLocal $file */

			$filename   = $file->getFilename();
			$remotename = 'public/' . substr($filename, $dirlen);

			CLI::PrintActionStart('Copying public file ' . $remotename);

			$deployed = \Core\Filestore\Factory::File($remotename);
			if($deployed->identicalTo($file)){
				CLI::PrintActionStatus('skip');
				continue;
			}

			$file->copyTo($deployed);