本文整理匯總了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())));
}