本文整理汇总了PHP中UploadHandler::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP UploadHandler::initialize方法的具体用法?PHP UploadHandler::initialize怎么用?PHP UploadHandler::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UploadHandler
的用法示例。
在下文中一共展示了UploadHandler::initialize方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
protected function initialize()
{
if ($this->get_server_var("REQUEST_METHOD") == "GET" && isset($_GET["delete"])) {
$this->delete();
} else {
parent::initialize();
}
}
示例2: initialize
protected function initialize()
{
$this->db = new mysqli($this->options['db_host'], $this->options['db_user'], $this->options['db_pass'], $this->options['db_name']);
parent::initialize();
$this->db->close();
}
示例3: sendFile
public function sendFile($mediaType, $objectId)
{
App::uses('UploadHandler', 'Media.Vendor');
$uploadHandler = new UploadHandler(null, false);
$fileResonse = $uploadHandler->initialize(false);
$userFile = $fileResonse['files'][0];
$orig_fname = $userFile->name;
$tmp_name = PATH_FILES_UPLOAD . $orig_fname;
list($media_type) = explode('/', $userFile->type);
if (!in_array($media_type, $this->Media->types)) {
$media_type = 'bin_file';
}
$crop = false;
$object_type = $mediaType;
$object_id = $objectId;
$path = pathinfo($tmp_name);
$file = $media_type;
$ext = '.' . $path['extension'];
$data = compact('media_type', 'object_type', 'object_id', 'tmp_name', 'file', 'ext', 'orig_fname', 'crop');
$id = $this->Media->uploadMedia($data);
return $id;
}
示例4: MetadataHandler
<?php
/*
* jQuery File Upload Plugin PHP Example 5.14
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
error_reporting(E_ALL | E_STRICT);
require 'MetadataHandler.php';
require 'UploadHandler.php';
if (isset($_GET["action"]) && trim($_GET["action"]) === 'submissions') {
$metadata_handler = new MetadataHandler();
$allSubmissions = $metadata_handler->getAll();
echo json_encode($allSubmissions);
} else {
if (isset($_GET["action"]) && trim($_GET["action"]) === 'filesList' && isset($_GET["id"])) {
$upload_handler = new UploadHandler();
$upload_handler->initialize();
} else {
die('Not supported request.');
}
}
示例5: Start
/**
* iUploaderHandler Methods
*/
public function Start()
{
parent::initialize();
}
示例6: initialize
protected function initialize()
{
parent::initialize();
global $USER;
}
示例7: initialize
protected function initialize()
{
$this->db = conectabd(BD_PRINCIPAL);
parent::initialize();
$this->db->close();
}