public function bootstrapScript($url = 'bootstrap.min.js', $options = array()) { $pluginRoot = dirname(dirname(DIRNAME(__FILE__))); $pluginName = end(explode(DS, $pluginRoot)); $url = '/' . Inflector::underscore($pluginName) . '/js/' . $url; return parent::script($url, $options); }
protected static function applyWrapper($connection, $wrapper_name) { $wrapper_class = 'lmb' . ucfirst($wrapper_name) . 'CacheWrapper'; if (!class_exists($wrapper_class)) { $file = DIRNAME(__FILE__) . '/wrappers/' . $wrapper_class . '.class.php'; if (!file_exists($file)) { throw new lmbException("Cache wripper '{$wrapper_class}' file not found", array('dsn' => $dsn, 'name' => $wrapper_name, 'class' => $wrapper_class, 'file' => $file)); } lmb_require($file); } return new $wrapper_class($connection); }
/** * Run validation * @param array $data * @param array $rules * @return bool */ public function run($data, $rules = NULL) { // Optional rules if ($rules !== NULL) { // Add rules if ($this->add_rules($rules) === FALSE) { // Could not add rules return FALSE; } } // Set data to validate $this->data = $data; $this->rules = $rules; error_log(print_r($rules, true), 3, DIRNAME(__FILE__) . '/rules.log'); // Rules are set if (is_array($this->rules)) { // Check fields foreach ($this->rules as $k => $v) { $this->check_field($k); } } // Check if any errors were set return !empty($this->error) ? $this->error : TRUE; }
<?php /* LOAD FUNCTION MODULES */ foreach (glob(dirname(__FILE__) . '/functions/*.php') as $filename) { require_once $filename; } foreach (glob(dirname(__FILE__) . '/functions/**/*.php') as $filename) { require_once $filename; } /* APPLICATION LOGIC */ require DIRNAME(__FILE__) . '/application.php'; /* LOAD APPLICATION MODULES */ foreach (glob(dirname(__FILE__) . '/application/*.php') as $filename) { require_once $filename; } foreach (glob(dirname(__FILE__) . '/application/**/*.php') as $filename) { require_once $filename; }
function __call($method, $params) { $this->status = null; $this->error = null; $this->raw_response = null; $this->response = null; // If no parameters are passed, this will be an empty array $params = array_values($params); // The ID should be unique for each call $this->id++; // Build the request, it's ok that params might have any empty array $request = json_encode(array('method' => $method, 'params' => $params, 'id' => $this->id)); // Build the cURL session $curl = curl_init("{$this->proto}://{$this->username}:{$this->password}@{$this->host}:{$this->port}/{$this->url}"); $options = array(CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_FOLLOWLOCATION => TRUE, CURLOPT_MAXREDIRS => 10, CURLOPT_HTTPHEADER => array('Content-type: application/json'), CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $request); // This prevents users from getting the following warning when open_basedir is set: // Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set if (ini_get('open_basedir')) { unset($options[CURLOPT_FOLLOWLOCATION]); } if ($this->proto == 'https') { // If the CA Certificate was specified we change CURL to look for it if ($this->CACertificate != null) { $options[CURLOPT_CAINFO] = $this->CACertificate; $options[CURLOPT_CAPATH] = DIRNAME($this->CACertificate); } else { // If not we need to assume the SSL cannot be verified so we set this flag to FALSE to allow the connection $options[CURLOPT_SSL_VERIFYPEER] = FALSE; } } curl_setopt_array($curl, $options); // Execute the request and decode to an array $this->raw_response = curl_exec($curl); $this->response = json_decode($this->raw_response, TRUE); // If the status is not 200, something is wrong $this->status = curl_getinfo($curl, CURLINFO_HTTP_CODE); // If there was no error, this will be an empty string $curl_error = curl_error($curl); curl_close($curl); if (!empty($curl_error)) { $this->error = $curl_error; } if ($this->response['error']) { // If gamecreditsd returned an error, put that in $this->error $this->error = $this->response['error']['message']; } elseif ($this->status != 200) { // If gamecreditsd didn't return a nice error message, we need to make our own switch ($this->status) { case 400: $this->error = 'HTTP_BAD_REQUEST'; break; case 401: $this->error = 'HTTP_UNAUTHORIZED'; break; case 403: $this->error = 'HTTP_FORBIDDEN'; break; case 404: $this->error = 'HTTP_NOT_FOUND'; break; } } if ($this->error) { return FALSE; } return $this->response['result']; }
function __call($method, $params) { $this->status = null; $this->error = null; $this->raw_response = null; $this->response = null; // The ID should be unique for each call $this->id++; // If no parameters are passed, this will be an empty array if ($method == 'getblocktemplate') { $param = $params[0]; $request = "{\"method\":\"{$method}\",\"params\":[{$param}],\"id\":{$this->id}}"; // debuglog($request); } else { $params = array_values($params); // Build the request, it's ok that params might have any empty array $request = json_encode(array('method' => $method, 'params' => $params, 'id' => $this->id)); } // Build the cURL session $curl = curl_init("{$this->proto}://{$this->username}:{$this->password}@{$this->host}:{$this->port}/{$this->url}"); $options = array(CURLOPT_CONNECTTIMEOUT => 20, CURLOPT_TIMEOUT => 30, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_FOLLOWLOCATION => TRUE, CURLOPT_MAXREDIRS => 10, CURLOPT_HTTPHEADER => array('Content-type: application/json'), CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $request); if ($this->proto == 'https') { // If the CA Certificate was specified we change CURL to look for it if ($this->CACertificate != null) { $options[CURLOPT_CAINFO] = $this->CACertificate; $options[CURLOPT_CAPATH] = DIRNAME($this->CACertificate); } else { // If not we need to assume the SSL cannot be verified so we set this flag to FALSE to allow the connection $options[CURLOPT_SSL_VERIFYPEER] = FALSE; } } curl_setopt_array($curl, $options); // Execute the request and decode to an array $this->raw_response = curl_exec($curl); // debuglog($this->raw_response); $this->response = json_decode($this->raw_response, TRUE); // If the status is not 200, something is wrong $this->status = curl_getinfo($curl, CURLINFO_HTTP_CODE); // If there was no error, this will be an empty string $curl_error = curl_error($curl); curl_close($curl); // debuglog($this->response); if (!empty($curl_error)) { $this->error = $curl_error; } if (isset($this->response['error']) && $this->response['error']) { // If bitcoind returned an error, put that in $this->error $this->error = strtolower($this->response['error']['message']); } elseif ($this->status != 200) { // If bitcoind didn't return a nice error message, we need to make our own switch ($this->status) { case 400: $this->error = 'HTTP_BAD_REQUEST'; break; case 401: $this->error = 'HTTP_UNAUTHORIZED'; break; case 403: $this->error = 'HTTP_FORBIDDEN'; break; case 404: $this->error = 'HTTP_NOT_FOUND'; break; } } if ($this->error) { return FALSE; } return $this->response['result']; }
<?php /** * include FFmpeg class **/ include DIRNAME(DIRNAME(__FILE__)) . '/src/ffmpeg.class.php'; /** * get options from database **/ $options = array('duration' => 99, 'position' => 0, 'itsoffset' => 2); /** * Create command */ $FFmpeg = new FFmpeg('/usr/local/bin/ffmpeg'); $FFmpeg->input('/var/media/original.avi'); $FFmpeg->transpose(0)->vflip()->grayScale()->vcodec('h264')->frameRate('30000/1001'); $FFmpeg->acodec('aac')->audioBitrate('192k'); foreach ($options as $option => $values) { $FFmpeg->call($option, $values); } $FFmpeg->output('/var/media/new.mp4', 'mp4'); print $FFmpeg->command;
$g_ignore_weights = true; } else { if ($arg == "--no-drop-db") { $locals['no_drop_db'] = true; } else { if ($arg == "--keep-all") { $locals['keep_all'] = true; } else { if ($arg == "--no-demo") { $g_skipdemo = true; } else { if ($arg == "--no-marks") { $g_usemarks = false; } else { if ($arg == "--cwd") { chdir(DIRNAME(__FILE__)); } else { if (is_dir($arg)) { $test_dirs[] = $arg; } else { if (preg_match("/^(\\d+)-(\\d+)\$/", $arg, $range)) { $test_range = array($range[1], $range[2]); // from, to } else { if (preg_match("/^(\\d+):(\\d+)\$/", $arg, $range)) { // FIXME! lockdown gen model, only keep test mode // FIXME! lockdown $test_dirs from here, and check it for emptiness // ie. make sure there are NO other test arguments when this syntax is in use $test_dirs = array(sprintf("test_%03d", $range[1])); $g_pick_query = (int) $range[2]; } else {
<?php define('MENU_STAFF', true); require_once DIRNAME(__DIR__) . '/includes/globals.php'; require_once DIRNAME(__DIR__) . '/includes/class/class_mtg_paginate.php'; $pages = new Paginator(); $_SESSION['staff_authed_time'] = time() + 900; $_GET['pull'] = isset($_GET['pull']) && ctype_alpha(str_replace('.php', '', $_GET['pull'])) ? str_replace('.php', '', $_GET['pull']) : null; $file = empty($_GET['pull']) ? 'index.php' : $_GET['pull'] . '.php'; $path = __DIR__ . '/pull/' . $file; if (file_exists($path)) { require_once $path; } else { $mtg->error('Invalid pull request' . ($users->hasAccess('override_all') ? ' - ' . $path : '')); }
<?php namespace JBBCode\visitors; require_once DIRNAME(__DIR__) . '/CodeDefinition.php'; require_once DIRNAME(__DIR__) . '/DocumentElement.php'; require_once DIRNAME(__DIR__) . '/ElementNode.php'; require_once DIRNAME(__DIR__) . '/NodeVisitor.php'; require_once DIRNAME(__DIR__) . '/TextNode.php'; /** * This visitor is used by the jBBCode core to enforce nest limits after * parsing. It traverses the parse graph depth first, removing any subtrees * that are nested deeper than an element's code definition allows. * * @author jbowens * @since May 2013 */ class NestLimitVisitor implements \JBBCode\NodeVisitor { protected $depth = array(); /* A map from tag name to current depth. */ public function visitDocumentElement(\JBBCode\DocumentElement $documentElement) { foreach ($documentElement->getChildren() as $child) { $child->accept($this); } } public function visitTextNode(\JBBCode\TextNode $textNode) { /* Nothing to do. Text nodes don't have tag names or children. */ }
<?php error_reporting(E_ALL); ini_set('display_errors', '1'); DEFINE('SMARTY_ROOT', DIRNAME(__FILE__) . '/../_smarty'); DEFINE('CONTENT_ROOT', DIRNAME(__FILE__) . '/../_content'); DEFINE('CURRENT_THEME', 'cogsci');
<?php require 'php-dpa-parser/parser.php'; $dirname = DIRNAME(__FILE__); foreach (glob("{$dirname}/php-dpa-parser/result/*.php") as $file) { require $file; } foreach (glob("{$dirname}/php-dpa-parser/result/media/*.php") as $file) { require $file; } foreach (glob("{$dirname}/php-dpa-parser/result/content/*.php") as $file) { require $file; } foreach (glob("{$dirname}/php-dpa-parser/result/content/media/*.php") as $file) { require $file; }
<?php /** * 2013-7-6 13:41:44 * @author x.li * @abstract 入口文件 */ $arr = explode('/', $_SERVER['PHP_SELF']); $root_dir = $arr[1]; // 站点物理路径 defined("HOME_REAL_PATH") || define("HOME_REAL_PATH", $_SERVER['DOCUMENT_ROOT'] . '/' . $root_dir); // 站点根目录 defined("HOME_PATH") || define("HOME_PATH", 'http://' . $_SERVER['HTTP_HOST'] . '/' . $root_dir); // 应用根目录 defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); // 第三方库目录 defined("LIBRARY_PATH") || define("LIBRARY_PATH", realpath(DIRNAME(__FILE__) . "/../library")); // 站点配置文件目录 defined("CONFIGS_PATH") || define("CONFIGS_PATH", REALPATH(APPLICATION_PATH . "/configs")); // 默认以调试方式运行 defined("APPLICATION_ENV") || define("APPLICATION_ENV", getenv("APPLICATION_ENV") ? getenv("APPLICATION_ENV") : "development"); set_include_path(implode(PATH_SEPARATOR, array(realpath(LIBRARY_PATH), get_include_path()))); // 自动加载library/Evolve目录下的文件 require_once LIBRARY_PATH . "/Evolve/ClassLoader.php"; // 常量 require_once CONFIGS_PATH . "/Constant.php"; require_once 'Zend/Application.php'; $application = new Zend_Application(APPLICATION_ENV, CONFIGS_PATH . "/application.ini"); $application->bootstrap()->run();
function __construct($db, $set, $my, $mtg, $users) { $db->query('UPDATE `users` SET `last_seen` = ? WHERE `id` = ?'); $db->execute([date('Y-m-d H:i:s'), $my['id']]); $threshold = $users->getSetting('logout_threshold'); if ($threshold != 'never') { if (isset($_SESSION['last_seen']) && $_SESSION['last_seen'] < time() - $threshold) { session_unset(); session_destroy(); session_start(); $_SESSION['msg'] = ['type' => 'error', 'content' => 'You\'ve been logged out due to inactivity']; exit(header('Location: login.php')); } else { $_SESSION['last_seen'] = time(); } } else { $_SESSION['last_seen'] = time(); } header("Content-type: text/html;charset=UTF-8"); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="MTG Codes v9" /> <meta name="author" content="Magictallguy" /> <title><?php echo $mtg->format($set['game_name']); ?> - MTG Codes v9</title> <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css" /> <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/grids-responsive-min.css" /> <!--[if lte IE 8]> <link rel="stylesheet" href="css/layouts/side-menu-old-ie.css" /> <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/grids-responsive-old-ie-min.css" /> <![endif]--> <!--[if gt IE 8]><!--> <link rel="stylesheet" href="css/layouts/side-menu.css" /> <!--<![endif]--> <style type='text/css'> .center { text-align:center; } </style> <link rel="stylesheet" type="text/css" href="css/message.css" /> <link rel="stylesheet" type="text/css" href="css/style.css" /> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" /> </head> <body> <div id="layout"> <a href="#menu" id="menuLink" class="menu-link"><span> </span></a> <div id="menu"> <div class="userinfo"> <ul class="pure-menu-list"> <li class="pure-menu-item"><?php echo $users->name($my['id'], true); ?> </li> <li class="pure-menu-item"><strong>Money:</strong> <?php echo $set['main_currency_symbol'] . $mtg->format($my['money']); ?> </li> <li class="pure-menu-item"><strong>Level:</strong> <?php echo $mtg->format($my['level']); ?> </li> <li class="pure-menu-item"><strong>Points:</strong> <?php echo $mtg->format($my['points']); ?> </li> <li class="pure-menu-item"><strong>Merits:</strong> <?php echo $mtg->format($my['merits']); ?> </li> </ul><hr /> <ul class="pure-menu-list"> <li class="pure-menu-item">Energy: <?php echo $my['energy'] . '/' . $my['energy_max']; ?> </li> <li class="pure-menu-item">Nerve: <?php echo $my['nerve'] . '/' . $my['nerve_max']; ?> </li> <li class="pure-menu-item">Happy: <?php echo $my['happy'] . '/' . $my['happy_max']; ?> </li> <li class="pure-menu-item">Life: <?php echo $my['health'] . '/' . $my['health_max']; ?> </li> <li class="pure-menu-item">Exp: <?php echo $mtg->format($my['exp'], 2) . '/' . $users->expRequired(true); ?> </li> </ul> </div> <div class="pure-menu"><?php if (!defined('MENU_ENABLE')) { define('MENU_ENABLE', true); } require_once defined('MENU_STAFF') ? DIRNAME(__DIR__) . '/staff/menu.php' : __DIR__ . '/menu.php'; ?> </div> </div> <div id="main"> <div class="header"> <div class="logo"> </div><?php if (defined('HEADER_TEXT')) { echo '<h3>', HEADER_TEXT, '</h3>'; } ?> </div> <div class="content"><?php if (array_key_exists('action', $_GET) && $_GET['action'] == 'logout') { session_unset(); session_destroy(); session_start(); $_SESSION['msg'] = ['type' => 'success', 'content' => 'You\'ve logged out. Come back soon!']; exit(header('Location: index.php')); } if ($my['hospital']) { echo '<strong>Nurse:</strong> You\'re currently in hospital for ' . $mtg->time_format($my['hospital'] * 60) . '.<br />'; } if ($my['jail']) { echo '<strong>Officer:</strong> You\'re currently in jail for ' . $mtg->time_format($my['jail'] * 60) . '.<br />'; } }
function csyn_main_menu() { if (function_exists('add_menu_page')) { add_menu_page('CyberSyn', 'CyberSyn', 'add_users', DIRNAME(__FILE__) . '/cybersyn-options.php'); add_submenu_page(DIRNAME(__FILE__) . '/cybersyn-options.php', 'CyberSyn RSS/Atom Syndicator', 'RSS/Atom Syndicator', 'add_users', DIRNAME(__FILE__) . '/cybersyn-syndicator.php'); } }
$db->query('INSERT INTO `settings_crons` (`type`, `last`) VALUES ("1min", ?)'); $db->execute([date('Y-m-d H:i:s')]); } /* This is an automated database backup system. It'll create a .gz (gzipped) archive of both the structure and data in your game's database daily You MAY wish to consider moving this to a cron file I've stuck it here because I'm lazy.. */ $db->query('SELECT `last` FROM `settings_crons` WHERE `type` = "1day"'); $db->execute(); if ($db->num_rows()) { $cron = strtotime($db->fetch_single()); $deficit = time() - $cron; if ($deficit >= 86400) { $date = date('Y-m-d'); $backupFile = DIRNAME(__DIR__) . '/sql/' . DB_NAME . '_' . $date . '.gz'; if (file_exists($backupFile)) { unlink($backupFile); } $command = 'mysqldump --opt -h ' . DB_HOST . ' -u ' . DB_USER . ' -p\'' . DB_PASS . '\' ' . DB_NAME . ' | gzip > ' . $backupFile; system($command); $time = time(); $floor = $time - floor($time / 86400) * 86400; if ($floor > 0) { $next = time() - $floor; $db->query('UPDATE `settings_crons` SET `last` = ? WHERE `type` = "1day"'); $db->execute([date('Y-m-d H:i:s', $next)]); } } } else { $db->query('INSERT INTO `settings_crons` (`type`, `last`) VALUES ("1day", ?)');
Do whatever you like with the original work, just don't be a dick. Being a dick includes - but is not limited to - the following instances: 1a. Outright copyright infringement - Don't just copy this and change the name. 1b. Selling the unmodified original with no work done what-so-ever, that's REALLY being a dick. 1c. Modifying the original work to contain hidden harmful content. That would make you a PROPER dick. If you become rich through modifications, related works/services, or supporting the original work, share the love. Only a dick would make loads off this work and not buy the original works creator(s) a pint. Code is provided with no warranty. Using somebody else's code and bitching when it goes wrong makes you a DONKEY dick. Fix the problem yourself. A non-dick would submit the fix back. */ if (!defined('MTG_ENABLE')) { exit; } require_once DIRNAME(__DIR__) . '/config.php'; class database { protected $last_query; protected $conn; private $host = DB_HOST; private $user = DB_USER; private $pass = DB_PASS; private $name = DB_NAME; private $db; private $stmt; static $inst = null; static function getInstance() { if (self::$inst == null) { self::$inst = new database();
if ($_REQUEST['dictionary'] != "") { $GLOBALS['dict'] = $_REQUEST['dictionary']; } } */ /* // leave out the dicrtionary support for the moment if ($_REQUEST['init'] == 1) { // don't put spaces between these as js is going to tokenize them up echo "<div id='HA-spellcheck-dictionaries'>en,en_GB,en_US,en_CA,sv_SE,de_DE,pt_PT</div>"; } */ if (get_magic_quotes_gpc()) { foreach ($_REQUEST as $k => $v) { $_REQUEST["{$k}"] = stripslashes($v); } } require_once DIRNAME(__FILE__) . '/spell_parser.inc'; require_once 'XML/XML_HTMLSax.php'; $handler = new Spell_Parser(); $handler->setLanguage($GLOBALS['dict']); $parser = new XML_HTMLSax(); $parser->set_object($handler); $parser->set_element_handler('openHandler', 'closeHandler'); $parser->set_data_handler('dataHandler'); $string_to_parse = stripslashes($_POST['content']); $parser->parse($string_to_parse); ?> <body> </html>
Log::error($exception); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return Response::make("Be right back!", 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php'; View::addLocation(DIRNAME(app_path()) . '/src/views'); require app_path() . '/helpers/Validate.php'; require app_path() . '/helpers/General.php'; // require app_path() . '/helpers/Images.php'; // require app_path() . '/helpers/scss.inc.php';
<?php $opts = getopt("", array('zmq:', 'verbose', 'logLevel:')); $zmq = isset($opts['zmq']) ? (string) $opts['zmq'] : false; $verbose = isset($opts['verbose']) ? true : false; $logLevel = isset($opts['logLevel']) ? (string) $opts['logLevel'] : false; if ($verbose) { $logLevel = 'debug'; } require_once DIRNAME(__FILE__) . '/../vendor/autoload.php'; if (!$zmq) { $zmq = 'tcp://127.0.0.1:5444'; } Awdn\VigilantQueue\Consumer\ConsoleConsumer::factory($zmq, \Awdn\VigilantQueue\Utility\ConsoleLog::loggerFactory('ConsoleConsumer', $logLevel), $verbose)->consume();
<?php include_once DIRNAME(__FILE__) . '/globals.php'; include_once DIRNAME(__FILE__) . '/bbcode_parser.php'; global $ir, $db; $check = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE (`bmembMember` = '%u')", $ir['userid'])); $check_two = $db->query(sprintf("SELECT * FROM `businesses` WHERE (`busDirector` = '%u')", $ir['userid'])); if (!$db->num_rows($check_two) and !$db->num_rows($check)) { echo 'You are not a member of a Company right now, come back another time. <br><br><a href="business_view.php">View Business listings</a><br /> '; $h->endpage(); exit; } else { $r = $db->fetch_row($check); $b = $db->fetch_row($check_two); $fetch_business = $db->query(sprintf("SELECT * FROM `businesses` LEFT JOIN `businesses_classes` ON (`classId` = `busClass`) WHERE (`busId` = '%u') OR (`busId` = '%u')", $r['bmembBusiness'], $b['busId'])); if (!$db->num_rows($fetch_business)) { echo 'This Company does not exist at this time, please come back later.'; $h->endpage(); exit; } else { $inf = $db->fetch_row($fetch_business); } } switch ($_GET['p']) { case 'leave_business': leave_business();
</td> </tr> <tr> <td colspan="2" class="center"><input type="submit" value="Connect" class="pure-button pure-button-primary" /></td> </tr> </table> </form> *<strong>Host:</strong> This mostly speaks for itself. You need to enter the URL to your MySQL database.<br /> - For most people, it's normally <code>localhost</code>, which is filled in by default.<br /> *<strong>User:</strong> The name of the user you created when creating the database.<br /> *<strong>Pass:</strong> This is the password you entered when creating the user.<br /> *<strong>Database:</strong> And finally, the name of the database itself! </p><?php break; case 3: if (file_exists(DIRNAME(__DIR__) . '/includes/config.php')) { error('It looks like your game may have already been installed.. Please check that <code>/includes/config.php</code> contains the correct information'); } $_POST['host'] = array_key_exists('host', $_POST) ? $_POST['host'] : null; if (empty($_POST['host'])) { error('You didn\'t enter a valid hostname'); } if ($_POST['host'] != 'localhost') { if (!@checkdnsrr($_POST['host'])) { warning('I couldn\'t verify that host. I\'ll continue attempting to install this for you anyway'); } } $_POST['user'] = array_key_exists('user', $_POST) && !empty($_POST['user']) ? $_POST['user'] : '******'; $_POST['timezone'] = array_key_exists('timezone', $_POST) && is_string($_POST['timezone']) ? $_POST['timezone'] : null; if (empty($_POST['timezone'])) { error('You didn\'t select a valid timezone');
/** * Evaluates if check passed. * * @return type */ function evaluate() { if (is_null($this->evaluate)) { require_once DIRNAME(__FILE__) . '/conditional/evaluate.php'; $this->evaluate = new WPCF_Evaluate(); } $this->passed = $this->evaluate->evaluate($this); return $this->passed; }
<?php /** * include FFmpeg class **/ include DIRNAME(DIRNAME(__FILE__)) . '/src/FFmpeg.php'; /** * get options from database **/ $options = array('duration' => 99, 'position' => 0, 'itsoffset' => 2); /** * Create command */ $FFmpeg = new FFmpeg('/usr/local/bin/ffmpeg'); $FFmpeg->input('/var/media/original.avi'); $FFmpeg->transpose(0)->vflip()->grayScale()->vcodec('h264')->frameRate('30000/1001'); $FFmpeg->acodec('aac')->audioBitrate('192k'); foreach ($options as $option => $values) { $FFmpeg->call($option, $values); } $FFmpeg->output('/var/media/new.mp4', 'mp4'); print $FFmpeg->command;
<?php include_once DIRNAME(__FILE__) . '/globals.php'; $_POST['ID'] = abs(@intval($_POST['ID'])); if (!$_POST['ID']) { echo "Invalid use of file"; exit; } else { $com = $db->query("SELECT bmembBusiness FROM businesses_members WHERE bmembMember='{$ir['userid']}'"); $cc = $db->fetch_row($com); $clas = $db->query("SELECT * FROM businesses WHERE busId='{$cc['bmembBusiness']}'"); $cs = $db->fetch_row($clas); $clas = $db->query("SELECT * FROM businesses WHERE busDirector='1'"); $cs = $db->fetch_row($clas); $q = $db->query("SELECT * FROM compspecials WHERE csID={$_POST['ID']}"); if ($db->num_rows($q) == 0) { print "There is no Company Special with this ID!"; } else { $r = $db->fetch_row($q); if ($ir['comppoints'] < $r['csCOST']) { print "You don't have enough company points to get this reward!"; $h->endpage(); exit; } if ($r['csJOB'] != $cs['busClass']) { print "You are not in this type of Company!"; $h->endpage(); exit; } if ($r['csITEM']) { item_add($userid, $r['csITEM'], '1');
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @package elis * @subpackage curriculummanagement * @author Remote-Learner.net Inc * @license http://www.gnu.org/copyleft/gpl.html GNU GPL * @copyright (C) 2008-2012 Remote Learner.net Inc http://www.remote-learner.net * */ //need to do this because this file is included from different paths require_once DIRNAME(DIRNAME(DIRNAME(__FILE__))) . '/config.php'; require_once $CFG->libdir . '/pChart.1.27d/pChart/pChart.class'; require_once $CFG->libdir . '/pChart.1.27d/pChart/pData.class'; define('PHP_REPORT_GAS_GAUGE_PI', 3.1415); define('PHP_REPORT_GAS_GAUGE_POINTS_PER_PI', 2000); define('PHP_REPORT_GAS_GAUGE_LABEL_FONT_SIZE', 12); define('PHP_REPORT_GAS_GAUGE_RELATIVE_ARROW_WIDTH', 0.02); define('PHP_REPORT_GAS_GAUGE_RELATIVE_ARROW_TOP_POSITION', 0.1); /** * Converts a polar coordinate to an absolute position on the * chart being rendered * * @param float $theta The point's angle, from positive x-axis and moving clockwise * @param float $radius The mangnitude of the polar radius * * @return stdClass An object containing the necessary x and y coordinates
<?php /* Start Session */ session_name("qwench"); session_start(); /* Define */ define('ROOT', DIRNAME(__FILE__)); define('DS', DIRECTORY_SEPARATOR); /* Get Basic Details */ $path = explode("/", substr($_SERVER['PATH_INFO'], 1)); $controller = 'questions'; $action = 'index'; if (empty($_GET['type'])) { $_GET['type'] = "active"; } $norender = false; $noheader = false; if (!empty($path[0])) { $controller = $path[0]; if ($_GET['type'] == "active") { $_GET['type'] = ""; } } if (!empty($path[1])) { $action = $path[1]; if ($_GET['type'] == "active") { $_GET['type'] = ""; } } /* Include Libraries */ include_once ROOT . DS . 'config.php';
function __construct() { require_once DIRNAME(__FILE__) . '/bean-theme-shortcodes.php'; define('BEAN_SC_ADMIN_URI', plugin_dir_url(__FILE__) . 'admin'); define('BEAN_TINYMCE_DIR', DIRNAME(__FILE__) . '/admin'); add_action('init', array(&$this, 'action_admin_init')); add_action('admin_enqueue_scripts', array(&$this, 'action_admin_scripts_init')); add_action('wp_enqueue_scripts', array(&$this, 'action_frontend_scripts')); }
<?php namespace JBBCode\validators; require_once DIRNAME(__DIR__) . '/InputValidator.php'; /** * An InputValidator for urls. This can be used to make [url] bbcodes secure. * * @author jbowens * @since May 2013 */ class UrlValidator implements \JBBCode\InputValidator { /** * Returns true iff $input is a valid url. * * @param $input the string to validate */ public function validate($input) { $input = str_replace('http://drcity.org/', '', $input); $input = str_replace('http://www.drcity.org/', '', $input); $valid = filter_var($input, FILTER_SANITIZE_URL); return !!$valid; } }
<?php /** * All of the Constant values in this file are censored or otherwise modified. * We've kept values the same where they were the same in our own config file. */ define('ACCESS_TOKEN', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); define('UNEMPTY_FOLDER_COUNT', 1); define('FORM_DETAILS_ID', 00); define('FORM_DETAILS_NAME', 'Test'); define('COPY_FORM_ID', 00); define('GET_SUBMISSIONS_FORM', 00); define('SUBMISSION_DETAILS_ID', 00); define('SUBMISSION_DETAILS_FORM_ID', 00); define('EDIT_SUBMISSION_ID', 00); define('EDIT_SUBMISSION_FIELD_ID', 00); define('EDIT_SUBMISSION_ARRAY_FIELD_ID', 00); define('DELETE_SUBMISSION_FORM', 00); define('SUBMIT_FORM_ID', DELETE_SUBMISSION_FORM); define('CREATE_FIELD_FORM_ID', 00); define('UPLOAD_FORM_ID', 00); $submitFormFieldIds = array(00, 00, 00); $submitFormFieldValues = array('short-answer-test', array('first' => 'first-test', 'last' => 'last-test'), 'this is a long answer field'); $searchFields = array(00); $searchValues = array('5.00'); $uploadFieldIds = array(00); $uploadFieldValues = array(array(file_get_contents(DIRNAME(__FILE__) . '/fs-logo.png'), 'fs-logo.png')); // We use time-based code in here, so you may need to run the code below if // a timezone is not defined elsewhere in your environment // date_default_timezone_set('UTC');