Sencha Ext JS를 PHP 애플리케이션에 통합하기 위한 기본 구성요소
이 라이브러리는 서버 생성 페이지를 사용하여 개발 및 프로덕션 컨텍스트에서 Sencha Ext JS 6(5도 작동해야 함) 애플리케이션을 실행할 때 다양한 요구 사항에 대한 간단한 추상화를 제공합니다. 개발 및 프로덕션 빌드는 서로 다른 소스 트리를 사용하여 애플리케이션 파일을 제공합니다. 이 프로세스는 소위 매니페스트와 Javascript 마이크로로더를 기반으로 합니다. 이 프로세스가 서버 생성 페이지 및 라우팅과 원활하게 작동하는지 확인하기 위해 라이브러리는 매니페스트 생성에 연결되고 필요한 환경 및 컨텍스트에 따라 매니페스트를 동적으로 수정합니다.
현재 이 라이브러리는 Ext JS를 Symfony 기반 애플리케이션에 통합하는 Symfony 번들인 teqneers/ext-application-bundle의 기반으로만 사용됩니다. 우리는 라이브러리를 독립 실행형 구성 요소로 사용하거나 Symfony 환경이 아닌 다른 컨텍스트에서 사용하려고 시도한 적이 없으므로 다음은 번들 없이 이론적으로 작동하는 방법일 뿐입니다. 번들 외부에서 라이브러리를 더욱 유용하게 만드는 데 도움과 기여를 해주시면 감사하겠습니다.
Composer를 사용하여 이 라이브러리를 설치할 수 있습니다.
composer require teqneers/ext-application
또는 작곡가.json 파일에 패키지를 직접 추가하세요.
가상 애플리케이션의 다음 디렉토리 구조를 고려하면
./
|-- src/ Application source code
|-- htdocs/ Public web-facing directory (document root)
| |-- index.php PHP front controller
| |-- app/ Root folder for Ext JS application production build
|-- my-app/ The Ext JS application source folder (sencha generate app -ext MyApp ./my-app)
애플리케이션을 구성해야 합니다(예: index.php에서).
$ config = TQ ExtJS Application Configuration ApplicationConfiguration (
__DIR__ . ' /../my-app ' , // the absolute path to the Ext JS application workspace
' ../my-app ' , // the relative path from the public web-facing directory to the Ext JS application workspace
__DIR__ , // the absolute path to the public web-facing directory
' / ' // the relative path from the public web-facing directory to the root directory used for production build artifacts (usually /)
);
// add a default build
$ config -> addBuild (
' default ' , // the build name (just for referencing the build)
' / ' , // the application path relative to the Ext JS application workspace (usually / unless you have multiple applications and/or packages in a single workspace)
' app ' , // the application path relative to the root directory used for production build artifacts
' manifest.json ' , // the build manifest filename for development builds
' bootstrap.js ' , // the micro-loader filename for development builds
null , // the application cache manifest filename for development builds (usually NULL)
' bootstrap.json ' , // the build manifest filename for production builds
' bootstrap.js ' , // the micro-loader filename for production builds
' cache.appcache ' // the application cache manifest filename fro production builds
);
$ application = new TQ ExtJS Application Application (
$ config ,
new TQ ExtJS Application Manifest ManifestLoader (),
' dev ' // dev or prod depending on wether you want to run from development or drom production build
);
$ microLoader = $ application -> getMicroLoaderFile (); // returns a SplFileInfo for the configured micro-loader
$ hasAppCache = $ application -> hasAppCache ();
if ( $ hasAppCache ) {
$ appCache = $ application -> getAppCacheFile (); // returns a SplFileInfo for the configured application cache manifest
}
$ manifest = $ application -> getManifest ( ' /htdocs ' ); // returns a TQExtJSApplicationManifestManifest configured correctly when running document root on your application base path
echo $ manifest ; // outputs the manifest
개발 모드에서 애플리케이션을 실행할 때, 웹 서버가 Ext JS 애플리케이션 작업공간의 파일도 제공할 수 있도록 웹 서버의 문서 루트가 (일반) 공개 웹 연결 디렉터리보다 한 수준 위에 있는지 확인해야 합니다.
MIT 라이센스(MIT)
저작권 (c) 2021 TEQneers GmbH & Co. KG
본 소프트웨어 및 관련 문서 파일("소프트웨어")의 사본을 취득한 모든 사람에게 사용, 복사, 수정, 병합에 대한 권리를 포함하되 이에 국한되지 않고 제한 없이 소프트웨어를 취급할 수 있는 권한이 무료로 부여됩니다. , 소프트웨어 사본을 게시, 배포, 재라이센스 부여 및/또는 판매하고, 소프트웨어를 제공받은 사람에게 다음 조건에 따라 그렇게 하도록 허용합니다.
위의 저작권 고지와 본 허가 고지는 소프트웨어의 모든 사본 또는 상당 부분에 포함됩니다.
소프트웨어는 상품성, 특정 목적에의 적합성 및 비침해에 대한 보증을 포함하되 이에 국한되지 않고 명시적이든 묵시적이든 어떠한 종류의 보증 없이 "있는 그대로" 제공됩니다. 어떠한 경우에도 작성자나 저작권 보유자는 계약, 불법 행위 또는 기타 행위로 인해 소프트웨어나 사용 또는 기타 거래와 관련하여 발생하는 모든 청구, 손해 또는 기타 책임에 대해 책임을 지지 않습니다. 소프트웨어.