![]() To give you a idea this is what my paths looks like: $this->path_botoes = $this->root. '/' Īfter updating all those variables you will have to update the paths with them as needed. $this->path_link = substr($str_path_web, 0, strrpos($str_path_web, '/')) Replace with $this->root = "/path/to/deployed/scriptcase/site/" /* $this->root = substr($str_path_sys, 0, -1 * strlen($str_path_web)) Replace with $str_path_web = "/path/to/deployed/scriptcase/site/" /* Then go down and update the paths for the following varaibles: $str_path_apl_url = "/path/to/deployed/scriptcase/site/" If you want to call it from a cron job or directly on the command line comment that code out and just add: */ This is where scriptcase tries to dynamicly find the path but this only works when calling the page from the browser. $str_path_apl_dir = substr($str_path_apl_dir, 0, strrpos($str_path_apl_dir, “/”)+1) $str_path_apl_dir = substr($str_path_sys, 0, strrpos($str_path_sys, “/”)) $str_path_apl_url = substr($str_path_apl_url, 0, strrpos($str_path_apl_url, “/”)+1) $str_path_apl_url = substr($str_path_apl_url, 0, strrpos($str_path_apl_url, “/”)) Then go in to the “index.php” file and look for the following: ![]() Go into your my_blank_app_name folder then into my_blank_app_name.php and change the path to only be “index.php”. So if your is located in “/www/my_site/” and inside the “my_site” folder is the “_lib” file then you put “/www/my_site/” wherever “/path/to/deployed/scriptcase/site/” apears. Just a note wherever you see “/path/to/deployed/scriptcase/site/” below that is the path to where the _lib file is located. Otherwise if you try to call it on the command line you will see a bunch of html containing an error.Īll the changes below will need to happen on the server you deploy your project to. When you use a blank app there are still some libraries that get called where the paths will not work properly.ĭisable security and enable direct call on the page. ![]() I recently had to create a email service using a cron job and scriptcase. Am I being stupid that this should work as simple as this, or is there a lot more involved? Surely I am not the first person that needs to do something like this? Even if I ignore the output, I still cannot find anything in any error logs, and the no entry is made in the log table associated with the log schema. If I then use a terminal window and go to the directory where blank the app is, and enter ‘php index.php’, a whole bunch of what looks like HTML (possibly CSS?) is sent to standard output. But I cannot find an entry in any error log resulting from the error_log() statement - is this expected? Should this work within an SC app (I have not tried this before)? When I generate and run this from within SC, I do get “Done” displaying on a blank page and an entry is made in the log table associated with the log schema. Sc_log_add (“testing”, “Batch application works.”) The Execute event only has three lines in it: This is the simplest app - I hardly changed anything when I used the New App wizard. I did create a blank app ( not a control app). I tried building a very quick blank app, but when I tried to test run it in background (command line ‘php /index.php’ it crashed out with a series of warnings (library not found) and finally an uncaught exception. Is there a recommended app type, or an approach I can use to do this? Hence I was going to use cron to kick off a PHP process regularly (it does not have to be a daemon driven off a signal or anything that elaborate). The background batch app does not have to be executed in a critical timeframe, it just needs to check the DB every 30 mins or so. Rather than start from scratch, and given I already have built internal libraries in SC to do the required processing for other parts of the system, I would like to build the background batch app in SC. ![]() The solution I am building has the need for a background process to regularly check the database, and based upon some flags and the time, it needs to update data in the database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |