├── src
├── app
│ └── index.html
├── store
│ ├── storage
│ │ ├── index.html
│ │ └── lang
│ │ │ ├── index.html
│ │ │ └── en
│ │ │ └── doc.yaml
│ ├── packages
│ │ ├── dev
│ │ │ ├── index.html
│ │ │ └── apixDevPackageIllustration
│ │ │ │ ├── devpack
│ │ │ │ ├── model
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── sudb
│ │ │ │ │ │ ├── index.html
│ │ │ │ │ │ ├── adapter
│ │ │ │ │ │ │ ├── index.html
│ │ │ │ │ │ │ └── userAdapter.php
│ │ │ │ │ │ ├── builder
│ │ │ │ │ │ │ ├── index.html
│ │ │ │ │ │ │ └── userBuilder.php
│ │ │ │ │ │ └── user.php
│ │ │ │ │ ├── tables.yaml
│ │ │ │ │ └── modelVar.php
│ │ │ │ ├── migrations
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── schemas
│ │ │ │ │ │ └── index.html
│ │ │ │ │ └── seeds
│ │ │ │ │ │ └── index.html
│ │ │ │ └── repository
│ │ │ │ │ └── index.html
│ │ │ │ ├── source
│ │ │ │ └── bundle
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── apixDevPackageSourceIllustration
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── src
│ │ │ │ │ └── index.html
│ │ │ │ │ ├── apixDevPackageSourceIllustrationInterface.php
│ │ │ │ │ └── index.php
│ │ │ │ ├── developer.php
│ │ │ │ ├── toolBox.php
│ │ │ │ ├── serviceConf.php
│ │ │ │ ├── getServiceInterface.php
│ │ │ │ ├── getService.php
│ │ │ │ └── app.php
│ │ ├── index.html
│ │ ├── providers
│ │ │ ├── index.html
│ │ │ ├── database
│ │ │ │ ├── index.html
│ │ │ │ ├── sudb
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── .gitignore
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── composer.json
│ │ │ │ │ ├── src
│ │ │ │ │ │ ├── utils.php
│ │ │ │ │ │ ├── model.php
│ │ │ │ │ │ ├── joinBuilderOperation.php
│ │ │ │ │ │ └── whereBuilderOperation.php
│ │ │ │ │ └── test.php
│ │ │ │ ├── doctrine
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── bootstrap.dist.php
│ │ │ │ │ ├── config.php
│ │ │ │ │ └── DoctrineEntityManager.php
│ │ │ │ ├── eloquent
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── eloquentCapsule.php
│ │ │ │ │ └── eloquentConnection.php
│ │ │ │ └── mongodb
│ │ │ │ │ └── builder.php
│ │ │ ├── webservice
│ │ │ │ ├── README.md
│ │ │ │ └── src
│ │ │ │ │ ├── soapClient.php
│ │ │ │ │ ├── simpleXml.php
│ │ │ │ │ └── jsonClient.php
│ │ │ ├── search
│ │ │ │ ├── searchInterface.php
│ │ │ │ └── search.php
│ │ │ ├── auth
│ │ │ │ └── src
│ │ │ │ │ ├── register
│ │ │ │ │ ├── redis.php
│ │ │ │ │ ├── config.php
│ │ │ │ │ └── session.php
│ │ │ │ │ ├── driver
│ │ │ │ │ ├── mongo.php
│ │ │ │ │ ├── redis.php
│ │ │ │ │ └── database.php
│ │ │ │ │ ├── encrypt
│ │ │ │ │ └── math.php
│ │ │ │ │ ├── authenticate.php
│ │ │ │ │ └── builder
│ │ │ │ │ └── sudb.php
│ │ │ └── migrations
│ │ │ │ └── consoleColors.php
│ │ └── auto
│ │ │ ├── csrf
│ │ │ ├── README.md
│ │ │ └── csrf.php
│ │ │ ├── translations
│ │ │ ├── README.md
│ │ │ └── translations.php
│ │ │ ├── login
│ │ │ └── login.php
│ │ │ ├── logout
│ │ │ └── logout.php
│ │ │ ├── facebook
│ │ │ └── facebook.php
│ │ │ └── app
│ │ │ └── app.php
│ ├── services
│ │ ├── index.html
│ │ ├── outputResolver.php
│ │ ├── search.php
│ │ ├── sparseFilter.php
│ │ ├── httpCsrfToken.php
│ │ ├── date.php
│ │ ├── mobileDetect.php
│ │ ├── pipeline.php
│ │ ├── repository.php
│ │ ├── guzzle.php
│ │ ├── event.php
│ │ ├── fileProcess.php
│ │ ├── settings.php
│ │ ├── httpSession.php
│ │ ├── rabbitMQ.php
│ │ ├── platform.php
│ │ ├── pushNotifications.php
│ │ ├── httprequest.php
│ │ ├── cache.php
│ │ ├── faker.php
│ │ └── appcollection.php
│ ├── migrations
│ │ ├── seeds
│ │ │ ├── index.html
│ │ │ └── users_seed.php
│ │ └── schemas
│ │ │ └── index.html
│ ├── config
│ │ ├── storeRepository.php
│ │ ├── runner.php
│ │ ├── statusCodes.php
│ │ └── dbConnector.php
│ └── server
│ │ └── requirements.php
├── boot
│ ├── VerifyCsrfToken.php
│ ├── OnceForKernel.php
│ └── EncryptKeyForUser.php
├── kernel.php
└── helpers.php
├── external
└── public
│ ├── admin
│ ├── index.html
│ ├── board
│ │ └── index.html
│ ├── config
│ │ ├── app.js
│ │ └── env.js
│ ├── template
│ │ └── index.html
│ └── widgets
│ │ └── index.html
│ └── declarations
│ └── apidoc_files
│ ├── api_project.js
│ ├── locale.js
│ ├── de.js
│ ├── prettify.css
│ ├── polyfill.js
│ ├── css
│ ├── index.js
│ └── send_sample_request.js
├── _config.yml
├── favicon.ico
├── phpmig.phar
├── README.md
├── tests
└── FooTest.php
├── .env.example
├── .travis.yml
├── .gitignore
├── phpunit.xml
├── .htaccess
├── cli-config.php
├── package.json
├── LICENSE
├── index.php
├── node-cli.js
├── node.js
├── composer.json
└── api
/src/app/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/storage/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/external/public/admin/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/dev/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/services/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/storage/lang/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-minimal
--------------------------------------------------------------------------------
/external/public/admin/board/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/external/public/admin/config/app.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/external/public/admin/config/env.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/migrations/seeds/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/external/public/admin/template/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/external/public/admin/widgets/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/migrations/schemas/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/providers/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/providers/database/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/providers/database/sudb/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/providers/webservice/README.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/providers/database/doctrine/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/providers/database/eloquent/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/providers/database/sudb/.gitignore:
--------------------------------------------------------------------------------
1 | /vendor/
2 |
--------------------------------------------------------------------------------
/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aligurbuz/apix/HEAD/favicon.ico
--------------------------------------------------------------------------------
/phpmig.phar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aligurbuz/apix/HEAD/phpmig.phar
--------------------------------------------------------------------------------
/src/store/packages/dev/apixDevPackageIllustration/devpack/model/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/dev/apixDevPackageIllustration/source/bundle/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/dev/apixDevPackageIllustration/devpack/migrations/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/dev/apixDevPackageIllustration/devpack/model/sudb/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/dev/apixDevPackageIllustration/devpack/repository/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/dev/apixDevPackageIllustration/devpack/migrations/schemas/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/dev/apixDevPackageIllustration/devpack/migrations/seeds/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/dev/apixDevPackageIllustration/devpack/model/sudb/adapter/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/dev/apixDevPackageIllustration/devpack/model/sudb/builder/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/dev/apixDevPackageIllustration/devpack/model/tables.yaml:
--------------------------------------------------------------------------------
1 | tables:
2 | - users
3 |
--------------------------------------------------------------------------------
/src/store/packages/dev/apixDevPackageIllustration/source/bundle/apixDevPackageSourceIllustration/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/dev/apixDevPackageIllustration/source/bundle/apixDevPackageSourceIllustration/src/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/packages/providers/database/sudb/README.md:
--------------------------------------------------------------------------------
1 | # Sudb-Orm
2 | ```
3 | composer require aligurbuz/sudb-orm
4 |
5 | ```
6 |
7 |
--------------------------------------------------------------------------------
/src/store/packages/auto/csrf/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Usage
3 |
4 | ```
5 | http://ip/folder_name/service/project_name/csrf/index
6 |
7 | ```
--------------------------------------------------------------------------------
/src/store/packages/auto/translations/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Usage
3 |
4 | ```
5 | http://ip/folder_name/service/project_name/translations/index?lang=:lang&yaml=:yamlFile
6 |
7 | ```
--------------------------------------------------------------------------------
/src/store/packages/dev/apixDevPackageIllustration/developer.php:
--------------------------------------------------------------------------------
1 | null
9 | ];
10 |
--------------------------------------------------------------------------------
/src/store/packages/dev/apixDevPackageIllustration/toolBox.php:
--------------------------------------------------------------------------------
1 | [
9 | 'url'=>null
10 | ]
11 | ];
12 |
--------------------------------------------------------------------------------
/tests/FooTest.php:
--------------------------------------------------------------------------------
1 | assertEquals(0, count($stack));
10 | }
11 | }
12 | ?>
--------------------------------------------------------------------------------
/src/boot/VerifyCsrfToken.php:
--------------------------------------------------------------------------------
1 | [
9 | 'php api project create mobi',
10 | 'php api service create mobi:stk',
11 | 'php api model create mobi file:user table:users'
12 | ]
13 | ];
14 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # see http://about.travis-ci.org/docs/user/languages/php/ for more hints
2 | language: php
3 |
4 | # list any PHP version you want to test against
5 | php:
6 | - 7.0
7 |
8 |
9 | before_script:
10 | - composer update
11 | - cp .env.example .env
12 | - php api project create mobi
13 | - php api service create mobi:stk
--------------------------------------------------------------------------------
/src/boot/OnceForKernel.php:
--------------------------------------------------------------------------------
1 | false,
16 |
17 | ];
18 |
--------------------------------------------------------------------------------
/src/store/packages/dev/apixDevPackageIllustration/getServiceInterface.php:
--------------------------------------------------------------------------------
1 | [
10 | 'sudo apt-get install -y nodejs',
11 | 'sudo apt-get install npm',
12 | 'sudo npm cache clean -f',
13 | 'sudo npm install -g n',
14 | 'sudo n stable',
15 | 'sudo n latest'
16 | ]
17 |
18 | ];
--------------------------------------------------------------------------------
/src/kernel.php:
--------------------------------------------------------------------------------
1 |
2 |
Please visit apidocjs.com with the full documentation.
\n" 11 | }, 12 | "footer": { 13 | "content": "Suggestions, contact, support and error reporting on GitHub
\n" 14 | }, 15 | "order": [ 16 | "GetUser", 17 | "PostUser" 18 | ], 19 | "generator": { 20 | "version": "0.9.0", 21 | "time": "2014-11-28T14:51:50.677Z" 22 | }, 23 | "apidoc": "0.2.0" 24 | }); -------------------------------------------------------------------------------- /cli-config.php: -------------------------------------------------------------------------------- 1 | search=new searchEngine(); 33 | } 34 | 35 | /** 36 | * get run. 37 | * 38 | */ 39 | public function driver($driver=null){ 40 | return $this->search->runEngineHandle($driver); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/store/packages/auto/translations/translations.php: -------------------------------------------------------------------------------- 1 | (https://github.com/aligurbuz)", 18 | "license": "ISC", 19 | "bugs": { 20 | "url": "https://github.com/aligurbuz/apix/issues" 21 | }, 22 | "homepage": "https://github.com/aligurbuz/apix#readme", 23 | "keywords": [ 24 | "apix" 25 | ], 26 | "dependencies": { 27 | "async": "^2.5.0", 28 | "body-parser": "^1.17.2", 29 | "express": "^4.15.4", 30 | "n-cli": "^1.2.15", 31 | "request": "^2.81.0", 32 | "serve-favicon": "^2.4.3", 33 | "socket.io": "^2.0.3", 34 | "ws": "^3.1.0" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/store/services/sparseFilter.php: -------------------------------------------------------------------------------- 1 | request=new Request(); 34 | } 35 | /** 36 | * @param $callback 37 | * @return string 38 | */ 39 | public function filter($callback){ 40 | 41 | //$call=call_user_func($callback); 42 | return [ 43 | 'key'=>'sparse' 44 | ]; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/store/packages/providers/database/doctrine/bootstrap.dist.php: -------------------------------------------------------------------------------- 1 | 'driver', 18 | 'host'=>'host', 19 | 'user'=>'user', 20 | 'password'=>'password', 21 | 'dbname'=>'dbname', 22 | ); 23 | 24 | $config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode); 25 | $driver = new AnnotationDriver(new AnnotationReader(), $paths); 26 | 27 | // registering noop annotation autoloader - allow all annotations by default 28 | AnnotationRegistry::registerLoader('class_exists'); 29 | $config->setMetadataDriverImpl($driver); 30 | $entityManager = EntityManager::create($dbParams, $config); 31 | 32 | -------------------------------------------------------------------------------- /src/store/packages/providers/database/doctrine/config.php: -------------------------------------------------------------------------------- 1 | dbParams = array( 33 | 'driver' => 'pdo_'.$dbConfig['driver'], 34 | 'host' => $dbConfig['host'], 35 | 'user' => $dbConfig['user'], 36 | 'password' => $dbConfig['password'], 37 | 'dbname' => $dbConfig['database'], 38 | ); 39 | 40 | } 41 | 42 | 43 | } -------------------------------------------------------------------------------- /src/store/packages/auto/csrf/csrf.php: -------------------------------------------------------------------------------- 1 | session=app("session"); 25 | } 26 | 27 | /** 28 | * csrf route is main method. 29 | * 30 | * @return array 31 | */ 32 | public function indexAction(){ 33 | 34 | //check session for postToken 35 | if($this->session->has("postToken")===false){ 36 | $token=new csrfToken(); 37 | $tokenSet=$this->session->set("postToken",$token->GenerateToken()); 38 | } 39 | return ['postToken'=>$this->session->get("postToken")]; 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /src/store/packages/dev/apixDevPackageIllustration/devpack/model/sudb/builder/userBuilder.php: -------------------------------------------------------------------------------- 1 | [ 16 | 'id'=>'desc' 17 | ] 18 | ]; 19 | } 20 | 21 | /** 22 | * @var paginator. 23 | * 24 | * @info your result is automatically paginated 25 | * @status optional 26 | * @return array 27 | */ 28 | public function paginator(){ 29 | 30 | return [ 31 | 'auto'=>10 32 | ]; 33 | } 34 | 35 | /** 36 | * @var resultDataInfo. 37 | * 38 | * @info this value changes default result data info 39 | * @example coultAllData=>'total' 40 | * @status optional 41 | * @return array 42 | */ 43 | public function resultDataInfo(){ 44 | 45 | return []; 46 | } 47 | } -------------------------------------------------------------------------------- /src/store/services/httpCsrfToken.php: -------------------------------------------------------------------------------- 1 | setUp(); 31 | 32 | } 33 | public static function setUpBeforeClass() 34 | { 35 | self::$bytes = base64_decode('aMf+Tct/RLn2WQ=='); 36 | } 37 | protected function setUp() 38 | { 39 | $this->generator = new UriSafeTokenGenerator(self::ENTROPY); 40 | } 41 | protected function tearDown() 42 | { 43 | $this->generator = null; 44 | } 45 | public function GenerateToken() 46 | { 47 | return $this->generator->generateToken(); 48 | 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/store/packages/providers/search/search.php: -------------------------------------------------------------------------------- 1 | search; 41 | } 42 | else{ 43 | $searchDriver=$driver; 44 | } 45 | 46 | $search='src\store\\packages\\providers\\search\\'.$searchDriver.'\\search'; 47 | return utils::resolve($search); 48 | } 49 | 50 | 51 | 52 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | <<<<<<< HEAD 4 | Copyright (c) 2016 Ali Gürbüz 5 | ======= 6 | Copyright (c) 2017 apixphp 7 | >>>>>>> ce5169b146df6fdacc24ab9e0d1a253725ab05c7 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | -------------------------------------------------------------------------------- /src/store/packages/providers/auth/src/register/redis.php: -------------------------------------------------------------------------------- 1 | config =$config; 40 | $this->data =$this->config->query['results'][0]; 41 | $this->session =app('session'); 42 | } 43 | 44 | /** 45 | * @method register 46 | */ 47 | public function register(){ 48 | 49 | //make something 50 | } 51 | 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/store/services/date.php: -------------------------------------------------------------------------------- 1 | timezone(date_default_timezone_get())->diffForHumans(); 34 | } 35 | 36 | /** 37 | * carbon date get data. 38 | * 39 | * @return carbon class 40 | */ 41 | public function date($int) 42 | { 43 | Carbon::setLocale('en'); 44 | //date_default_timezone_set('Europe/London'); 45 | return Carbon::createFromTimestamp($int)->timezone(date_default_timezone_get()); 46 | } 47 | 48 | public function test(){ 49 | return 'test'; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/store/packages/providers/database/eloquent/eloquentConnection.php: -------------------------------------------------------------------------------- 1 | capsule = new Capsule; 16 | $config="\\src\\app\\".app."\\".version."\\config\\database"; 17 | $configdb=$config::dbsettings(); 18 | 19 | $this->capsule->addConnection([ 20 | 'driver' => $configdb['driver'], 21 | 'host' => $configdb['host'], 22 | 'database' => $configdb['database'], 23 | 'username' => $configdb['user'], 24 | 'password' => $configdb['password'], 25 | 'charset' => 'utf8', 26 | 'collation' => 'utf8_unicode_ci', 27 | 'prefix' => '', 28 | ]); 29 | 30 | // Make this Capsule instance available globally via static methods... (optional) 31 | $this->capsule->setAsGlobal(); 32 | 33 | // Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher()) 34 | $this->capsule->bootEloquent(); 35 | } 36 | } -------------------------------------------------------------------------------- /external/public/declarations/apidoc_files/de.js: -------------------------------------------------------------------------------- 1 | define({ 2 | de: { 3 | 'Allowed values:' : 'Erlaubte Werte:', 4 | 'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern', 5 | 'compare changes to:' : 'vergleiche Änderungen mit:', 6 | 'compared to' : 'verglichen mit', 7 | 'Default value:' : 'Standardwert:', 8 | 'Description' : 'Beschreibung', 9 | 'Field' : 'Feld', 10 | 'General' : 'Allgemein', 11 | 'Generated with' : 'Erstellt mit', 12 | 'Name' : 'Name', 13 | 'No response values.' : 'Keine Rückgabewerte.', 14 | 'optional' : 'optional', 15 | 'Parameter' : 'Parameter', 16 | 'Permission:' : 'Berechtigung:', 17 | 'Response' : 'Antwort', 18 | 'Send' : 'Senden', 19 | 'Send a Sample Request' : 'Eine Beispielanfrage senden', 20 | 'show up to version:' : 'zeige bis zur Version:', 21 | 'Size range:' : 'Größenbereich:', 22 | 'Type' : 'Typ', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/store/packages/dev/apixDevPackageIllustration/getService.php: -------------------------------------------------------------------------------- 1 | source->apixDevPackageSourceIllustration()->get(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/store/services/mobileDetect.php: -------------------------------------------------------------------------------- 1 | mobile=new \Mobile_Detect; 33 | 34 | } 35 | 36 | /** 37 | * get isMobile. 38 | * 39 | * @return bool true|false 40 | */ 41 | public function isMobile(){ 42 | 43 | return $this->mobile->isMobile(); 44 | } 45 | 46 | /** 47 | * get isTable. 48 | * 49 | * @return bool true|false 50 | */ 51 | public function isTablet(){ 52 | 53 | return $this->mobile->isTablet(); 54 | } 55 | 56 | /** 57 | * @method is 58 | * @param $data 59 | * @return bool true|false 60 | */ 61 | public function is($data){ 62 | 63 | return $this->mobile->is($data); 64 | } 65 | 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/store/packages/dev/apixDevPackageIllustration/source/bundle/apixDevPackageSourceIllustration/index.php: -------------------------------------------------------------------------------- 1 | pipeline=StaticPathModel::getAppServicePipeline(); 26 | } 27 | 28 | /** 29 | * @param $name 30 | * @param $args 31 | * @return mixed 32 | */ 33 | public function __call($name,$args){ 34 | 35 | $this->pipe=$name; 36 | return $this->callPipes(); 37 | } 38 | 39 | 40 | public function callPipes(){ 41 | 42 | $callPipes=$this->pipeline->{$this->pipe}(); 43 | 44 | $pipelineList=[]; 45 | $pipelineCallBack=[]; 46 | foreach ($callPipes as $key=>$pipelines){ 47 | 48 | foreach ($pipelines as $pipelineClass=>$pipelineMethod){ 49 | 50 | if(count($pipelineList)){ 51 | 52 | $pipelineCallBack[]=call_user_func([Utils::makeBind($pipelineClass),$pipelineMethod],end($pipelineList)); 53 | } 54 | 55 | $pipelineList[]=Utils::makeBind($pipelineClass)->$pipelineMethod(); 56 | } 57 | } 58 | 59 | return end($pipelineCallBack); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/store/packages/providers/database/doctrine/DoctrineEntityManager.php: -------------------------------------------------------------------------------- 1 | paths, $this->isDevMode); 21 | $driver = new AnnotationDriver(new AnnotationReader(), $this->paths); 22 | 23 | // registering noop annotation autoloader - allow all annotations by default 24 | AnnotationRegistry::registerLoader('class_exists'); 25 | $config->setMetadataDriverImpl($driver); 26 | $entityManager = EntityManager::create($this->dbParams(), $config); 27 | 28 | if(defined('devPackage')){ 29 | return $entityManager->getRepository('src\\store\\packages\\dev\\'.service.'\\devpack\\model\\doctrine\\'.$model); 30 | } 31 | 32 | return $entityManager->getRepository('src\app\\'.app.'\\'.version.'\model\doctrine\\'.$model); 33 | 34 | } 35 | } -------------------------------------------------------------------------------- /src/store/services/repository.php: -------------------------------------------------------------------------------- 1 | $name($arguments); 59 | } 60 | throw new \BadFunctionCallException('Not available repo you want'); 61 | 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/store/packages/dev/apixDevPackageIllustration/devpack/model/sudb/adapter/userAdapter.php: -------------------------------------------------------------------------------- 1 | builder=$builder; 21 | } 22 | 23 | /** 24 | * model user get method 25 | * @return array @method 26 | */ 27 | public function get() 28 | { 29 | return $this->builder->get(); 30 | } 31 | 32 | /** 33 | * model user create method 34 | * @return array @method 35 | */ 36 | public function create($post=array()) 37 | { 38 | return $this->builder->create($post); 39 | } 40 | 41 | /** 42 | * model user update method 43 | * @return array @method 44 | */ 45 | public function update($post=array()) 46 | { 47 | return $this->builder->update($post); 48 | } 49 | 50 | /** 51 | * model user delete method 52 | * @return array @method 53 | */ 54 | public function delete($post=array()) 55 | { 56 | return $this->builder->delete($post); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/store/packages/dev/apixDevPackageIllustration/app.php: -------------------------------------------------------------------------------- 1 | source=\branch::source(); 38 | $this->model=\branch::query(); 39 | $this->main=\branch::main(); 40 | parent::__construct(); 41 | } 42 | 43 | 44 | /** 45 | * service restrictions method. 46 | * 47 | * @param prepared functions and objects 48 | * request method : super service call 49 | * main overloading method as restrictions 50 | * @return array 51 | */ 52 | public function restrictions() 53 | { 54 | $list=[]; 55 | return $list; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/store/packages/providers/auth/src/driver/mongo.php: -------------------------------------------------------------------------------- 1 | config=$config; 34 | } 35 | 36 | /** 37 | * @param array $credentials 38 | * @return null 39 | */ 40 | public function attempt($credentials=array()){ 41 | 42 | //make somethings 43 | 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/store/packages/providers/auth/src/driver/redis.php: -------------------------------------------------------------------------------- 1 | config=$config; 34 | } 35 | 36 | /** 37 | * @param array $credentials 38 | * @return null 39 | */ 40 | public function attempt($credentials=array()){ 41 | 42 | //make somethings 43 | 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/store/packages/providers/auth/src/encrypt/math.php: -------------------------------------------------------------------------------- 1 | config=$config; 45 | $this->data_id=$this->config->data['id']; 46 | $this->request=new Request(); 47 | } 48 | 49 | /** 50 | * @method register 51 | */ 52 | public function register(){ 53 | 54 | return $this->data_id * \ip2long($this->request->getClientIp()); 55 | } 56 | 57 | /** 58 | * @param $id 59 | * @method resolve 60 | * @return mixed 61 | */ 62 | public function resolve($id){ 63 | 64 | return $id / \ip2long($this->request->getClientIp()); 65 | } 66 | 67 | 68 | } 69 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | register(); 46 | 47 | //get connection 48 | echo \Apix\connection::run(); -------------------------------------------------------------------------------- /node-cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env '+this.argv['dir']+' 2 | 3 | /** 4 | * boardDir is path that in external/public,that is admin directory 5 | * widgetFile is path that in external/public/boardDir/widgets,that is admin widgets 6 | * boardFile is path that in external/public/boardDir/board,that is admin board -- dashboard 7 | * partChangeAble starts with @@@ --- it is for boardFile 8 | * 9 | */ 10 | //using : node node-cli board --app boardDir --widgets widgetFile --board boardFile --change partChangeAble 11 | 12 | "use strict"; 13 | 14 | var path = require('path'); 15 | var appDir = path.dirname(require.main.filename); 16 | 17 | var Cli = new require("n-cli"); 18 | var cli = new Cli({ 19 | silent: false, 20 | handleUncaughtException : true 21 | }); 22 | 23 | cli.on("board", function(){ 24 | 25 | var fs = require('fs'); 26 | fs = require('fs'); 27 | 28 | var app=this.argv['app']; 29 | var widget=this.argv['widgets']; 30 | var board=this.argv['board']; 31 | var change=this.argv['change']; 32 | 33 | var boardFile='./external/public/'+app+'/board/'+board; 34 | var widgetFile='./external/public/'+app+'/widgets/'+widget; 35 | 36 | fs.readFile(widgetFile, 'utf8', function (err,data) { 37 | if (err) { 38 | return console.log(err); 39 | } 40 | 41 | fs.readFile(boardFile, 'utf8', function (err,boardData) { 42 | if (err) { 43 | return console.log(err); 44 | } 45 | 46 | var changeData=boardData.replace(new RegExp("@@@"+change, "g"),data); 47 | 48 | 49 | fs.writeFile(boardFile, changeData, function (err) { 50 | if (err) return console.log(err); 51 | console.log('board ok'); 52 | 53 | }); 54 | 55 | }); 56 | 57 | 58 | }); 59 | 60 | }); 61 | -------------------------------------------------------------------------------- /src/helpers.php: -------------------------------------------------------------------------------- 1 | getLocalization(),$getbase->getLocalization()); 61 | } 62 | return \Apix\LanguageDefinitor::get($data,$langname,$getbase->getLocalization()); 63 | 64 | } 65 | return null; 66 | } 67 | } -------------------------------------------------------------------------------- /node.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | /** 3 | * get path for main directory. 4 | * 5 | * @param {object} req 6 | * @public 7 | */ 8 | 9 | /** 10 | * get path for main directory. 11 | * 12 | * @param {object} req 13 | * @public 14 | */ 15 | global.path = require('path'); 16 | global.appDir = path.dirname(require.main.filename); 17 | 18 | /** 19 | * Start express project. 20 | * 21 | * @param {object} req 22 | * @public 23 | */ 24 | var express=require("express"); 25 | 26 | /** 27 | * get express method--top level 28 | * 29 | * @param {object} req 30 | * @public 31 | */ 32 | var app=express(); 33 | 34 | /** 35 | * Get config for app settings. 36 | * 37 | * @param {object} req 38 | * @public config.js 39 | */ 40 | global.async = require("async"); 41 | 42 | var http = require('http').Server(app); 43 | 44 | /** 45 | * express route body parser . 46 | * 47 | * @param {object} req 48 | * @public 49 | */ 50 | var bodyParser = require('body-parser'); 51 | app.use(bodyParser.json()); // support json encoded bodies 52 | app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies 53 | 54 | var favicon = require('serve-favicon'); 55 | app.use(favicon(__dirname + '/favicon.ico')); 56 | 57 | /** 58 | * express route . 59 | * 60 | * @param {object} req 61 | * @public 62 | */ 63 | app.all("/:app/:node/:token",function (request,response,next){ 64 | 65 | if(request.params.name=="favicon.ico") 66 | { 67 | response.send("favicon.ico") 68 | } 69 | 70 | /** 71 | * Get base config for app. 72 | * 73 | * @param {object} req 74 | * @public config.js 75 | */ 76 | global.base = require("./src/app/"+request.params.app+"/kernel/node/app.js"); 77 | 78 | response.setHeader('Content-Type', 'application/json'); 79 | base.config(request,function(resultData){ 80 | response.json(resultData); 81 | }) 82 | }); 83 | 84 | http.listen(3000); -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aligurbuz/apix", 3 | "description": "Simple restful API service with php", 4 | "type": "json", 5 | "authors": [ 6 | { 7 | "name": "aligurbuz", 8 | "email": "galiant781@gmail.com" 9 | } 10 | ], 11 | "repositories": { 12 | "packagist": { "url": "https://packagist.org", "type": "composer" } 13 | }, 14 | "require": { 15 | "apixphp/restapixlib":"dev-master", 16 | "php-di/php-di": "^5.4", 17 | "ocramius/proxy-manager": "~1.0|~2.0", 18 | "symfony/yaml": "2.*", 19 | "sinergi/browser-detector": "^6.1", 20 | "nesbot/carbon": "^1.21", 21 | "symfony/http-foundation": "^3.2", 22 | "mobiledetect/mobiledetectlib": "^2.8", 23 | "predis/predis": "^1.0", 24 | "symfony/var-dumper": "*", 25 | "monolog/monolog": "^1.22", 26 | "symfony/console": "^3.2", 27 | "symfony/debug": "^3.2", 28 | "vlucas/phpdotenv": "^2.4", 29 | "guzzlehttp/guzzle": "^6.2", 30 | "symfony/finder": "^3.3", 31 | "symfony/security-csrf": "^3.2", 32 | "symfony/filesystem": "^3.2", 33 | "elasticsearch/elasticsearch": "~5.0", 34 | "twig/twig": "~1.0", 35 | "symfony/cache": "^3.2", 36 | "respect/validation": "^1.1", 37 | "tightenco/collect": "^5.4", 38 | "illuminate/database": "^5.4", 39 | "illuminate/pagination": "^5.4", 40 | "symfony/event-dispatcher": "^3.2", 41 | "fzaninotto/faker": "^1.6", 42 | "spatie/array-to-xml": "^2.3", 43 | "facebook/graph-sdk": "^5.5", 44 | "league/pipeline": "^0.3.0", 45 | "phpunit/phpunit": "^6.3" 46 | }, 47 | "autoload": { 48 | "files": ["src/helpers.php"] 49 | }, 50 | "require-dev": { 51 | "mockery/mockery": "^0.9.7", 52 | "symfony/process": "^3.2", 53 | "phploc/phploc": "^4.0" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /external/public/declarations/apidoc_files/prettify.css: -------------------------------------------------------------------------------- 1 | /* Pretty printing styles. Used with prettify.js. */ 2 | /* Vim sunburst theme by David Leibovic */ 3 | pre .str { 4 | color: #65B042; 5 | } 6 | /* string - green */ 7 | pre .kwd { 8 | color: #E28964; 9 | } 10 | /* keyword - dark pink */ 11 | pre .com { 12 | color: #AEAEAE; 13 | font-style: italic; 14 | } 15 | /* comment - gray */ 16 | pre .typ { 17 | color: #89bdff; 18 | } 19 | /* type - light blue */ 20 | pre .lit { 21 | color: #3387CC; 22 | } 23 | /* literal - blue */ 24 | pre .pun { 25 | color: #fff; 26 | } 27 | /* punctuation - white */ 28 | pre .pln { 29 | color: #fff; 30 | } 31 | /* plaintext - white */ 32 | pre .tag { 33 | color: #89bdff; 34 | } 35 | /* html/xml tag - light blue */ 36 | pre .atn { 37 | color: #bdb76b; 38 | } 39 | /* html/xml attribute name - khaki */ 40 | pre .atv { 41 | color: #65B042; 42 | } 43 | /* html/xml attribute value - green */ 44 | pre .dec { 45 | color: #3387CC; 46 | } 47 | /* decimal - blue */ 48 | /* Specify class=linenums on a pre to get line numbering */ 49 | ol.linenums { 50 | margin-top: 0; 51 | margin-bottom: 0; 52 | color: #AEAEAE; 53 | } 54 | /* IE indents via margin-left */ 55 | li.L0, 56 | li.L1, 57 | li.L2, 58 | li.L3, 59 | li.L5, 60 | li.L6, 61 | li.L7, 62 | li.L8 { 63 | list-style-type: none; 64 | } 65 | /* Alternate shading for lines */ 66 | @media print { 67 | pre .str { 68 | color: #060; 69 | } 70 | pre .kwd { 71 | color: #006; 72 | font-weight: bold; 73 | } 74 | pre .com { 75 | color: #600; 76 | font-style: italic; 77 | } 78 | pre .typ { 79 | color: #404; 80 | font-weight: bold; 81 | } 82 | pre .lit { 83 | color: #044; 84 | } 85 | pre .pun { 86 | color: #440; 87 | } 88 | pre .pln { 89 | color: #000; 90 | } 91 | pre .tag { 92 | color: #006; 93 | font-weight: bold; 94 | } 95 | pre .atn { 96 | color: #404; 97 | } 98 | pre .atv { 99 | color: #060; 100 | } 101 | } -------------------------------------------------------------------------------- /src/store/services/guzzle.php: -------------------------------------------------------------------------------- 1 | client=new Client(); 34 | } 35 | 36 | 37 | /** 38 | * guzzle http request get data. 39 | * 40 | * @return guzzle class 41 | */ 42 | public function get($url=null,$responseObject=null,$params=array()){ 43 | 44 | //get response guzzle 45 | try { 46 | $response = $this->client->request("GET",$url,$params); 47 | } 48 | catch (\GuzzleHttp\Exception\ClientException $e) { 49 | throw new \LogicException('Webservice caught response: ' . $e->getResponse()->getBody()); 50 | } 51 | 52 | 53 | define('guzzleOutPutter',$responseObject,true); 54 | 55 | if($responseObject==null OR $responseObject=='json'){ 56 | return json_decode($response->getBody()->getContents(),1); 57 | } 58 | return $response->getBody()->getContents(); 59 | } 60 | 61 | /** 62 | * guzzle http request post data. 63 | * 64 | * @return guzzle class 65 | */ 66 | public function post($url=null,$postdata=array(),$responseObject=null){ 67 | //get response guzzle 68 | $response = $this->client->request("POST",$url,[ 69 | 'form_params'=>$postdata 70 | ]); 71 | 72 | if($responseObject==null OR $responseObject=='json'){ 73 | return json_decode($response->getBody()->getContents(),1); 74 | } 75 | } 76 | 77 | 78 | 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/store/packages/providers/database/sudb/src/model.php: -------------------------------------------------------------------------------- 1 | getSubClassOf($subClassOf); 34 | return $instance->getQuery($name,$args); 35 | } 36 | 37 | /** 38 | * getQuery method is main method. 39 | * 40 | * @return array 41 | */ 42 | public function getQuery($name,$args){ 43 | $model=utils::resolve("\\src\\store\\packages\providers\\database\\sudb\\src\\builder"); 44 | $model->subClassOf($this->subClassOf); 45 | if($name=="where"){ 46 | if(array_key_exists(0,$args)){ 47 | if(!is_callable($args[0])){ 48 | if(array_key_exists(1,$args) && array_key_exists(2,$args)){ 49 | return $model->where($args[0],$args[1],$args[2],$model); 50 | } 51 | else{ 52 | return $model->where(null,null,null,$model); 53 | } 54 | 55 | } 56 | else{ 57 | return $model->where($args[0],$model); 58 | } 59 | } 60 | else{ 61 | return $model->where(null,null,null,$model); 62 | } 63 | 64 | 65 | } 66 | 67 | return $model->$name($args,$model); 68 | 69 | 70 | } 71 | 72 | 73 | /** 74 | * getQuery method is main method. 75 | * 76 | * @return array 77 | */ 78 | public function getSubClassOf($class=null){ 79 | if($class!==null){ 80 | $this->subClassOf=utils::resolve($class); 81 | } 82 | 83 | } 84 | 85 | } -------------------------------------------------------------------------------- /src/store/packages/providers/database/mongodb/builder.php: -------------------------------------------------------------------------------- 1 | connection=(new \MongoDB\Client)->$database; 42 | } 43 | 44 | public function collection($collection=null){ 45 | 46 | if($collection===null){ 47 | throw new \InvalidArgumentException('document as table is not available'); 48 | } 49 | 50 | $this->collection=$this->connection->$collection; 51 | 52 | return $this; 53 | } 54 | 55 | public function get(){ 56 | 57 | $data = $this->collection->find()->toArray(); 58 | return $this->resolve($data); 59 | } 60 | 61 | private function resolve($data){ 62 | 63 | $dataArray=json_decode(json_encode($data),1); 64 | $list=[]; 65 | foreach($dataArray as $key=>$value){ 66 | foreach($value as $column=>$columnValue){ 67 | 68 | if($column=="_id"){ 69 | $column='id'; 70 | $columnValue=$dataArray[$key]['_id']['$oid']; 71 | } 72 | 73 | $list[$key][$column]=$columnValue; 74 | } 75 | } 76 | 77 | return $list; 78 | } 79 | 80 | } -------------------------------------------------------------------------------- /src/store/packages/providers/database/sudb/test.php: -------------------------------------------------------------------------------- 1 | 10]; 14 | 15 | //this value is run for auto order by desc 16 | public $orderBy=['auto'=>['id'=>'desc']]; 17 | 18 | //query result with this value is called from redis 19 | public $redis=['status'=>false,'expire'=>60]; 20 | 21 | //this value is created and updated time for values it will be inserted 22 | public $createdAndUpdatedFields=['created_at'=>'createdAt','updated_at'=>'updatedAt']; 23 | 24 | //this value is run for auto join type (left|inner) 25 | //protected $joiner=['auto'=>"left"]; 26 | 27 | //this value is similar field that on the joined tables 28 | /*protected $joinField=['books'=>['match'=>'BookId','joinField'=>['bookname','status/bookstatus']], 29 | 'chats'=>['hasOne'=>'userid','joinField'=>['message']] 30 | ];*/ 31 | 32 | //this value hiddens to select field 33 | //public $selectHidden=['id']; 34 | 35 | //this scope is automatically run 36 | //public $scope=['auto'=>'active']; 37 | 38 | //scope query 39 | /** 40 | * @param $data 41 | * @param $query 42 | */ 43 | public function modelScope($data,$query){ 44 | 45 | //get id 46 | if($data=="id"){ 47 | $query->where(function($model){ 48 | if(\app::checkUrlParam("id")){ 49 | $model->where("id","=",\app::getUrlParam("id")); 50 | } 51 | }); 52 | } 53 | 54 | //scopes 55 | if($data=="active"){ 56 | $query->where("status","=",1); 57 | } 58 | 59 | } 60 | 61 | //insert conditions 62 | public $insertConditions=[ 63 | 'status'=>false, 64 | 'wantedFields'=>[], 65 | 'exceptFields'=>[], 66 | 'obligatoryFields'=>[], 67 | 'queueFields'=>[] 68 | ]; 69 | 70 | //select permissions for client 71 | //header select id::username 72 | public $selectPermissions=[ 73 | 'status'=>false, 74 | 'authorized'=>'*', 75 | 'forbidden'=>[], 76 | 'tokens'=>'*', 77 | 'seperator'=>'::' 78 | ]; 79 | } -------------------------------------------------------------------------------- /src/store/services/event.php: -------------------------------------------------------------------------------- 1 | queue_path=staticPathModel::getJobPath().'\apix'; 39 | } 40 | 41 | /** 42 | * @param null $name 43 | * @param callable|null $callback 44 | * @return mixed 45 | */ 46 | public function queue($name=null, callable $callback=null){ 47 | 48 | // if name variable is a closure value 49 | // it throws an error as invalidArgumentException 50 | if($name instanceof \Closure){ 51 | throw new \InvalidArgumentException('queue name is invalid'); 52 | } 53 | 54 | // check for task according name 55 | // if an task is available called name variable 56 | if($this->checkForTaskAccordingName($name)){ 57 | 58 | // if checkForTaskAccordingName is true 59 | // queue is run 60 | $this->queueRun($name); 61 | } 62 | 63 | //callback return 64 | return call_user_func($callback); 65 | } 66 | 67 | 68 | /** 69 | * @param $name 70 | * @return boolean 71 | */ 72 | private function checkForTaskAccordingName($name){ 73 | 74 | //if a task is available for name 75 | // boolean true other boolean false 76 | if(class_exists($task=$this->queue_path.'\\'.$name.'\task')){ 77 | return true; 78 | } 79 | return false; 80 | } 81 | 82 | /** 83 | * @param $name 84 | * process runner 85 | * @return void 86 | */ 87 | private function queueRun($name){ 88 | 89 | $process = new Process('php api job run '.app.' '.$name); 90 | $process->run(); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/store/packages/auto/facebook/facebook.php: -------------------------------------------------------------------------------- 1 | accessToken=$appFacebook['accessToken']; 36 | $this->appId=$appFacebook['appId']; 37 | $this->appSecret=$appFacebook['appSecret']; 38 | $this->appVersion=$appFacebook['appVersion']; 39 | } 40 | 41 | /** 42 | * facebook route is main method. 43 | * 44 | * @return array 45 | */ 46 | public function indexAction() 47 | { 48 | $fb = new \Facebook\Facebook([ 49 | 'app_id' => $this->appId, 50 | 'app_secret' => $this->appSecret, 51 | 'default_graph_version' => $this->appVersion, 52 | 'default_access_token' => $this->accessToken, // optional 53 | ]); 54 | 55 | try { 56 | 57 | // Get the \Facebook\GraphNodes\GraphUser object for the current user. 58 | // If you provided a 'default_access_token', the '{access-token}' is optional. 59 | $response = $fb->get('/me',$this->accessToken); 60 | 61 | } catch(\Facebook\Exceptions\FacebookResponseException $e) { 62 | 63 | // When Graph returns an error 64 | return [ 65 | 66 | 'facebookSdkResult'=>'Graph returned an error: ' . $e->getMessage() 67 | ]; 68 | 69 | } catch(\Facebook\Exceptions\FacebookSDKException $e) { 70 | 71 | // When validation fails or other local issues 72 | return [ 73 | 74 | 'facebookSdkResult'=>'Facebook SDK returned an error: ' . $e->getMessage() 75 | ]; 76 | } 77 | 78 | return [ 79 | 'facebookSdkResult'=>$response->getGraphUser() 80 | ]; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/store/packages/providers/webservice/src/soapClient.php: -------------------------------------------------------------------------------- 1 | 1, 55 | 'exceptions'=>0 56 | ]); 57 | 58 | } 59 | 60 | return new static; 61 | } 62 | 63 | /** 64 | * @method __call 65 | */ 66 | public function __call($method,$args){ 67 | self::$method=$method; 68 | return new static; 69 | } 70 | 71 | 72 | /** 73 | * @method get 74 | */ 75 | public static function get($data){ 76 | 77 | /** 78 | * simple define load 79 | * return string 80 | */ 81 | define('guzzleOutPutter',app('base')->response); 82 | 83 | $soapFunction=self::$method; 84 | 85 | if($soapFunction===null){ 86 | throw new \InvalidArgumentException('Soap Function Error'); 87 | } 88 | 89 | if(method_exists(self::$soap,$soapFunction)){ 90 | return self::$soap->$soapFunction(); 91 | } 92 | 93 | dd(self::$soap->__getFunctions()); 94 | 95 | $soapData=self::$soap->$soapFunction($data); 96 | 97 | return $soapData; 98 | 99 | } 100 | 101 | 102 | /** 103 | * @method __callStatic 104 | */ 105 | public static function __callStatic($group,$args){ 106 | self::$group=$group; 107 | self::url(\app::getWebServiceConfigUrl(self::$group)); 108 | return new static; 109 | } 110 | 111 | } 112 | -------------------------------------------------------------------------------- /src/store/packages/auto/app/app.php: -------------------------------------------------------------------------------- 1 | request=$request; 32 | } 33 | 34 | /** 35 | * app route is main method. 36 | * 37 | * @return array 38 | */ 39 | public function indexAction() 40 | { 41 | /** 42 | * app settings is an array. 43 | * 44 | * @return array 45 | */ 46 | $app=[ 47 | 'app'=>[ 48 | 'app'=>app, 49 | 'version'=>version, 50 | 'host'=>$this->request->getHost(), 51 | 'isSecure'=>$this->request->isSecure() 52 | ] 53 | 54 | ]; 55 | 56 | 57 | /** 58 | * node settings is an array. 59 | * 60 | * @return array 61 | */ 62 | $node=[ 63 | 'node'=>$this->getNodeForApp() 64 | ]; 65 | 66 | /** 67 | * array_merge for result. 68 | * 69 | * @return array 70 | */ 71 | return array_merge($app,$node); 72 | } 73 | 74 | 75 | /** 76 | * @var method node service 77 | * @return array 78 | */ 79 | public function getNodeForApp(){ 80 | 81 | $query= $this->request->query(); 82 | 83 | $request=(isset($query['request'])) ? $query['request'] : 'get'; 84 | 85 | $node=staticPathModel::getServiceNamespace('node',$request); 86 | 87 | if(class_exists($node)){ 88 | $methods=utils::getClassMethods($node,true); 89 | 90 | $nodes=[]; 91 | foreach($methods as $method){ 92 | $methodAction=$method.'Action'; 93 | $nodeClass=utils::resolve($node); 94 | $nodes[$method]=$nodeClass->$methodAction(); 95 | } 96 | return $nodes; 97 | } 98 | return []; 99 | 100 | 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /api: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | register(); 34 | 35 | /** 36 | * set config 37 | */ 38 | require (\Apix\staticPathModel::$apixClassAliasPath); 39 | \Apix\environment::config(); 40 | use Apix\StaticPathModel as staticPath; 41 | use Apix\Utils; 42 | 43 | 44 | /** 45 | * System cli command main file 46 | * this snippet calls really command file for system 47 | * return class method 48 | */ 49 | if(file_exists(staticPath::$binCommandsPath.''.$argv[1].''.utils::$extension)){ 50 | 51 | /** 52 | * System cli command for spl function 53 | * this snippet calls really spl command for system 54 | * return spl method 55 | */ 56 | $commandNamespaceSpl=staticPath::$binCommandsNameSpace.''.$argv[1]; 57 | $commandFile=new $commandNamespaceSpl(); 58 | 59 | /** 60 | * System cli main class file 61 | * this snippet calls really main class file for system 62 | * return class method 63 | */ 64 | $method=$argv[2]; 65 | echo $commandFile->$method(utils::getArgForConsoleParameters($argv)).''.PHP_EOL; 66 | } 67 | else{ 68 | 69 | /** 70 | * System cli custom command main file 71 | * return class method 72 | * get base properties 73 | */ 74 | echo utils::getBaseConsoleStaticProperties($argv); 75 | 76 | 77 | } 78 | 79 | 80 | -------------------------------------------------------------------------------- /src/store/packages/providers/auth/src/register/config.php: -------------------------------------------------------------------------------- 1 | config=$config; 47 | 48 | /** 49 | * push to array auth credentials 50 | * push to array auth client ip 51 | * push to array auth client http browser info 52 | */ 53 | $this->dataForHash =$this->config->getCredentials(); 54 | $this->dataForHash['ip'] =(new Request())->getClientIp(); 55 | $this->dataForHash['agent'] =$_SERVER['HTTP_USER_AGENT']; 56 | 57 | //set context hash variable 58 | $this->contextHash=$this->dataForHash; 59 | $this->setContextHash('time',time()); 60 | 61 | //id algorithm 62 | //it is for that we do not directly register auth id 63 | $this->setIdAlgorithm(); 64 | 65 | //set hash for dataForHash 66 | //it hashes md5 and sha1 67 | return $this->getContextHash(); 68 | 69 | } 70 | 71 | /** 72 | * @param $key 73 | * @param $value 74 | */ 75 | protected function setContextHash($key, $value){ 76 | 77 | //check context Hash 78 | //if it is empty,then set key value 79 | if(!isset($this->contextHash[$key])){ 80 | 81 | $this->contextHash[$key]=$value; 82 | } 83 | 84 | } 85 | 86 | /** 87 | * @method getContextHash 88 | */ 89 | protected function getContextHash(){ 90 | 91 | //context hash with id algorithm 92 | return $this->id.'_'.md5(sha1(implode(',',$this->contextHash))); 93 | } 94 | 95 | /** 96 | * @method setIdAlgorithm 97 | */ 98 | protected function setIdAlgorithm(){ 99 | 100 | //set encrypt model for id 101 | $this->id=$this->config->getAuthEncryptModel(); 102 | } 103 | 104 | } 105 | -------------------------------------------------------------------------------- /src/store/config/dbConnector.php: -------------------------------------------------------------------------------- 1 | driver=$configdb['driver']; 36 | $this->host=$configdb['host']; 37 | $this->database=$configdb['database']; 38 | $this->user=$configdb['user']; 39 | $this->password=$configdb['password']; 40 | 41 | /** @var TYPE_NAME $this */ 42 | try { 43 | 44 | if(self::$instance===null){ 45 | $this->db = new \PDO(''.$this->driver.':host='.$this->host.';dbname='.$this->database.'', $this->user,$this->password); 46 | $this->db->exec("SET NAMES utf8"); 47 | $this->db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); 48 | $this->db->setAttribute(\PDO::ATTR_EMULATE_PREPARES,false); 49 | //$this->db->setAttribute(\PDO::ATTR_PERSISTENT,true); 50 | 51 | self::$instance=$this->db; 52 | } 53 | 54 | $this->db=self::$instance; 55 | } 56 | catch (\PDOException $e) { 57 | if(environment()=="local"){ 58 | $connectionError=[ 59 | 'status'=>false, 60 | 'result'=>[ 61 | 'error'=>true, 62 | 'code'=>$e->getCode(), 63 | 'message'=>'Database Connection Error', 64 | 'trace'=>$e->getTrace() 65 | ] 66 | 67 | ]; 68 | echo json_encode($connectionError); 69 | } 70 | else{ 71 | 72 | throw new \LogicException('Production Connection Settings Error'); 73 | } 74 | 75 | exit(); 76 | } 77 | } 78 | 79 | } 80 | 81 | 82 | public function get(){ 83 | 84 | return $this->db; 85 | 86 | } 87 | 88 | public function getDriver(){ 89 | return $this->driver; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/store/services/fileProcess.php: -------------------------------------------------------------------------------- 1 | fs = new Filesystem(); 23 | } 24 | 25 | /** 26 | * filesystem mkdir method. 27 | * mkdir() creates a directory. 28 | * On POSIX filesystems, directories are created with a default mode value 0777. 29 | * You can use the second argument to set your own mode 30 | * 31 | * @return filesystem class 32 | */ 33 | public function mkdir($path=null,$dir=null,$chmod=0777) 34 | { 35 | if($path!==null && $dir!==null){ 36 | try { 37 | $this->fs->mkdir($path.'/'.$dir,$chmod); 38 | } catch (IOExceptionInterface $e) { 39 | echo "An error occurred while creating your directory at ".$e->getPath(); 40 | } 41 | } 42 | return false; 43 | } 44 | 45 | 46 | /** 47 | * filesystem exists method. 48 | * exists() checks for the presence of all files or directories and returns false if a file is missing: 49 | * You can pass an array or any Traversable object as the first argument. 50 | * @return filesystem class 51 | */ 52 | public function exists($path=null) 53 | { 54 | if($path!==null){ 55 | return $this->fs->exists($path); 56 | } 57 | return false; 58 | } 59 | 60 | 61 | /** 62 | * copy() is used to copy files. If the target already exists, the file is copied only if the 63 | * source modification date is later than the target. 64 | * This behavior can be overridden by the third boolean argument: 65 | * @return filesystem class 66 | */ 67 | public function copy($copied=null,$copying=null) 68 | { 69 | if($copied!==null && $copying!==null){ 70 | return $this->fs->copy($copied,$copying,true); 71 | } 72 | } 73 | 74 | 75 | /** 76 | * touch() sets access and modification time for a file. The current time is used by default. 77 | * You can set your own with the second argument. The third argument is the access time: 78 | * @return filesystem class 79 | */ 80 | public function touch($touch=null,$own=null,$access=null) 81 | { 82 | if($touch!==null){ 83 | $this->fs->touch($touch); 84 | } 85 | } 86 | 87 | 88 | } 89 | -------------------------------------------------------------------------------- /src/store/services/settings.php: -------------------------------------------------------------------------------- 1 | optionalPath=StaticPathModel::optionalPath(true); 16 | $this->settingsPath=$this->optionalPath.'/Settings'; 17 | 18 | if(!file_exists($this->settingsPath)){ 19 | 20 | mkdir($this->settingsPath,0777); 21 | touch($this->settingsPath.'/app.dist'); 22 | } 23 | 24 | } 25 | 26 | /** 27 | * @param $file string 28 | * @param $key 29 | * @param $value 30 | * @return string 31 | */ 32 | public static function set($file, $key, $value){ 33 | 34 | //get instance 35 | $instance=new self; 36 | 37 | //new data 38 | $new=[]; 39 | $new[$key]=$value; 40 | 41 | /** 42 | * @var $old array 43 | */ 44 | $old=(self::get($file)===null) ? [] : self::get($file); 45 | 46 | //join new data and old data 47 | $data=array_merge($old,$new); 48 | 49 | //yaml process 50 | $yaml = Yaml::dump($data); 51 | file_put_contents($instance->settingsPath.'/'.ucfirst($file).'.yml', $yaml); 52 | 53 | } 54 | 55 | /** 56 | * @param $file string 57 | * @param $default 58 | * @return string 59 | */ 60 | public static function get($file,$default=null){ 61 | 62 | //get instance 63 | $instance=new self; 64 | 65 | //file parse 66 | $fileParse=explode(".",$file); 67 | 68 | //get file 69 | $file=$fileParse[0]; 70 | 71 | if(isset($fileParse[1])){ 72 | 73 | //get key 74 | $key=$fileParse[1]; 75 | } 76 | 77 | 78 | //get yaml path 79 | $yamlPath=$instance->settingsPath.'/'.$file.'.yml'; 80 | 81 | if($default!==null){ 82 | 83 | $value=(self::get($file)===null) ? [] : self::get($file); 84 | 85 | if(isset($key) AND !isset($value[$key])){ 86 | return $default; 87 | } 88 | } 89 | 90 | //if there is no yaml path 91 | if(!file_exists($yamlPath)){ 92 | 93 | return null; 94 | } 95 | 96 | 97 | //get yaml data 98 | $value = Yaml::parse(file_get_contents($yamlPath)); 99 | 100 | if(isset($key)){ 101 | 102 | //return with key 103 | return (isset($value[$key])) ? $value[$key] : null; 104 | } 105 | 106 | //all data 107 | return $value; 108 | 109 | } 110 | 111 | public static function has($file){ 112 | 113 | return (self::get($file)===null) ? false : true; 114 | } 115 | 116 | } 117 | -------------------------------------------------------------------------------- /src/store/packages/providers/webservice/src/simpleXml.php: -------------------------------------------------------------------------------- 1 | point(pointer)->get() 20 | * call2 : \Xml::url()->get() 21 | * call3 : \Xml::groupName()->point(pointer)->get() 22 | * return type string 23 | * 24 | */ 25 | 26 | class simpleXml { 27 | 28 | /** 29 | * @var $url 30 | */ 31 | public static $url=false; 32 | 33 | /** 34 | * @var $url 35 | */ 36 | public static $xml; 37 | 38 | /** 39 | * @var pointer 40 | */ 41 | public static $pointer=false; 42 | 43 | /** 44 | * @var $group 45 | */ 46 | public static $group=null; 47 | 48 | 49 | /** 50 | * return mixed 51 | */ 52 | public static function url($url=false,$pointer=false){ 53 | 54 | if($url){ 55 | self::$url=true; 56 | self::$xml=app('guzzle')->get($url,'xml'); 57 | 58 | if($pointer){ 59 | return self::$xml; 60 | } 61 | } 62 | 63 | self::$pointer=true; 64 | 65 | return new static; 66 | } 67 | 68 | public static function point($point=false){ 69 | 70 | if(self::$url===false){ 71 | self::$pointer=true; 72 | } 73 | 74 | if($point && self::$pointer){ 75 | static::url(\app::getWebServiceConfigUrl(self::$group,$point),true); 76 | } 77 | 78 | return new static; 79 | } 80 | 81 | /** 82 | * @method test 83 | */ 84 | public static function get($loadData=false){ 85 | 86 | /** 87 | * simple Xml load 88 | * return xml 89 | */ 90 | define('guzzleOutPutter',app('base')->response); 91 | 92 | /** 93 | * @var $xml 94 | * get url xml data 95 | */ 96 | $xml = simplexml_load_string(self::$xml, "SimpleXMLElement", LIBXML_NOCDATA); 97 | 98 | /** 99 | * @var $json 100 | * get to array xml data 101 | */ 102 | $json = json_encode($xml); 103 | 104 | /** 105 | * get finally output 106 | */ 107 | return (object)json_decode($json,TRUE); 108 | 109 | 110 | } 111 | 112 | 113 | /** 114 | * @method test 115 | */ 116 | public static function toArray($data){ 117 | 118 | $xmlToArrayResolve=new \SimpleXMLElement($data); 119 | return json_decode(json_encode($xmlToArrayResolve),1); 120 | 121 | } 122 | 123 | 124 | /** 125 | * @method __callStatic 126 | */ 127 | public static function __callStatic($group,$args){ 128 | self::$group=$group; 129 | return new static; 130 | } 131 | 132 | } 133 | -------------------------------------------------------------------------------- /src/store/services/httpSession.php: -------------------------------------------------------------------------------- 1 | session = new Session($storage); 30 | self::$instance=$this->session; 31 | }else{ 32 | $this->session=self::$instance; 33 | } 34 | 35 | } 36 | 37 | /** 38 | * {@set} . 39 | * Sets an attribute by key. 40 | */ 41 | public function set($key=null,$value=null) 42 | { 43 | if($key!==null && $value!==null){ 44 | return $this->session->set($key,$value); 45 | } 46 | return false; 47 | } 48 | 49 | 50 | /** 51 | * {@get} . 52 | * Gets an attribute by key. 53 | */ 54 | public function get($key=null) 55 | { 56 | if($key!==null){ 57 | return $this->session->get($key); 58 | } 59 | return null; 60 | } 61 | 62 | /** 63 | * {@has} 64 | * Returns true if the attribute exists. 65 | */ 66 | public function has($name=null) 67 | { 68 | if($name!==null){ 69 | return $this->session->has($name); 70 | } 71 | return false; 72 | } 73 | 74 | /** 75 | * {@all} 76 | * Gets all attributes as an array of key => value. 77 | */ 78 | public function all() 79 | { 80 | return $this->session->all(); 81 | } 82 | 83 | /** 84 | * {@remove} 85 | * Deletes an attribute by key. 86 | */ 87 | public function remove($name=null) 88 | { 89 | if($name!==null){ 90 | return $this->session->remove($name); 91 | } 92 | return null; 93 | } 94 | 95 | 96 | /** 97 | * {@clear} 98 | * Clear all attributes. 99 | */ 100 | public function clear() 101 | { 102 | return $this->session->clear(); 103 | } 104 | 105 | 106 | 107 | } -------------------------------------------------------------------------------- /src/store/packages/providers/auth/src/authenticate.php: -------------------------------------------------------------------------------- 1 | guard=($guard===null) ? $this->guard: $guard; 26 | 27 | return $this; 28 | } 29 | 30 | /** 31 | * @param array $credentials 32 | * @return mixed|null|string 33 | * login post attempt 34 | */ 35 | public function attempt($credentials=array()){ 36 | 37 | //destroy if there is auth session 38 | //then,set register process 39 | $this->getAuthRegisterModel('destroy'); 40 | 41 | /** 42 | * @var $this->getAuthDriverModel 43 | * get driver and model query 44 | */ 45 | $this->getAuthDriverModel($credentials,'attempt'); 46 | 47 | return $this->result; 48 | 49 | } 50 | 51 | 52 | /** 53 | * @method check 54 | * @return null 55 | */ 56 | public function check(){ 57 | 58 | /** 59 | * @var $this->getAuthDriverModel 60 | * get driver and model query 61 | */ 62 | $this->getAuthDriverModel([],'check'); 63 | 64 | return $this->result; 65 | 66 | } 67 | 68 | /** 69 | * @method persistent 70 | * @return null 71 | */ 72 | public function persistent(){ 73 | 74 | /** 75 | * @var $this->getAuthDriverModel 76 | * get driver and model query 77 | */ 78 | $this->getAuthDriverModel([],'persistent'); 79 | 80 | return $this->result; 81 | 82 | } 83 | 84 | 85 | /** 86 | * @method user 87 | * @return object 88 | */ 89 | public function user(){ 90 | 91 | //take data 92 | $this->check(); 93 | 94 | //check returned query 95 | if(isset($this->query['results'])){ 96 | 97 | //get user information as object 98 | return (object)$this->query['results'][0]; 99 | } 100 | 101 | return null; 102 | 103 | 104 | } 105 | 106 | /** 107 | * @method logout 108 | * @return mixed 109 | */ 110 | public function logout(){ 111 | 112 | //auth register model destroy 113 | return $this->getAuthDriverModel([],'logout'); 114 | } 115 | 116 | /** 117 | * @method getToken 118 | * @return mixed 119 | */ 120 | public function getToken(){ 121 | 122 | //if the user is not null 123 | if($this->user()!==null){ 124 | 125 | //get token from user 126 | return $this->user()->{$this->getTokenField()}; 127 | } 128 | 129 | return null; 130 | } 131 | 132 | 133 | 134 | 135 | } 136 | -------------------------------------------------------------------------------- /external/public/declarations/apidoc_files/polyfill.js: -------------------------------------------------------------------------------- 1 | // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys 2 | if (!Object.keys) { 3 | Object.keys = (function () { 4 | 'use strict'; 5 | var hasOwnProperty = Object.prototype.hasOwnProperty, 6 | hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'), 7 | dontEnums = [ 8 | 'toString', 9 | 'toLocaleString', 10 | 'valueOf', 11 | 'hasOwnProperty', 12 | 'isPrototypeOf', 13 | 'propertyIsEnumerable', 14 | 'constructor' 15 | ], 16 | dontEnumsLength = dontEnums.length; 17 | 18 | return function (obj) { 19 | if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { 20 | throw new TypeError('Object.keys called on non-object'); 21 | } 22 | 23 | var result = [], prop, i; 24 | 25 | for (prop in obj) { 26 | if (hasOwnProperty.call(obj, prop)) { 27 | result.push(prop); 28 | } 29 | } 30 | 31 | if (hasDontEnumBug) { 32 | for (i = 0; i < dontEnumsLength; i++) { 33 | if (hasOwnProperty.call(obj, dontEnums[i])) { 34 | result.push(dontEnums[i]); 35 | } 36 | } 37 | } 38 | return result; 39 | }; 40 | }()); 41 | } 42 | 43 | //Production steps of ECMA-262, Edition 5, 15.4.4.18 44 | //Reference: http://es5.github.com/#x15.4.4.18 45 | if (!Array.prototype.forEach) { 46 | 47 | Array.prototype.forEach = function (callback, thisArg) { 48 | 49 | var T, k; 50 | 51 | if (this == null) { 52 | throw new TypeError(" this is null or not defined"); 53 | } 54 | 55 | // 1. Let O be the result of calling ToObject passing the |this| value as the argument. 56 | var O = Object(this); 57 | 58 | // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length". 59 | // 3. Let len be ToUint32(lenValue). 60 | var len = O.length >>> 0; 61 | 62 | // 4. If IsCallable(callback) is false, throw a TypeError exception. 63 | // See: http://es5.github.com/#x9.11 64 | if (typeof callback !== "function") { 65 | throw new TypeError(callback + " is not a function"); 66 | } 67 | 68 | // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. 69 | if (arguments.length > 1) { 70 | T = thisArg; 71 | } 72 | 73 | // 6. Let k be 0 74 | k = 0; 75 | 76 | // 7. Repeat, while k < len 77 | while (k < len) { 78 | 79 | var kValue; 80 | 81 | // a. Let Pk be ToString(k). 82 | // This is implicit for LHS operands of the in operator 83 | // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk. 84 | // This step can be combined with c 85 | // c. If kPresent is true, then 86 | if (k in O) { 87 | 88 | // i. Let kValue be the result of calling the Get internal method of O with argument Pk. 89 | kValue = O[k]; 90 | 91 | // ii. Call the Call internal method of callback with T as the this value and 92 | // argument list containing kValue, k, and O. 93 | callback.call(T, kValue, k, O); 94 | } 95 | // d. Increase k by 1. 96 | k++; 97 | } 98 | // 8. return undefined 99 | }; 100 | } 101 | -------------------------------------------------------------------------------- /src/store/packages/providers/auth/src/driver/database.php: -------------------------------------------------------------------------------- 1 | config=$config; 34 | } 35 | 36 | /** 37 | * @param array $credentials 38 | * @return mixed 39 | */ 40 | public function attempt($credentials=array()){ 41 | 42 | //$credentials is array true and must be password 43 | if(count($this->config->credentials=$credentials)){ 44 | 45 | //config auth model properties 46 | $this->config->getAuthDriverBuilder(); 47 | } 48 | 49 | //check login and if it is true 50 | //set register process 51 | $this->config->setAuthRegister(); 52 | 53 | } 54 | 55 | 56 | /** 57 | * @method updateAppToken 58 | * @return mixed 59 | */ 60 | public function updateAppToken(){ 61 | 62 | //config auth model properties 63 | $this->config->getAuthDriverBuilder('updateAppToken'); 64 | 65 | } 66 | 67 | 68 | /** 69 | * @method check 70 | */ 71 | public function check(){ 72 | 73 | //check auth in register model 74 | $this->config->getAuthDriverBuilder('check'); 75 | 76 | //check login and if it is true 77 | //set register process 78 | $this->config->setAuthRegister(false); 79 | 80 | } 81 | 82 | 83 | /** 84 | * @method persistent 85 | */ 86 | public function persistent(){ 87 | 88 | //check auth in register model 89 | $this->config->getAuthDriverBuilder('persistent'); 90 | 91 | //check login and if it is true 92 | //set register process 93 | $this->config->setAuthRegister(false); 94 | 95 | } 96 | 97 | /** 98 | * @method logout 99 | */ 100 | public function logout(){ 101 | 102 | //get token 103 | $token=$this->config->getAuthRegisterModel('getAuthSession'); 104 | 105 | //get security authenticate data 106 | $this->config->getSecurityCredentials($token); 107 | 108 | //app token 109 | $this->config->token=$this->config->getAuthRegisterModel('getAuthHashConfigReference'); 110 | 111 | //update app token from driver model 112 | $this->config->getAuthDriverModel([],'updateAppToken'); 113 | 114 | return $this->config->getAuthRegisterModel('destroy'); 115 | 116 | } 117 | 118 | } 119 | -------------------------------------------------------------------------------- /src/store/packages/providers/database/sudb/src/joinBuilderOperation.php: -------------------------------------------------------------------------------- 1 | querySqlFormatter=$querySqlFormatter; 34 | } 35 | 36 | /** 37 | * getSelect method is main method. 38 | * 39 | * @return array 40 | */ 41 | public function joinMainProcess($data,$model){ 42 | 43 | $joinerModel=$model['model']->joiner; 44 | 45 | $joinerArray=[]; 46 | 47 | if(!isset($data['joiner'])){ 48 | $data=$this->callWithModel($joinerModel); 49 | } 50 | 51 | if(array_key_exists('joiner',$data)){ 52 | 53 | foreach ($data['joiner'][0] as $myJoin) { 54 | 55 | $myJoinBuilder="\\src\\app\\".app."\\".version."\\model\\sudb\\".$myJoin.""; 56 | $myJoinClass=new $myJoinBuilder(); 57 | $myJoinTable=$myJoinClass->table; 58 | 59 | foreach ($joinerModel[$myJoin]['relations'] as $key => $value) { 60 | $joinerArray['join'][] = strtoupper($data['type']) . ' JOIN ' . $myJoinTable . ' ON ' . $model['model']->table . '.' . $key . '=' . $myJoinTable . '.' . $value; 61 | } 62 | 63 | if (array_key_exists("select",$data) && array_key_exists($myJoin, $data['select'])) { 64 | 65 | foreach ($data['select'][$myJoin] as $selectVal) { 66 | $joinerArray['select'][] = $myJoinTable . '.' . $selectVal; 67 | } 68 | } else { 69 | $joinerArray['select'][] =null; 70 | } 71 | 72 | } 73 | } 74 | 75 | return $joinerArray; 76 | 77 | } 78 | 79 | 80 | /** 81 | * @param $data 82 | * @return array 83 | */ 84 | public function callWithModel($data){ 85 | 86 | $callWithModelArray=[]; 87 | foreach ($data as $model=>$value){ 88 | $callWithModelArray=($value['auto']) ? $this->callWithModelArray($model,$value) : $this->sparseFieldsModelJoin($data); 89 | } 90 | return $callWithModelArray; 91 | } 92 | 93 | /** 94 | * @param $data 95 | * @return array 96 | */ 97 | public function sparseFieldsModelJoin($data){ 98 | 99 | $queryString=(new Request())->getQueryString(); 100 | $callWithModelArray=[]; 101 | 102 | if(isset($queryString['relations'])){ 103 | 104 | $models=explode("-",$queryString['relations']); 105 | 106 | foreach ($data as $model=>$value){ 107 | 108 | if(in_array($model,$models)){ 109 | $callWithModelArray=$this->callWithModelArray($model,$value); 110 | } 111 | 112 | } 113 | 114 | } 115 | 116 | return $callWithModelArray; 117 | 118 | 119 | } 120 | 121 | 122 | /** 123 | * @param $model 124 | * @param $value 125 | * @return array 126 | */ 127 | private function callWithModelArray($model, $value){ 128 | 129 | $callWithModelArray=[]; 130 | $callWithModelArray['joiner'][0][]=$model; 131 | $callWithModelArray['joiner'][1][$model]=$value['fields']; 132 | $callWithModelArray['type']=$value['join']; 133 | $callWithModelArray['select'][$model]=$value['fields']; 134 | 135 | return $callWithModelArray; 136 | } 137 | 138 | 139 | } -------------------------------------------------------------------------------- /src/store/services/rabbitMQ.php: -------------------------------------------------------------------------------- 1 | app=$app; 45 | $this->declare=$declare; 46 | } 47 | else{ 48 | $projectConfig="\\src\\app\\".app."\\".version."\\config\\rabbitMQ"; 49 | $this->app=app; 50 | $this->declare=app; 51 | } 52 | 53 | 54 | $rabbitMQ=$projectConfig::rmqSettings(); 55 | 56 | $this->connection=new AMQPStreamConnection($rabbitMQ['rabbitMQ']['host'], $rabbitMQ['rabbitMQ']['port'], $rabbitMQ['rabbitMQ']['user'], $rabbitMQ['rabbitMQ']['password']); 57 | $this->channel=$this->connection->channel(); 58 | 59 | } 60 | 61 | 62 | 63 | public function publisher(){ 64 | 65 | $this->channel->exchange_declare($this->declare, 'fanout', false, false, false); 66 | 67 | $task='\\src\\app\\'.$this->app.'\\'.utils::getAppVersion($this->app).'\\optional\\jobs\\rabbitmq\\'.$this->declare.'\\task'; 68 | 69 | $msg = new AMQPMessage((new $task())->execute()); 70 | 71 | $this->channel->basic_publish($msg, $this->declare); 72 | 73 | $this->channel->close(); 74 | $this->connection->close(); 75 | } 76 | 77 | 78 | public function subscriber(){ 79 | 80 | //cli command : nohup php api job pusher rabbitmq mobi user subscriber > /dev/null 2>&1 & 81 | // nohup kill : kill -9 pid 82 | 83 | $this->channel->exchange_declare($this->declare, 'fanout', false, false, false); 84 | 85 | list($queue_name, ,) = $this->channel->queue_declare("", false, false, true, false); 86 | 87 | $this->channel->queue_bind($queue_name, $this->declare); 88 | 89 | $callback = function($msg){}; 90 | 91 | $this->channel->basic_consume($queue_name, '', false, true, false, false, $callback); 92 | 93 | while(count($this->channel->callbacks)) { 94 | 95 | $process = new Process('php api job run rabbitmq '.$this->app.' '.$this->declare.' publisher'); 96 | $process->run(); 97 | 98 | // executes after the command finishes 99 | if (!$process->isSuccessful()) { 100 | throw new ProcessFailedException($process); 101 | } 102 | echo $process->getOutput(); 103 | sleep(5); 104 | } 105 | 106 | $this->channel->close(); 107 | $this->connection->close(); 108 | } 109 | 110 | 111 | public function run(){ 112 | 113 | $process = new Process('nohup php api job run rabbitmq '.$this->app.' '.$this->declare.' subscriber > '.root.'/src/app/'.$this->app.'/'.utils::getAppVersion($this->app).'/optional/jobs/rabbitmq/'.$this->declare.'/nohup 2>&1 & echo $! > '.root.'/src/app/'.$this->app.'/'.utils::getAppVersion($this->app).'/optional/jobs/rabbitmq/'.$this->declare.'/save_pid.txt'); 114 | $process->run(); 115 | 116 | // executes after the command finishes 117 | if (!$process->isSuccessful()) { 118 | throw new ProcessFailedException($process); 119 | } 120 | 121 | echo $process->getOutput(); 122 | } 123 | 124 | 125 | } 126 | -------------------------------------------------------------------------------- /external/public/declarations/apidoc_files/css: -------------------------------------------------------------------------------- 1 | /* latin-ext */ 2 | @font-face { 3 | font-family: 'Source Code Pro'; 4 | font-style: normal; 5 | font-weight: 400; 6 | src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(http://fonts.gstatic.com/s/sourcecodepro/v6/mrl8jkM18OlOQN8JLgasD4a1YDtoarzwSXxTHggEXMw.woff2) format('woff2'); 7 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; 8 | } 9 | /* latin */ 10 | @font-face { 11 | font-family: 'Source Code Pro'; 12 | font-style: normal; 13 | font-weight: 400; 14 | src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(http://fonts.gstatic.com/s/sourcecodepro/v6/mrl8jkM18OlOQN8JLgasD5bPFduIYtoLzwST68uhz_Y.woff2) format('woff2'); 15 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; 16 | } 17 | /* vietnamese */ 18 | @font-face { 19 | font-family: 'Source Sans Pro'; 20 | font-style: normal; 21 | font-weight: 400; 22 | src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url(http://fonts.gstatic.com/s/sourcesanspro/v9/ODelI1aHBYDBqgeIAH2zlCxe5Tewm2_XWfbGchcXw4g.woff2) format('woff2'); 23 | unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; 24 | } 25 | /* latin-ext */ 26 | @font-face { 27 | font-family: 'Source Sans Pro'; 28 | font-style: normal; 29 | font-weight: 400; 30 | src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url(http://fonts.gstatic.com/s/sourcesanspro/v9/ODelI1aHBYDBqgeIAH2zlIa1YDtoarzwSXxTHggEXMw.woff2) format('woff2'); 31 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; 32 | } 33 | /* latin */ 34 | @font-face { 35 | font-family: 'Source Sans Pro'; 36 | font-style: normal; 37 | font-weight: 400; 38 | src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url(http://fonts.gstatic.com/s/sourcesanspro/v9/ODelI1aHBYDBqgeIAH2zlJbPFduIYtoLzwST68uhz_Y.woff2) format('woff2'); 39 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; 40 | } 41 | /* vietnamese */ 42 | @font-face { 43 | font-family: 'Source Sans Pro'; 44 | font-style: normal; 45 | font-weight: 600; 46 | src: local('Source Sans Pro Semibold'), local('SourceSansPro-Semibold'), url(http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGMZXFz2iDKd7GJNSaxRYiSj3rGVtsTkPsbDajuO5ueQw.woff2) format('woff2'); 47 | unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; 48 | } 49 | /* latin-ext */ 50 | @font-face { 51 | font-family: 'Source Sans Pro'; 52 | font-style: normal; 53 | font-weight: 600; 54 | src: local('Source Sans Pro Semibold'), local('SourceSansPro-Semibold'), url(http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGKyGJhAh-RE0BxGcd_izyev3rGVtsTkPsbDajuO5ueQw.woff2) format('woff2'); 55 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; 56 | } 57 | /* latin */ 58 | @font-face { 59 | font-family: 'Source Sans Pro'; 60 | font-style: normal; 61 | font-weight: 600; 62 | src: local('Source Sans Pro Semibold'), local('SourceSansPro-Semibold'), url(http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGMzFoXZ-Kj537nB_-9jJhlA.woff2) format('woff2'); 63 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; 64 | } 65 | /* vietnamese */ 66 | @font-face { 67 | font-family: 'Source Sans Pro'; 68 | font-style: normal; 69 | font-weight: 700; 70 | src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGMms7UHsIbjUxEJqIwog-i_3rGVtsTkPsbDajuO5ueQw.woff2) format('woff2'); 71 | unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; 72 | } 73 | /* latin-ext */ 74 | @font-face { 75 | font-family: 'Source Sans Pro'; 76 | font-style: normal; 77 | font-weight: 700; 78 | src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGO4s1Ux4PuImWPk5fSr6HPL3rGVtsTkPsbDajuO5ueQw.woff2) format('woff2'); 79 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; 80 | } 81 | /* latin */ 82 | @font-face { 83 | font-family: 'Source Sans Pro'; 84 | font-style: normal; 85 | font-weight: 700; 86 | src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGJkF8H8ye47wsfpWywda8og.woff2) format('woff2'); 87 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; 88 | } 89 | -------------------------------------------------------------------------------- /src/store/packages/providers/auth/src/register/session.php: -------------------------------------------------------------------------------- 1 | config =$config; 45 | $this->session =app('session'); 46 | $this->persistent =$this->config->persistent; 47 | } 48 | 49 | /** 50 | * @method register 51 | */ 52 | public function register(){ 53 | 54 | //check session 55 | if(!$this->hasAuthSession()){ 56 | 57 | //get hash for auth 58 | $authHash=$this->getAuthHash($this->config); 59 | 60 | //check persistent and then real authHash 61 | $authHash=($this->persistent===null) ? $authHash : $this->persistent; 62 | 63 | //session register for authHash 64 | $this->session->set('auth',$authHash); 65 | 66 | //app token 67 | $this->config->token=$this->session->get('auth'); 68 | 69 | //update app token from driver model 70 | $this->config->getAuthDriverModel([],'updateAppToken'); 71 | 72 | } 73 | 74 | //query result 75 | $this->config->result=[ 76 | 'authToken'=>$this->session->get('auth') 77 | ]; 78 | } 79 | 80 | /** 81 | * @method check 82 | * @return array 83 | */ 84 | public function check(){ 85 | 86 | if($this->hasAuthSession()){ 87 | 88 | //session auth parse 89 | $authExplode=$this->sessionAuthParse(); 90 | 91 | //get authMath 92 | $authMath=(int)$authExplode[0]; 93 | 94 | //get auth id resolved via encrypt model 95 | $authId=$this->config->getAuthEncryptModel('resolve',(int)$authExplode[0]); 96 | 97 | //get auth token 98 | $authData=(isset($authExplode[1])) ? $authExplode[1] : null; 99 | 100 | //get token from session 101 | $token=$this->session->get('auth'); 102 | 103 | //return compact for array 104 | return compact('authMath','authId','authData','token'); 105 | } 106 | 107 | return []; 108 | } 109 | 110 | 111 | /** 112 | * @method destroy 113 | * auth destroy 114 | */ 115 | public function destroy(){ 116 | 117 | if($this->hasAuthSession()){ 118 | 119 | //session auth destroy 120 | $this->session->remove('auth'); 121 | 122 | return true; 123 | } 124 | 125 | return false; 126 | 127 | } 128 | 129 | /** 130 | * @method sessionAuthParse 131 | */ 132 | private function sessionAuthParse(){ 133 | 134 | //session auth parse 135 | return explode('_',$this->session->get('auth')); 136 | 137 | } 138 | 139 | 140 | /** 141 | * @method hasAuthSession 142 | */ 143 | private function hasAuthSession(){ 144 | 145 | //get session auth 146 | return $this->session->has('auth'); 147 | 148 | } 149 | 150 | 151 | /** 152 | * @method getAuthSession 153 | */ 154 | public function getAuthSession(){ 155 | 156 | if($this->hasAuthSession()){ 157 | 158 | //get session auth 159 | return $this->session-> get('auth'); 160 | } 161 | 162 | return null; 163 | 164 | 165 | } 166 | 167 | /** 168 | * @method getAuthHashConfigReference 169 | * @return string 170 | */ 171 | public function getAuthHashConfigReference() 172 | { 173 | return parent::getAuthHash($this->config); 174 | } 175 | 176 | 177 | } 178 | -------------------------------------------------------------------------------- /src/store/packages/dev/apixDevPackageIllustration/devpack/model/sudb/user.php: -------------------------------------------------------------------------------- 1 | false,'expire'=>60]; 50 | 51 | /** 52 | * @var createdAndUpdatedFields. 53 | * 54 | * @info this value is created and updated time for values it will be inserted 55 | * @status obligatory 56 | */ 57 | public $createdAndUpdatedFields=['created_at'=>'createdAt','updated_at'=>'updatedAt']; 58 | 59 | 60 | /** 61 | * @var resultDataInfo. 62 | * 63 | * @info this value changes default result data info 64 | * @example coultAllData=>'total' 65 | * @status optional 66 | */ 67 | public $resultDataInfo=[]; 68 | 69 | 70 | /** 71 | * @var joiner relationship. 72 | * 73 | * @info joiner table is relationship 74 | * @status it is array 75 | * @param tableName=>['childRelation'=>'tableNameRelation'] 76 | */ 77 | public $joiner=[]; 78 | 79 | 80 | /** 81 | * @var selectHidden. 82 | * 83 | * @info your table columns is hidden 84 | * @status optional 85 | */ 86 | public $selectHidden=[]; 87 | 88 | /** 89 | * @var insertConditions. 90 | * 91 | * @info restrictions for data inserted by client 92 | * @status optional - it is run for status true 93 | */ 94 | public $insertConditions=[ 95 | 'status'=>false, 96 | 'wantedFields'=>[], 97 | 'exceptFields'=>[], 98 | 'obligatoryFields'=>[], 99 | 'queueFields'=>[] 100 | ]; 101 | 102 | /** 103 | * @var updateConditions. 104 | * 105 | * @info restrictions for data updated by client 106 | * @status optional - it is run for status true 107 | */ 108 | public $updateConditions=[ 109 | 'status'=>false, 110 | 'wantedFields'=>[], 111 | 'exceptFields'=>[], 112 | 'obligatoryFields'=>[], 113 | 'queueFields'=>[] 114 | ]; 115 | 116 | /** 117 | * @var selectPermissions. 118 | * 119 | * @info client can select to data 120 | * @status optional - it is run for status true 121 | */ 122 | public $selectPermissions=[ 123 | 'status'=>false, 124 | 'authorized'=>'*', 125 | 'forbidden'=>[], 126 | 'tokens'=>'*', 127 | 'seperator'=>'::' 128 | ]; 129 | 130 | 131 | /** 132 | * @var scope. 133 | * 134 | * @info specific where conditional 135 | * @status optional 136 | */ 137 | public $scope=['auto'=>[]]; 138 | 139 | 140 | /** 141 | * @var modelScope. 142 | * 143 | * @info specific where conditional snippet 144 | * @status optional 145 | */ 146 | public function modelScope($data, $query) 147 | { 148 | 149 | //get id 150 | if ($data=="id") { 151 | $query->where(function ($model) { 152 | if (\app::checkUrlParam("id")) { 153 | $model->where("id", "=", \app::getUrlParam("id")); 154 | } 155 | }); 156 | } 157 | 158 | //scopes 159 | if ($data=="active") { 160 | $query->where("status", "=", 1); 161 | } 162 | } 163 | 164 | /** 165 | * @var specific field . 166 | * 167 | * @info your table columns is value 168 | * @status optional 169 | */ 170 | /*public function fieldPassword(){ 171 | return md5(\app::post("password")); 172 | }*/ 173 | 174 | 175 | public function __construct(){ 176 | 177 | $this->resultDataInfo=$this->resultDataInfo(); 178 | $this->paginator=$this->paginator(); 179 | $this->orderBy=$this->orderBy(); 180 | } 181 | } 182 | -------------------------------------------------------------------------------- /src/store/services/platform.php: -------------------------------------------------------------------------------- 1 | instance==null){ 36 | if($name!==null){ 37 | $this->platform=$name; 38 | $this->instance=1; 39 | } 40 | } 41 | else{ 42 | if($this->instance==1){ 43 | if($name!==null){ 44 | $this->service=service; 45 | $this->instance=2; 46 | } 47 | } 48 | else{ 49 | if($name!==null){ 50 | $this->filename=method; 51 | $this->instance=3; 52 | } 53 | } 54 | 55 | } 56 | 57 | return $this; 58 | } 59 | 60 | 61 | 62 | /** 63 | * get platform get. 64 | * 65 | * @return array 66 | */ 67 | public function take($callback=null){ 68 | 69 | if($this->service==null && $this->filename==null){ 70 | $this->service=service; 71 | $this->filename=method; 72 | } 73 | 74 | if(defined("devPackage")){ 75 | 76 | $config='\\src\\store\\packages\\dev\\'.service.'\\platform\\config'; 77 | $status=false; 78 | $instance=true; 79 | $configMethodMain=''.$this->platform; 80 | $configMethod=''.$this->platform.'_'.$this->service.'_'.$this->filename; 81 | if(method_exists($config,$configMethod)){ 82 | $status=\Apix\utils::resolve($config)->$configMethod(); 83 | $instance=false; 84 | } 85 | 86 | if($instance && method_exists($config,$configMethodMain)){ 87 | $status=\Apix\utils::resolve($config)->$configMethodMain(); 88 | } 89 | 90 | if($method!==null && $status){ 91 | $classplatform=root.'/src/packages/dev/'.service.'/platform/'.$this->platform.'/'.$this->service.'/'.$this->filename.'.php'; 92 | if(file_exists($classplatform)){ 93 | $platformname='\\src\\store\\packages\\dev\\'.service.'\\platform\\'.$this->platform.'\\'.$this->service.'\\'.$this->filename; 94 | return \Apix\utils::resolve($platformname)->$method(); 95 | } 96 | if(is_callable($callback)){ 97 | return call_user_func($callback); 98 | } 99 | return false; 100 | 101 | 102 | } 103 | } 104 | else{ 105 | 106 | $config='\\src\\app\\'.app.'\\'.version.'\\optional\\platform\\config'; 107 | $status=false; 108 | $instance=true; 109 | $configMethodMain=''.$this->platform; 110 | $configMethod=''.$this->platform.'_'.$this->service.'_'.$this->filename; 111 | if(method_exists($config,'handle')){ 112 | $platformResolve=\Apix\utils::resolve($config)->handle(); 113 | $this->platform=$platformResolve; 114 | $instance=false; 115 | $status=true; 116 | } 117 | 118 | if($status){ 119 | 120 | $classplatform=root.'/src/app/'.app.'/'.version.'/optional/platform/'.$this->platform.'/'.$this->service.'/'.request.'Service.php'; 121 | if(file_exists($classplatform)){ 122 | $platformname='\\src\\app\\'.app.'\\'.version.'\\optional\\platform\\'.$this->platform.'\\'.$this->service.'\\'.request.'Service'; 123 | $method=method; 124 | $appPlatform=\Apix\utils::resolve($platformname); 125 | if(method_exists($appPlatform,$method)){ 126 | return \Apix\utils::resolve($platformname)->$method(); 127 | } 128 | 129 | } 130 | if(is_callable($callback)){ 131 | return call_user_func($callback); 132 | } 133 | return false; 134 | 135 | 136 | } 137 | 138 | if(is_callable($callback)){ 139 | return call_user_func($callback); 140 | } 141 | return false; 142 | 143 | } 144 | 145 | } 146 | 147 | 148 | } 149 | -------------------------------------------------------------------------------- /src/store/packages/providers/auth/src/builder/sudb.php: -------------------------------------------------------------------------------- 1 | config =$config; 34 | $this->model =$this->config->getModel(); 35 | } 36 | 37 | /** 38 | * @param $pure 39 | * @method register 40 | * @return mixed 41 | */ 42 | public function attempt($pure=false){ 43 | 44 | //get model 45 | $model=$this->model; 46 | 47 | /** 48 | * @var $credentials 49 | * get credentials 50 | */ 51 | $credentials=$this->config->credentials; 52 | 53 | //pure model query 54 | //credentials coming from client 55 | $query=$model::where(function($query) use($credentials) { 56 | 57 | foreach ($credentials as $key=>$value){ 58 | $query->where($key,'=',$value); 59 | } 60 | }); 61 | 62 | //pure true 63 | if($pure){ 64 | 65 | //get pure query 66 | //for update 67 | return $query; 68 | } 69 | 70 | //sudb orm query 71 | $this->config->query =$query->get(); 72 | 73 | if(isset($this->config->query['results'])){ 74 | $this->config->data =$this->config->query['results'][0]; 75 | } 76 | 77 | } 78 | 79 | /** 80 | * @method updateAppToken 81 | */ 82 | public function updateAppToken(){ 83 | 84 | //app token update 85 | $this->attempt(true)->update([$this->config->getTokenField()=>$this->config->token]); 86 | } 87 | 88 | 89 | /** 90 | * @param $token 91 | * @return mixed 92 | */ 93 | public function getSecurityDataForToken($token){ 94 | 95 | //get model 96 | $model=$this->model; 97 | 98 | $query=$model::where($this->config->getTokenField(),'=',$token)->get(); 99 | 100 | return $query; 101 | } 102 | 103 | 104 | /** 105 | * @method check 106 | * check auth from driver 107 | */ 108 | public function check(){ 109 | 110 | //get model 111 | $model=$this->model; 112 | 113 | //check register method for auth 114 | $auth=$this->config->getAuthRegisterModel('check'); 115 | 116 | //check authId from session 117 | if(isset($auth['authId'])){ 118 | 119 | //set config data id 120 | $this->config->data['id']=$auth['authId']; 121 | } 122 | 123 | //check driver for auth and auth math as real calculating via client ip 124 | if(isset($auth['authMath']) && $auth['authMath']==$this->config->getAuthEncryptModel()){ 125 | 126 | //get query for auth id 127 | $this->config->query=$model::where(function($query) use($auth) { 128 | 129 | $query->where('id','=',$auth['authId']); 130 | $query->where($this->config->getTokenField(),'=',$auth['token']); 131 | 132 | })->get(); 133 | 134 | } 135 | } 136 | 137 | 138 | /** 139 | * @method persistent 140 | * check auth from driver 141 | */ 142 | public function persistent(){ 143 | 144 | //get model 145 | $model=$this->model; 146 | 147 | //get query for auth id 148 | $persistentQuery=$model::where(function($query) { 149 | 150 | $query->where($this->config->getTokenField(),'=',$this->config->getTokenPersistent()); 151 | 152 | })->get(); 153 | 154 | if(!isset($persistentQuery['error'])){ 155 | 156 | //persistent data 157 | $persistentData=$persistentQuery['results'][0]; 158 | 159 | //call check method 160 | $this->check(); 161 | 162 | //if query is null 163 | if($this->config->query===null){ 164 | 165 | //set credentials 166 | $attemptCredentials=[]; 167 | 168 | //config credentials key 169 | foreach ($this->config->getCredentialsKey() as $credent){ 170 | 171 | //set key credentials from config/auth 172 | $attemptCredentials[$credent]=$persistentData[$credent]; 173 | } 174 | 175 | //set config persistent get token field from driver 176 | $this->config->persistent=$persistentData[$this->config->getTokenField()]; 177 | 178 | //set new auth credentials attempt 179 | $this->config->getAuthDriverModel($attemptCredentials,'attempt'); 180 | } 181 | } 182 | 183 | 184 | } 185 | 186 | 187 | 188 | 189 | } 190 | -------------------------------------------------------------------------------- /src/store/services/pushNotifications.php: -------------------------------------------------------------------------------- 1 | $data['mtitle'], 33 | 'message' => $data['mdesc'], 34 | 'subtitle' => '', 35 | 'tickerText' => '', 36 | 'msgcnt' => 1, 37 | 'vibrate' => 1 38 | ); 39 | 40 | $headers = array( 41 | 'Authorization: key=' .self::$API_ACCESS_KEY, 42 | 'Content-Type: application/json' 43 | ); 44 | 45 | $fields = array( 46 | 'registration_ids' => array($reg_id), 47 | 'data' => $message, 48 | ); 49 | 50 | return $this->useCurl($url, $headers, json_encode($fields)); 51 | } 52 | 53 | // Sends Push's toast notification for Windows Phone 8 users 54 | public function WP($data, $uri) { 55 | $delay = 2; 56 | $msg = "" . 57 | "