mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
0bc0a09bf4
- application/extensions file system permission now is 775 - application/logs file system permission now is 775 - Added extensions directory in application/: config, controllers, helpers, hooks, libraries, models, views and widgets - Added view views/extensions/manage.php - Added controller controllers/system/extensions/Manager.php - Added library ExtensionsLib to manage extensions - Added model models/system/Extensions_model.php - Moved code related to print out info from MigrationLib to EPrintfLib
57 lines
1.2 KiB
PHP
57 lines
1.2 KiB
PHP
<?php
|
|
|
|
class Extensions_model extends DB_Model
|
|
{
|
|
/**
|
|
* Constructor
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->dbTable = 'system.tbl_extensions';
|
|
$this->pk = 'extension_id';
|
|
}
|
|
|
|
/**
|
|
* getDependencies
|
|
*/
|
|
public function getDependencies($dependencies)
|
|
{
|
|
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
|
|
|
return $this->execQuery(
|
|
'SELECT *
|
|
FROM '.$this->dbTable.'
|
|
WHERE enabled = TRUE
|
|
AND name IN ?',
|
|
array('name' => $dependencies)
|
|
);
|
|
}
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public function getInstalledExtensions()
|
|
{
|
|
$query = 'SELECT extension_id, e1.name, e1.version, description, license, url, core_version, dependencies, enabled
|
|
FROM system.tbl_extensions e1
|
|
INNER JOIN (
|
|
SELECT name, MAX(version) AS version
|
|
FROM system.tbl_extensions
|
|
GROUP BY name) e2
|
|
ON (e1.name = e2.name AND e1.version = e2.version)';
|
|
|
|
return $this->execQuery($query);
|
|
}
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public function executeQuery($sql)
|
|
{
|
|
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
|
|
|
return $this->execQuery($sql);
|
|
}
|
|
}
|