本文整理汇总了PHP中logThis函数的典型用法代码示例。如果您正苦于以下问题:PHP logThis函数的具体用法?PHP logThis怎么用?PHP logThis使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了logThis函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
/**
* Update a provisioning record
*/
public function update(ProvisioningRequest $request, Provisioning $provisioning)
{
$provisioning->update($request->all());
$this->dispatch(new RewriteDhcpConfig());
logThis('Provisioning event: ' . $provisioning->customer->name . ' was reprovisioned to ' . $provisioning->ontconfig->software->ont->model . '/' . $provisioning->ontconfig->software->version . '/' . $provisioning->ontconfig->name . ' on ' . $provisioning->access_switch_port->nice_name);
return $provisioning;
}
示例2: handle
/**
* Handle the event.
*
* @param AccessSwitchSlotWasModified $event
* @return void
*/
public function handle(SlotModuleWasChanged $event)
{
$original_slot_module = $event->access_switch_slot;
$new_slot_module = AccessSwitchSlot::findOrFail($original_slot_module->id);
$originalPortCount = $original_slot_module->module_type->number_of_ports;
$originalModuleType = $original_slot_module->module_type->name;
$newPortCount = $new_slot_module->module_type->number_of_ports;
$newModuleType = $new_slot_module->module_type->name;
$switchName = $new_slot_module->access_switch->name;
$slotNumber = $new_slot_module->slot_number;
if ($original_slot_module->module_type->empty_slot) {
// If the original state was empty, we only need to add ports
for ($port_number = 1; $port_number <= $newPortCount; $port_number++) {
$new_slot_module->ports()->create(['port_number' => $port_number]);
}
logThis($newModuleType . ' added to ' . $switchName . ' slot ' . $slotNumber);
} else {
// First remove any ports associated with the slot
foreach ($original_slot_module->ports as $port) {
$port->delete();
}
// Now add the new ports
if ($new_slot_module->module_type->empty_slot) {
logThis($originalModuleType . ' removed from ' . $switchName . ' slot ' . $slotNumber);
} else {
for ($port_number = 1; $port_number <= $newPortCount; $port_number++) {
$new_slot_module->ports()->create(['port_number' => $port_number]);
}
}
logThis($originalModuleType . ' removed from ' . $switchName . ' slot ' . $slotNumber . ' and replaced with ' . $newModuleType);
}
}
示例3: _logThis
/**
* upgrade wizard logging
*/
function _logThis($entry)
{
if (function_exists('logThis')) {
logThis($entry);
} else {
$log = clean_path(getcwd() . '/upgradeWizard.log');
// create if not exists
if (!file_exists($log)) {
$fp = fopen($log, 'w+');
// attempts to create file
if (!is_resource($fp)) {
$GLOBALS['log']->fatal('UpgradeWizard could not create the upgradeWizard.log file');
}
} else {
$fp = fopen($log, 'a+');
// write pointer at end of file
if (!is_resource($fp)) {
$GLOBALS['log']->fatal('UpgradeWizard could not open/lock upgradeWizard.log file');
}
}
$line = date('r') . ' [UpgradeWizard] - ' . $entry . "\n";
if (fwrite($fp, $line) === false) {
$GLOBALS['log']->fatal('UpgradeWizard could not write to upgradeWizard.log: ' . $entry);
}
fclose($fp);
}
}
示例4: apiUpdateDoc
/**
* API to update a doc
*/
public function apiUpdateDoc(GadocRequest $request, Gadoc $gadoc)
{
logThis(auth()->user()->name . ' modified ' . $gadoc->title);
$gadoc->backup(auth()->user()->name);
$gadoc->update($request->all());
return $gadoc;
}
示例5: tearDown
public function tearDown()
{
global $sugar_config, $sugar_version, $mod_strings;
if (file_exists($this->loc->invalidNameFormatUpgradeFilename)) {
unlink($this->loc->invalidNameFormatUpgradeFilename);
}
if (file_exists($this->loc->invalidNameFormatUpgradeFilename . '.backup')) {
rename($this->loc->invalidNameFormatUpgradeFilename . '.backup', $this->loc->invalidNameFormatUpgradeFilename);
}
unset($this->loc);
SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
unset($this->user);
unset($GLOBALS['current_user']);
$sugar_config = $this->backupConfig;
if (!rebuildConfigFile($sugar_config, $sugar_version)) {
logThis('*** ERROR: could not write config.php!');
$errors[] = $mod_strings['ERR_UW_CONFIG_WRITE'];
}
unset($this->backupSystemLocaleNameFormat);
unset($sugar_config);
unset($sugar_version);
unset($mod_strings);
unset($app_strings);
unset($app_list_strings);
unset($locale);
unset($_REQUEST);
}
示例6: update
/**
* Update the admin settings
*/
public function update(AdminSettingsRequest $request, AdminSetting $admin_settings)
{
$admin_settings_before_update = clone $admin_settings;
$admin_settings->update($request->all());
logThis('Admin settings change. BEFORE: ' . $admin_settings_before_update . ' AFTER ' . $admin_settings);
return $admin_settings;
}
示例7: apiStoreReply
/**
* API to store a new reply
*/
public function apiStoreReply(ReplyRequest $request, Post $post)
{
logThis(auth()->user()->name . ' replied to ' . $post->title);
$request->merge(['user_id' => auth()->user()->id]);
$reply = $post->replies()->create($request->all());
return $reply;
}
示例8: updateRoles
/**
* Assign permissions to user
*/
public function updateRoles(Request $request, User $user)
{
$roles = $request->checkedRoles ?: [];
// $roles = array of submitted roles OR if all checkboxes were unchecked, make it an empty array
$user->roles()->sync($roles);
logThis('Roles for ' . $user->name . ' changed to ' . $user->roles()->lists('label'));
return $user->load('roles');
}
示例9: destroy
/**
* Delete a shared network
*/
public function destroy(DhcpSharedNetwork $dhcp_shared_network)
{
$dhcp_shared_network->delete();
flash()->info('Deleted', 'Shared Network ' . $dhcp_shared_network->name . ' was deleted.');
logThis('DHCP Shared Network ' . $dhcp_shared_network->name . ' was deleted.');
$this->dispatch(new RewriteDhcpConfig());
return redirect()->route('dhcp.index');
}
示例10: delete
/**
* Delete a customer
*/
public function delete(Customer $customer)
{
logThis('Customer Deleted: ' . $customer->name . ' was deleted.');
$this->dispatch(new RemoveFromMonitoring($customer));
$customer->delete();
$this->dispatch(new RewriteDhcpConfig());
return $customer;
}
示例11: updatePermissions
/**
* Assign permissions to role
*/
public function updatePermissions(Request $request, Role $role)
{
$permissions = $request->checkedPermissions ?: [];
// $permissions = array of submitted permissions OR if all checkboxes were unchecked, make it an empty array
$role->permissions()->sync($permissions);
logThis('Permissions for ' . $role->label . ' changed to ' . $role->permissions()->lists('label'));
return $role->load('permissions');
}
示例12: store
/**
* Store a new App\Post
*/
public function store(PostRequest $request)
{
logThis(auth()->user()->name . ' created a new post called ' . $request->title);
$post = auth()->user()->posts()->create($request->all());
if ($request->hasFile('myfiles')) {
$post->addFiles($request->file('myfiles'));
}
flash()->success('Created!', $post->title . ' has been created.');
return redirect()->route('posts.index');
}
示例13: deleteUser
/**
* Delete a user
*/
public function deleteUser(Request $request, User $user)
{
if (auth()->user()->id == $user->id) {
flash()->error('You can not delete yourself', 'Have some self respect.');
return redirect()->back();
}
logThis('User ' . $user->name . ' was deleted by ' . auth()->user()->name);
flash()->success('Success!', 'User ' . $user->name . ' was deleted.');
$user->delete();
return redirect()->back();
}
示例14: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next, $requiredPermission)
{
if (env('DISABLE_AUTHORIZATION') == true) {
return $next($request);
}
if (!$request->user()->can($requiredPermission)) {
logThis(auth()->user()->email . ' tried to access ' . $request->url() . ', but does not have permission to do so.');
flash()->error('Bad Robot!', 'You do not have access to that.');
return redirect('/');
}
return $next($request);
}
示例15: deployDhcpConfig
/**
* This method copies the dhcpd.conf file from storage and then restarts dhcp
*/
public function deployDhcpConfig()
{
logThis('Deploying dhcpd.conf');
// The next three lines copies the local dhcpd.conf to the server
$localFile = storage_path() . '/app/dhcp/dhcpd.conf';
$remotePath = '/etc/dhcp/dhcpd.conf';
\SSH::into('dhcp_server')->put($localFile, $remotePath);
logThis('New dhcpd.conf copied to dhcp server at ' . env('DHCP_SERVER'));
// Now let's restart dhcp
\SSH::into('dhcp_server')->run(['service isc-dhcp-server restart']);
logThis('isc-dhcp-server restarted on dhcp server at ' . env('DHCP_SERVER'));
}