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


PHP Kit::getKits方法代码示例

本文整理汇总了PHP中Kit::getKits方法的典型用法代码示例。如果您正苦于以下问题:PHP Kit::getKits方法的具体用法?PHP Kit::getKits怎么用?PHP Kit::getKits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Kit的用法示例。


在下文中一共展示了Kit::getKits方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Kit

#!/usr/bin/php
<?php 
/******************************************************************/
/***KIT SYNC SCRIPT - TO BE RUN FROM CLI AND FROM APP ROOT PATH!***/
/******************************************************************/
require_once "config.php";
require_once "api/classes/kit.inc.php";
$kitAPI = new Kit();
$downloadDir = "download/kits/";
$kitArr = $kitAPI->getKits();
foreach ($kitArr as $key => $val) {
    $kitId = $val['id'];
    $kitChannels = $kitAPI->getKitChannels($kitId, 'ogg');
    mkdir($downloadDir . $kitId);
    $channelArr = array();
    foreach ($kitChannels as $key => $val) {
        $fileName = $downloadDir . $kitId . '/' . $val['channel'] . '.ogg';
        $fp = fopen($fileName, 'wb');
        fwrite($fp, base64_decode($val['src']));
        fclose($fp);
        $channel = exec("soxi -c " . $fileName);
        array_push($channelArr, $channel);
    }
    $maxChannels = max($channelArr);
    if ($maxChannels > 1) {
        foreach ($channelArr as $key => $val) {
            if ($val == 1) {
                $fileName = $downloadDir . $kitId . '/' . $key . ".ogg";
                exec("sox " . $fileName . " " . $fileName . " remix 1 1");
            }
        }
开发者ID:htmiguel,项目名称:beat-slappr,代码行数:31,代码来源:kit-sync.php

示例2: Kit

<?php

session_start();
require_once "config.php";
require_once "api/classes/kit.inc.php";
require_once "api/classes/pattern.inc.php";
$kit = new Kit();
$kitArr = $kit->getKits();
$pattern = new Pattern();
if (isset($_SESSION['user_id'])) {
    $patternArr = $pattern->get("all");
} else {
    $patternArr = $pattern->get("system");
}
$sharePattern = "";
if ($_GET) {
    require_once "api/classes/pattern.inc.php";
    $sharePattern = new Pattern();
    if ($_GET['p']) {
        $p = $_GET['p'];
    }
    $sharePattern = $sharePattern->getSharedPattern($p);
}
?>
<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
        <meta name="description" content="<?php 
echo APP_NAME;
?>
开发者ID:htmiguel,项目名称:beat-slappr,代码行数:31,代码来源:index.php

示例3:

if (isset($_REQUEST['cmd'])) {
    $cmd = $_REQUEST['cmd'];
}
if (isset($_REQUEST['id'])) {
    $id = $_REQUEST['id'];
}
if (isset($_REQUEST['format'])) {
    $format = $_REQUEST['format'];
}
if (!isset($cmd)) {
    echo "No command specified.";
    return;
}
switch ($cmd) {
    case "getKits":
        $kits = $kit->getKits();
        echo json_encode($kits);
        break;
    case "getKitChannels":
        if (isset($id) && isset($format)) {
            $channels = $kit->getKitChannels($id, $format);
            echo json_encode($channels);
        } else {
            echo "Missing Required Parameters";
            return;
        }
        break;
    default:
        echo "That command is not implemented.";
        return;
}
开发者ID:htmiguel,项目名称:beat-slappr,代码行数:31,代码来源:kit.php

示例4: header

require_once APP_PATH . "/api/classes/kit.inc.php";
if (!isset($_SESSION['user_id']) || $_SESSION['email'] != SYSTEM_ADMIN_EMAIL) {
    header('Location: ../login.php');
}
$kitAPI = new Kit();
$template = new MainTemplate();
if ($_POST) {
    $action = $_POST['action'];
    if ($action == 'newKit') {
        $newKitName = $_POST['newKitName'];
        $newKitStatus = $kitAPI->newKit($newKitName);
        $newKitSuccess = $newKitStatus['success'] ? 'success' : 'error';
    } else {
        if ($action == 'syncKits') {
            $downloadDir = "../../download/kits/";
            $kitArr = $kitAPI->getKits();
            foreach ($kitArr as $key => $val) {
                $kitId = $val['id'];
                $kitChannels = $kitAPI->getKitChannels($kitId, 'ogg');
                mkdir($downloadDir . $kitId);
                $channelArr = array();
                foreach ($kitChannels as $key => $val) {
                    $fileName = $downloadDir . $kitId . '/' . $val['channel'] . '.ogg';
                    $fp = fopen($fileName, 'wb');
                    fwrite($fp, base64_decode($val['src']));
                    fclose($fp);
                    $channel = exec("soxi -c " . $fileName);
                    array_push($channelArr, $channel);
                }
                $maxChannels = max($channelArr);
                if ($maxChannels > 1) {
开发者ID:htmiguel,项目名称:beat-slappr,代码行数:31,代码来源:index.php


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