Closed (fixed)
Project:
Drupal.org CVS applications
Component:
new project application
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
13 Aug 2010 at 19:52 UTC
Updated:
18 Oct 2018 at 20:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
avpadernoHello, and thanks for applying for a CVS account.
You still need to upload the archive containing the code in a comment here.
What is your reply to what reported by sun?
Comment #2
czingerline commentedHi.
Regarding post #21:
Objects:
I use objects to gather together common sets of functionality, which in this case are related to each of the most popular database tables. I also use them to maintain and pass around state within our application, which I have found makes the rest of the code using these objects clearer and more concise.
However, I have been careful to expose all the API functions and extension points, in mostpopular.api.php, using Drupal's functional model. The application does not expose the underlying objects directly through these functions, relying instead on passing around their IDs; nor does it require that developers writing hooks for new mostpopular services be aware of or interact directly with these objects.
lock.ini:
Drupal's locking mechanism, implemented in includes/lock.ini, provides a means for guaranteeing that only one instance of a block of code can run at a time. It is expected that the code will release the lock once it is complete or once a timeout has expired.
In contrast, the mostpopular_last_run table (and its lastrun.php wrapper class) controls how often each of the most popular cron processes are allowed to update their data from remote datasources, which is likely on the order of hours or days. They allow fine-grained control over how often to refresh the data for each interval of time, which we refer to internally as "throttles". These updates only occur as part of a cron job, of which there should only be a single instance running.
I considered using Drupal's locking for this purpose, but then the code would never release the locks and would necessarily wait instead for them to timeout on their own, which could be days. This seems like use of locks for which they were not intended. Using my own table also allows me more flexibility so I can keep track of each service and interval separately, as the number of available services and intervals are configurable.
Reviewing:
I agree that this is a complex module with many moving parts, and believe that it probably will make more sense to code reviewers if you install it and play with the configuration options. The administration pages correspond closely with the class objects.
I also recommend looking at mostpopular.api.php early in the review process, as this is where the key concepts and extension points are documented. This file is structured in a way which should be familiar to the Drupal community, even if reviewers are unfamiliar with the OOP structures.
Does this give you enough information to go on? If not, let me know and I'll post more. Thanks.
Comment #3
sunComment #4
avpadernot()is available whenhook_install(), orhook_uninstall()are invoked. See the code executed from php_install() as example.There is a Drupal function to load files containing PHP code.
Included files should have extension .inc, not .php.
t().The correct placeholder for URLs is prefixed by
@.hook_uninstall().This is only a partial review.
Comment #5
czingerline commentedHi,
I have made updates to the module. Here are responses to the items in your list:
1. License files cannot be committed in Drupal.org repository. Projects committed in Drupal.org repository have the same license used by Drupal.
**** I removed the license file from the codebase.
2. The version line needs to be removed from the .info file.
**** Done
3. t() is available when hook_install(), or hook_uninstall() are invoked. See the code executed from php_install() as example.
**** Done
4.
There is a Drupal function to load files containing PHP code.
Included files should have extension .inc, not .php.
**** Now using module_load_include().
5. Menu descriptions and titles, schema descriptions are not passed to t().
**** Removed t() from schema descriptions, did not find it in menu
6. Functions that are implementations of hooks should have a comment that reports that.
**** Done
7. See http://drupal.org/coding-standards to understand how a module should be written. In particular, see how the code should be formatted.
**** Can you be more specific, I believe I have been following the coding standards
8.
The correct placeholder for URLs is prefixed by @.
**** Done
9. The module doesn't implement hook_uninstall().
**** It does, can you please check again?
Let me know if I can do anything else to get this module released. Thank you!
Comment #6
avpadernoAny reference to the license should be removed from the code.
The copyright statement would not be anymore exact from the moment you apply patches provided by users; to make an example, Drupal core code is not stated to be copyrighted from Dries Buytaert (it is copyrighted by all the contributors).
It usually not a good idea to unconditionally include code contained in PHP files. If the files contain form handlers, theme functions, or menu callbacks, Drupal core code allows to third-party modules to define which files must be loaded in the implementations of
hook_menu(), andhook_theme(); in these cases, Drupal loads the file only when necessary.Is the variable defined by this module?
Messages strings should end with a period.
PHP5 class constructor is
__construct(), which is the one reported by the coding standards.If the content of the variable is not changed, why isn't the code using a class constant?
AddThisis the name of a class that the module addthis.module would use.Reserved SQL keywords are written in uppercase.
That code is similar to the code that in the documentation of
t()is reported as wrong.the function
l()should not be used in these cases.That code could be formatted better.
There are other code lines that are not formatted as suggested by the coding standards (e.g., using a space before, or after the parenthesis in a function call).
Avoid to include HTML tags in strings to translate; that doesn't mean to split a sentence in phrases, anyway. In this case, as the
<p>tag is at the beginning of the string, it'sThank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:
You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
I thank all the dedicated reviewers as well.
Comment #9
avpaderno