當前位置: 首頁>>代碼示例>>PHP>>正文


PHP is_function_callable函數代碼示例

本文整理匯總了PHP中is_function_callable函數的典型用法代碼示例。如果您正苦於以下問題:PHP is_function_callable函數的具體用法?PHP is_function_callable怎麽用?PHP is_function_callable使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了is_function_callable函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: action

 public function action()
 {
     $mode = $_POST['new_mode'];
     $rec_option = $_POST['is_recursive'];
     $valid_options = array('none', 'files', 'folders', 'both');
     $chmod_perm = is_dir($path) ? $chmod_dirs : $chmod_files;
     // check perm
     if ($chmod_perm === FALSE) {
         $fileORfolder = is_dir($path) ? 'folders' : 'files';
         $response = "Changing" . $fileORfolder . "permissions are not allowed.";
         $this->r = array($response, 403);
         return;
     }
     // check mode
     if (!preg_match("/^[0-7]{3}\$/", $mode)) {
         $this->r = array('The supplied permission mode is incorrect.', 400);
         return;
     }
     // check recursive option
     if (!in_array($rec_option, $valid_options)) {
         $this->r = array("wrong option", 400);
         return;
     }
     // check if server disabled chmod
     if (is_function_callable('chmod') === FALSE) {
         $this->r = array('The chmod function has been disabled by the server.', 'chmod', 403);
         return;
     }
     $mode = "0" . $mode;
     $mode = octdec($mode);
     rchmod($path, $mode, $rec_option);
 }
開發者ID:Kingtreemonkey,項目名稱:FileManager,代碼行數:32,代碼來源:Chmod.php

示例2: response

     if ($chmod_perm === FALSE) {
         response(sprintf(trans('File_Permission_Not_Allowed'), is_dir($path) ? lcfirst(trans('Folders')) : lcfirst(trans('Files'))), 403)->send();
         exit;
     }
     // check mode
     if (!preg_match("/^[0-7]{3}\$/", $mode)) {
         response(trans('File_Permission_Wrong_Mode'), 400)->send();
         exit;
     }
     // check recursive option
     if (!in_array($rec_option, $valid_options)) {
         response("wrong option", 400)->send();
         exit;
     }
     // check if server disabled chmod
     if (is_function_callable('chmod') === FALSE) {
         response(sprintf(trans('Function_Disabled'), 'chmod'), 403)->send();
         exit;
     }
     $mode = "0" . $mode;
     $mode = octdec($mode);
     rchmod($path, $mode, $rec_option);
     break;
 case 'save_text_file':
     $content = $_POST['new_content'];
     // $content = htmlspecialchars($content); not needed
     // $content = stripslashes($content);
     // no file
     if (!file_exists($path)) {
         response(trans('File_Not_Found'), 404)->send();
         exit;
開發者ID:ilhammalik,項目名稱:yii2-starter,代碼行數:31,代碼來源:execute.php

示例3: response

                // can't copy/cut files
                if ($copy_cut_files === false) {
                    response(sprintf(trans('Copy_Cut_Not_Allowed'), $_POST['sub_action'] == 'copy' ? lcfirst(trans('Copy')) : lcfirst(trans('Cut')), trans('Files')), 403)->send();
                    exit;
                }
            }
            $_SESSION['RF']['clipboard']['path'] = $_POST['path'];
            $_SESSION['RF']['clipboard_action'] = $_POST['sub_action'];
            break;
        case 'clear_clipboard':
            $_SESSION['RF']['clipboard'] = null;
            $_SESSION['RF']['clipboard_action'] = null;
            break;
        case 'chmod':
            $path = $current_path . $_POST['path'];
            if (is_dir($path) && $chmod_dirs === false || is_file($path) && $chmod_files === false || is_function_callable("chmod") === false) {
                response(sprintf(trans('File_Permission_Not_Allowed'), is_dir($path) ? lcfirst(trans('Folders')) : lcfirst(trans('Files')), 403), 400)->send();
                exit;
            } else {
                $perm = decoct(fileperms($path) & 0777);
                $perm_user = substr($perm, 0, 1);
                $perm_group = substr($perm, 1, 1);
                $perm_all = substr($perm, 2, 1);
                $ret = '<div id="files_permission_start">
				<form id="chmod_form">
					<table class="table file-perms-table">
						<thead>
							<tr>
								<td></td>
								<td>r&nbsp;&nbsp;</td>
								<td>w&nbsp;&nbsp;</td>
開發者ID:kipps,項目名稱:sri-lanka,代碼行數:31,代碼來源:ajax_calls.php

示例4: die

                // can't copy/cut files
                if ($copy_cut_files === FALSE) {
                    die(sprintf(lang_Copy_Cut_Not_Allowed, $_POST['sub_action'] == 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut), lang_Files));
                }
            }
            $_SESSION['RF']['clipboard']['path'] = $_POST['path'];
            $_SESSION['RF']['clipboard']['path_thumb'] = $_POST['path_thumb'];
            $_SESSION['RF']['clipboard_action'] = $_POST['sub_action'];
            break;
        case 'clear_clipboard':
            $_SESSION['RF']['clipboard'] = NULL;
            $_SESSION['RF']['clipboard_action'] = NULL;
            break;
        case 'chmod':
            $path = $current_path . $_POST['path'];
            if (is_dir($path) && $chmod_dirs === FALSE || is_file($path) && $chmod_files === FALSE || is_function_callable("chmod") === FALSE) {
                die(sprintf(lang_File_Permission_Not_Allowed, is_dir($path) ? lcfirst(lang_Folders) : lcfirst(lang_Files)));
            } else {
                $perm = decoct(fileperms($path) & 0777);
                $perm_user = substr($perm, 0, 1);
                $perm_group = substr($perm, 1, 1);
                $perm_all = substr($perm, 2, 1);
                $ret = '<div id="files_permission_start">
				<form id="chmod_form">
					<table class="file-perms-table">
						<thead>
							<tr>
								<td></td>
								<td>r&nbsp;&nbsp;</td>
								<td>w&nbsp;&nbsp;</td>
								<td>x&nbsp;&nbsp;</td>
開發者ID:ThebingServices,項目名稱:ResponsiveFilemanager,代碼行數:31,代碼來源:ajax_calls.php

示例5: die

     die;
 }
 // user wants to paste folder to it's own sub folder.. baaaah.
 if (is_dir($data['path']) && strpos($path, $data['path']) !== FALSE) {
     die;
 }
 // something terribly gone wrong
 if ($action != 'copy' && $action != 'cut') {
     die('no action');
 }
 // check for writability
 if (is_really_writable($path) === FALSE || is_really_writable($path_thumb) === FALSE) {
     die($path . '--' . $path_thumb . '--' . lang_Dir_No_Write);
 }
 // check if server disables copy or rename
 if (is_function_callable($action == 'copy' ? 'copy' : 'rename') === FALSE) {
     die(sprintf(lang_Function_Disabled, $action == 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)));
 }
 if ($action == 'copy') {
     rcopy($data['path'], $path);
     rcopy($data['path_thumb'], $path_thumb);
 } elseif ($action == 'cut') {
     rrename($data['path'], $path);
     rrename($data['path_thumb'], $path_thumb);
     // cleanup
     if (is_dir($data['path']) === TRUE) {
         rrename_after_cleaner($data['path']);
         rrename_after_cleaner($data['path_thumb']);
     }
 }
 // cleanup
開發者ID:redmexico,項目名稱:XoopsCore,代碼行數:31,代碼來源:execute.php


注:本文中的is_function_callable函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。