Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

Rekomendowane odpowiedzi

Opublikowano

After a long talk with fellow developers on how to improve my "storm" application, we came to the conclusion that it was the "wrong" approach to developer tools, it tried to do too much and often times it did things that some didn't want it to do. to get around this, we have decided to break up "storm" into multiple applications and call them "The Dev Toolbox".

These applications are being provided free of charge to the IPS developer community, but i ask if you find them useful or lifesaving, consider making a donation of any amount, to ensure the future development of these fantastic tools:

https://paypal.me/codingjungle

if you would like to access the git repo:

https://bitbucket.org/CodingJungle/devtools

there will be two branches, master and dev. master will be what is found here in the download and dev will be any fixes, features, etc, that are in the works, so it might not be ready for general use. if you want access to be able to push, send me a PM with your bitbucket name/email and i will consider adding you.

In this download you will find 4 new and improved components to the "storm" application (well 5 in total, but dtbase will be required to be installed along with any of the other apps, as it contains shared code and data they will use). they are as follows:

DT Proxy:

Proxy, is the proxy class generator reworked and improved upon proxy class generator found in "storm". most of the improvements will be seen by people who use IDE's and in particular PHPStorm, coupled with a very powerful plugin, php-toolbox. The biggest improvements that weren't made for phpstorm and this plugin, was the property generation for ActiveRecord and descendant classes. In this version it will try to determine the return type from the fields definition and will use the fields description if it has one to describe the property. this is useful to avoid "return" type errors in most IDE's inspections. however it is not a 100% perfect, if you are not satisfied with the results of it, you can regenerate the proxy's without the field type being set, it will just configure them as "strings".

PHPStorm and PHP-Toolbox Features:

Templates return type (this uses built in features of phpstorm and does not require the php-toolbox plugin). this feature when you type in \IPS\Theme::i()-getTemplate('somegroup'), will try to match the "group" parameter to a class, which overrides the methods default return type, so you can get a list of "available" templates to that group. this feature is limited by the ability in phpstorm and can only match on the group, so you might find that it doesn't always return the template you want, as there can be multiple groups with the same named template, it does work for the most part. will continue to try to improve this feature:

templates.thumb.png.e92a9150b93d4340682eef4fe98df4f5.png

*note: from this point on for dtproxy description you will need phpstorm and the php-toolbox plugin installed and enabled to have these features working!

Application Hinting:

there are several IPS methods that require "application" to be entered as on of its parameters, this feature provides a hinting dialogue for you to select an app from for several methods for IPS. (note: this isn't an exhaustive list for methods that handle a parameter, just the most used imho, below is a list of methods this works for, if it has a number after it, it is what parameter it is for, the first param would be 0):

  • IPS\Application::load
  • IPS\Application::appIsEnabled
  • IPS\Email::buildFromTemplate:0
  • IPS\Application::appsWithExtension:0
  • IPS\Lang::saveCustom:0
  • IPS\Lang::copyCustom:0
  • IPS\Lang::copyCustom:3
  • IPS\Lang::deleteCustom:0
  • IPS\Theme::getTemplate:1
  • IPS\Application::extension:0
  • IPS\Application::allExtensions:0
  • IPS\Output::js:1
  • IPS\Output::css:1"

templates.thumb.png.e92a9150b93d4340682eef4fe98df4f5.png

Table Name Hinting:

This one is for methods in IPS that require a table name as a parameter.

  • IPS\Db::select:1
  • IPS\Db::insert:0
  • IPS\Db::delete:0
  • IPS\Db::update:0
  • IPS\Db::replace:0
  • IPS\Db::checkForTable:0
  • IPS\Db::createTable:0
  • IPS\Db::duplicateTableStructure:0
  • IPS\Db::renameTable:0
  • IPS\Db::alterTable:0
  • IPS\Db::dropTable:0
  • IPS\Db::getTableDefinition:0
  • IPS\Db::addColumn:0
  • IPS\Db::changeColumn:0
  • IPS\Db::dropColumn:0
  • IPS\Helpers\Table\Db::__construct:0

db.thumb.png.faf8c440862af5823faae6045d21cc68.png

 

Language Strings Hinting:

several methods in IPS require a use of a language string.

  • IPS\Lang::addToStack:0
  • IPS\Lang::checkKeyExists
  • IPS\Lang::get
  • IPS\Lang::saveCustom:1
  • IPS\Lang::copyCustom:1
  • IPS\Lang::copyCustom:2
  • IPS\Lang::deleteCustom:1

lang.thumb.png.766677252be1f41b4fb25c5b976e5b0f.png

Template Group Hinting:

\IPS\Theme::i()->getTemplate( 0 ) is a required parameter and requires a template group to be added, this will add hinting to it:

templateGroups.thumb.png.b4a164c906c6e2643a163e6e81a4a927.png

Modpermissions hinting:

modpermissions.thumb.png.761badaaf5895f5978c773450f4b5307.png

Url Hinting (on \IPS\Http\Url::internal, will bring up a list of apps, apps with modules, and apps with modules and controllers):

urls.thumb.png.4e8a5c9c9d4bbee4f323d7eb24aa1c1c.png

Furl Hinting:

furls.thumb.png.3fee9a03211a38c940855660bdbb3643.png

this isn't exhaustive list, but this is a start. as development continues on DT Proxy, hopefully we can bring it to new levels and offer more comprehensive phpstorm features, if you don't use phpstorm but know of plugins or features in other IDE's that can do similar things, let me know, if it is not too much of a hassle, i will try to add them in :).

 

DT Dev Plus:

this app extends the features of the developer center for applications in IPS. this will add 3 new tabs (Sources, Dev Folder and Languages).

Sources:

this is the feature that received the biggest boost in new features and abilities. You can create several class types (and interfaces and traits here) that will automatically be added to your applications sources folder, with all the appropriate namespacing and class prefixing. you can also define what it extends or implements or uses (for traits). On ActiveRecord, Node, Item, Review, you can select to have the database generated for you, along with other scaffolding (like for nodes/items, it will create the controllers and modules for it, along with adding the nodes to the ACP menu of your app).

for Nodes/Items/Comments/Reviews, you will be present with list of interfaces and traits found in IPS, that you can select. if the trait/interface needs to add a property/method or a map to the column map, this will automatically add them to the newly created class (and if the property or map is a table field, it will also add it to the table if it creates a table). It really takes out the guess work and the hunting down what you "need" to add something, now just check a box and the way you go!

Dev Folder:

Not a whole lot has changed here, but you can create templates, js widets/controllers/modules, that will automatically add to the location/group you select, and will give you a skeleton of the code.  the biggest change here is the ability to select existing location/groups.

Languages:

this might not be a feature for everyone, but i find it saves me time. this will provide a list of all the languages strings defined for your app (this includes lang.php and jslang.php), and provides a list that can be edited in the browser, along with where it should be saved too (like is it a lang.php only or jslang.php only or do you want it to appear for both). I like being able to quickly and easily see both lists and make changes where needed :)

Extension:

Dev Center Plus also includes an extension, if you add it to your app, it will add a "doc block" at the head of each php file, and will also add a blank "index.html" to each directory that doesn't have one, to prevent directory listings from those folders. these are both executed at build time. if you don't have the extension for your app, then these features will not run. you can also provide a list of files or directories to ignore thru the extension that you don't want to include in your tar file.

DT Dev Folder:

ever misplaced those pesky dev folders for your plugins or applications, or woking for a client and they want you to do something with another application, but you don't have the dev folders and the author is slow to respond. do not fear, DT Dev Folder is here! This applications allows you to generate the dev folders for applications and plugins. this application will also allow you to install plugins while in_dev mode (and generates the dev folder for you). it will also create the dev folder for apps installed while in_dev :)

DT Code:

I'm not sure where i will be going with this application exactly, right now it will search thru your code looking for lang keys and settings, it will check and verify they are both in use and defined. it can return false positives as these might not always be "defined" in a way it can read it, but can give you the ability to see which language strings are in use and get rid of the "dead" ones and same with settings. if you have any suggestions for things you would want to check in your code, let me know and i will see about implementing this feature.

DT Base:

This app doesn't really do much on its own, it adds the "DevBar Menu" to the acp, but it is required for the other apps as it is has classes and data they will use (instead of reinventing the wheel for each application) decided to go with a "required" base app.

There are a ton of features and abilities i'm probably forgetting about, so why don't you try it out for yourself, its free after all :)

Future DT apps:

  • Content Generator (this includes member generations and at least forum/topic/post generation)
  • Profilier - will provide an area so you can monitor your apps performance and find out other vital information about your apps performance.

 

Hope everyone enjoys this! send me any bugs or feedback to my PM's, i won't be supporting this application in my apps topic. thanks to everyone who has made this possible :)

View the full article

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.