小编BeB*_*ley的帖子

从URL启动活动

我试图在用户浏览某个网址时启动我的应用程序.我找到了一些例子,它们在清单中都有相同的东西,但它对我不起作用.我已将intent-filter放在Activity和Receiver下.

这是我的清单片段:

<intent-filter>
  <action android:name="android.intent.action.VIEW"></action>
  <category android:name="android.intent.category.DEFAULT"></category>
  <category android:name="android.intent.category.BROWSABLE"></category>
  <data android:host="www.urbandictionary.com" android:scheme="http"></data>
</intent-filter>
Run Code Online (Sandbox Code Playgroud)

在Activity下,我尝试使用onNewIntent,当它在Receiver下时,我尝试使用onReceiveIntent,两者都使用一个简单的Log.i调用来查看它是否被触发.我没有太多运气.

android manifest android-intent android-activity

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

CakePHP 3.10 -&gt; 4.x 升级 - Rector 无法启动

我正在使用4.x 升级指南将站点从 CakePHP 3.10.0 升级到CakePHP 4.x。我已经成功了,直到您需要运行以下命令:

bin/cake upgrade rector --rules phpunit80 <path/to/app/tests>
bin/cake upgrade rector --rules cakephp40 <path/to/app/src>
Run Code Online (Sandbox Code Playgroud)

我跳过了第一个命令,因为我还没有进行单元测试)。当我运行第二个命令时,它只是挂起。该命令根本没有任何输出。我已经让它静置了几个小时,但没有任何作用。我添加-v到命令中并最终得到了一些输出,但它仍然挂起:

$ bin/cake upgrade rector --rules cakephp40 ../vintage-lib/src -v
Detecting autoload file for /mnt/d/Programming/PHP/vintage-lib/src
-> Checking /mnt/d/Programming/PHP/vintage-lib/src/vendor/autoload.php
-> Checking /mnt/d/Programming/PHP/vintage-lib/vendor/autoload.php
-> Found /mnt/d/Programming/PHP/vintage-lib/vendor/autoload.php
Running /mnt/d/Programming/PHP/upgrade/vendor/bin/rector process  --autoload-file='/mnt/d/Programming/PHP/vintage-lib/vendor/autoload.php' --config='/mnt/d/Programming/PHP/upgrade/config/rector/cakephp40.php' --working-dir='/mnt/d/Programming/PHP/vintage-lib/src' '/mnt/d/Programming/PHP/vintage-lib/src'
Run Code Online (Sandbox Code Playgroud)

我尝试在 Windows、WSL 甚至 Linux VM 中运行它 - 结果保持不变,这让我相信它与我的代码或配置文件有关。我尝试在每个插件上运行该命令,但得到相同的结果。

我还运行并修复了来自 codeniffer 的所有错误和警告,但这没有什么区别。

我很茫然,因为我不知道下一步该去哪里检查。任何帮助将不胜感激。

php cakephp rector

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