小编use*_*428的帖子

优化用 TypeScript 编写的文件内容解析器类

I got a typescript module (used by a VSCode extension) which accepts a directory and parses the content contained within the files. For directories containing large number of files this parsing takes a bit of time therefore would like some advice on how to optimize it.

I don't want to copy/paste the entire class files therefore will be using a mock pseudocode containing the parts that I think are relevant.

class Parser {
    constructor(_dir: string) {
        this.dir = _dir;
    } …
Run Code Online (Sandbox Code Playgroud)

javascript parallel-processing node-worker-threads

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

找不到请求的URL - Laravel 5

我正在尝试将一个Web应用程序(我使用Laravel 5制作)上传到DigitalOcean Droplet.但我得到404错误:

在此服务器上找不到请求的URL/public/login.

这是我的apache2.conf

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www/html/hotelguide/public> 
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
Run Code Online (Sandbox Code Playgroud)

000-default.conf

<VirtualHost *:80>

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/hotelguide/public

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

这是我的文件夹结构 这是我的文件夹结构

这是php artisan route:list的输出 这是php artisan route:list的输出

更新:LARAVEL LOG

Stack trace:
#0 /var/www/html/hotelguide/vendor/symfony/console/Application.php(183): Symfony\Component\Console\Application->find('routes')
#1 /var/www/html/hotelguide/vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /var/www/html/hotelguide/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/www/html/hotelguide/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 {main}
Run Code Online (Sandbox Code Playgroud)

更新:PHP错误日志(最后一个错误)

124.43.95.22 - - [02/Sep/2016:14:01:29 +0530] …
Run Code Online (Sandbox Code Playgroud)

php apache laravel

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

传递给控制器​​方法的参数 2 必须在请求的实例中,没有给出

我试图在我的控制器中将 2 个日期从一个视图传递到另一个视图,但出现以下错误:传递给 App\Http\Controllers\GuestController::reservationToGuest() 的参数 2 必须是 Illuminate\Http\ 的实例请求,没有给出

这是我的第一个视图(具有日期的视图):

<form action="{{ route('create_guest') }}">                                            
    {{ csrf_field() }}
    <input type="hidden" value="2016-08-26" name="dateOne">
    <input type="hidden" value="2016-08-28" name="dateTwo">
    <button class="btn btn-block btn-success">Proceed To Check In</button>
</form>
Run Code Online (Sandbox Code Playgroud)

(dateOne 和 dateTwo 是我在第二个视图中想要的日期)

路由文件

Route::get('/guest_page/create/{idreservation?}',[
    'uses' => 'GuestController@reservationToGuest',
    'as' => 'create_guest'
]);
Run Code Online (Sandbox Code Playgroud)

在GuestController 中reservationToGuest

public function reservationToGuest($idreservation = null, Request $request){
    if($idreservation === null){
        return view('guest_page_create', ['idreservation' => 0, 'page_title' => 'Guest Check In', 'check_in_date' => $request['dateOne']]);

    } else{ //else clause works just fine and the …
Run Code Online (Sandbox Code Playgroud)

php laravel

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