PHPackages                             bear/ace - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bear/ace

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bear/ace
========

Ace online editor utility

1.0.1(9y ago)104.0k51BSD-3-ClausePHP

Since Apr 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/koriym/BEAR.Ace)[ Packagist](https://packagist.org/packages/bear/ace)[ Docs](http://koriym.github.io/BEAR.Ace/)[ RSS](/packages/bear-ace/feed)WikiDiscussions develop Synced yesterday

READMEChangelog (1)DependenciesVersions (9)Used By (1)

BEAR.Ace
========

[](#bearace)

Ace online editor utility for PHP
---------------------------------

[](#ace-online-editor-utility-for-php)

BEAR.Ace is an Ace utility for PHP. ([Ace](https://github.com/ajaxorg/ace) is a standalone code editor written in JavaScript.) It enables you to use an editor via a web service or to fix syntax errors on the fly.

BEAR.AceはオンラインエディターAceのユーティリティです。 エディターwebサービスやシンタックスエラーのオンライン修正が可能です。

Getting started
===============

[](#getting-started)

### Installing via Composer

[](#installing-via-composer)

The recommended way to install BEAR.Ace is through [Composer](http://getcomposer.org).

```
# 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 require bear/ace:^1.0
```

### Start the online editor web service

[](#start-the-online-editor-web-service)

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

```

You can now browse file content using the 'file' and 'line' (optional) query.

Open

[![Editor](https://camo.githubusercontent.com/61301f7749a29ea0641df52f42ed1e3da2e4eda4fb00ad1b7d90fb916dcfb768/68747470733a2f2f7261772e6769746875622e636f6d2f6b6f7269796d2f424541522e4163652f67682d70616765732f6173736574732f656469746f722e706e67)](https://camo.githubusercontent.com/61301f7749a29ea0641df52f42ed1e3da2e4eda4fb00ad1b7d90fb916dcfb768/68747470733a2f2f7261772e6769746875622e636f6d2f6b6f7269796d2f424541522e4163652f67682d70616765732f6173736574732f656469746f722e706e67)

You can also save the file you are editing when you have write access to the web server. It supports save shortcut keys for Windows(Ctl+S) and OSX(Cmd+S).

Sample Code
-----------

[](#sample-code)

Getting HTML to display in the editor.

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

You can specify a `$file` as an absolute path or as a relative path from `$rootPath`. Files higher than `$rootPath` are not accessible for security reasons.

Starting the online service is simple using the following code.

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

More sample code can be found in the /docs/ directory.

Syntax Error Editor
-------------------

[](#syntax-error-editor)

Once an error handler has been registered, when a syntax error occurs, you can not only display the error but make a fix in the browser on the fly. The browser is then automatically reloaded for you upon save. This feature can really minimize the time and frustration caused by simple careless mistakes.

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

[![Editor](https://camo.githubusercontent.com/d75366617fb9e1d07b9e5497e6f4b66472fbfa2fb2280329960fb9a60e9d18d4/68747470733a2f2f7261772e6769746875622e636f6d2f6b6f7269796d2f424541522e4163652f67682d70616765732f6173736574732f73796e7461785f6572726f722e706e67)](https://camo.githubusercontent.com/d75366617fb9e1d07b9e5497e6f4b66472fbfa2fb2280329960fb9a60e9d18d4/68747470733a2f2f7261772e6769746875622e636f6d2f6b6f7269796d2f424541522e4163652f67682d70616765732f6173736574732f73796e7461785f6572726f722e706e67)

edit();
-------

[](#edit)

You can also view file content in the editor by using the edit function. Just specify the object or file path in the argument.

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

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

xdebug.file\_link\_format
-------------------------

[](#xdebugfile_link_format)

The online editor can be linked to in the stack trace file name using the following ini configuration of xdebug.

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

Syntax Error Integration in Symfony2
------------------------------------

[](#syntax-error-integration-in-symfony2)

1. Add "bear / ace" to composer.json, then install it with the composer command.

```
    "require": {
        ...
        "bear/ace": "*"
    },
```

```
$ composer update bear/ace
```

2. Register a syntax error editor in web/app\_dev.php.

```
require_once __DIR__.'/../app/AppKernel.php';
// after this line

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

// before this line
$kernel = new AppKernel('dev', true);
```

3. That's it ! You can now fix syntax errors on the spot.

Requirements
------------

[](#requirements)

- PHP 5.3+

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 98% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~287 days

Recently: every ~358 days

Total

6

Last Release

3377d ago

Major Versions

0.2.1 → 1.0.02013-06-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/db4fc75ffc631168d0d7143b6f2c24b1534dfb921212bd851c026c5cbbb1344d?d=identicon)[koriym](/maintainers/koriym)

---

Top Contributors

[![koriym](https://avatars.githubusercontent.com/u/529021?v=4)](https://github.com/koriym "koriym (50 commits)")[![mackstar](https://avatars.githubusercontent.com/u/197328?v=4)](https://github.com/mackstar "mackstar (1 commits)")

---

Tags

editoraceonline editor

### Embed Badge

![Health badge](/badges/bear-ace/health.svg)

```
[![Health](https://phpackages.com/badges/bear-ace/health.svg)](https://phpackages.com/packages/bear-ace)
```

###  Alternatives

[ckeditor/ckeditor

JavaScript WYSIWYG web text editor.

5244.3M79](/packages/ckeditor-ckeditor)[stfalcon/tinymce-bundle

This Bundle integrates TinyMCE WYSIWYG editor into a Symfony2 project.

2553.0M24](/packages/stfalcon-tinymce-bundle)[unisharp/laravel-ckeditor

JavaScript WYSIWYG web text editor (for laravel).

375765.1k5](/packages/unisharp-laravel-ckeditor)[yajra/laravel-datatables-editor

Laravel DataTables Editor plugin for Laravel 5.5+.

1196.4M2](/packages/yajra-laravel-datatables-editor)[norberttech/aceeditor-bundle

Bundle that integrate excellent JavaScript ace editor into Symfony Form.

29315.5k](/packages/norberttech-aceeditor-bundle)[h5p/h5p-editor

H5P Editor functionality in PHP

791.6M32](/packages/h5p-h5p-editor)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
