Archive

Archive for February, 2010

Zend internationalize

February 26, 2010 Leave a comment


How to make it smart? So that we can translate any lanugage?

1. Checking tools

[root@www ~]# xgettext –version
xgettext (GNU gettext-tools) 0.14.6
Copyright (C) 1995-1998, 2000-2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Ulrich Drepper.

[root@www files]# msgfmt –version
msgfmt (GNU gettext-tools) 0.14.6
Copyright (C) 1995-1998, 2000-2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Ulrich Drepper.

Read more…

Categories: centOS, Fedora 12, PHP, Unix/Linux, Zend

Zend view and layout

February 26, 2010 Leave a comment

How to zend view/layout?

  1. Default
    $zf enable layout == application/layouts/scripts/layout.phtml
    default page == application/views/scripts/index/index.phtml
  2. Mannual* make directory under > application/views/scripts/folder/file.phtml
    * make controller under > application/controllers/FolderController.php
    FolderController.php > indexAction(){} Read more…
Categories: centOS, Fedora 12, PHP, Unix/Linux, Zend

Zend model

February 26, 2010 Leave a comment

How to zend model/database?

1. model or database > Zend_Db_Table

Read more…

Categories: centOS, Fedora 12, PHP, Unix/Linux, Zend

Zend controller

February 26, 2010 Leave a comment

How to zend controller?

1. by doing this > we are adding three controller

zf create action add index == create as new/check/alert > addAction() { } to controller name “IndexController.php”

Read more…

Categories: centOS, Fedora 12, PHP, Unix/Linux, Zend

Zend tutorial Zend framework tutorial Zf tutorial Zend getting started Zend quickstart

February 25, 2010 Leave a comment

Requirements:

[root@www ~]# uname -a
Linux http://www.shamun.be 2.6.18-164.11.1.el5 #1 SMP Wed Jan 20 07:39:04 EST 2010 i686 i686 i386 GNU/Linux

[root@www ~]# php -v
PHP 5.2.12
(cli) (built: Jan 31 2010 11:31:11)
Copyright (c) 1997-2009 The PHP GroupZend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies

[root@www ~]# mysql –version
mysql Ver 14.12 Distrib 5.0.90, for redhat-linux-gnu (i686) using readline 5.1

[root@www ~]# httpd -v
Server version: Apache/2.2.3
Server built: Nov 12 2009 18:43:47

Installation:

a. Find existing php

[root@www ~]# whereis php
php: /usr/bin/php /etc/php.d /etc/php.ini /usr/lib/php /usr/include/php /usr/share/php /usr/share/man/man1/php.1.gz

b. vi /etc/php.ini (add the bold path)

[root@www ~]# grep include_path /etc/php.ini

; (directory must also be in include_path or full path must
;include_path = “.:/php/includes”

include_path = “.:/usr/share/pear:/usr/share/php:/root/zend/library

;include_path = “.;c:\php\includes”


c. Now the basic uses of zf using include_path is working, thats all zend wants

[root@www ~]# zf show version
Zend Framework Version: 1.10.1

Read more…

Categories: centOS, Fedora 12, PHP, Unix/Linux, Zend

PHP – zend install, zend start

February 22, 2010 4 comments

Zend framework? i will make it so  easy, that a just born baby can use it?

* Follow steps 1 ………6 sucks according to zend guide. :

* Follow steps 7 ……… rest works

1. [root@www html]# whereis php
php: /usr/bin/php /etc/php.d /etc/php.ini /usr/lib/php /usr/include/php /usr/share/man/man1/php.1.gz
[root@www html]#

2. [root@www ~]# ln -s /root/zend/bin/zf.sh /usr/local/bin/zf

3. [root@www ~]# php -i | grep include_path
include_path => .:/usr/share/pear:/usr/share/php => .:/usr/share/pear:/usr/share/php
[root@www ~]#

4. vi /etc/php.ini (change like this!)

[root@www etc]# grep include_path /etc/php.ini
; (directory must also be in include_path or full path must
;include_path = “.:/php/includes”
include_path = “.:/usr/share/pear:/usr/share/php:/root/zend/library
;include_path = “.;c:\php\includes”
[root@www etc]#

5. [root@www etc]# service httpd status
httpd (pid  4102) is running…
[root@www etc]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@www etc]# php -i | grep include_path
include_path => .:/usr/share/pear:/usr/share/php:/root/zend/library => .:/usr/share/pear:/usr/share/php:/root/zend/library
[root@www etc]#

6. [root@www etc]# zf –help
PHP Fatal error:  Cannot access self:: when no class scope is active in /root/zend/library/Zend/Tool/Framework/Provider/Signature.php on line 355

Fatal error: Cannot access self:: when no class scope is active in /root/zend/library/Zend/Tool/Framework/Provider/Signature.php on line 355
[root@www etc]#

Damn! incompatibility with centOS!! what i do what i do?
* why? because zend doesnt shift with latest php on it, and centOS doesnt shift also with, so using zend means get infected with mysql/php updates.

Read more…

Categories: centOS, Fedora 12, PHP, Unix/Linux, Zend Tags:

centOS – sendmail sendmail.mc private use

February 20, 2010 Leave a comment

How to use default sendmail private use?

1. yum install sendmail-cf

2. vi /etc/mail/sendmail.mc
# uncomment it like this
dnl # DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA’)dnl

3. [root@www mail]# m4 sendmail.mc > sendmail.cf.new

4. [root@www mail]# mv sendmail.cf sendmail.cf.ori
[root@www mail]# mv sendmail.cf.new sendmail.cf
[root@www mail]# service sendmail restart
Shutting down sendmail:                                    [FAILED]
Starting sendmail:                                         [  OK  ]
Starting sm-client:                                        [  OK  ]
[root@www mail]#

5. echo “body text” | mail -s “subject text” you@outdomain.com

Done..

When i cant send email to ouside domains? (sendmail send mails to localhost! in that case.)

1.vi sendmail.mc
change the smtp address

2. m4 sendmail.mc sendmail.cf

3. [root@www mail]# service sendmail restart
Shutting down sm-client:                                   [  OK  ]
Shutting down sendmail:                                    [  OK  ]
Starting sendmail:                                         [  OK  ]
Starting sm-client:                                        [  OK  ]
[root@www mail]#

Categories: centOS