• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP logThis函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中logThis函数的典型用法代码示例。如果您正苦于以下问题:PHP logThis函数的具体用法?PHP logThis怎么用?PHP logThis使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了logThis函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:goatatwork,项目名称:access2,代码行数:10,代码来源:ProvisioningApiController.php


示例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);
     }
 }
开发者ID:goatatwork,项目名称:access2,代码行数:38,代码来源:ChangeSwitchSlotModule.php


示例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);
    }
}
开发者ID:JimMackin,项目名称:SuiteCRM-Build-Maker,代码行数:30,代码来源:upgrade_utils.php


示例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;
 }
开发者ID:goatatwork,项目名称:goldaccess-support,代码行数:10,代码来源:GadocsController.php


示例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);
 }
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:27,代码来源:Bug41058Test.php


示例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;
 }
开发者ID:goatatwork,项目名称:access2,代码行数:10,代码来源:AdminSettingsApiController.php


示例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;
 }
开发者ID:goatatwork,项目名称:goldaccess-support,代码行数:10,代码来源:RepliesController.php


示例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');
 }
开发者ID:goatatwork,项目名称:access2,代码行数:11,代码来源:UsersApiController.php


示例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');
 }
开发者ID:goatatwork,项目名称:access2,代码行数:11,代码来源:DhcpSharedNetworksController.php


示例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;
 }
开发者ID:goatatwork,项目名称:access2,代码行数:11,代码来源:CustomersApiController.php


示例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');
 }
开发者ID:goatatwork,项目名称:access2,代码行数:11,代码来源:RolesApiController.php


示例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');
 }
开发者ID:goatatwork,项目名称:goldaccess-support,代码行数:13,代码来源:PostsController.php


示例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();
 }
开发者ID:goatatwork,项目名称:goldaccess-support,代码行数:14,代码来源:AdminController.php


示例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);
 }
开发者ID:goatatwork,项目名称:access2,代码行数:19,代码来源:CheckPermissions.php


示例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'));
 }
开发者ID:goatatwork,项目名称:access2,代码行数:15,代码来源:HandlesDhcpConfigsTrait.php


示例16: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $requestTime = $_SERVER['REQUEST_TIME'];
     $queuedForSuspend = SuspendQueue::whereAction(1)->get();
     foreach ($queuedForSuspend as $job) {
         $provisioningRecord = Provisioning::findOrFail($job->provisioning_id);
         $disable = $provisioningRecord->disableUserPorts();
         if ($disable == '0') {
             logThis('GASuspendQueueRun: ONT for ' . $provisioningRecord->customer->name . ' back online. Service suspended.');
         } elseif ($disable == '1') {
             logThis('GASuspendQueueRun: ONT for ' . $provisioningRecord->customer->name . ' still offline. Re-queueing suspension.');
         } elseif ($disable == '2') {
             logThis('GASuspendQueueRun: ONT for ' . $provisioningRecord->customer->name . ' back online, but there was an error suspending service.');
         }
     }
 }
开发者ID:goatatwork,项目名称:access2,代码行数:21,代码来源:RunSuspendQueue.php


示例17: handle

 /**
  * Handle the event.
  *
  * @param  OntConfigWasRemoved  $event
  * @return void
  */
 public function handle(OntConfigWasRemoved $event)
 {
     $config = $event->config;
     $timestamp = date('YmdHis');
     $publicPathToConfigFiles = public_path() . '/ontsoftware/' . $config->software->ont->model . '/' . $config->software->version . '/' . $config->name;
     $publicTrashFolder = public_path() . '/ontsoftware/trash/configs/' . $timestamp . '/' . $config->software->ont->model . '/' . $config->software->version . '/' . $config->name;
     $tftpPathToConfigFiles = '/tftpboot/' . $config->software->ont->model . '/' . $config->software->version . '/' . $config->name;
     $tftpTrashFolder = '/tftpboot/trash/configs/' . $timestamp . '/' . $config->software->ont->model . '/' . $config->software->version . '/' . $config->name;
     if (File::copyDirectory($publicPathToConfigFiles, $publicTrashFolder)) {
         File::deleteDirectory($publicPathToConfigFiles);
     }
     if (File::copyDirectory($tftpPathToConfigFiles, $tftpTrashFolder)) {
         File::deleteDirectory($tftpPathToConfigFiles);
     }
     logThis('Config removed: ' . $config->software->ont->model . '/' . $config->software->version . '/' . $config->name);
 }
开发者ID:goatatwork,项目名称:access2,代码行数:22,代码来源:TrashOntConfigFiles.php


示例18: handle

 /**
  * Handle the event.
  *
  * @param  OntWasRemoved  $event
  * @return void
  */
 public function handle(OntWasRemoved $event)
 {
     $ont = $event->ont;
     $timestamp = date('YmdHis');
     $publicPathToOnt = public_path() . '/ontsoftware/' . $ont->model;
     $publicTrashFolder = public_path() . '/ontsoftware/trash/onts/' . $timestamp . '/' . $ont->model;
     $tftpPathToOnt = '/tftpboot/' . $ont->model;
     $tftpTrashFolder = '/tftpboot/trash/onts/' . $timestamp . '/' . $ont->model;
     if (File::copyDirectory($publicPathToOnt, $publicTrashFolder)) {
         File::deleteDirectory($publicPathToOnt);
     }
     if (File::copyDirectory($tftpPathToOnt, $tftpTrashFolder)) {
         File::deleteDirectory($tftpPathToOnt);
     }
     logThis('Ont removed: ' . $ont->model);
 }
开发者ID:goatatwork,项目名称:access2,代码行数:22,代码来源:TrashOntFiles.php


示例19: handle

 /**
  * Handle the event.
  *
  * @param  OntSoftwareWasRemoved  $event
  * @return void
  */
 public function handle(OntSoftwareWasRemoved $event)
 {
     $software = $event->software;
     $timestamp = date('YmdHis');
     $publicPathToSoftware = public_path() . '/ontsoftware/' . $software->ont->model . '/' . $software->version;
     $publicTrashFolder = public_path() . '/ontsoftware/trash/software/' . $timestamp . '/' . $software->ont->model . '/' . $software->version;
     $tftpPathToSoftware = '/tftpboot/' . $software->ont->model . '/' . $software->version;
     $tftpTrashFolder = '/tftpboot/trash/software/' . $timestamp . '/' . $software->ont->model . '/' . $software->version;
     if (File::copyDirectory($publicPathToSoftware, $publicTrashFolder)) {
         File::deleteDirectory($publicPathToSoftware);
     }
     if (File::copyDirectory($tftpPathToSoftware, $tftpTrashFolder)) {
         File::deleteDirectory($tftpPathToSoftware);
     }
     logThis('Software removed: ' . $software->ont->model . '/' . $software->version);
 }
开发者ID:goatatwork,项目名称:access2,代码行数:22,代码来源:TrashOntSoftwareFiles.php


示例20: destroy

 /**
  * Unsuspends a customer's ONT
  */
 public function destroy(Provisioning $provisioning)
 {
     $provisioning->suspended = 0;
     $provisioning->save();
     $unsuspend = $provisioning->enableUserPorts();
     if ($unsuspend == '0') {
         flash()->overlay('Success', 'Service for this ONT has been reactivated', 'success');
     }
     if ($unsuspend == '1') {
         logThis('Queued ONT re-activation for ' . $provisioning->customer->name);
         flash()->overlay('Queued', 'Re-activation of this ONT has been queued.', 'info');
     }
     if ($unsuspend == '2') {
         flash()->overlay('Failed', 'There was an error while re-activating this ONT. Please look in Application Logs for more info', 'error');
     }
     return back();
 }
开发者ID:goatatwork,项目名称:access2,代码行数:20,代码来源:SuspendServiceController.php



注:本文中的logThis函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP logToFile函数代码示例发布时间:2022-05-15
下一篇:
PHP logTestMsg函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap