本文整理汇总了PHP中Controller::call方法的典型用法代码示例。如果您正苦于以下问题:PHP Controller::call方法的具体用法?PHP Controller::call怎么用?PHP Controller::call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Controller
的用法示例。
在下文中一共展示了Controller::call方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_scan_mkt
public function get_scan_mkt()
{
register_shutdown_function(function () {
Controller::call('Market_Parser@scan_market_files');
});
return Response::json(array('TDDB:' => 'Markettime: processing'));
}
示例2: get_scan_pvpstats
public function get_scan_pvpstats()
{
register_shutdown_function(function () {
Controller::call('PVPStats_Parser@scan_pvpstats_files');
});
return Response::json(array('TDDB:' => 'PVPStatstime: processing'));
}
示例3: testIssues
public function testIssues()
{
Bundle::start('flyswatter');
// Seed Database
Controller::call('flyswatter::seed@seed');
$issue = Issue::find(1);
$this->assertNotNull($issue->id);
}
示例4: function
Auth::logout();
return Redirect::to('login');
});
Route::get('admin/logout', function () {
Session::flush();
Auth::logout();
return Redirect::to('admin/login');
});
Route::get('fileupload', function () {
return View::make('fileinclude');
});
Route::post('fileupload', 'FiletestController@indx');
Route::get('admin/emergencyUse', 'AdminController@emergencyUse');
Route::get('admin/emergencyUse12', 'AdminController@emergencyUse12');
Route::get('admin/listusers/(:any)/(:any)', function ($event, $userid) {
return Controller::call('AdminController@singleuser', array('event' => $event, 'userid' => $userid));
});
Route::controller('admin', 'AdminController');
Route::controller('sales', 'SalesController');
Route::controller('event1/rankingform', 'RankingformController');
Route::controller('event2/rankingform', 'RankingformController');
Route::controller('rescom_summit_bangalore_2016/rankingform', 'RankingformController');
Route::controller('hotelier_summit_mumbai_2016/rankingform', 'RankingformController');
Route::controller('hotelier_summit_africa_2016/rankingform', 'RankingformController');
Route::controller('design_mission_saudi_arabia_2016/rankingform', 'RankingformController');
Route::controller('design_mission_north_east_2016/rankingform', 'RankingformController');
Route::controller('design_mission_south_west_2016/rankingform', 'RankingformController');
Route::controller('design_mission_middle_east_2016/rankingform', 'RankingformController');
Route::controller('design_mission_south_africa_2016/rankingform', 'RankingformController');
Route::controller('design_mission_turkey_2016/rankingform', 'RankingformController');
Route::controller('design_mission_asia_2016/rankingform', 'RankingformController');
示例5: isset
require_once 'api/controller.php';
$method = isset($_REQUEST['analize']) && $_REQUEST['analize'] ? 'analize' : 'parse';
$file = false;
if (isset($_FILES['files'])) {
$file = file_get_contents($_FILES['files']['tmp_name'][0], $_FILES['files']['size'][0]);
} else {
if (isset($_REQUEST['data'])) {
$file = $_REQUEST['data'];
} else {
if (isset($_FILES['data'])) {
$file = file_get_contents($_FILES['data']['tmp_name']);
}
}
}
if ($file) {
$args = Controller::call($method, array('service' => $_REQUEST['type']), $file, $_REQUEST['params']);
} else {
$args = array('Error' => 'No source file');
}
if (isset($args[0]) && empty($args[0])) {
echo json_encode($args);
} else {
if (!isset($_REQUEST['readable']) || !$_REQUEST['readable']) {
require_once 'Sync.php';
$args = toUtf8($args);
echo json_encode($args);
} else {
print_r(serialize($args));
}
}
function srtToUtf8($data)
示例6: function
// EMAIL CONTROLLER
Route::get(ADM_URI . '/(:bundle)', function () {
return Controller::call('email::backend.email.email@index');
});
Route::put(ADM_URI . '/(:bundle)', function () {
return Controller::call('email::backend.email.email@update');
});
Route::get(ADM_URI . '/(:bundle)/new', function () {
return Controller::call('email::backend.email.email@new');
});
Route::post(ADM_URI . '/(:bundle)', function () {
return Controller::call('email::backend.email.email@create');
});
// Used by ajax to create users drop
// down when selecting/filtering users
// to send an email
Route::post(ADM_URI . '/(:bundle)/get_users', function () {
return Controller::call('email::backend.email.email@get_users');
});
// Route::post(ADM_URI.'/(:bundle)/order', function()
// {
// return Controller::call('email::backend.email@order');
// });
// Route::any(ADM_URI.'/(:bundle)', function()
// {
// return Controller::call('email::backend.email@index');
// });
// Route::any(ADM_URI.'/(:bundle)/(:any)/(:any?)', function($method, $parameter = null)
// {
// return Controller::call("email::backend.email@{$method}", array($parameter) );
// });
示例7: post
public function post($request)
{
// to Receive POST Params (use $this->params)
parent::post($request);
$user_id = $this->getUserId();
$tz_offset = $this->getTimezoneOffset();
if ($this->isLoggedIn()) {
$date_start = $this->getParam('dateStart');
$date_end = $this->getParam('dateEnd');
// check the dates parameters formats (ex: 31/12/2012 23:59:59, but the time is optional)
$regex_date = '/^(0[1-9]|[12][0-9]|3[01])\\/(0[1-9]|1[0-2])\\/([12][0-9]{3})( ([01][0-9]|2[0-3])(:[0-5][0-9]){2})?$/';
if (!preg_match($regex_date, $date_start)) {
Errors::runException("CALENDAR_INVALID_START_DATE");
}
if (!preg_match($regex_date, $date_end)) {
Errors::runException("CALENDAR_INVALID_END_DATE");
}
// get the start timestamp UNIX from the parameter
$start_arr = explode(' ', $date_start);
$start_date_arr = explode('/', $start_arr[0]);
$start_time_arr = !empty($start_arr[1]) ? explode(':', $start_arr[1]) : array('00', '00', '00');
$rangeStart = mktime($start_time_arr[0], $start_time_arr[1], $start_time_arr[2], $start_date_arr[1], $start_date_arr[0], $start_date_arr[2]) - $tz_offset;
// get the end timestamp UNIX from the parameter
$end_arr = explode(' ', $date_end);
$end_date_arr = explode('/', $end_arr[0]);
$end_time_arr = !empty($end_arr[1]) ? explode(':', $end_arr[1]) : array('23', '59', '59');
$rangeEnd = mktime($end_time_arr[0], $end_time_arr[1], $end_time_arr[2], $end_date_arr[1], $end_date_arr[0], $end_date_arr[2]) - $tz_offset;
$rangeStart = $rangeStart * 1000;
$rangeEnd = $rangeEnd * 1000;
$concept = "schedulable";
$id = false;
$criteria = array();
$criteria['order'] = "startTime";
$criteria['deepness'] = 2;
$criteria['timezones'] = array();
$criteria['timezones'][1] = 'America/Sao_Paulo';
$criteria['timezones'][3] = 'America/Sao_Paulo';
$criteria['filter'] = array();
$criteria['filter'][0] = "AND";
$criteria['filter'][1] = array();
$criteria['filter'][1][0] = "OR";
$criteria['filter'][1][1] = array();
$criteria['filter'][1][1][0] = "AND";
$criteria['filter'][1][1][1] = array();
$criteria['filter'][1][1][1][0] = ">=";
$criteria['filter'][1][1][1][1] = "rangeEnd";
$criteria['filter'][1][1][1][2] = $rangeStart;
//START
$criteria['filter'][1][1][2] = array();
$criteria['filter'][1][1][2][0] = "=<";
$criteria['filter'][1][1][2][1] = "rangeEnd";
$criteria['filter'][1][1][2][2] = $rangeEnd;
//END
$criteria['filter'][1][2] = array();
$criteria['filter'][1][2][0] = "AND";
$criteria['filter'][1][2][1] = array();
$criteria['filter'][1][2][1][0] = ">=";
$criteria['filter'][1][2][1][1] = "rangeStart";
$criteria['filter'][1][2][1][2] = $rangeStart;
//START
$criteria['filter'][1][2][2] = array();
$criteria['filter'][1][2][2][0] = "=<";
$criteria['filter'][1][2][2][1] = "rangeStart";
$criteria['filter'][1][2][2][2] = $rangeEnd;
//END
$criteria['filter'][1][3] = array();
$criteria['filter'][1][3][0] = "AND";
$criteria['filter'][1][3][1] = array();
$criteria['filter'][1][3][1][0] = "<=";
$criteria['filter'][1][3][1][1] = "rangeStart";
$criteria['filter'][1][3][1][2] = $rangeStart;
//START
$criteria['filter'][1][3][2] = array();
$criteria['filter'][1][3][2][0] = ">=";
$criteria['filter'][1][3][2][1] = "rangeEnd";
$criteria['filter'][1][3][2][2] = $rangeEnd;
//END
$criteria['filter'][2] = array("IN", "calendar", array(1));
$properties = $criteria && isset($criteria['properties']) ? $criteria['properties'] : false;
$service = $criteria && isset($criteria['service']) ? $criteria['service'] : false;
$res = Controller::call('find', Controller::URI($concept), false, $criteria);
$arrEvents = array();
foreach ($res as $event) {
$timeZone = new DateTimeZone($event['timezone']);
$timeStart = new DateTime('@' . (int) ($event['startTime'] / 1000), $timeZone);
$timeEnd = new DateTime('@' . (int) ($event['endTime'] / 1000), $timeZone);
$timeStart->setTimezone($timeZone);
$timeEnd->setTimezone($timeZone);
$newEvent = array();
$newEvent['eventID'] = "" . $event['id'];
$newEvent['eventName'] = "" . $event['summary'];
$newEvent['eventDescription'] = "" . $event['description'];
$newEvent['eventLocation'] = "" . $event['location'];
$newEvent['eventStartDate'] = "" . $timeStart->format('d/m/Y H:i:s');
$newEvent['eventEndDate'] = "" . $timeEnd->format('d/m/Y H:i:s');
//$newEvent['eventTimeZone'] = "" . $event['timezone'];
$newEvent['eventAllDay'] = "" . $event['allDay'];
$arrEvents[] = $newEvent;
}
$result = array('events' => $arrEvents);
//.........这里部分代码省略.........
示例8: deleteSchedulable
public function deleteSchedulable(&$uri, &$params, &$criteria, $original)
{
if (Config::module('useCaldav', 'expressoCalendar')) {
require_once ROOTPATH . '/modules/calendar/interceptors/DAViCalAdapter.php';
}
if (isset($criteria['filter']) && $criteria['filter'] && isset($criteria['filter'][1][2])) {
$idSchedulable = $criteria['filter'][1][2];
$idCalendar = $criteria['filter'][2][2];
$owner = $criteria['filter'][3][2];
$qtdMyCalendars = self::countMyCalendarsEvent($idSchedulable, $owner);
$link = Controller::read(array('concept' => 'calendarToSchedulable'), false, array('filter' => array('AND', array('=', 'calendar', $idCalendar), array('=', 'schedulable', $idSchedulable))));
$link = is_array($link) && isset($link[0]) ? $link[0] : $link;
$calendar = Controller::read(array('concept' => 'calendar'), false, array('filter' => array('=', 'id', $idCalendar)));
$calendar = is_array($calendar) && isset($calendar[0]) ? $calendar[0] : $calendar;
if ($isAttende = !self::ownerSchedulable($idSchedulable, $owner)) {
Controller::delete(array('concept' => 'calendarToSchedulable', 'id' => $link['id']));
if ($qtdMyCalendars <= 1) {
$participant = Controller::read(array('concept' => 'participant'), array('id'), array('filter' => array('AND', array('=', 'user', $owner), array('=', 'schedulable', $idSchedulable))));
Controller::call('update', array('concept' => 'participant', 'id' => $participant[0]['id']), array('status' => STATUS_CANCELLED));
}
} else {
if ($qtdMyCalendars > 1) {
Controller::delete(array('concept' => 'calendarToSchedulable', 'id' => $link['id']));
}
}
if (Config::module('useCaldav', 'expressoCalendar')) {
DAViCalAdapter::deleteEvent($idSchedulable, array('location' => $calendar['location']));
}
if ($isAttende || $qtdMyCalendars > 1) {
return false;
}
$uri['id'] = $idSchedulable;
if (isset($criteria['type']) && $criteria['type'] == '2') {
$tasks = Controller::find(array('concept' => 'taskToActivity'), array('task'), array('filter' => array('=', 'activity', $idSchedulable)));
if (is_array($tasks) and count($tasks) > 0) {
Controller::delete(array('concept' => 'taskToActivity'), null, array('filter' => array('=', 'activity', $idSchedulable)));
}
if (isset($criteria['removeTaskToActivity']) && $criteria['removeTaskToActivity']) {
if (is_array($tasks) and count($tasks) > 0) {
$ids = array();
foreach ($tasks as $v) {
$ids[] = $v['task'];
}
Controller::delete(array('concept' => 'schedulable'), false, array('filter' => array('IN', 'id', $ids)));
}
}
}
}
}
示例9: put
public static function put($URI, $data, &$txIds = NULL)
{
try {
$URI = self::serviceName($URI);
if ($commit = !$txIds) {
$txIds = array();
}
if (!isset(self::$tx[$URI['service']])) {
self::call('begin', $URI);
self::$tx[$txIds[] = $URI['service']] = array();
}
$method = $data ? isset($data['id']) ? 'update' : 'create' : 'delete';
$links = self::links($URI['concept']);
$order = self::$txID++;
$postpone = array();
$linkNames = array();
if ($data) {
$URI['id'] = isset($data['id']) ? $data['id'] : false;
foreach ($links as $linkName => $linkTarget) {
if (isset($data[$linkName]) && is_array($data[$linkName])) {
if (self::isConcept($URI['concept'], $linkName)) {
$data[$linkName] = self::put(array('concept' => $linkTarget), $data[$linkName], $txIds);
} else {
$postpone[$linkTarget] = $data[$linkName];
$linkNames[$linkTarget] = $linkName;
}
}
}
} else {
$URI['id'] = isset($data['id']) ? $data['id'] : $URI['id'];
}
$result = Controller::call($method, $URI, $data, false, false, true);
if (is_array($result) && isset($result['id'])) {
$URI['id'] = $result['id'];
}
$index = count(self::$tx[$URI['service']]) - 1;
self::$tx[$URI['service']][$index]['order'] = $order;
self::$tx[$URI['service']][$index]['id'] = $URI['id'];
if (!isset(self::$tx[$URI['service']][$index]['concept'])) {
self::$tx[$URI['service']][$index]['concept'] = $URI['concept'];
}
foreach ($postpone as $linkTarget => $dt) {
if (Controller::hasOne($URI['concept'], $linkNames[$linkTarget])) {
$dt = array($dt);
}
foreach ($dt as $ii => $value) {
if (!is_array($value)) {
$value = array('id' => $value);
}
$value[self::links($URI['concept'], $linkNames[$linkTarget])] = $URI['id'];
self::put(array('concept' => $linkTarget), $value, $txIds);
}
}
if ($commit) {
$result = array();
for ($i = count($txIds) - 1; $i >= 0; $i--) {
$currentTx = self::$tx[$txIds[$i]];
unset(self::$tx[$txIds[$i]]);
if (!self::commit(array('service' => $txIds[$i]), $currentTx)) {
self::rollback(array('service' => $txIds[$i]), $currentTx);
foreach ($currentTx as $i => $st) {
$currentTx[$i]['rollback'] = true;
}
}
$result = array_merge($result, $currentTx);
}
self::$txID = 0;
return $result;
}
} catch (Exception $e) {
if (!self::fallback($e, $URI)) {
self::closeAll();
}
return false;
}
return $URI['id'];
}
示例10: function
<?php
/*
|--------------------------------------------------------------------------
| Molpay Bundle Routes
|--------------------------------------------------------------------------
*/
Route::post('(:bundle)/callback', function () {
return Controller::call('molpay::callback@index');
});
Route::post('(:bundle)/push', function () {
return Controller::call('molpay::callback@push');
});
示例11: array
return Controller::call('navigation::backend.navigation.groups@destroy', array($parameter));
});
/////////////////////////////////
//////////// LINKS //////////////
/////////////////////////////////
// SHOW
Route::get(ADM_URI . '/(:bundle)/links/(:num)', function ($parameter) {
return Controller::call('navigation::backend.navigation.links@show', array($parameter));
});
Route::get(ADM_URI . '/(:bundle)/links/(:num)/edit', function ($parameter) {
return Controller::call('navigation::backend.navigation.links@edit', array($parameter));
});
// UPDATE
Route::put(ADM_URI . '/(:bundle)/links/(:num)', function ($parameter) {
return Controller::call('navigation::backend.navigation.links@update', array($parameter));
});
// NEW
// not following the convention
// since we need to pass the group
// id where this link will be created
Route::get(ADM_URI . '/(:bundle)/links/new/(:num)', function ($parameter) {
return Controller::call('navigation::backend.navigation.links@new', array($parameter));
});
// CREATE
Route::post(ADM_URI . '/(:bundle)/links', function () {
return Controller::call('navigation::backend.navigation.links@create');
});
// DELETE
Route::delete(ADM_URI . '/(:bundle)/links/(:num)', function ($parameter) {
return Controller::call('navigation::backend.navigation.links@destroy', array($parameter));
});
示例12: isset
// $properties = $_REQUEST['properties'];
// $limit = $_REQUEST['limit'];
// $offset = $_REQUEST['offset'];
// $group = $_REQUEST['group'];
// $order = $_REQUEST['join'];
// $filter = $_REQUEST['filter'];
// $URI = $_REQUEST['URI'];
$concept = isset($_REQUEST['concept']) ? $_REQUEST['concept'] : false;
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : false;
$filter = isset($_REQUEST['filter']) ? $_REQUEST['filter'] : false;
$criteria = isset($_REQUEST['criteria']) ? $_REQUEST['criteria'] : false;
$criteria = $filter ? $criteria ? array_merge($criteria, array('filter' => $filter)) : array('filter' => $filter) : $criteria;
$properties = $criteria && isset($criteria['properties']) ? $criteria['properties'] : false;
$service = $criteria && isset($criteria['service']) ? $criteria['service'] : false;
require_once 'api/controller.php';
///Conversor Para utf8 ante de codificar para json pois o json so funciona com utf8
function toUtf8($data)
{
if (!is_array($data)) {
return mb_convert_encoding($data, 'UTF-8', 'UTF-8 , ISO-8859-1');
}
$return = array();
foreach ($data as $i => $v) {
$return[toUtf8($i)] = toUtf8($v);
}
return $return;
}
////////////////////////////////////////////////////////////////////////////////////////
echo json_encode(toUtf8(Controller::call($id ? 'read' : 'find', Controller::URI($concept, $id, $service), $properties, $criteria)));
Controller::closeAll();
示例13: testControllersContainKeyData
/**
* Test controllers contain all relevent view data
*/
public function testControllersContainKeyData()
{
$this->assertArrayHasKey('projects', Controller::call('flyswatter::home@index')->content->data);
$this->assertArrayHasKey('title', Controller::call('flyswatter::home@index')->content->data);
}
示例14: testCallbackRequestWithProvider
/**
* Test OneAuth\Auth\Controller::action_callback() with valid provider
*
* @test
*/
public function testCallbackRequestWithProvider()
{
$response = Controller::call('oneauth::connect@callback', array('twtter'));
$this->assertInstanceOf('Laravel\\Response', $response);
$this->assertEquals(200, $response->foundation->getStatusCode());
}
示例15: testTheTemplateCanBeOverriden
/**
* Test that the "layout" method is called on the controller.
*
* @group laravel
*/
public function testTheTemplateCanBeOverriden()
{
$this->assertEquals('Layout', Controller::call('template.override@index')->content);
}