Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor #2059

Merged
merged 160 commits into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
d8c8a81
changing travis to test refactor
alagroy-42 Aug 19, 2020
aa39d59
moving classes
alagroy-42 Aug 21, 2020
9cc8f1f
adding namespace Project + its classes and begginning the refactorisa…
alagroy-42 Aug 17, 2020
264269e
adding hasXXX + readXXX method refactorisation + moving findLayerByXX…
alagroy-42 Aug 17, 2020
9fd7e14
finishing refactor of getXXX methods
alagroy-42 Aug 18, 2020
a0276b8
adding the end of the context modification + deleting deprecated methods
alagroy-42 Aug 18, 2020
c3f48ae
adding documentation + deleting useless methods in qgisProject
alagroy-42 Aug 18, 2020
a5202d4
moving findEditionLayerByXX methods from project to configFile
alagroy-42 Aug 18, 2020
445a064
optimizing some method and making code a bit more clear
alagroy-42 Aug 18, 2020
6aa08a8
fixing Syntax/namespace errors
alagroy-42 Aug 19, 2020
db8bded
fixing a few changes
alagroy-42 Aug 19, 2020
ba9650f
fixes
alagroy-42 Aug 19, 2020
c3dc2c5
renaming classes in CamelCase + renaming configFile in projectConfig
alagroy-42 Aug 21, 2020
98eb3d1
moving xml method from config to qgisProject
alagroy-42 Aug 24, 2020
2c9f749
force typing some params
alagroy-42 Aug 24, 2020
078c8b6
fixing camelCase
alagroy-42 Aug 24, 2020
4fc85fb
reworked cache handling
alagroy-42 Aug 25, 2020
17a237c
embedded layers are now reloaded when they have been modified after t…
alagroy-42 Aug 25, 2020
19a41fb
camelCase fixes again
alagroy-42 Aug 25, 2020
747f026
moving UnknownLizmapProjectException to namespace LizmapProject + mar…
alagroy-42 Aug 25, 2020
21ed8d0
fixing problem with foreach braces + few changes
alagroy-42 Aug 25, 2020
55bd462
Merge pull request #1770 from alagroy-42/project-git-mv
laurentj Aug 25, 2020
d021d9a
modifying lizmapProject so that it contains a Project and calls the c…
alagroy-42 Aug 18, 2020
16d36c1
adding jelixContext singleton
alagroy-42 Aug 19, 2020
39393ac
modifying lizmapProject constructor + updating modules that uses it
alagroy-42 Aug 19, 2020
8fa553f
correcting bugs on lizmapProject and project + adding missing methods…
alagroy-42 Aug 19, 2020
17de2ea
fixing all browser errors
alagroy-42 Aug 20, 2020
cd3ec19
deleting all browser errors
alagroy-42 Aug 26, 2020
a74935e
fixing problem when data disappeared when page was refresh
alagroy-42 Aug 26, 2020
9d61256
adding missing methods
alagroy-42 Aug 27, 2020
1e3b383
adding QGIS projects for tests
alagroy-42 Sep 1, 2020
8f19eeb
adding cache and log method in AppContextInterface and JelixContext +…
alagroy-42 Aug 26, 2020
8d41bbb
modifying lizmapServices constructor
alagroy-42 Sep 7, 2020
7dd1694
adding missing methods + correct a few things
alagroy-42 Sep 7, 2020
32a7127
fixing bug with cache and XML Layers
alagroy-42 Sep 7, 2020
72663c7
Merge branch 'refactor' into lizmapProjectRefactor-no-conflicts
alagroy-42 Sep 8, 2020
6d468d8
Merge pull request #1780 from alagroy-42/lizmapProjectRefactor-no-con…
alagroy-42 Sep 8, 2020
e030ed0
adding construct tests
alagroy-42 Aug 27, 2020
2c93603
adding all the ProjectConfig tests
alagroy-42 Aug 27, 2020
de45c77
adding construct tests
alagroy-42 Aug 27, 2020
e002e7d
adding all the ProjectConfig tests
alagroy-42 Aug 27, 2020
2a61563
adding beggining of QgisProject tests
alagroy-42 Aug 28, 2020
df5bdc8
adadding readXXX methods tests
alagroy-42 Aug 31, 2020
9d3cfc2
adding new tests
alagroy-42 Aug 31, 2020
ecb7b26
fixing get XmlLayer2 bug
alagroy-42 Sep 1, 2020
373ec8f
adding readEdition/AttributeLayers tests
alagroy-42 Sep 1, 2020
c995122
adding setShortNames tests
alagroy-42 Sep 2, 2020
d289a7f
fixing an issue with recent ProjectConfig modifs
alagroy-42 Sep 8, 2020
1e1d730
adding missing jUrl methods missing in appContext
alagroy-42 Sep 8, 2020
0a22362
Merge pull request #1786 from alagroy-42/testProject
laurentj Sep 14, 2020
9db62c0
Merge pull request #1797 from alagroy-42/QgisProjectTests
laurentj Sep 14, 2020
51f1cfa
Merge pull request #1806 from alagroy-42/appContextjUrl
laurentj Sep 14, 2020
2f882e3
moving lizmapRepository to namespace Projec
alagroy-42 Sep 4, 2020
0eacb16
Merge pull request #1806 from alagroy-42/appContextjUrl
laurentj Sep 14, 2020
8b45abc
Merge branch 'refactor' of github.com:3liz/lizmap-web-client into ref…
alagroy-42 Sep 14, 2020
5e8ce31
fixing for conflicts
alagroy-42 Sep 14, 2020
15e76fb
Merge branch 'master' into refactor
alagroy-42 Sep 14, 2020
f6f6618
removing services and appContext from getProject/s methods
alagroy-42 Sep 15, 2020
fe3455f
Merge pull request #1800 from alagroy-42/repo-no-conflicts
laurentj Sep 15, 2020
880ec33
beginning of tests
alagroy-42 Sep 8, 2020
7f2f3cf
adding more tests
alagroy-42 Sep 10, 2020
a70c330
adding editionLayers tests
alagroy-42 Sep 11, 2020
46506d8
adding loginFiltered method tests
alagroy-42 Sep 14, 2020
23a00f8
adding Google tests
alagroy-42 Sep 14, 2020
d6f06ad
adding checkAcl tests
alagroy-42 Sep 14, 2020
4dcb086
small fixes due to rebase
alagroy-42 Sep 14, 2020
77d5e6b
correcting an absolute path to make tests work in Travis environment
alagroy-42 Sep 15, 2020
070ecb1
fixing broken tests again
alagroy-42 Sep 15, 2020
9f6fd02
fixing issues
alagroy-42 Sep 15, 2020
07576f6
Merge pull request #1814 from alagroy-42/ProjectTests
laurentj Sep 15, 2020
043cff9
Some cleanup into Repository
laurentj Sep 15, 2020
5bfc8bb
marking qgisProject as deprecated
alagroy-42 Sep 15, 2020
0a0c188
moving log classes to namespace LizmapLogger
alagroy-42 Sep 15, 2020
6493485
renaming new classes to be in accordance with PSR-4 and restoring old…
alagroy-42 Sep 15, 2020
98395ca
uncontextualizing classes from Jelix
alagroy-42 Sep 15, 2020
289e864
removing Listener from Logger namespace
alagroy-42 Sep 15, 2020
a859002
recontextualising Config tests + fixes
alagroy-42 Sep 16, 2020
0803cf0
adding Item tests
alagroy-42 Sep 16, 2020
c3247c8
moving item part ini handling in Config + some fixes
alagroy-42 Sep 17, 2020
a540416
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Sep 21, 2020
10240cd
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Sep 21, 2020
70cf38f
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Sep 22, 2020
8494e50
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Sep 25, 2020
5238c7c
moving qgisForm* classes to namespace LizmapForm
alagroy-42 Sep 28, 2020
70dcace
uncontextualizing Jelix in the classes
alagroy-42 Sep 28, 2020
da5a616
fixing test + jFormPlugin
alagroy-42 Sep 30, 2020
b90d406
Merge pull request #1840 from alagroy-42/editionRefactor
alagroy-42 Sep 30, 2020
febb0ea
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Sep 30, 2020
e2ea124
cs-fix to pass the linting GH Action
alagroy-42 Sep 30, 2020
6036cde
constructor docstring
alagroy-42 Sep 30, 2020
f80d0d4
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Oct 1, 2020
3ec13b4
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Oct 5, 2020
2f9c3e6
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Oct 7, 2020
188133c
fixing issues
alagroy-42 Oct 9, 2020
c68e9e9
adding JSON generation for Forms infos in QgisProject
alagroy-42 Sep 30, 2020
14da578
fixing broken QgisProjects tests + coding style for theses tests
alagroy-42 Sep 30, 2020
d171ede
fixing coding style
alagroy-42 Sep 30, 2020
17ae46b
modifying the API with namespace changes + modifying qgisForm/Control…
alagroy-42 Oct 1, 2020
a0cc73d
fixed geometry field not present in XML
alagroy-42 Oct 1, 2020
8ab4a2c
refactoring qgisForm to make it testable
alagroy-42 Oct 1, 2020
25f2f58
refactoring qgisFormControl to make it testable
alagroy-42 Oct 2, 2020
88d33f1
uncontextualizing json folder for tests
alagroy-42 Oct 5, 2020
550f5cf
Merge pull request #1822 from alagroy-42/logSystemRefactor
laurentj Oct 9, 2020
f2a6c39
Revert lizmapLogItem::update() as Item::update() does not exists
laurentj Oct 9, 2020
42435e7
Logger: little optimization and fix doc comments
laurentj Oct 9, 2020
0960148
correcting relative temp path for forms storage
alagroy-42 Oct 9, 2020
703d78c
Merge pull request #1866 from 3liz/fix-logger
laurentj Oct 9, 2020
9f63ee6
Merge branch 'FormJSONGeneration' into refactor
laurentj Oct 9, 2020
651ff30
Missing comment
laurentj Oct 9, 2020
bc36c12
Merge pull request #1844 from alagroy-42/qgisFormRefactor
laurentj Oct 9, 2020
cec8ea6
Merge remote-tracking branch 'alagroy/FormsRefactor' into refactor
laurentj Oct 9, 2020
4887074
Fix AppContextInterface::getLocale: should accept parameters
laurentj Oct 9, 2020
6c90add
Fix little issues and optimization
laurentj Oct 9, 2020
f275552
Fix some comments
laurentj Oct 9, 2020
19d04da
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Oct 12, 2020
d745331
uncontextualizing json folder for tests
alagroy-42 Oct 5, 2020
0bb4bf4
adding qgisForm tests
alagroy-42 Oct 6, 2020
e2c6d95
adding more tests
alagroy-42 Oct 7, 2020
cb743ef
fix lint
alagroy-42 Oct 12, 2020
2f1d10f
uncontextualizing json folder for tests
alagroy-42 Oct 5, 2020
2722a06
adding qgisForm tests
alagroy-42 Oct 6, 2020
2d83af5
adding qgisFormControl tests
alagroy-42 Oct 7, 2020
fc2c3dc
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Oct 13, 2020
6521832
fixed duplicated method and bad comment
alagroy-42 Oct 13, 2020
e865fc3
Merge pull request #1861 from alagroy-42/ControlTests
laurentj Oct 14, 2020
8171a03
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Oct 14, 2020
f8e44c4
Merge branch 'refactor' of github.com:3liz/lizmap-web-client into ref…
alagroy-42 Oct 14, 2020
281a157
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Nov 20, 2020
df57f2e
fixing broken tests after merge + lint
alagroy-42 Nov 24, 2020
96035dd
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Nov 24, 2020
ce27af2
moving Proxy/Request classes to new namespace
alagroy-42 Nov 30, 2020
bb4961e
Merge pull request #1946 from alagroy-42/git-mv-RequestProxy
laurentj Nov 30, 2020
0eaa058
changing namespaces in files
alagroy-42 Nov 30, 2020
15e393f
uncontextualizing Jelix and lizmapServices from Request classes
alagroy-42 Nov 27, 2020
a836852
moving getMap and build methods to more logic places
alagroy-42 Nov 27, 2020
0dcc8e1
documentation
alagroy-42 Nov 27, 2020
eb629cd
Merge pull request #1947 from alagroy-42/ProxyRequestRefactor
laurentj Dec 8, 2020
389967c
making Proxy class testable
alagroy-42 Nov 24, 2020
7ed3d22
refactoring all the Request classes
alagroy-42 Nov 26, 2020
ac8eab3
lint
alagroy-42 Nov 30, 2020
37af53d
Merge pull request #1948 from alagroy-42/Refacto-new-base
laurentj Dec 8, 2020
002f0a7
making Proxy class testable
alagroy-42 Nov 24, 2020
2808f68
refactoring all the Request classes
alagroy-42 Nov 26, 2020
ab89a3b
lint
alagroy-42 Nov 30, 2020
742c789
adding Proxy tests
alagroy-42 Dec 1, 2020
ec85ec2
adding WMTS tests
alagroy-42 Dec 1, 2020
c53365e
adding OGCRequest tests
alagroy-42 Dec 1, 2020
6e33350
adding WFS Tests
alagroy-42 Dec 2, 2020
9d9ca33
adding WMS tests
alagroy-42 Dec 3, 2020
1bf6d38
Merge pull request #1962 from alagroy-42/TestsProxyRequest
laurentj Dec 17, 2020
7a4f8dd
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Jan 12, 2021
952f025
lint + fix broken tests after merge
alagroy-42 Jan 12, 2021
0d16e78
Merge branch 'refactor' of github.com:3liz/lizmap-web-client into ref…
alagroy-42 Jan 12, 2021
9ebdefd
fix broken tests
alagroy-42 Jan 12, 2021
5538027
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Jan 12, 2021
7c84dc4
Merge branch 'master' of github.com:3liz/lizmap-web-client into refactor
alagroy-42 Jan 22, 2021
79853af
deleting unused qgis project files
alagroy-42 Jan 22, 2021
50d52fb
fix phpStan errors on refactor
alagroy-42 Jan 22, 2021
b273e70
lint
alagroy-42 Jan 22, 2021
9b4731b
fixing edition, project parsing and an error in admin pages
alagroy-42 Jan 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lizmap/modules/admin/controllers/maps.classic.php
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ public function removeSection()
public function removeCache()
{
$repository = $this->param('repository');
$repoKey = lizmapProxy::clearCache($repository);
$repoKey = \Lizmap\Request\Proxy::clearCache(lizmap::getRepository($repository));
if ($repoKey) {
jMessage::add(jLocale::get('admin~admin.cache.repository.removed', array($repoKey)));
}
Expand Down Expand Up @@ -595,7 +595,7 @@ public function removeLayerCache()
$lproj->clearCache();

// Remove the cache for the layer
lizmapProxy::clearLayerCache($repository, $project, $layer);
\Lizmap\Request\Proxy::clearLayerCache($repository, $project, $layer);

jMessage::add(jLocale::get('admin~admin.cache.layer.removed', array($layer)));

Expand Down
2 changes: 1 addition & 1 deletion lizmap/modules/admin/templates/maps.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<dd>
<table class="table">
{assign $section = 'repository:'.$repo->getKey()}
{assign $properties = $repo->getRepoProperties()}
{assign $properties = $repo->getProperties()}
{foreach $properties as $prop}
<tr>
{if $prop == 'path' && $rootRepositories != ''}
Expand Down
2 changes: 1 addition & 1 deletion lizmap/modules/dataviz/classes/datavizPlot.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ public function fetchData($method = 'wfs', $exp_filter = '')
$wfsparams['EXP_FILTER'] = $exp_filter;
}

$wfsrequest = new lizmapWFSRequest($this->lproj, $wfsparams);
$wfsrequest = new \Lizmap\Request\WFSRequest($this->lproj, $wfsparams, lizmap::getServices(), lizmap::getAppContext());
$wfsresponse = $wfsrequest->getfeature();
$features = null;

Expand Down
2 changes: 1 addition & 1 deletion lizmap/modules/dynamicLayers/controllers/map.classic.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function index()
$querystring = $url.$rparams;

// Get remote data
list($data, $mime, $code) = lizmapProxy::getRemoteData($querystring);
list($data, $mime, $code) = \Lizmap\Request\Proxy::getRemoteData($querystring);

// Get returned response and redirect to appropriate project page
$json = json_decode($data);
Expand Down
36 changes: 30 additions & 6 deletions lizmap/modules/lizmap/classes/lizmap.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
*
* @license Mozilla Public License : http://www.mozilla.org/MPL/
*/

use Lizmap\Logger as Log;

/**
* @deprecated
*/
class UnknownLizmapProjectException extends Exception
{
}
Expand All @@ -29,12 +35,21 @@ class lizmap
*/
protected static $repositoryInstances = array();

// lizmapServices instance
/**
* @var lizmapServices The lizmapServices instance for the singleton
*/
protected static $lizmapServicesInstance = null;

// lizmapLogConfigInstance
/**
* @var lizmapLogConfig The lizmapLogConfig instance for the singleton
*/
protected static $lizmapLogConfigInstance = null;

/**
* @var lizmapJelixContext The jelixContext instance for the singleton
*/
protected static $appContext = null;

/**
* this is a static class, so private constructor.
*/
Expand All @@ -52,12 +67,21 @@ public static function getServices()
$globalConfig = jApp::config();
$ldapEnabled = jApp::isModuleEnabled('ldapdao');
$varPath = jApp::varPath();
self::$lizmapServicesInstance = new lizmapServices($lizmapConfigTab, $globalConfig, $ldapEnabled, $varPath);
self::$lizmapServicesInstance = new lizmapServices($lizmapConfigTab, $globalConfig, $ldapEnabled, $varPath, self::getAppContext());
}

return self::$lizmapServicesInstance;
}

public static function getAppContext()
{
if (!self::$appContext) {
self::$appContext = new \Lizmap\App\JelixContext();
}

return self::$appContext;
}

public static function saveServices()
{
$ini = new jIniFileModifier(jApp::configPath('lizmapConfig.ini.php'));
Expand Down Expand Up @@ -149,7 +173,7 @@ public static function constructRepositoryForm($rep, $form)
}

// reconstruct form fields based on repositoryPropertyList
$propertiesOptions = lizmapRepository::getPropertiesOptions();
$propertiesOptions = lizmapRepository::getRepoProperties();

foreach (lizmapRepository::getProperties() as $k) {
$ctrl = null;
Expand Down Expand Up @@ -359,7 +383,7 @@ public static function getLogConfig()
{
if (!self::$lizmapLogConfigInstance) {
$readConfigPath = parse_ini_file(jApp::varPath().self::$lizmapLogConfig, true);
self::$lizmapLogConfigInstance = new lizmapLogConfig($readConfigPath);
self::$lizmapLogConfigInstance = new Log\Config($readConfigPath, self::getAppContext(), jApp::configPath('lizmapLogConfig.ini.php'));
}

return self::$lizmapLogConfigInstance;
Expand All @@ -372,7 +396,7 @@ public static function getLogConfig()
*/
public static function getLogItemProperties()
{
return lizmapLogItem::getSProperties();
return Log\Item::getSProperties();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lizmap/modules/lizmap/classes/lizmapLog.listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function addLog($key, $data)

// user who modified the line
if (!array_key_exists('user', $data)) {
$juser = jAuth::getUserSession();
$juser = \jAuth::getUserSession();
$data['user'] = $juser->login;
}

Expand Down
99 changes: 19 additions & 80 deletions lizmap/modules/lizmap/classes/lizmapLogConfig.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,59 +9,39 @@
*
* @license Mozilla Public License : http://www.mozilla.org/MPL/
*/
class lizmapLogConfig
{
// Lizmap log configuration data
private $data = array();

// general properties
private $properties = array(
'active',
'profile',
);

// list of the logItems of the ini file
protected $logItems = array();
// If the log is active globally or not
private $active = '';
use Lizmap\Logger as Log;

// database profile
private $profile = '';
/**
* @deprecated
*/
class lizmapLogConfig
{
/**
* @var Log\Config;
*/
protected $config;

public function __construct($readConfigPath)
public function __construct($readConfigPath, $appContext, $iniFile)
{
$this->data = $readConfigPath;

// set generic parameters
foreach ($this->properties as $prop) {
if (isset($readConfigPath['general'][$prop])) {
$this->{$prop} = $readConfigPath['general'][$prop];
}
}
$this->config = new Log\Config($readConfigPath, $appContext, $iniFile);
}

public function getProperties()
{
return $this->properties;
return $this->config->getProperties();
}

/**
* Get a log item.
*
* @param string $key Key of the log item to get
*
* @return lizmapLogItem
* @return lizmapLogItem|Log\Item
*/
public function getLogItem($key)
{
if (!key_exists($key, $this->logItems)) {
if (!key_exists('item:'.$key, $this->data)) {
return null;
}
$this->logItems[$key] = new lizmapLogItem($key, $this->data['item:'.$key]);
}

return $this->logItems[$key];
return $this->config->getLogItem($key);
}

/**
Expand All @@ -71,16 +51,7 @@ public function getLogItem($key)
*/
public function getLogItemList()
{
$logItemList = array();

foreach ($this->data as $section => $data) {
$match = preg_match('#(^item:)#', $section, $matches);
if (isset($matches[0])) {
$logItemList[] = str_replace($matches[0], '', $section);
}
}

return $logItemList;
return $this->config->getLogItemList();
}

/**
Expand All @@ -90,19 +61,7 @@ public function getLogItemList()
*/
public function modify($data)
{
$modified = false;
if (!$data) {
return $modified;
}
foreach ($data as $k => $v) {
if (in_array($k, $this->properties)) {
$this->data['general'][$k] = $v;
$this->{$k} = $v;
$modified = true;
}
}

return $modified;
return $this->config->modify($data);
}

/**
Expand All @@ -113,12 +72,7 @@ public function modify($data)
*/
public function update($data, $ini = null)
{
$modified = $this->modify($data);
if ($modified) {
$modified = $this->save($ini);
}

return $modified;
return $this->config->update($data, $ini);
}

/**
Expand All @@ -128,21 +82,6 @@ public function update($data, $ini = null)
*/
public function save($ini = null)
{
if (!$ini) {
$iniFile = jApp::configPath('lizmapLogConfig.ini.php');
$ini = new jIniFileModifier($iniFile);
}
foreach ($this->properties as $prop) {
if ($this->{$prop} !== '' && $this->{$prop} !== null) {
$ini->setValue($prop, $this->{$prop}, 'general');
} else {
$ini->removeValue($prop, 'general');
}
}

// Save the ini file
$ini->save();

return $ini->isModified();
return $this->config->save($ini);
}
}