PDO
PDO support => enabled
PDO drivers => sqlite, pgsql
pdo_pgsql
PDO Driver for PostgreSQL => enabled
PostgreSQL(libpq) Version => 9.6.10
pdo_sqlite
PDO Driver for SQLite 3.x => enabled
SQLite Library => 3.24.0
pgsql
PostgreSQL Support => enabled
PostgreSQL(libpq) Version => 9.6.10
PostgreSQL(libpq) => PostgreSQL 9.6.10 on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
Multibyte character support => enabled
SSL support => enabled
Active Persistent Links => 0
Active Links => 0
Directive => Local Value => Master Value
pgsql.allow_persistent => On => On
pgsql.auto_reset_persistent => Off => Off
pgsql.ignore_notice => Off => Off
pgsql.log_notice => Off => Off
pgsql.max_links => Unlimited => Unlimited
pgsql.max_persistent => Unlimited => Unlimited
public function getContent($query): ?string
{
try {
filter_var($query, FILTER_VALIDATE_URL);
} catch (\Exception $e) {
return false;
}
$queryEncode = urlencode($query);
if ($result = $this->loadFromCache($queryEncode)) {
return $result['content'];
}
return null;
}
public function testGetContentValidUrl()
{
$url = 'https://phpunijst.de';
$client = $this->createMock(Client::class);
$contentService = new ContentService($client);
$result = $contentService->getContent($url);
$this->assertTrue($contentService->getContent($url) !== false);
}
public function addResource(Request $request)
{
$domain = $request->input(self::SERVICE_STRING);
$query = $request->input(self::QUERY_STRING);
$result = $this->service->saveContent($domain, $query);
if ($result == true){
echo "Добавлено";
}else{
echo "Ошибка";
}
}
"require": {
"php": "^7.1.3",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "5.7.*",
"laravel/tinker": "^1.0",
"predis/predis": "^1.1",
"symfony/dom-crawler": "^4.2"
},
Options:
--output (-o) Path to store the generated documentation.
ex: --output openapi.yaml
--exclude (-e) Exclude path(s).
ex: --exclude vendor,library/Zend
--bootstrap (-b) Bootstrap a php file for defining constants, etc.
ex: --bootstrap config/constants.php
--processor Register an additional processor.
--format Force yaml or json.
--debug Show additional error information.
--help (-h) Display this help message.
./vendor/bin/openapi --output api/openapi.yaml
$rout->respond('GET', '/openapi', function () {
$openapi = \OpenApi\scan("api");
});
$rout->dispatch();
if (!filter_var($url, FILTER_VALIDATE_URL) === false)
результат этого скрипта возврат true или false