Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. if(isset($variable)) { // only executes when $variable IS NOT NULL } if($variable) { // executes when $variable != false, 0, '', array(), .. }
  2. ignace

    Zend Date

    $date = new Zend_Date($row['db_date']); echo $date->get('YYYY-MM-dd HH:mm:ss'); More information can be found at: http://framework.zend.com/manual/en/zend.date.html
  3. Lazy Loading is as simple as: public function getFoo() { if(is_null($this->foo)) { $this->foo = $this->_getFoo(); } return $this->foo; } This way you will load Foo objects when you actually need them (when you call upon them)
  4. checkdate($a_partes[1],$a_partes[0],$a_partes[2]) checkdate()
  5. I'm sure those who started Facebook never guessed they would invite the whole world in on their crappy site.
  6. Fenway said that data duplication should be something you need to consider when things get really heavy not at the start of your project. MySQL can easily handle a few million records (with proper indexing). And if you then would feel the need you can create a summary tables with optimized indexes, or partition your tables, or ..
  7. Site versions are managed with release planning. On each iteration you decide what features will be built in the software. At the end of an iteration and prior to the actual release, you have a deployment procedure which depends on the project and your hardware architecture (it may be as simple as a SCM push to your GIT/Mercurial repo). Sometimes the release procedure is more involved and you have to do some manual editing like minifying JS and CSS files. The actual release is usually done overnight.
  8. Base your reasoning on facts not merely believes. Putting data in another table because one field would cost you severly in performance is nonsense.
  9. Have you uploaded the directory Zend into library? Do you overwrite the include_path in your application through set_incude_path()?
  10. Have you uploaded Zend framework to your webhost? Is this path available in the include_path?
  11. return ($_SESSION['validate'] == $this->_generateHash()) ? true : false; You don't need this extra typing $_SESSION['validate'] == $this->_generateHash() will return a boolean true if they match or a boolean false if not. So ? true : false; is redundant, don't state the obvious.
  12. for($i = 1; $i <= 12; ++$i) printf('%02d', $i);
  13. Add Lazy Loading to your Data Mapper. That way you only retrieve the course objects if you actually need them.
  14. Apparently you missed the point of programming. You can write a script that does this for you, as write the PHP include in the correct place, replacing whatever was there first. glob DOMDocument
  15. There is no difference Zend_Db_Table extends Zend_Db_Table_Abstract. You should always extend from abstract classes, not concrete classes.
  16. ActiveRecord is a common pattern to use for simple projects. You could abstract the ActiveRecord and use a Repository to actually retrieve/store the ActiveRecord's. $repo = new UserRepository(); $user = $repo->find(1); $user->firstname = 'John'; $user->lastname = 'Doe'; $repo->store($user); This way the ActiveRecord doesn't need to know about the DB table structure or have a DB connection. A possible implementation for find() could be: public function find($id) { // get the record from DB $record = new ActiveRecord($this->_columns); $record->populate($rowData); return $record; }
  17. class Cube { private $cubes = array(); public function addCube(Cube $cube) { $this->cubes[] = $cube; return $cube; } public function addCubes(array $cubes) { foreach($cubes as $cube) { $this->addCube($cube); } return $this; } } $cube = new Cube(); $cube->addCube(new Cube())->addCube(new Cube())->addCubes(array(new Cube(), new Cube(), new Cube(), new Cube())) print_r($cube); You could take a look at the Composite Pattern
  18. $combobox = $form->addElement('Select', 'mycombobox'); You can read more about forms at the Zend_Form documentation
  19. I like it alot. You certainly took my advice on explaining what minecraft is. I would add some in-game items to the website (opacity 10% background bottom-right, top-left) so that the visitor gets familiar with how the game looks and gets inspired to read more about Minecraft.
  20. As you probably know the Waterfall methodology does all A&D up front. RUP is an Agile process like eXtreme Programming that uses Artifacts. If you do all your planning up front you are using the Waterfall methodology instead of a true Agile process. In an Agile methodology you perform your planning at the start of an iteration, this is mostly done on a white-board in group, sometimes someone is assigned to translate the thoughts/designs on the white-board to an appropriate/official paper format as documentation for later use. However not many do so and instead use the tests as guides for new programmers, as a test should clearly state how a class is used. A principle many adhere to, with concerns to documentation, is only create the Artifact if it ADDS VALUE.
  21. Would this help? SELECT columns FROM table2 JOIN smf_members ON table2.id_member = smf_members.id_member WHERE smf_members.id_group = '9' OR find_in_set('9', smf_members.additional_groups) ORDER BY member_name FIND_IN_SET()
  22. You shouldn't have to worry unless you are absolutely sure you will make the 1M visitors/day (exaggeration intended) mark in that case you will need to adjust your app architecture to be able to scale-up/out and make your app so that certain pieces/areas of the app can be moved to a different server
  23. Ah, OO Analysis & Design my favourite topic Wether you want to develop your app in OO or not is up to you. Just remember you don't abstract away too much too soon in the process, otherwise your app although yet small will be overwhelming and too complex early on in the process. Since you have Sequence Diagrams you also should have a clear idea about the code, since a Sequence Diagram is actually code documentation on paper. Implement these classes and make sure you have a clear set of Unit-Tests to verify that they work. PS All Artifacts in RUP are optional.. except the code Only add aditional Artifacts if they ADD VALUE
  24. You could do this with normal replication where you would pick one website that would act as a master and all 69 others would be slaves of that master. This of course assumes that: 1) There is only 1 website that edits prices 2) You have full control over the MySQL setup which may not be the case if they are all shared hosted Otherwise you could pick one website as a host or buy an additional server that will act as the database for all 70 websites. The advantage being that you can buy additional (or use less popular websites to act as a back-up) MySQL servers and add a load balancer. MySQL Replication
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.