Last active
April 20, 2022 06:05
-
-
Save ounziw/ef2c9afeddcc519bea403152be577f28 to your computer and use it in GitHub Desktop.
packages/attest/ concretecmsで、contentimporterを使って属性と属性セットを登録できるかどうか
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Concrete\Package\Attest; | |
use Concrete\Core\Package\Package; | |
use Concrete\Core\Backup\ContentImporter; | |
use Concrete\Core\Cache\Cache; | |
defined('C5_EXECUTE') or die("Access Denied."); | |
class Controller extends Package { | |
protected $pkgHandle = 'attest'; | |
protected $appVersionRequired = '8.5'; | |
protected $pkgVersion = '0.9'; | |
public function getPackageName() { | |
return t("attest"); | |
} | |
public function getPackageDescription() { | |
return t("attest"); | |
} | |
public function install() { | |
$pkg = parent::install(); | |
Cache::disableAll(); | |
$ci = new ContentImporter(); | |
$ci->importContentFile($pkg->getPackagePath() . '/import.xml'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<concrete5-cif version="1.0"> | |
<attributekeys> | |
<attributekey handle="attsample1" name="属性1" package="" searchable="1" indexed="1" type="number" category="collection" /> | |
</attributekeys> | |
<attributesets> | |
<attributeset name="サンプル属性" package="" handle="att1" category="collection"> | |
<attributekey handle="attsample1" /> | |
</attributeset> | |
</attributesets> | |
</concrete5-cif> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
インポート直前に、キャッシュ無効化 Cache::disableAll(); を追加した