本文整理汇总了PHP中Catalog::create_catalog_type方法的典型用法代码示例。如果您正苦于以下问题:PHP Catalog::create_catalog_type方法的具体用法?PHP Catalog::create_catalog_type怎么用?PHP Catalog::create_catalog_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Catalog
的用法示例。
在下文中一共展示了Catalog::create_catalog_type方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update_360020
/**
* update_360020
*
* Catalog types are plugins now
*/
public static function update_360020()
{
$retval = true;
$sql = "SELECT `id`, `catalog_type`, `path`, `remote_username`, `remote_password` FROM `catalog`";
$db_results = Dba::read($sql);
$c = Catalog::create_catalog_type('local');
$c->install();
$c = Catalog::create_catalog_type('remote');
$c->install();
while ($results = Dba::fetch_assoc($db_results)) {
if ($results['catalog_type'] == 'local') {
$sql = "INSERT INTO `catalog_local` (`path`, `catalog_id`) VALUES (?, ?)";
$retval &= Dba::write($sql, array($results['path'], $results['id']));
} elseif ($results['catalog_type'] == 'remote') {
$sql = "INSERT INTO `catalog_remote` (`uri`, `username`, `password`, `catalog_id`) VALUES (?, ?, ?, ?)";
$retval &= Dba::write($sql, array($results['path'], $results['remote_username'], $results['remote_password'], $results['id']));
}
}
$sql = "ALTER TABLE `catalog` DROP `path`, DROP `remote_username`, DROP `remote_password`";
$retval &= Dba::write($sql);
$sql = "ALTER TABLE `catalog` MODIFY COLUMN `catalog_type` varchar(128)";
$retval &= Dba::write($sql);
$sql = "UPDATE `artist` SET `mbid` = null WHERE `mbid` = ''";
$retval &= Dba::write($sql);
$sql = "UPDATE `album` SET `mbid` = null WHERE `mbid` = ''";
$retval &= Dba::write($sql);
$sql = "UPDATE `song` SET `mbid` = null WHERE `mbid` = ''";
$retval &= Dba::write($sql);
return $retval;
}
示例2: T_
?>
</th>
<th class="cel_version"><?php
echo T_('Version');
?>
</th>
<th class="cel_action"><?php
echo T_('Action');
?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach ($catalogs as $type) {
$catalog = Catalog::create_catalog_type($type);
if ($catalog == null) {
continue;
}
$catalog->format();
if ($catalog->is_installed()) {
$action = 'confirm_uninstall_catalog_type';
$action_txt = T_('Disable');
} else {
$action = 'install_catalog_type';
$action_txt = T_('Activate');
}
?>
<tr class="<?php
echo UI::flip_class();
?>