This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* List of independent countries originaly found at: https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes | |
* date of creation 06 dec 2021 | |
*/ | |
return [ | |
"AF" => "Afghanistan", | |
"AL" => "Albania", | |
"DZ" => "Algeria", | |
"AD" => "Andorra", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use Illuminate\Support\Facades\File; | |
class extractTranslationStrings extends Command | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
*Since Lithium uses PDO, you can just get the PDO object and call the beginTransaction() method. | |
*/ | |
$foo = app\models\Foo::create(); | |
$pdo = Connections::get('default')->connection; | |
$pdo->beginTransaction(); | |
$foo->bar = 'Hello'; | |
$foo->save(); | |
$pdo->commit(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! ) Notice: Use of undefined constant type - assumed 'type' in /Applications/mampstack-5.4.17-0/apache2/htdocs/libraries/lithium/analysis/Inspector.php on line 543 | |
Call Stack | |
# Time Memory Function Location | |
1 0.0000 239680 {main}( ) ../index.php:0 | |
2 0.0093 1652672 lithium\action\Dispatcher::run( ) ../index.php:41 | |
3 0.0094 1654448 lithium\core\StaticObject::_filter( ) ../Dispatcher.php:155 | |
4 0.0094 1657264 lithium\util\collection\Filters::run( ) ../StaticObject.php:147 | |
5 0.0094 1660208 lithium\core\Libraries::{closure:/Applications/mampstack-5.4.17-0/apache2/htdocs/libraries/li3_docs/config/bootstrap.php:26-38}( ) ../Filters.php:184 | |
6 0.0097 1690304 lithium\util\collection\Filters->next( ) ../bootstrap.php:32 | |
7 0.0097 1690464 {closure:/Applications/mampstack-5.4.17-0/apache2/htdocs/app/config/bootstrap/action.php:41-52}( ) ../Filters.php:203 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.get('/lobby/:id', function(req, res) { | |
db.games.find( { name: req.params.id }, function(err, game) { | |
if (err) { | |
console.log('error'); | |
return res.render('404', { | |
title: 'Game not found', | |
message: 'Game ' + req.params.id + 'not found' | |
}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$result = Model::find('all', array( | |
'conditions' => array( | |
'$or' => array( | |
array('hierarchy' => $p->_id), | |
array('_id' => (string)$c->_id) | |
) | |
), | |
'fields' => array('_id', 'title'), | |
)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use lithium\net\http\Media; | |
Media::type('default', null, array( | |
'view' => 'lithium\template\View', | |
'paths' => array( | |
'layout' => array( | |
'{:library}/views/layouts/{:layout}.{:type}.php', | |
LITHIUM_APP_PATH.'/views/layouts/{:layout}.{:type}.php' | |
), | |
'template' => '{:library}/views/{:controller}/{:template}.{:type}.php', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use lithium\action\Dispatcher; | |
//Allow admin continuation routes to be made. | |
Dispatcher::config( | |
array( | |
'rules' => array( | |
'admin' => array('action' => 'admin_{:action}') | |
) | |
) | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\controllers; | |
use \app\models\Taxonomies; | |
use MongoId; | |
class CategoriesController extends \lithium\action\Controller { | |
/** | |
* @var Protected $_type - protected variable which define type of taxonomy, | |
* Can be omited if there is no need for additional types of taxonomy. |