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
1
vote
1 answer

How do I override POST content type detection?

I'm trying to migrate an existing web app to the Lithium framework. If I POST JSON-encoded data to an URL and set the Content-Type header to application/json on the request, the POST'd data is automatically parsed and available in the controller (as…
benzado
  • 82,288
  • 22
  • 110
  • 138
1
vote
1 answer

dashboard in Lithium like in cakePHP

I'm trying to figure out how to load/set models/classes in Lithium controller. This is my first so serious framework & I like it very much, but I dont know a lot about them. Have used only simple one. The problem what I have is: I'm trying to figure…
Mr. Sensitive
  • 685
  • 1
  • 6
  • 16
1
vote
1 answer

Accessing auth session data (Lithium + MongoDB)

Okay, so hopefully I am asking this question correctly: I set up my user model & controller, as well as my session model and controller... but I want to render some of the session info onto a page. for example If I were to login to a page, it would…
briankulp
  • 186
  • 1
  • 11
1
vote
1 answer

Push new value to inner array with Lithium and MongoDB

I have a structure like this: [_id] => MongoId Object ( [$id] => 4e91bcb40b7aab256c000000 ) [campaigns] => Array ( [0] => Array ( [campaign_id] => 4e91bcd10b7aab2b6c000000 [refer_code] => AjZCJR [owner] => 1 …
Dan
  • 445
  • 6
  • 31
1
vote
1 answer

How to use Zend Helper in Lithium

i'm trying to migrate my cakephp apps to lithium, and already use Doctrine, and Twig as plugin, but now i'm also want to integrate Zend libraries into apps, and i have to integrate the Zend helper libraries. I added the Zend library and ZendX on…
ikhsan
  • 800
  • 5
  • 11
1
vote
2 answers

Storing Country, State, City and Zip in NoSQL

Hey I am trying to come up with a good schema for storing country, state, city, zip in a NoSQL(MongoDB) and I wanted from feed back on this schema. { _id: xxxxx, country: { name: "United States", currency: "USD", …
Devin Dixon
  • 11,553
  • 24
  • 86
  • 167
1
vote
1 answer

distinct selects in lithium

Using Lithiums Model, how do you achieve getting a distinct result set of specific fields from a collection in MongoDB? mongo query: db.blogs.distinct('url');
papacostas
  • 848
  • 1
  • 9
  • 24
1
vote
1 answer

ORM: List of related items

I tried to use ORM to find list of provinces and their cities. the result is same as this list: "provinces": [ { "name": "Prov.1", "Cities": { "name": "City.1" } }, { "name": "Prov.1", …
Ramin Firooz
  • 506
  • 8
  • 25
1
vote
1 answer

Auth in li3 framework check(~ always authenticating

I've pretty much straight lifted my code from http://li3.me/docs/manual/auth/simple-authentication.md in if($user = Auth::check('customer', $this->request)) { //whatever } I'm trying to get a simple Auth::check in Lithium to fail when no user…
Roon
  • 98
  • 7
1
vote
4 answers

Can't connect to mongoDB with lithium

I have uncomented mongodb connection in bootstrap/connections.php and everything seems to be ok but now I'm getting following error: ( ! ) Fatal error: Uncaught exception 'lithium\core\NetworkException' with message 'Could not connect to the…
Marius
  • 185
  • 11
1
vote
1 answer

How can I add handler to database query results in Lithium

I am using the Lithium framework version 1.1.1 in PHP 5.6 with MongoDB. I have updated MongoDB from 3.4 to 3.6 and this ended up requiring the PHP ini variable mongo.long_as_object be set to true for the aggregateCursor() methods to work properly in…
1
vote
1 answer

Versioning a PHP Lithium API

Goal I've been tasked with versioning a pretty large PHP Lithium API. The end result I'm looking for is to use namespacing to separate the versions. For example, normally a lithium route that looked like…
Jamie Butler
  • 235
  • 1
  • 2
  • 19
1
vote
1 answer

Lithium: How do I change the location Connections' and similar classes look for adapters

I've been trying to get Connections to use a customised adapter located at app/extensions/data/source/database/adapter/. I thought extending the Connections class and replacing protected static $_adapters = 'data.source'; with protected static…
Archer
  • 11
  • 3
1
vote
4 answers

Relationships with Lithium models

Can't find any documentation on relationships with Lithum models (using MongoDB). Could anyone point me to some info or show me an example?
Cobby
  • 5,273
  • 4
  • 28
  • 41
1
vote
1 answer

SUM function on multiple columns in Lithium ORM

I want something like this: $res = Model::find('all', array( 'fields' => array( 'SUM(col1)' => array( 'alias' => 'col1_total', ), 'SUM(col2)' => array( 'alias' =>…
Ramin Firooz
  • 506
  • 8
  • 25