Updated 4a. JCB Demo Component Directory, Folders and Files (markdown)
@@ -16,7 +16,7 @@ The JCB Demo component analysis presented in this chapter will introduce you to
|
||||
* [Chrome](https://www.google.com/chrome/) plus its [Developer Tools](https://developers.google.com/web/tools/chrome-devtools/) and [developer extensions](https://chrome.google.com/webstore/category/ext/11-web-development) or, others like [Firefox](https://www.mozilla.org/en-US/firefox/new/) with similar features and add-ons
|
||||
* Joomla! Debug, especially its Stack Trace, and XDEBUG compatibly including links to the source in each trace
|
||||
|
||||
There are [many other possibilities](https://docs.joomla.org/Setting_up_your_workstation_for_web_development), especially with the IDE, but this combination integrates well, and much of its features are native to the applications comprising it. This also applies to any other components used as examples in the videos and chapters accompanying them in this manual. Keep in mind as you progress through them the complexity of the components being shown as examples will increase. The directory tree will look more complex, and contain many additional files. However, they all share one thing in common which is the MVC paradigm; all follow its basic directory structure and naming conventions, including the files contained in it. This also includes the locations of the files. The code and necessary constructs specific to a Model, View or Controller for each to function and interconnect with each other and the Joomla! API at the most basic level are common to all, if developed using the MVC paradigm in its strictest sense.
|
||||
There are [many other possibilities](https://docs.joomla.org/Setting_up_your_workstation_for_web_development), especially with the IDE, but this combination integrates well, and much of its features are native to the applications comprising it. This also applies to any other components used as examples in the videos and chapters accompanying them in this manual. Keep in mind as you progress through them the complexity of the components being shown as examples will increase. The directory tree will look more complex, and contain many additional files. However, they all share one thing in common which is the [MVC Paradigm](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller); all follow its basic directory structure and naming conventions, including the files contained in it. This also includes the locations of the files. The code and necessary constructs specific to a Model, View or Controller for each to function and interconnect with each other and the Joomla! API at the most basic level are common to all, if developed using the MVC paradigm in its strictest sense.
|
||||
|
||||
Unzip com_demo_v2_0_0__J3.zip and using the shell or command line, list its directories, sub-directories and all the files contained in them, by changing to the root of the directory and typing for example dir > demoDirectory.txt /s if using the Microsoft Windows command line. Other operating systems have a similar command in their shell. Then, browse through the directories and files using the file manager for your operating system like Windows Explorer or better yet, an Integrated Development Environment (IDE) like [NetBeans](https://netbeans.org/) or a similar Integrated Development Environment (IDE) with native XDEBUG and GitHub functionality. An IDE is recommended since it has many features facilitating this analysis. Some of these include:
|
||||
|
||||
@@ -43,11 +43,13 @@ Getting XDEBUG to work with your browser and IDE can be a daunting task. [This g
|
||||
|
||||
Each PHP version (WAMP allows switching between 5.x and 7.x) uses a different DLL in php.ini that WAMP switches between when different PHP versions are used. WAMP current version allows switching between that last 5.x version and three 7.x versions. So, do not change what was installed by WAMP at the end of php.ini. Comment out all the lines underneath using a semicolon (;) in each php.ini used by WAMP for each PHP version it allows you to switch to which is very nice for let's say looking at latest Joomla! version, e.g Joomla! 4 alpha.
|
||||
|
||||
Not using the correct DLL is the most common error when using XDEBUG and WAMP sets this up correctly. The other error that is very common is not having the [Visual C++ Packages](http://wampserver.aviatechno.net/?lang=en&prerequis=afficher) installed for the corresponding version of PHP that was compiled. WAMP does this for you. The previous link is the best one for a comprehensive installation of WAMP, all on one page. Since there are many versions of WAMP, although you should be using the current one, it will not hurt to install all of the Visual C++ Packages though it takes considerable time and you must install the 32 and 64 bit versions. Read through the page completely so you install everything that is required. You can install all of the Visual C++ Packages as you will have whatever version of the package is needed for whatever version you have of XDEBUG. The dependency with each Visual C++ Package version depends on what version was used to compile PHP. Like anything worth the effort, do the work and read the information in the sites I have mentioned previously. It usually will not work if you just install it and hope the installation took care of everything. XAMPP will install XDEBUG without much effort from you but WAMP is a much better environment to work in (same for LAMP and MAMP).
|
||||
Not using the correct DLL is the most common error when using XDEBUG and WAMP sets this up correctly. The other error that is very common is not having the [Visual C++ Packages](http://wampserver.aviatechno.net/?lang=en&prerequis=afficher) installed for the corresponding version of PHP that was compiled. Let WAMP do this for you. The previous link appears to be the best one to use for a comprehensive installation of WAMP that is a one-page-stop for everything you need. Since there are many versions of WAMP, although you should be using the current one, it will not hurt to install all of the Visual C++ Packages. It takes some time and you must install the 32 and 64 bit versions and I suggest doing it in date order starting with the earliest and ending with the latest. Read through the page completely so you install everything that is required. Follow all the recommendations that are also on the page.
|
||||
|
||||
It should be mentioned for those wishing to take the quick path you can browse com_demo_v2_0_0__J3.zip directly using Windows File Explorer as one example and skim through the tree and files without extracting it. However, this is a Joomla! component install package so it will not match the directory structure. If you are familiar with the Joomla! installation package requirements and structure this should not be a problem. For some, this is all they require, especially if they are very experienced PHP developers, have used the Joomla! API extensively and found JCB was not very difficult to learn by just reading its code.
|
||||
You can install all of the Visual C++ Packages as you will have then have whatever version of the package is needed for whatever version you have of PHP. Do not worry that two are French. They work fine but you may need to be sure you click the OK button instead of Cancel as they are in French. Other than that all else on the page installs in English. The dependency the PHP version has with each Visual C++ Package version depends on the version of the Visual C++ Package that was used to compile the PHP version. Like anything worth the effort, do the work and read the information in the sites I have mentioned previously. Often, XDEBUG if you just install it and hope the installation took care of everything. More than likely they had the right Visual C++ Package installed and did not change the DLL php.ini was loading. But it seems like many have issues with it as they depended on the install to do everything, including their environment. XAMPP will install XDEBUG without much effort from you but WAMP is a much better environment to work in. The same applies for LAMP and MAMP.
|
||||
|
||||
If you have not reached this level yet, creating the text file and performing the same analysis done here for your own component or ones freely supplied by JCB, as some are complex, is an excellent exercise. Make notes in your text file as you browse through the directories and files on your development site for later review or revisiting concepts that perhaps were not very clear at the time. Follow along as you go through the directory tree on your system. Locate and open the files in each one shown below and view its contents. Good study habits will enable you to progress quickly to become an advanced developer of components built using the MVC paradignm, JCB and the Joomla! API. It, along with the other tools mentioned here, allows you to save a lot of time, develop more components and most importantly, adhere to the [MVC paradigm](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller) which is a time-saver in itself.
|
||||
It should be mentioned for those wishing to take the quick path you can browse com_demo_v2_0_0__J3.zip directly using Windows File Explorer as one example and skim through the tree and files without extracting it. However, this is a [Joomla! component install package](https://docs.joomla.org/File_Structure_and_Naming_Conventions) so it will not match the directory structure. If you are familiar with the Joomla! installation package requirements and structure this should not be a problem. For some, this is all they require, especially if they are very experienced PHP developers, have used the Joomla! API extensively and found JCB was not very difficult to learn by using the JCB Component Builder after it is installed, plus browsing through its code.
|
||||
|
||||
If you have not reached this level yet, creating the text file and performing the same analysis done here is an excellent exercise. Do the same for your own components and when ready, import the more complex JCB freely distributed components into JCB and do the same. Make notes in your text file as you browse through the directories and files on your development site for later review or revisiting concepts that perhaps were not very clear at the time. Follow along as you go through the directory tree on your system. Locate and open the files in each one shown below and view its contents. Good study habits will enable you to progress quickly to become an advanced developer of Joomla! components built using the MVC paradignm, JCB and the Joomla! API. It, along with the other tools mentioned here, allows you to save a lot of time, develop more components and most importantly, adhere to the [MVC paradigm](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller) which is a time-saver in itself.
|
||||
|
||||
Beneath the directory structure and files presented next you will find a short explanation of their relation to the component, the areas of the JCB component that builds each and JCB's interaction with the Joomla! API. You'll see how JCB reuses and extends Joomla!'s abstract base classes, including their methods and properties to implement the many features and functions built into JCB which are utilized by you while building a component. As you peruse the directory structure and files, links are available allowing you to quickly go to the explanatory text below the directory structure for that file, including a reference to where in JCB it originated from and any interaction between JCB and the Joomla! API.
|
||||
***
|
||||
|
Reference in New Issue
Block a user