Skip to content

Instantly share code, notes, and snippets.

@hakre
hakre / docker-minimal-example.sh
Created October 23, 2019 20:36
Docker Run without "docker run"
<<'EOD' docker build --rm --tag rewrite-tester --no-cache -
FROM httpd:alpine
RUN set -e \
; sed -i -e 's/^#LoadModule rewrite_module/LoadModule rewrite_module/' \
-e 's/^LogLevel .*$/LogLevel debug rewrite:trace8/' \
-e '\|<Directory "/usr/local/apache2/htdocs">|,\ </Directory> s/^ AllowOverride .*$/ AllowOverride All/' \
/usr/local/apache2/conf/httpd.conf \
; echo -e ' \n\
RewriteEngine On \n\
RewriteBase / \n\
@hakre
hakre / phpinfo-search.html
Created May 14, 2019 20:07
phpinfo() javascript search
<!-- phpinfo() search -->
<form style="position: sticky; top: 0;">
<input>
</form>
<script defer>//
/*
* phpinfo() search javascript (~ES5/6)
*/
const w = window;
const d = document;
@hakre
hakre / other.php
Created June 18, 2017 23:50
inject php declare ticks poc
<?php
/**
* just some file
*/
$a = 1;
if ($a > 0) {
$a += 2;
print($a);
@hakre
hakre / csv-to-xml.php
Created August 16, 2015 12:13
Converting a massive CSV to a specific XML format
<?php
/*
* Converting a massive CSV to a specific XML format
*
* @link http://stackoverflow.com/a/32034227/367456
*/
/**
* Class XmlEncoder
*
@if (@X)==(@Y) @end /* Harmless hybrid line that begins a JScript comment
::************ Documentation ***********
::REPL.BAT version 5.0
:::
:::REPL Search Replace [Options [SourceVar]]
:::REPL /?[REGEX|REPLACE]
:::REPL /V
:::
::: Performs a global regular expression search and replace operation on
<?php
/**
* Example: SimpleXML tell apart a single element and a list of elements with a single element
*
* @link https://hakre.wordpress.com/2013/02/12/simplexml-type-cheatsheet/
* @libk http://stackoverflow.com/a/14829309/367456
*/
$buffer = <<<XML
<root>
@hakre
hakre / example.php
Created July 14, 2015 22:47
Register Xpath Namespace-Prefixes globally on a SimpleXML Document
<?php
/**
* @link http://stackoverflow.com/questions/28520983/php-simplexml-xpath-does-not-keep-the-namespaces-when-returns-data
*/
/**
* Class SimpleXpath
*
* DOMXpath wrapper for SimpleXMLElement
*
@hakre
hakre / XmlArrayElement.php
Created July 14, 2015 21:42
Recursive Method Calls with SimpleXML and DOMDocument Context
<?php
/**
* Class ArrayXmlElement
*
* Use an array definition stored as XML to convert a tree structure from another DOMDocument
*
* @author hakre <http://hakre.wordpress.com>
*/
class XmlArrayElement extends SimpleXMLElement
{
@hakre
hakre / domblaze2.php
Created July 14, 2015 21:26
DOMBLAZE II XMLNS
<?php
/**
* DOMBLAZE II is just with XMLNS support
*
* @link http://stackoverflow.com/a/26327033/367456
*/
/* DOMBLAZE II XMLNS */ $doc->registerNodeClass("DOMElement", "DOMBLAZE");
class DOMBLAZE extends DOMElement

Extend from SoapClient Examples

Just a collection gist of some assorted example SOAPClients. Code must not be stable or useful under all circumstances, these are examples. Most of the code is outdated, so you won't need to use it any longer in production code. I've just collected and compiled this together out of interest, the information normally is scattered around.

If you need to a start with PHP's SOAPClient start with the PHP manual page of it and read through the comments as well. Double check with exisiting bug-reports if given as many things are fixed since a comment was left.