How to extending CI3 $this->db - mysql

I'm building a codeigniter 3(.1.9 older version) apps using mysql, I need to extend / override codeigniter $this->db,
so if myapps using
$this->db->insert
$this->db->update
$this->db->replace and
$this->db->delete
there will be a log in a file for CRUD actions.

You cannot Change/Modify/Replace Database classes.
According to CodeIgniter Official Documentation
"The Database classes can not be extended or replaced with your own classes. All other classes are able to be replaced/extended."
You can check the Official Documentation here.

Related

RequestContext udpate via PrimeFaces Selector (PFS)

Is it possible to update components via RequestContext with PFS? I have tried RequestContext.getCurrentContext().update("#(.some-class)"); but seems it does nothing (PF v6.0.18).
NO you cannot do that from the server side. From this announcement: https://www.primefaces.org/search-expression-framework/
NOTE:
Client side expressions are also NOT safe as server side expressions.
You could have a look at OmniFaces. It includes component utils which include methods to simplify searching them (compared to using the JSF spec API). It might help you to (more easily) find the components you need to update.

How to use flash() with session in cakephp 3.3

I'm beginner in programming, i use cakephp 3.3 version and i want to understand how to activate session and use in controller and how to send flash message like this:$this->session->flash('items was updated'). What line have to add to activate session and where, how to use correctly? Thanks!
https://www.google.co.nz/url?q=http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html&sa=U&ved=0ahUKEwj8soeQ6N7QAhWGzbwKHTXsCuQQFggLMAA&sig2=Yi_7YH9XKwQ3sZvzd0kpeA&usg=AFQjCNGz10_vrov2Lw7bCkB5sgc2b8asOA
have a look on here
have you used setFlash in the controller and are you using the default layout??
have you also followed the blog tutorial i think that went over using flash messages ands its a great tutorial

Laravel Equivalent of passing variables to functions in codeigniter

I am using CodeIgniter from 2 years and i am trying to move to Laravel and I saw many tutorials of how to use Laravel but i couldn't find any answers to how to pass variables to functions using the URL and without using routes like in CodeIgniter if i called this link
site.com/users/edit/12.
I would be calling the users controller , the edit function and passing a variable of value 12
how can i do the same in Laravel without using routes for every single function or using query strings which will make the URL ugly?
Here is an example.Hope that it will be helpful.......
route.php
Route::controller('users','UsersController');
UsersController.php
class UsersController extends BaseController
{
public function getEdit($value)
{
echo $value;
}
}
url
site.com/users/edit/12
output
12
In Laravel - 3 you may do it using something like this:
Route::controller(Controller::detect());
But in later versions it's not available and you should explicitly declare the routes. Actually it's better to declare routes explicitly and this approach has many benefits too. This is a common problem that happens to developers who migrates from CodeIgniter but later they get motivated and if you use this you'll love this for sure.
You may read this article by Phil Sturgeon who was the man behind the CodeIgniter framework, he discussed about it's down sides of this (automatic routing).
If you are using Laravel - 4 then check the Controllers Manual, specially check out the RESTful and Resourceful controllers section, it may attract you but be familiar with explicit route declaration first.

Silex symfony ACL without ORM

Is there any way to implement ACL using Silex, but without Doctrine ORM?
Using entities we can handle this like this
$oidd = new Symfony\Component\Security\Acl\Domain\ObjectIdentity::fromDomainObject($message(\);
$acl = $app['security.acl.provider']->createAcl($oidd);
// the current user is the owner
$sid = Symfony\Component\Security\Acl\Domain\UserSecurityIdentity::fromAccount($currentUser);
$acl->insertObjectAce($sid, Symfony\Component\Security\Acl\Permission\MaskBuilder::MASK_OWNER);
Any solutions?
You might want to have a look at this example project.
https://github.com/davedevelopment/silex-acl-demo
The relevant bootstrap code is here (and works for me with Silex 1.2):
https://github.com/davedevelopment/silex-acl-demo/blob/master/app/bootstrap.php#L59
From the README:
This is a demo of Symfony's ACL using Silex. I've tried
to annotate the services in app/bootstrap.php, but to be honest, I
originally reverse engineered the symfony full stack frameworks DI
configuration without fully understanding what everything does, still
don't!

MVC4, SimpleMembershipProvider, MySql and FluentNhibernate

I am trying to use SimpleMembership with MySql and I cant get it to work.
I downloaded the latest devart connector for MySql and followed the instructions on
http://www.devart.com/dotconnect/mysql/articles/extendedmembership-tutorial.html
The problem is that the WebSecurity class provided by devart, only has the InitializeDatabaseConnection method but it misses the rest of the methods WebMatrix.WebData has. (i.e UserExists(), CreateAccount(), etc )
Does anyone knows any implementation of WebSecurity alternative to WebMatrix.WebData?
We have implemented the InitializeDatabaseConnection method in the Devart.Common.Web.WebSecurity class because there was no way to override the corresponding method of the WebMatrix.WebData.WebSecurity class.
Other methods of the WebMatrix.WebData.WebSecurity class are supported in our implementation and can be used with Devart's SimpleMembership provider.