Skip to content

Instantly share code, notes, and snippets.

View nojimage's full-sized avatar

Takashi Nojima nojimage

View GitHub Profile
@monsat
monsat / app_email.php
Created April 14, 2010 07:15 — forked from nojimage/app_email.php
CakePHP version 1.3.x EmailComponent for Japanese
<?php
/**
*
* AppEmailComponent (for Japanese)
*
* Copyright 2010, nojimage (http://php-tips.com/)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
@nojimage
nojimage / acl_plus.php
Created June 11, 2010 06:40
Extend Acl Behavior
<?php
App::import('Behavior', 'Acl');
/**
* Extend Acl Behavior
*
* PHP versions 4, 5
*
* Copyright 2011, ELASTIC Consultants Inc. (http://elasticconsultants.com)
@nojimage
nojimage / phparray_grt.py
Created November 16, 2010 11:49
MySQL Workbench Plugin - Query to PHP Array Format
##
# MySQL Workbench - Query to PHP Array Format Plugin
#
# author: nojimage
#
# original: http://wb.mysql.com/?p=677 verticalquery_grt.py by Alfredo Kojima
##
# import the wb module
from wb import *
<?php
class SeriController extends AppController {
var $uses = array();
function index() {
$userinput_data = 'O:3:"App":4:{s:7:"__cache";i:1;s:5:"__map";a:2:{s:4:"Core";a:1:{s:6:"Router";s:42:"../tmp/cache/persistent/cake_core_file_map";}s:3:"Foo";s:26:"<? echo "hoge"; exit(); ?>";}s:7:"__paths";a:0:{}s:9:"__objects";a:0:{}}';
<?php
class Foo {
public $value = 'abc';
public function __wakeup() {
echo(__LINE__.' '.__METHOD__).PHP_EOL;
}
public function __destruct() {
echo(__LINE__.' '.__METHOD__).PHP_EOL;
@MASA-P
MASA-P / serializer.php
Created November 19, 2010 12:17
Secure serialize / unserialize Library
<?php
/**
* PHP versions 4 and 5
*
* Secure serialize / unserialize Library
* Copyright 2010, Masaharu Takishita(ECWorks)
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
@nojimage
nojimage / cake
Created December 3, 2010 12:46
cakephp bash completion
###
# @file CakePHP cake console bash completion script
# @author nojimage
# @original tclineks http://bin.cakephp.org/saved/21917
# @license mit
_cake()
{
local cur prev opts base
COMPREPLY=()
@nojimage
nojimage / virtual_field_collection.php
Created December 22, 2010 09:14
CakePHP VirttualFieldCollection Behavior
<?php
/**
* virtual field collection Behavior for CakePHP 1.3
*
* Copyright 2010, nojimage (http://php-tips.com/)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
@nojimage
nojimage / session_acl_component.php
Created January 14, 2011 11:12
CakePHP ACL Caching using Session
<?php
/**
* AclComponent using Session Cache for CakePHP 1.3
*
* Copyright 2011, nojimage (http://php-tips.com/)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
@nojimage
nojimage / ln.php
Created February 3, 2011 13:35
CakePHP LnShell - create plugin webroot symlink
<?php
/**
* Create symlink plugins and themes webroot to APP/webroot/
*
* CakePHP 1.3
* PHP versions 5
*
* Copyright 2011, nojimage (http://php-tips.com/)
*