コード例 #1
0
 /**
  * Render the view
  */
 public function render()
 {
     if (null === $this->getLayoutPath()) {
         return;
     }
     /** @noinspection PhpUnusedLocalVariableInspection */
     $path = $this->getLayoutPath();
     $layoutPath = Steelcode_File_Helper::exists($this->getLayoutPath()) ? $this->getLayoutPath() : CONSTANT('INCLUDE_PATH') . 'includes/path-not-found.php';
     /** @noinspection PhpIncludeInspection */
     require_once $layoutPath;
 }
コード例 #2
0
 /**
  * Get the properties of a file
  *
  * @param string $file : name of the file
  * @return array : array of properties
  */
 public function getFileProperties($file)
 {
     $fileType = $this->getFileType($file);
     $fileSizeInBytes = filesize($file);
     $fileSize = (int) $fileSizeInBytes;
     $fileSize = Steelcode_File_Helper::sizeString($fileSize);
     $extension = Steelcode_Media_Helper::fileExtension($file);
     $fileModifiedTime = date('d M Y', filemtime($file));
     return array('type' => $fileType === 'unknown' ? strtoupper($extension) . ' file' : ucfirst($fileType), 'size_as_string' => $fileSize, 'size_in_bytes' => $fileSizeInBytes, 'date_modified' => $fileModifiedTime);
 }
コード例 #3
0
 public function extract()
 {
     $requestPath = Steelcode_Server_Vars::getVar('PATH_INFO');
     if ($requestPath === null) {
         $requestPath = $this->_generatePath();
     }
     if ($requestPath === '/') {
         $this->_defaults();
     } else {
         $this->_extractPath($requestPath);
     }
     if (!Steelcode_File_Helper::exists($this->_config->getControllerPath())) {
         $this->_pageNotFound();
     }
     return $this->_config;
 }