Live data from Hacker News

Just open sourced my 10k LOC PHP & MySQL invoicing app

github.com

91–100 of 101 posts

Re: Just open sourced my 10k LOC PHP & MySQL invoicing app

#91

Earlier quoted context omitted.

CI was built in the PHP4 days, and for that reason it has a lot of cruft left over. For example, there is no autoloader. Also, classes are loaded as singletons, and are assigned to properties of the controller, which I put into the 'magic' category, and isn't compatible with IDE autocomplete features (I'm a VIM user, but it makes things easier for a lot of developers). //CI Class Load Example: $this->load->library('e…

I'm not comp sci educated, I'm all self taught so maybe "Autoload" has a real meaning outside of this context, but CI does have an autoloader... something that can autoload libraries and models? application/config/autoload.php

http://php.net/manual/en/language.oop5.autoload.php

Re: Just open sourced my 10k LOC PHP & MySQL invoicing app

#92
post #43

Earlier quoted context omitted.

CI was built in the PHP4 days, and for that reason it has a lot of cruft left over. For example, there is no autoloader. Also, classes are loaded as singletons, and are assigned to properties of the controller, which I put into the 'magic' category, and isn't compatible with IDE autocomplete features (I'm a VIM user, but it makes things easier for a lot of developers). //CI Class Load Example: $this->load->library('e…

What PHP framework would you use if you had to today? Kohana? Yii? Something else?

I think it's pretty important to figure out what you expect from a framework.

If you want to make it easier for other people to come on, perhaps open up to an ecosystem of open source contribution, you want a framework with broad appeal. Yii or Drupal would be good choices.

If you want a solid foundation, that you personally will benefit from, you either want something that is well engineered (perhaps even slightly over engineered) or something really minimal, that doesn't get in the way. Depending on you own experience and/or taste.

Re: Just open sourced my 10k LOC PHP & MySQL invoicing app

#93
post #70

Earlier quoted context omitted.

Ugh, yup. This code should either be taken down, or come with a HUGE warning that it needs to be audited for security vulnerabilities.

All projects which have been just open sourced are going to contain bugs. That is, until people like you find them and fix them and submit pull requests ;). CI strips out all funky characters, so while it is possible to cause an erroneous query, I'm not seeing a security issue here.

On top of that we are all hopefully always learning. New kinds of security attacks will come along and we will have to figure out how to address them.

I would encourage you to consider trying hard to build a team around your project. In my experience open source software is hard work and really only can thrive in a community. This doesn't form magically around the software. It takes time and effort to build. If you can get good security folks in your community you can learn a lot from them.

Re: Just open sourced my 10k LOC PHP & MySQL invoicing app

#94

What would you do different based on what you know now?

While I was at a startup recently, I did all of my frontend development in Backbone.js, this app would do a lot better in that framework. Also, the CI framework isn't all that great, I would have certainly used a different framework. Perhaps even Node.js (which is what I'm doing a lot of my development in nowadays). I also would have looked for a marketer and devoted more time to the project. The market for this kind…

I don't think anyone's ever subscribed to a SaaS product because it used X technology over Y. I also think you're way too focused on the tech and the list of features, instead of selling a solution.

You can say all you want about invoicing being an over saturated market, but I launched a very successful project management product a few months ago. Focus on doing a few things very well, and you can do well in just about any "saturated" B2B space.

Re: Just open sourced my 10k LOC PHP & MySQL invoicing app

#95
post #94

Earlier quoted context omitted.

While I was at a startup recently, I did all of my frontend development in Backbone.js, this app would do a lot better in that framework. Also, the CI framework isn't all that great, I would have certainly used a different framework. Perhaps even Node.js (which is what I'm doing a lot of my development in nowadays). I also would have looked for a marketer and devoted more time to the project. The market for this kind…

I don't think anyone's ever subscribed to a SaaS product because it used X technology over Y. I also think you're way too focused on the tech and the list of features, instead of selling a solution. You can say all you want about invoicing being an over saturated market, but I launched a very successful project management product a few months ago. Focus on doing a few things very well, and you can do well in just abo…

Spot on!

Re: Just open sourced my 10k LOC PHP & MySQL invoicing app

#97
post #43

Earlier quoted context omitted.

CI was built in the PHP4 days, and for that reason it has a lot of cruft left over. For example, there is no autoloader. Also, classes are loaded as singletons, and are assigned to properties of the controller, which I put into the 'magic' category, and isn't compatible with IDE autocomplete features (I'm a VIM user, but it makes things easier for a lot of developers). //CI Class Load Example: $this->load->library('e…

What PHP framework would you use if you had to today? Kohana? Yii? Something else?

Consider FuelPHP (http://fuelphp.com/) - it has a decent support for PHP 5.3 and modern databases such as Redis & MongoDB.

Re: Just open sourced my 10k LOC PHP & MySQL invoicing app

#98
post #65

Earlier quoted context omitted.

Symfony is nice, Zend 2 is going to fix everything from ZF1 and is worth keeping an eye on as well. I've dabbled in Doctrine before, but the memory usage looked a little too high for the convenience it offered.

Out of curiosity what are you doing in PHP where memory usage is an issue? PHP's standard life cycle, while having numerous disadvantages, avoids a lot of problems with memory usage. It's a rather different beat, but you might checkout Propel ( http://propelorm.org ) for a different take on a PHP ORM. It has a static build phase unlike Doctrine which turns some people off, but if you can get past that it's a rather n…

If you think that your project is going to grow into a substantial code base, I would NOT recommend Propel.

A lot about their active record implementation violates POLA with various gotchas and code generation gets tedious and unwieldy with models that contain many fields or relations.

Re: Just open sourced my 10k LOC PHP & MySQL invoicing app

#99
post #65

Earlier quoted context omitted.

Out of curiosity what are you doing in PHP where memory usage is an issue? PHP's standard life cycle, while having numerous disadvantages, avoids a lot of problems with memory usage. It's a rather different beat, but you might checkout Propel ( http://propelorm.org ) for a different take on a PHP ORM. It has a static build phase unlike Doctrine which turns some people off, but if you can get past that it's a rather n…

If you think that your project is going to grow into a substantial code base, I would NOT recommend Propel. A lot about their active record implementation violates POLA with various gotchas and code generation gets tedious and unwieldy with models that contain many fields or relations.

Interesting, I've been using Propel for so long I've probably internalized all the gotchas. What in particular caught you off guard?

Re: Just open sourced my 10k LOC PHP & MySQL invoicing app

#100
post #99

Earlier quoted context omitted.

If you think that your project is going to grow into a substantial code base, I would NOT recommend Propel. A lot about their active record implementation violates POLA with various gotchas and code generation gets tedious and unwieldy with models that contain many fields or relations.

Interesting, I've been using Propel for so long I've probably internalized all the gotchas. What in particular caught you off guard?

My favourite is probably:

Say you want to add a product to an existing order in the database...

$orderProduct = new OrderProduct(); $order = OrderPeer::retrieveByPK(1);

$order->addOrderProduct($orderProduct);

Now, if ANYWHERE after this point in the code, something calls $order->getOrderProducts() before you call $order->save() (like a validation routine or something) you will lose that new OrderProduct and it will not be persisted.

It's bit me more than once, especially as you start to spread code around that depends on traversing the relationships - can be a very tricky bug to spot.

Post reply on HN