Igniter 사전적의미로 점화장치!

CodeIgniter가 내게는 '코드에 불을 붙이다' 란 의미로 받아 들여진다. 얼마전부터 웹프로그래밍을 시작 하면서 PHP 프레임웤에 관심을 가지게 되었다. 프레임웤이 없으면 자유도는 있겠지만 너무 난잡한 프로그래밍이 되기 쉽더라. 나중에 코드도 마구 꼬이고 암튼 내게는 무지 필요한거다.

우선 이리저리 찾다가 Zend Framework의 동영상 강좌를 보면서 따라 해 봤는데 이건 익숙해지는게 쉽진 않은거 같다. 용량도 좀 되는거 같고, 그래서 여러 사람들이 가볍고 빠르다고 칭찬한 코드점화기(CodeIgniter)를 테스트 해 보기로 했다.

우선 기본 셋팅을 하고 난뒤 나오는 첫페이지에서 'Page rendered in 0.0223 seconds'로 페이지 속도가 나오는 걸 보니 이걸 제대로 좀 봐야겠다는 의지가 불끈 한다. ^^



관련글

'Web' 카테고리의 다른 글

OTTO 3D Store & vista 서비스  (0) 2008.08.05
인터넷 광고  (2) 2008.07.23
PHP Snoopy Readme  (0) 2007.11.08
NAME:

    Snoopy - the PHP net client v1.2.2
    
SYNOPSIS:

    include "Snoopy.class.php";
    $snoopy = new Snoopy;
    
    $snoopy->fetchtext("http://www.php.net/");
    print $snoopy->results;
    
    $snoopy->fetchlinks("http://www.phpbuilder.com/");
    print $snoopy->results;
    
    $submit_url = "http://lnk.ispi.net/texis/scripts/msearch/netsearch.html";
    
    $submit_vars["q"] = "amiga";
    $submit_vars["submit"] = "Search!";
    $submit_vars["searchhost"] = "Altavista";
        
    $snoopy->submit($submit_url,$submit_vars);
    print $snoopy->results;
    
    $snoopy->maxframes=5;
    $snoopy->fetch("http://www.ispi.net/");
    echo "<PRE>\n";
    echo htmlentities($snoopy->results[0]);
    echo htmlentities($snoopy->results[1]);
    echo htmlentities($snoopy->results[2]);
    echo "</PRE>\n";

    $snoopy->fetchform("http://www.altavista.com");
    print $snoopy->results;

DESCRIPTION:

    What is Snoopy?
    
    Snoopy is a PHP class that simulates a web browser. It automates the
    task of retrieving web page content and posting forms, for example.

    Some of Snoopy's features:
    
    * easily fetch the contents of a web page
    * easily fetch the text from a web page (strip html tags)
    * easily fetch the the links from a web page
    * supports proxy hosts
    * supports basic user/pass authentication
    * supports setting user_agent, referer, cookies and header content
    * supports browser redirects, and controlled depth of redirects
    * expands fetched links to fully qualified URLs (default)
    * easily submit form data and retrieve the results
    * supports following html frames (added v0.92)
    * supports passing cookies on redirects (added v0.92)
    
    
REQUIREMENTS:

    Snoopy requires PHP with PCRE (Perl Compatible Regular Expressions),
    which should be PHP 3.0.9 and up. For read timeout support, it requires
    PHP 4 Beta 4 or later. Snoopy was developed and tested with PHP 3.0.12.

CLASS METHODS:

    fetch($URI)
    -----------
    
    This is the method used for fetching the contents of a web page.
    $URI is the fully qualified URL of the page to fetch.
    The results of the fetch are stored in $this->results.
    If you are fetching frames, then $this->results
    contains each frame fetched in an array.
        
    fetchtext($URI)
    ---------------    
    
    This behaves exactly like fetch() except that it only returns
    the text from the page, stripping out html tags and other
    irrelevant data.        

    fetchform($URI)
    ---------------    
    
    This behaves exactly like fetch() except that it only returns
    the form elements from the page, stripping out html tags and other
    irrelevant data.        

    fetchlinks($URI)
    ----------------

    This behaves exactly like fetch() except that it only returns
    the links from the page. By default, relative links are
    converted to their fully qualified URL form.

    submit($URI,$formvars)
    ----------------------
    
    This submits a form to the specified $URI. $formvars is an
    array of the form variables to pass.
        
        
    submittext($URI,$formvars)
    --------------------------

    This behaves exactly like submit() except that it only returns
    the text from the page, stripping out html tags and other
    irrelevant data.        

    submitlinks($URI)
    ----------------

    This behaves exactly like submit() except that it only returns
    the links from the page. By default, relative links are
    converted to their fully qualified URL form.


CLASS VARIABLES:    (default value in parenthesis)

    $host            the host to connect to
    $port            the port to connect to
    $proxy_host        the proxy host to use, if any
    $proxy_port        the proxy port to use, if any
    $agent            the user agent to masqerade as (Snoopy v0.1)
    $referer        referer information to pass, if any
    $cookies        cookies to pass if any
    $rawheaders        other header info to pass, if any
    $maxredirs        maximum redirects to allow. 0=none allowed. (5)
    $offsiteok        whether or not to allow redirects off-site. (true)
    $expandlinks    whether or not to expand links to fully qualified URLs (true)
    $user            authentication username, if any
    $pass            authentication password, if any
    $accept            http accept types (image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*)
    $error            where errors are sent, if any
    $response_code    responde code returned from server
    $headers        headers returned from server
    $maxlength        max return data length
    $read_timeout    timeout on read operations (requires PHP 4 Beta 4+)
                    set to 0 to disallow timeouts
    $timed_out        true if a read operation timed out (requires PHP 4 Beta 4+)
    $maxframes        number of frames we will follow
    $status            http status of fetch
    $temp_dir        temp directory that the webserver can write to. (/tmp)
    $curl_path        system path to cURL binary, set to false if none
    

EXAMPLES:

    Example:     fetch a web page and display the return headers and
                the contents of the page (html-escaped):
    
    include "Snoopy.class.php";
    $snoopy = new Snoopy;
    
    $snoopy->user = "joe";
    $snoopy->pass = "bloe";
    
    if($snoopy->fetch("http://www.slashdot.org/"))
    {
        echo "response code: ".$snoopy->response_code."<br>\n";
        while(list($key,$val) = each($snoopy->headers))
            echo $key.": ".$val."<br>\n";
        echo "<p>\n";
        
        echo "<PRE>".htmlspecialchars($snoopy->results)."</PRE>\n";
    }
    else
        echo "error fetching document: ".$snoopy->error."\n";



    Example:    submit a form and print out the result headers
                and html-escaped page:

    include "Snoopy.class.php";
    $snoopy = new Snoopy;
    
    $submit_url = "http://lnk.ispi.net/texis/scripts/msearch/netsearch.html";
    
    $submit_vars["q"] = "amiga";
    $submit_vars["submit"] = "Search!";
    $submit_vars["searchhost"] = "Altavista";

        
    if($snoopy->submit($submit_url,$submit_vars))
    {
        while(list($key,$val) = each($snoopy->headers))
            echo $key.": ".$val."<br>\n";
        echo "<p>\n";
        
        echo "<PRE>".htmlspecialchars($snoopy->results)."</PRE>\n";
    }
    else
        echo "error fetching document: ".$snoopy->error."\n";



    Example:    showing functionality of all the variables:
    

    include "Snoopy.class.php";
    $snoopy = new Snoopy;

    $snoopy->proxy_host = "my.proxy.host";
    $snoopy->proxy_port = "8080";
    
    $snoopy->agent = "(compatible; MSIE 4.01; MSN 2.5; AOL 4.0; Windows 98)";
    $snoopy->referer = "http://www.microsnot.com/";
    
    $snoopy->cookies["SessionID"] = 238472834723489l;
    $snoopy->cookies["favoriteColor"] = "RED";
    
    $snoopy->rawheaders["Pragma"] = "no-cache";
    
    $snoopy->maxredirs = 2;
    $snoopy->offsiteok = false;
    $snoopy->expandlinks = false;
    
    $snoopy->user = "joe";
    $snoopy->pass = "bloe";
    
    if($snoopy->fetchtext("http://www.phpbuilder.com"))
    {
        while(list($key,$val) = each($snoopy->headers))
            echo $key.": ".$val."<br>\n";
        echo "<p>\n";
        
        echo "<PRE>".htmlspecialchars($snoopy->results)."</PRE>\n";
    }
    else
        echo "error fetching document: ".$snoopy->error."\n";


    Example:     fetched framed content and display the results
    
    include "Snoopy.class.php";
    $snoopy = new Snoopy;
    
    $snoopy->maxframes = 5;
    
    if($snoopy->fetch("http://www.ispi.net/"))
    {
        echo "<PRE>".htmlspecialchars($snoopy->results[0])."</PRE>\n";
        echo "<PRE>".htmlspecialchars($snoopy->results[1])."</PRE>\n";
        echo "<PRE>".htmlspecialchars($snoopy->results[2])."</PRE>\n";
    }
    else
        echo "error fetching document: ".$snoopy->error."\n";


COPYRIGHT:
    Copyright(c) 1999,2000 ispi. All rights reserved.
    This software is released under the GNU General Public License.
    Please read the disclaimer at the top of the Snoopy.class.php file.


THANKS:
    Special Thanks to:
    Peter Sorger <sorgo@cool.sk> help fixing a redirect bug
    Andrei Zmievski <andrei@ispi.net> implementing time out functionality
    Patric Sandelin <patric@kajen.com> help with fetchform debugging
    Carmelo <carmelo@meltingsoft.com> misc bug fixes with frames

'Web' 카테고리의 다른 글

인터넷 광고  (2) 2008.07.23
웹서버 부하분산처리 phpschool 검색  (0) 2007.10.11
NFS(Network File System) 서버  (0) 2007.10.11
Flex2 php 멀티 파일 업로드 예제

사용자 삽입 이미지
http://weblog.cahlan.com/files/file_uploads/FileUpload.html
 화면에서 마우스 오른쪽 버튼 누르면 소스를 볼수 있음.


테스트 결과 서버측에 PHP 파일을 만들고 
MXML 코드에서 아래 부분만 수정 해주면 바로 사용 가능함.
private const _strUploadDomain:String = "http://codycodingcowboy.cahlan.com/";
private const _strUploadScript:String = _strUploadDomain + "files/upload.php";
여러명이 접속 할때도 업로드 되는지 테스트 해보니 잘 됨.^^

http://weblog.cahlan.com/
위의 블로그에는 Flex에 관한 좋은 자료들이 많은것 같음. 

'Flex' 카테고리의 다른 글

Flex3 데모 어플리케이션  (0) 2007.10.12
Flex events와 behaviors 사용하기  (0) 2007.05.20
Flex 어플리케이션 보여주기  (0) 2007.05.20

+ Recent posts