[eluser]carmencito[/eluser]
In 1.7, the
script function has been removed.
This lines of codes were removed from the system/libraries/Loader.php
Code:
/**
* Load Script
*
* This function loads the specified include file from the
* application/scripts/ folder.
*
* NOTE: This feature has been deprecated but it will remain available
* for legacy users.
*
* @access public
* @param array
* @return void
*/
function script($scripts = array())
{
if ( ! is_array($scripts))
{
$scripts = array($scripts);
}
foreach ($scripts as $script)
{
$script = strtolower(str_replace(EXT, '', $script));
if (isset($this->_ci_scripts[$script]))
{
continue;
}
if ( ! file_exists(APPPATH.'scripts/'.$script.EXT))
{
show_error('Unable to load the requested script: scripts/'.$script.EXT);
}
include_once(APPPATH.'scripts/'.$script.EXT);
}
log_message('debug', 'Scripts loaded: '.implode(', ', $scripts));
}
You can try to extend the native CodeIgniter
Loader library file to use the deprecated
script function. Try this.
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Loader extends CI_Loader {
var $_ci_scripts = array();
// --------------------------------------------------------------------
/**
* Load Script
*
* This function loads the specified include file from the
* application/scripts/ folder.
*
* NOTE: This feature has been deprecated but it will remain available
* for legacy users.
*
* @access public
* @param array
* @return void
*/
function script($scripts = array())
{
if ( ! is_array($scripts))
{
$scripts = array($scripts);
}
foreach ($scripts as $script)
{
$script = strtolower(str_replace(EXT, '', $script));
if (isset($this->_ci_scripts[$script]))
{
continue;
}
if ( ! file_exists(APPPATH.'scripts/'.$script.EXT))
{
show_error('Unable to load the requested script: scripts/'.$script.EXT);
}
include_once(APPPATH.'scripts/'.$script.EXT);
}
log_message('debug', 'Scripts loaded: '.implode(', ', $scripts));
}
}
...save the code as
MY_Loader.php and place it inside
system/application/libraries/ directory. The prefix
MY_ depends on whether you change the config value for subclass_prefix in config.php
Code:
$config['subclass_prefix'] = 'MY_';