'%COMPONENT%' => $componentname,
		'%AUTHORNAME%' => $packagername,
		'%AUTHOREMAIL%' => $packageremail,
	);
	$fcontents = str_replace(array_keys($freplaces), array_values($freplaces), $controllerscaffolding);
	file_put_contents($dirname . $fname, $fcontents);
	$md5 = md5_file($dirname . $fname);

	$allfiles[] = array(
		'file' => $fname,
		'md5' => $md5,
		'controllers' => array($class . 'Controller')
	);

	// Don't forget to create a template directory for any pages on this controller.
	$dir = new \Core\Filestore\Backends\DirectoryLocal($dirname . 'templates/pages/' . strtolower($class));
	$dir->mkdir();
}


// Write the changelog
$now = Time::GetCurrentGMT(Time::FORMAT_RFC2822);
file_put_contents($dirname . 'CHANGELOG', "$componentname 1.0.0

	* Initial version

");
$allfiles[] = array(
	'file' => 'CHANGELOG',
	'md5' => md5_file($dirname . 'CHANGELOG')
);
Exemple #2
0
if($theme != 'default'){
	CLI::PrintHeader('Reinstalling Theme ' . $theme);
	$change = \ThemeHandler::GetTheme($theme)->install(2);
	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;