当前位置: 首页>>代码示例>>PHP>>正文


PHP Package::buildPath方法代码示例

本文整理汇总了PHP中Package::buildPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Package::buildPath方法的具体用法?PHP Package::buildPath怎么用?PHP Package::buildPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Package的用法示例。


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

示例1: errorLog

 public function errorLog($message)
 {
     if (!$this->_errorLog) {
         $this->_errorLog = Package::buildPath($_SERVER['DOCUMENT_ROOT'], 'fileupload.log');
     }
     error_log($message . "\n", 3, $this->_errorLog);
 }
开发者ID:roycocup,项目名称:Tests,代码行数:7,代码来源:Upload.php

示例2: routeShutdown

 public function routeShutdown(Zend_Controller_Request_Abstract $request)
 {
     if ('admin' == $request->getModuleName() && 'Login' != $request->getControllerName()) {
         // Immediate ACL check to make sure they have identity
         $allowUser = defined('DEBUG_MODE') ? true : false;
         // blacklist system
         $user = $request->getParam('User', null);
         if ($user instanceof Showcase_User) {
             // OK user has identity, check the roles
             //$allowUser = Zend_registry::get('Acl')->isAllowed($user->getRoles(), "CMS User") ? true : false;
             $allowUser = $user->isCmsaccess;
         }
         if (!$allowUser) {
             $request->setControllerName('Login')->setModuleName('index')->setActionName('index')->setDispatched(false);
         } else {
             Showcase_Controller_Action_HelperBroker::addPath(Package::buildPath(SITE_DIR, 'classes', 'Controller', 'Action', 'Helper', 'Admin'), 'Showcase_Controller_Action_Helper_Admin');
             // Cretae a new helper path for administrative privileges
             //$request->setParam('Admin', Showcase_Admin::getInstance());
             // Set the instance of the Admin object
             //$request->getParam('View')->assign('admin', $request->getParam('Admin'));
             // And inject it into the view so it can help things for Smarty
             // Include the CMS JS scripts
             //$request->getParam('View')->assign('javaScripts', array('/include/js/admin/js/cms'));
             // Check if the user wants to force a manual cache clearance
             //if ($request->getParam('flushCache')) {
             //	Showcase_Content_Cache::flushCache();
             //}
         }
     }
 }
开发者ID:roycocup,项目名称:Tests,代码行数:30,代码来源:Admin.php

示例3: smarty_resource_view_source

/**
 * smarty_resource_view_source
 *
 * The first function, source() is supposed to retrieve the resource.
 * Its second parameter $tpl_source is a variable passed by reference
 * where the result should be stored. The function is supposed to
 * return TRUE if it was able to successfully retrieve the resource
 * and FALSE otherwise.
 *
 * @param string $tpl_name
 * @param string $tpl_source reference
 * @param object $smarty reference
 * @uses Package::buildPath()
 * @return void
 */
function smarty_resource_view_source($tplName, &$tplSource, Smarty &$smarty)
{
    $templateVars = $smarty->get_template_vars();
    $currentModule = $templateVars['__ZF__']['module'];
    $currentController = $templateVars['__ZF__']['controller'];
    $resourcePath = null;
    if ("login" !== strtolower($currentController) && "static" !== strtolower($currentController) && "admin" !== strtolower($currentModule)) {
        $client = $smarty->get_registered_object('client');
        if (($path = Package::buildPath($smarty->template_dir, 'clients', $client->identifier, 'modules', $currentModule, $currentController, $tplName)) && is_readable($path)) {
            $resourcePath = $path;
        } elseif (($path = Package::buildPath($smarty->template_dir, 'clients', $client->identifier, 'modules', $currentModule, 'default', $tplName)) && is_readable($path)) {
            $resourcePath = $path;
        } elseif (($path = Package::buildPath($smarty->template_dir, 'clients', $client->identifier, 'modules', $currentModule, $tplName)) && is_readable($path)) {
            $resourcePath = $path;
        } elseif (($path = Package::buildPath($smarty->template_dir, 'clients', $client->identifier, 'modules', $tplName)) && is_readable($path)) {
            $resourcePath = $path;
        } elseif (($path = Package::buildPath($smarty->template_dir, 'clients', $client->identifier, $tplName)) && is_readable($path)) {
            $resourcePath = $path;
        }
    }
    if (!$resourcePath) {
        if (($path = Package::buildPath($smarty->template_dir, 'modules', $currentModule, $currentController, $tplName)) && is_readable($path)) {
            $resourcePath = $path;
        } elseif (($path = Package::buildPath($smarty->template_dir, 'modules', $currentModule, 'default', $tplName)) && is_readable($path)) {
            $resourcePath = $path;
        } elseif (($path = Package::buildPath($smarty->template_dir, 'modules', $currentModule, $tplName)) && is_readable($path)) {
            $resourcePath = $path;
        } elseif (($path = Package::buildPath($smarty->template_dir, 'modules', $tplName)) && is_readable($path)) {
            $resourcePath = $path;
        } elseif (($path = Package::buildPath($smarty->template_dir, $tplName)) && is_readable($path)) {
            $resourcePath = $path;
        } else {
            return false;
        }
    }
    if ('admin' == $currentModule && isset($resourcePath)) {
        if ($tpl = $smarty->_read_file($resourcePath)) {
            $tplSource = $tpl;
        }
        return true;
    }
    if ($resourcePath) {
        if ($tpl = $smarty->_read_file($resourcePath)) {
            $tplSource = $tpl;
        }
        // $tplSource = $path;
        /*
        $smarty->_smarty_include(
        	array(
        		'smarty_include_tpl_file'	=> $path,
        		'smarty_include_vars'		=> array()
        	)
        );
        die('we got to here');
        */
        return true;
    }
    return false;
}
开发者ID:roycocup,项目名称:Tests,代码行数:74,代码来源:resource.view.php

示例4: __construct

 public function __construct($post)
 {
     $this->_post = $post;
     $this->_clientName = strtolower($this->_post['client']['name']);
     $this->_uploadPathImages = Package::buildPath(DOC_DIR, 'document_root', 'images', 'clients', strtolower($this->_clientName), 'campaigns') . DIRECTORY_SEPARATOR;
     $this->_uploadPathMedia = Package::buildPath(DOC_DIR, 'document_root', 'media', strtolower($this->_clientName)) . DIRECTORY_SEPARATOR;
     $this->_dbImagePath = DIRECTORY_SEPARATOR . Package::buildPath('images', 'clients', strtolower($this->_clientName), 'campaigns') . DIRECTORY_SEPARATOR;
     $this->_dbMediaPath = DIRECTORY_SEPARATOR . Package::buildPath('media', strtolower($this->_clientName)) . DIRECTORY_SEPARATOR;
 }
开发者ID:roycocup,项目名称:Tests,代码行数:9,代码来源:Job.php

示例5: routeStartup

 public function routeStartup(Zend_Controller_Request_Abstract $request)
 {
     $request->setParam('View', Showcase_View_Smarty::factory('view.xml'));
     $request->getParam('View')->cache_handler_func = 'zend_cache_handler';
     $request->getParam('View')->caching = 0;
     $viewRenderer = new Showcase_Controller_Action_Helper_ViewRenderer();
     $viewRenderer->setViewSuffix('tpl')->setView($request->getParam('View'))->setViewBasePathSpec(Package::buildPath(SITE_DIR, 'views'));
     Zend_Controller_Action_HelperBroker::removeHelper('viewRenderer');
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
 }
开发者ID:roycocup,项目名称:Tests,代码行数:10,代码来源:View.php

示例6: __construct

 public function __construct($content = null)
 {
     $this->_post = $content;
     isset($content['contentId']) ? $this->_contentId = $content['contentId'] : NULL;
     isset($content['operationType']) ? $this->_operationType = $content['operationType'] : NULL;
     isset($content['client']) ? $this->_client = $content['client'] : NULL;
     isset($content['jobId']) ? $this->_jobId = $content['jobId'] : NULL;
     isset($content['title']) ? $this->_article['title'] = $content['title'] : NULL;
     isset($content['description']) ? $this->_article['description'] = $content['description'] : NULL;
     isset($content['image']) ? $this->_image = $content['image'] : NULL;
     isset($content['datePublished']) ? $this->_published = $content['datePublished'] : NULL;
     isset($content['status']) ? $this->_status = $content['status'] : NULL;
     isset($content['client']) ? $this->_uploadPathImages = Package::buildPath(DOC_DIR, 'document_root', 'images', 'clients', strtolower($this->_client['name']), 'campaigns') : NULL;
     isset($content['client']) ? $this->_dbImagePath = "/" . Package::buildPath('images', 'clients', strtolower($this->_client['name']), 'campaigns') . "/" : NULL;
     isset($content['oldImageName']) ? $this->_oldImage = array('name' => $content['oldImageName'], 'fullPath' => $this->_uploadPathImages . DIRECTORY_SEPARATOR . $content['oldImageName']) : NULL;
 }
开发者ID:roycocup,项目名称:Tests,代码行数:16,代码来源:Content.php

示例7: includeAction

 public function includeAction()
 {
     $this->_helper->ViewRenderer->setUseStage(false);
     if (($include = $this->_getParam('include', null)) && ($extension = $this->_getParam('extension', null))) {
         if (!strpos($include, '/')) {
             $include = Package::buildPath($extension, $include);
         }
         switch ($extension) {
             case 'css':
                 header("Content-type: text/css");
                 break;
             case 'js':
                 break;
         }
         $this->view->assign('include', $include . '.' . $extension);
     }
 }
开发者ID:roycocup,项目名称:Tests,代码行数:17,代码来源:StaticController.php

示例8: getFilesize

 public function getFilesize()
 {
     if (!$this->path || $this->isWeblink) {
         return false;
     }
     $sysPath = Package::buildPath($_SERVER['DOCUMENT_ROOT'], $this->path);
     if (file_exists($sysPath)) {
         $size = filesize($sysPath) / 1024;
         if ($size < 1024) {
             $size = number_format($size, 2);
             $size .= ' KB';
         } else {
             if ($size / 1024 < 1024) {
                 $size = number_format($size / 1024, 2);
                 $size .= ' MB';
             } elseif ($size / 1024 / 1024 < 1024) {
                 $size = number_format($size / 1024 / 1024, 2);
                 $size .= ' GB';
             }
         }
         return $size;
     }
     return false;
 }
开发者ID:roycocup,项目名称:Tests,代码行数:24,代码来源:Media.php

示例9: setCompilePath

 /**
  * Set the path to the compile directory
  *
  * @param string $path The directory to set as the path.
  * @return void
  */
 public function setCompilePath($path)
 {
     if (is_writable($path)) {
         $this->_setSmartyParams('compile_dir', $path);
         return;
     }
     $this->_setSmartyParams('compile_dir', Package::buildPath(SITE_DIR, 'views', 'compile'));
     return;
     //throw new Exception('Invalid compile path provided: ' . $path);
 }
开发者ID:roycocup,项目名称:Tests,代码行数:16,代码来源:Smarty.php


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