piotr-cz / cockpit-sql-driver Goto Github PK
View Code? Open in Web Editor NEWSQL Driver for Cockpit CMS
License: MIT License
SQL Driver for Cockpit CMS
License: MIT License
https://github.com/piotr-cz/cockpit-sql-driver/blob/master/LICENSE#L3
https://piocz.cz
should be https://piotr.cz
Which has been added in Cockpit v0.9.3 here.
At this moment it's used only for moving collection entries to trash.
Hey, there is a "," missing in your config.php example. After "localhost".
Tables are created on the fly and this can mess things up.
Simple test:
$this->on('cockpit.bootstrap', function() {
$test = $this->storage->getKey('test', 'test', []);
});
Now my database has a new table named "test".
Another test with an existing table:
$this->on('cockpit.bootstrap', function() {
$test = $this->storage->getKey('wp_users', 'test', []);
});
result:
PDOException while running query
SELECT
"document"
FROM
`wp_users`
WHERE JSON_UNQUOTE(JSON_EXTRACT(`document`, '$.\"key\"')) = 'test'
LIMIT 1
The current behaviour makes it impossible to use the same database with a different application or with custom tables in it.
If I could prefix all cockpit tables with e. g. cp_
, I could still create a ton of useles tables on the fly with a typo in my storage request, but it wouldn't hurt much.
I'm not sure, if it was intentional, but the default bootstrap priority should be very high (e. g. 9999) to change the driver with the highest priority.
A simple test in addons/test/bootstrap.php
:
// default priority 0
$this->on('cockpit.bootstrap', function() {
$test = $this->storage->getKey('cockpit/options', 'multiplane', []);
var_dump($test); // array(0) { }
});
// priority 10
$this->on('cockpit.bootstrap', function() {
$test = $this->storage->getKey('cockpit/options', 'multiplane', []);
var_dump($test); // Call to a member function findOne() on null
}, 10);
If I set 'bootstrapPriority' => 9999
in the database options, the event with prio 10 works.
Hello i want to use cockpit with mysql database ,
How to install it ,
i have tryed it already buy its shown error ,
show please make a video on this in core cokpit .
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.