Lithium 101

Lithium101 is an unofficial community resource for the Lithium PHP framework indexing articles, tutorials, code snippets and libraries.

Libraries

Tracking 261 plugins, categorised and sorted. If you are the plugin owner you can edit the status and category.

Snippets

So far there are 54 Lithium related snippets. It's super easy to add your gists as snippets on the site, if there is anything you think might be interesting or helpful take a minute to share it.

Latest Activity

2 days ago davidpersson created a comment about an issue in UnionOfRAD/lithium

error in save entity without all fields that is defined in model validate .

@koushki I don't think #1121 has to block this issue. Those issues are independent from each other. davidpersson
2 days ago davidpersson created a comment about an issue in UnionOfRAD/lithium

All fields embed in update query, even which they didn't change !

The current default behavior for SQL databases is to do a full replace instead of an incremental update when saving an existing entity having all fields. I agree that this is something which can/should be optimized. I don't agree about the severity of this missing feature. It becomes only a problem if you rely on the atomicity of updates _and_ have a high amount of concurrency _and_ retrieved all fields. This feature could be implemented in the `Database::update()` and `Database::create()` methods similar to how its done with `MongDb` using its own Exporter class. For this case we may not even need a dedicated exporter class unless there's more code involved. davidpersson
2 days ago koushki created a comment about an issue in UnionOfRAD/lithium

error in save entity without all fields that is defined in model validate .

@davidpersson ,@netable please don't merge this commit. I found a bigger bug in `Entity` and i reported in #1121 issue. after fixing #1121 issue, we can use better way for this case. koushki

All fields embed in update query, even which they didn't change !

hi, in updating entity data , all fields that are selected, even they which didn't change will embed into query and they will store their datas. <b>It is dangerous risk !!</b> to becoming more clear i explain this with belove sample. <em>in controller A:</em> ```php $user = Users::find(1); $user->balance = 10; $user->save(); ``` <em>in controller B:</em> ```php $user = Users::find(1); $user->name = 'test'; $user->save(); ``` <ol> <li>Request for A : select user 1 (id = 1, balance = 0, name = 'your name') <li>Request for B : select user 1 (id = 1, balance = 0, name = 'your name') <li>Request for A : change balance and save data in database (balance = 10, name = 'your name') <li>Request for B : change name and save data in database (balance = 0, name = 'test') </ol> in above sample, in item 4, request shouldn't change `balance` field because `balance` hasn't changed in this request. @nateabele , I checked Entity source code and found `_updated` property, also i found `18b6a8c58766` commit that you had changed `_updated` behaviour. I think after this commit above bug has happened.
3 days ago markwilde pushed to UnionOfRAD/li3_queue

Moved QueueTest into tests/cases/storage

Cleaned spacing

Updated testConfiguration() to assertNull instead of assertFalse Looking at Adaptable class, config returns NULL on no config, instead of false

Muted fsockopen connection errors on testing for beanstalk server Error messages not needed as tests already mention if server is not running

Removed tests which are covered by other class unit tests

Added space formatting

Added read and write method to MockQueue

Shortened QueueTest setup

Updates to QueueTest - Removed tearDown - Removed testConfiguration - Added testWriteNoConfig - Added testWrite

Initial work on AMQP adapter

Added new write/read/consume methods to storage/Queue

Updated read method in storage/Queue

Added testSimpleWrite for AMQP

Added testReadNoConfig and testRead to QueueTest

Updates to AMQP adapter

Added testSimpleRead to AMQPTest

Updated AMQPTest

Changed variable naming from $acknowledge to $messages

Refactored AMQP and fixed bugs

Added new tests

3 days ago davidpersson created a comment about an issue in UnionOfRAD/li3_queue

Added AMQP adapter & updated Beanstalk adapter

Please commit as you see fit directly once you have write access. davidpersson

Added AMQP adapter & updated Beanstalk adapter

I've created an adapter for AMQP and in doing so updated the way messages are handled allowing the return of a message object. Works similar to the way models return entities allowing you to confirm and requeue messages. In doing this I've also updated the Beanstalk adapter to work in the same way and made everything use native Lithium classes/format. Tests accompany both these adapters.
4 days ago davidpersson created a comment about an issue in UnionOfRAD/lithium

error in save entity without all fields that is defined in model validate .

@koushki Model::validates() would be the best place. davidpersson
4 days ago koushki created a comment about an issue in UnionOfRAD/lithium

error in save entity without all fields that is defined in model validate .

thanks everybody for your opinions, I changed previous way to confirmed way. @jails please check and give me your opinion. @davidpersson I wanted to change documents but i don't know where is better, I confused among: + `validates` property in `Model` + `validates` method in `Model` + `check` method in `Validator` koushki
4 days ago davidpersson pushed to UnionOfRAD/li3_docs

Use normal crumb sep.

4 days ago davidpersson pushed to UnionOfRAD/li3_docs

Humanize crumb titles.

5 days ago davidpersson pushed to UnionOfRAD/li3_docs

Fenced code markdown parsing.

6 days ago jails created a comment about an issue in UnionOfRAD/lithium

error in save entity without all fields that is defined in model validate .

Yup, I should be able to provide something the new W.E. ! jails
6 days ago davidpersson created a comment about an issue in UnionOfRAD/lithium

error in save entity without all fields that is defined in model validate .

Alright, @jails would you like to lead the implementation and work on it together @koushki? Granted you both would like to and have time. davidpersson
6 days ago nateabele created a comment about an issue in UnionOfRAD/lithium

error in save entity without all fields that is defined in model validate .

@davidpersson Yeah I'm pretty much in agreement with @jails. nateabele
6 days ago davidpersson pushed to UnionOfRAD/li3_docs

Lower heading level.

6 days ago davidpersson pushed to UnionOfRAD/li3_docs

Implement up and always show TOC.

6 days ago davidpersson pushed to UnionOfRAD/li3_docs

Cleanup markup.

6 days ago davidpersson pushed to UnionOfRAD/li3_docs

Lower heading count.

6 days ago davidpersson pushed to UnionOfRAD/li3_docs

Implement (optional) caching.

6 days ago davidpersson pushed to UnionOfRAD/li3_docs

Set default options.

Protect against directory traversal.

6 days ago davidpersson created a comment about an issue in UnionOfRAD/lithium

error in save entity without all fields that is defined in model validate .

@jails I find your solution and the explanation totally valid and would be find with implementing it this way. I also started to wonder how other frameworks handle that case. davidpersson
7 days ago davidpersson pushed to UnionOfRAD/lithium

Add headings to namespaces docs; update h hierachy.

Replace markdown curly braces with triple ticks and remove link hack.

Uppercasing readme filenames.

Fixing formatting of codeblocks.

Normalize links to php.net.