
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
00f100/fcphp-datasource-mysql
Advanced tools
Class to manipulate Datasource MySQL
Composer:
$ composer require 00f100/fcphp-datasource-mysql
or add in composer.json
{
"require": {
"00f100/fcphp-datasource-mysql": "*"
}
}
use FcPhp\Di\Facades\DiFacade;
use FcPhp\Datasource\Factory;
use FcPhp\Datasource\Strategy;
use FcPhp\Datasource\Interfaces\ICriteria;
use FcPhp\Datasource\MySQL\MySQL;
// MySQL Instance
$dataConnection = [
'host' => '',
'port' => '',
'username' => '',
'password' => '',
'database' => '',
];
$instance = new MySQL('mysql', $dataConnection);
// to Query Instance ...
$strategies = [
'mysql' => 'FcPhp/Datasource/MySQL/Strategies/MySQLStrategy',
];
$criterias = [
'mysql' => 'FcPhp/Datasource/MySQL/Criterias/MySQL',
];
$di = DiFacade::getInstance();
$factory = new Factory($strategies, $criterias, $di);
$strategy = new Strategy('mysql', $factory);
$query = new Query($strategy);
// Configure query
// SELECT t.field
// FROM table AS t
// LEFT JOIN table AS t2 ON t2.field = t.field AND t2.field = "string"
// WHERE (
// (
// campo = 500 AND
// campo2 = 500 AND (
// field = "value" OR
// field2 < "value2"
// ) AND
// campo3 = "abc" AND
// campo3 = "abc" AND (
// field = "value" OR
// field2 < "value123122"
// ) AND
// campo3 IN (10,20,30)
// )
// )
$query->select('t.field')
->from('table', 't')
->join('LEFT', ['t2' => 'table'], function(ICriteria $criteria) {
$criteria->condition('t2.field', '=', 't.field', true);
$criteria->condition('t2.field', '=', 'string');
})
->where(function(ICriteria $criteria) {
$criteria->and(function(ICriteria $criteria) {
$criteria->condition('campo', '=', 500);
$criteria->condition('campo2', '=', 500);
$criteria->or(function(ICriteria $criteria) {
$criteria->condition('field', '=', 'value');
$criteria->condition('field2', '<', 'value2');
});
$criteria->condition('campo3', '=', 'abc');
$criteria->condition('campo3', '=', 'abc');
$criteria->or(function(ICriteria $criteria) {
$criteria->condition('field', '=', 'value');
$criteria->condition('field2', '<', 'value123122');
});
$criteria->condition('campo3', 'IN', [10, 20, 30]);
});
});
// Configure query
// INSERT INTO
// (column1,column2,column3) VALUES
// (100,"content2",0)
// ON DUPLICATE KEY UPDATE
// `column1` = 50,
// `column2` = "content to update",
// `column3` = 1
$query->insert()
->columns(['column1', 'column2', 'column3'])
->values('column2', 'content2')
->values('column3', false)
->values('column1', 100)
->duplicateKey([
'column1' => 50,
'column2' => 'content to update',
'column3' => true
]);
// Execute Query
$data = $instance->execute($query);
See:
FAQs
Package to manipulate datasource MySQL
We found that 00f100/fcphp-datasource-mysql demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.