Skip to content

Instantly share code, notes, and snippets.

diff --git a/control/Session.php b/control/Session.php
index a4f13b5..acd340f 100644
--- a/control/Session.php
+++ b/control/Session.php
@@ -301,10 +301,8 @@ class Session {
$diffVar = &$diffVar[$n];
}
- if($var !== $val) {
- $var = $val;
<?php
/**
* @package framework
* @subpackage reflection
*/
namespace SilverStripe\Framework\Reflection;
/**
* Parses a token stream and extracts the classes, interfaces and traits.
<?php
// _config.php
Object::add_extension('SiteConfig', 'CustomSiteConfig');
// CustomSiteConfig.php
class CustomSiteConfig extends DataObjectDecorator {
@ajshort
ajshort / Proposal.md
Created April 21, 2012 02:25
Module System Refactoring

As you may know, hopefully for GSOC I'll be working on refactoring the module system to one based on composer. However, before this can be done the existing module layer will need to be reworked to provide an actual module API, rather than the current heap of random bits and pieces. I think this should have the following goals:

  • Provide a reflection API for getting information about the modules running.
  • Allow modules to be installed in subfolders.
  • Implement a resource loader system which loads classes, templates and assets from modules, taking into account module priority,

To that end, I'd like to propose a number of pretty radical changes:

  • Separate the framework into SilverStripe\Base and SilverStripe\Framework namespaces (or something similar, maybe SilverStripe\Core) - the idea is that the Base namespace is responsible for registering modules and loading resources from them, while the Framework namespace is the actual functionality you're all familiar with. This makes it a bit easier to test and
<?php
/**
* A list decorator that allows a list to be grouped into sub-lists by common
* values of a field.
*
* @package sapphire
* @subpackage model
*/
class GroupedList extends SS_ListDecorator {
<?php
/**
* A list object that wraps around an array.
*
* @package sapphire
* @subpackage model
*/
class ArrayList extends ViewableData implements SS_List {
/**
diff --git a/core/model/DataList.php b/core/model/DataList.php
index c94250a..4305923 100644
--- a/core/model/DataList.php
+++ b/core/model/DataList.php
@@ -58,7 +58,16 @@ class DataList extends DataObjectSet {
public function sql() {
return $this->dataQuery->query()->sql();
}
-
+
+--------------------------------------+
| Engine | Sensitive | Insensitive |
+------------+-----------+-------------+
| MySQL | = BINARY | = |
| Postgres | = | ILIKE |
| SQL Server | COLLATE | = |
| Sqlite | = | LIKE |
| Oracle | = | REGEXP_LIKE |
+------------+-----------+-------------+
<?php
/**
* A utility class that can recursively find files matching a set of rules
* within a directory.
*
* The file finder can have several options set on it:
* - name_regex (string): A regular expression that file basenames must match.
* - accept_callback (callback): A callback that is called to accept a file.
* If it returns false the item will be skipped. The callback is passed the
* basename, pathname and depth.
<?php
/**
* Adds the ability to select a theme to use to render a page, and have it
* cascade down the tree.
*/
class Page extends SiteTree {
public static $db = array(
'Theme' => 'Varchar'
);