ホームページ バックエンド開発 PHPチュートリアル mysqlデータベースを操作するための自作PHPクラスを共有する

mysqlデータベースを操作するための自作PHPクラスを共有する

Jul 25, 2016 am 08:48 AM

これは私自身が書いたクラスです。どなたでも議論したりガイドしたりできます。いくつかの使用法:
//データベース オブジェクトを宣言する
$Conn = new Mysql;ユーザー名、データベース パスワード、データベース名、データベース エンコーディング、データベース テーブル プレフィックス [空にすることもできます]);

上記のコードはすでにこのクラス ファイルをロードし、いくつかのデータベース接続パラメーターを初期化しています。
以下はいくつかの基本的なメソッド関数です:
1. $Conn -> Table();
データテーブルを選択します。パラメータはデータテーブルの名前です
2. $Conn -> Field();
フィールドを選択します。名前、複数 カンマで区切ります。このメソッドが呼び出されない場合は、すべてが返されます
3. $Conn -> Where();
Sql Where サブステートメント、条件に基づいてフィルターします
4. ;
SQL ソート
5 , $Conn -> Page (int);
パラメータは正の整数です。このメソッドが呼び出された場合、レコードはページ単位で表示されます
6. $Conn -> Select (ブール値) ;
クエリを実行し、クエリ結果を返します (存在しない場合は false を返します)。省略した場合、返される配列には数値要素が含まれます。 7、$Conn -> Del();
レコードを削除します
8、$ Conn -> Edit(array());
レコードを変更します。パラメータは 1 次元配列、配列キーはフィールド名です。配列の値はフィールドの値です
9 $Conn -> Into(array());
レコードを追加します。パラメータは 1 次元の配列、配列のキーはフィールド名、配列の値はフィールドです価値。

上記のメソッドは連続して呼び出すことができます。例:

$Rult = $Conn -> Table('user') -> Select(); //クエリはユーザー テーブル内のすべてのレコードを返します
$Rult = $ Conn -> Table( 'user') -> Page(20) -> Select();//クエリは user テーブル内のすべてのレコードを返し、それらをページごとに 20 レコードずつ表示します

;メソッド呼び出しや裏技もたくさんありますので、時間があるときに詳しく説明します。
  1. /*
  2. データベース操作クラス
  3. 操作方法: オブジェクトに面する
  4. 作成時期: 2013-3-10
  5. 現在のバージョン: BqhMysql (mysqli) 1.0.1
  6. ソフトウェア作者: Sad Song
  7. お問い合わせQQ: 36975
  8. 連絡先番号: 18907975647
  9. 電子メール: admin@q128.com
  10. 連絡先住所: 江西省贛州市石城県小松鎮
  11. 郵便番号: 342706
  12. */
  13. class Mysql{
  14. private $LocalHost = ' localhost';
  15. private $LoaclUser = 'root';
  16. private $LocalPass = '123456';
  17. private $LocalBase = 'jiangxibaiyi';
  18. private $LocalCode = 'UTF8';
  19. private $PreFix;
  20. private $Conn;
  21. private $Start = 0;
  22. private $Error = false; //データベースの接続ステータス、false は接続されていない、または接続が異常であることを意味します
  23. public $Err = true //SQL の実行結果
  24. private $Table;
  25. private $Field = '*';
  26. private $Where = '';
  27. private $Order = '';
  28. private $PageSize = 0; //ページ表示->ページごとのアイテム数、0 はページング表示なしを意味します
  29. private $ PageCount = 1; //ページ表示 -> 合計ページ数
  30. private $PageNum = 1; //ページ表示 -> 合計ページ数
  31. private $PageNo = 1; ->現在のページとは何ですか
  32. private $PageKey = 'page'; //ページ URL パラメーター キー
  33. private $PageStart = 0; //ページ表示->返される現在の項目
  34. private $Select;
  35. private $Rest;
  36. private $Result = false;//結果セット
  37. public $FormArray = array();
  38. public $Instr_ID = 0;
  39. private $j = 0;
  40. public function Parameter($ Loca、$Root、$Pass、$Base、$Code、$PreFix = ''){
  41. $this->LoaclUser = $Root;
  42. $this->LocalBase = $Base;
  43. $this->LocalCode = $Code;
  44. $this->LocalHost = $Loca;
  45. $this->LocalPass = $Pass;
  46. $this->PreFix = $PreFix;
  47. return $this;
  48. }
  49. プライベート関数 Connection( $ Sql ){
  50. !function_exists(mysqli_connect ) ? die('クエリが失敗しました。mysqli 拡張機能をロードできません') : null;
  51. $this->Conn = @new mysqli( $this->LocalHost, $this-> LoaclUser, $this->LocalPass, $this->LocalBase);
  52. $this->Error = mysqli_connect_errno() == 0 ? true : false;
  53. !$this->Error die('データベース接続 ?エラー。データベース接続パラメータを確認してください') : null;
  54. $this->Conn->query('SET NAMES ' . $this->LocalCode);
  55. $this->Rest = $this-> ;Conn->query($Sql) ;
  56. $this->Err = mysqli_error($this->Conn);
  57. $this->Instr_ID = mysqli_insert_id($this->Conn);
  58. $this ->Rest->free_result;
  59. $this->Conn->close;
  60. $this -> FormArray = '';
  61. return $this;
  62. }
  63. public function null(){
  64. $this ->PageSize = 0;
  65. // $this->PageCount = 1;
  66. $this->PageStart = 1;
  67. $this->フィールド = ' * ';
  68. $this->Select = ' ';
  69. unset($this->Table, $this->Where,$this->Order, $this->Result);
  70. }
  71. public function Table( $TableName ) {//データ テーブル
  72. $this -> null();
  73. $this->Table = '`' . $TableName . '`';
  74. return $this;
  75. }
  76. public function Field( $ Array = '*' ) {//data フィールド
  77. !empty( $this->Field ) ? $this->Field = '' : null;
  78. $Array =explode(',', $Array);
  79. foreach ( $Array as $field ) {
  80. $this->Field .= !$this->Start ? '`' : ', `' . $this->Start++;
  81. }
  82. $this->Start = 0;
  83. return $this;
  84. }
  85. public function Where( $Where ) {//Condition
  86. $this->Where = ' where ' .$Where;
  87. return $this; }
  88. public function Order( $Order ) {//Sort
  89. $this->Order = ' order by ' . $Order;
  90. return $this;
  91. }
  92. public function pk( $key ) {//ページング URL パラメーター key
  93. $this->PageKey = $key;
  94. return $this;
  95. }
  96. public function Page( $PageSize ) {///ページング
  97. $this-> PageSize = $PageSize;
  98. $this->gt;PageNo = $this->gt;get( $this->PageKey );
  99. $this->PageNo = empty( $this->PageNo ) || $this->PageNo ) || ! is_numeric( $this->PageNo 1 ? 1 : $this->PageNo;
  100. return $this;
  101. }
  102. function post( $Key, $Filter = true ){
  103. return $Filter ?strip_tags($_POST[$Key]) : $_POST[$Key];
  104. }
  105. public function get( $Key, $Filter = true ) {
  106. $Filter を返す ?strip_tags($_GET [$Key]) : $_GET[$Key];
  107. }
  108. パブリック関数 Sel(){
  109. $this->Select = 'Select ' 。 $this->フィールド 。 ' から ' 。 $this->テーブル 。 $this->どこ . $this->Order;
  110. $this->Connection( $this->Select );
  111. if ( $this->Rest->num_rows ) {
  112. while ( $Rs = $this->Rest ->fetch_assoc() ) {
  113. $this->Result[] = $Rs;
  114. }
  115. }
  116. $DataBase = $this->Result;
  117. return empty($DataBase) ? false : $DataBase;
  118. }
  119. public function querys( $Sql = '', $Type = 'not', $biao = false ) {
  120. $this->Select = $Sql;
  121. $this->Connection ( $this->Select );
  122. if ( $this->Rest->num_rows ) {
  123. if ( !$biao ) {
  124. while ( $Rs = $this->Rest->fetch_array() ) {
  125. $this->Result[] = !preg_match('/^d+$/i', $Type) ? $Rs : $Rs[ $Type ];
  126. }
  127. } else {
  128. while ( $Rs = $this->gt;Rest->fetch_assoc() ) {
  129. $this->Result[] = $Rs;
  130. }
  131. }
  132. }
  133. $DataBase = $this->Result;
  134. return empty($DataBase) ? false : $DataBase;
  135. }
  136. public functionexecutes( $Sql = '' ){
  137. $this->Connection( $Sql );
  138. return $this->Rest;
  139. }
  140. public 関数が存在します( $T = '', $F = '', $W = ''){
  141. if ( empty( $F ) ) { return 0; }
  142. $cmd = 空( $W ) ? ' sum(' . $F . ') を `baiyinum` として `' から選択します。 $this->PreFix 。 $T .'`' : 'sum(' . $F . ') を `baiyinum` として `' から選択します。 $this->PreFix 。 $T .'' ここで ' . $W;
  143. $this->Connection( $cmd );
  144. unset( $T, $F, $W, $cmd );
  145. $Rel = $this->>Rest->fetch_array();
  146. return Round( $Rel['baiyinum'], 2 );
  147. }
  148. public function ExistsTo( $Bili = 10000, $T = '', $F = '', $W = ''){
  149. if ( empty ( $F ) ) { 0 を返します。 }
  150. $cmd = 空( $W ) ? ' sum(' . $F . ') を `baiyinum` として `' から選択します。 $this->PreFix 。 $T .'`' : 'sum(' . $F . ') を `baiyinum` として `' から選択します。 $this->PreFix 。 $T .'' ここで ' . $W;
  151. $this->Connection( $cmd );
  152. unset( $T, $F, $W, $cmd );
  153. $Rel = $this->>Rest->fetch_array();
  154. return round( $Rel['baiyinum'] * $Bili );
  155. }
  156. public function Select( $Type = true, $ListNum = 1 ){ // 返记录(数组形式、返条数)
  157. $this- >選択 = '選択' 。 $this->フィールド 。 ' から ' 。 $this->テーブル 。 $this->どこ . $this->Order;
  158. if ( is_numeric( $ListNum ) ) {
  159. if ( $this->PageSize > 0 ) {
  160. $this->Connection( $this->Select );//実行查询
  161. $this->PageCount = $this->Rest->num_rows;//取得录总数
  162. $this->PageNum = ceil($this->PageCount / $this->PageSize); //共通共有量
  163. $this->PageNo = $this->PageNo > $this->ページ番号 ? $this->PageNum : $this->PageNo;
  164. $this->PageStart = ( $this->PageNo - 1 ) * $this->PageSize; //当前从第几条开始返
  165. $this->Select .= 'limit' 。 $this->PageStart 。 ', ' .$this->PageSize; // 重新构造句sql语
  166. } else {
  167. $this->Select .= 'limit' . $ListNum; // 重新构造句sql语
  168. }
  169. } else {
  170. $this->Select .= ' 制限 1'; // 重新构造句sql语
  171. }
  172. //echo $this->Select;
  173. $this->Connection( $this->Select );// 再実行查询
  174. if ( $this->Rest- >num_rows ) {//如果记录存在
  175. if ( $Type ) {
  176. while ( $Rs = $this->Rest->fetch_array() ) {
  177. $this->Result[] = $Rs;
  178. }
  179. }else{
  180. while ( $Rs = $this->Rest->fetch_assoc() ) {
  181. $this->Result[] = $Rs;
  182. }
  183. }
  184. }
  185. if ( ( $ ListNum == 1 または !is_numeric( $ListNum ) ) && !$this->PageSize) { $this->Result = $this->Result[0]; }
  186. $DataBase = $this->Result;
  187. return empty($DataBase) ? false : $DataBase;
  188. }
  189. public function Num() { // 戻り记录总数
  190. $this->Select = 'Select ' . $this->フィールド 。 ' から ' 。 $this->テーブル 。 $this->どこ . $this->Order;
  191. $this->Connection( $this->Select );//実行查询
  192. return $this->Rest->num_rows;// 取得记录总数
  193. }
  194. public function PageNav($NumNav = false ) { //分页
  195. $Action = $this -> get('action');
  196. !empty( $Action ) or $Action = 'index';
  197. $Module = $this -> get('module');
  198. !empty( $Module ) or $Module = 'index';
  199. $NavUrl = '/' . $Module . '/' . $Action . '/' . $this -> PageKey .'/';
  200. $NaIndex = '/' . $Module . '/' . $Action;
  201. $PageHtml = "\n
    ";
  202. $PageHtml .= '' . $this->PageCount . '条记录 ' . $this->PageNo . '/' . $this->PageNum . '页 ';
  203. $this->PageNo <= 1 or $PageHtml .= "首页\nPageNo - 1) . "\">上一页\n";
  204. if ( $NumNav ) { $PageHtml .= $this->NumPage($NavUrl); }
  205. $this->PageNo >= $this->PageNum or $PageHtml .= "PageNo + 1) . "\">下一页\nPageNum . "\">尾页\n";
  206. $PageHtml .= "
\n";
  • return $PageHtml;
  • }
  • private function NumPage( $Can = '' ) { //数字分页
  • $NumHtml = '';
  • $First = 1;
  • $Last = $this->PageNum;
  • if ( $this->PageNum > 5 ) {
  • if ( $this->PageNo < $this->PageNum ) {
  • $First = $this->PageNo - 2;
  • $Last = $this->PageNo + 2;
  • }else{
  • $First = $this->PageNo - 4;
  • $Last = $this->PageNum;
  • }
  • }
  • if ( $First < 1 ) { $First = 1; $Last = $First + 4;}
  • if ( $Last > $this->PageNum ) { $First = $this->PageNum - 4; $Last = $this->PageNum;}
  • for( $i = $First; $i <= $Last; $i++) {
  • $NumHtml .= $this->PageNo != $i ? "\n\t" . '' . $i . '' . "\n\t" : "\n\t" .'' . $i . '' . "\n\t";
  • }
  • unset($Can, $First, $i, $Last);
  • return $NumHtml;
  • }
  • public function UserPage($NumNav = false, $PageName = 'index', $Mulu = 'user' ) { //会员中心分页
  • $NavUrl = '/' . $Mulu . '/' . $PageName . '/' . $this->PageKey . '/';
  • $PageHtml = "\n
    ";
  • $PageHtml .= '' . $this->PageCount . '条记录 ' . $this->PageNo . '/' . $this->PageNum . '页 ';
  • $this->PageNo <= 1 or $PageHtml .= "首页\nPageNo - 1) . "\">上一页\n";
  • if ( $NumNav ) { $PageHtml .= $this->NumPage($NavUrl); }
  • $this->PageNo >= $this->PageNum or $PageHtml .= "PageNo + 1) . "\">下一页\nPageNum . "\">尾页\n";
  • $PageHtml .= "
  • n";
  • return $PageHtml;
  • }
  • // フォーム処理開始
  • // フォーム判定時に送信
  • public function FormIs( $Keys = 'mm' ) {
  • return $_POST[ $Keys ] == 1 ? true : false;
  • }
  • //post 経由でデータを取得
  • public function _post( $Keys = '', $TiHuan = '') {
  • $Values =trip_tags( $_POST[ $Keys ] );
  • $ this->FormArray[$Keys] = empty( $Values ) ? $TiHuan : $Values;
  • return empty( $Values ) ? $TiHuan : $Values;
  • }
  • //メソッドを取得データを取得するには
  • public function _get ( $Keys = '', $TiHuan = '') {
  • $Values =trip_tags( $_GET[ $Keys ] );
  • return empty( $Values ) ? $Values;
  • }
  • //数値か0以上かを判定
  • public function IsNum( $Num = 0, $Mesg = 'パラメータは数値でなければなりません' ) {
  • if ( is_numeric( $Num ) && !empty( $Num ) && $Num >= 0 ) {
  • return $Num;
  • }else{
  • die( $Mesg );
  • }
  • }
  • //それが数値であり、0以上であるかどうかを判断しますそして return True/False
  • public function NumBer( $Num = 0) {
  • return is_numeric( $Num ) && !empty( $Num ) && $Num >= 0 ? true : false;
  • }
  • //それを検出します関連するデータが存在するようです
  • public function IsData($Types = true, $memg = 'データはすでに存在します' ){
  • $this->Connection('select ' . $this->Field . ' from ' . $this ->Table . $this->Where);
  • if ( $Types ){
  • $this->Rest->num_rows > die( $memg ) : null;
  • } else {
  • return $ this->Rest->num_rows;
  • }
  • }
  • //データベースレコードに書き込む
  • public function into( $Mesg = '' ){
  • !is_array( $this->FormArray ) ? Mesg ) : null;
  • $Sql = ' に挿入 . $this->Table . ' (`';
  • $I = 0;
  • foreach ( $this->FormArray as $Key => $Val ) {
  • $Duan .= !$I ? $Key . '`' : ', ` ' . '`';
  • if ( is_numeric( $Val ) ){
  • $Vals .= !$I ? : ', ' . $Val;
  • }else{
  • $Val .= !$I ? '' : ', '' . $Val .
  • }
  • $Sql .= $Duan . ') 値 (' . $Vals . ' )';
  • //@file_put_contents('1.sql', $Sql, FILE_APPEND);
  • $this-> ;Connection( $Sql );
  • return !empty( $this->Err ) ? false : true;
  • }
  • //データを配列形式で書き込む
  • public function MsgBox( $Table = '', $Filed = array () ) {
  • $this -> Table($Table);
  • foreach( $Filed as $Key => $Val ) {
  • $this -> FormArray[ $Key ] = $Val; $this -> Into('データが取得されません');
  • }
  • //データベース Record を変更します
  • public function Edit( $Array = array() ) {
  • if ( empty( $Array ) ) { $Array = $this -> }
  • if ( !is_array( $Array ) || empty( $Array ) ) {
  • return false;
  • } else {
  • $Sql = 'update ' . set ';
  • $I = 0;
  • $Sub = '';
  • $Huan = array(' -' => '[jian]', '+' => '[jia]', '*' = > '[チェン]', '/' => '[チュウ]');
  • $ ザン = array('[ジャン]' => '-', '[ジア]' => '+' , '[cheng]' => '*', '[chu]' => '/ ');
  • foreach ( $Array as $Files => $Val ) {
  • $Val = !is_numeric( $ Val ) && !preg_match('/`w+`s*(+|-|*|/)/ i', $Val) '' . $Val;
  • foreach ( $Huan as $key => $val ){
  • $Val = str_replace($key, $val, $Val );
  • $duan = '`' . $Files . ' . $Files . '' = ';
  • $Sub .= $duan . $Val;
  • $ I++;
  • }
  • $Sub . = $Fan ; => $Hui ) {
  • $Sql = str_replace($Fan, $Hui, $Sql);
  • }
  • //echo $Sql;
  • $this -> 接続を解除( $Array, $duan, $Fan, $Files, $Huan, $Hui, $I, $ key, $Sql, $Sub, $Val, $Zhan, $val );
  • return !empty( $this -> ; エラー) ? false : true;
  • }
  • // データベース レコードを削除します
  • $Sql = '$this->Table . $this->Connection( $Sql );
  • unset($Sql);
  • return !empty( $this->Err ) ? false : true;
  • }
  • //フォーム処理が終了します
  • //ページジャンプ
  • public function Msg( $Text = 'Operation success' ) {
  • echo '';
  • echo ' ';
  • exit;
  • }
  • #現在のシステム時刻を取得します
  • public function Times(){
  • return str_replace('-', '[jian]', date ('Y-m-d H:i:s'));
  • }
  • # 取得用户IP地址
  • public function GetIP(){
  • if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown"))
  • $ip = getenv("HTTP_CLIENT_IP");
  • else if (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown"))
  • $ip = getenv("HTTP_X_FORWARDED_FOR");
  • else if (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown"))
  • $ip = getenv("REMOTE_ADDR");
  • else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown"))
  • $ip = $_SERVER['REMOTE_ADDR'];
  • else
  • $ip = "不明";
  • return($ip);
  • }
  • //最後关闭データベース库连接
  • public function Close(){
  • !is_object( $this -> Conn ) または mysqli_close( $this -> Conn );
  • }
  • }
  • 复制定


    このウェブサイトの声明
    この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

    ホットAIツール

    Undresser.AI Undress

    Undresser.AI Undress

    リアルなヌード写真を作成する AI 搭載アプリ

    AI Clothes Remover

    AI Clothes Remover

    写真から衣服を削除するオンライン AI ツール。

    Undress AI Tool

    Undress AI Tool

    脱衣画像を無料で

    Clothoff.io

    Clothoff.io

    AI衣類リムーバー

    Video Face Swap

    Video Face Swap

    完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

    ホットツール

    メモ帳++7.3.1

    メモ帳++7.3.1

    使いやすく無料のコードエディター

    SublimeText3 中国語版

    SublimeText3 中国語版

    中国語版、とても使いやすい

    ゼンドスタジオ 13.0.1

    ゼンドスタジオ 13.0.1

    強力な PHP 統合開発環境

    ドリームウィーバー CS6

    ドリームウィーバー CS6

    ビジュアル Web 開発ツール

    SublimeText3 Mac版

    SublimeText3 Mac版

    神レベルのコード編集ソフト(SublimeText3)

    JSON Web Tokens(JWT)とPHP APIでのユースケースを説明してください。 JSON Web Tokens(JWT)とPHP APIでのユースケースを説明してください。 Apr 05, 2025 am 12:04 AM

    JWTは、JSONに基づくオープン標準であり、主にアイデンティティ認証と情報交換のために、当事者間で情報を安全に送信するために使用されます。 1。JWTは、ヘッダー、ペイロード、署名の3つの部分で構成されています。 2。JWTの実用的な原則には、JWTの生成、JWTの検証、ペイロードの解析という3つのステップが含まれます。 3. PHPでの認証にJWTを使用する場合、JWTを生成および検証でき、ユーザーの役割と許可情報を高度な使用に含めることができます。 4.一般的なエラーには、署名検証障害、トークンの有効期限、およびペイロードが大きくなります。デバッグスキルには、デバッグツールの使用とロギングが含まれます。 5.パフォーマンスの最適化とベストプラクティスには、適切な署名アルゴリズムの使用、有効期間を合理的に設定することが含まれます。

    セッションのハイジャックはどのように機能し、どのようにPHPでそれを軽減できますか? セッションのハイジャックはどのように機能し、どのようにPHPでそれを軽減できますか? Apr 06, 2025 am 12:02 AM

    セッションハイジャックは、次の手順で達成できます。1。セッションIDを取得します。2。セッションIDを使用します。3。セッションをアクティブに保ちます。 PHPでのセッションハイジャックを防ぐための方法には次のものが含まれます。1。セッション_regenerate_id()関数を使用して、セッションIDを再生します。2。データベースを介してストアセッションデータを3。

    確固たる原則と、それらがPHP開発にどのように適用されるかを説明してください。 確固たる原則と、それらがPHP開発にどのように適用されるかを説明してください。 Apr 03, 2025 am 12:04 AM

    PHP開発における固体原理の適用には、次のものが含まれます。1。単一責任原則(SRP):各クラスは1つの機能のみを担当します。 2。オープンおよびクローズ原理(OCP):変更は、変更ではなく拡張によって達成されます。 3。Lischの代替原則(LSP):サブクラスは、プログラムの精度に影響を与えることなく、基本クラスを置き換えることができます。 4。インターフェイス分離原理(ISP):依存関係や未使用の方法を避けるために、細粒インターフェイスを使用します。 5。依存関係の反転原理(DIP):高レベルのモジュールと低レベルのモジュールは抽象化に依存し、依存関係噴射を通じて実装されます。

    phpstormでCLIモードをデバッグする方法は? phpstormでCLIモードをデバッグする方法は? Apr 01, 2025 pm 02:57 PM

    phpstormでCLIモードをデバッグする方法は? PHPStormで開発するときは、PHPをコマンドラインインターフェイス(CLI)モードでデバッグする必要がある場合があります。

    システムの再起動後にUnixSocketの権限を自動的に設定する方法は? システムの再起動後にUnixSocketの権限を自動的に設定する方法は? Mar 31, 2025 pm 11:54 PM

    システムが再起動した後、UnixSocketの権限を自動的に設定する方法。システムが再起動するたびに、UnixSocketの許可を変更するために次のコマンドを実行する必要があります:sudo ...

    フレームワークセキュリティ機能:脆弱性から保護します。 フレームワークセキュリティ機能:脆弱性から保護します。 Mar 28, 2025 pm 05:11 PM

    記事では、入力検証、認証、定期的な更新など、脆弱性から保護するためのフレームワークの重要なセキュリティ機能について説明します。

    PHPでの後期静的結合を説明します(静的::)。 PHPでの後期静的結合を説明します(静的::)。 Apr 03, 2025 am 12:04 AM

    静的結合(静的::) PHPで後期静的結合(LSB)を実装し、クラスを定義するのではなく、静的コンテキストで呼び出しクラスを参照できるようにします。 1)解析プロセスは実行時に実行されます。2)継承関係のコールクラスを検索します。3)パフォーマンスオーバーヘッドをもたらす可能性があります。

    See all articles