Questions tagged [lithium]

Lithium is an RAD framework for PHP 5.3+

Lithium, an RAD framework for PHP, is focused on quality, speed, and flexibility. It's a set of philosophies and tools that enable one to build applications quickly, without sacrificing quality, extensibility, or control of the framework.

Lithium understands distributed storage and caching, queuing systems, micro-dispatch frameworks, with integrated support for document oriented databases like CouchDB and MongoDB, alongside relational databases like MySQL and SQLite.

Official Lithium (li3) Homepage

The Manual

API

The Source Code on GitHub

301 questions
4
votes
3 answers

Accessing more than one model deep relationships in Lithium

Is it possible to access more than one model deep in a relationship in Lithium? For example, I have a User model: class Users extends \lithium\data\Model { public $validates = array(); public $belongsTo = array("City"); } and I have a City…
Jess
  • 42,368
  • 6
  • 37
  • 51
4
votes
2 answers

PHP lithium(li3) how to find out version

If I have a lithium app that I did not set up how do I find out the version?
Evgenius
  • 935
  • 1
  • 8
  • 17
4
votes
1 answer

Error updating an array in Mongo

I have created an array in my mongo document, so it looks a bit like the following: { "_id" : ObjectId("4f59e19d0b7aab2903000004"), "details" : { x:1, y:2 } } I am then trying to push a new value to the array, doing: db.users.update({"_id" :…
Dan
  • 445
  • 6
  • 31
4
votes
3 answers

Lithium mongodb relation between models

I'm using lithium with mongodb and I would like to know with my models below how I could get the data of the user from Posts::find('all'); query? Do I have to do two queries? Thanks for your help!
Maxime P
  • 775
  • 1
  • 9
  • 13
4
votes
2 answers

Exclude results from Lithium find

I'd like to exclude results from a call to a Lithium model's find() method. I need to do this for models with both MongoDB and MySQL data sources, but in SQL I mean something like WHERE myfield NOT IN (1,2,3). I'd like to just be able to pass a not…
michaeltwofish
  • 4,096
  • 3
  • 28
  • 32
4
votes
1 answer

How to use SUM aggregate function in queries with Lithium PHP framework

How to use SUM aggregate function in queries with Lithium PHP framework. I wanted to fetch sum of a column value. How to do this in Lithium Frame work. Thanks,
Yogesh
  • 363
  • 3
  • 9
  • 22
4
votes
5 answers

Is it safe to store passwords in Lithium sessions?

I'd like to use the "cookie" session adapter from Lithium. After the user logs in I'll create a cookie with his hashed password. If this cookie is present and the hashed password matches the one from the db, I'll log him in automatically. Is this…
Elfy
  • 1,733
  • 6
  • 19
  • 39
4
votes
1 answer

Using Memcached to cache results from Model::find()

I'd like to store the DocumentSet returned from Model::find() in memcached. However, I get the MongoException below when I try to work with the results after retrieving them from cache. Specifically, when using foreach, the exception is thrown when…
Eric C
  • 971
  • 6
  • 14
4
votes
1 answer

Lithium form helper data and errors missing?

I am building a test Lithium app to learn how it works and I found that the form helper doesn't seem to recognise my data being passed back or any validation errors. At the moment I'm having to manually pass back my errors and then process them in…
David Yell
  • 11,756
  • 13
  • 61
  • 100
4
votes
4 answers

Lithium count with left join

As part of a larger query with dynamically-generated elements, I need to do a left join and count. This is the query I need. SELECT slug, name, count(client_tests.id) AS test_count FROM clients LEFT JOIN client_tests ON clients.id =…
michaeltwofish
  • 4,096
  • 3
  • 28
  • 32
3
votes
3 answers

PHP Lithium: Filtering an existent DocumentSet and get first Match

I am retrieving a DocumentSet in Lithium from MongoDB, but I don't want to process the documents all at once. Instead I would like to have a filter, which I just could tell something like this: $manyDocuments->giveMeTheOneWhere(array('foo' =>…
YMMD
  • 3,730
  • 2
  • 32
  • 43
3
votes
1 answer

How to code tag cloud in Ltihium without HABTM?

I'm a little foggy with Lithiums relationships. I'm trying to create a tag cloud using Lithium but I'm not sure how to do this without using HABTM relationships. I'm using MySQL, btw. Any suggestions? :edited to add sample code: Here is a very…
Housni
  • 963
  • 1
  • 10
  • 23
3
votes
2 answers

Lithium Generic Model Filter

I am currently developing a Lithium application which requires various things to be added to an object before save() is called. Ideally I would be able to write a filter to apply to the Model class (the base model that other models extends) such as…
GaryDevenay
  • 2,405
  • 2
  • 19
  • 41
3
votes
3 answers

Lithium all rows in cookies, session

Currently after login Lithium stores in session and cookies all rows from users table like password, hash etc. How to remove (don't allow to store) some of the information like password and hash?
Mr. Sensitive
  • 685
  • 1
  • 6
  • 16
3
votes
2 answers

Custom lithium routing scenario

I've been tasked with rewriting an existing website with large pre-existing link catalog. For argument's sake, let's assume we can't do anything that would change the link catalog. Here's a few examples of the link structure we're working with: An…
Eric C
  • 971
  • 6
  • 14
1
2
3
20 21