This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** @var modX $modx */ | |
switch ($modx->event->name) { | |
case 'OnHandleRequest': | |
$isAjax = !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'; | |
if (empty($_REQUEST['action']) || (!$isAjax && $modx->event->name != 'OnHandleRequest')) {return;} | |
$action = trim($_REQUEST['action']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', 1); | |
ini_set("max_execution_time", 50); | |
define('MODX_API_MODE', true); | |
require 'index.php'; | |
$modx->getService('error', 'error.modError'); | |
$modx->getRequest(); | |
$modx->setLogLevel(modX::LOG_LEVEL_INFO); | |
$modx->setLogTarget('ERROR'); | |
$modx->error->message = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Following the guide found at this page | |
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html | |
echo "\r\nUpdating system ...\r\n" | |
sudo apt-get update | |
# Create folder to place selenium in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param array $c | |
* @return array | |
*/ | |
function averageNumberOfGoals($c) | |
{ | |
$games = $c['games']; | |
$scored = $c['goals']['scored']; | |
$skiped = $c['goals']['skiped']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Only run via SSH | |
if (PHP_SAPI !== 'cli') exit(); | |
// Instantiate MODX | |
@include(dirname(__FILE__) . '/config.core.php'); | |
if (!defined('MODX_CORE_PATH')) define('MODX_CORE_PATH', dirname(__FILE__) . '/core/'); | |
include_once (MODX_CORE_PATH . "model/modx/modx.class.php"); | |
$modx= new modX(); | |
$modx->initialize('web'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by Andrey Stepanenko. | |
* User: webnitros | |
* Date: 24.01.2019 | |
* Time: 1:00 | |
*/ | |
ini_set('display_errors', 1); | |
ini_set("max_execution_time", 50); | |
define('MODX_API_MODE', true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by Andrey Stepanenko. | |
* User: webnitros | |
* Date: 06.02.2019 | |
* Time: 18:38 | |
*/ | |
switch ($event->name) { | |
case 'OnMediaSourceGetProperties': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//ini_set('display_errors', 1); | |
//ini_set("max_execution_time", 20); | |
// Boot up MODX | |
require_once dirname(dirname(__FILE__)) . '/config.core.php'; | |
require_once MODX_CORE_PATH . 'model/modx/modx.class.php'; | |
$modx = new modX(); | |
$modx->initialize('web'); | |
$modx->getService('error','error.modError', '', ''); | |
// Boot up any service classes or packages (models) you will need |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyControllerPayment extends modRestController { | |
public $classKey = 'msPayment'; | |
public $defaultSortField = 'rank'; | |
public $defaultLimit = 20; | |
public $headers = array( | |
'Access-Control-Allow-Methods' => 'GET', | |
); | |
public $fields = 'id,name,description,price,logo,active'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Connect to a POP3 server. | |
* @access public | |
* @param string $host | |
* @param integer|boolean $port | |
* @param integer $tval | |
* @return boolean | |
*/ | |
public function connect($host, $port = false, $tval = 30) |
OlderNewer