Skip to content

Instantly share code, notes, and snippets.

hakre hakre

View GitHub Profile
View change-admin-url.php
<?php
/**
* Change Admin URL
*
* Copyright (C) 2010 hakre <http://hakre.wordpress.com/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
@hakre
hakre / output-buffer-to-temp.php
Created Dec 19, 2012
Output buffer for large output to temporary file on disk (>2MB)
View output-buffer-to-temp.php
<?php
/*
* Output buffer for large output to temporary file on disk (>2MB)
*
* @link http://stackoverflow.com/questions/5446647/how-can-i-use-var-dump-output-buffering-without-memory-errors/
*/
/**
* Iterate over lines of a stream resource.
*
@hakre
hakre / other.php
Created Jun 18, 2017
inject php declare ticks poc
View other.php
<?php
/**
* just some file
*/
$a = 1;
if ($a > 0) {
$a += 2;
print($a);
@hakre
hakre / taxonomy-feeds.php
Created Feb 5, 2011
WordPress 3.1 Taxonomy Feeds
View taxonomy-feeds.php
<?php
/**
* WordPress 3.1 Taxonomy Feeds Plugin (Must-Use)
*
* Copyright (C) 2011 hakre <http://hakre.wordpress.com/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
@hakre
hakre / schematest.php
Created Dec 13, 2012
Speeding up XML schema validations of a batch of XML files against the same XML schema (XSD)
View schematest.php
<?php
/**
* @link http://stackoverflow.com/questions/13865149/speeding-up-xml-schema-validations-of-a-batch-of-xml-files-against-the-same-xml
*/
$mapping = [
'http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd' => 'schema/xhtml1-transitional.xsd',
'http://www.w3.org/2001/xml.xsd' => 'schema/xml.xsd',
];
@hakre
hakre / DateInterval_11556731.php
Created Jul 19, 2012
How we can add two date intervals in PHP
View DateInterval_11556731.php
<?php
/**
* How we can add two date intervals in PHP
* @link http://stackoverflow.com/q/11556731/367456
* @link http://codepad.viper-7.com/oBW2le
*
* NOTE: This code is rough.
*/
header("Content-Type: text/plain;");
@hakre
hakre / docker-minimal-example.sh
Created Oct 23, 2019
Docker Run without "docker run"
View docker-minimal-example.sh
<<'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 / magnet-links-bittorrent.php
Created Mar 1, 2012
Magnet links library for PHP
View magnet-links-bittorrent.php
View README.md

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.

@hakre
hakre / phpinfo-search.html
Created May 14, 2019
phpinfo() javascript search
View phpinfo-search.html
<!-- phpinfo() search -->
<form style="position: sticky; top: 0;">
<input>
</form>
<script defer>//
/*
* phpinfo() search javascript (~ES5/6)
*/
const w = window;
const d = document;
You can’t perform that action at this time.