当前位置: 首页>>代码示例>>PHP>>正文


PHP Catalog::create_catalog_type方法代码示例

本文整理汇总了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;
 }
开发者ID:bl00m,项目名称:ampache,代码行数:35,代码来源:update.class.php

示例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();
    ?>
开发者ID:cheese1,项目名称:ampache,代码行数:31,代码来源:show_catalog_types.inc.php


注:本文中的Catalog::create_catalog_type方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。