本文整理汇总了PHP中Upload::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Upload::__construct方法的具体用法?PHP Upload::__construct怎么用?PHP Upload::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Upload
的用法示例。
在下文中一共展示了Upload::__construct方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Sınıfı başlatır ve resim yüklenebilmesi için gerekli ortamı hazırlar
*
* @param array $file
* @param string $target
*/
public function __construct(array $file = [], $target = '')
{
parent::__construct($file, $target);
$types = $this->getDefaultImageTypes();
$this->setAllowedMimeTypes($types->getImageMimeTypes());
$this->setAllowedExt($types->getImageTypeExt(), ['.php']);
}
示例2: __construct
/**
* Constructor
*
* @param string $name nombre de archivo por metodo POST
*/
public function __construct($name)
{
parent::__construct($name);
$this->_imgInfo = getimagesize($_FILES[$name]['tmp_name']);
// Ruta donde se guardara el archivo
$this->_path = dirname($_SERVER['SCRIPT_FILENAME']) . '/img/upload';
}
示例3: Rating
function __construct()
{
parent::__construct();
$this->commentRatingMngr = new Rating('commentRatings', 'comments');
$this->commentMngr = new Comment_v0(1, GlobalMas::$filesPath_web);
//FileFolder::delete(GlobalMas::$filesPath_absolute);
}
示例4: __construct
public function __construct($arrAttributes = null)
{
// check against arrAttributes, as 'onsubmit_callback' => 'multifileupload_moveFiles' does not provide valid attributes
if ($arrAttributes !== null && !$arrAttributes['uploadFolder']) {
throw new \Exception(sprintf($GLOBALS['TL_LANG']['ERR']['noUploadFolderDeclared'], $this->name));
}
$arrAttributes['uploadAction'] = static::$uploadAction;
if (TL_MODE == 'FE') {
$arrAttributes['uploadActionParams'] = http_build_query(AjaxAction::getParams(MultiFileUpload::NAME, static::$uploadAction));
}
$arrAttributes['addRemoveLinks'] = isset($arrAttributes['addRemoveLinks']) ? $arrAttributes['addRemoveLinks'] : true;
if (!is_array($arrAttributes['value']) && !Validator::isBinaryUuid($arrAttributes['value'])) {
$arrAttributes['value'] = json_decode($arrAttributes['value']);
}
// bin to string -> never pass binary to the widget!!
if ($arrAttributes['value']) {
if (is_array($arrAttributes['value'])) {
$arrAttributes['value'] = array_map(function ($val) {
return \Validator::isBinaryUuid($val) ? \StringUtil::binToUuid($val) : $val;
}, $arrAttributes['value']);
} else {
$arrAttributes['value'] = array(\Validator::isBinaryUuid($arrAttributes['value']) ? \StringUtil::binToUuid($arrAttributes['value']) : $arrAttributes['value']);
}
}
parent::__construct($arrAttributes);
$this->objUploader = new MultiFileUpload($arrAttributes);
// add onsubmit_callback: move files after form submission
$GLOBALS['TL_DCA'][$this->strTable]['config']['onsubmit_callback']['multifileupload_moveFiles'] = array('HeimrichHannot\\MultiFileUpload\\FormMultiFileUpload', 'moveFiles');
Ajax::runActiveAction(MultiFileUpload::NAME, MultiFileUpload::ACTION_UPLOAD, $this);
}
示例5: __construct
public function __construct($config)
{
parent::__construct($config);
$this->config = array("pathFormat" => $config['scrawlPathFormat'], "maxSize" => $config['scrawlMaxSize'], "allowFiles" => $config['scrawlAllowFiles'], "oriName" => "scrawl.png");
$this->fieldName = $config['scrawlFieldName'];
$this->base64 = "base64";
}
示例6: __construct
/**
* Constructor
*
* @param string $path chemin vers l'image
* @param string $ext extention de l'image
* @return void
*/
public function __construct($name)
{
parent::__construct($name);
$this->ext = $this->infos['extension'];
if ($this->ext == 'jpg') {
$this->ext = 'jpeg';
}
$this->maxsize = 512000;
// 1MO
}
示例7: __construct
/**
* Método construtor
* @param array $Files Files do arquivo. Ex.: $_FILES['arquivo']
* @param string $destination Path completo do destino do arquivo
* @param mixed $customRename Nome customizado para o arquivo
*/
public function __construct($Files, $destination, $customRename = false)
{
parent::__construct($Files, $destination, $customRename);
}
示例8: __construct
/**
* Constructor
*
* @param string $name nombre de archivo por metodo POST
*/
public function __construct($name)
{
parent::__construct($name);
// Ruta donde se guardara el archivo
$this->_path = dirname(APP_PATH) . '/public/files/upload';
}
示例9: __construct
/**
* Constructor
*
* @param string $name nombre de archivo por metodo POST
*/
public function __construct($name)
{
parent::__construct($name);
// Ruta donde se guardara el archivo
$this->_path = dirname($_SERVER['SCRIPT_FILENAME']) . '/files/upload';
}
示例10: __construct
public function __construct()
{
parent::__construct();
}
示例11: __construct
public function __construct($config)
{
parent::__construct($config);
$this->config = array("pathFormat" => $config['videoPathFormat'], "maxSize" => $config['videoMaxSize'], "allowFiles" => $config['videoAllowFiles']);
$this->fieldName = $config['videoFieldName'];
}
示例12: __construct
/**
* Método construtor
* @param array $Files Files do arquivo. Ex.: $_FILES['arquivo']
* @param string $destination Path completo do destino do arquivo
* @param mixed $customRename Nome customizado para o arquivo
*/
public function __construct($Files, $destination, $customRename = false)
{
parent::__construct($Files, $destination, $customRename);
$this->detination = parent::getDestination() . '/' . parent::getNewName();
$this->info = getimagesize(parent::getTmpName());
}
示例13: __construct
/**
* Requires data from validation class to avoid the need of reforming $_FILES array twice
* @param object of type ValidateFile $validator
* @param string $id - book id
* @return object
*/
public function __construct(ValidateFile $validator, $id)
{
parent::__construct($validator);
$this->id = $id;
}