This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// connect | |
$mongo = new MongoClient("localhost:27017"); | |
$db = $mongo->selectDB("test"); | |
$col = $db->createCollection("test"); | |
// insert | |
$db = $mongo->selectDB('test'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* format-to-YYY-MM-DD | |
* | |
* @param string $date format:[January or Jan] 1st 2013 00:00 AM | |
* @return string $formatedDate format:YYYY-MM-DD hh:mm | |
*/ | |
function date_format_std($date) | |
{ | |
$pattern = '/^([a-z]+)\s([a-z0-9]+)\s([0-9]{4})\s([0-2][0-9]:[0-6][0-9])\s(am|pm)/i'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'Mail.php'; | |
require_once 'Mail/mime.php'; | |
class SendMail | |
{ | |
private $mimeObj; | |
private $checkAddress = array( | |
'To' => array(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* DBマネージャー(PDO) | |
* | |
*/ | |
class DbManager | |
{ | |
private static $instance; | |
private $dbrepository = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* DBコントローラ(PDO) | |
* | |
*/ | |
class DbController | |
{ | |
protected $repository = null; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Dateマネージャー(DateTime) | |
* | |
*/ | |
class DateManager | |
{ | |
private $datetime = null; | |
private $dateInterval = null; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fontforgeコマンドをインストールする。 | |
apt-get install fontforge | |
# 生成スクリプトをGitを用いて取得する | |
cd /tmp | |
git clone git://github.com/yascentur/Ricty.git | |
# Inconsolataから、「OpenType file」をダウンロードする。 | |
wget http://levien.com/type/myfonts/Inconsolata.otf | |
mv /tmp/Inconsolata.otf /tmp/Ricty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build | |
cd path/to/document_root | |
mkdir -p project_dir/lib/vendor | |
cd /lib/vendor/ | |
wget http://www.symfony-project.org/get/symfony-1.4.20.tgz | |
tar zxvf symfony-1.4.20.tgz | |
mv symfony-1.4.20 symfony | |
rm symfony-1.4.20.tgz | |
cd ../../ | |
php lib/vendor/symfony/data/bin/symfony generate:project projectname |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;-------------------------------------- | |
;; php-mode | |
;;-------------------------------------- | |
(when (require 'php-mode nil t) | |
(add-to-list 'auto-mode-alist '("\\.ctp\\'" . php-mode)) | |
(setq php-search-url "http://jp.php.net/ja/") | |
(setq php-manual-url "http://jp.php.net/manual/ja")) | |
;; settings indent for php-mode | |
(defun php-indent-hook () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* CSV読み込み | |
* | |
* @access public | |
* @param string $path | |
* @retunr array $result | |
*/ | |
public static function readCsv($path) |
OlderNewer