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

PHP fileinode函数代码示例

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

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



在下文中一共展示了fileinode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: listFile

 public function listFile($pathname, $pattern = "*")
 {
     static $_listDirs = array();
     $guid = md5($pathname . $pattern);
     if (!isset($_listDirs[$guid])) {
         $dir = array();
         $list = glob($pathname . $pattern);
         foreach ($list as $i => $file) {
             $dir[$i]["filename"] = preg_replace("/^.+[\\\\\\/]/", "", $file);
             $dir[$i]["pathname"] = realpath($file);
             $dir[$i]["owner"] = fileowner($file);
             $dir[$i]["perms"] = fileperms($file);
             $dir[$i]["inode"] = fileinode($file);
             $dir[$i]["group"] = filegroup($file);
             $dir[$i]["path"] = dirname($file);
             $dir[$i]["atime"] = fileatime($file);
             $dir[$i]["ctime"] = filectime($file);
             $dir[$i]["size"] = filesize($file);
             $dir[$i]["type"] = filetype($file);
             $dir[$i]["ext"] = is_file($file) ? strtolower(substr(strrchr(basename($file), "."), 1)) : "";
             $dir[$i]["mtime"] = filemtime($file);
             $dir[$i]["isDir"] = is_dir($file);
             $dir[$i]["isFile"] = is_file($file);
             $dir[$i]["isLink"] = is_link($file);
             $dir[$i]["isReadable"] = is_readable($file);
             $dir[$i]["isWritable"] = is_writable($file);
         }
         $cmp_func = create_function("\$a,\$b", "\r\n\t\t\t\$k  =  \"isDir\";\r\n\t\t\tif(\$a[\$k]  ==  \$b[\$k])  return  0;\r\n\t\t\treturn  \$a[\$k]>\$b[\$k]?-1:1;\r\n\t\t\t");
         usort($dir, $cmp_func);
         $this->_values = $dir;
         $_listDirs[$guid] = $dir;
     } else {
         $this->_values = $_listDirs[$guid];
     }
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:35,代码来源:Dir.php


示例2: listFile

 public function listFile($pathname, $pattern = '*')
 {
     static $_listDirs = array();
     $guid = md5($pathname . $pattern);
     if (!isset($_listDirs[$guid])) {
         $dir = array();
         $list = glob($pathname . $pattern);
         foreach ($list as $i => $file) {
             $dir[$i]['filename'] = basename($file);
             $dir[$i]['pathname'] = realpath($file);
             $dir[$i]['owner'] = fileowner($file);
             $dir[$i]['perms'] = fileperms($file);
             $dir[$i]['inode'] = fileinode($file);
             $dir[$i]['group'] = filegroup($file);
             $dir[$i]['path'] = dirname($file);
             $dir[$i]['atime'] = fileatime($file);
             $dir[$i]['ctime'] = filectime($file);
             $dir[$i]['size'] = filesize($file);
             $dir[$i]['type'] = filetype($file);
             $dir[$i]['ext'] = is_file($file) ? strtolower(substr(strrchr(basename($file), '.'), 1)) : '';
             $dir[$i]['mtime'] = filemtime($file);
             $dir[$i]['isDir'] = is_dir($file);
             $dir[$i]['isFile'] = is_file($file);
             $dir[$i]['isLink'] = is_link($file);
             $dir[$i]['isReadable'] = is_readable($file);
             $dir[$i]['isWritable'] = is_writable($file);
         }
         $cmp_func = create_function('$a,$b', '' . "\r\n" . '			$k  =  "isDir";' . "\r\n" . '			if($a[$k]  ==  $b[$k])  return  0;' . "\r\n" . '			return  $a[$k]>$b[$k]?-1:1;' . "\r\n" . '			');
         usort($dir, $cmp_func);
         $this->_values = $dir;
         $_listDirs[$guid] = $dir;
     } else {
         $this->_values = $_listDirs[$guid];
     }
 }
开发者ID:fkssei,项目名称:pigcms10,代码行数:35,代码来源:Dir.class.php


示例3: dir2array

function dir2array($dir, $content)
{
    if ($dir[strlen($dir) - 1] != '/') {
        $dir .= '/';
    }
    if (!is_dir($dir)) {
        return array();
    }
    $dir_handle = opendir($dir);
    $array = array();
    while ($object = readdir($dir_handle)) {
        if (!in_array($object, array('.', '..'))) {
            $filepath = $dir . $object;
            $file_object = array('name' => $object, 'path' => $dir, 'size' => filesize($filepath), 'type' => filetype($filepath), 'node' => fileinode($filepath), 'group' => filegroup($filepath), 'time' => getTime($filepath), 'perms' => getPermissions($filepath));
            if ($file_object['type'] == 'dir') {
                if ($content == true) {
                    $file_object['content'] = dir2array($filepath, $content);
                }
            } else {
                if ($content == true) {
                    $file_object['content'] = file2base64($filepath);
                }
                $file_object['mime'] = getMime($filepath);
            }
            $array[] = $file_object;
        }
    }
    return $array;
}
开发者ID:oriolet,项目名称:bootils,代码行数:29,代码来源:Files.php


示例4: __construct

 public function __construct($file, $scope = self::SCOPE_APP, $size = 65535)
 {
     $mf = $file . ($scope == self::SCOPE_PID) ? '.' . getmypid() : '';
     if (!file_exists($mf)) {
         touch($mf);
     }
     $this->key = fileinode($mf);
     $this->debug("SHM key: %d", $this->key);
     $this->shm = shm_attach($this->key, $size, 0700);
 }
开发者ID:noccy80,项目名称:cherryphp,代码行数:10,代码来源:sharedmem.php


示例5: servicemain

 function servicemain()
 {
     for ($s = 0; $s < 5; $s++) {
         usleep(100000);
         $key = fileinode(__FILE__);
         $this->enterCriticalSection($key);
         echo $this->char;
         $this->leaveCriticalSection();
     }
 }
开发者ID:noccy80,项目名称:cherryphp,代码行数:10,代码来源:criticalsection.php


示例6: __construct

 /**
  * 构造函数
  * @throws \Exception
  */
 private function __construct()
 {
     // 主配置位置
     $config_file = WORKERMAN_ROOT_DIR . '/conf/workerman.conf';
     if (!file_exists($config_file)) {
         throw new \Exception('Configuration file "' . $config_file . '" not found');
     }
     // 载入主配置
     self::$config['workerman'] = self::parseFile($config_file);
     self::$config['workerman']['log_dir'] = isset(self::$config['workerman']['log_dir']) ? self::$config['workerman']['log_dir'] : WORKERMAN_ROOT_DIR . '/logs';
     self::$configFile = realpath($config_file);
     // 寻找应用配置
     $conf_d = isset(self::$config['workerman']['include']) ? self::$config['workerman']['include'] : self::DEFAULT_CONFD_PATH;
     $index = 1;
     foreach (glob($conf_d) as $config_file) {
         $worker_name = basename($config_file, '.conf');
         $config_data = self::parseFile($config_file);
         if (isset(self::$config[$worker_name])) {
             $worker_name = $worker_name . '-' . $index++;
         }
         if (!isset($config_data['enable']) || $config_data['enable']) {
             self::$config[$worker_name] = self::parseFile($config_file);
         } else {
             continue;
         }
         // 支持 WORKERMAN_ROOT_DIR 配置
         array_walk_recursive(self::$config[$worker_name], array('\\Man\\Core\\Lib\\Config', 'replaceWORKERMAN_ROOT_DIR'));
         // 找出绝对路径
         $config_file = realpath($config_file);
         if (self::$config[$worker_name]['worker_file'][0] !== '/') {
             self::$config[$worker_name]['worker_file'] = dirname($config_file) . '/' . self::$config[$worker_name]['worker_file'];
         }
         if (!isset(self::$config[$worker_name]['chdir'])) {
             self::$config[$worker_name]['chdir'] = dirname($config_file);
         }
     }
     // 整理Monitor配置
     self::$config['Monitor'] = self::$config['workerman']['Monitor'];
     unset(self::$config['workerman']['Monitor']);
     self::$config['Monitor']['worker_file'] = '../Common/Monitor.php';
     self::$config['Monitor']['persistent_connection'] = 1;
     self::$config['Monitor']['start_workers'] = 1;
     self::$config['Monitor']['user'] = 'root';
     self::$config['Monitor']['preread_length'] = 8192;
     self::$config['Monitor']['exclude_path'] = isset(self::$config['Monitor']['exclude_path']) ? array_merge(self::$config['Monitor']['exclude_path'], get_included_files()) : get_included_files();
     self::$config['Monitor']['exclude_path'][] = self::$config['workerman']['log_dir'];
     self::$config['Monitor']['exclude_path'][] = sys_get_temp_dir();
     if (!isset(self::$config['Monitor']['listen'])) {
         $socket_file = '/tmp/workerman.' . fileinode(__FILE__) . '.sock';
         self::$config['Monitor']['listen'] = 'unix://' . $socket_file;
     }
     // 支持 WORKERMAN_ROOT_DIR 配置
     array_walk_recursive(self::$config['Monitor'], array('\\Man\\Core\\Lib\\Config', 'replaceWORKERMAN_ROOT_DIR'));
 }
开发者ID:walkor,项目名称:workerman-bench,代码行数:58,代码来源:Config.php


示例7: createFile

 /**
  * Creates a new file in the directory
  *
  * Data will either be supplied as a stream resource, or in certain cases
  * as a string. Keep in mind that you may have to support either.
  *
  * After successful creation of the file, you may choose to return the ETag
  * of the new file here.
  *
  * The returned ETag must be surrounded by double-quotes (The quotes should
  * be part of the actual string).
  *
  * If you cannot accurately determine the ETag, you should not return it.
  * If you don't store the file exactly as-is (you're transforming it
  * somehow) you should also not return an ETag.
  *
  * This means that if a subsequent GET to this new file does not exactly
  * return the same contents of what was submitted here, you are strongly
  * recommended to omit the ETag.
  *
  * @param string $name Name of the file
  * @param resource|string $data Initial payload
  * @return null|string
  */
 function createFile($name, $data = null)
 {
     // We're not allowing dots
     if ($name == '.' || $name == '..') {
         throw new DAV\Exception\Forbidden('Permission denied to . and ..');
     }
     $newPath = $this->path . '/' . $name;
     file_put_contents($newPath, $data);
     clearstatcache(true, $newPath);
     return '"' . sha1(fileinode($newPath) . filesize($newPath) . filemtime($newPath)) . '"';
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:35,代码来源:Directory.php


示例8: testPut

 function testPut()
 {
     $request = new HTTP\Request('PUT', '/testput.txt');
     $filename = $this->tempDir . '/testput.txt';
     $request->setBody('Testing new file');
     $this->server->httpRequest = $request;
     $this->server->exec();
     $this->assertEquals(['X-Sabre-Version' => [DAV\Version::VERSION], 'Content-Length' => ['0'], 'ETag' => ['"' . sha1(fileinode($filename) . filesize($filename) . filemtime($filename)) . '"']], $this->response->getHeaders());
     $this->assertEquals(201, $this->response->status);
     $this->assertEquals('', $this->response->body);
     $this->assertEquals('Testing new file', file_get_contents($filename));
 }
开发者ID:siite,项目名称:choose-sa-cloud,代码行数:12,代码来源:ServerTest.php


示例9: getFileInfo

 public static function getFileInfo($path)
 {
     $aryFileInfo = array();
     $aryFileInfo["accessed"] = fileatime($path);
     $aryFileInfo["changed"] = filectime($path);
     $aryFileInfo["group"] = filegroup($path);
     $aryFileInfo["inode"] = fileinode($path);
     $aryFileInfo["modified"] = filemtime($path);
     $aryFileInfo["owner"] = fileowner($path);
     $aryFileInfo["permissions"] = fileperms($path);
     $aryFileInfo["size"] = filesize($path);
     return $aryFileInfo;
 }
开发者ID:joel-cass,项目名称:structure-cms,代码行数:13,代码来源:FileSystemHelper.php


示例10: testBaseUri

 function testBaseUri()
 {
     $serverVars = ['REQUEST_URI' => '/blabla/test.txt', 'REQUEST_METHOD' => 'GET'];
     $filename = $this->tempDir . '/test.txt';
     $request = HTTP\Sapi::createFromServerArray($serverVars);
     $this->server->setBaseUri('/blabla/');
     $this->assertEquals('/blabla/', $this->server->getBaseUri());
     $this->server->httpRequest = $request;
     $this->server->exec();
     $this->assertEquals(['X-Sabre-Version' => [Version::VERSION], 'Content-Type' => ['application/octet-stream'], 'Content-Length' => [13], 'Last-Modified' => [HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($filename)))], 'ETag' => ['"' . sha1(fileinode($filename) . filesize($filename) . filemtime($filename)) . '"']], $this->response->getHeaders());
     $this->assertEquals(200, $this->response->status);
     $this->assertEquals('Test contents', stream_get_contents($this->response->body));
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:13,代码来源:ServerSimpleTest.php


示例11: generateKey

 public static function generateKey($file = null)
 {
     if (!$file) {
         if (!empty($argv[0])) {
             $file = $argv[0];
         } elseif (!empty($_SERVER["SCRIPT_FILENAME"])) {
             $file = $_SERVER["SCRIPT_FILENAME"];
         } else {
             $file = tempnam(null, "ipc");
         }
     }
     $key = fileinode($file);
     return $key;
 }
开发者ID:noccy80,项目名称:cherryphp,代码行数:14,代码来源:ipcobject.php


示例12: parseConfig

/**
 * Checks if the commit it's possible and parse arguments
 * Checks if repository, group and user_name are right.
 *  It extract group from svnroot, and check if the plugin
 *  is availabe. It checks if the user exists.
 *
 * @param   array    $Config Config
 *
 * @return  array    Returns 'check'=true if check passed, group, group_id
 */
function parseConfig(&$Config)
{
    global $sys_svnroot_path, $svn_tracker_debug, $file;
    $Result = array();
    $Result['check'] = true;
    $Repository = $Config['Repository'];
    $UserName = $Config['UserName'];
    if ($sys_svnroot_path[strlen($sys_svnroot_path) - 1] != '/') {
        $sys_svnroot_path .= '/';
    }
    $repo_root = substr($Repository, 0, strrpos($Repository, "/") + 1);
    //we get the directory of the repository root (with trailing slash)
    if (fileinode($sys_svnroot_path) == fileinode($repo_root)) {
        // since the $sys_svnroot_path is usually $sys_svnroot, and that one is a symlink, we check that the inode is the same for both
        $GroupName = substr($Repository, strrpos($Repository, "/") + 1);
        $Config['FileName'] = substr($Config['FileName'], strlen($Repository));
        //get only the filename relative to the repo
    } else {
        $GroupName = $Repository;
        $Config['FileName'] = $Config['FileName'];
    }
    if ($svn_tracker_debug) {
        echo "GroupName = " . $GroupName . "\n";
        echo "SVNRootPath = " . $sys_svnroot_path . "\n";
    }
    if ($svn_tracker_debug) {
        fwrite($file, $GroupName . "\n");
    }
    $Result['group'] = group_get_object_by_name($GroupName);
    $Result['user'] = user_get_object_by_name($UserName);
    if (!$Result['group'] || !is_object($Result['group']) || $Result['group']->isError() || !$Result['group']->isActive()) {
        $Result['check'] = false;
        $Result['error'] = 'Group Not Found';
    } else {
        $Result['group_id'] = $Result['group']->getID();
        if (!$Result['group']->usesPlugin('svntracker')) {
            $Result['check'] = false;
            $Result['error'] = 'Plugin not enabled for this Group';
        }
    }
    if (!$Result['user'] || !is_object($Result['user']) || $Result['user']->isError() || !$Result['user']->isActive()) {
        $Result['check'] = false;
        $Result['error'] = 'Invalid User';
    }
    return $Result;
}
开发者ID:neymanna,项目名称:fusionforge,代码行数:56,代码来源:newcommit.php


示例13: __construct

 public function __construct($file, $scope = self::SCOPE_GLOBAL, $size = 65535)
 {
     if (!$file) {
         throw new \BadArgumentException("Expected filename to Queue constructor");
     }
     $mf = $file . ($scope == self::SCOPE_PID ? '.' . getmypid() : '');
     if (!file_exists($mf)) {
         touch($mf);
     }
     $this->key = fileinode($mf);
     if (!msg_queue_exists($this->key)) {
         debug("Creating IPC queue (0x%x) for %s", $this->key, $mf);
         $this->queue = msg_get_queue($this->key, 0600);
     } else {
         debug("Reopening IPC queue (0x%x) for %s", $this->key, $mf);
         $this->queue = msg_get_queue($this->key, 0600);
     }
 }
开发者ID:noccy80,项目名称:cherryphp,代码行数:18,代码来源:queue.php


示例14: listFile

    /**
     +----------------------------------------------------------
    * 取得目录下面的文件信息
     +----------------------------------------------------------
    * @access public
     +----------------------------------------------------------
    * @param mixed $pathname 路径
     +----------------------------------------------------------
    */
    function listFile($pathname, $pattern = '*')
    {
        static $_listDirs = array();
        $guid = md5($pathname . $pattern);
        if (!isset($_listDirs[$guid])) {
            $dir = array();
            $list = glob($pathname . $pattern);
            foreach ($list as $i => $file) {
                //$dir[$i]['filename']    = basename($file);
                //basename取中文名出问题.改用此方法
                //编码转换.把中文的调整一下.
                $dir[$i]['filename'] = preg_replace('/^.+[\\\\\\/]/', '', $file);
                $dir[$i]['pathname'] = realpath($file);
                $dir[$i]['owner'] = fileowner($file);
                $dir[$i]['perms'] = fileperms($file);
                $dir[$i]['inode'] = fileinode($file);
                $dir[$i]['group'] = filegroup($file);
                $dir[$i]['path'] = dirname($file);
                $dir[$i]['atime'] = fileatime($file);
                $dir[$i]['ctime'] = filectime($file);
                $dir[$i]['size'] = filesize($file);
                $dir[$i]['type'] = filetype($file);
                $dir[$i]['ext'] = is_file($file) ? strtolower(substr(strrchr(basename($file), '.'), 1)) : '';
                $dir[$i]['mtime'] = filemtime($file);
                $dir[$i]['isDir'] = is_dir($file);
                $dir[$i]['isFile'] = is_file($file);
                $dir[$i]['isLink'] = is_link($file);
                //$dir[$i]['isExecutable']= function_exists('is_executable')?is_executable($file):'';
                $dir[$i]['isReadable'] = is_readable($file);
                $dir[$i]['isWritable'] = is_writable($file);
            }
            $cmp_func = create_function('$a,$b', '
			$k  =  "isDir";
			if($a[$k]  ==  $b[$k])  return  0;
			return  $a[$k]>$b[$k]?-1:1;
			');
            // 对结果排序 保证目录在前面
            usort($dir, $cmp_func);
            $this->_values = $dir;
            $_listDirs[$guid] = $dir;
        } else {
            $this->_values = $_listDirs[$guid];
        }
    }
开发者ID:qq907274532,项目名称:cms,代码行数:53,代码来源:Dir.class.php


示例15: getfilename_with_inodelist

function getfilename_with_inodelist($file_dir, $attach_list)
{
    $result = array();
    $i = 0;
    $dir_hd = @opendir($file_dir) or die("can't open:{$file_dir}");
    while (($file = readdir($dir_hd)) !== false) {
        if (is_dir($file)) {
            // dir
        } else {
            $file = $file_dir . "/" . $file;
            $file_inode = fileinode($file);
            foreach ($attach_list as $item) {
                if ($item == $file_inode) {
                    $result[] = $file;
                    break;
                }
            }
        }
    }
    return $result;
}
开发者ID:kyosold,项目名称:huahua,代码行数:21,代码来源:send.php


示例16: validate_folder

/** Returns the destination folder path if valid, die otherwise
 *
 * creates the folder if non-existent.
 */
function validate_folder($folder)
{
    global $dirname;
    // Checks if the selected folder is a child of the photos dir.
    if (fileinode(parentdir(parentdir($folder))) == fileinode($dirname)) {
        if (file_exists($folder)) {
            if (!is_dir($folder)) {
                log_and_die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": "' . $folder . ' is not a folder."}, "id" : "id"}');
            }
            if (!is_writable($folder)) {
                log_and_die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": "' . $folder . ' is not writable."}, "id" : "id"}');
            }
        } else {
            if (!mkdir($folder, 0744, true)) {
                log_and_die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": "Unable to create ' . $folder . '."}, "id" : "id"}');
            }
        }
    } else {
        log_and_die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": "Illegal destination folder, ' . $folder . ' is not a child of ' . $dirname . '"}, "id" : "id"}');
    }
    return $folder;
}
开发者ID:JocelynDelalande,项目名称:PhotoShow,代码行数:26,代码来源:upload-backend.php


示例17: cacheLock

 /**
  * Get an exclusive lock on the cache directory.
  *
  * @since 150422 Rewrite.
  *
  * @throws \Exception If {@link \sem_get()} not available and there's
  *                    no writable tmp directory for {@link \flock()} either.
  * @throws \Exception If unable to obtain an exclusive lock by any available means.
  * @return array Lock type & resource handle needed to unlock later or FALSE if disabled by filter.
  *
  *
  * @note This call is blocking; i.e. it will not return a lock until a lock becomes possible.
  *    In short, this will block the caller until such time as write access becomes possible.
  */
 public function cacheLock()
 {
     if ($this->applyWpFilters(GLOBAL_NS . '\\share::disable_cache_locking', false) || $this->applyWpFilters(GLOBAL_NS . '_disable_cache_locking', false)) {
         return false;
         // Disabled cache locking.
     }
     if (!($wp_config_file = $this->findWpConfigFile())) {
         throw new \Exception(__('Unable to find the wp-config.php file.', 'comet-cache'));
     }
     $lock_type = 'flock';
     // Default lock type.
     $lock_type = $this->applyWpFilters(GLOBAL_NS . '\\share::cache_lock_lock_type', $lock_type);
     $lock_type = $this->applyWpFilters(GLOBAL_NS . '_cache_lock_type', $lock_type);
     if (!in_array($lock_type, ['flock', 'sem'], true)) {
         $lock_type = 'flock';
         // Default lock type.
     }
     if ($lock_type === 'sem' && $this->functionIsPossible('sem_get')) {
         if ($ipc_key = ftok($wp_config_file, 'w')) {
             if (($resource = sem_get($ipc_key, 1)) && sem_acquire($resource)) {
                 return ['type' => 'sem', 'resource' => $resource];
             }
         }
     }
     if (!($tmp_dir = $this->getTmpDir())) {
         throw new \Exception(__('No writable tmp directory.', 'comet-cache'));
     }
     $inode_key = fileinode($wp_config_file);
     $mutex = $tmp_dir . '/' . SLUG_TD . '-' . $inode_key . '.lock';
     if (!($resource = fopen($mutex, 'wb')) || !flock($resource, LOCK_EX)) {
         throw new \Exception(__('Unable to obtain an exclusive lock.', 'comet-cache'));
     }
     @chmod($mutex, 0666);
     // See https://git.io/v2WAt
     return ['type' => 'flock', 'resource' => $resource];
 }
开发者ID:arobbins,项目名称:sblog,代码行数:50,代码来源:CacheLockUtils.php


示例18: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     clearstatcache();
     $records = 0;
     $deleted = 0;
     foreach (File::with('item')->get() as $fileOb) {
         $file = $fileOb->getFilepath();
         if ($this->checkExistance($file) || fileinode($file) !== $fileOb->inode) {
             $fileOb->delete();
             $deleted++;
         }
         $records++;
     }
     foreach (Item::doesntHave('files')->get() as $item) {
         $file = $item->path;
         if ($this->checkExistance($file)) {
             $item->delete();
             $deleted++;
         }
         $records++;
     }
     $this->line("{$records} processed");
     $this->line("{$deleted} deleted");
 }
开发者ID:bagf,项目名称:laravel-file-search,代码行数:29,代码来源:IndexRecheck.php


示例19: fileinode

<?php

/* 
Prototype: int fileinode ( string $filename );
Description: Returns the inode number of the file, or FALSE in case of an error.
*/
/* Passing file names with different notations, using slashes, wild-card chars */
$file_path = dirname(__FILE__);
echo "*** Testing fileinode() with different notations of file names ***\n";
$dir_name = $file_path . "/fileinode_variation3";
mkdir($dir_name);
$file_handle = fopen($dir_name . "/fileinode_variation3.tmp", "w");
fclose($file_handle);
$files_arr = array("/fileinode_variation3/fileinode_variation3.tmp", "/fileinode_variation3/fileinode_variation3.tmp/", "/fileinode_variation3//fileinode_variation3.tmp", "//fileinode_variation3//fileinode_variation3.tmp", "/fileinode_variation3/*.tmp", "fileinode_variation3/fileinode*.tmp", "/fileinode_variation3/fileinode_variation3.tmp" . chr(0), "/fileinode_variation3/fileinode_variation3.tmp");
$count = 1;
/* loop through to test each element in the above array */
foreach ($files_arr as $file) {
    echo "- Iteration {$count} -\n";
    var_dump(fileinode($file_path . "/" . $file));
    clearstatcache();
    $count++;
}
echo "\n*** Done ***";
error_reporting(0);
$file_path = dirname(__FILE__);
$dir_name = $file_path . "/fileinode_variation3";
unlink($dir_name . "/fileinode_variation3.tmp");
rmdir($dir_name);
开发者ID:badlamer,项目名称:hhvm,代码行数:28,代码来源:fileinode_variation3.php


示例20: getInode

 /**
  * Gets file inode
  * 
  * @return int Returns the inode number of the file, or FALSE on failure. 
  */
 public function getInode()
 {
     return fileinode($this->pathname);
 }
开发者ID:phootwork,项目名称:file,代码行数:9,代码来源:FileOperationTrait.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP filelist函数代码示例发布时间:2022-05-15
下一篇:
PHP filegroup函数代码示例发布时间: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