Skip to content

Instantly share code, notes, and snippets.

View MarioBlazek's full-sized avatar
🎯
Focusing

Mario Blazek MarioBlazek

🎯
Focusing
View GitHub Profile
# Learn more about services, parameters and containers at
# https://symfony.com/doc/current/service_container.html
parameters:
app.default.cats_api.token: 'your-token-here'
app.default.cats_api.url: 'https://api.thecatapi.com/v1/categories'
services:
app.controller.cat_api:
class: AppBundle\Controller\CatApiController
parent: ezpublish.controller.base
<?php
declare(strict_types=1);
namespace AppBundle\Http;
use eZ\Publish\Core\MVC\ConfigResolverInterface;
use Http\Client\HttpClient;
use Http\Message\MessageFactory;
use Symfony\Component\HttpFoundation\Request;
@MarioBlazek
MarioBlazek / http-config-config.yml
Created February 6, 2020 12:45
HTTPlug config config.yml
# Httplug configuration
httplug:
plugins:
logger: ~
clients:
app:
factory: httplug.factory.curl
plugins: [httplug.plugin.logger]
chown -Rh www-data: /opt/solr
[Unit]
Description=Apache SOLR for My Project
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
WorkingDirectory=/var/www/my_project/ezpublish_legacy/extension/ezfind/java
ExecStart=/usr/bin/java -jar -server -Xms64M -Xmx512M -Dsolr.solr.home=/var/lib/solr/solr410/cores -Djetty.port=8984 -jar start.jar
Restart=on-failure
User=www-data
[Unit]
Description=Apache SOLR
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
WorkingDirectory=/opt/solr
PIDFile=/opt/solr/server/ez/solr-8983.pid
ExecStart=/opt/solr/bin/solr -s ez -noprompt -p 8983
User=www-data
// exceptions.php
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
try {
throw new NotFoundHttpException();
} catch (\Exception $e) { echo 1;
} catch (NotFoundHttpException $e) { echo 2;
} catch (\Exception $e) { echo 3;
} finally { echo 4;
}
echo 5;
<?php
try {
try {
echo 'a-';
throw new exception();
echo 'b-';
} catch (Exception $e) {
echo 'caught-';
throw $e;
git remote add upstream [email protected]:netgen/TagsBundle.git
git push origin feature_readme_changes_for_blog_post -f