Skip to content

Instantly share code, notes, and snippets.

View f's full-sized avatar
writing code

Fatih Kadir Akın f

writing code
View GitHub Profile
<?php
class Autoloader {
public static $prefix = NULL;
public static function register($path, $prefix = 'class_')
{
self::$prefix = $prefix;
if (is_dir($path))
set_include_path($path . PATH_SEPARATOR . get_include_path());
@f
f / Router.php
Created January 26, 2011 13:14
MVC Router
<?php
namespace Library;
class Router {
private static $_instance = NULL;
private function __clone()
{}
<?php
class Security {
/**
* if(Security::checkInjection($value)) {
* error_log('Possible SQL/XSS injection attack detected with the request '.$value);
* }
*
* @param $value
* @return bool
<?php
require_once 'Security.php';
class SecurityTest extends PHPUnit_Framework_TestCase
{
/**
* @var Security
*/
protected $object;
<?php
class Security {
private static $cacheSetter = 'apc_store';
private static $cacheGetter = 'apc_fetch';
private static $cacheRemover = 'apc_delete';
public static function setCacheSetter($callback)
{
<?php
class autoloader {
public static $loader;
public static function init()
{
if (self::$loader == NULL)
self::$loader = new self();
<style>
.box {
float: left;
width: 30px;
height: 30px;
border: 1px solid red;
}
.clear {
clear: both;
<?php
class MySQL {
private static $_instance = NULL;
private $conn = NULL;
public $server;
public $username;
public $password;
<?php
namespace Application;
class Configuration extends \Library\Configuration {
public function configDevelopment()
{
$this->registry->set('database.connector', 'MySQL');
$this->registry->set('database.settings', array(
'driver' => 'pdo_mysql',
<?php
namespace Application;
class Bootstrap extends \Library\Bootstrap {
/**
* Başlangıç methodu, setup hazırlanıyor.
*
* @return void
*/