Вход Регистрация
Файл: sngine-v2.8/Script/includes/libs/Embed/Adapters/Pastebin.php
Строк: 24
<?php

namespace EmbedAdapters;

use 
EmbedHttpResponse;
use 
EmbedUtils;

/**
 * Adapter to generate embed code from pastebin.
 */
class Pastebin extends Webpage
{
    
/**
     * {@inheritdoc}
     */
    
public static function check(Response $response)
    {
        return 
$response->isValid() && $response->getUrl()->match([
            
'pastebin.com/*',
        ]);
    }

    
/**
     * {@inheritdoc}
     */
    
public function getCode()
    {
        
$this->width null;
        
$this->height null;

        
$url $this->getResponse()->getUrl();
        
$path '/embed_js' $url->getPath();

        return 
Utils::script($this->getResponse()->getUrl()->getAbsolute($path));
    }
}
Онлайн: 0
Реклама