for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace NerdsAndCompany\Schematic\Mappers;
use Craft;
use NerdsAndCompany\Schematic\Schematic;
use NerdsAndCompany\Schematic\Interfaces\MapperInterface;
use yii\base\Component as BaseComponent;
/**
* Schematic General Settings Mapper.
*
* Sync Craft Setups.
* @author Nerds & Company
* @copyright Copyright (c) 2015-2018, Nerds & Company
* @license MIT
* @see http://www.nerds.company
*/
class GeneralSettingsMapper extends BaseComponent implements MapperInterface
{
* {@inheritdoc}
public function export(array $info = []): array
$info = Craft::$app->getInfo();
return [
'info' => $info,
];
}
public function import(array $info, array $settings = []): array
if (array_key_exists('info', $info)) {
Schematic::info('- Saving general settings');
if (!Craft::$app->saveInfo($info['info'])) {
Schematic::warning('- Couldn’t save general settings.');
return [];