Skip to content

Instantly share code, notes, and snippets.

View Rayne's full-sized avatar
⚠️
I may be slow to respond.

Dennis Meckel Rayne

⚠️
I may be slow to respond.
View GitHub Profile
<?php
use Symfony\Component\ClassLoader\UniversalClassLoader;
use Symfony\Component\Finder\Finder;
require_once __DIR__ . '/com.symfony/Symfony/Component/ClassLoader/UniversalClassLoader.php';
$loader = new UniversalClassLoader();
package com.example.test_loader;
import java.util.Calendar;
import android.app.Activity;
import android.app.LoaderManager;
import android.app.LoaderManager.LoaderCallbacks;
import android.content.AsyncTaskLoader;
import android.content.Context;
import android.content.Loader;
@Rayne
Rayne / index.php
Created May 8, 2014 13:58
F3 Escaping Problem
<?php
$root = dirname(__DIR__) . '/';
/** @var $fw \Base */
$fw = require $root . 'vendor/bcosca/fatfree/lib/base.php';
$fw->set('CACHE', 'folder=' . __DIR__ . '/tmp/cache/');
$fw->set('CASELESS', false);
$fw->set('DEBUG', 2);
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Blog title</title>
<link>http://127.0.0.1/tpl</link>
<description>534f.de Blog</description>
<pubDate>DATE</pubDate>
<item>
<title>TITLE</title>
<link>http://127.0.0.1/tpl/TITLE_SLUG</link>
@Rayne
Rayne / index.php
Last active August 29, 2015 14:06
Autoloading with FatFreeFramework and Composer
<?php
$root = dirname(__DIR__);
require_once $root . '/vendor/autoload.php';
$f3 = Base::instance();
/** FRAMEWORK *************************************************************************************/
$f3->set('AUTOLOAD', $root . '/app/Classes/');
@Rayne
Rayne / F3PHPUnitTest.php
Created May 23, 2015 11:07
Basic FatFreeFramework/Base->mock() + PHPUnit example
<?php
class F3PHPUnitTest extends PHPUnit_Framework_TestCase {
public function test() {
$f3 = Base::instance();
// Don't write to STDOUT
$f3->set('QUIET', true);
$f3->route('GET /path', function(){ echo 'TEXT'; });
@Rayne
Rayne / index.php
Created August 8, 2015 15:37
Fat-Free Framework: Adding new filters to Preview and Template
<?php
require_once "../vendor/autoload.php";
class ExtTemplate extends Template {
public function date($timestamp) {
return date('d-m-Y' , $timestamp);
}
}
@Rayne
Rayne / index.php
Last active November 10, 2015 22:52
Fat-Free Framework: Session CSRF Tests
<?php
require 'base.php';
$f3 = Base::instance();
/**
* @see https://github.com/bcosca/fatfree/issues/878
*/
$f3->route('GET /session/@backend', function(Base $f3, array $args){
@Rayne
Rayne / UI somefile.html
Created November 20, 2015 13:25
Fat-Free Framework: New `$ttl` attribute for <include>
<h2>somefile.html</h2>
<p>{{ time() }}</p>
@Rayne
Rayne / index.php
Created November 21, 2015 09:37
Fat-Free Framework: TTL tests for `View` and `Preview` (`Template`)
<?php
require 'base.php';
$f3 = Base::instance();
$f3->DEBUG = 3;
$f3->UI = 'UI/';
$f3->CACHE = 'folder=tmp/cache/';
$f3->TEMP = 'tmp/temp/';