本文整理汇总了PHP中func_get_args函数的典型用法代码示例。如果您正苦于以下问题:PHP func_get_args函数的具体用法?PHP func_get_args怎么用?PHP func_get_args使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了func_get_args函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: command_dd
function command_dd()
{
$args = func_get_args();
$options = $this->get_options();
$dd = kernel::single('dev_docbuilder_dd');
if (empty($args)) {
$dd->export();
} else {
foreach ($args as $app_id) {
$dd->export_tables($app_id);
}
}
if ($filename = $options['result-file']) {
ob_start();
$dd->output();
$out = ob_get_contents();
ob_end_clean();
if (!is_dir(dirname($filename))) {
throw new Exception('cannot find the ' . dirname($filename) . 'directory');
} elseif (is_dir($filename)) {
throw new Exception('the result-file path is a directory.');
}
file_put_contents($options['result-file'], $out);
echo 'data dictionary doc export success.';
} else {
$dd->output();
}
}
开发者ID:sss201413,项目名称:ecstore,代码行数:28,代码来源:doc.php
示例2: display
/**
* Displays a view
*
* @param mixed What page to display
* @return void
* @throws NotFoundException When the view file could not be found
* or MissingViewException in debug mode.
*/
public function display()
{
$path = func_get_args();
//debug($path);
$count = count($path);
//debug($count);
if (!$count) {
return $this->redirect('/');
}
$page = $subpage = $title_for_layout = null;
//debug(Inflector::humanize($path[$count - 1]));
if (!empty($path[0])) {
$page = $path[0];
}
if (!empty($path[1])) {
$subpage = $path[1];
}
if (!empty($path[$count - 1])) {
$title_for_layout = Inflector::humanize($path[$count - 1]);
}
$this->set(compact('page', 'subpage', 'title_for_layout'));
//debug($this->render(implode('/', $path)));
//debug($page);
//debug($subpage);
//debug($title_for_layout);
try {
$this->render(implode('/', $path));
} catch (MissingViewException $e) {
if (Configure::read('debug')) {
throw $e;
}
throw new NotFoundException();
}
}
开发者ID:pavsnellski,项目名称:SMC,代码行数:42,代码来源:PagesController.php
示例3: testCodePageNumberToName
/**
* @dataProvider providerCodePage
*/
public function testCodePageNumberToName()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_CodePage', 'NumberToName'), $args);
$this->assertEquals($expectedResult, $result);
}
开发者ID:rodrigopbel,项目名称:ong,代码行数:10,代码来源:CodePageTest.php
示例4: value
/**
* Gets or sets the inner value
*
* @param string $value
* @return string
*/
public function value()
{
if ($args = func_get_args()) {
$this->__value = $args[0];
}
return $this->__value;
}
开发者ID:dsi-agpt,项目名称:cdmfr,代码行数:13,代码来源:Searchword.php
示例5: __
/**
* Translate a phrase
*
* @return string
*/
public function __()
{
$args = func_get_args();
$expr = new Mage_Core_Model_Translate_Expr(array_shift($args), $this->_getRealModuleName());
array_unshift($args, $expr);
return AO::app()->getTranslator()->translate($args);
}
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:12,代码来源:Action.php
示例6: dd
/**
* Dump & Die
*
* @codeCoverageIgnore
*/
function dd()
{
array_map(function ($x) {
var_dump($x);
}, func_get_args());
die;
}
开发者ID:arcanedev,项目名称:arabic,代码行数:12,代码来源:helpers.php
示例7: query
/**
* {@inheritDoc}
*/
public function query(Query $query)
{
$this->logger->startCall(__FUNCTION__, func_get_args(), array('fetchDepth' => $this->transport->getFetchDepth()));
$result = $this->transport->query($query);
$this->logger->stopCall();
return $result;
}
开发者ID:nikophil,项目名称:cmf-tests,代码行数:10,代码来源:LoggingClient.php
示例8: index
public function index()
{
$this->load->model('printing_model');
$this->load->model('settings_model');
$this->load->model('contests_model');
$arg_list = func_get_args();
$contest = $this->contests_model->getCurrentContest();
$points_table_used = $this->contests_model->getPointsUsed();
if (!$this->contests_model->table_exists($points_table_used) or $this->contests_model->tableEmpty($points_table_used)) {
redirect("/competitors?redirected_from='site.php'");
}
$data['all_input_tables'] = $this->printing_model->allWrittenInputTables($contest);
$data['all_charters'] = $this->printing_model->allWrittenCharters($contest);
$data['gcp_status'] = $this->settings_model->getGCPStatus();
if (!$this->printing_model->printerConfigured()) {
$data['printer_set_up'] = FALSE;
}
if ($this->input->get('class_selection') and $this->input->get('print_function')) {
$this->load->model('classes_model');
$data['class_selection']['class_id'] = $this->input->get('class_selection');
$data['class_selection']['class_name'] = $this->classes_model->getClassName($data['class_selection']['class_id']);
$data['print_function'] = $this->input->get('print_function');
}
if (isset($arg_list[0]['input_tables']['printing']['status']['completed']) && $arg_list[0]['input_tables']['printing']['status']['completed']) {
$data['input_tables']['printing']['status']['completed'] = $arg_list[0]['input_tables'];
}
if (isset($arg_list[0]['error']['uncomplete']) && $arg_list[0]['error']['uncomplete']) {
$data['error']['uncomplete'] = true;
}
$data['main_content'] = 'printing_view.php';
$this->load->view('/includes/template.php', $data);
}
开发者ID:kilianvolmer,项目名称:GiegSports,代码行数:32,代码来源:printing.php
示例9: plugin_fusen_convert
function plugin_fusen_convert()
{
$prms = func_get_args();
if (isset($prms[0]) && $prms[0] === 'spliter' && isset($prms[1])) {
$id = intval($prms[1]);
return '<!--NA-->' . $this->conf['spliter'] . $id . '<!--/NA-->';
}
$base = '';
$divclass = 'xpwiki_' . $this->root->mydirname;
$res = array();
if ($this->root->render_mode === 'render') {
return '';
} else {
if ($this->root->render_mode === 'block') {
if (empty($GLOBALS['Xpwiki_' . $this->root->mydirname]['is_read']) || !empty($GLOBALS['Xpwiki_' . $this->root->mydirname]['cache']['fusen']['loaded'])) {
return '';
}
$res = $this->func->set_current_page($GLOBALS['Xpwiki_' . $this->root->mydirname]['page']);
$base = 'xpwiki_body';
$divclass = 'xpwiki_b_' . $this->root->mydirname;
$this->root->pagecache_min = 0;
}
}
$html = $this->get_html(func_get_args(), $base, $divclass);
if ($res) {
$this->func->set_current_page($res['page']);
}
return $html;
}
开发者ID:nouphet,项目名称:rata,代码行数:29,代码来源:fusen.inc.php
示例10: instance
/**
* Returns an instance of the singleton.
*
* Passes args to constructor
*/
public static final function instance()
{
if (null === static::$_instance) {
static::$_instance = new self(func_get_args());
}
return self::$_instance;
}
开发者ID:prggmr,项目名称:xpspl,代码行数:12,代码来源:singleton.php
示例11: getAttributesByKey
public function getAttributesByKey()
{
$_aParams = func_get_args() + array(0 => '');
$_sKey = $_aParams[0];
$_bIsMultiple = '' !== $_sKey;
return $this->getElement($this->aAttributes, $_sKey, array()) + array('type' => 'checkbox', 'id' => $this->aAttributes['id'] . '_' . $_sKey, 'checked' => $this->getElement($this->aAttributes, array('value', $_sKey), null) ? 'checked' : null, 'value' => 1, 'name' => $_bIsMultiple ? "{$this->aAttributes['name']}[{$_sKey}]" : $this->aAttributes['name'], 'data-id' => $this->aAttributes['id']) + $this->aAttributes;
}
开发者ID:sultann,项目名称:admin-page-framework,代码行数:7,代码来源:AdminPageFramework_Input_checkbox.php
示例12: _activeHook
private function _activeHook($type)
{
if (!isset($this->_hooks[$type])) {
return null;
}
$hook =& $this->_hooks[$type];
global $_G;
if (!in_array($hook['plugin'], $_G['setting']['plugins']['available'])) {
return null;
}
if (!preg_match("/^[\\w\\_]+\$/i", $hook['plugin']) || !preg_match('/^[\\w\\_\\.]+\\.php$/i', $hook['include'])) {
return null;
}
include_once DISCUZ_ROOT . 'source/plugin/' . $hook['plugin'] . '/' . $hook['include'];
if (!class_exists($hook['class'], false)) {
return null;
}
if (!isset($this->classes[$hook['class']])) {
$this->classes[$hook['class']] = new $hook['class']();
}
if (!method_exists($this->classes[$hook['class']], $hook['method'])) {
return null;
}
$param = func_get_args();
array_shift($param);
return $this->classes[$hook['class']]->{$hook}['method']($param);
}
开发者ID:hacktea8,项目名称:d_z_s_t_u_d_e_n_t,代码行数:27,代码来源:wechat.lib.class.php
示例13: dump
/**
* Nette\Diagnostics\Debugger::dump() shortcut.
* @tracySkipLocation
*/
function dump($var)
{
foreach (func_get_args() as $arg) {
Debugger::dump($arg);
}
return $var;
}
开发者ID:Johnik010,项目名称:rezervace,代码行数:11,代码来源:shortcuts.php
示例14: query
/**
* Query database
*
* @param string $sql SQL Query
* @param array|string $replacement Replacement
* @return mixed
*/
public function query()
{
$args = func_get_args();
$sql = array_shift($args);
// Menerapkan $replacement ke pernyataan $sql
if (!empty($args)) {
$sql = vsprintf($sql, $args);
}
try {
// Return 'false' kalo belum ada koneksi
if (!$this->_db) {
$this->connect();
}
$this->_sql = $sql;
// Eksekusi SQL Query
if ($results = $this->_db->query($sql)) {
if (is_bool($results)) {
return $results;
}
$this->_results = $results;
$this->_num_rows = $this->_results->num_rows;
return $this;
} else {
App::error($this->_db->error . '<br>' . $this->_sql);
}
} catch (Exception $e) {
setAlert('error', $e->getMessage());
return false;
}
}
开发者ID:tommyputranto,项目名称:tokonlen,代码行数:37,代码来源:Db.php
示例15: TR
function TR()
{
// writes a table row using row_data to fill the td's.
// nothing else is needed, since colors and fonts will be
// determined by the style sheet.
//
// Optionally a 2nd parameter may be provided, tr_param,
// which can contain any parameters to the <tr> tag..
$arg = func_get_args();
if (count($arg) > 1) {
list($row_data, $tr_param) = $arg;
} else {
$row_data = $arg[0];
$tr_param = null;
}
echo "<tr";
if ($tr_param) {
echo " {$tr_param}";
}
echo ">\n";
foreach ($row_data as $td_data) {
echo "\t<td>{$td_data}</td>\n";
}
echo "</tr>\n";
}
开发者ID:thctlo,项目名称:1.2.0,代码行数:25,代码来源:msre_table_functions.php
示例16: all
/**
* Returns all of the attributes in the collection
*
* If an optional mask array is passed, this only
* returns the keys that match the mask
*
* @param array $mask The parameter mask array
* @access public
* @return array
*/
public function all($mask = null)
{
if (null !== $mask) {
// Support a more "magical" call
if (!is_array($mask)) {
$mask = func_get_args();
}
/*
* Remove all of the keys from the attributes
* that aren't in the passed mask
*/
$attributes = array_intersect_key($this->attributes, array_flip($mask));
/*
* Make sure that each key in the mask has at least a
* null value, since the user will expect the key to exist
*/
foreach ($mask as $key) {
if (!isset($attributes[$key])) {
$attributes[$key] = null;
}
}
return $attributes;
}
return $this->attributes;
}
开发者ID:harmjanhaisma,项目名称:PocketMine-Realms,代码行数:35,代码来源:DataCollection.php
示例17: getUrl
/**
* Set asset url path
*
* @param string $path
* @param null $packageName
* @param null $version
* @param bool|false $absolute
* @param bool|false $ignorePrefix
*
* @return string
*/
public function getUrl($path, $packageName = null, $version = null)
{
// Dirty hack to work around strict notices with parent::getUrl
$absolute = $ignorePrefix = false;
if (func_num_args() > 3) {
$args = func_get_args();
$absolute = $args[3];
if (isset($args[4])) {
$ignorePrefix = $args[4];
}
}
// if we have http in the url it is absolute and we can just return it
if (strpos($path, 'http') === 0) {
return $path;
}
// otherwise build the complete path
if (!$ignorePrefix) {
$assetPrefix = $this->getAssetPrefix(strpos($path, '/') !== 0);
$path = $assetPrefix . $path;
}
$url = parent::getUrl($path, $packageName, $version);
if ($absolute) {
$url = $this->getBaseUrl() . $url;
}
return $url;
}
开发者ID:Jandersolutions,项目名称:mautic,代码行数:37,代码来源:AssetsHelper.php
示例18: run
/**
* Benchmarks a function.
*
* @access public
*/
function run()
{
$arguments = func_get_args();
$iterations = array_shift($arguments);
$function_name = array_shift($arguments);
if (strstr($function_name, '::')) {
$function_name = explode('::', $function_name);
$objectmethod = $function_name[1];
}
// If we're calling a method on an object use call_user_func
if (strstr($function_name, '->')) {
$function_name = explode('->', $function_name);
$objectname = $function_name[0];
global ${$objectname};
$objectmethod = $function_name[1];
for ($i = 1; $i <= $iterations; $i++) {
$this->setMarker('start_' . $i);
call_user_func_array(array(${$objectname}, $function_name[1]), $arguments);
$this->setMarker('end_' . $i);
}
return 0;
}
for ($i = 1; $i <= $iterations; $i++) {
$this->setMarker('start_' . $i);
call_user_func_array($function_name, $arguments);
$this->setMarker('end_' . $i);
}
}
开发者ID:amjadtbssm,项目名称:website,代码行数:33,代码来源:Iterate.php
示例19: getSingleton
public function getSingleton()
{
if (!isset($this->instance)) {
$this->instance = call_user_func_array([$this, 'getInstance'], func_get_args());
}
return $this->instance;
}
开发者ID:quallsbenson,项目名称:utility-object,代码行数:7,代码来源:ObjectWrapper.php
示例20: __construct
/**
* Default constructor
* @param value some value
*/
function __construct()
{
$args = func_get_args();
if (func_num_args() == 1) {
$this->init($args[0]);
}
}
开发者ID:renduples,项目名称:alibtob,代码行数:11,代码来源:Albumtype.php
注:本文中的func_get_args函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论