小编eth*_*den的帖子

作曲家从类映射中排除不工作

所以我的composer.json中有以下内容

 "autoload": {
        "classmap": [
            "database", "app/path1"
        ],
        "psr-4": {
            "App\\": "app/"
        },
        "exclude-from-classmap": [
          "/app/path1/Front/"
        ]
    },
Run Code Online (Sandbox Code Playgroud)

然而当我运行时composer dump-autoload -o它仍然会抱怨

  [Symfony\Component\Finder\Exception\AccessDeniedException]
  RecursiveDirectoryIterator::__construct(C:/app\path1\Front\
  node_modules\babel-preset-react\node_modules\babel-plugin-transform-react-j
  sx\node_modules\babel-helper-builder-react-jsx\node_modules\babel-types\nod
  e_modules\babel-traverse\node_modules\babel-code-frame\node_modules\chalk,C
  :/app\path1\Front\node_modules\babel-preset-react\node_modu
  les\babel-plugin-transform-react-jsx\node_modules\babel-helper-builder-reac
  t-jsx\node_modules\babel-types\node_modules\babel-traverse\node_modules\bab
  el-code-frame\node_modules\chalk): The system cannot find the path specifie
  d. (code: 3)






  [UnexpectedValueException]
  RecursiveDirectoryIterator::__construct(C:/app\path1\Front\
  node_modules\babel-preset-react\node_modules\babel-plugin-transform-react-j
  sx\node_modules\babel-helper-builder-react-jsx\node_modules\babel-types\nod
  e_modules\babel-traverse\node_modules\babel-code-frame\node_modules\chalk,C
  :/app\path1\Front\node_modules\babel-preset-react\node_modu
  les\babel-plugin-transform-react-jsx\node_modules\babel-helper-builder-reac
  t-jsx\node_modules\babel-types\node_modules\babel-traverse\node_modules\bab
  el-code-frame\node_modules\chalk): The system cannot find the path specifie
  d. (code: 3)
Run Code Online (Sandbox Code Playgroud)

这意味着它并没有真正排除 /app/path1/Front/

我做错了什么以及如何排除该目录以便它不会返回这些异常

php autoload npm laravel composer-php

5
推荐指数
0
解决办法
2584
查看次数

bash 正则表达式不起作用

所以我有这个代码

function test(){
  local output="ASD[test]"
  if [[ "$output" =~ ASD\[(.*?)\] ]]; then
     echo "success";
  else
     echo "fail"
  fi;
}
Run Code Online (Sandbox Code Playgroud)

正如您所看到的,它应该会回显成功,因为该字符串与该正则表达式匹配。然而,这最终返回失败。我做错了什么?

regex bash shell scripting

1
推荐指数
1
解决办法
1284
查看次数

标签 统计

autoload ×1

bash ×1

composer-php ×1

laravel ×1

npm ×1

php ×1

regex ×1

scripting ×1

shell ×1