PHP code example of bear / ace

1. Go to this page and download the library: Download bear/ace library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bear / ace example snippets


$html = (string)(new Editor)->setRootPath($rootPath)->setPath($file)->setLine($line);

try {
    $editor = (new Editor)->setRootPath($rootPath)->handle($_GET, $_POST, $_SERVER);
    echo $editor;
} catch (Exception $e) {
    http_response_code($e->getCode());
    echo $e->getCode();
}

(new \BEAR\Ace\ErrorEditor)->registerSyntaxErrorEdit();

$file = __DIR__ . 'file.php';
edit($file);

$a = new A;
edit($a);

xdebug.file_link_format=localhost:8090/?file=%f&line=$l

    "    ...
        "bear/ace": "*"
    },


// after this line

(new \BEAR\Ace\ErrorEditor)->registerSyntaxErrorEdit();

// before this line
$kernel = new AppKernel('dev', true);
bash
# Install Composer
curl -sS https://getcomposer.org/installer | php

# Install as stand alone editor
php composer.phar create-project bear/ace BEAR.Ace

# Add BEAR.Ace as a dependency
php composer.phar 

$ cd BEAR.Ace/web
$ php -S localhost:8090 index.php