Post by JohnnyO » Tue Oct 14, 2008 3:38 am

Also running 5.2.6 ..  ;)

If you make it idiot proof, they will just build a better idiot.


User avatar
New member

Posts

Joined
Wed Nov 14, 2007 7:31 am
Location - Denver, CO - USA

Post by snover » Tue Oct 14, 2008 3:42 am

Um, from what you've posted, with the exception of the image helper, all you're really needing to do here is calling static class functions. There's no reason you can't implement this with regular PHP 5.2.

Code: Select all

<?php
class Model {
  public static function product()
  {
    return new Product();
  }
}

$product = Model::product();
Or if you were thinking of doing it dynamically...

Code: Select all

<?php
class Model {
  public function __callStatic($name, $args)
  {
     require_once "catalog/model/{$name}.php"; // Or use spl_autoload_register to register an autoload function
     $reflection = new ReflectionClass($name); // throws exception 'Class <class> does not exist' if it can't be loaded
     return $reflection->newInstanceArgs($args);
  }
}
And actually there's no reason you can't implement the image helper either:

Code: Select all

<?php
class Helper {
  protected static $_imageHelper;
  public static function image() {
    if(!self::$_imageHelper) { // Optimised so we only have to instantiate a single instance of the image helper here
      self::$_imageHelper = new ImageHelper();
    }
    return self::$_imageHelper;
  }
}
Helper::image()->resize($file, 100, 100);

HTH,
Last edited by snover on Tue Oct 14, 2008 4:42 am, edited 1 time in total.

Newbie

Posts

Joined
Thu Jul 19, 2007 5:27 am

Post by snover » Thu Oct 23, 2008 6:12 am

You know, I just noticed that the database schema is hugely wasteful. There are a whole bunch of int(1), int(3), int(4), int(5) columns — that means you're using 4 bytes for fields that fields that will never be allowed to store more than 1-5 digits. These should really be changed to tinyint(1), smallint(3), smallint(4), and mediumint(5), which use 1, 2, 2, and 3 bytes, respectively.

Regards,
Last edited by snover on Thu Oct 23, 2008 6:17 am, edited 1 time in total.

Newbie

Posts

Joined
Thu Jul 19, 2007 5:27 am

Post by salmoon » Thu Nov 06, 2008 5:13 pm

Hey Daniel.

Any chance we can have a more realistic time for release of 1.0 as i've told my client "very soon" a few too many times now.

Many thanks.

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by Daniel » Fri Nov 07, 2008 8:03 pm

I will aim for monday.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by salmoon » Tue Nov 11, 2008 5:14 pm

?

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by hm2k » Tue Nov 11, 2008 7:15 pm

Please don't pester daniel for v1.0, If you are in a rush, consider using the 0.7.current from the SVN.

There is no realistic reason why this shouldn't work for you.

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by salmoon » Tue Nov 11, 2008 7:17 pm

is the ipn callback problem fixed in that version....?

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by Daniel » Tue Nov 11, 2008 7:24 pm

salmoon wrote: is the ipn callback problem fixed in that version....?
yes

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by salmoon » Tue Nov 11, 2008 7:34 pm

Ah i didn't know this.

Sorry to pester about v1.0.

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by salmoon » Thu Nov 13, 2008 7:51 am

is 0.7.current = 0.7.8? or 0.7.9?

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by Qphoria » Thu Nov 13, 2008 8:24 am

current is current... its the latest....  in this case it's the most recent build that will soon be 0.7.9  final. Then we will be on 0.8.x

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by salmoon » Thu Nov 13, 2008 8:26 am

so its 0.7.8 then.. thanks.

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by Qphoria » Thu Nov 13, 2008 8:27 am

lol um no.. its 0.7.current. about 100 bug fixes and new features since 0.7.8. If you want to generalize.. you can call it 0.7.9. In a few days I hope never to hear the numbers 0.7.8 again

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by salmoon » Thu Nov 13, 2008 8:42 am

ah k. sorry didn't really get the "0.7.current" thing as it doesn't say that anywhere in the list here:
http://code.google.com/p/open-cart/downloads/list

and i assumed with 0.7.8 not being a RC it was more stable / good to use in production environment.
Last edited by salmoon on Thu Nov 13, 2008 8:45 am, edited 1 time in total.

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by Qphoria » Thu Nov 13, 2008 9:06 am

Get RC3.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by aboel3zz » Thu Nov 13, 2008 10:31 pm

The Beta version registry class doesn't support singleton patterns , why ??

Newbie

Posts

Joined
Thu Nov 13, 2008 6:26 pm

Post by Daniel » Fri Nov 14, 2008 4:19 am

aboel3zz wrote: The Beta version registry class doesn't support singleton patterns , why ??
Your right.

This has been a big problem in my head because I don't like objects just being able to appear out of now where. I like them being passed around thourgh the constructors. If you've ever used UML to constuct your applications you will know how important passing object is.

I am updating the beta though to use a single registry pattern.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by aboel3zz » Tue Dec 30, 2008 4:47 pm

I want to ask if there is a complete checkout process in the beta version ?
Last edited by aboel3zz on Tue Dec 30, 2008 10:35 pm, edited 1 time in total.

Newbie

Posts

Joined
Thu Nov 13, 2008 6:26 pm

Post by Qphoria » Tue Dec 30, 2008 4:55 pm

Use 0.7.9 for a live cart. 1.0 is currently only released as a developer preview.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 21 guests