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


PHP FileHandler::getFileHandler方法代码示例

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


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

示例1: fprintf

        fprintf($f, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n");
        fprintf($f, "<title>Error</title>\n");
        fprintf($f, "</head>\n");
        fprintf($f, "<body>\n");
        fprintf($f, "<p>\n");
        fprintf($f, _("File '%s' cannot be shown.") . "<br>\n%s\n", $filename, $message);
        fprintf($f, "</p>\n");
        fprintf($f, "</body>\n");
        fprintf($f, "</html>\n");
        fclose($f);
    }
    $targetFile = "file:///{$targetFile}";
}
// Get information of application for uploaded file.
require_once 'FileHandler.class.php';
$handler = FileHandler::getFileHandler($targetFile);
// create window object and send to nuc
$dt = new DateTime();
$date = $dt->format('Y-m-d H:i:s');
$window = array("id" => "", "win_id" => "", "name" => "", "state" => "", "file" => $targetFile, "handler" => $handler, "userid" => "", "date" => $date);
//echo "<body onLoad=\"sendToNuc('newWindow=".serialize($window)."')\" /></body>";
$serializedWindow = serialize($window);
$sw = urlencode($serializedWindow);
// Get cURL resource
$curl = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, array(CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => CONFIG_CONTROL_FILE . '?newWindow=' . $sw, CURLOPT_USERAGENT => 'PalMA cURL Request'));
// Send the request & save response to $resp
$resp = curl_exec($curl);
// Close request to clear up some resources
curl_close($curl);
开发者ID:BennySchindelhauer,项目名称:PalMA,代码行数:31,代码来源:upload.php

示例2: DwbHandler

                                $fhandler = '/usr/bin/dwb --override-restore';
                            } else {
                                if ($ftype === 'mpg' || $ftype === 'mpeg' || $ftype === 'avi' || $ftype === 'mp3' || $ftype == "mp4") {
                                    $fhandler = '/usr/bin/vlc --no-audio';
                                }
                            }
                        }
                    }
                }
            }
        }
        /*
                alternatively with mime-types
            // $ftype = mime_content_type($this->UPLOAD_PATH.$file);
                    // if($ftype=='application/pdf')
                    // if($ftype=='image/gif' || $ftype=='image/jpg' || $ftype=='image/png' )
                    // if($ftype=='html' || $ftype=='url' || $ftype="text/plain")
                    // (...)
        */
        return $fhandler;
    }
}
if ($unittest[__FILE__]) {
    // Run unit test.
    $dwbHandler = new DwbHandler();
    $zathuraHandler = new ZathuraHandler();
    echo "DOWNLOAD   =" . FileHandler::DOWNLOAD . "\n";
    echo "filehandler=" . FileHandler::getFileHandler("test.txt") . "\n";
    $handler = ${'dwb' . 'Handler'};
    echo "controls   =" . $handler->getControls() . "\n";
}
开发者ID:BennySchindelhauer,项目名称:PalMA,代码行数:31,代码来源:FileHandler.class.php


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