Skip to content

1.12.0

Choose a tag to compare

@koriym koriym released this 11 Jun 02:21
· 1194 commits to 1.x since this release
3bb59f3
  • Add ResourceLogger #179 #189
  • JSON Shcema validation for HAL link #158 #165
  • Improve validation error message #167
  • Improve OPTION method output #159
  • Generates FakeJson on the fly #160 #161 #162
  • CamelCakeKeyModule #163 #164 #183 (Independet package)
  • Class parameter #166
  • Trigger E_USER_ERROR when exception caught in toString (former error is E_USER_WARNING) #168 #172
  • Omit host name and schema #169
  • newInstance() set method get #171
  • Fix big typo #170
  • Cleanup the code #173 #175 #178 #181 #184 #185
  • Improve error message #174
  • Support HEAD method #177
  • Refactor HalRender to share in bear/sunday #180
  • Support http resource #187
  • Bug fix #186 #188 #190

FakeJson

$this->install(new FakeJsonModule);

CamelCaseKeyModule

$this->install(new CamelCakeKeyModule);

Default schema

use BEAR\Resource\Annotation\ContextSchema
class FooModule
{
    /**
     * {@inheritdoc}
     */
    protected function configure()
        // ...
        $this->bind()->annotatedWith(ContextSchema::class)->toInstance('app://self');
    } 
}

Resource Logger

For production

Log only when the method is "UNSAFE". (POST, PUT, etc)

$this->install(new ProdLoggerModule);

For development

Log all request as well as response.

$this->install(new DevLoggerModule);

Your Logger

You may want to log login_id or special request/response information in a particular case. In that case, you can bind your own logger. The logger was called in each resource request.

$this->bind(LoggerInterface::class)->to(YourLogger::class);