SDpower

phalcon-devtools 增加專案樣板

by on 11 月.18, 2014, under 未分類

phalcon-devtools 增加專案樣板

之前phpconf 有會眾提到說是否自行增加樣版?基本上不會有問題而且開發團隊有增加樣版也都還沒補上.
接下來會簡單講解如何加入自行樣板.

安裝使用phalcon-devtools

螢幕快照 2014-11-18 上午10.05.27
(continue reading…)

Leave a Comment :, more...

Using Redis.

by on 7 月.04, 2014, under PHP & MYSQL

Readis

Redis is an open source, BSD licensed, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

1.Installation

a.Mac OSX

螢幕快照 2014-07-04 10.28.21

b.Ubuntu

-> % sudo apt-get install redis-server 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libjemalloc1 redis-tools
The following NEW packages will be installed:
  libjemalloc1 redis-server redis-tools
0 upgraded, 3 newly installed, 0 to remove and 84 not upgraded.
Need to get 410 kB of archives.
After this operation, 1,272 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/universe libjemalloc1 amd64 3.5.1-2 [76.8 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty/universe redis-tools amd64 2:2.8.4-2 [65.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ trusty/universe redis-server amd64 2:2.8.4-2 [267 kB]
Fetched 410 kB in 2s (176 kB/s)       
Selecting previously unselected package libjemalloc1.
(Reading database ... 300693 files and directories currently installed.)
Preparing to unpack .../libjemalloc1_3.5.1-2_amd64.deb ...
Unpacking libjemalloc1 (3.5.1-2) ...
Selecting previously unselected package redis-tools.
Preparing to unpack .../redis-tools_2%3a2.8.4-2_amd64.deb ...
Unpacking redis-tools (2:2.8.4-2) ...
Selecting previously unselected package redis-server.
Preparing to unpack .../redis-server_2%3a2.8.4-2_amd64.deb ...
Unpacking redis-server (2:2.8.4-2) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Setting up libjemalloc1 (3.5.1-2) ...
Setting up redis-tools (2:2.8.4-2) ...
Setting up redis-server (2:2.8.4-2) ...
Starting redis-server: redis-server.
Processing triggers for libc-bin (2.19-0ubuntu6) ...
Processing triggers for ureadahead (0.100.0-16) ...
stevelo@stevelo-pc [12:01:47] [~]

(continue reading…)

Leave a Comment more...

Using Twig with Phalcon PHP and kill it!!

by on 4 月.17, 2014, under PHP & MYSQL

Using Twig with Phalcon PHP.

Twig is a modern template engine for PHP.
Now we can Using Twig with Phalcon.
How to do:
1.Install Twing in library as git submodule.

git submodule add git@github.com:fabpot/Twig.git app/library/Twig

2.Install phalcon incubator in library as git submodule.

git submodule add git@github.com:phalcon/incubator.git app/library/incubator

(continue reading…)

2 Comments more...

Phalcon framework testing

by on 4 月.16, 2014, under PHP & MYSQL

luosteve@SteveMac [10:55:51] [~/tmp]
-> % git clone --depth=1 git://github.com/phalcon/cphalcon.git
Cloning into 'cphalcon'...
remote: Counting objects: 1437, done.
remote: Compressing objects: 100% (971/971), done.
remote: Total 1437 (delta 593), reused 799 (delta 352)
Receiving objects: 100% (1437/1437), 2.08 MiB | 792.00 KiB/s, done.
Resolving deltas: 100% (593/593), done.
Checking connectivity... done.
luosteve@SteveMac [10:56:01] [~/tmp]
-> % cd cphalcon/build
root@SteveMac [10:56:35] [~/tmp/cphalcon/build] [master]
-> # ./install
.
.
.
.
.
.
une=native -O2 -finline-functions -fomit-frame-pointer -fvisibility=hidden   -o phalcon.la -export-dynamic -avoid-version -prefer-pic -module -rpath /Users/luosteve/tmp/cphalcon/build/64bits/modules  phalcon.lo
gcc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/phalcon.so -bundle  .libs/phalcon.o   -march=native -mtune=native
dsymutil .libs/phalcon.so || :
warning: no debug symbols in executable (-arch x86_64)
creating phalcon.la
(cd .libs && rm -f phalcon.la && ln -s ../phalcon.la phalcon.la)
/bin/sh /Users/luosteve/tmp/cphalcon/build/64bits/libtool --mode=install cp ./phalcon.la /Users/luosteve/tmp/cphalcon/build/64bits/modules
cp ./.libs/phalcon.so /Users/luosteve/tmp/cphalcon/build/64bits/modules/phalcon.so
cp ./.libs/phalcon.lai /Users/luosteve/tmp/cphalcon/build/64bits/modules/phalcon.la
----------------------------------------------------------------------
Libraries have been installed in:
   /Users/luosteve/tmp/cphalcon/build/64bits/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

Installing shared extensions:     /Users/luosteve/.phpbrew/php/php-5.5.10/lib/php/extensions/no-debug-non-zts-20121212/

Thanks for compiling Phalcon!
Build succeed: Please restart your web server to complete the installation
./install  27.78s user 3.81s system 99% cpu 31.690 total

(continue reading…)

Leave a Comment more...

Phabricator 安裝

by on 5 月.30, 2013, under FreeBSD, Git

螢幕快照 2013-05-30 上午10.01.07
Phabricator 是 FasceBook 所開發出來的開源軟體 web applications,包含各種專案程式碼控管需要的功能 Review Code,Track Bugs,Browse Source…

接下來開始安裝,本文範例接來自官網使用手冊.
(continue reading…)

1 Comment more...

FreeBSD 安裝使用RVM

by on 2 月.24, 2013, under Ruby

FreeBSD 安裝使用RVM

$ wget --no-check-certificate https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer
$ chmod +x rvm-installer
$ ./rvm-installer --version latest
Leave a Comment more...

Go 語言~ 初學筆記

by on 2 月.19, 2013, under Go

主要學習文件依照下面的連結閱讀
https://github.com/astaxie/build-web-application-with-golang
首先安裝Go,Go也有第三方套件做版本切換gvm.
https://github.com/moovweb/gvm
依照只是裝好後.

$ gvm install go1
Downloading Go source...
Installing go1...
 * Compiling...
$ gvm use go1
Now using version go1
$ 

接下來可以開始試用Go !!

$ go 
Go is a tool for managing Go source code.

Usage:

	go command [arguments]

The commands are:

    build       compile packages and dependencies
    clean       remove object files
    doc         run godoc on package sources
    env         print Go environment information
    fix         run go tool fix on packages
    fmt         run gofmt on package sources
    get         download and install packages and dependencies
    install     compile and install packages and dependencies
    list        list packages
    run         compile and run Go program
    test        test packages
    tool        run specified go tool
    version     print Go version
    vet         run go tool vet on packages

Use "go help [command]" for more information about a command.

Additional help topics:

    gopath      GOPATH environment variable
    packages    description of package lists
    remote      remote import path syntax
    testflag    description of testing flags
    testfunc    description of testing functions

Use "go help [topic]" for more information about that topic.

關於幾個重要系統環境變數.gvm都幫你切換好了!

GVM_ROOT=/Users/luosteve/.gvm
GVM_VERSION=1.0.16
GVM_PATH_BACKUP=/Users/luosteve/.gvm/bin:/Users/luosteve/.rvm/gems/ruby-1.9.3-p374/bin:/Users/luosteve/.rvm/gems/ruby-1.9.3-p374@global/bin:/Users/luosteve/.rvm/rubies/ruby-1.9.3-p374/bin:/Users/luosteve/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/go/bin:/Users/luosteve/mybin:/Users/luosteve/bin/google_appengine:/Users/luosteve/.rvm/bin
gvm_go_name=go1
gvm_pkgset_name=global
GOROOT=/Users/luosteve/.gvm/gos/go1
GOPATH=/Users/luosteve/.gvm/pkgsets/go1/global

再來是開發的$GOPATH環境變數
$GOPATH環境變數主要為工作目錄,可為多個.

    export GOPATH=~/apple/mygo1;~/apple/mygo2

以上 $GOPATH 目錄主要有三個內容:

  • src 原始碼(比如:.go .c .h .s等)
  • pkg 編譯後的包(比如:.a)
  • bin 編譯後的文件為可執行檔

依照範例建立一個sample,執行go install後會編譯好檔案.

-> % ll
total 8
-rw-r--r--  1 luosteve  staff  2108  2 19 10:36 mymath.a
luosteve@SteveMac [10:36:40] [~/Go/pkg/darwin_amd64] 

在依照範例建立好mathapp,執行go build產生mathapp執行檔.
螢幕快照 2013-02-19 上午10.45.05

Leave a Comment more...

Ruby Version Manager

by on 2 月.05, 2013, under Ruby

Ruby Version Manager

介紹

最近同事都在看Ruby,想說跟進一下神人們的腳步.看看是不是可以開竅點@@
Ruby 依照以前安裝套件經驗,版本是最難搞的.
慶幸有很多開發人員先鋒,做的很多貢獻.
如今才有RVM Ruby Version Manager 誕生!!解決很多初學者很多困擾障礙.
RVM是一套Ruby版本控管可以在各版號切換.甚至自定版號與安裝套件之間切換.
(continue reading…)

Leave a Comment : more...

FreeBSD 安裝Gitlab 4.1

by on 2 月.01, 2013, under FreeBSD

GitLab

logoGitLab 是一套webbase的管理系統,與有名的github 非常類似.
特性 快速, 安全與穩定的方案使用 Rails & Gitolite開發,並且使用MIT License授權.
如果這樣還沒有概念那就看看官網的 screenshots.
再來看怎摸安裝…
FreeBSD官網不支援,觀玩建議安裝使用Debian/Ubuntu 其他如RedHat linux bases都有人安裝成功過.
就是沒有FreeBSD!!!!!!!!!阿阿阿阿阿阿阿阿阿阿

再來只好花費週末8個小時撞牆來安裝.
(continue reading…)

Leave a Comment :, , more...

FreeBsd 9.1 安裝遇到 Python not found!

by on 1 月.20, 2013, under FreeBSD

如果你安裝遇到:

Checking for Python support: 
  ** Python not found!
error: Python.h: No such file or directory

解決方式 就執行下列:

cd /usr/ports/lang/python ; make install clean
cp /usr/local/include/pth/* /usr/local/include/python2.7/
Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!