fuelphp

fuelphp

Posted by zxll on September 25, 2018

##初始化

    # quick install oil from the web
    $ curl https://get.fuelphp.com/oil | sh
    # now that oil is installed, create a blog project in a directory called Sites
    $ cd Sites/
    $ oil create blog

##设置session 存储格式

    在config目录下对应的环境加入session的配置
    fuel/app/config/development/session.php
    'flash_id'              => 'flash',
    'flash_auto_expire' => true,
    'post_cookie_name'  => '_session_id',
    #'http_header_name'  => 'Set-Cookie',
    'enable_cookie'     => 'true',
    // specific configuration settings for database based sessions
    'db'                => array(
    'cookie_name'   => '_session_id',        // name of the session cookie for database based sessions
    'encrypt_cookie' => false,
    ),
    'table'             => array(
     sessions
    'database'          => 'xxxx',           // name of the database name (as configured in config/db.php)
    'table'             => 'sessions',       // name of the sessions table
    'gc_probability'    => 5,                // probability % (between 0 and 100) for garbage collection
     ),
   
     创建session表
     php oil r session:create

##系统收信配置

    wget http://pear.php.net/go-pear.phar
    php go-pear.phar
    /usr/local/php/bin/pear install Mail_Mime
    /usr/local/php/bin/pear install Mail_mimeDecode
    /usr/local/php/bin/pear install Mail

    postfix将指定域名和mail头的mail进行收信处理实现和用户mail通信的实现
    receive:       "|/usr/gn_owner/bin/mail_receive.sh"
   
    =================================
    /usr/gn_owner/bin/mail_receive.sh
    =================================
    while read line ; do
    email+=${line}"\n"
    done

    php oil r mail:mail_receive $email

    ==================================
    php
    ==================================
    require_once('Mail.php');
    require_once('Mail/mimeDecode.php');

    $mmd = new \Mail_mimeDecode($contents);

    $sr = $mmd->decode(array (
        'include_bodies' => true,
        'decode_bodies' => true,
        'decode_headers' => "UTF-8//IGNORE",
        'crlf'           => "\n",
    ));