本文整理汇总了PHP中Symfony\Component\HttpFoundation\File\File::getBaseName方法的典型用法代码示例。如果您正苦于以下问题:PHP File::getBaseName方法的具体用法?PHP File::getBaseName怎么用?PHP File::getBaseName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\HttpFoundation\File\File
的用法示例。
在下文中一共展示了File::getBaseName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beforePrepare
/**
* Add parameters Kinvey needs to properly process the file.
*
* @param Guzzle\Common\Event
* @return void
*/
public function beforePrepare(Event $event)
{
$command = $event['command'];
$operation = $command->getOperation();
$client = $command->getClient();
if ($command->getName() !== 'createEntity') {
return;
}
if ($command['collection'] !== 'files' && $client->getCollectionName() !== 'files') {
return;
}
$file = new File($command['path']);
$operation->setResponseClass('GovTribe\\LaravelKinvey\\Client\\KinveyFileResponse');
$operation->addParam(new Parameter(array('name' => 'path', 'type' => 'string', 'default' => $command['path'])));
$operation->addParam(new Parameter(array('name' => '_public', 'location' => 'json', 'type' => 'boolean', 'default' => isset($command['_public']) ? $command['_public'] : false)));
$operation->addParam(new Parameter(array('name' => '_filename', 'location' => 'json', 'type' => 'string', 'default' => !isset($command['_filename']) ? $file->getBaseName() : $command['_filename'])));
$operation->addParam(new Parameter(array('name' => 'size', 'location' => 'json', 'type' => 'integer', 'default' => $file->getSize())));
$operation->addParam(new Parameter(array('name' => 'mimeType', 'location' => 'json', 'type' => 'string', 'default' => $file->getMimeType())));
}