Basic osclass development related information.
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Note: This will have a performance impact on your site, so make sure to turn this off in your production site.
The OSC_DEBUG_DB
constant, added in version 2.3, saves the database queries to an array and at the end of the execution the queries are displayed at the end the page. The information saves each query: the sql string, how long that query took to execute, the sql number error and string if there has been some sql error.
The OSC_DEBUG_DB_LOG
constant, added in version 2.3, logs the sql queries to a file called queries.log in oc-content. If you want to debug the sql queries of the AJAX calls or cron, you must use OSC_DEBUG_DB_LOG
because we can't print these at the end of the page. If Apache doesn't have write permissions, you may need to create the file first and set the appropriate permissions (i.e. use 666).
The OSC_DEBUG_DB_EXPLAIN
constant, added in version 2.3, run an EXPLAIN
query for each select query and logs the result to a file called explain_queries.log queries. It should be used only during the development of OSClass, themes or plugins to see the performance of the queries. Remember, if Apache doesn't have write permissions, you may need to create the file first and set the appropriate permissions (i.e. use 666).
The OSC_DEBUG
constant, added in version 2.3, controls the display of php errors and warnings. If this setting is not defined in config.php, the default value is false.
When the OSC_DEBUG
is false, the error reporting level is E_ALL ^ E_NOTICE ^ E_USER_NOTICE
. In that case, we're not showing notice and strict php errors. However, if we set the constant to true, the error reporting level is E_ALL | E_STRICT
and display_error
value is 1.
The OSC_DEBUG_LOG
constant, added in version 2.3, logs these errors to a file called debug.log in oc-content. If Apache doesn't have write permissions, you may need to create the file first and set the appropriate permissions (i.e. use 666).
This diagram could be a bit difficult to understand at first and follow all the relations. To be able to use an interactive version of the same diagram, please use the MySQL Workbench and follow these steps.
Download MySQL Workbench (it's free and cross-platform!)
Install it and open it
Select Create EER Model From SQL Script
Look for your file 'struct.sql (your_osclass_folder/oc-includes/osclass/installer/struct.sql)
Check Place imported object on a diagram
Click on Execute, Next, Finish
Re-arrange the boxes (tables) as you wish
Relations will highlight if you place your mouse over the tables or the relations.
We don’t like bugs, neither you do. I’ve seen a post in talking about this and I’ve found really interesting. I’m going to reproduce it here:
Here’s a great rule: If we can’t reproduce the bug, we can’t fix the bug.
When you report a bug to us, here’s what happens:
We read the bug report
One of us tries to reproduce the bug
If we can reproduce it, we investigate what’s broken and fix it
But if we can’t reproduce the bug…
Often bug reports don’t include enough information. Meaning we have go back and ask for details so we can investigate. If you want to increase the odds we fix an issue, and fix it fast, help us out.
A great bug report includes the following:
What were you trying to do?
What did you click on or do last?
What happened / what did you see?
What browser are you using?
What version of OSClass?
What hosting provider? (And if you know, what version of PHP do they use?)
The bug is reported to the right place:
Plugins: Specify the plugin and the version
Themes: Specify the theme and the version
Bonus points for reviewing known issues before submitting, as your problem might already have been reported and have a patch or a workaround.
We work hard to have you deal with as few issues as possible, but if you want to improve the odds we can fix your issue fast, please take a extra minute to write a bug report that’s easier for us to use. Thanks.
We are glad to hear you want to contribute to the Osclass project. Osclass is an open source solution for your classifieds site, developed by and for its users, like you. There are several ways to help Osclass grow and improve, even if you don't know to code, you could still help Osclass.
Documentation is done by everyone who wants to do it! This documentation is available on our public GitHub Repo
It is work in progress to allow everyone to contribute with translations.
Users' participation and involvement are essential to maintain our support forums.
Currently we do not have any official forums but you can get help at which is an active public forum with active community.
We will update this list here if we found more places where you can actively seek or give support.
Do you know PHP, JS or MySQL? Get involved in Osclass development. Help us write code, add features and fix bugs!
Visit our project and check out our repositories. You can sign in and help us improve our core, themes or plugins. The best way to do this is through “Pull request” and help us fixing bugs by applying changes to the code. For any doubt, look up the help section for any doubt.
Even if you don’t know to code, you can also contribute to Osclass. You can help us test the previous releases of Osclass as well as our themes and plugins.
We will be happy if you tell your friends about Osclass, share a link or display a small banner on your site. More users -> stronger community -> better Osclass!
Osclass is and will always be free,. Sending money to Osclass developers is another way to support the community. If any theme or plugin makes your life a little bit easier, contact the author and show your support. Sometimes developers just need to hear users are happy to use their plugins/themes.
Basic Introduction to Osclass coding style
This small guide is partly based in the coding style guide of Zend Framework :
PHP code must always be delimited by the full-form, standard PHP tags:
Short tags are never allowed. For files containing only PHP code, the closing tag must always be omitted (See General standards).
Variables should follow the Hungarian Notation ( ), that means they should start with a character indicating the type of variable, for example i for integer, a for arrays, o for objects, s for strings ... Also, each first character of a word should be uppercase.
Note: SQL column's names should follow a similar notation, but the first character should follow an underscore. Words are separated by an underscore, all in lowercase. If the column is a primary key, it should be preceded by "pk_" if it's a foreign key by "fk_"
The brace should always be written on the line underneath the class name.
Every class must have a documentation block that conforms to the PHPDocumentor standard. The following is an example of an acceptable class declaration:
Control statements based on the if
and elseif
constructs must have a single space before the opening parenthesis of the conditional and a single space after the closing parenthesis.
The opening brace is written on the same line as the conditional statement.
The closing brace is always written on its own line. Any content within the braces must be indented using four spaces.
It's required ALWAYS to put the braces.
The following if statements is not valid
Control statements written with the "switch" statement must have a single space before the opening parenthesis of the conditional statement and after the closing parenthesis.
All content within the "switch" statement must be indented using four spaces. Content under each "case" statement must be indented using an additional four spaces.
The construct default should never be omitted from a switch statement.
Bug reports that for #3 are incredibly useful, as we can see exactly what you saw.
Source:
Want to suggest improvements or new functionalities? . Have you encountered a bug or want to suggest any other improvement? Open an issue on .
All documentation blocks ("docblocks") must be compatible with the phpDocumentor format. Describing the phpDocumentor format is beyond the scope of this document. For more information, visit: »
This small guide is partly based in the coding style guide of Zend Framework :