Skip to content

Instantly share code, notes, and snippets.

Björn Weinbrenner bjoerne2

View GitHub Profile
View deploy.php
<?php
namespace Deployer;
use Exception;
require 'recipe/common.php';
// Project name
set('application', '<application>');
View autosave.js
var XWiki=(function(c){var a=c.editors=c.editors||{};a.AutoSave=Class.create({options:{enabled:false,frequency:5,...
View gist:b5b6cfb23a0b2e69858ee62389424e3b
editors.AutoSave = Class.create({
options : {
/** Is the autosave enabled ? */
enabled: false,
/** If enabled, how frequent are the savings */
frequency: 5, // minutes
...
View gist:27c1f8e9e8fc5164956d75ce14f25072
...
try {
foreach ($this->uri->segments as $segment) {
if (preg_match('/_controller$/', $segment)) {
show_404();
}
}
parent::_parse_routes();
} finally {
...
View gist:e612283826bd6ea40dd846f0a8b80496
<?php
class MY_Router extends CI_Router {
protected function _parse_routes()
{
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['_method'])) {
$old_server_method = $_SERVER['REQUEST_METHOD'];
$_SERVER['REQUEST_METHOD'] = strtoupper($_POST['_method']);
}
try {
View gist:404df6931d5ac4dbe2f95db931aff135
<input type="hidden" name="_method" value="delete">
<input type="hidden" name="_method" value="put">
View gist:f67bf8eb6c47fe5fb0bdb1e461fa4641
$route['items']['get'] = 'items/index';
$route['items/(:num)']['get'] = 'items/show/$1';
$route['items/new']['get'] = 'items/new_item';
$route['items']['post'] = 'items/create';
$route['items/(:num)/edit']['get'] = 'items/edit/$1';
$route['items/(:num)']['put'] = 'items/update/$1';
$route['items/(:num)']['delete'] = 'items/delete/$1';
View items.php
public function index()
{
}
public function show($id)
{
}
public function new_item()
{
View gist:d975b910b9530491cdd008e8a001dd94
<Directory "/Users/bjoerne/Source/codeigniter-routing">
Options FollowSymLinks Multiviews Indexes
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>
View gist:83ced5ac8bfd83947999f8bc1b761a8c
<VirtualHost *:80>
DocumentRoot /Users/bjoerne/Source/codeigniter-routing/public
ServerName codeigniter-routing.bjoerne.local
</VirtualHost>
You can’t perform that action at this time.