This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
■mod_sslインストール[root@centos ~]# yum -y install mod_ssl ← mod_sslインストール | |
■WebサーバーSSL設定(1)サーバー用秘密鍵・証明書作成[root@centos ~]# cd /etc/pki/tls/certs/ ← ディレクトリ移動 | |
[root@centos certs]# sed -i 's/365/3650/g' Makefile ← サーバー用証明書有効期限を1年から10年に変更 | |
[root@centos certs]# make server.crt ← サーバー用秘密鍵・証明書作成 | |
umask 77 ; \ | |
/usr/bin/openssl genrsa -des3 1024 > server.key | |
Generating RSA private key, 1024 bit long modulus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DNSレコードについて | |
<DNSレコードの種類> | |
主に設定していただくDNSレコードには、以下のようなものがあります。 | |
■Aレコード | |
ホスト名を IP アドレスに指定。 | |
・IP アドレスを入力してください。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
set_time_limit ( 0 ); | |
use Aws\Common\Aws; | |
use Aws\DynamoDb\Enum\KeyType; | |
use Aws\DynamoDb\Enum\Type; | |
class Controller_Aws_Dynamodb extends Controller | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PHP最適化テクニックが紹介されていましたので以下にまとめてみました。 | |
1.taticメソッドが使えるなら使おう。速度は4倍になる | |
2.__get, __set, __autoload は使わない | |
3.require_once は重い | |
4.include, requireで読み込むファイルはフルパスにしよう | |
5.スクリプト開始時のUNIXタイムを $_SERVER['REQUEST_TIME'] で取れる | |
6.strncasecmp関数やstrpbrk関数を使えるケースはこれらを使い、正規表現は使わない | |
7.preg_replaceはstr_replaceより速い、しかし、strtrはpreg_replaceより4倍速い | |
8.引数を、単体か配列かで自動判別するようなコードは出来るだけ避ける |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//首先做一个类内的变量,存储一下相关的数组: | |
public $tree = null; | |
//然后做个测试方法,用于输出结果 | |
public function test() { | |
$res = M('channel')->where('fatherid is null')->select(); | |
$this->createtree($res); | |
dump($this->tree); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test2(); | |
/** | |
* 方法测试 | |
*/ | |
function test2() { | |
echo IntToCn(333030); // 三十三万三千零三十 | |
echo IntToCn(1111); // 一千一百一十一 | |
echo IntToCn(101010101); // 一亿一百零一万零一百零一 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 什么是会话控制 | |
出现原因:http是无状态协议的,每次都是不同的服务器请求,无法维护两个请求事务之间的关系. | |
会话控制:能够在网站中跟踪一个变量,通过对变量的跟踪,就可以使多个请求事物之间建立联系,根据授权和用户身份显示不同的内容,不同页面 | |
cookie:是服务器设置在客户端的文本文件,保存客户端得个人信息. | |
2 会话跟踪技术 | |
1 隐藏表单域 | |
2 url重写 | |
3 cookie技术 | |
4 session技术 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Aws\Common\Aws; | |
class Controller_S3 extends Controller | |
{ | |
public function action_index() | |
{ | |
// Config::load('aws', true); | |
$aws = Config::get('aws'); | |
$s3 = Aws::factory( $aws['services']['default_settings']['params'] )->get('s3'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 自動生成 sublime text を使うと便利 | |
Generators resource users | |
username:string[50],email:string[100],password:string[100],active:tinyinteger:defalut(0),suspended:tinyinteger:defalut(0),level:integer:defalut(1),deleted_at:timestamp:nullable() | |
※model/User.php は予め用意されていますので、消されないように注意してください。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1: | |
composer.jsonファイルを編集 | |
"require": { | |
"php": ">=5.3.3", | |
"monolog/monolog": "1.5.*", | |
"fuelphp/upload": "2.0", | |
"aws/aws-sdk-php": "2.2.*" | |
}, |