示例#1
0
 protected function __construct()
 {
     $properties_dir = App\Files::makeDirIfNotExists(public_path('uploads/properties'));
     $this->docs_dir = App\Files::makeDirIfNotExists($properties_dir . '/docs');
     $this->images_dir = App\Files::makeDirIfNotExists($properties_dir . '/images');
     $this->allowed_docs = config('cleverbons.files.allowed_docs');
     $this->allowed_images = config('cleverbons.files.allowed_images');
     $this->num_max_file_per_type = config('cleverbons.properties.max_num_file_per_type');
 }
示例#2
0
 protected function bundle($_filenames, $_ext = 'js')
 {
     $_filenames = !is_array($_filenames) ? array($_filenames) : $_filenames;
     $filename = 'wasabi' . md5(implode('|', $_filenames)) . $this->_getFileLastModifiedTimesIndentifier($_filenames);
     $ext = strtolower(trim($_ext));
     $filename = $filename . '.' . $ext;
     $bundle_dir_base_path = $this->BASE_BUNDLES_DIR;
     $content = '/*' . "\n * " . implode("\n * ", $_filenames) . "\n" . ' */' . "\n";
     $BUNDLES_DIR = App\Files::makeDirIfNotExists($this->BUNDLES_DIR);
     if (App\Files::exists($BUNDLES_DIR . '/' . $filename)) {
         return $bundle_dir_base_path . '/' . $filename;
     }
     foreach ($_filenames as $f) {
         $f = preg_replace('/\\?.+$/', '', $f);
         // Remove query string
         $content .= "\n /*----------- " . $f . " ------------*/ \n";
         if ($ext === 'js') {
             // See: https://github.com/tedious/JShrink
             $content .= JShrink\Minifier::minify(App\Files::get(rtrim($f, '/')));
         }
     }
     App\Files::makeFile($BUNDLES_DIR . '/' . $filename, $content);
     return $bundle_dir_base_path . '/' . $filename;
 }
示例#3
0
 protected function __construct()
 {
     $dir = 'uploads/company_logos';
     $this->logo_dir = App\Files::makeDirIfNotExists(public_path($dir));
     $this->logo_dir_baseuri = url('/' . $dir);
 }