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


PHP Pluf::fileExists方法代碼示例

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


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

示例1: loadFile

 public static function loadFile($file)
 {
     if (false === ($ffile = Pluf::fileExists($file))) {
         throw new Exception(sprintf(__('Fixture file not found: %s.'), $file));
     }
     return self::load(file_get_contents($ffile));
 }
開發者ID:burbuja,項目名稱:pluf,代碼行數:7,代碼來源:Fixture.php

示例2: url

 public static function url($file = '')
 {
     if ($file !== '' && Pluf::f('last_update_file', false) && false !== ($last_update = Pluf::fileExists(Pluf::f('last_update_file')))) {
         $file = $file . '?' . substr(md5(filemtime($last_update)), 0, 5);
     }
     return Pluf::f('url_media', Pluf::f('app_base') . '/media') . $file;
 }
開發者ID:burbuja,項目名稱:pluf,代碼行數:7,代碼來源:MediaUrl.php

示例3: loadSetLocale

 public static function loadSetLocale($lang)
 {
     $GLOBALS['_PX_current_locale'] = $lang;
     setlocale(LC_TIME, array($lang . '.UTF-8', $lang . '_' . strtoupper($lang) . '.UTF-8'));
     if (isset($GLOBALS['_PX_locale'][$lang])) {
         return;
         // We consider that it was already loaded.
     }
     $GLOBALS['_PX_locale'][$lang] = array();
     foreach (Pluf::f('installed_apps') as $app) {
         if (false != ($pofile = Pluf::fileExists($app . '/locale/' . $lang . '/' . strtolower($app) . '.po'))) {
             $GLOBALS['_PX_locale'][$lang] += Pluf_Translation::readPoFile($pofile);
         }
     }
 }
開發者ID:burbuja,項目名稱:pluf,代碼行數:15,代碼來源:Translation.php

示例4: findMigrations

 /**
  * Find the migrations for the current app.
  *
  * @return array Migrations names indexed by order.
  */
 public function findMigrations()
 {
     $migrations = array();
     if (false !== ($mdir = Pluf::fileExists($this->app . '/Migrations'))) {
         $dir = new DirectoryIterator($mdir);
         foreach ($dir as $file) {
             $matches = array();
             if (!$file->isDot() && !$file->isDir() && preg_match('#^(\\d+)#', $file->getFilename(), $matches)) {
                 $info = pathinfo($file->getFilename());
                 $migrations[(int) $matches[1]] = $info['filename'];
             }
         }
     }
     return $migrations;
 }
開發者ID:burbuja,項目名稱:pluf,代碼行數:20,代碼來源:Migration.php

示例5: testFileExists

 public function testFileExists()
 {
     $this->assertEquals(true, Pluf::fileExists('Pluf.php'));
     $this->assertEquals(true, Pluf::fileExists('PEAR.php'));
     $this->assertEquals(false, Pluf::fileExists('Pluf-dummy.php'));
 }
開發者ID:burbuja,項目名稱:pluf,代碼行數:6,代碼來源:PlufTest.php

示例6: loadFunction

 /**
  * Load a function depending on its name.
  *
  * The implementation file of the function
  * MyApp_Youpla_Boum_Stuff() is MyApp/Youpla/Boum.php That way it
  * is possible to group all the related function in one file.
  *
  * Throw an exception if not possible to load the function.
  *
  * @param string Function to load.
  */
 public static function loadFunction($function)
 {
     if (function_exists($function)) {
         return;
     }
     $elts = explode('_', $function);
     array_pop($elts);
     $file = implode(DIRECTORY_SEPARATOR, $elts) . '.php';
     if (false !== ($file = Pluf::fileExists($file))) {
         include $file;
     }
     if (!function_exists($function)) {
         throw new Exception('Impossible to load the function: ' . $function);
     }
 }
開發者ID:burbuja,項目名稱:pluf,代碼行數:26,代碼來源:Pluf.php


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