Cloud Nine

Avatar

This blog is my everything!!

Oct
06
symfonyのプロジェクト作成
Oct 6, 2008 0

symfonyの設定

$ mkdir localhost  ← ディレクトリの作成
$ cd localhost/

プレロジェクトを作成していきます。

$ symfony init-project project_name  ← プロジェクトの作成
>> dir+      /home/hogehoge/localhost/config
>> file+     /home/hogehoge/localhost/config/schema.yml
>> file+     /home/hogehoge/localhost/config/databases.yml
>> file+     /home/hogehoge/localhost/config/rsync_exclude.txt
>> file+     /home/hogehoge/localhost/config/properties.ini
>> file+     /home/hogehoge/localhost/c…/ProjectConfiguration.class.php
>> file+     /home/hogehoge/localhost/config/propel.ini
>> dir+      /home/hogehoge/localhost/doc
>> dir+      /home/hogehoge/localhost/log
>> dir+      /home/hogehoge/localhost/web
>> file+     /home/hogehoge/localhost/web/robots.txt
>> dir+      /home/hogehoge/localhost/web/js
>> file+     /home/hogehoge/localhost/web/.htaccess
>> dir+      /home/hogehoge/localhost/web/uploads
>> dir+      /home/hogehoge/localhost/web/uploads/assets
・
・

$ symfony init-app myproject  ← アプリの指定の作成

Apacheの設定

# vi /etc/httpd/conf/httpd.conf  ← Apacheの設定

  ServerName localhost
  DocumentRoot “/home/hogehoge/localhost/web”
  DirectoryIndex index.php
  Alias /sf “/usr/share/pear/data/symfony/web/sf”

#permit rewrite
  
   AllowOverride All
  

  
   allow from all
  

Apacheの再起動で、設定した画面にアクセスして下記の画面がでると設定完了
symfony完了

Oct
04
Meadow(emacs)の背景を透過させる
Oct 4, 2008 0

.emacsに下記の内容を追加

;;;背景関係を設定2008/10/04 追記
(if window-system (progn
   (set-background-color "Black")    ←背景
   (set-foreground-color "LightGray") ←前景
   (set-cursor-color "Gray")              ←カーソルの色
   (set-frame-parameter nil 'alpha 90)←透過具合
))

大変参考にさせてもらったサイト
suztomoの日記
ありがとうございました。

ちなみに、キャプチャーを取ったけど透過が具合がキャプチャーでは取れなかった。。。。
残念

Sep
12
centOSにsymfonyをインストール
Sep 12, 2008 0

確認すべきこと

  1. symfonyはPHP5の環境でしか動きません
  2. pearが古いと動きません Version1.40以降

Pearのインストール

pearが入っているのかを確認する

yum list | grep pear
php-pear.noarch                          1:1.4.9-4.el5.1        installed
php-pear-Auth-SASL.noarch                1.0.2-4.el5.centos     extras
php-pear-DB.noarch                       1.7.13-1.el5.centos    extras
php-pear-Date.noarch                     1.4.7-2.el5.centos     extras
php-pear-File.noarch                     1.2.2-1.el5.centos     extras
php-pear-HTTP-Request.noarch             1.4.2-1.el5.centos     extras
php-pear-Log.noarch                      1.9.13-1.el5.centos    extras
php-pear-MDB2.noarch                     2.4.1-2.el5.centos     extras
php-pear-MDB2-Driver-mysql.noarch        1.4.1-3.el5.centos     extras
php-pear-Mail.noarch                     1.1.14-1.el5.centos    extras
php-pear-Mail-Mime.noarch                1.4.0-1.el5.centos     extras
php-pear-Net-SMTP.noarch                 1.2.10-1.el5.centos    extras
php-pear-Net-Sieve.noarch                1.1.5-2.el5.centos     extras
php-pear-Net-Socket.noarch               1.0.8-1.el5.centos     extras
php-pear-Net-URL.noarch                  1.0.15-1.el5.centos    extras

上記のようにpearの一覧がでればインストールはされています。

入っていない場合は、インストールが必要です。

yum install pear

1.40以降でないと動かないので、pearのアップグレード

pear upgrade PEAR

symfonyのインストール

symfonyにチャンネルを追加

pear channel-discover pear.symfony-project.com

いよいよsymfonyをインストール

pear install symfony/symfony
symfony/symfony requires PHP extension “dom”

とエラーがでる、、、調べると「php-xml」が必要らしい

yum install php-xml

symfonyのインストールを再挑戦

pear install symfony/symfony
downloading symfony-1.1.1.tgz ...
Starting to download symfony-1.1.1.tgz (2,131,490 bytes)
..................................................done: 2,131,490 bytes
install ok: channel://pear.symfony-project.com/symfony-1.1.1

インストールの確認

symfony -v
Available tasks:
  :help               Displays help for a task (h)
  :list               Lists tasks
cache
  :clear              Clears the cache (cc, clear-cache)
configure
  :author             Configure project author
  :database           Configure database DSN
generate
  :app                Generates a new application (init-app)
  :module             Generates a new module (init-module)
  :project            Generates a new project (init-project)
  :task               Creates a skeleton class for a new task
i18n
  :extract            Extracts i18n strings from php files
  :find               Finds non “i18n ready” strings in an application
log
  :clear              Clears log files (log-purge)
  :rotate             Rotates an application log files (log-rotate)
plugin
  :add-channel        Add a new PEAR channel
  :install            Installs a plugin (plugin-install)
  :list               Lists installed plugins (plugin-list)
  :uninstall          Uninstalls a plugin (plugin-uninstall)
  :upgrade            Upgrades a plugin (plugin-upgrade)
project
  :clear-controllers  Clears all non production environment controllers (clear-controllers)
  :deploy             Deploys a project to another server (sync)
  :disable            Disables an application in a given environment (disable)
  :enable             Enables an application in a given environment (enable)
  :freeze             Freezes symfony libraries (freeze)
  :permissions        Fixes symfony directory permissions (permissions, fix-perms)
  :unfreeze           Unfreezes symfony libraries (unfreeze)
  :upgrade1.1         Upgrade a symfony project to the 1.1 symfony release
propel
  :build-all          Generates Propel model, SQL and initializes the database (propel-build-all)
  :build-all-load     Generates Propel model, SQL, initializes database, and load data (propel-build-all-load)
  :build-db           Creates database for current model (propel-build-db)
  :build-forms        Creates form classes for the current model
  :build-model        Creates classes for the current model (propel-build-model)
  :build-schema       Creates a schema.xml from an existing database (propel-build-schema)
  :build-sql          Creates SQL for the current model (propel-build-sql)
  :data-dump          Dumps data to the fixtures directory (propel-dump-data)
  :data-load          Loads data from fixtures directory (propel-load-data)
  :generate-crud      Generates a Propel CRUD module (propel-generate-crud)
  :init-admin         Initializes a Propel admin module (propel-init-admin)
  :insert-sql         Inserts SQL for current model (propel-insert-sql)
  :schema-to-xml      Creates schema.xml from schema.yml (propel-convert-yml-schema)
  :schema-to-yml      Creates schema.yml from schema.xml (propel-convert-xml-schema)
test
  :all                Launches all tests (test-all)
  :functional         Launches functional tests (test-functional)
  :unit               Launches unit tests (test-unit)

とりあえず、完了!!

Sep
04
開発方法について
Sep 4, 2008 0

今開発中のシステムの開発方法を明記しておきます。
PHPで開発しております。

フレームワーク
symfony まだまだ使いこなせていない
テンプレートエンジン
Smarty
ドキュメント、まだまだ知らないことがたくさんあります。
データベースのコネクション
PDO
はじめはやっかいだったが、今はないともう離れられない。
テスト
PHPUnit
まだ開発途中なので、これから検証してみる感じです。
OS
CentOS 5 final
データベース
MySQL 5.0.45
phpMyAdminとかで管理してるけど、あんまりセキュリティ上あんまりよくないとかで使ってない人が多いのを最近よく聞く。
エディタ
Emacs 22.1
Meadowは重いのがなぁ。。。早くなる方法ないのかな

Aug
27
はじめてのPython
Aug 27, 2008 1

今日生まれて初めてPythonを触りました。
classの勉強のためにPythonからRubyを触るといいと、友人から言われたので触り始めました。
Rubyはその友人が触っていて悔しいし、オーストラリアでは結構Pythonも主流という理由で選びました。

Python 1日目

環境

CentOS 5.1
Python 2.4

メモ

名前の由来は、英国BBS放送の「モンティパイソン」からです。

コメントは#

#my first python.
print "Hello Python"

文の区切り文字は、セミコロン(;)

print "Hello Python"; print "How are you?"

ブロックの範囲をインテンドで決めてるようです。
phpとか

if(a<0){
	print 0以上;
}else{
	prit 0以下;
}

Pythonは

def foo(a):
	if a < 0:
		print 0以上
	else:
		print 0以下

日本語表示
エンコードをしていないとエラーがでる
# coding: エンコーディング名

# coding: Shift_JIS
# coding: EUC-JP

実行方法

python /home/www/test.py
Hello Python

Aug
26
CentOSにEmacsのインストール
Aug 26, 2008 0

Emacsをyumでインストール

yum install emacs

emacsで日本語入力を可能にする

yum install anthy-el

ctl-\で日本語モ−ド

vi /home/ユーザ名/.emacs
; 日本語をデフォルトにする。
(set-language-environment "Japanese")
; anthy.el をロードできるようにする (必要に応じて)。
(push "/usr/local/share/emacs/site-lisp/anthy/" load-path)
; anthy.el をロードする。
(load-library "anthy")
; japanese-anthy をデフォルトの input-method にする。
(setq default-input-method "japanese-anthy"))

Aug
20
Meadowでhttpd.confの編集をやり易くするapache-mode.elの紹介
Aug 20, 2008 0

Unix的なアレのサイトで紹介されていたapache-mode.elが便利なので紹介したいと思います。

emacswikiから apache-mode.elのダウンロード

apache-mode.elのページからダウンロード選択してapache-mode.elを落として下記のフォルダにいれてください。

C:meadowsite-lisp (ぼくの環境なので参考に)

.emacsに下記に内容を記入する。

ちなみに、「;;」はコメントです。

;; httpd.conf用
(autoload 'apache-mode "apache-mode" nil t)
(add-to-list 'auto-mode-alist '("\.htaccess\'"   . apache-mode))
(add-to-list 'auto-mode-alist '("httpd\.conf\'"  . apache-mode))
(add-to-list 'auto-mode-alist '("srm\.conf\'"    . apache-mode))
(add-to-list 'auto-mode-alist '("access\.conf\'" . apache-mode))
(add-to-list 'auto-mode-alist '("sites-\(available\|enabled\)/" . apache-mode))

完了です。

ちなみに、.htaccessなども対象にできるようですね。
hogehogeでファイル名をしてしているのでほかにも対象にしたいファイルは追加してください。

(add-to-list 'auto-mode-alist '("hogehoeg\.conf\'" . apache-mode))

Aug
19
CentOSにphpMyAdminのインストール
Aug 19, 2008 0

phpMyAdminを落としてきます・

wget http://prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-2.11.8.1-all-languages.tar.gz

ファイルの移動

mv phpMyAdmin-2.11.8.1-all-languages.tar.gz /home/document/www/

解凍します。

xf phpMyAdmin-2.11.5.1-all-languages.tar.gz

わかりやすい名前にリネーム

mv ./phpMyAdmin-2.11.8.1-all-languages /phpMyAdmin

php-mysqlが入っていなければインストール

[root@localhost ~]# yum install php php-mysql

設定ファイルのコピー

[root@localhost ~]# cp /home/document/www/phpMyAdmin/config.sample.inc.php /home/document/www/config.inc.php

パーミッションの変更

[root@localhost ~]# chmod 660 /home/document/www/phpMyAdmin/config.inc.php

config.inc.phpを変更

[root@localhost ~]# vi  /home/document/www/phpMyAdmin/config.inc.php
$cfg['blowfish_secret']   = '';パスワードを追加

$cfg[’Lang’]     = ‘ja-utf-8′;日本語のために追加

php-mbstringとphp-mcryptのインストール
これをインストールしておかないと警告がでるので

mbstring
文字のエンコーディングなどに使用します。

警告内容
「PHP の mbstring 拡張が見つかりませんでした。マルチバイト文字セットを使用しているようですが、mbstring拡張がないと
 phpMyAdmin は文字列を正しく分割できないため予期しない結果になることがあります」

[root@localhost ~]# yum -y install php-mbstring

mcrypt
暗号の処理に使用します。

警告内容
mcrypt 拡張をロードできません。PHP の設定を確認してください」

[root@localhost ~]# yum -y install php-mcrypt

上記の内容で、phpMyAdminの設置が完了

Aug
15
meadowのスタートページを表示させない方法
Aug 15, 2008 0

;; スタートアップページを表示しない

(setq inhibit-startup-message t)

他にもやっていること
;; バックアップファイルを作らない

(setq make-backup-files nil)

;; 自動セーブも無効化

(setq auto-save-default nil)

Jul
26
meadow(Emacs)で基本的な文字置換
Jul 26, 2008 0

Emacsで文字置換

M-x replace-string 置換の対象の文字 RET 置換したい文字 RET

‘置換の対象の文字’をすべて’置換したい文字’へ変更できます。

M-x query-replace 置換の対象の文字 RET 置換したい文字 RET

ユーザーが指定したもののみ ‘置換の対象の文字’をすべて’置換したい文字’へ変更できます。
SPACEで置換、nでパスできます。

Next,

Advertisings

Search Keyword

Calendar

2008年 November
« Oct    
 12
3456789
10111213141516
17181920212223
24252627282930

Status

フィードメーター - Cloud  Nine あわせて読みたいブログパーツ