restore_include_path
include_path構成オプションの値を復元します
関数名:restore_include_path()
関数の説明:この関数は、set_include_path()関数を使用して変更されたinclude_pathの値を復元するために使用されます。
関数の使用法:restore_include_path()関数はパラメーターを受け入れません。
サンプルコード:
// 设置新的include_path set_include_path('/path/to/directory'); // 备份当前的include_path $backup = get_include_path(); // 修改include_path set_include_path('/another/path'); // 恢复之前的include_path restore_include_path(); // 输出恢复后的include_path echo get_include_path(); // 输出/path/to/directory
上記の例では、最初にset_include_path()関数を使用して新しいinclud_pathを設定します。次に、get_include_path()関数を使用して、current curringの値をバックアップしました。次に、set_include_path()関数を使用してinclude_pathを変更します。最後に、restore_include_path()関数を使用して、以前のバックアップ値にcontruce_pathを復元します。コードの最後の行はget_include_path()関数を使用して復元されたinclude_path値を出力して、回復が成功したかどうかを確認します。
restore_include_path()関数は、set_include_path()関数によって変更されたinclude_path値のみを復元し、include_pathを変更する他の方法を復元しないことに注意してください。