synapsestudios / synapse-base Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED
License: MIT License
DEPRECATED
License: MIT License
There is currently no readable way of creating requests containing files. We should add a createUploadRequest method to ControllerTestCase.
Additionally, the current createJsonRequest does not allow specifying cookie or server params. Might want to update that while we're at it.
TestCase::mockMethod
exists, and takes the following parameters:
$this->mocks
)returnCallback
This will transform:
$this->mocks['roleService']->expects($this->any())
->method('addRoleForUser')
->will($this->returnCallback(function ($user, $role) {
// Code here
}));
Into this:
$this->mockMethod('roleService', 'addRoleForUser', function ($user, $role) {
// Code here
});
TestCase
sql
method name is changed to createSql
.UserController allows any user to make a get request with an ID and get that user's email. Instead, the URI should just be /user and it should return data for the logged in user.
This is an exploratory, "for discussion" issue. The vision for why this may be a good idea can be summed up in a list of pros and cons.
Pros:
master
could use MapperAbstraction
v1.0, but the Project could separately require MapperAbstraction
v1.1 and the latest Synapse Base.)Cons:
findById()
to explicitly prefix the table name when using JOINs.id
columns.When using a JOIN on two tables that have id
columns, using findById
can cause errors when trying to look up records by ID. This can be fixed by overriding findById
and specifying the table prefix manually. However, since the mapper is aware of the table name already, I don't see a reason it can't add this to the queries automatically. It shouldn't break any existing queries, and it may prevent unexpected behavior.
route:list
exist
When a request violates the access rules (set in the service provider), an AccessDeniedHttpException
is thrown and the request is cancelled. This should return some kind of 403 response instead, maybe with some kind of message.
EncryptionService
class and tests will be available in synapse-baseEncryptedMapper
class and tests will be available in synapse-baseKeyManagement
namespace classes will be ported into synapse-baseAwsKeyManagementService
and the way AWS credentials are handled. Consider porting the AwsCredentialsService
that will check the env for aws credentials. Also consider updating the credentials service to use the Request object instead of the $_SERVER super global.Synapse\Work\AbstractConsoleWork has a call to a protected property on line 39. Trying to execute a class that extends AbstractConsoleWork causes PHP Fatal error: Call to protected method Synapse\Command\CommandProxy::execute() from context 'Synapse\Work\AbstractConsoleWork' in /vagrant/vendor/synapsestudios/synapse-base/src/Synapse/Work/AbstractConsoleWork.php on line 39
It should be calling run
here instead.
Currently, our CORS service injects 2 Access-Control-Allow-Methods
headers if there are multiple methods for an endpoint. Hipache inconveniently throws one of them away.
Add a CorsServiceProvider based on the current package, but where it adds the above header, just implode the allowed methods with a comma.
Especially for foreign key issues, the error is next to useless.
The sql() method instantiates a Zend\Db\Sql\Sql object. For testability, perhaps use an inject factory class instead with a getSqlObject method on it.
While it's true we'll only be moving the instantiation from the mapper to the factory, the factory will be very simple and won't need testing, whereas mappers are more complicated
I am receiving an error that states Fatal Error (E_ERROR): Call to undefined method Symfony\Component\Validator\ExecutionContext::getValidator() {"file":"/vagrant/vendor/symfony/validator/Symfony/Component/Validator/Constraints/CollectionValidator.php","line":53} []
This may be due to inconsistencies in the way that the different Symfony components are versioned in composer.json.
Arr::diff
method which accepts two arrays and diffs them multidimensionally.Changelog should reflect versions past 0.2.6
users.created
is an auto-updated datetime.user_tokens.created
is an auto-updated datetime.emails.created
is an auto-updated datetime.emails.updated
is an auto-updated datetime.We need a way to pass options to the OAuth server in order to control how long the access/refresh tokens have until they expire. Right now it is hardcoded in the bshaffer OAuth module as 3hrs/1wk respectively.
This wasn't working on another project. The fix specified below did the trick.
$charset = $app['config']->load('db')['charset'];
$app['db']->query("set names {$charset}", DbAdapter::QUERY_MODE_EXECUTE);
$app['db']->query("set character_set_client={$charset}", DbAdapter::QUERY_MODE_EXECUTE);
$app['db']->query("set character_set_connection={$charset}", DbAdapter::QUERY_MODE_EXECUTE);
$app['db']->query("set character_set_results={$charset}", DbAdapter::QUERY_MODE_EXECUTE);
$app['db']->query("set character_set_server={$charset}", DbAdapter::QUERY_MODE_EXECUTE);
Applications need a way to upload, save, and retrieve files
use [trait]
code from mappersmaster
, major version should be bumped to 2. Dependents must remove use [mapper trait]
code from mappers.E.g. the getter for address_2 should be getAddress2.
\Synapse\Validation\NewConstraints\*
\Synapse\Validator\Constraints\*
classes exist in above namespace with constant messages.\Synapse\Validator\Constraints\*
classes marked as deprecated via docblock, with the explanation that upon the next major revision to synapse-base, NewConstraints
will become Constraints
and the legacy Constraints
classes would go away.NewConstraints
copies of all synapse-base constraints with constant-y validation messagescreateFromArray()
method will use the entity returned from the mapper's getPrototype()
method instead of EmailEntity
enqueueSendEmailJob()
will require AbstractEntity
instead of EmailEntity
FinderTrait::getQueryResultCount
. It literally does the SELECT... and then does a separate SELECT count(*)
. This is way deoptimized.Currently GenerateInstallCommand creates files by using the >
operator to redirect the output of mysqldump to a file. Doing so does not ensure that the file will have the desired encoding. We should instead use the option --result-file=filename.sql
to ensure that the file has the correct encoding.
http://makandracards.com/makandra/595-dumping-and-importing-from-to-mysql-in-an-utf-8-safe-way
http://nathan.rambeck.org/blog/1-preventing-encoding-issues-mysqldump
token
and userId
methods that return the associated data.In the FinderTrait's addWheres() function, if the operator is either IS
or IS NOT
it automatically creates IsNull or IsNotNull predicates, assuming that the user wants to check for null.
IS
and IS NOT
can also be used to check boolean values.
https://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html#operator_is
https://github.com/synapsestudios/synapse-base/blob/master/src/Synapse/Mapper/FinderTrait.php#L298
Related resource URLs in API responses.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.