Skip to content

Commit a2cd09d

Browse files
committed
Change is_callable to method_exists for Laravel 8
1 parent bad5c16 commit a2cd09d

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,13 @@ composer require alexstack/laravel-cms && php artisan laravelcms --locale=en --t
301301
- Local: Create a github repository for the laravelcms folder. eg. cd cms && git init && git remote add origin https://github.com/xxx.git
302302
- Local: Enable gd exif for heroku php: composer require ext-exif ext-gd
303303
- On HeroKu: create a new app from this github repository, enable automatically deploy
304-
- HeroKu: add Dyno formation: web vendor/bin/heroku-php-apache2 public/
305-
- HeroKu: add .env variables to settings -> Config Vars
306-
- Local: to use Nginx together with PHP, add a file named Procfile on folder cms with content below:
304+
- Local: to use Nginx/apache together with PHP, add a file named Procfile on folder cms with content below:
307305
```php
308-
web: vendor/bin/heroku-php-nginx
306+
web: vendor/bin/heroku-php-apache2 public/
309307
```
308+
- HeroKu: add Dyno formation: web vendor/bin/heroku-php-apache2 public/
309+
- HeroKu: add .env variables to settings -> Config Vars
310+
- Done
310311

311312
## License
312313

src/Http/Controllers/LaravelCmsPluginAdminController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function customPluginFunc($action = 'return_options', $form_data = null,
118118
{
119119
$plugin_settings = $this->helper->s('plugin.'.$this->plugin->param_name);
120120
$plugin_class = trim($plugin_settings['php_class'] ?? '');
121-
if ('' != $plugin_class && class_exists($plugin_class) && is_callable($plugin_class.'::'.$action)) {
121+
if ('' != $plugin_class && class_exists($plugin_class) && method_exists($plugin_class, $action)) {
122122
//echo $plugin_class . '::' . $action . ' --- ';
123123

124124
return call_user_func([new $plugin_class(), $action], $form_data, $plugin, $plugin_settings);

src/Repositories/LaravelCmsPageAdminRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ public function extraPageTabs($action = 'return_options', $form_data = null, $pa
325325
$callback_ary = collect([]);
326326
foreach ($option_ary as $plugin) {
327327
$plugin_class = trim($plugin['php_class'] ?? '');
328-
if ('' != $plugin_class && class_exists($plugin_class) && is_callable($plugin_class.'::'.$action)) {
328+
if ('' != $plugin_class && class_exists($plugin_class) && method_exists($plugin_class, $action)) {
329329
//echo $plugin_class . '::' . $action . ' --- ';
330330

331331
$s = call_user_func([new $plugin_class(), $action], $form_data, $page, $plugin);

src/Repositories/LaravelCmsPageRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function show($id)
9090
$user_class = $special_json->php_class;
9191
$class_method = $special_json->class_method ?? 'index';
9292
$parameters = $special_json->parameters ?? null;
93-
if ('' != $user_class && class_exists($user_class) && is_callable($user_class.'::'.$class_method)) {
93+
if ('' != $user_class && class_exists($user_class) && method_exists($user_class, $class_method)) {
9494
$data = call_user_func([new $user_class(), $class_method], $data, $parameters);
9595
} else {
9696
$data['call_user_func_error'] = $user_class.' class not exists or class_method not callable ';

0 commit comments

Comments
 (0)