本文整理汇总了PHP中pts_client::init方法的典型用法代码示例。如果您正苦于以下问题:PHP pts_client::init方法的具体用法?PHP pts_client::init怎么用?PHP pts_client::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pts_client
的用法示例。
在下文中一共展示了pts_client::init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
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/>.
*/
// INIT
define('PHOROMATIC_SERVER', true);
define('REMOTE_ACCESS', true);
// XXX TODO: Is this still used with new Phoromatic?
//ini_set('memory_limit', '64M');
define('PTS_MODE', 'WEB_CLIENT');
define('PTS_AUTO_LOAD_OBJECTS', true);
error_reporting(E_ALL);
include '../../pts-core.php';
pts_client::init();
$environmental_variables = array('aid' => 'ACCOUNT_ID', 'sid' => 'SYSTEM_ID', 'bid' => 'BENCHMARK_TICKET_ID', 'gsid' => 'GSID', 'a' => 'ACTIVITY', 'r' => 'REQUEST', 'pts' => 'CLIENT_VERSION', 'pts_core' => 'CLIENT_CORE_VERSION', 'h' => 'CLIENT_HARDWARE', 's' => 'CLIENT_SOFTWARE', 'i' => 'ID', 'o' => 'OTHER', 'nm' => 'NETWORK_CLIENT_MAC', 'nw' => 'NETWORK_CLIENT_WOL', 'n' => 'HOSTNAME', 'ti' => 'TEST_IDENTIFIER', 'ts' => 'TRIGGER_STRING', 'time' => 'ESTIMATED_TIME', 'pc' => 'PERCENT_COMPLETE', 'c' => 'COMPOSITE_XML', 'ob' => 'OPENBENCHMARKING_ID', 'sched' => 'SCHEDULE_ID', 'lip' => 'LOCAL_IP', 'j' => 'JSON', 'composite_xml' => 'COMPOSITE_XML', 'composite_xml_gz' => 'COMPOSITE_XML_GZ', 'composite_xml_hash' => 'COMPOSITE_XML_HASH', 'system_logs_zip' => 'SYSTEM_LOGS_ZIP', 'system_logs_hash' => 'SYSTEM_LOGS_HASH', 'msi' => 'PTS_MACHINE_SELF_ID', 'err' => 'ERROR_MSG', 'et' => 'ELAPSED_TIME');
foreach ($environmental_variables as $get_var => $to_var) {
if (isset($_REQUEST[$get_var]) && !empty($_REQUEST[$get_var])) {
${$to_var} = $_REQUEST[$get_var];
} else {
${$to_var} = null;
}
}
if ($CLIENT_CORE_VERSION < 5312) {
// Due to major PTS 5.4 development changes, client version bump will be necessary
$json['phoromatic']['error'] = 'You must update your Phoronix Test Suite clients for compatibility with this Phoromatic server.';
echo json_encode($json);
exit;
}
// DATABASE SETUP
示例2: phoromatic_init_web_page_setup
function phoromatic_init_web_page_setup()
{
if (session_save_path() == null) {
// This is needed since on at least EL6 by default there is no session_save_path set
if (is_writable('/var/lib/php') && is_dir('/var/lib/php')) {
session_save_path('/var/lib/php');
} else {
if (is_writable('/var/lib/php5') && is_dir('/var/lib/php5')) {
session_save_path('/var/lib/php5');
} else {
session_save_path('/tmp');
}
}
}
define('PHOROMATIC_SERVER', true);
error_reporting(E_ALL);
session_start();
define('PTS_MODE', 'WEB_CLIENT');
define('PTS_AUTO_LOAD_OBJECTS', true);
define('PHOROMATIC_USER_IS_VIEWER', !isset($_SESSION['AdminLevel']) || $_SESSION['AdminLevel'] >= 10 || $_SESSION['AdminLevel'] < 1 ? true : false);
include '../../pts-core.php';
pts_client::init();
}