Skip to content

Instantly share code, notes, and snippets.

@gabesullice
gabesullice / notes.md
Last active January 10, 2023 16:04
FrankenPHP w/ Drupal notes
  • Overrides
    • Changed the root directive in the Caddyfile to web instead of public
    • Used -v $PWD:/app instead of /app/public
    • Added error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT to php.ini and used -v $PWD/php.ini:/usr/local/lib/php.ini to suppress warnings. Deprecations were still being printed out.
  • Observations
    • Many warnings like this one: **Warning**: ini_set(): Session ini settings cannot be changed after headers have already been sent in **/app/web/core/lib/Drupal/Core/DrupalKernel.php** on line **1000**
    • Many deprecations were printed out, such as: __Deprecated function__: Creation of dynamic property Drupal\Core\Installer\InstallerKernel::$_serviceId is deprecated in __Drupal\Core\DependencyInjection\ContainerBuilder->set()__ (line __83__ of __/app/web/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php__).
    • Drupal is still not compatible with PHP 8.2: https://www.drupal.org/project/drupal/issues/3283358
  • FrankenPHP compiles PHP
@stborchert
stborchert / docker-compose.solr.yaml
Created December 15, 2020 08:05
DDEV recipe for Solr 4
# DDev Apache Solr recipe file for Solr 4.
#
# To access Solr after it is installed:
# - The Solr admin interface will be accessible at:
# http://<projectname>.ddev.site:8983/solr/
# For example, if the project is named "myproject" the hostname will be:
# http://myproject.ddev.site:8983/solr/
# - To access the Solr container from the web container use:
# http://solr:8983/solr/
@oksana-c
oksana-c / migrate-way-1.php
Created February 17, 2019 20:06 — forked from labboy0276/migrate-way-1.php
Various Drupal 8 Body Migration Techniques Ways
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate\Plugin\MigrateSourceInterface;
use Drupal\migrate\Row;
/**
* Implements hook_migrate_prepare_row().
*/
function YOUR_MODULE_migrate_prepare_row(Row $row, MigrateSourceInterface $source, MigrationInterface $migration) {
switch ($migration->id()) {
case 'config_name':
@Tamal
Tamal / git-ssh-error-fix.sh
Last active November 14, 2024 11:16
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone [email protected]:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T [email protected]
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
@deathlyfrantic
deathlyfrantic / dom-insert-after.php
Last active February 17, 2023 12:15
why doesn't the DOM spec include an insertAfter method, srsly guys
<?php
/** Inserts a new node after a given reference node. Basically it is the complement to the DOM specification's
* insertBefore() function.
* @param \DOMNode $newNode The node to be inserted.
* @param \DOMNode $referenceNode The reference node after which the new node should be inserted.
* @return \DOMNode The node that was inserted.
*/
function insertAfter(\DOMNode $newNode, \DOMNode $referenceNode)
{
if($referenceNode->nextSibling === null) {
@keopx
keopx / import_gzip_drush.sh
Created July 16, 2015 18:36
Import gzipped sql using Drush
gunzip -c database.sql.gz | drush sqlc
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;
; All relative paths in this configuration file are relative to PHP's install
; prefix (/home/sotarok/.phpenv/versions/5.4.0s). This prefix can be dynamicaly changed by using the
; '-p' argument from the command line.
; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the