Announcement

Collapse
No announcement yet.

SC8.1: How to use extern php editor

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • SC8.1: How to use extern php editor

    Hi
    i like to write my php libraries in an editor like eclipse. I found my libraries in /opt/NetMake/v8/wwwroot/scriptcase/devel/conf/sys/libraries and everything works fine, when i write as root in the libraries.

    But this is not the way i love.

    Does anyone have a solution to use an external editor to modify scriptcase libraries.

    Best regards
    Steve

  • #2
    Map the directory on your server to your desktop and edit the file. Be very very very very (did I say very?) aware what you do tho. I would test it first in detail.
    It is easier to use a tool like autoit to create 2 macro's or so that opens a library and opens eclipse and copies the web contents to eclipse (and one going vice versa).
    I havent tested this so this is just my first idea...

    Comment


    • #3
      Originally posted by stephanw View Post
      Hi
      i like to write my php libraries in an editor like eclipse. I found my libraries in /opt/NetMake/v8/wwwroot/scriptcase/devel/conf/sys/libraries and everything works fine, when i write as root in the libraries.

      But this is not the way i love.

      Does anyone have a solution to use an external editor to modify scriptcase libraries.

      Best regards
      Steve
      Can you enlight me with exactly what you want to modify? In general you could code your libraries outside scriptcase, then copy-paste the code where you need it.
      Regards,
      Cavadinha

      Development Team
      Netmake - IT Solutions

      Comment


      • #4
        Hi
        my idea is, that i can use a good php editor to write my code and then easy use in sc. Yes i can copy/paste. And i can also mount the folder /opt/NetMake/v8/wwwroot/scriptcase/devel/conf/sys/libraries on my computer and edit/store the files directly inside this.

        I only want to know, if there is a more comfort way. And also more secure way, because i have to mount the folder as root.

        Comment


        • #5
          I do use an external editor now and then for ScriptCase development. However, I develop fully external classes, so that I do not need to be linked in to the ScriptCase environment. When the class is ready I just load it as a library for the project and I can then refer to it in the ScriptCase environment in the various PHP code sections.

          For the PHP code sections in a given SC application I usually find the SC editor sufficient as it is often not big sections of code that has to be entered, but occasionally I do copy/paste of these PHP code sections from Rapid PHP (http://www.rapidphpeditor.com/), which I find to be an efficient editor with color coding of key words, code outline, code folding and completion, but not a humongous and resource hungry IDE like Eclipse.

          Another good option in Rapid PHP is the preview tab. If one of my applications have errors when generating the application, ScriptCase will display the name of the generated file where the problem is. I then open the generated PHP file and can better see the cause of the problem. When correcting the issue, I can immediately open the preview tab and check/correct until all problems have been solved. The corrected code can then be pasted back into the relevant PHP code section in the ScriptCase environment.

          Perhaps it is just me that does not fully know the possibilities of linking an external PHP editor/IDE directly to the ScriptCase environment, because I do not see what benefits one would have from that. The above is for me a good and efficient setup. Rapid PHP is not free, but quite cheap.
          Last edited by Orion; 07-24-2015, 08:44 AM.
          Best regards,

          Frank

          Comment


          • #6
            Hi Frank
            thank's for that input. It helps me to think different ways...
            One question: Isn't it a disadvantage of php classes, that all the macros from sc are not available?

            I tried this with a pdf report.... omg, this was tricky. Maybe also because the pdf itself is an external library in sc. Do you have problems like this when you working with your own classes in sc?

            Best regards
            Steve

            Comment


            • #7
              Hi Steve,

              You are welcome.

              Well, so far the classes I have made have not interacted much with the user interface but rather depended either on data in the database, which the class can reach through a separate PDO (PHP Data Objects) connection, or I have passed in stuff through parameters of the constructor method of the class. When having to interact with the user interface, however, I usually just use the PHP code sections with the macros. I think that the user interface is so mixed into the SC environment, which is both the browser based IDE as well as an underlying SQLite database, that it is probably difficult to effectively use an external IDE as a replacement for SC one.

              All in all, I am okay with browser based SC IDE. It may not be the most advanced, but it does what it is supposed to. Once I go with a code generation, I am happy to let it do its job and not worry too much about the structure. The whole point is to get a working and good looking application fast. But of course sometimes you do need to add something. In those cases I try to keep it as separate as I can, letting ScriptCase do just what it is good at.

              In my current project I am using an external library that interacts with the database. In the beginning I tried to make the external library part of the ScriptCase project, but I found that it was to better to keep it totally separate, so that I from the SC menu in the application just call my own main PHP procedure that controls and interacts with library that in turn accesses the database. There is a bit of simple user interface in my own main PHP procedure, but most of it is background processing against the database.
              Best regards,

              Frank

              Comment


              • #8
                Your lib is a separated set of files I guess, and you copy together your deploy, right? 8.1 has improved this, and now you can include with a macro, then, you can edit your library files directly with this new system. Don't know if I explained correctly
                /Giuseppe

                Professional Scriptcase Services
                Some Customers opinions

                Comment


                • #9
                  I have used both ways. If it is an external library with its own folder structure, I have deployed the external library separately and not as part of the ScriptCase deployment. But for if it is just some extra PHP files with classes that are used in the project, I have loaded these in the project/application, so that they are deployed as part of the ScriptCase application. There are features for this in 8.0.

                  I have not yet looked at the include features of 8.1, but it definitely looks interesting.
                  Best regards,

                  Frank

                  Comment


                  • #10
                    Dear all,

                    But, about that "...you can edit your library files directly with this new system..." comment from Giu, the problem that I see, its that the SC editor is not the better, I mean, dont have tools like autocomplete, highlight syntax, inter alia. I think that this is the point of Steve.

                    Best regards,

                    Comment


                    • #11
                      Originally posted by aymg01 View Post
                      Dear all,

                      But, about that "...you can edit your library files directly with this new system..." comment from Giu, the problem that I see, its that the SC editor is not the better, I mean, dont have tools like autocomplete, highlight syntax, inter alia. I think that this is the point of Steve.

                      Best regards,
                      Because what I mean with with edit library files directly, is using another editor.
                      /Giuseppe

                      Professional Scriptcase Services
                      Some Customers opinions

                      Comment


                      • #12
                        I got it your point!

                        Comment


                        • #13
                          Hi guys
                          thank you very much for your posts. That's exactly what i need: To know how others do.

                          I will now try both: Make separate classes with their own libs to access the db, but include this as libraries in sc. So i hope i can use the deployment feature of sc, which is very comfortable for me.

                          Happy coding and best regards
                          Steve

                          Comment


                          • #14
                            Originally posted by stephanw View Post
                            Hi guys
                            thank you very much for your posts. That's exactly what i need: To know how others do.

                            I will now try both: Make separate classes with their own libs to access the db, but include this as libraries in sc. So i hope i can use the deployment feature of sc, which is very comfortable for me.

                            Happy coding and best regards
                            Steve
                            Using new Libraries feature, you can't use macros on it. Remember it.
                            /Giuseppe

                            Professional Scriptcase Services
                            Some Customers opinions

                            Comment

                            Working...
                            X