ARC2::getIncPath PHP Method

getIncPath() static public method

*
static public getIncPath ( $f = '' )
    static function getIncPath($f = '')
    {
        $r = realpath(dirname(__FILE__)) . '/';
        $dirs = array('plugin' => 'plugins', 'trigger' => 'triggers', 'store' => 'store', 'serializer' => 'serializers', 'extractor' => 'extractors', 'sparqlscript' => 'sparqlscript', 'parser' => 'parsers');
        foreach ($dirs as $k => $dir) {
            if (preg_match('/' . $k . '/i', $f)) {
                return $r . $dir . '/';
            }
        }
        return $r;
    }

Usage Example

コード例 #1
0
ファイル: ARC2.php プロジェクト: p6/arc2
 static function inc($f, $path = '')
 {
     $prefix = 'ARC2';
     if (preg_match('/^([^\\_]+)\\_(.*)$/', $f, $m)) {
         $prefix = $m[1];
         $f = $m[2];
     }
     $inc_path = $path ? $path : ARC2::getIncPath($f);
     $path = $inc_path . $prefix . '_' . urlencode($f) . '.php';
     if (file_exists($path)) {
         return include_once $path;
     }
     /* safe-mode hack */
     if (@(include_once $path)) {
         return 1;
     }
     /* try other path */
     if ($prefix != 'ARC2') {
         $path = $inc_path . strtolower($prefix) . '/' . $prefix . '_' . urlencode($f) . '.php';
         if (file_exists($path)) {
             return include_once $path;
         }
         /* safe-mode hack */
         if (@(include_once $path)) {
             return 1;
         }
     }
     return 0;
 }
All Usage Examples Of ARC2::getIncPath