diff --git a/application/classes/Controller/Admin/Module.php b/application/classes/Controller/Admin/Module.php index b3361648..566ff9ba 100644 --- a/application/classes/Controller/Admin/Module.php +++ b/application/classes/Controller/Admin/Module.php @@ -29,7 +29,7 @@ class Controller_Admin_Module extends Controller_TemplateDefault_Admin { array_unshift($classes,''); foreach ($classes as $c) { - $cn = sprintf($ch,$c ? ucfirst($c).'_'.ucfirst($class) : $class); + $cn = Kohana::classname('Controller_'.$c ? $c.'_'.$class : $class); if (class_exists($cn)) { $r = new ReflectionClass($cn); diff --git a/modules/adsl/classes/Model/Product/Plugin/ADSL.php b/modules/adsl/classes/Model/Product/Plugin/Adsl.php similarity index 96% rename from modules/adsl/classes/Model/Product/Plugin/ADSL.php rename to modules/adsl/classes/Model/Product/Plugin/Adsl.php index 2b285cb1..006a9a92 100644 --- a/modules/adsl/classes/Model/Product/Plugin/ADSL.php +++ b/modules/adsl/classes/Model/Product/Plugin/Adsl.php @@ -9,7 +9,7 @@ * @copyright (c) 2009-2013 Open Source Billing * @license http://dev.osbill.net/license.html */ -class Model_Product_Plugin_ADSL extends Model_Product_Plugin { +class Model_Product_Plugin_Adsl extends Model_Product_Plugin { protected $_table_name = 'adsl_plan'; protected $_belongs_to = array( diff --git a/modules/adsl/classes/Service/Traffic/Adsl.php b/modules/adsl/classes/Service/Traffic/Adsl.php index 6c2affa3..260d1993 100644 --- a/modules/adsl/classes/Service/Traffic/Adsl.php +++ b/modules/adsl/classes/Service/Traffic/Adsl.php @@ -50,7 +50,7 @@ class Service_Traffic_Adsl { * @return HeadImage */ public static function instance($supplier) { - $sc = sprintf('%s_%s',get_called_class(),ucwords(strtolower($supplier))); + $sc = Kohana::classname(get_called_class().'_'.$supplier); if (! class_exists($sc)) throw new Kohana_Exception('Class doesnt exist for :supplier',array(':supplier'=>$supplier)); diff --git a/modules/domain/classes/Model/Product/Plugin/DOMAIN.php b/modules/domain/classes/Model/Product/Plugin/Domain.php similarity index 93% rename from modules/domain/classes/Model/Product/Plugin/DOMAIN.php rename to modules/domain/classes/Model/Product/Plugin/Domain.php index 098ee72d..e4c4c0c6 100644 --- a/modules/domain/classes/Model/Product/Plugin/DOMAIN.php +++ b/modules/domain/classes/Model/Product/Plugin/Domain.php @@ -9,7 +9,7 @@ * @copyright (c) 2009-2013 Open Source Billing * @license http://dev.osbill.net/license.html */ -class Model_Product_Plugin_DOMAIN extends Model_Product_Plugin { +class Model_Product_Plugin_Domain extends Model_Product_Plugin { // This model doesnt have a database table public function __construct() { } diff --git a/modules/export/classes/Controller/Affiliate/Export.php b/modules/export/classes/Controller/Affiliate/Export.php index 138f8539..056e7986 100644 --- a/modules/export/classes/Controller/Affiliate/Export.php +++ b/modules/export/classes/Controller/Affiliate/Export.php @@ -23,7 +23,7 @@ class Controller_Affiliate_Export extends Controller_TemplateDefault_Affiliate { if (empty($_POST['plugin'])) $this->request->redirect('affiliate/export/index'); - $sc = sprintf('Export_%s',ucfirst($_POST['plugin'])); + $sc = Kohana::classname('Export_'.$_POST['plugin']); if (! class_exists($sc)) throw new Kohana_Exception('Export Class doesnt exist for :plugin',array(':plugin'=>$_POST['plugin'])); else diff --git a/modules/host/classes/Model/Host/Server.php b/modules/host/classes/Model/Host/Server.php index f594cb18..fd40e4a5 100644 --- a/modules/host/classes/Model/Host/Server.php +++ b/modules/host/classes/Model/Host/Server.php @@ -21,7 +21,7 @@ class Model_Host_Server extends ORM_OSB { * Return the object of the product plugin */ public function plugin($type='') { - $c = sprintf('Host_Plugin_%s',ucfirst(strtolower($this->provision_plugin))); + $c = Kohana::classname('Host_Plugin_'.$this->provision_plugin); if (! $this->provision_plugin OR ! class_exists($c)) return NULL; diff --git a/modules/invoice/classes/Invoice.php b/modules/invoice/classes/Invoice.php index 377dfc89..124df9e5 100644 --- a/modules/invoice/classes/Invoice.php +++ b/modules/invoice/classes/Invoice.php @@ -93,7 +93,7 @@ SELECT i.id AS iid,i.due_date AS due FROM ab_invoice i,ab_invoice_item ii WHERE * Generate a PDF invoice */ public function pdf() { - $invoice_class = sprintf('Invoice_TCPDF_%s',ucfirst(Kohana::$config->load('invoice')->driver)); + $invoice_class = Kohana::classname('Invoice_TCPDF_'.Kohana::$config->load('invoice')->driver); $pdf = new $invoice_class($this->io); diff --git a/modules/invoice/classes/Invoice/TCPDF.php b/modules/invoice/classes/Invoice/Tcpdf.php similarity index 100% rename from modules/invoice/classes/Invoice/TCPDF.php rename to modules/invoice/classes/Invoice/Tcpdf.php diff --git a/modules/invoice/classes/Invoice/TCPDF/Default.php b/modules/invoice/classes/Invoice/Tcpdf/Default.php similarity index 99% rename from modules/invoice/classes/Invoice/TCPDF/Default.php rename to modules/invoice/classes/Invoice/Tcpdf/Default.php index 714c044e..5ea9c54e 100644 --- a/modules/invoice/classes/Invoice/TCPDF/Default.php +++ b/modules/invoice/classes/Invoice/Tcpdf/Default.php @@ -9,7 +9,7 @@ * @copyright (c) 2009-2013 Open Source Billing * @license http://dev.osbill.net/license.html */ -class Invoice_TCPDF_Default extends Invoice_TCPDF { +class Invoice_TCPDF_Default extends Invoice_Tcpdf { // Current line being printed public $sum_y = 0; diff --git a/modules/product/classes/Model/Product.php b/modules/product/classes/Model/Product.php index e3124acd..44f59fcf 100644 --- a/modules/product/classes/Model/Product.php +++ b/modules/product/classes/Model/Product.php @@ -90,7 +90,7 @@ class Model_Product extends ORM_OSB { if (! is_numeric($this->prod_plugin_data)) throw new Kohana_Exception('Missing plugin_id for :product (:type)',array(':product'=>$this->id,':type'=>$this->prod_plugin_file)); - return ORM::factory(sprintf('Product_Plugin_%s',$this->prod_plugin_file),$this->prod_plugin_data); + return ORM::factory(Kohana::classname(sprintf('Product_Plugin_%s',$this->prod_plugin_file)),$this->prod_plugin_data); } /** diff --git a/modules/service/classes/Model/Service.php b/modules/service/classes/Model/Service.php index 62287a32..973ea7c8 100644 --- a/modules/service/classes/Model/Service.php +++ b/modules/service/classes/Model/Service.php @@ -56,7 +56,7 @@ class Model_Service extends ORM_OSB { if (! is_numeric($this->product->prod_plugin_data)) throw new Kohana_Exception('Missing plugin_id for :product (:type)',array(':product'=>$this->product->id,':type'=>$this->product->prod_plugin_file)); - $o = ORM::factory(sprintf('Service_Plugin_%s',ucwords(strtolower($this->product->prod_plugin_file))),array('service_id'=>$this->id)); + $o = ORM::factory(Kohana::classname(sprintf('Service_Plugin_%s',$this->product->prod_plugin_file)),array('service_id'=>$this->id)); return $type ? $o->$type : $o; }