Removed deprecated methods from Factory.

All classes that use this have been changed.
This commit is contained in:
Abel Hoogeveen 2016-06-02 20:12:22 +02:00
parent da1752dd5f
commit ae94dca984
14 changed files with 14 additions and 154 deletions

View File

@ -83,7 +83,7 @@ class FW_DB_Cache {
{
// Assign the main CI object to $this->CI and load the file helper since we use it a lot
$this->factory = Factory::getInstance();
$this->factory->getHelpers()->load('file');
$this->factory->helpers->load('file');
$this->check_path();
}

View File

@ -304,7 +304,7 @@ abstract class FW_DB_utility {
extract($params);
// Load the xml helper
$this->factory->getHelpers()->load('xml');
$this->factory->helpers->load('xml');
// Generate the result
$xml = '<'.$root.'>'.$newline;

View File

@ -340,7 +340,7 @@ if ( ! function_exists('get_mime_by_extension'))
if ( ! is_array($mimes))
{
$factory = FuzeWorks\Factory::getInstance();
$mimes = $factory->getConfig()->get('mimes')->toArray();
$mimes = $factory->config->get('mimes')->toArray();
if (empty($mimes))
{

View File

@ -72,9 +72,9 @@ class FW_Cache_file extends FW_Driver {
$this->factory = Factory::getInstance();
// Load the required helpers
$this->factory->getHelpers()->load('file');
$this->factory->helpers->load('file');
$path = $this->factory->getConfig()->get('cache')->cache_file_path;
$path = $this->factory->config->get('cache')->cache_file_path;
$this->_cache_path = ($path === '') ? 'Application'.DS.'Cache/' : $path;
}

View File

@ -461,7 +461,7 @@ class FW_Zip {
$filename .= '.zip';
}
$this->factory->getHelpers()->load('download');
$this->factory->helpers->load('download');
$get_zip = $this->get_zip();
$zip_content =& $get_zip;

View File

@ -135,7 +135,7 @@ class Config
{
self::$factory = Factory::getInstance();
}
$config = self::$factory->getConfig();
$config = self::$factory->config;
return $config->getConfig($configName);
}

View File

@ -297,144 +297,4 @@ class Factory
{
unset($this->instances[ucfirst($objectName)]);
}
/* --------------------------------- Compatibility classes --------------------------------- */
/**
* @deprecated
*/
public function getConfig()
{
return $this->instances['Config'];
}
/**
* @deprecated
*/
public function getCore()
{
return $this->instances['Core'];
}
/**
* @deprecated
*/
public function getDatabase()
{
return $this->instances['Database'];
}
/**
* @deprecated
*/
public function getEvents()
{
return $this->instances['Events'];
}
/**
* @deprecated
*/
public function getHelpers()
{
return $this->instances['Helpers'];
}
/**
* @deprecated
*/
public function getInput()
{
return $this->instances['Input'];
}
/**
* @deprecated
*/
public function getLanguage()
{
return $this->instances['Language'];
}
/**
* @deprecated
*/
public function getLayout()
{
return $this->instances['Layout'];
}
/**
* @deprecated
*/
public function getLibraries()
{
return $this->instances['Config'];
}
/**
* @deprecated
*/
public function getLogger()
{
return $this->instances['Logger'];
}
/**
* @deprecated
*/
public function getModels()
{
return $this->instances['Models'];
}
/**
* @deprecated
*/
public function getModules()
{
return $this->instances['Modules'];
}
/**
* @deprecated
*/
public function getOutput()
{
return $this->instances['Output'];
}
/**
* @deprecated
*/
public function getRouter()
{
return $this->instances['Router'];
}
/**
* @deprecated
*/
public function getSecurity()
{
return $this->instances['Security'];
}
/**
* @deprecated
*/
public function getUri()
{
return $this->instances['URI'];
}
/**
* @deprecated
*/
public function getUtf8()
{
return $this->instances['Utf8'];
}
}

View File

@ -44,7 +44,7 @@ class configTest extends CoreTestAbstract
public function setUp()
{
$factory = Factory::getInstance();
$this->config = $factory->getConfig();
$this->config = $factory->config;
}
public function testGetConfigClass()

View File

@ -160,7 +160,7 @@ class factoryTest extends CoreTestAbstract
// And test when changing one classInstance
$factory->newInstance('Layout');
$this->assertNotSame($factory->getLayout(), $factory2->getLayout());
$this->assertNotSame($factory->layout, $factory2->layout);
}
public function tearDown()

View File

@ -45,7 +45,7 @@ class helperTest extends CoreTestAbstract
public function setUp()
{
$factory = Factory::getInstance();
$this->helpers = $factory->getHelpers();
$this->helpers = $factory->helpers;
}
public function testGetHelpersClass()

View File

@ -50,7 +50,7 @@ class arrayHelperTest extends CoreTestAbstract
public function setUp()
{
// Load Helper
Factory::getInstance()->getHelpers()->load('array');
Factory::getInstance()->helpers->load('array');
}
// ------------------------------------------------------------------------

View File

@ -42,7 +42,7 @@ class commonHelperTest extends CoreTestAbstract
public function setUp()
{
// Load Helper
Factory::getInstance()->getHelpers()->load('common');
Factory::getInstance()->helpers->load('common');
}
public function test_stringify_attributes()

View File

@ -42,7 +42,7 @@ class fileHelperTest extends CoreTestAbstract
public function setUp()
{
// Load Helper
Factory::getInstance()->getHelpers()->load('file');
Factory::getInstance()->helpers->load('file');
vfsStreamWrapper::register();
vfsStreamWrapper::setRoot(new vfsStreamDirectory('testDir'));

View File

@ -42,7 +42,7 @@ class xmlHelperTest extends CoreTestAbstract
public function setUp()
{
// Load Helper
Factory::getInstance()->getHelpers()->load('xml');
Factory::getInstance()->helpers->load('xml');
}
public function test_xml_convert()