日記帳
本ページはプロモーションが含まれています
カテゴリー
Links
blog(ブログ)マスター
アンドロイドの巣
ゼロから始めるベランダ菜園
タイトル
ラジコン
2024年5月
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

laravel 定義済み グローバル関数

カテゴリー: ぷろぐらみんぐ
2018-06-23
laravel 5.6 定義済み グローバル関数

ヘルパー関数でグローバル関数が定義されているので注意されたい。
次のコマンドで検索することができる
find . -type f -name "helpers.php"
./vendor/laravel/framework/src/Illuminate/Foundation/helpers.php
./vendor/laravel/framework/src/Illuminate/Support/helpers.php
./vendor/mockery/mockery/library/helpers.php

次のコマンドで、関数一覧を表示できる
grep "function_exists" ファイル名 | grep -oP "'.+'" | sort



エラー
"Too few arguments to function redirect(), 0 passed in vendor\laravel\framework\src\Illuminate\Foundation\Auth\AuthenticatesUsers.php on line 107 and exactly 1 expected "
はい。検索 redirect
  グローバル関数 redirect かぶり見たいですね。

Laravelに既存のプロジェクトを移行しようと思ったのですが
namespace使うように書き換えるか、既存のプロジェクトのredirect関数を別名に変更するしかないですね。
当然一括置換できる後者しか選択の余地がないですね。

ここで定義されています
vendor/laravel/framework/src/Illuminate/Foundation/helpers.php

このファイルで定義されいる同名関数が使われている場合は、誤動作する可能性がある。

一覧
vendor/laravel/framework/src/Illuminate/Foundation/helpers.php
'__'
'abort'
'abort_if'
'abort_unless'
'action'
'app'
'app_path'
'asset'
'auth'
'back'
'base_path'
'bcrypt'
'broadcast'
'cache'
'config'
'config_path'
'cookie'
'csrf_field'
'csrf_token'
'database_path'
'decrypt'
'dispatch'
'dispatch_now'
'elixir'
'encrypt'
'event'
'factory'
'info'
'logger'
'logs'
'method_field'
'mix'
'now'
'old'
'policy'
'public_path'
'redirect'
'report'
'request'
'rescue'
'resolve'
'resource_path'
'response'
'route'
'secure_asset'
'secure_url'
'session'
'storage_path'
'today'
'trans'
'trans_choice'
'url'
'validator'
'view'

vendor/laravel/framework/src/Illuminate/Support/helpers.php
'append_config'
'array_add'
'array_collapse'
'array_divide'
'array_dot'
'array_except'
'array_first'
'array_flatten'
'array_forget'
'array_get'
'array_has'
'array_last'
'array_only'
'array_pluck'
'array_prepend'
'array_pull'
'array_random'
'array_set'
'array_sort'
'array_sort_recursive'
'array_where'
'array_wrap'
'blank'
'camel_case'
'class_basename'
'class_uses_recursive'
'collect'
'data_fill'
'data_get'
'data_set'
'dd'
'e'
'ends_with'
'env'
'filled'
'head'
'kebab_case'
'last'
'object_get'
'optional'
'preg_replace_array'
'retry'
'snake_case'
'starts_with'
'str_after'
'str_before'
'str_contains'
'str_finish'
'str_is'
'str_limit'
'str_plural'
'str_random'
'str_replace_array'
'str_replace_first'
'str_replace_last'
'str_singular'
'str_slug'
'str_start'
'studly_case'
'tap'
'throw_if'
'throw_unless'
'title_case'
'trait_uses_recursive'
'transform'
'value'
'windows_os'
'with'



ブログ内 関連記事: laravel 定義済み グローバル関数


ブログ内 関連記事: laravel 定義済み グローバル関数

トラックバック
トラックバックはありません。
PR

[PR]