Skip to content

Instantly share code, notes, and snippets.

View designermonkey's full-sized avatar

John Porter designermonkey

View GitHub Profile
@designermonkey
designermonkey / example.php
Created May 20, 2014 12:48
Example of using the containers in Symphony
<?php
// Usage of Core
namespace SymphonyCMS;
class MyService
{
/**
* Constructor expects a tailored subset of core components
<?php
/**
* Symphony CMS
*/
namespace SymphonyCMS;
/**
* Event Listener
*/
class EventListener implements ListenerInterface
@designermonkey
designermonkey / gist:10837549
Last active August 29, 2015 13:59
Using this method, pages can be selected from a selectbox in Symphony, and output into the entry you want to match against. Then a template needs to be created for each option in the selectbox, and the xsl will match against it. Caveats are that the entry needs to be manually passed to the template, as root context is broken.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Pages Section Templates
Templates for the display of content from the Symphony 'Pages' Section
This is a slightly hacky technique to allow the template to be chosen in the XML.
Pages are driven by content templates, so the mode for each view should reference a content template
/**
* Style definition for the Symphony backend
*/
/*--------------------------------------------------------------------------
Structure
--------------------------------------------------------------------------*/
#wrapper {
require 'formula'
class Neo4j < Formula
homepage 'http://neo4j.org'
url 'http://dist.neo4j.org/neo4j-community-2.0.0-M06-unix.tar.gz'
version 'community-2.0.0.M06-unix'
md5 'fb57c0daae42c2212984e2d97669b36d'
def install
# Remove windows files
require 'formula'
class Phpunit < Formula
homepage 'http://www.phpunit.de/manual/current/en/index.html'
url 'https://phar.phpunit.de/phpunit.phar'
sha1 'dc693b34a62644f61cfc01a22d9654ff4b8764af'
version 'HEAD'
def install
bin.install "phpunit.phar" => "phpunit"
@designermonkey
designermonkey / gist:6463775
Created September 6, 2013 13:26
Symphony logged in author DS
<?php
require_once(TOOLKIT . '/class.datasource.php');
Class datasourcelogged_in_author extends Datasource{
public $dsParamROOTELEMENT = 'logged-in-author';
public $dsParamORDER = 'desc';
public $dsParamREDIRECTONEMPTY = 'no';
public $dsParamSORT = 'id';
<?xml version="1.0" encoding="UTF-8"?>
<data>
<events>
<event>
<title>Recurring Exciting Event</title>
<date>2012-01-01</date>
<end-date>2014-12-31</end-date>
<recurring>yes</recurring>
<recurring-number>2</recurring-number>
<recurring-type>weeks</recurring-type>
@designermonkey
designermonkey / somefile.conf
Created May 28, 2013 13:42
Set http auth per domain: Apache 2.2
# Check for the hostname here
SetEnvIfNoCase HOST ^(www\.)?website\.co\.uk$ PROTECTED_HOST
<Directory /path/to/htdocs>
AuthType Basic
AuthName "Authentication"
AuthUserFile /path/to/.htpasswd
Order Deny,Allow
Satisfy any
Deny from all
@designermonkey
designermonkey / authors.php
Last active December 17, 2015 17:29
Symphony CMS table schemas in Laravel format. I don't expect these all to be used, but they are here for a starting point.
<?php
/**
* Authors Table
*
* Removed some 'default null' statements for some columns as they will always contain values
* Renamed `user_type` to `author_type`
* Removed `enum` for types in place of `id` link to `author_types` table
*/
Schema::create('authors', function($table)