• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ipFile函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ipFile函数的典型用法代码示例。如果您正苦于以下问题:PHP ipFile函数的具体用法?PHP ipFile怎么用?PHP ipFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: ipCronExecute

 public static function ipCronExecute($info)
 {
     if ($info['firstTimeThisDay'] || $info['test']) {
         self::cleanDirRecursive(ipFile('file/tmp/'));
         self::cleanDirRecursive(ipFile('file/secure/tmp/'));
     }
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:7,代码来源:Event.php


示例2: downloadTheme

 public function downloadTheme($name, $url, $signature)
 {
     $model = Model::instance();
     //download theme
     $net = new \Ip\Internal\NetHelper();
     $themeTempFilename = $net->downloadFile($url, ipFile('file/secure/tmp/'), $name . '.zip');
     if (!$themeTempFilename) {
         throw new \Ip\Exception('Theme file download failed.');
     }
     $archivePath = ipFile('file/secure/tmp/' . $themeTempFilename);
     //check signature
     $fileMd5 = md5_file($archivePath);
     $rsa = new \Crypt_RSA();
     $rsa->loadKey($this->publicKey);
     $rsa->setSignatureMode(CRYPT_RSA_SIGNATURE_PKCS1);
     $verified = $rsa->verify($fileMd5, base64_decode($signature));
     if (!$verified) {
         throw new \Ip\Exception('Theme signature verification failed.');
     }
     //extract
     $helper = Helper::instance();
     $secureTmpDir = ipFile('file/secure/tmp/');
     $tmpExtractedDir = \Ip\Internal\File\Functions::genUnoccupiedName($name, $secureTmpDir);
     \Ip\Internal\Helper\Zip::extract($secureTmpDir . $themeTempFilename, $secureTmpDir . $tmpExtractedDir);
     unlink($archivePath);
     //install
     $extractedDir = $helper->getFirstDir($secureTmpDir . $tmpExtractedDir);
     $installDir = $model->getThemeInstallDir();
     $newThemeDir = \Ip\Internal\File\Functions::genUnoccupiedName($name, $installDir);
     rename($secureTmpDir . $tmpExtractedDir . '/' . $extractedDir, $installDir . $newThemeDir);
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:31,代码来源:ThemeDownloader.php


示例3: __construct

 /**
  * @param array|string $data
  * @param null $defaultImage
  */
 public function __construct($data, $defaultImage = null)
 {
     if (is_string($data)) {
         $data = $this->parseStr($data);
     }
     if (!empty($data['imageOrig']) && file_exists(ipFile('file/repository/' . $data['imageOrig']))) {
         $this->imageOrig = $data['imageOrig'];
         if (isset($data['x1']) && isset($data['y1']) && isset($data['x2']) && isset($data['y2'])) {
             $this->x1 = $data['x1'];
             $this->y1 = $data['y1'];
             $this->x2 = $data['x2'];
             $this->y2 = $data['y2'];
             if (empty($data['requiredWidth'])) {
                 $data['requiredWidth'] = $this->x2 - $this->x1;
             }
             if (empty($data['requiredHeight'])) {
                 $data['requiredHeight'] = $this->y2 - $this->y1;
             }
             $this->requiredWidth = $data['requiredWidth'];
             $this->requiredHeight = $data['requiredHeight'];
             $transform = array('type' => 'crop', 'x1' => $this->getX1(), 'y1' => $this->getY1(), 'x2' => $this->getX2(), 'y2' => $this->getY2(), 'width' => $this->getRequiredWidth(), 'height' => $this->getRequiredHeight());
             $this->image = ipFileUrl(ipReflection($this->getImageOrig(), $transform, null));
         }
     } else {
         $this->image = $defaultImage;
     }
     if (!empty($data['id'])) {
         $this->id = $data['id'];
     } else {
         $this->id = mt_rand(2, 2147483647);
         //1 used for inline logo
     }
 }
开发者ID:x33n,项目名称:ImpressPages,代码行数:37,代码来源:Image.php


示例4: concatenate

 protected static function concatenate($urls, $ext)
 {
     $key = md5(json_encode($urls));
     $path = 'file/concatenate/' . $key . '.' . $ext;
     if (!is_file(ipFile($path))) {
         $concatenated = '';
         foreach ($urls as $url) {
             $urlContent = self::fetchContent($url);
             if ($urlContent === false) {
                 //break if at least one of the assets can't be downloaded
                 return false;
             }
             if ($ext == 'css') {
                 $urlContent = self::replaceUrls($url, $urlContent);
                 $concatenated .= "\n" . '/*' . $url . "*/\n" . $urlContent;
             }
             if ($ext == 'js') {
                 $urlContent .= ';';
                 $concatenated .= "\n" . '//' . $url . "\n" . $urlContent;
             }
         }
         if (!is_dir(ipFile('file/concatenate'))) {
             mkdir(ipFile('file/concatenate'));
         }
         file_put_contents(ipFile($path), $concatenated);
     }
     return ipFileUrl($path);
 }
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:28,代码来源:Model.php


示例5: downloadPlugin

 public function downloadPlugin($name, $url, $signature)
 {
     if (is_dir(ipFile("Plugin/{$name}/"))) {
         Service::deactivatePlugin($name);
         Helper::removeDir(ipFile("Plugin/{$name}/"));
     }
     //download plugin
     $net = new \Ip\Internal\NetHelper();
     $pluginTempFilename = $net->downloadFile($url, ipFile('file/secure/tmp/'), $name . '.zip');
     if (!$pluginTempFilename) {
         throw new \Ip\Exception('Plugin file download failed.');
     }
     $archivePath = ipFile('file/secure/tmp/' . $pluginTempFilename);
     //check signature
     $fileMd5 = md5_file($archivePath);
     $rsa = new \Crypt_RSA();
     $rsa->loadKey($this->publicKey);
     $rsa->setSignatureMode(CRYPT_RSA_SIGNATURE_PKCS1);
     $verified = $rsa->verify($fileMd5, base64_decode($signature));
     if (!$verified) {
         throw new \Ip\Exception('Plugin signature verification failed.');
     }
     //extract
     $secureTmpDir = ipFile('file/secure/tmp/');
     $tmpExtractedDir = \Ip\Internal\File\Functions::genUnoccupiedName($name, $secureTmpDir);
     \Ip\Internal\Helper\Zip::extract($secureTmpDir . $pluginTempFilename, $secureTmpDir . $tmpExtractedDir);
     unlink($archivePath);
     //install
     $extractedDir = $this->getFirstDir($secureTmpDir . $tmpExtractedDir);
     $installDir = Model::pluginInstallDir();
     $newPluginDir = \Ip\Internal\File\Functions::genUnoccupiedName($name, $installDir);
     rename($secureTmpDir . $tmpExtractedDir . '/' . $extractedDir, $installDir . $newPluginDir);
     Service::activatePlugin($name);
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:34,代码来源:PluginDownloader.php


示例6: ipRouteAction_150

 /**
  * @param $info
  * @return array|null
  * @throws \Ip\Exception
  */
 public static function ipRouteAction_150($info)
 {
     $requestFile = ipFile('') . $info['relativeUri'];
     $fileDir = ipFile('file/');
     if (ipRequest()->getRelativePath() != $info['relativeUri']) {
         return null;
         //language specific url.
     }
     if (mb_strpos($requestFile, $fileDir) !== 0) {
         return null;
     }
     $reflection = mb_substr($requestFile, mb_strlen($fileDir));
     $reflection = urldecode($reflection);
     $reflectionModel = ReflectionModel::instance();
     $reflectionRecord = $reflectionModel->getReflectionByReflection($reflection);
     if ($reflectionRecord) {
         $reflectionModel->createReflection($reflectionRecord['original'], $reflectionRecord['reflection'], json_decode($reflectionRecord['options'], true));
         if (is_file(ipFile('file/' . $reflection))) {
             //supply file route
             $result['page'] = null;
             $result['plugin'] = 'Repository';
             $result['controller'] = 'PublicController';
             $result['action'] = 'download';
             return $result;
         }
     }
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:32,代码来源:Job.php


示例7: execute

 /**
  * Execute response and return html response
  *
  * @return \Ip\Response
  */
 public function execute()
 {
     ipContent()->setBlockContent('main', $this->content);
     $layout = $this->getLayout();
     if ($layout[0] == '/' || $layout[1] == ':') {
         // Check if absolute path: '/' for unix, 'C:' for windows
         $viewFile = $layout;
         if (!is_file($viewFile)) {
             $viewFile = ipThemeFile('main.php');
         }
     } elseif (strpos($layout, '/') !== false) {
         //impresspages path. Eg. Ip/Internal/xxx.php
         $viewFile = $layout;
         if (!is_file(ipFile($viewFile))) {
             $viewFile = ipThemeFile('main.php');
         }
     } else {
         //layout file. Like main.php
         $viewFile = ipThemeFile($layout);
         if (!is_file($viewFile)) {
             $viewFile = ipThemeFile('main.php');
         }
     }
     $content = ipView($viewFile, $this->getLayoutVariables())->render();
     $response = new \Ip\Response($content, $this->getHeaders(), $this->getStatusCode());
     return $response;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:32,代码来源:Layout.php


示例8: index

 public function index()
 {
     ipAddJs('Ip/Internal/Core/assets/js/jquery-ui/jquery-ui.js');
     ipAddCss('Ip/Internal/Core/assets/js/jquery-ui/jquery-ui.css');
     ipAddJs('Ip/Internal/Core/assets/js/easyXDM/easyXDM.min.js');
     ipAddJs('Ip/Internal/Design/assets/options.js');
     ipAddJs('Ip/Internal/Design/assets/market.js');
     ipAddJs('Ip/Internal/Design/assets/design.js');
     ipAddJs('Ip/Internal/Design/assets/pluginInstall.js');
     ipAddJs('Ip/Internal/System/assets/market.js');
     $model = Model::instance();
     $themes = $model->getAvailableThemes();
     $model = Model::instance();
     $theme = $model->getTheme(ipConfig()->theme());
     $options = $theme->getOptionsAsArray();
     $themePlugins = $model->getThemePlugins();
     $installedPlugins = \Ip\Internal\Plugins\Service::getActivePluginNames();
     $notInstalledPlugins = array();
     //filter plugins that are already installed
     foreach ($themePlugins as $plugin) {
         if (!empty($plugin['name']) && (!in_array($plugin['name'], $installedPlugins) || !is_dir(ipFile('Plugin/' . $plugin['name'])))) {
             $notInstalledPlugins[] = $plugin;
         }
     }
     if (isset($_SESSION['module']['design']['pluginNote'])) {
         $pluginNote = $_SESSION['module']['design']['pluginNote'];
         unset($_SESSION['module']['design']['pluginNote']);
     } else {
         $pluginNote = '';
     }
     $data = array('pluginNote' => $pluginNote, 'theme' => $model->getTheme(ipConfig()->theme()), 'plugins' => $notInstalledPlugins, 'availableThemes' => $themes, 'marketUrl' => $model->getMarketUrl(), 'showConfiguration' => !empty($options), 'contentManagementUrl' => ipConfig()->baseUrl() . '?aa=Content.index', 'contentManagementText' => __('Manage content', 'Ip-admin', false));
     $contentView = ipView('view/layout.php', $data);
     ipResponse()->setLayoutVariable('removeAdminContentWrapper', true);
     return $contentView->render();
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:35,代码来源:AdminController.php


示例9: ipFile

 public static function ipFile($path)
 {
     $path = str_replace('Plugin/', 'install/Plugin/', $path);
     if (self::$installationDir) {
         return self::$installationDir . $path;
     } else {
         return ipFile($path);
     }
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:9,代码来源:Model.php


示例10: __construct

 /**
  * @param array|string $data
  * @param string $defaultLogo
  */
 public function __construct($data, $defaultLogo = null)
 {
     if (is_string($data)) {
         $data = $this->parseStr($data);
     }
     if (!isset($data['type'])) {
         if ($defaultLogo) {
             $data['type'] = self::TYPE_IMAGE;
         } else {
             $data['type'] = self::TYPE_TEXT;
         }
     }
     switch ($data['type']) {
         case self::TYPE_TEXT:
             $this->type = self::TYPE_TEXT;
             break;
         case self::TYPE_IMAGE:
             $this->type = self::TYPE_IMAGE;
             break;
         default:
             $this->type = self::TYPE_TEXT;
             break;
     }
     if (!empty($data['imageOrig']) && file_exists(ipFile('file/repository/' . $data['imageOrig']))) {
         $this->imageOrig = $data['imageOrig'];
         if (isset($data['x1']) && isset($data['y1']) && isset($data['x2']) && isset($data['y2'])) {
             $this->x1 = $data['x1'];
             $this->y1 = $data['y1'];
             $this->x2 = $data['x2'];
             $this->y2 = $data['y2'];
             if (empty($data['requiredWidth'])) {
                 $data['requiredWidth'] = $this->x2 - $this->x1;
             }
             if (empty($data['requiredHeight'])) {
                 $data['requiredHeight'] = $this->y2 - $this->y1;
             }
             $this->requiredWidth = $data['requiredWidth'];
             $this->requiredHeight = $data['requiredHeight'];
             $transform = array('type' => 'crop', 'x1' => $this->getX1(), 'y1' => $this->getY1(), 'x2' => $this->getX2(), 'y2' => $this->getY2(), 'width' => $this->getRequiredWidth(), 'height' => $this->getRequiredHeight(), 'quality' => 100);
             $requestedName = \Ip\Internal\Text\Specialchars::url(ipGetOptionLang('Config.websiteTitle'));
             $this->image = ipReflection($this->getImageOrig(), $transform, $requestedName);
         }
     } else {
         $this->image = $defaultLogo;
     }
     if (!empty($data['text'])) {
         $this->setText($data['text']);
     } else {
         $this->setText(ipGetOptionLang('Config.websiteTitle'));
     }
     if (isset($data['color'])) {
         $this->setColor($data['color']);
     }
     if (isset($data['font'])) {
         $this->setFont($data['font']);
     }
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:61,代码来源:Logo.php


示例11: pluginIcon

 protected function pluginIcon($pluginName)
 {
     if (file_exists(ipFile('Plugin/' . $pluginName . '/assets/icon.svg'))) {
         return ipFileUrl('Plugin/' . $pluginName . '/assets/icon.svg');
     }
     if (file_exists(ipFile('Plugin/' . $pluginName . '/assets/icon.png'))) {
         return ipFileUrl('Plugin/' . $pluginName . '/assets/icon.png');
     }
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:9,代码来源:AdminController.php


示例12: setupTestDatabase

 public static function setupTestDatabase($database, $tablePrefix)
 {
     Model::setInstallationDir(ipFile(''));
     Model::createDatabaseStructure($database, $tablePrefix);
     Model::importData($tablePrefix);
     OptionHelper::import(__DIR__ . '/options.json');
     Model::insertAdmin('test', '[email protected]', 'test');
     ipSetOptionLang('Config.websiteTitle', 'TestSite', 'en');
     ipSetOptionLang('Config.websiteEmail', '[email protected]', 'en');
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:10,代码来源:TestService.php


示例13: getTheme

 public function getTheme($name = null, $dir = null, $url = null)
 {
     if ($name == null) {
         $name = ipConfig()->theme();
     }
     if ($dir == null) {
         $dir = ipFile('Theme/');
     }
     $model = Model::instance();
     $theme = $model->getTheme($name, $dir, $url);
     return $theme;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:12,代码来源:Service.php


示例14: extractArchive

 private function extractArchive($archivePath, $extractedPath)
 {
     $fs = new Helper\FileSystem();
     $fs->createWritableDir($extractedPath);
     $fs->clean($extractedPath);
     require_once ipFile('Ip/Internal/PclZip.php');
     $zip = new \PclZip($archivePath);
     $status = $zip->extract(PCLZIP_OPT_PATH, $extractedPath, PCLZIP_OPT_REMOVE_PATH, 'ImpressPages');
     if (!$status) {
         throw new UpdateException("Archive extraction failed");
     }
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:12,代码来源:UpdateModel.php


示例15: availablePermissions

 /**
  * Get list of all available permissions on the system
  */
 public static function availablePermissions()
 {
     $permissions = array('Super admin', 'Content', 'Pages', 'Design', 'Plugins', 'Config', 'Config advanced', 'Languages', 'System', 'Administrators', 'Log', 'Email', 'Repository', 'Repository upload');
     $plugins = \Ip\Internal\Plugins\Model::getActivePluginNames();
     foreach ($plugins as $plugin) {
         if (is_file(ipFile('Plugin/' . $plugin . '/AdminController.php'))) {
             array_push($permissions, $plugin);
         }
     }
     $permissions = ipFilter('ipAvailablePermissions', $permissions);
     return $permissions;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:15,代码来源:AdminPermissionsModel.php


示例16: ipCacheClear

 public static function ipCacheClear()
 {
     $dir = ipFile('file/concatenate');
     $cacheFiles = scandir($dir);
     foreach ($cacheFiles as $file) {
         if (in_array($file, array('.', '..'))) {
             continue;
         }
         if (is_writable($dir . '/' . $file)) {
             unlink($dir . '/' . $file);
         }
     }
 }
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:13,代码来源:Event.php


示例17: render

 public function render($view = null)
 {
     if ($this->totalPages < 1 && $this->currentPage == 1) {
         return null;
     }
     if (!$view) {
         $view = ipFile('Ip/Pagination/view/pagination.php');
     }
     $data = $this->options;
     $data['currentPage'] = $this->currentPage;
     $data['totalPages'] = $this->totalPages;
     $data['pages'] = $this->pages();
     return ipView($view, $data)->render();
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:14,代码来源:Pagination.php


示例18: load

 public function load($name)
 {
     $fileName = str_replace('\\', '/', $name) . '.php';
     if ($fileName[0] == '/') {
         //in some environments required class starts with slash. In that case remove the slash.
         $fileName = substr($fileName, 1);
     }
     $possibleFilename = ipFile($fileName);
     if (file_exists($possibleFilename)) {
         require_once $possibleFilename;
         return true;
     }
     return false;
 }
开发者ID:impresspages,项目名称:impresspages,代码行数:14,代码来源:Autoloader.php


示例19: generateJavascript

 public function generateJavascript()
 {
     $cacheVersion = $this->getCacheVersion();
     $javascriptFiles = $this->getJavascript();
     $javascriptFilesSorted = array();
     foreach ($javascriptFiles as $level) {
         foreach ($level as &$file) {
             if ($file['type'] == 'file' && $file['cacheFix']) {
                 $file['value'] .= (strpos($file['value'], '?') !== false ? '&' : '?') . $cacheVersion;
             }
         }
         $javascriptFilesSorted = array_merge($javascriptFilesSorted, $level);
     }
     $data = array('ip' => array('baseUrl' => ipConfig()->baseUrl(), 'languageId' => null, 'languageUrl' => '', 'theme' => ipConfig()->get('theme'), 'pageId' => null, 'securityToken' => \Ip\ServiceLocator::application()->getSecurityToken(), 'developmentEnvironment' => ipConfig()->isDevelopmentEnvironment(), 'debugMode' => ipconfig()->isDebugMode(), 'isManagementState' => false, 'isAdminState' => false, 'isAdminNavbarDisabled' => false), 'javascriptVariables' => $this->getJavascriptVariables(), 'javascript' => $javascriptFilesSorted);
     return ipView(ipFile('Ip/Internal/Config/view/javascript.php'), $data)->render();
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:16,代码来源:PageAssets.php


示例20: download

 public static function download()
 {
     $requestFile = ipFile('') . ipRequest()->getRelativePath();
     $fileDir = ipFile('file/');
     if (mb_strpos($requestFile, $fileDir) !== 0) {
         return null;
     }
     $file = mb_substr($requestFile, mb_strlen($fileDir));
     $file = urldecode($file);
     if (empty($file)) {
         throw new \Ip\Exception('Required parameter is missing');
     }
     $absoluteSource = realpath(ipFile('file/' . $file));
     if (!$absoluteSource || !is_file($absoluteSource)) {
         throw new \Ip\Exception\Repository\Transform("File doesn't exist", array('filename' => $absoluteSource));
     }
     if (strpos($absoluteSource, realpath(ipFile('file/'))) !== 0 || strpos($absoluteSource, realpath(ipFile('file/secure'))) === 0) {
         throw new \Exception("Requested file (" . $file . ") is outside of public dir");
     }
     $mime = \Ip\Internal\File\Functions::getMimeType($absoluteSource);
     $fsize = filesize($absoluteSource);
     // set headers
     header("Pragma: public");
     header("Expires: 0");
     header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
     header("Cache-Control: public");
     header('Content-type: ' . $mime);
     header("Content-Transfer-Encoding: binary");
     header("Content-Length: " . $fsize);
     // download
     // @readfile($file_path);
     $file = @fopen($absoluteSource, "rb");
     if ($file) {
         while (!feof($file)) {
             print fread($file, 1024 * 8);
             flush();
             if (connection_status() != 0) {
                 @fclose($file);
                 die;
             }
         }
         @fclose($file);
     }
     //TODO provide method to stop any output by ImpressPages
     ipDb()->disconnect();
     exit;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:47,代码来源:PublicController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ipFileUrl函数代码示例发布时间:2022-05-15
下一篇:
PHP ipDb函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap