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


PHP Finder::in方法代碼示例

本文整理匯總了PHP中Finder::in方法的典型用法代碼示例。如果您正苦於以下問題:PHP Finder::in方法的具體用法?PHP Finder::in怎麽用?PHP Finder::in使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Finder的用法示例。


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

示例1: collectGarbage

 /**
  * Randomly runs garbage collection on the image directory
  *
  * @return bool
  */
 public function collectGarbage()
 {
     if (!mt_rand(1, $this->gcFreq) == 1) {
         return false;
     }
     $this->createFolderIfMissing();
     $finder = new Finder();
     $criteria = sprintf('<= now - %s minutes', $this->expiration);
     $finder->in($this->webPath . '/' . $this->imageFolder)->date($criteria);
     foreach ($finder->files() as $file) {
         unlink($file->getPathname());
     }
     return true;
 }
開發者ID:ivytin,項目名稱:re_web,代碼行數:19,代碼來源:ImageFileHandler.php

示例2: load

 public function load($resource, $type = null)
 {
     if (true === $this->loaded) {
         throw new \RuntimeException('Do not add this loader twice');
     }
     //$modules = $this->doctrine->getRepository('MaximCMSBundle:Module')->findBy(array("activated" => 1));
     $collection = new RouteCollection();
     /* FIND ROUTING FILES IN BUNDLES AND LOAD THOSE */
     $exclude = array("CMSBundle", "InstallBundle", "AdminBundle");
     $names = array("routing.yml", "routing_admin.yml");
     for ($i = 0; $i < count($names); $i++) {
         $finder = new Finder();
         $finder->name($names[$i]);
         foreach ($finder->in(__DIR__ . "/../../")->exclude($exclude) as $file) {
             $locator = new FileLocator(array(substr($file, 0, count($file) - (strlen($names[$i]) + 1))));
             $loader = new YamlFileLoader($locator);
             $collection->addCollection($loader->load($names[$i]));
         }
     }
     return $collection;
     /*if (true === $this->loaded) {
                 throw new \RuntimeException('Do not add this loader twice');
             }
     
             $collection = new RouteCollection();
                                      echo "hi";
             // get all Bundles
             $bundles = $this->container->getParameter('kernel.bundles');
             foreach($bundles as $bundle) {
                 if(isset($bundle)) {
     
                        echo $bundle;
     
                 }
             }
     
     
             /*$resource = '@AcmeDemoBundle/Resources/config/import_routing.yml';
             $type = 'yaml';
     
             $importedRoutes = $this->import($resource, $type);
     
             $collection->addCollection($importedRoutes);
     
             return $collection;          */
 }
開發者ID:c4d3r,項目名稱:mcsuite-application-eyeofender,代碼行數:46,代碼來源:RoutingLoader.php

示例3: delete

 /**
  * Delete a directory.
  *
  * @access  public
  * @return  bool
  */
 public function delete()
 {
     $from = $this->getStreamName();
     $finder = new Finder();
     $finder->in($from)->childFirst();
     foreach ($finder as $file) {
         $file->open()->delete();
         $file->close();
     }
     if (null === $this->getStreamContext()) {
         return @rmdir($from);
     }
     return @rmdir($from, $this->getStreamContext()->getContext());
 }
開發者ID:Hywan,項目名稱:File,代碼行數:20,代碼來源:Directory.php


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