codeigniter modular extensions - codeigniter

I'm trying to implement modular extensions into a codeigniter 2 setup but am having a few problems. I followed the installation instructions on the wiki and everything was working fine. Then I started to play around a bit and try and use it. All I did was create a new module called users with the required folders and added a model class called users_m. I then tried to load this from my welcome module controller. According to the wiki this should be very straightforward. I simply added this line
$this->load->model('users/users_m');
to the constructor of my welcome controller.
Unfortunately at this point I get the white screen of death.
So I tried something else. This time I removed the load model line and added
$this->output->enable_profiler(TRUE);
This time I got the welcome page displayed and I got the profiler, but at the top of the page I got this error:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI::$profiler
Filename: MX/Loader.php
Line Number: 145
I don't know if these two tries are related or not, but there's obviously something not right with my setup. Could someone point me in the right direction?

If you accessing the model from the controller in the same module, you can load it using just:
$this->load->model(‘user_m’);
You only have to do $this->load->model(‘module/model_name’); when your cross loading between modules.
Just to make sure, your model is located here right?
application/modules/users/models/users_m.php
As for the profiler error:
1) Have you done installation step 5 and put the Modular Extensions core files into application/core?
2) Do you have the latest version of HMVC? There have been updates to mx/loader.php in the last couple days.
Ps. great tutorial on HMVC: http://net.tutsplus.com/tutorials/php/hvmc-an-introduction-and-application/

if you have folder structure like:
application/
modules/
users/
models/
users_m.php
then use this to call modelsin you controller
$this->load->model('users/users_m','',TRUE);

Related

Did I solve my "Target class [mail.manager] does not exist." issue?

Just upgraded from Laravel 6 to 7, and had the error response above when submitting a contact form. I eventually found a solution that seems to work and I am submitting here to help out the next guy.
In the terminal run:
composer require illuminate/mail
Add the following to the top of the controller file (app/Http/Controllers/Main.php in my case):
use \Illuminate\Support\Facades\Mail;
Add this to bootstrap/app.php:
$app->register(Illuminate\Mail\MailServiceProvider::class);
Save and test, and it worked localhost.
If the above does not work for you, there are some other possible issues and solutions available at this link, where I must give credit to vipindasks.
https://laracasts.com/discuss/channels/lumen/lumen-52-mail-not-working
Since I am suppose to ask a question:
Do you see any problems with this solution even though the site and mailer is working now?
You are simply missing a backslash. This tells the autoloader that the file you are looking for is not in the namespace your controller resides in :
$app->register(\Illuminate\Mail\MailServiceProvider::class);
Run composer update hope this will help you

Fatal error: Class 'Mage_Sales_Model_Order' not found in ....core/Mage/Reports/Model/Resource/Order/Collection.php on line 456

I was installing magento 1.9.1 on my server everything went fine but after installation when i click on Go to Backend and give my username and password to login to Admin Panel it gives the following error:
Fatal error: Class 'Mage_Sales_Model_Order' not found in
/home2/siatel/public_html/4ebay/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php
on line 456
Though my frontend side of website is working perfectly ... Please help.
I can see my admin log-in page. Error comes only when I give username and pass and hit continue...
Without more information, it sounds like you're missing your
app/code/core/Mage/Sales/Model/Order.php
file. It seems like you're missing a lot of different files as well. I'd diff your installation vs. the contents of a standard tar archive.
Your error shows like this
Fatal error: Class 'Mage_Shipping_Helper_Data' not found in
/home2/siatel/public_html/4ebay/app/Mage.php on line 547
see the portion 'Mage_Shipping_Helper_Data' not found. It means Magento is looking for a helper class file and it couldnt find it. Magento will look for this file in app/code/core/Mage/Shipping/Helper/Data.php.
I will give you some hint on how this file path came from. First of all magento core files lies in the location app/code/core/. Then missing class name (in this case Mage_Shipping_Helper_Data) will converted as Mage/Shipping/Helper/Data.php. Then this will append to the core codePool directory path. That is app/code/core/Mage/Shipping/Helper/Data.php
For every file, magento assigns path as like this. Please note that, you need to attach .php part to the last keyword. Also you need to copy the exact same data of that file (take into consider the version). It means it need to have a 'Magento way' class name and so on

Joomla 1.5 font page blank page

I am new to the Joomla CMS I would like to say first. The server the website was being hosted on just updated their PHP the 5.4. It worked correctly for a time then the front page stopped displaying anything. I have tried almost everything that's suggested to fix the problem but nothing seems to work. From checking the error_log, exporting the website and re installing it on a new hosting service that still supports PHP 5.2, viewed the PHP errors and made small changes to the file's code that logged as syntax errors so they wouldn't occur and nothing, still blank. Starting from scratch is not on options for me because I need to keep that template intact since I was not the one that created it. If anyone out there has any suggestion it would be appreciated.
When turning on the error reporting in the configuration file I get
Beginning error messages
Strict Standards: Non-static method JLoader::import() should not be called statically in C:\xampp\htdocs\restore\libraries\loader.php on line 186
Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\restore\libraries\loader.php on line 71
Strict Standards: Non-static method JFactory::getApplication() should not be called statically in C:\xampp\htdocs\restore\index.php on line 31
Strict Standards: Declaration of JSite::getPathWay() should be compatible with that of JApplication::getPathway() in C:\xampp\htdocs\restore\includes\application.php on line 377
Strict Standards: Non-static method JRegistryFormat::getInstance() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\restore\libraries\joomla\registry\registry.php on line 373
Ending error messages
just list a few. I have tried going through and editing them with now luck.
I have found the problem. On if its modules was causing the blank page error in some way.
I was able to find this out by first making a copy of the current site using Akeeba Backup plugin.
Installed is on my localhost.
Installed a fresh version of Joomla 1.5 (with out default data)
Then edited the configuration.php file's database connection settings
/* Database Settings */
var $dbtype = 'mysql';
var $host = 'localhost';
var $user = 'root';
var $password = 'password';
var $db = 'dbname';
var $dbprefix = 'jos_';
to use the database created from the copied version of the website I installed on my localhost.
With that being done the fresh version of joomla I created had all the database information
I needed to recreate a new website with the same content.
I then started copying the components, modules, plugins, template, and modules from the copied
version to the fresh version.
Note: Some of the plugins and modules needed to be re-installed.
I would check to see if the fresh version was still functioning correctly every time I copied a directory over. Then, bam I got a blank front end page on the fresh version after I copies over a certain module.
So I found a version of the module that worked for 1.5 on the W3 and re-installed it.
Solving the mystery of my blank front end page.
It took quite a few hours to pinpoint the problem but I'm thankful for the people that responded to my question on the forums I posted it on. And I hope this can help anyone out there that comes across a mysterious blank front end page.
This issue really isn't a Joomla specific one, but PHP. To learn more about troubleshooting these issues in PHP, there is a good discussion at How to get useful error messages in PHP and What is the recommended error_reporting() setting for development? What about E_STRICT?

Doctrine 2.2 Bisna CLI

I can't get the Bisna doctrine cli to work. It complains about not being able to find the Symfony Console application. Notice it's trying to look for it in a nested directory of Doctrine/Symfony/Console/Symfony/Component/Console. Anybody ever seen this?
PHP Warning: require(/Users/jhicks/workspace/production/application/../library/Doctrine/Symfony/Console/Symfony/Component/Console/Application.php): failed to open stream: No such file or directory in /Users/jhicks/workspace/production/library/Doctrine/Common/ClassLoader.php on line 163
PHP Fatal error: require(): Failed opening required '/Users/jhicks/workspace/production/application/../library/Doctrine/Symfony/Console/Symfony/Component/Console/Application.php' (include_path='/Users/jhicks/workspace/production/library:.:/opt/local/lib/php') in /Users/jhicks/workspace/production/library/Doctrine/Common/ClassLoader.php on line 163
Here's the Github page for the doctrine cli from Bisna: https://github.com/guilhermeblanco/ZendFramework1-Doctrine2/blob/master/bin/doctrine.php
There are many repositories that call themsemves Bisna in Github, it is difficult to find what of them you are using without further information.
The original one is the one created by Guilherme Blanco (Bisna used to be his nickname) called Zend Framework 1 + Doctrine 2 and works like a charm, but it does not bundle the Symfony components necessary to run the CLI tool.
What you have to do is download them from GitHub (search for "Symfony" and you will find the components inside the Organization repository) and put them inside your project's library folder paying attention to the PSR #0 naming conventions.
If you provide the piece of code that generates this error and the repository and version you are using, it will be easier to detect the error and give a better answer. It is naive to try and guess the type of error, but probably you have problems with namespaces and/or how you are calling Symfony's Console component.
If you need some guidance on how this integration can be achieved, you can look at doctrine.php inside Blanco's repository.
Looks like I needed to add these two lines to my existing autoloader bootstrap method:
$symfonyAutoloader = new \Doctrine\Common\ClassLoader('Symfony', 'Doctrine');
$autoloader->pushAutoloader(array($symfonyAutoloader, 'loadClass'), 'Symfony');
I didn't think this would be necessary since I included Symfony in the autoloaderNamespaces array in my application.ini file.
autoloaderNamespaces[] = "Symfony"

Codeigniter 1.7.2: function image() seems to no longer exist, what is the replacement?

A society I belong to have a website which someone who left a few years ago set up. It was done using codeigniter (which was probably rather excessive given that the website is pretty simple.)
The server it is hosted on updated Php recently, which resulted in the website completely breaking. It now simply returns a page full of deprecated function error messages like
"A PHP Error was encountered
Severity: 8192
Message: Function set_magic_quotes_runtime() is deprecated
Filename: codeigniter/CodeIgniter.php
Line Number: 60
"
Reading the CodeIgniter documentation it seemed the new version would work fine with the latest PhP installed on the server. I installed a the latest version of CodeIgniter (1.7.2) and copied over the views and database settings. I now get an error message about the image() function being undefined:
"Fatal error: Call to undefined function image() in /public_html/newSystem/application/views/welcome_index.php on line 32"
I tried searching through all the CodeIgniter documentation, and couldn't find any reference to this function.
it is used in the following fasion:
<?=image('welcome_index_splash-text.gif')?>
which led me to believe it was related to the img() function which converts text into an element, but replacing image() with img() gave the same error message. (Well, with img being undefined instead of image)
Since I have never used CodeIgniter before, there is probably a very simple fix, but it doesn't seem readily available from the UsersGuide.
The lesson would be not to use a framework like CodeIgniter when static HTML would have done, but it wasn't my decision to set it up like this in the first place!
Thank you for any help.
Codeigniter has a helper function called img() which returns the HTML code for the image provided as argument. If you get that error you're probably not including the right helper library like this:
$this->load->helper('html');
in your controller.
Reference: http://codeigniter.com/user_guide/helpers/html_helper.html

Resources