我正在尝试为Symfony项目中的某些共享类设置自定义目录结构.我想在项目的根目录中创建一个自定义文件夹,我想使用Symfony自动加载功能自动注册该文件夹中的服务.
所以我在services.yaml文件中添加了一个自定义服务命名空间:
# src ./config/services.yaml
services:
...
TestNamespace\:
resource: '../TestNamespace/*'
...
Run Code Online (Sandbox Code Playgroud)
我在自定义文件夹中添加了一个空类:
# src ./TestNamespace/TestClass.php
namespace TestNamespace;
class TestClass
{
}
Run Code Online (Sandbox Code Playgroud)
当我运行应用程序时,我收到以下错误:
(1/2) InvalidArgumentException
Expected to find class "TestNamespace\TestClass" in file
"/path/to/ClassLoadErrorDemo/demo/TestNamespace/TestClass.php"
while importing services from resource
"../TestNamespace/*", but it was not found! Check the
namespace prefix used with the resource.
(2/2) FileLoaderLoadException
Expected to find class "TestNamespace\TestClass" in file
"/path/to/ClassLoadErrorDemo/demo/TestNamespace/TestClass.php" while
importing services from resource "../TestNamespace/*", but it was not
found! Check the namespace prefix used with the …Run Code Online (Sandbox Code Playgroud) 上个月,我注意到由于传出带宽,我的 Azure 账单大幅增加。我使用了 1800GB 的传出数据,而之前使用了大约 200GB。经过一些研究,我发现这是由我上个月启用的 Azure Front Door 服务引起的,我不知道与该服务相关的额外间接成本。
我将在下面提供我对“问题”的分析,希望能避免其他人犯我犯的错误。
我想使用 SQL 脚本将一些行插入表中,但表键是 Ulid。有没有办法在MySQL中生成Ulids?据我所知,它不是内置的,谷歌也没有提出任何社区提供的解决方案,所以我想知道这是否可能。