搜索订单.

@param string $filePath
@param bool $immutable
@param string $point 经纬度
@param int $dist 距离范围
@param int $limit 查询多少个
@param int $status 师傅状态

@return bool
432999
public function selectData($point, $dist, $status, $limit)
    {

        $sql = $this->getSearchSql($point, $dist, $status, $limit);
        try {
            $result = DB::select($sql);
        } catch (\Exception $e) {
            Log::info('c=OrderApiRepository f=selectData  msg=' . $e->getMessage());
            return false;
        }
        return $result;
    }
1015210
public function toAbsolute(): FilePathInterface
    {
        if ($this->myAboveBaseLevel > 0) {
            throw new FilePathLogicException('File path "' . $this->__toString() . '" can not be made absolute: Relative path is above base level.');
        }

        return new self(true, $this->myAboveBaseLevel, $this->myDrive, $this->myDirectoryParts, $this->myFilename);
    }
181487
public function publish(string $packagePath, array $map, bool $isSymlink, bool $isRelative)
    {
        $packagePath = (string)realpath($packagePath);
        \assert('is_dir($packagePath) && is_readable($packagePath)');
        foreach ($map as $from => $to) {
            $origin = realpath(rtrim($packagePath, '/') . '/' . ltrim($from, '/'));
            \assert('is_dir($origin) && is_readable($origin)');
            $this->filesystem->remove($to);
            $this->filesystem->mkdir(\dirname($to));
            if ($isSymlink) {
                $from = $isRelative
                    ? $this->filesystem->makePathRelative($origin, \dirname($to))
                    : $origin;
                $this->publishSymlink($origin, $from, $to);
            } else {
                $this->io->write(sprintf('Installing assets %s as <comment>hard copies</comment>.', $origin));
                $this->filesystem->mirror($origin, $to);
            }
        }
    }
411571
function fileStoreContents( $filePath, $contents, $scope = false, $datatype = false )
    {
        eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileStoreContents( '$filePath' )", __METHOD__ );

        eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );

        eZFile::create( basename( $filePath ), dirname( $filePath ), $contents, true );

        $perm = eZINI::instance()->variable( 'FileSettings', 'StorageFilePermissions' );
        chmod( $filePath, octdec( $perm ) );

        eZDebug::accumulatorStop( 'dbfile' );
    }
257152
protected function readCacheFile($filePath)
    {
        if (file_exists($filePath)) {
            /** @noinspection PhpIncludeInspection */
            $map = require $filePath;
            if (is_array($map)) {
                $this->map = array_merge($this->map, $map);
            }

            return true;
        }

        return false;
    }
1072666
public function checkCreateFile($filePath)
    {
        $defaultPermissions = $this->getPermissionUtils()->getDefaultPermissions();

        if (file_exists($filePath)) {
            if (!is_writable($filePath) && !in_array($this->getPermissionUtils()->getCurrentPermission($filePath), array($defaultPermissions['file'], $defaultPermissions['dir']))) {
                return $this->getPermissionUtils()->setDefaultPermissions($filePath, true);
            }
            return true;
        }

        $pathParts = pathinfo($filePath);
        if (!file_exists($pathParts['dirname'])) {
            $dirPermission = $defaultPermissions['dir'];
            $dirPermission = is_string($dirPermission) ? base_convert($dirPermission,8,10) : $dirPermission;

            if (!$this->mkdir($pathParts['dirname'], $dirPermission, true)) {
                throw new Error('Permission denied: unable to create a folder on the server - ' . $pathParts['dirname']);
            }
        }

        if (touch($filePath)) {
            return $this->getPermissionUtils()->setDefaultPermissions($filePath, true);
        }

        return false;
    }
66766
public function readFile($filePath = null, array $options = [])
    {
        $items = parse_ini_file(
            $filePath,
            (empty($options)
                ? true
                : $options[ 'sections' ])
        );

        $this->merge($items);

        return $items;
    }
657336
public function updatePSDPropertiesFromLocalFile($inputPath, $channelsCount, $compression, $outPath)
    {

        if ($channelsCount == '')
            throw new Exception('Channels count not specified');

        if ($compression == '')
            throw new Exception('Compression method not specified');

        if ($outPath == '')
            throw new Exception('Output file name not specified');

        //build URI
        $strURI = Product::$baseProductUri . '/imaging/psd?channelsCount=' . $channelsCount . '&compression=' . $compression . '&outPath=' . $outPath;

        //sign URI
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::uploadFileBinary($signedURI, $inputPath, 'xml', 'POST');

        $v_output = Utils::validateOutput($responseStream);
        if ($v_output === '') {
            $folder = new Folder();
            $outputStream = $folder->GetFile($outPath);
            $outputPath = AsposeApp::$outPutLocation . $outPath;
            Utils::saveFile($outputStream, $outputPath);
            return $outputPath;
        } else
            return $v_output;
    }
606061
public function readFile($filePath = null, array $options = [])
    {
        $filePath = empty($filePath)
            ? $this->filePath
            : $filePath;

        $defaultOptions = [
            'length'    => 1000,
            'delimiter' => ',',
        ];

        $options = array_merge($defaultOptions, $options);

        $result = [];

        if (false !== ($handle = fopen($filePath, 'r'))) {
            while (false !== ($data = fgetcsv($handle, $options[ 'length' ], $options[ 'delimiter' ]))) {
                $result[] = fgetcsv($handle);
            }
        }

        return $result;
    }
51656
public function readFileFunc($filepath)
    {
        /** @var UniformResourceLocator $locator */
        $locator = $this->grav['locator'];

        if ($locator->isStream($filepath)) {
            $filepath = $locator->findResource($filepath);
        }

        if ($filepath && file_exists($filepath)) {
            return file_get_contents($filepath);
        }

        return false;
    }
274882
private function checkPermission(array &$retValue, $filePath, $permission)
    {
        $isOk = true;
        switch ($permission) {
            case self::PERMISSION_READ:
                if (!$this->checkReadable($filePath)) {
                    $retValue[] = new CheckOutcome(
                        'check.file_permission.notreadable',
                        array('%0%' => $filePath),
                        $this->getLevel()
                    );
                    $isOk = false;
                }
                break;
            case self::PERMISSION_WRITE:
                if (!$this->checkWritable($filePath)) {
                    $retValue[] = new CheckOutcome(
                        'check.file_permission.notwritable',
                        array('%0%' => $filePath),
                        $this->getLevel()
                    );
                    $isOk = false;
                }
                break;
            case self::PERMISSION_EXECUTE:
                if (!$this->checkExecutable($filePath)) {
                    $retValue[] = new CheckOutcome(
                        'check.file_permission.notexecutable',
                        array('%0%' => $filePath),
                        $this->getLevel()
                    );
                    $isOk = false;
                }
                break;
            default:
                $retValue[] = new CheckOutcome(
                    'check.file_permission.invalidtype',
                    array('%0%' => $permission),
                    CheckOutcome::ERROR
                );
                $isOk = false;
                break;
        }

        return $isOk;
    }
1166392
public function loadFile($filePath)
    {
        if ($filePath instanceof \SplFileInfo) {
            $filePath = $filePath->getRealPath();
        }

        if (isset($this->sourceFileDirectory)) {
            if (is_file($this->sourceFileDirectory . $filePath)) {
                $filePath = $this->sourceFileDirectory . $filePath;
            }
        }

        if (is_file($filePath)) {
            $this->sourceFilePath = realpath($filePath);
            $this->sourceFileDirectory = pathinfo($this->sourceFilePath, PATHINFO_DIRNAME) . DIRECTORY_SEPARATOR;

            return $this->loadString(file_get_contents($filePath));
        }

        return false;
    }
27412
public static function openFile(/*string*/ $filePath, /*string*/ $mode) {
    return self::isFile($filePath) ? fopen($filePath, $mode, false) : false;
  }
379736
public function queue($filePath = null, string $disk = null, string $readerType = null)
    {
        if (!$this instanceof ShouldQueue) {
            throw new InvalidArgumentException('Importable should implement ShouldQueue to be queued.');
        }

        return $this->import($filePath, $disk, $readerType);
    }
1217816
public static function process($ficlist, $sourcepath, $distpath, $preprocvars, $preprocmanifest = false)
    {
        $manifest = new Reader($ficlist, $sourcepath, $distpath);
        $manifest->setVerbose(self::$verbose);
        $manifest->setStripComment(self::$stripComment);
        $manifest->setTargetCharset(self::$targetPropertiesFilesCharset);
        $manifest->setSourceCharset(self::$sourcePropertiesFilesDefaultCharset);
        $manifest->setIndentation(self::$indentation);
        $manifest->process($preprocvars, $preprocmanifest);
    }
581998
protected function moveFilesIntoTargetFolder($sourcePath, $targetPath)
    {
        $filesystem = new \Symfony\Component\Filesystem\Filesystem();
        $filesystem->mirror($sourcePath, $targetPath);
        $finder     = new \Symfony\Component\Finder\Finder();
        $iterator   = $finder->files()->ignoreUnreadableDirs(true)->followLinks()->in($sourcePath);
        $sFiles     = [];
        foreach ($iterator as $file) {
            $relativePathFile = str_replace($sourcePath, '', $file->getRealPath());
            if (!file_exists($targetPath . $relativePathFile)) {
                $sFiles[$relativePathFile] = $targetPath . $relativePathFile;
            }
        }
        return $this->setArrayToJson($sFiles);
    }
162109
private function make($filePath, array $params)
    {
        if (!is_null($this->basePath)) {
            $fileFullPath = FileHelper::normalizePath(Yii::getAlias($this->basePath . '/' . $filePath));
        } else {
            $fileFullPath = FileHelper::normalizePath($filePath);
        }

        $fileFullPath = urldecode($fileFullPath);

        if (!is_file($fileFullPath)) {
            return false;
        }

        $quality = isset($params['quality']) ? $params['quality'] : $this->options['quality'];

        $cacheFileName = md5($fileFullPath . serialize($params) . $quality . filemtime($fileFullPath));
        $cacheFileExt = strrchr($fileFullPath, '.');
        $cacheFileDir = '/' . substr($cacheFileName, 0, 2);
        $cacheFilePath = Yii::getAlias($this->cachePath) . $cacheFileDir;
        $cacheFile = $cacheFilePath . '/' . $cacheFileName . $cacheFileExt;
        $cacheUrl = str_replace('\\', '/', preg_replace('/^@[a-z]+/', '', $this->cachePath) . $cacheFileDir . '/'
            . $cacheFileName . $cacheFileExt);

        $cacheUrl = !is_null($this->prefixPath) ? $this->prefixPath . $cacheUrl : $cacheUrl;

        if (file_exists($cacheFile)) {
            if ($this->cacheExpire !== 0 && (time() - filemtime($cacheFile)) > $this->cacheExpire) {
                unlink($cacheFile);
            } else {
                return $cacheUrl;
            }
        }

        if (!is_dir($cacheFilePath)) {
            mkdir($cacheFilePath, 0755, true);
        }

        try{
            $this->image = Image::getImagine()->open($fileFullPath);
        }catch(\Imagine\Exception\RuntimeException $e){
            return null;
        }catch(\Imagine\Exception\InvalidArgumentException $e){
            return null;
        }

        foreach ($params as $key => $value) {
            switch ($key) {
                case self::FUNCTION_THUMBNAIL :
                    $this->thumbnail($value);
                    break;
                case self::FUNCTION_RESIZE :
                    $this->resize($value);
                    break;
                case self::FUNCTION_CROP :
                    $this->crop($value);
                    break;
                case self::FUNCTION_WATERMARK :
                    $this->watermark($value);
                    break;
            }
        }

        $this->image->save($cacheFile, [
            'quality' => $quality
        ]);

        if (array_key_exists(self::FUNCTION_COMPRESS, $params)) {
            if ($params[self::FUNCTION_COMPRESS] && !is_null($this->options['tinyPng']['apiKey'])) {
                $result = $this->tiny->compress($cacheFile);
                $result->writeTo($cacheFile);
            }
        }

        return $cacheUrl;
    }