Skip to content

Instantly share code, notes, and snippets.

@0test
Last active November 29, 2023 12:15
Show Gist options
  • Save 0test/83abbb379579e0a0ee529b1ccb95cda7 to your computer and use it in GitHub Desktop.
Save 0test/83abbb379579e0a0ee529b1ccb95cda7 to your computer and use it in GitHub Desktop.
cli evo
<?php
set_time_limit(0);
ini_set('session.gc_maxlifetime', 0);
if (!defined("MODX_API_MODE")){
define("MODX_API_MODE",true);
}
if(php_sapi_name() === 'cli'){
define('MODX_BASE_PATH', '/home/users/0/0test/domains/xxx.ru/');
define('MODX_BASE_URL', '/');
define('MODX_SITE_URL', 'https://xxx.ru/');
include MODX_BASE_PATH."index.php";
if (empty ($modx->config)){
$modx->getSettings();
}
}
else{
include_once("../index.php");
$modx->db->connect();
if (empty ($modx->config)){
$modx->getSettings();
}
}
include_once(MODX_BASE_PATH."assets/lib/MODxAPI/modResource.php");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment