Since accidental lazy-loading almost always lead to performance problems, I was seeking a way to disable it. The solution is easy. Just define somewhere the following trait and use it in your model when you need to disable lazy loading:
* Class OnlyEagerLoadedModelTrait
* @package FH\Stock\Model
* @param string $method
protected function getRelationshipFromMethod($method)
$modelName = static::class;
throw new LogicException(
"EagerLoadedOnlyTrait: Attempting to lazy-load relation '$method' on model '$modelName'"
class CategoryUser extends Eloquent
Some time ago I blogged about creating nice PDO wrapper. Recently I’ve created a repository for my small PDO wrapper on GitHub: https://github.com/FractalizeR/phpSweetPDO
Library is released under Apache License. Feel free to use it!
I’ve just released a first version of Smarty extension for Silex framework. You can take it here
Silex is a PHP microframework for PHP 5.3. It is built on the shoulders of Symfony2 and Pimple and also inspired by sinatra.
A microframework provides the guts for building simple single-file apps.
Recently I was upgrading my websites on Joomla and moved them to PHP 5.3. I noticed too many errors from mod_slick_rss extension coming to PHP log. I’ve fixed them and added some new options:
- Some new CSS classes to further style layoout
- Ability to sort feeds by date or by their original order in the feed
- Header and footer texts to display before and after the feed
- Ability to output item date in the feed in a given format
You can download updated version here.
I turned VBulletin forum into support system for our customers. In some forums users post requests to activate their access to some subforums. Administrator looks through all the requests, verifies data, provided by each user and sets secondary usergroups for certain user according to request. Each time having checked user data, administrator needs to go to user profile and click Options there to go to user edit window.
What this hack does?
This hack adds a button Edit User to each post. Having clicked this button opens /admincp/user.php?do=edit&u=$post[userid] page in new window. So, my staff needs only one click to access user account data.
Hack is fully customizable. The following parameters are adjustable:
* Window height and width
* Button icon
* User groups for which this button is shown
* Button location (choose from 9 possible)
Continue reading “[VBulletin Addon] “Edit User” Button in postbit”
Powerful VBulletin addon, that scans every attachment any user uploads to your forum for viruses and allows to execute various actions if any virus is found. Hack requires PHP 5.x. and (depending on driver) PHP AV extensions or some antivirus software installed on PC
Continue reading “[VBulletin Addon] VBulletin Antivirus”
What does it do?
This hack shows all items, that require moderation in a notifications area. Items are grouped by type:
Continue reading “[VBulletin addon] Show items, awaiting moderation in notifications area”