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 submit POST for cURL in Lithium

I'm trying to create a custom Auth adapter for a legacy API. Let's call the adapter TR42. Right now, I'm debugging TR42::check() so I'm using hardcoded values:
Housni
  • 963
  • 1
  • 10
  • 23
1
vote
2 answers

How to define custom handler for Lithium layout

I'm looking to define my own custom handler in the layout view, much like $this->title() or $this->scripts() so that I can render content in the layout that is supplied by the view. To be precise, I'd like to display the date of a newspaper edition…
1
vote
1 answer

Trouble replicating wordpress taxonomy table query

I'm trying to forgo some wordpress overhead and query the databases directly using lithium model relationships. Here's the query I'm replicating: SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER…
Eric C
  • 971
  • 6
  • 14
1
vote
1 answer

Using MongoDB upsert in Lithium

I'm having a bit of a problem performing an upsert in Lithium with MongoDB. The update works fine but it won't do the insert. My code is: Feeds::update( array('data' => array('user_id' => array('$addToSet' => $user["_id"])…
Dawson Goodell
  • 418
  • 2
  • 5
  • 15
1
vote
2 answers

rewrite rule for shop in lithium / apache

I have a lithium installation and all the .htaccess works fine. I need to install OpenCart as a shopping cart in app/webroot/shop I copied all the files and also changed the .htaccess file in the root folder of lithium installation as
Nilam Doctor
  • 491
  • 7
  • 18
1
vote
0 answers

lithium insert entity array into model object property

The following coding sample doesn't work. $joiner = new Entity(); $joiner->name = $post['name']; $joiner->address = $post['address']; $meeting = Meeting::first($_id); $meeting->joiner[] = $joiner; $meeting->save(); I hope each time when the form…
guosheng1987
  • 107
  • 1
  • 7
1
vote
1 answer

Connecting to MongoDB using Lithium li3 Framework

I am writing a relatively simple app in the Lithium (li3) Framework. I am using MongoDB as the datastore. My MongoDB database is hosted in the cloud - at MongoHQ. I am getting intermittent errors when trying to post data. At times it will work -…
NinoCodes
  • 35
  • 1
  • 4
1
vote
2 answers

mongodb query to lithium command

db.users.aggregate( {$match : {"_id" : ObjectId("50f69176904e1d66affec20d")} }, {$unwind : "$connections"}, {$match : {$or : [ {"connections.users" : {$exists : false}}, …
ArunKolhapur
  • 5,805
  • 4
  • 18
  • 31
1
vote
1 answer

Mongo Query in Lithium

db.tickers.aggregate( { $project: {_id: 0, year: {$year: '$date'}, month: {$month: '$date'}, day: {$dayOfMonth: '$date'}, hour: {$hour: '$date'}, avg: '$ticker.avg' } }, { $group: { _id: { year: '$year',…
Nilam Doctor
  • 491
  • 7
  • 18
1
vote
0 answers

User hasMany Posts - Lithium MongoDB relationship

I'm just trying out the simplest of the examples for hasMany relations where User hasMany Posts. A user_id is hardwired in view code when saving posts for testing. Questions: Are relationships supported for Lithium 0.11 release for document…
Nilesh Kale
  • 233
  • 1
  • 4
  • 12
1
vote
2 answers

Closing PHP tag in Lithium

As you know most PHP sources deprecated inserting closing tag, but I wonder why in Lithium documentation, it is encouraged to include a closing PHP tag? Is there any rational reason for that? Beside that there is some other obsolete style in its…
Handsome Nerd
  • 17,114
  • 22
  • 95
  • 173
1
vote
1 answer

Backbone Model fetched from Lithium controller is not loaded properly in bb Model

I'm using backbone.js and Lithium. I'm fetching a model from the server by passing in a _id that is received as a hidden parameter on the page. The database MongoDB has stored the data correctly and can be viewed from console as: { "_id" :…
Nilesh Kale
  • 233
  • 1
  • 4
  • 12
1
vote
3 answers

Lithium framework multiple 'or' statements in a query (using mongoDB)

I have started work with lithium framework + mongoDB recently. I want to do a really simple query which contains multiple or statements. I have articles in the DB with publish_up and publish_down fields. I want to fetch only those records/documents…
1
vote
1 answer

Lithium: find list with condition not in a array

I am trying to use the find for a list having fields = name and the field "number" NOT in a list of array $importedVolumes. $importedVolumes = array('22','38'); Volumes::find('list', array( "fields"=>"name", …
Nilam Doctor
  • 491
  • 7
  • 18
1
vote
2 answers

Get Distinct records from MongoDB using lithium

I want to find distinct records from a collected "pages". I tried: $Volume_numbers = Pages::find(array('fields'=>'DISTINCT volume_number')); I also tried: $params = array('conditions'=>array( 'distinct' => 'pages', 'key' =>…
Nilam Doctor
  • 491
  • 7
  • 18