小编Ben*_*Ben的帖子

如何使用curl.h在我的网络服务器上安装git没有这样的文件错误

我一直在尝试在我的网络服务器上安装Git.当我尝试"make install"时,我得到以下错误,我似乎无法通过.

[root@site git-core-0.99.6]# make install
gcc -o http-pull.o -c -g -O2 -Wall '-DSHA1_HEADER=<openssl/sha.h>' http-pull.c 
http-pull.c:6:23: error: curl/curl.h: No such file or directory
http-pull.c:7:23: error: curl/easy.h: No such file or directory
http-pull.c:16: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token 
http-pull.c: In function âfetch_indexâ:
http-pull.c:102: warning: implicit declaration of function âcurl_easy_setoptâ
Run Code Online (Sandbox Code Playgroud)

如果你需要看到它,还有更多的东西,但它的一部分将涵盖这个问题

linux git ssh curl

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

Laravel 5.0.*中间件,用于在处理路由之前从url中删除前缀区域设置

我正在寻找一种方法,使所有应用程序路由具有多个语言环境,而无需使用路由组.这是因为我使用外部扩展包,这意味着路由在很多地方注册.

基本上我想要/ foo/bar以及/ en/foo/bar,/ de/foor/bar,/ es/foo/bar等都可以通过/ foot/bar路由识别和处理

 Route::get('foo/bar', function () {
     return App::getLocale() . ' result';
 });
Run Code Online (Sandbox Code Playgroud)

所以上面会给我'结果'或'结果'或'结果'.

我已经有了基于路径段设置语言环境的中间件.我试过以下没有运气.

   ...
   $newPath =  str_replace($locale,'',$request->path());

   $request->server->set('REQUEST_URI',$new_path);

 }

 return $next($request);
Run Code Online (Sandbox Code Playgroud)

希望这是可能的,或者还有其他方法可以实现它.

编辑 - - -

基于下面的评论,我通过将以下代码添加到public/index.php中来快速攻击它.希望通过编辑请求对象可以更好地了解我想要实现的目标.

$application_url_segments = explode( '/', trim( $_SERVER["REQUEST_URI"], '/' ) );

$application_locale = $application_url_segments[0];

$application_locales = ['en' => 'English', 'de' => 'German'];

if ( array_key_exists( $application_locale, $application_locales ) ) {

    $_SERVER["REQUEST_URI"] = str_replace( '/' . $application_locale,'',$_SERVER["REQUEST_URI"] );

}
Run Code Online (Sandbox Code Playgroud)

middleware routes laravel

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

没有尝试Laravel 5.1.x数据库队列作业

我成功地使在测试站点上工作的任务排队,并更新了实时站点(同一服务器)。现在,实时队列正在填充,没有经过处理或尝试。我正在使用伪造,并且正在运行一个队列进程。任何人都可以帮忙我接下来要检查的内容以找出为什么它无法正常工作

queue worker laravel

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

标签 统计

laravel ×2

curl ×1

git ×1

linux ×1

middleware ×1

queue ×1

routes ×1

ssh ×1

worker ×1